@metamask/institutional-wallet-snap 0.2.8
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/CHANGELOG.md +17 -0
- package/README.md +3 -0
- package/dist/bundle.js +1 -0
- package/dist/preinstalled-snap.json +1 -0
- package/images/bitgo.svg +12 -0
- package/images/cactus.svg +11 -0
- package/images/fireblocks.svg +3 -0
- package/images/gk8.svg +20 -0
- package/images/icon.svg +1 -0
- package/images/mpcvault.svg +3 -0
- package/images/neptune.svg +14 -0
- package/images/safe.svg +11 -0
- package/images/zodia.svg +1 -0
- package/package.json +92 -0
- package/snap.manifest.json +82 -0
package/dist/bundle.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var t={7967:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BaseTransaction=void 0;const n=r(9226),i=r(5372),o=r(636),s=r(8284);e.BaseTransaction=class{constructor(t,e){this.cache={hash:void 0,dataFee:void 0},this.activeCapabilities=[],this.DEFAULT_CHAIN=n.Chain.Mainnet,this.DEFAULT_HARDFORK=n.Hardfork.Merge;const{nonce:r,gasLimit:o,to:a,value:u,data:h,v:c,r:f,s:l,type:d}=t;this._type=Number((0,i.bufferToBigInt)((0,i.toBuffer)(d))),this.txOptions=e;const p=(0,i.toBuffer)(""===a?"0x":a),m=(0,i.toBuffer)(""===c?"0x":c),g=(0,i.toBuffer)(""===f?"0x":f),b=(0,i.toBuffer)(""===l?"0x":l);this.nonce=(0,i.bufferToBigInt)((0,i.toBuffer)(""===r?"0x":r)),this.gasLimit=(0,i.bufferToBigInt)((0,i.toBuffer)(""===o?"0x":o)),this.to=p.length>0?new i.Address(p):void 0,this.value=(0,i.bufferToBigInt)((0,i.toBuffer)(""===u?"0x":u)),this.data=(0,i.toBuffer)(""===h?"0x":h),this.v=m.length>0?(0,i.bufferToBigInt)(m):void 0,this.r=g.length>0?(0,i.bufferToBigInt)(g):void 0,this.s=b.length>0?(0,i.bufferToBigInt)(b):void 0,this._validateCannotExceedMaxInteger({value:this.value,r:this.r,s:this.s}),this._validateCannotExceedMaxInteger({gasLimit:this.gasLimit},64),this._validateCannotExceedMaxInteger({nonce:this.nonce},64,!0);const y=void 0===this.to||null===this.to,v=e.allowUnlimitedInitCodeSize??!1,w=e.common??this._getCommon();y&&w.isActivatedEIP(3860)&&!1===v&&(0,s.checkMaxInitCodeSize)(w,this.data.length)}get type(){return this._type}supports(t){return this.activeCapabilities.includes(t)}validate(t=!1){const e=[];return this.getBaseFee()>this.gasLimit&&e.push(`gasLimit is too low. given ${this.gasLimit}, need at least ${this.getBaseFee()}`),this.isSigned()&&!this.verifySignature()&&e.push("Invalid Signature"),t?e:0===e.length}_validateYParity(){const{v:t}=this;if(void 0!==t&&t!==BigInt(0)&&t!==BigInt(1)){const t=this._errorMsg("The y-parity of the transaction should either be 0 or 1");throw new Error(t)}}_validateHighS(){const{s:t}=this;if(this.common.gteHardfork("homestead")&&void 0!==t&&t>i.SECP256K1_ORDER_DIV_2){const t=this._errorMsg("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid");throw new Error(t)}}getBaseFee(){const t=this.common.param("gasPrices","tx");let e=this.getDataFee();if(t&&(e+=t),this.common.gteHardfork("homestead")&&this.toCreationAddress()){const t=this.common.param("gasPrices","txCreation");t&&(e+=t)}return e}getDataFee(){const t=this.common.param("gasPrices","txDataZero"),e=this.common.param("gasPrices","txDataNonZero");let r=BigInt(0);for(let n=0;n<this.data.length;n++)0===this.data[n]?r+=t:r+=e;if((void 0===this.to||null===this.to)&&this.common.isActivatedEIP(3860)){const t=BigInt(Math.ceil(this.data.length/32));r+=this.common.param("gasPrices","initCodeWordCost")*t}return r}toCreationAddress(){return void 0===this.to||0===this.to.buf.length}isSigned(){const{v:t,r:e,s:r}=this;return void 0!==t&&void 0!==e&&void 0!==r}verifySignature(){try{const t=this.getSenderPublicKey();return 0!==(0,i.unpadBuffer)(t).length}catch(t){return!1}}getSenderAddress(){return new i.Address((0,i.publicToAddress)(this.getSenderPublicKey()))}sign(t){if(32!==t.length){const t=this._errorMsg("Private key must be 32 bytes in length.");throw new Error(t)}let e=!1;0===this.type&&this.common.gteHardfork("spuriousDragon")&&!this.supports(o.Capability.EIP155ReplayProtection)&&(this.activeCapabilities.push(o.Capability.EIP155ReplayProtection),e=!0);const r=this.getMessageToSign(!0),{v:n,r:s,s:a}=(0,i.ecsign)(r,t),u=this._processSignature(n,s,a);if(e){const t=this.activeCapabilities.indexOf(o.Capability.EIP155ReplayProtection);t>-1&&this.activeCapabilities.splice(t,1)}return u}_getCommon(t,e){if(void 0!==e){const r=(0,i.bufferToBigInt)((0,i.toBuffer)(e));if(t){if(t.chainId()!==r){const t=this._errorMsg("The chain ID does not match the chain ID of Common");throw new Error(t)}return t.copy()}return n.Common.isSupportedChainId(r)?new n.Common({chain:r,hardfork:this.DEFAULT_HARDFORK}):n.Common.custom({name:"custom-chain",networkId:r,chainId:r},{baseChain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})}return t?.copy()??new n.Common({chain:this.DEFAULT_CHAIN,hardfork:this.DEFAULT_HARDFORK})}_validateCannotExceedMaxInteger(t,e=256,r=!1){for(const[n,o]of Object.entries(t))switch(e){case 64:if(r){if(void 0!==o&&o>=i.MAX_UINT64){const t=this._errorMsg(`${n} cannot equal or exceed MAX_UINT64 (2^64-1), given ${o}`);throw new Error(t)}}else if(void 0!==o&&o>i.MAX_UINT64){const t=this._errorMsg(`${n} cannot exceed MAX_UINT64 (2^64-1), given ${o}`);throw new Error(t)}break;case 256:if(r){if(void 0!==o&&o>=i.MAX_INTEGER){const t=this._errorMsg(`${n} cannot equal or exceed MAX_INTEGER (2^256-1), given ${o}`);throw new Error(t)}}else if(void 0!==o&&o>i.MAX_INTEGER){const t=this._errorMsg(`${n} cannot exceed MAX_INTEGER (2^256-1), given ${o}`);throw new Error(t)}break;default:{const t=this._errorMsg("unimplemented bits value");throw new Error(t)}}}static _validateNotArray(t){const e=["nonce","gasPrice","gasLimit","to","value","data","v","r","s","type","baseFee","maxFeePerGas","chainId"];for(const[r,n]of Object.entries(t))if(e.includes(r)&&Array.isArray(n))throw new Error(`${r} cannot be an array`)}_getSharedErrorPostfix(){let t="";try{t=this.isSigned()?(0,i.bufferToHex)(this.hash()):"not available (unsigned)"}catch(e){t="error"}let e="";try{e=this.isSigned().toString()}catch(e){t="error"}let r="";try{r=this.common.hardfork()}catch(t){r="error"}let n=`tx type=${this.type} hash=${t} nonce=${this.nonce} value=${this.value} `;return n+=`signed=${e} hf=${r}`,n}}},5716:(t,e,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.FeeMarketEIP1559Transaction=void 0;const i=r(2321),o=r(5372),s=r(1115),a=r(7967),u=r(8284),h=n.from(2..toString(16).padStart(2,"0"),"hex");class c extends a.BaseTransaction{constructor(t,e={}){super({...t,type:2},e),this.DEFAULT_HARDFORK="london";const{chainId:r,accessList:n,maxFeePerGas:i,maxPriorityFeePerGas:s}=t;if(this.common=this._getCommon(e.common,r),this.chainId=this.common.chainId(),!1===this.common.isActivatedEIP(1559))throw new Error("EIP-1559 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([1559,2718,2930]);const h=u.AccessLists.getAccessListData(n??[]);if(this.accessList=h.accessList,this.AccessListJSON=h.AccessListJSON,u.AccessLists.verifyAccessList(this.accessList),this.maxFeePerGas=(0,o.bufferToBigInt)((0,o.toBuffer)(""===i?"0x":i)),this.maxPriorityFeePerGas=(0,o.bufferToBigInt)((0,o.toBuffer)(""===s?"0x":s)),this._validateCannotExceedMaxInteger({maxFeePerGas:this.maxFeePerGas,maxPriorityFeePerGas:this.maxPriorityFeePerGas}),a.BaseTransaction._validateNotArray(t),this.gasLimit*this.maxFeePerGas>o.MAX_INTEGER){const t=this._errorMsg("gasLimit * maxFeePerGas cannot exceed MAX_INTEGER (2^256-1)");throw new Error(t)}if(this.maxFeePerGas<this.maxPriorityFeePerGas){const t=this._errorMsg("maxFeePerGas cannot be less than maxPriorityFeePerGas (The total must be the larger of the two)");throw new Error(t)}this._validateYParity(),this._validateHighS();(e?.freeze??!0)&&Object.freeze(this)}static fromTxData(t,e={}){return new c(t,e)}static fromSerializedTx(t,e={}){if(!t.slice(0,1).equals(h))throw new Error(`Invalid serialized tx input: not an EIP-1559 transaction (wrong tx type, expected: 2, received: ${t.slice(0,1).toString("hex")}`);const r=(0,o.arrToBufArr)(i.RLP.decode(t.slice(1)));if(!Array.isArray(r))throw new Error("Invalid serialized tx input: must be array");return c.fromValuesArray(r,e)}static fromValuesArray(t,e={}){if(9!==t.length&&12!==t.length)throw new Error("Invalid EIP-1559 transaction. Only expecting 9 values (for unsigned tx) or 12 values (for signed tx).");const[r,n,i,s,a,u,h,f,l,d,p,m]=t;return this._validateNotArray({chainId:r,v:d}),(0,o.validateNoLeadingZeroes)({nonce:n,maxPriorityFeePerGas:i,maxFeePerGas:s,gasLimit:a,value:h,v:d,r:p,s:m}),new c({chainId:(0,o.bufferToBigInt)(r),nonce:n,maxPriorityFeePerGas:i,maxFeePerGas:s,gasLimit:a,to:u,value:h,data:f,accessList:l??[],v:void 0!==d?(0,o.bufferToBigInt)(d):void 0,r:p,s:m},e)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let t=super.getDataFee();return t+=BigInt(u.AccessLists.getDataFeeEIP2930(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:t,hardfork:this.common.hardfork()}),t}getUpfrontCost(t=BigInt(0)){const e=this.maxPriorityFeePerGas,r=this.maxFeePerGas-t,n=(e<r?e:r)+t;return this.gasLimit*n+this.value}raw(){return[(0,o.bigIntToUnpaddedBuffer)(this.chainId),(0,o.bigIntToUnpaddedBuffer)(this.nonce),(0,o.bigIntToUnpaddedBuffer)(this.maxPriorityFeePerGas),(0,o.bigIntToUnpaddedBuffer)(this.maxFeePerGas),(0,o.bigIntToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:n.from([]),(0,o.bigIntToUnpaddedBuffer)(this.value),this.data,this.accessList,void 0!==this.v?(0,o.bigIntToUnpaddedBuffer)(this.v):n.from([]),void 0!==this.r?(0,o.bigIntToUnpaddedBuffer)(this.r):n.from([]),void 0!==this.s?(0,o.bigIntToUnpaddedBuffer)(this.s):n.from([])]}serialize(){const t=this.raw();return n.concat([h,n.from(i.RLP.encode((0,o.bufArrToArr)(t)))])}getMessageToSign(t=!0){const e=this.raw().slice(0,9),r=n.concat([h,n.from(i.RLP.encode((0,o.bufArrToArr)(e)))]);return t?n.from((0,s.keccak256)(r)):r}hash(){if(!this.isSigned()){const t=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(t)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=n.from((0,s.keccak256)(this.serialize()))),this.cache.hash):n.from((0,s.keccak256)(this.serialize()))}getMessageToVerifySignature(){return this.getMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const t=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(t)}const t=this.getMessageToVerifySignature(),{v:e,r,s:n}=this;this._validateHighS();try{return(0,o.ecrecover)(t,e+BigInt(27),(0,o.bigIntToUnpaddedBuffer)(r),(0,o.bigIntToUnpaddedBuffer)(n))}catch(t){const e=this._errorMsg("Invalid Signature");throw new Error(e)}}_processSignature(t,e,r){const n={...this.txOptions,common:this.common};return c.fromTxData({chainId:this.chainId,nonce:this.nonce,maxPriorityFeePerGas:this.maxPriorityFeePerGas,maxFeePerGas:this.maxFeePerGas,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:t-BigInt(27),r:(0,o.bufferToBigInt)(e),s:(0,o.bufferToBigInt)(r)},n)}toJSON(){const t=u.AccessLists.getAccessListJSON(this.accessList);return{chainId:(0,o.bigIntToHex)(this.chainId),nonce:(0,o.bigIntToHex)(this.nonce),maxPriorityFeePerGas:(0,o.bigIntToHex)(this.maxPriorityFeePerGas),maxFeePerGas:(0,o.bigIntToHex)(this.maxFeePerGas),gasLimit:(0,o.bigIntToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0,o.bigIntToHex)(this.value),data:"0x"+this.data.toString("hex"),accessList:t,v:void 0!==this.v?(0,o.bigIntToHex)(this.v):void 0,r:void 0!==this.r?(0,o.bigIntToHex)(this.r):void 0,s:void 0!==this.s?(0,o.bigIntToHex)(this.s):void 0}}errorStr(){let t=this._getSharedErrorPostfix();return t+=` maxFeePerGas=${this.maxFeePerGas} maxPriorityFeePerGas=${this.maxPriorityFeePerGas}`,t}_errorMsg(t){return`${t} (${this.errorStr()})`}}e.FeeMarketEIP1559Transaction=c},9733:(t,e,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.AccessListEIP2930Transaction=void 0;const i=r(2321),o=r(5372),s=r(1115),a=r(7967),u=r(8284),h=n.from(1..toString(16).padStart(2,"0"),"hex");class c extends a.BaseTransaction{constructor(t,e={}){super({...t,type:1},e),this.DEFAULT_HARDFORK="berlin";const{chainId:r,accessList:n,gasPrice:i}=t;if(this.common=this._getCommon(e.common,r),this.chainId=this.common.chainId(),!this.common.isActivatedEIP(2930))throw new Error("EIP-2930 not enabled on Common");this.activeCapabilities=this.activeCapabilities.concat([2718,2930]);const s=u.AccessLists.getAccessListData(n??[]);if(this.accessList=s.accessList,this.AccessListJSON=s.AccessListJSON,u.AccessLists.verifyAccessList(this.accessList),this.gasPrice=(0,o.bufferToBigInt)((0,o.toBuffer)(""===i?"0x":i)),this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),a.BaseTransaction._validateNotArray(t),this.gasPrice*this.gasLimit>o.MAX_INTEGER){const t=this._errorMsg("gasLimit * gasPrice cannot exceed MAX_INTEGER");throw new Error(t)}this._validateYParity(),this._validateHighS();(e?.freeze??!0)&&Object.freeze(this)}static fromTxData(t,e={}){return new c(t,e)}static fromSerializedTx(t,e={}){if(!t.slice(0,1).equals(h))throw new Error(`Invalid serialized tx input: not an EIP-2930 transaction (wrong tx type, expected: 1, received: ${t.slice(0,1).toString("hex")}`);const r=(0,o.arrToBufArr)(i.RLP.decode(Uint8Array.from(t.slice(1))));if(!Array.isArray(r))throw new Error("Invalid serialized tx input: must be array");return c.fromValuesArray(r,e)}static fromValuesArray(t,e={}){if(8!==t.length&&11!==t.length)throw new Error("Invalid EIP-2930 transaction. Only expecting 8 values (for unsigned tx) or 11 values (for signed tx).");const[r,n,i,s,a,u,h,f,l,d,p]=t;this._validateNotArray({chainId:r,v:l}),(0,o.validateNoLeadingZeroes)({nonce:n,gasPrice:i,gasLimit:s,value:u,v:l,r:d,s:p});return new c({chainId:(0,o.bufferToBigInt)(r),nonce:n,gasPrice:i,gasLimit:s,to:a,value:u,data:h,accessList:f??[],v:void 0!==l?(0,o.bufferToBigInt)(l):void 0,r:d,s:p},e)}getDataFee(){if(this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork())return this.cache.dataFee.value;let t=super.getDataFee();return t+=BigInt(u.AccessLists.getDataFeeEIP2930(this.accessList,this.common)),Object.isFrozen(this)&&(this.cache.dataFee={value:t,hardfork:this.common.hardfork()}),t}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}raw(){return[(0,o.bigIntToUnpaddedBuffer)(this.chainId),(0,o.bigIntToUnpaddedBuffer)(this.nonce),(0,o.bigIntToUnpaddedBuffer)(this.gasPrice),(0,o.bigIntToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:n.from([]),(0,o.bigIntToUnpaddedBuffer)(this.value),this.data,this.accessList,void 0!==this.v?(0,o.bigIntToUnpaddedBuffer)(this.v):n.from([]),void 0!==this.r?(0,o.bigIntToUnpaddedBuffer)(this.r):n.from([]),void 0!==this.s?(0,o.bigIntToUnpaddedBuffer)(this.s):n.from([])]}serialize(){const t=this.raw();return n.concat([h,n.from(i.RLP.encode((0,o.bufArrToArr)(t)))])}getMessageToSign(t=!0){const e=this.raw().slice(0,8),r=n.concat([h,n.from(i.RLP.encode((0,o.bufArrToArr)(e)))]);return t?n.from((0,s.keccak256)(r)):r}hash(){if(!this.isSigned()){const t=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(t)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=n.from((0,s.keccak256)(this.serialize()))),this.cache.hash):n.from((0,s.keccak256)(this.serialize()))}getMessageToVerifySignature(){return this.getMessageToSign()}getSenderPublicKey(){if(!this.isSigned()){const t=this._errorMsg("Cannot call this method if transaction is not signed");throw new Error(t)}const t=this.getMessageToVerifySignature(),{v:e,r,s:n}=this;this._validateHighS();try{return(0,o.ecrecover)(t,e+BigInt(27),(0,o.bigIntToUnpaddedBuffer)(r),(0,o.bigIntToUnpaddedBuffer)(n))}catch(t){const e=this._errorMsg("Invalid Signature");throw new Error(e)}}_processSignature(t,e,r){const n={...this.txOptions,common:this.common};return c.fromTxData({chainId:this.chainId,nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,accessList:this.accessList,v:t-BigInt(27),r:(0,o.bufferToBigInt)(e),s:(0,o.bufferToBigInt)(r)},n)}toJSON(){const t=u.AccessLists.getAccessListJSON(this.accessList);return{chainId:(0,o.bigIntToHex)(this.chainId),nonce:(0,o.bigIntToHex)(this.nonce),gasPrice:(0,o.bigIntToHex)(this.gasPrice),gasLimit:(0,o.bigIntToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0,o.bigIntToHex)(this.value),data:"0x"+this.data.toString("hex"),accessList:t,v:void 0!==this.v?(0,o.bigIntToHex)(this.v):void 0,r:void 0!==this.r?(0,o.bigIntToHex)(this.r):void 0,s:void 0!==this.s?(0,o.bigIntToHex)(this.s):void 0}}errorStr(){let t=this._getSharedErrorPostfix();return t+=` gasPrice=${this.gasPrice} accessListCount=${this.accessList?.length??0}`,t}_errorMsg(t){return`${t} (${this.errorStr()})`}}e.AccessListEIP2930Transaction=c},3217:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeTxParams=void 0;const n=r(5372);e.normalizeTxParams=t=>{const e=Object.assign({},t);return e.gasLimit=(0,n.toType)(e.gasLimit??e.gas,n.TypeOutput.BigInt),e.data=void 0===e.data?e.input:e.data,e.gasPrice=void 0!==e.gasPrice?BigInt(e.gasPrice):void 0,e.value=void 0!==e.value?BigInt(e.value):void 0,e.to=null!==e.to&&void 0!==e.to?(0,n.setLengthLeft)((0,n.toBuffer)(e.to),20):null,e.v="0x0"===e.v?"0x":e.v,e.r="0x0"===e.r?"0x":e.r,e.s="0x0"===e.s?"0x":e.s,"0x"!==e.v&&(e.v=(0,n.toType)(e.v,n.TypeOutput.BigInt)),e}},4670:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.TransactionFactory=e.Transaction=e.AccessListEIP2930Transaction=e.FeeMarketEIP1559Transaction=void 0;var o=r(5716);Object.defineProperty(e,"FeeMarketEIP1559Transaction",{enumerable:!0,get:function(){return o.FeeMarketEIP1559Transaction}});var s=r(9733);Object.defineProperty(e,"AccessListEIP2930Transaction",{enumerable:!0,get:function(){return s.AccessListEIP2930Transaction}});var a=r(1247);Object.defineProperty(e,"Transaction",{enumerable:!0,get:function(){return a.Transaction}});var u=r(921);Object.defineProperty(e,"TransactionFactory",{enumerable:!0,get:function(){return u.TransactionFactory}}),i(r(636),e)},1247:(t,e,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.Transaction=void 0;const i=r(2321),o=r(5372),s=r(1115),a=r(7967),u=r(636);function h(t,e){const r=Number(t),n=2*Number(e);return r===n+35||r===n+36}class c extends a.BaseTransaction{constructor(t,e={}){if(super({...t,type:0},e),this.common=this._validateTxV(this.v,e.common),this.gasPrice=(0,o.bufferToBigInt)((0,o.toBuffer)(""===t.gasPrice?"0x":t.gasPrice)),this.gasPrice*this.gasLimit>o.MAX_INTEGER){const t=this._errorMsg("gas limit * gasPrice cannot exceed MAX_INTEGER (2^256-1)");throw new Error(t)}this._validateCannotExceedMaxInteger({gasPrice:this.gasPrice}),a.BaseTransaction._validateNotArray(t),this.common.gteHardfork("spuriousDragon")&&(this.isSigned()?h(this.v,this.common.chainId())&&this.activeCapabilities.push(u.Capability.EIP155ReplayProtection):this.activeCapabilities.push(u.Capability.EIP155ReplayProtection));(e?.freeze??!0)&&Object.freeze(this)}static fromTxData(t,e={}){return new c(t,e)}static fromSerializedTx(t,e={}){const r=(0,o.arrToBufArr)(i.RLP.decode(Uint8Array.from(t)));if(!Array.isArray(r))throw new Error("Invalid serialized tx input. Must be array");return this.fromValuesArray(r,e)}static fromValuesArray(t,e={}){if(6!==t.length&&9!==t.length)throw new Error("Invalid transaction. Only expecting 6 values (for unsigned tx) or 9 values (for signed tx).");const[r,n,i,s,a,u,h,f,l]=t;return(0,o.validateNoLeadingZeroes)({nonce:r,gasPrice:n,gasLimit:i,value:a,v:h,r:f,s:l}),new c({nonce:r,gasPrice:n,gasLimit:i,to:s,value:a,data:u,v:h,r:f,s:l},e)}raw(){return[(0,o.bigIntToUnpaddedBuffer)(this.nonce),(0,o.bigIntToUnpaddedBuffer)(this.gasPrice),(0,o.bigIntToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:n.from([]),(0,o.bigIntToUnpaddedBuffer)(this.value),this.data,void 0!==this.v?(0,o.bigIntToUnpaddedBuffer)(this.v):n.from([]),void 0!==this.r?(0,o.bigIntToUnpaddedBuffer)(this.r):n.from([]),void 0!==this.s?(0,o.bigIntToUnpaddedBuffer)(this.s):n.from([])]}serialize(){return n.from(i.RLP.encode((0,o.bufArrToArr)(this.raw())))}_getMessageToSign(){const t=[(0,o.bigIntToUnpaddedBuffer)(this.nonce),(0,o.bigIntToUnpaddedBuffer)(this.gasPrice),(0,o.bigIntToUnpaddedBuffer)(this.gasLimit),void 0!==this.to?this.to.buf:n.from([]),(0,o.bigIntToUnpaddedBuffer)(this.value),this.data];return this.supports(u.Capability.EIP155ReplayProtection)&&(t.push((0,o.bigIntToUnpaddedBuffer)(this.common.chainId())),t.push((0,o.unpadBuffer)((0,o.toBuffer)(0))),t.push((0,o.unpadBuffer)((0,o.toBuffer)(0)))),t}getMessageToSign(t=!0){const e=this._getMessageToSign();return t?n.from((0,s.keccak256)(i.RLP.encode((0,o.bufArrToArr)(e)))):e}getDataFee(){return this.cache.dataFee&&this.cache.dataFee.hardfork===this.common.hardfork()?this.cache.dataFee.value:(Object.isFrozen(this)&&(this.cache.dataFee={value:super.getDataFee(),hardfork:this.common.hardfork()}),super.getDataFee())}getUpfrontCost(){return this.gasLimit*this.gasPrice+this.value}hash(){if(!this.isSigned()){const t=this._errorMsg("Cannot call hash method if transaction is not signed");throw new Error(t)}return Object.isFrozen(this)?(this.cache.hash||(this.cache.hash=n.from((0,s.keccak256)(i.RLP.encode((0,o.bufArrToArr)(this.raw()))))),this.cache.hash):n.from((0,s.keccak256)(i.RLP.encode((0,o.bufArrToArr)(this.raw()))))}getMessageToVerifySignature(){if(!this.isSigned()){const t=this._errorMsg("This transaction is not signed");throw new Error(t)}const t=this._getMessageToSign();return n.from((0,s.keccak256)(i.RLP.encode((0,o.bufArrToArr)(t))))}getSenderPublicKey(){const t=this.getMessageToVerifySignature(),{v:e,r,s:n}=this;this._validateHighS();try{return(0,o.ecrecover)(t,e,(0,o.bigIntToUnpaddedBuffer)(r),(0,o.bigIntToUnpaddedBuffer)(n),this.supports(u.Capability.EIP155ReplayProtection)?this.common.chainId():void 0)}catch(t){const e=this._errorMsg("Invalid Signature");throw new Error(e)}}_processSignature(t,e,r){this.supports(u.Capability.EIP155ReplayProtection)&&(t+=this.common.chainId()*BigInt(2)+BigInt(8));const n={...this.txOptions,common:this.common};return c.fromTxData({nonce:this.nonce,gasPrice:this.gasPrice,gasLimit:this.gasLimit,to:this.to,value:this.value,data:this.data,v:t,r:(0,o.bufferToBigInt)(e),s:(0,o.bufferToBigInt)(r)},n)}toJSON(){return{nonce:(0,o.bigIntToHex)(this.nonce),gasPrice:(0,o.bigIntToHex)(this.gasPrice),gasLimit:(0,o.bigIntToHex)(this.gasLimit),to:void 0!==this.to?this.to.toString():void 0,value:(0,o.bigIntToHex)(this.value),data:"0x"+this.data.toString("hex"),v:void 0!==this.v?(0,o.bigIntToHex)(this.v):void 0,r:void 0!==this.r?(0,o.bigIntToHex)(this.r):void 0,s:void 0!==this.s?(0,o.bigIntToHex)(this.s):void 0}}_validateTxV(t,e){let r;const n=void 0!==t?Number(t):void 0;if(void 0!==n&&n<37&&27!==n&&28!==n)throw new Error(`Legacy txs need either v = 27/28 or v >= 37 (EIP-155 replay protection), got v = ${n}`);if(void 0!==n&&0!==n&&(!e||e.gteHardfork("spuriousDragon"))&&27!==n&&28!==n)if(e){if(!h(BigInt(n),e.chainId()))throw new Error(`Incompatible EIP155-based V ${n} and chain id ${e.chainId()}. See the Common parameter of the Transaction constructor to set the chain id.`)}else{let t;t=(n-35)%2==0?35:36,r=BigInt(n-t)/BigInt(2)}return this._getCommon(e,r)}errorStr(){let t=this._getSharedErrorPostfix();return t+=` gasPrice=${this.gasPrice}`,t}_errorMsg(t){return`${t} (${this.errorStr()})`}}e.Transaction=c},921:(t,e,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.TransactionFactory=void 0;const i=r(5372),o=r(5716),s=r(9733),a=r(3217),u=r(1247);class h{constructor(){}static fromTxData(t,e={}){if("type"in t&&void 0!==t.type){const r=Number((0,i.bufferToBigInt)((0,i.toBuffer)(t.type)));if(0===r)return u.Transaction.fromTxData(t,e);if(1===r)return s.AccessListEIP2930Transaction.fromTxData(t,e);if(2===r)return o.FeeMarketEIP1559Transaction.fromTxData(t,e);throw new Error(`Tx instantiation with type ${r} not supported`)}return u.Transaction.fromTxData(t,e)}static fromSerializedData(t,e={}){if(!(t[0]<=127))return u.Transaction.fromSerializedTx(t,e);switch(t[0]){case 1:return s.AccessListEIP2930Transaction.fromSerializedTx(t,e);case 2:return o.FeeMarketEIP1559Transaction.fromSerializedTx(t,e);default:throw new Error(`TypedTransaction with ID ${t[0]} unknown`)}}static fromBlockBodyData(t,e={}){if(n.isBuffer(t))return this.fromSerializedData(t,e);if(Array.isArray(t))return u.Transaction.fromValuesArray(t,e);throw new Error("Cannot decode transaction: unknown type input")}static async fromEthersProvider(t,e,r){const n=(0,i.getProvider)(t),o=await(0,i.fetchFromProvider)(n,{method:"eth_getTransactionByHash",params:[e]});if(null===o)throw new Error("No data returned from provider");return h.fromRPCTx(o,r)}static async fromRPCTx(t,e={}){return h.fromTxData((0,a.normalizeTxParams)(t),e)}}e.TransactionFactory=h},636:(t,e)=>{"use strict";function r(t){if(0===t.length)return!0;const e=t[0];return!!Array.isArray(e)}Object.defineProperty(e,"__esModule",{value:!0}),e.isAccessList=e.isAccessListBuffer=e.Capability=void 0,function(t){t[t.EIP155ReplayProtection=155]="EIP155ReplayProtection",t[t.EIP1559FeeMarket=1559]="EIP1559FeeMarket",t[t.EIP2718TypedTransaction=2718]="EIP2718TypedTransaction",t[t.EIP2930AccessLists=2930]="EIP2930AccessLists"}(e.Capability||(e.Capability={})),e.isAccessListBuffer=r,e.isAccessList=function(t){return!r(t)}},8284:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AccessLists=e.checkMaxInitCodeSize=void 0;const n=r(5372),i=r(636);e.checkMaxInitCodeSize=function(t,e){const r=t.param("vm","maxInitCodeSize");if(r&&BigInt(e)>r)throw new Error(`the initcode size of this transaction is too large: it is ${e} while the max is ${t.param("vm","maxInitCodeSize")}`)};e.AccessLists=class{static getAccessListData(t){let e,r;if((0,i.isAccessList)(t)){e=t;const i=[];for(let e=0;e<t.length;e++){const r=t[e],o=(0,n.toBuffer)(r.address),s=[];for(let t=0;t<r.storageKeys.length;t++)s.push((0,n.toBuffer)(r.storageKeys[t]));i.push([o,s])}r=i}else{r=t??[];const i=[];for(let t=0;t<r.length;t++){const e=r[t],o=(0,n.bufferToHex)(e[0]),s=[];for(let t=0;t<e[1].length;t++)s.push((0,n.bufferToHex)(e[1][t]));const a={address:o,storageKeys:s};i.push(a)}e=i}return{AccessListJSON:e,accessList:r}}static verifyAccessList(t){for(let e=0;e<t.length;e++){const r=t[e],n=r[0],i=r[1];if(void 0!==r[2])throw new Error("Access list item cannot have 3 elements. It can only have an address, and an array of storage slots.");if(20!==n.length)throw new Error("Invalid EIP-2930 transaction: address length should be 20 bytes");for(let t=0;t<i.length;t++)if(32!==i[t].length)throw new Error("Invalid EIP-2930 transaction: storage slot length should be 32 bytes")}}static getAccessListJSON(t){const e=[];for(let r=0;r<t.length;r++){const i=t[r],o={address:"0x"+(0,n.setLengthLeft)(i[0],20).toString("hex"),storageKeys:[]},s=i[1];for(let t=0;t<s.length;t++){const e=s[t];o.storageKeys.push("0x"+(0,n.setLengthLeft)(e,32).toString("hex"))}e.push(o)}return e}static getDataFeeEIP2930(t,e){const r=e.param("gasPrices","accessListStorageKeyCost"),n=e.param("gasPrices","accessListAddressCost");let i=0;for(let e=0;e<t.length;e++){i+=t[e][1].length}return t.length*Number(n)+i*Number(r)}}},2674:(t,e,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.Common=void 0;const i=r(5372),o=r(7108),s=r(2699),a=r(346),u=r(318),h=r(4008),c=r(5669),f=r(7958),l=r(4394),d=r(2024),p=r(2267),m=r(3864);class g extends s.EventEmitter{constructor(t){super(),this._eips=[],this._customChains=t.customChains??[],this._chainParams=this.setChain(t.chain),this.DEFAULT_HARDFORK=this._chainParams.defaultHardfork??d.Hardfork.Merge,this.HARDFORK_CHANGES=this.hardforks().map((t=>[t.name,p.hardforks[t.name]])),this._hardfork=this.DEFAULT_HARDFORK,void 0!==t.hardfork&&this.setHardfork(t.hardfork),t.eips&&this.setEIPs(t.eips)}static custom(t,e={}){const r=e.baseChain??"mainnet",n={...g._getChainParams(r)};if(n.name="custom-chain","string"!=typeof t)return new g({chain:{...n,...t},...e});if(t===d.CustomChain.PolygonMainnet)return g.custom({name:d.CustomChain.PolygonMainnet,chainId:137,networkId:137},e);if(t===d.CustomChain.PolygonMumbai)return g.custom({name:d.CustomChain.PolygonMumbai,chainId:80001,networkId:80001},e);if(t===d.CustomChain.ArbitrumRinkebyTestnet)return g.custom({name:d.CustomChain.ArbitrumRinkebyTestnet,chainId:421611,networkId:421611},e);if(t===d.CustomChain.ArbitrumOne)return g.custom({name:d.CustomChain.ArbitrumOne,chainId:42161,networkId:42161},e);if(t===d.CustomChain.xDaiChain)return g.custom({name:d.CustomChain.xDaiChain,chainId:100,networkId:100},e);if(t===d.CustomChain.OptimisticKovan)return g.custom({name:d.CustomChain.OptimisticKovan,chainId:69,networkId:69},{hardfork:d.Hardfork.Berlin,...e});if(t===d.CustomChain.OptimisticEthereum)return g.custom({name:d.CustomChain.OptimisticEthereum,chainId:10,networkId:10},{hardfork:d.Hardfork.Berlin,...e});throw new Error(`Custom chain ${t} not supported`)}static fromGethGenesis(t,{chain:e,eips:r,genesisHash:n,hardfork:i,mergeForkIdPostMerge:o}){const s=(0,m.parseGethGenesis)(t,e,o),a=new g({chain:s.name??"custom",customChains:[s],eips:r,hardfork:i??s.hardfork});return void 0!==n&&a.setForkHashes(n),a}static isSupportedChainId(t){const e=this._getInitializedChains();return Boolean(e.names[t.toString()])}static _getChainParams(t,e){const r=this._getInitializedChains(e);if("number"==typeof t||"bigint"==typeof t){if(t=t.toString(),r.names[t]){return r[r.names[t]]}throw new Error(`Chain with ID ${t} not supported`)}if(void 0!==r[t])return r[t];throw new Error(`Chain with name ${t} not supported`)}setChain(t){if("number"==typeof t||"bigint"==typeof t||"string"==typeof t)this._chainParams=g._getChainParams(t,this._customChains);else{if("object"!=typeof t)throw new Error("Wrong input format");{if(this._customChains.length>0)throw new Error("Chain must be a string, number, or bigint when initialized with customChains passed in");const e=["networkId","genesis","hardforks","bootstrapNodes"];for(const r of e)if(!(r in t))throw new Error(`Missing required chain parameter: ${r}`);this._chainParams=t}}for(const t of this.hardforks())if(void 0===t.block)throw new Error("Hardfork cannot have undefined block number");return this._chainParams}setHardfork(t){let e=!1;for(const r of this.HARDFORK_CHANGES)r[0]===t&&(this._hardfork!==t&&(this._hardfork=t,this.emit("hardforkChanged",t)),e=!0);if(!e)throw new Error(`Hardfork with name ${t} not supported`)}getHardforkByBlockNumber(t,e,r){t=(0,i.toType)(t,i.TypeOutput.BigInt),e=(0,i.toType)(e,i.TypeOutput.BigInt),r=(0,i.toType)(r,i.TypeOutput.Number);const n=this.hardforks().filter((t=>null!==t.block||null!==t.ttd&&void 0!==t.ttd||void 0!==t.timestamp)),o=n.findIndex((t=>null!==t.ttd&&void 0!==t.ttd));if(n.slice(o+1).findIndex((t=>null!==t.ttd&&void 0!==t.ttd))>=0)throw Error("More than one merge hardforks found with ttd specified");let s=n.findIndex((e=>null!==e.block&&e.block>t||void 0!==r&&Number(e.timestamp)>r));if(-1===s)s=n.length;else if(0===s)throw Error("Must have at least one hardfork at block 0");if(void 0===r){s-=n.slice(0,s).reverse().findIndex((t=>null!==t.block||void 0!==t.ttd))}if(s-=1,null===n[s].block&&void 0===n[s].timestamp)(null==e||BigInt(n[s].ttd)>e)&&(s-=1);else if(o>=0&&null!=e){if(s>=o&&BigInt(n[o].ttd)>e)throw Error("Maximum HF determined by total difficulty is lower than the block number HF");if(s<o&&BigInt(n[o].ttd)<=e)throw Error("HF determined by block number is lower than the minimum total difficulty HF")}const a=s;for(;s<n.length-1&&(n[s].block===n[s+1].block&&n[s].timestamp===n[s+1].timestamp);s++);if(r){if(n.slice(0,a).reduce(((t,e)=>Math.max(Number(e.timestamp??"0"),t)),0)>r)throw Error("Maximum HF determined by timestamp is lower than the block number/ttd HF");if(n.slice(s+1).reduce(((t,e)=>Math.min(Number(e.timestamp??r),t)),r)<r)throw Error("Maximum HF determined by block number/ttd is lower than timestamp HF")}return n[s].name}setHardforkByBlockNumber(t,e,r){const n=this.getHardforkByBlockNumber(t,e,r);return this.setHardfork(n),n}_getHardfork(t){const e=this.hardforks();for(const r of e)if(r.name===t)return r;return null}setEIPs(t=[]){for(const e of t){if(!(e in l.EIPs))throw new Error(`${e} not supported`);const r=this.gteHardfork(l.EIPs[e].minimumHardfork);if(!r)throw new Error(`${e} cannot be activated on hardfork ${this.hardfork()}, minimumHardfork: ${r}`);if(void 0!==l.EIPs[e].requiredEIPs)for(const r of l.EIPs[e].requiredEIPs)if(!t.includes(r)&&!this.isActivatedEIP(r))throw new Error(`${e} requires EIP ${r}, but is not included in the EIP list`)}this._eips=t}param(t,e){let r;for(const n of this._eips)if(r=this.paramByEIP(t,e,n),void 0!==r)return r;return this.paramByHardfork(t,e,this._hardfork)}paramByHardfork(t,e,r){let n=null;for(const i of this.HARDFORK_CHANGES){if("eips"in i[1]){const r=i[1].eips;for(const i of r){const r=this.paramByEIP(t,e,i);n="bigint"==typeof r?r:n}}else{if(void 0===i[1][t])throw new Error(`Topic ${t} not defined`);void 0!==i[1][t][e]&&(n=i[1][t][e].v)}if(i[0]===r)break}return BigInt(n??0)}paramByEIP(t,e,r){if(!(r in l.EIPs))throw new Error(`${r} not supported`);const n=l.EIPs[r];if(!(t in n))throw new Error(`Topic ${t} not defined`);if(void 0===n[t][e])return;const i=n[t][e].v;return BigInt(i)}paramByBlock(t,e,r,n,i){const o=this.getHardforkByBlockNumber(r,n,i);return this.paramByHardfork(t,e,o)}isActivatedEIP(t){if(this.eips().includes(t))return!0;for(const e of this.HARDFORK_CHANGES){const r=e[1];if(this.gteHardfork(r.name)&&"eips"in r&&r.eips.includes(t))return!0}return!1}hardforkIsActiveOnBlock(t,e){e=(0,i.toType)(e,i.TypeOutput.BigInt),t=t??this._hardfork;const r=this.hardforkBlock(t);return"bigint"==typeof r&&r!==BigInt(0)&&e>=r}activeOnBlock(t){return this.hardforkIsActiveOnBlock(null,t)}hardforkGteHardfork(t,e){t=t??this._hardfork;const r=this.hardforks();let n=-1,i=-1,o=0;for(const s of r)s.name===t&&(n=o),s.name===e&&(i=o),o+=1;return n>=i&&-1!==i}gteHardfork(t){return this.hardforkGteHardfork(null,t)}hardforkBlock(t){t=t??this._hardfork;const e=this._getHardfork(t)?.block;return null==e?null:BigInt(e)}hardforkTimestamp(t){t=t??this._hardfork;const e=this._getHardfork(t)?.timestamp;return null==e?null:BigInt(e)}eipBlock(t){for(const e of this.HARDFORK_CHANGES){const r=e[1];if("eips"in r&&r.eips.includes(t))return this.hardforkBlock(e[0])}return null}hardforkTTD(t){t=t??this._hardfork;const e=this._getHardfork(t)?.ttd;return null==e?null:BigInt(e)}isHardforkBlock(t,e){t=(0,i.toType)(t,i.TypeOutput.BigInt),e=e??this._hardfork;const r=this.hardforkBlock(e);return"bigint"==typeof r&&r!==BigInt(0)&&r===t}nextHardforkBlockOrTimestamp(t){t=t??this._hardfork;const e=this.hardforks();let r=e.findIndex((e=>e.name===t));if(t===d.Hardfork.Merge&&(r-=1),r<0)return null;let n=e[r].timestamp??e[r].block;n=null!=n?Number(n):null;const i=e.slice(r+1).find((t=>{let e=t.timestamp??t.block;return e=null!=e?Number(e):null,t.name!==d.Hardfork.Merge&&null!=e&&e!==n}));if(void 0===i)return null;const o=i.timestamp??i.block;return null==o?null:BigInt(o)}nextHardforkBlock(t){t=t??this._hardfork;let e=this.hardforkBlock(t);if(null===e&&t===d.Hardfork.Merge){const t=this.hardforks(),r=t.findIndex((t=>null!==t.ttd&&void 0!==t.ttd));if(r<0)throw Error("Merge hardfork should have been found");e=this.hardforkBlock(t[r-1].name)}if(null===e)return null;return this.hardforks().reduce(((t,r)=>{const n=BigInt(null===r.block||void 0!==r.ttd&&null!==r.ttd?0:r.block);return n>e&&null===t?n:t}),null)}isNextHardforkBlock(t,e){t=(0,i.toType)(t,i.TypeOutput.BigInt),e=e??this._hardfork;const r=this.nextHardforkBlock(e);return null!==r&&r===t}_calcForkHash(t,e){let r=n.alloc(0),s=0;for(const e of this.hardforks()){const{block:i,timestamp:o,name:a}=e;let u=o??i;if(u=null!==u?Number(u):null,"number"==typeof u&&0!==u&&u!==s&&a!==d.Hardfork.Merge){const t=n.from(u.toString(16).padStart(16,"0"),"hex");r=n.concat([r,t]),s=u}if(e.name===t)break}const a=n.concat([e,r]);return`0x${(0,i.intToBuffer)((0,o.buf)(a)>>>0).toString("hex")}`}forkHash(t,e){t=t??this._hardfork;const r=this._getHardfork(t);if(null===r||null===r?.block&&void 0===r?.timestamp&&void 0===r?.ttd){throw new Error("No fork hash calculation possible for future hardfork")}if(null!=r?.forkHash)return r.forkHash;if(!e)throw new Error("genesisHash required for forkHash calculation");return this._calcForkHash(t,e)}hardforkForForkHash(t){const e=this.hardforks().filter((e=>e.forkHash===t));return e.length>=1?e[e.length-1]:null}setForkHashes(t){for(const e of this.hardforks()){const r=e.timestamp??e.block;null!==e.forkHash&&void 0!==e.forkHash||null==r&&void 0===e.ttd||(e.forkHash=this.forkHash(e.name,t))}}genesis(){return this._chainParams.genesis}hardforks(){return this._chainParams.hardforks}bootstrapNodes(){return this._chainParams.bootstrapNodes}dnsNetworks(){return this._chainParams.dnsNetworks}hardfork(){return this._hardfork}chainId(){return BigInt(this._chainParams.chainId)}chainName(){return this._chainParams.name}networkId(){return BigInt(this._chainParams.networkId)}eips(){return this._eips}consensusType(){const t=this.hardfork();let e;for(const r of this.HARDFORK_CHANGES)if("consensus"in r[1]&&(e=r[1].consensus.type),r[0]===t)break;return e??this._chainParams.consensus.type}consensusAlgorithm(){const t=this.hardfork();let e;for(const r of this.HARDFORK_CHANGES)if("consensus"in r[1]&&(e=r[1].consensus.algorithm),r[0]===t)break;return e??this._chainParams.consensus.algorithm}consensusConfig(){const t=this.hardfork();let e;for(const r of this.HARDFORK_CHANGES)if("consensus"in r[1]&&(e=r[1].consensus[r[1].consensus.algorithm]),r[0]===t)break;return e??this._chainParams.consensus[this.consensusAlgorithm()]??{}}copy(){const t=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return t.removeAllListeners(),t}static _getInitializedChains(t){const e={};for(const[t,r]of Object.entries(d.Chain))e[r]=t.toLowerCase();const r={mainnet:u,ropsten:c,rinkeby:h,goerli:a,sepolia:f};if(t)for(const n of t){const{name:t}=n;e[n.chainId.toString()]=t,r[t]=n}return r.names=e,r}}e.Common=g},4394:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EIPs=void 0,e.EIPs={1153:r(6174),1559:r(4559),2315:r(9328),2537:r(7026),2565:r(5718),2718:r(7153),2929:r(9067),2930:r(398),3074:r(756),3198:r(5920),3529:r(805),3540:r(9240),3541:r(5662),3554:r(1190),3607:r(549),3651:r(1682),3670:r(4513),3675:r(7598),3855:r(4264),3860:r(863),4345:r(5475),4399:r(8816),4844:r(7377),4895:r(4887),5133:r(4265)}},2024:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CustomChain=e.ConsensusAlgorithm=e.ConsensusType=e.Hardfork=e.Chain=void 0,function(t){t[t.Mainnet=1]="Mainnet",t[t.Ropsten=3]="Ropsten",t[t.Rinkeby=4]="Rinkeby",t[t.Goerli=5]="Goerli",t[t.Sepolia=11155111]="Sepolia"}(e.Chain||(e.Chain={})),function(t){t.Chainstart="chainstart",t.Homestead="homestead",t.Dao="dao",t.TangerineWhistle="tangerineWhistle",t.SpuriousDragon="spuriousDragon",t.Byzantium="byzantium",t.Constantinople="constantinople",t.Petersburg="petersburg",t.Istanbul="istanbul",t.MuirGlacier="muirGlacier",t.Berlin="berlin",t.London="london",t.ArrowGlacier="arrowGlacier",t.GrayGlacier="grayGlacier",t.MergeForkIdTransition="mergeForkIdTransition",t.Merge="merge",t.Shanghai="shanghai",t.ShardingForkDev="shardingFork"}(e.Hardfork||(e.Hardfork={})),function(t){t.ProofOfStake="pos",t.ProofOfWork="pow",t.ProofOfAuthority="poa"}(e.ConsensusType||(e.ConsensusType={})),function(t){t.Ethash="ethash",t.Clique="clique",t.Casper="casper"}(e.ConsensusAlgorithm||(e.ConsensusAlgorithm={})),function(t){t.PolygonMainnet="polygon-mainnet",t.PolygonMumbai="polygon-mumbai",t.ArbitrumRinkebyTestnet="arbitrum-rinkeby-testnet",t.ArbitrumOne="arbitrum-one",t.xDaiChain="x-dai-chain",t.OptimisticKovan="optimistic-kovan",t.OptimisticEthereum="optimistic-ethereum"}(e.CustomChain||(e.CustomChain={}))},2267:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hardforks=void 0,e.hardforks={chainstart:r(8050),homestead:r(6544),dao:r(1243),tangerineWhistle:r(3193),spuriousDragon:r(2800),byzantium:r(5449),constantinople:r(3360),petersburg:r(1898),istanbul:r(1155),muirGlacier:r(2991),berlin:r(2278),london:r(8684),shanghai:r(7644),arrowGlacier:r(3338),grayGlacier:r(8126),mergeForkIdTransition:r(1687),merge:r(8518),shardingFork:r(2551)}},9226:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(2674),e),i(r(2024),e),i(r(1658),e),i(r(3864),e)},1658:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3864:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseGethGenesis=void 0;const n=r(5372),i=r(2024);function o(t,e=!0){const{name:r,config:o,difficulty:s,mixHash:a,gasLimit:u,coinbase:h,baseFeePerGas:c}=t;let{extraData:f,timestamp:l,nonce:d}=t;const p=Number(l),{chainId:m}=o;if(""===f&&(f="0x"),(0,n.isHexPrefixed)(l)||(l=(0,n.intToHex)(parseInt(l))),18!==d.length&&(d=function(t){return t&&"0x0"!==t?(0,n.isHexPrefixed)(t)?"0x"+(0,n.stripHexPrefix)(t).padStart(16,"0"):"0x"+t.padStart(16,"0"):"0x0000000000000000"}(d)),o.eip155Block!==o.eip158Block)throw new Error("EIP155 block number must equal EIP 158 block number since both are part of SpuriousDragon hardfork and the client only supports activating the full hardfork");const g={name:r,chainId:m,networkId:m,genesis:{timestamp:l,gasLimit:parseInt(u),difficulty:parseInt(s),nonce:d,extraData:f,mixHash:a,coinbase:h,baseFeePerGas:c},hardfork:void 0,hardforks:[],bootstrapNodes:[],consensus:void 0!==o.clique?{type:"poa",algorithm:"clique",clique:{period:o.clique.period??o.clique.blockperiodseconds,epoch:o.clique.epoch??o.clique.epochlength}}:{type:"pow",algorithm:"ethash",ethash:{}}},b={[i.Hardfork.Homestead]:{name:"homesteadBlock"},[i.Hardfork.Dao]:{name:"daoForkBlock"},[i.Hardfork.TangerineWhistle]:{name:"eip150Block"},[i.Hardfork.SpuriousDragon]:{name:"eip155Block"},[i.Hardfork.Byzantium]:{name:"byzantiumBlock"},[i.Hardfork.Constantinople]:{name:"constantinopleBlock"},[i.Hardfork.Petersburg]:{name:"petersburgBlock"},[i.Hardfork.Istanbul]:{name:"istanbulBlock"},[i.Hardfork.MuirGlacier]:{name:"muirGlacierBlock"},[i.Hardfork.Berlin]:{name:"berlinBlock"},[i.Hardfork.London]:{name:"londonBlock"},[i.Hardfork.MergeForkIdTransition]:{name:"mergeForkBlock",postMerge:e},[i.Hardfork.Shanghai]:{name:"shanghaiTime",postMerge:!0,isTimestamp:!0},[i.Hardfork.ShardingForkDev]:{name:"shardingForkTime",postMerge:!0,isTimestamp:!0}},y=Object.keys(b).reduce(((t,e)=>(t[b[e].name]=e,t)),{}),v=Object.keys(o).filter((t=>void 0!==y[t]&&void 0!==o[t]&&null!==o[t]));if(g.hardforks=v.map((t=>({name:y[t],block:!0===b[y[t]].isTimestamp||"number"!=typeof o[t]?null:o[t],timestamp:!0===b[y[t]].isTimestamp&&"number"==typeof o[t]?o[t]:void 0}))).filter((t=>null!==t.block||void 0!==t.timestamp)),g.hardforks.sort((function(t,e){return(t.block??1/0)-(e.block??1/0)})),g.hardforks.sort((function(t,e){return(t.timestamp??p)-(e.timestamp??p)})),void 0!==o.terminalTotalDifficulty){const t={name:i.Hardfork.Merge,ttd:o.terminalTotalDifficulty,block:null},e=g.hardforks.findIndex((t=>!0===b[t.name]?.postMerge));-1!==e?g.hardforks.splice(e,0,t):g.hardforks.push(t)}const w=g.hardforks.length>0?g.hardforks.slice(-1)[0]:void 0;return g.hardfork=w?.name,g.hardforks.unshift({name:i.Hardfork.Chainstart,block:0}),g}e.parseGethGenesis=function(t,e,r){try{if(["config","difficulty","gasLimit","alloc"].some((e=>!(e in t))))throw new Error("Invalid format, expected geth genesis fields missing");return void 0!==e&&(t.name=e),o(t,r)}catch(t){throw new Error(`Error parsing parameters file: ${t.message}`)}}},2321:(t,e)=>{"use strict";function r(t){if(Array.isArray(t)){const e=[];let n=0;for(let i=0;i<t.length;i++){const o=r(t[i]);e.push(o),n+=o.length}return l(o(n,192),...e)}const e=g(t);return 1===e.length&&e[0]<128?e:l(o(e.length,128),e)}function n(t,e,r){if(r>t.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return t.slice(e,r)}function i(t){if(0===t[0])throw new Error("invalid RLP: extra zeros");return c(h(t))}function o(t,e){if(t<56)return Uint8Array.from([t+e]);const r=p(t),n=p(e+55+r.length/2);return Uint8Array.from(f(n+r))}function s(t,e=!1){if(null==t||0===t.length)return Uint8Array.from([]);const r=a(g(t));if(e)return r;if(0!==r.remainder.length)throw new Error("invalid RLP: remainder must be zero");return r.data}function a(t){let e,r,o,s,u;const h=[],c=t[0];if(c<=127)return{data:t.slice(0,1),remainder:t.slice(1)};if(c<=183){if(e=c-127,o=128===c?Uint8Array.from([]):n(t,1,e),2===e&&o[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:o,remainder:t.slice(e)}}if(c<=191){if(r=c-182,t.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if(e=i(n(t,1,r)),e<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return o=n(t,r,e+r),{data:o,remainder:t.slice(e+r)}}if(c<=247){for(e=c-191,s=n(t,1,e);s.length;)u=a(s),h.push(u.data),s=u.remainder;return{data:h,remainder:t.slice(e)}}{if(r=c-246,e=i(n(t,1,r)),e<56)throw new Error("invalid RLP: encoded list too short");const o=r+e;if(o>t.length)throw new Error("invalid RLP: total length is larger than the data");for(s=n(t,r,o);s.length;)u=a(s),h.push(u.data),s=u.remainder;return{data:h,remainder:t.slice(o)}}}Object.defineProperty(e,"__esModule",{value:!0}),e.RLP=e.utils=e.decode=e.encode=void 0,e.encode=r,e.decode=s;const u=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function h(t){let e="";for(let r=0;r<t.length;r++)e+=u[t[r]];return e}function c(t){const e=Number.parseInt(t,16);if(Number.isNaN(e))throw new Error("Invalid byte sequence");return e}function f(t){if("string"!=typeof t)throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){const n=2*r;e[r]=c(t.slice(n,n+2))}return e}function l(...t){if(1===t.length)return t[0];const e=t.reduce(((t,e)=>t+e.length),0),r=new Uint8Array(e);for(let e=0,n=0;e<t.length;e++){const i=t[e];r.set(i,n),n+=i.length}return r}function d(t){return(new TextEncoder).encode(t)}function p(t){if(t<0)throw new Error("Invalid integer as argument, must be unsigned!");const e=t.toString(16);return e.length%2?`0${e}`:e}function m(t){return t.length>=2&&"0"===t[0]&&"x"===t[1]}function g(t){if(t instanceof Uint8Array)return t;if("string"==typeof t)return m(t)?f((e="string"!=typeof(r=t)?r:m(r)?r.slice(2):r).length%2?`0${e}`:e):d(t);var e,r;if("number"==typeof t||"bigint"==typeof t)return t?f(p(t)):Uint8Array.from([]);if(null==t)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof t)}e.utils={bytesToHex:h,concatBytes:l,hexToBytes:f,utf8ToBytes:d},e.RLP={encode:r,decode:s}},4706:(t,e,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.accountBodyToRLP=e.accountBodyToSlim=e.accountBodyFromSlim=e.isZeroAddress=e.zeroAddress=e.importPublic=e.privateToAddress=e.privateToPublic=e.publicToAddress=e.pubToAddress=e.isValidPublic=e.isValidPrivate=e.generateAddress2=e.generateAddress=e.isValidChecksumAddress=e.toChecksumAddress=e.isValidAddress=e.Account=void 0;const i=r(5123),o=r(1115),s=r(101),a=r(144),u=r(4916),h=r(8127),c=r(8707),f=r(4243),l=BigInt(0);class d{constructor(t=l,e=l,r=h.KECCAK256_RLP,n=h.KECCAK256_NULL){this.nonce=t,this.balance=e,this.storageRoot=r,this.codeHash=n,this._validate()}static fromAccountData(t){const{nonce:e,balance:r,storageRoot:n,codeHash:i}=t;return new d(void 0!==e?(0,u.bufferToBigInt)((0,u.toBuffer)(e)):void 0,void 0!==r?(0,u.bufferToBigInt)((0,u.toBuffer)(r)):void 0,void 0!==n?(0,u.toBuffer)(n):void 0,void 0!==i?(0,u.toBuffer)(i):void 0)}static fromRlpSerializedAccount(t){const e=(0,u.arrToBufArr)(i.RLP.decode(Uint8Array.from(t)));if(!Array.isArray(e))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(e)}static fromValuesArray(t){const[e,r,n,i]=t;return new d((0,u.bufferToBigInt)(e),(0,u.bufferToBigInt)(r),n,i)}_validate(){if(this.nonce<l)throw new Error("nonce must be greater than zero");if(this.balance<l)throw new Error("balance must be greater than zero");if(32!==this.storageRoot.length)throw new Error("storageRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")}raw(){return[(0,u.bigIntToUnpaddedBuffer)(this.nonce),(0,u.bigIntToUnpaddedBuffer)(this.balance),this.storageRoot,this.codeHash]}serialize(){return n.from(i.RLP.encode((0,u.bufArrToArr)(this.raw())))}isContract(){return!this.codeHash.equals(h.KECCAK256_NULL)}isEmpty(){return this.balance===l&&this.nonce===l&&this.codeHash.equals(h.KECCAK256_NULL)}}e.Account=d;e.isValidAddress=function(t){try{(0,c.assertIsString)(t)}catch(t){return!1}return/^0x[0-9a-fA-F]{40}$/.test(t)};e.toChecksumAddress=function(t,e){(0,c.assertIsHexString)(t);const r=(0,f.stripHexPrefix)(t).toLowerCase();let i="";if(void 0!==e){i=(0,u.bufferToBigInt)((0,u.toBuffer)(e)).toString()+"0x"}const s=n.from(i+r,"utf8"),h=(0,a.bytesToHex)((0,o.keccak256)(s));let l="0x";for(let t=0;t<r.length;t++)parseInt(h[t],16)>=8?l+=r[t].toUpperCase():l+=r[t];return l};e.isValidChecksumAddress=function(t,r){return(0,e.isValidAddress)(t)&&(0,e.toChecksumAddress)(t,r)===t};e.generateAddress=function(t,e){return(0,c.assertIsBuffer)(t),(0,c.assertIsBuffer)(e),(0,u.bufferToBigInt)(e)===BigInt(0)?n.from((0,o.keccak256)(i.RLP.encode((0,u.bufArrToArr)([t,null])))).slice(-20):n.from((0,o.keccak256)(i.RLP.encode((0,u.bufArrToArr)([t,e])))).slice(-20)};e.generateAddress2=function(t,e,r){if((0,c.assertIsBuffer)(t),(0,c.assertIsBuffer)(e),(0,c.assertIsBuffer)(r),20!==t.length)throw new Error("Expected from to be of length 20");if(32!==e.length)throw new Error("Expected salt to be of length 32");const i=(0,o.keccak256)(n.concat([n.from("ff","hex"),t,e,(0,o.keccak256)(r)]));return(0,u.toBuffer)(i).slice(-20)};e.isValidPrivate=function(t){return s.secp256k1.utils.isValidPrivateKey(t)};e.isValidPublic=function(t,e=!1){if((0,c.assertIsBuffer)(t),64===t.length)try{return s.secp256k1.ProjectivePoint.fromHex(n.concat([n.from([4]),t])),!0}catch(t){return!1}if(!e)return!1;try{return s.secp256k1.ProjectivePoint.fromHex(t),!0}catch(t){return!1}};e.pubToAddress=function(t,e=!1){if((0,c.assertIsBuffer)(t),e&&64!==t.length&&(t=n.from(s.secp256k1.ProjectivePoint.fromHex(t).toRawBytes(!1).slice(1))),64!==t.length)throw new Error("Expected pubKey to be of length 64");return n.from((0,o.keccak256)(t)).slice(-20)},e.publicToAddress=e.pubToAddress;e.privateToPublic=function(t){return(0,c.assertIsBuffer)(t),n.from(s.secp256k1.ProjectivePoint.fromPrivateKey(t).toRawBytes(!1).slice(1))};e.privateToAddress=function(t){return(0,e.publicToAddress)((0,e.privateToPublic)(t))};e.importPublic=function(t){return(0,c.assertIsBuffer)(t),64!==t.length&&(t=n.from(s.secp256k1.ProjectivePoint.fromHex(t).toRawBytes(!1).slice(1))),t};e.zeroAddress=function(){const t=(0,u.zeros)(20);return(0,u.bufferToHex)(t)};function p(t){const[e,r,n,i]=t;return[e,r,0===(0,u.arrToBufArr)(n).length?h.KECCAK256_RLP:n,0===(0,u.arrToBufArr)(i).length?h.KECCAK256_NULL:i]}e.isZeroAddress=function(t){try{(0,c.assertIsString)(t)}catch(t){return!1}return(0,e.zeroAddress)()===t},e.accountBodyFromSlim=p;const m=new Uint8Array(0);e.accountBodyToSlim=function(t){const[e,r,n,i]=t;return[e,r,(0,u.arrToBufArr)(n).equals(h.KECCAK256_RLP)?m:n,(0,u.arrToBufArr)(i).equals(h.KECCAK256_NULL)?m:i]},e.accountBodyToRLP=function(t,e=!0){const r=e?p(t):t;return(0,u.arrToBufArr)(i.RLP.encode(r))}},8515:(t,e,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.Address=void 0;const i=r(4706),o=r(4916);class s{constructor(t){if(20!==t.length)throw new Error("Invalid address length");this.buf=t}static zero(){return new s((0,o.zeros)(20))}static fromString(t){if(!(0,i.isValidAddress)(t))throw new Error("Invalid address");return new s((0,o.toBuffer)(t))}static fromPublicKey(t){if(!n.isBuffer(t))throw new Error("Public key should be Buffer");const e=(0,i.pubToAddress)(t);return new s(e)}static fromPrivateKey(t){if(!n.isBuffer(t))throw new Error("Private key should be Buffer");const e=(0,i.privateToAddress)(t);return new s(e)}static generate(t,e){if("bigint"!=typeof e)throw new Error("Expected nonce to be a bigint");return new s((0,i.generateAddress)(t.buf,(0,o.bigIntToBuffer)(e)))}static generate2(t,e,r){if(!n.isBuffer(e))throw new Error("Expected salt to be a Buffer");if(!n.isBuffer(r))throw new Error("Expected initCode to be a Buffer");return new s((0,i.generateAddress2)(t.buf,e,r))}equals(t){return this.buf.equals(t.buf)}isZero(){return this.equals(s.zero())}isPrecompileOrSystemAddress(){const t=(0,o.bufferToBigInt)(this.buf),e=BigInt(0),r=BigInt("0xffff");return t>=e&&t<=r}toString(){return"0x"+this.buf.toString("hex")}toBuffer(){return n.from(this.buf)}}e.Address=s},8263:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncEventEmitter=void 0;const n=r(2699);class i extends n.EventEmitter{emit(t,...e){let[r,n]=e;const i=this;let o=i._events[t]??[];return void 0===n&&"function"==typeof r&&(n=r,r=void 0),"newListener"!==t&&"removeListener"!==t||(r={event:r,fn:n},n=void 0),o=Array.isArray(o)?o:[o],async function(t,e,r){let n;for await(const i of e)try{i.length<2?i.call(t,r):await new Promise(((e,n)=>{i.call(t,r,(t=>{t?n(t):e()}))}))}catch(t){n=t}if(n)throw n}(i,o.slice(),r).then(n).catch(n),i.listenerCount(t)>0}once(t,e){const r=this;let n;if("function"!=typeof e)throw new TypeError("listener must be a function");return n=e.length>=2?function(i,o){r.removeListener(t,n),e(i,o)}:function(i){r.removeListener(t,n),e(i,n)},r.on(t,n),r}first(t,e){let r=this._events[t]??[];if("function"!=typeof e)throw new TypeError("listener must be a function");return Array.isArray(r)||(this._events[t]=r=[r]),r.unshift(e),this}before(t,e,r){return this.beforeOrAfter(t,e,r)}after(t,e,r){return this.beforeOrAfter(t,e,r,"after")}beforeOrAfter(t,e,r,n){let i,o,s=this._events[t]??[];const a="after"===n?1:0;if("function"!=typeof r)throw new TypeError("listener must be a function");if("function"!=typeof e)throw new TypeError("target must be a function");for(Array.isArray(s)||(this._events[t]=s=[s]),o=s.length,i=s.length;i--;)if(s[i]===e){o=i+a;break}return s.splice(o,0,r),this}on(t,e){return super.on(t,e)}addListener(t,e){return super.addListener(t,e)}prependListener(t,e){return super.prependListener(t,e)}prependOnceListener(t,e){return super.prependOnceListener(t,e)}removeAllListeners(t){return super.removeAllListeners(t)}removeListener(t,e){return super.removeListener(t,e)}eventNames(){return super.eventNames()}listeners(t){return super.listeners(t)}listenerCount(t){return super.listenerCount(t)}getMaxListeners(){return super.getMaxListeners()}setMaxListeners(t){return super.setMaxListeners(t)}}e.AsyncEventEmitter=i},4916:(t,e,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.intToUnpaddedBuffer=e.bigIntToUnpaddedBuffer=e.bigIntToHex=e.bufArrToArr=e.arrToBufArr=e.validateNoLeadingZeroes=e.baToJSON=e.toUtf8=e.short=e.addHexPrefix=e.toUnsigned=e.fromSigned=e.bufferToInt=e.bigIntToBuffer=e.bufferToBigInt=e.bufferToHex=e.toBuffer=e.unpadHexString=e.unpadArray=e.unpadBuffer=e.setLengthRight=e.setLengthLeft=e.zeros=e.intToBuffer=e.intToHex=void 0;const i=r(8707),o=r(4243);e.intToHex=function(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Received an invalid integer type: ${t}`);return`0x${t.toString(16)}`};e.intToBuffer=function(t){const r=(0,e.intToHex)(t);return n.from((0,o.padToEven)(r.slice(2)),"hex")};e.zeros=function(t){return n.allocUnsafe(t).fill(0)};const s=function(t,r,n){const i=(0,e.zeros)(r);return n?t.length<r?(t.copy(i),i):t.slice(0,r):t.length<r?(t.copy(i,r-t.length),i):t.slice(-r)};e.setLengthLeft=function(t,e){return(0,i.assertIsBuffer)(t),s(t,e,!1)};e.setLengthRight=function(t,e){return(0,i.assertIsBuffer)(t),s(t,e,!0)};const a=function(t){let e=t[0];for(;t.length>0&&"0"===e.toString();)e=(t=t.slice(1))[0];return t};e.unpadBuffer=function(t){return(0,i.assertIsBuffer)(t),a(t)};e.unpadArray=function(t){return(0,i.assertIsArray)(t),a(t)};e.unpadHexString=function(t){return(0,i.assertIsHexString)(t),t=(0,o.stripHexPrefix)(t),"0x"+a(t)};e.toBuffer=function(t){if(null==t)return n.allocUnsafe(0);if(n.isBuffer(t))return n.from(t);if(Array.isArray(t)||t instanceof Uint8Array)return n.from(t);if("string"==typeof t){if(!(0,o.isHexString)(t))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${t}`);return n.from((0,o.padToEven)((0,o.stripHexPrefix)(t)),"hex")}if("number"==typeof t)return(0,e.intToBuffer)(t);if("bigint"==typeof t){if(t<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${t}`);let e=t.toString(16);return e.length%2&&(e="0"+e),n.from(e,"hex")}if(t.toArray)return n.from(t.toArray());if(t.toBuffer)return n.from(t.toBuffer());throw new Error("invalid type")};function u(t){const r=(0,e.bufferToHex)(t);return"0x"===r?BigInt(0):BigInt(r)}function h(t){return(0,e.toBuffer)("0x"+t.toString(16))}e.bufferToHex=function(t){return"0x"+(t=(0,e.toBuffer)(t)).toString("hex")},e.bufferToBigInt=u,e.bigIntToBuffer=h;e.bufferToInt=function(t){const e=Number(u(t));if(!Number.isSafeInteger(e))throw new Error("Number exceeds 53 bits");return e};e.fromSigned=function(t){return BigInt.asIntN(256,u(t))};e.toUnsigned=function(t){return h(BigInt.asUintN(256,t))};e.addHexPrefix=function(t){return"string"!=typeof t||(0,o.isHexPrefixed)(t)?t:"0x"+t},e.short=function(t,e=50){const r=n.isBuffer(t)?t.toString("hex"):t;return r.length<=e?r:r.slice(0,e)+"…"};e.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return n.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};e.baToJSON=function(t){if(n.isBuffer(t))return`0x${t.toString("hex")}`;if(t instanceof Array){const r=[];for(let n=0;n<t.length;n++)r.push((0,e.baToJSON)(t[n]));return r}};e.validateNoLeadingZeroes=function(t){for(const[e,r]of Object.entries(t))if(void 0!==r&&r.length>0&&0===r[0])throw new Error(`${e} cannot have leading zeroes, received: ${r.toString("hex")}`)},e.arrToBufArr=function t(e){return Array.isArray(e)?e.map((e=>t(e))):n.from(e)},e.bufArrToArr=function t(e){return Array.isArray(e)?e.map((e=>t(e))):Uint8Array.from(e??[])};e.bigIntToHex=t=>"0x"+t.toString(16),e.bigIntToUnpaddedBuffer=function(t){return(0,e.unpadBuffer)(h(t))},e.intToUnpaddedBuffer=function(t){return(0,e.unpadBuffer)((0,e.intToBuffer)(t))}},8127:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MAX_WITHDRAWALS_PER_PAYLOAD=e.RLP_EMPTY_STRING=e.KECCAK256_RLP=e.KECCAK256_RLP_S=e.KECCAK256_RLP_ARRAY=e.KECCAK256_RLP_ARRAY_S=e.KECCAK256_NULL=e.KECCAK256_NULL_S=e.TWO_POW256=e.SECP256K1_ORDER_DIV_2=e.SECP256K1_ORDER=e.MAX_INTEGER_BIGINT=e.MAX_INTEGER=e.MAX_UINT64=void 0;const n=r(8834),i=r(101);e.MAX_UINT64=BigInt("0xffffffffffffffff"),e.MAX_INTEGER=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),e.MAX_INTEGER_BIGINT=BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935"),e.SECP256K1_ORDER=i.secp256k1.CURVE.n,e.SECP256K1_ORDER_DIV_2=i.secp256k1.CURVE.n/BigInt(2),e.TWO_POW256=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),e.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",e.KECCAK256_NULL=n.Buffer.from(e.KECCAK256_NULL_S,"hex"),e.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",e.KECCAK256_RLP_ARRAY=n.Buffer.from(e.KECCAK256_RLP_ARRAY_S,"hex"),e.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",e.KECCAK256_RLP=n.Buffer.from(e.KECCAK256_RLP_S,"hex"),e.RLP_EMPTY_STRING=n.Buffer.from([128]),e.MAX_WITHDRAWALS_PER_PAYLOAD=16},3244:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.compactBytesToNibbles=e.bytesToNibbles=e.nibblesToCompactBytes=e.nibblesToBytes=e.hasTerminator=void 0;e.hasTerminator=t=>t.length>0&&16===t[t.length-1];e.nibblesToBytes=(t,e)=>{for(let r=0,n=0;n<t.length;r+=1,n+=2)e[r]=t[n]<<4|t[n+1]};e.nibblesToCompactBytes=t=>{let r=0;(0,e.hasTerminator)(t)&&(r=1,t=t.subarray(0,t.length-1));const n=new Uint8Array(t.length/2+1);return n[0]=r<<5,1==(1&t.length)&&(n[0]|=16,n[0]|=t[0],t=t.subarray(1)),(0,e.nibblesToBytes)(t,n.subarray(1)),n};e.bytesToNibbles=t=>{const e=2*t.length+1,r=new Uint8Array(e);for(let e=0;e<t.length;e++){const n=t[e];r[2*e]=n/16,r[2*e+1]=n%16}return r[e-1]=16,r};e.compactBytesToNibbles=t=>{if(0===t.length)return t;let r=(0,e.bytesToNibbles)(t);r[0]<2&&(r=r.subarray(0,r.length-1));const n=2-(1&r[0]);return r.subarray(n)}},8707:(t,e,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.assertIsString=e.assertIsArray=e.assertIsBuffer=e.assertIsHexString=void 0;const i=r(4243);e.assertIsHexString=function(t){if(!(0,i.isHexString)(t)){throw new Error(`This method only supports 0x-prefixed hex strings but input was: ${t}`)}};e.assertIsBuffer=function(t){if(!n.isBuffer(t)){throw new Error(`This method only supports Buffer but input was: ${t}`)}};e.assertIsArray=function(t){if(!Array.isArray(t)){throw new Error(`This method only supports number arrays but input was: ${t}`)}};e.assertIsString=function(t){if("string"!=typeof t){throw new Error(`This method only supports strings but input was: ${t}`)}}},5372:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.toAscii=e.stripHexPrefix=e.padToEven=e.isHexString=e.isHexPrefixed=e.getKeys=e.getBinarySize=e.fromUtf8=e.fromAscii=e.arrayContainsArray=void 0,i(r(8127),e),i(r(3895),e),i(r(4706),e),i(r(8515),e),i(r(2868),e),i(r(2074),e),i(r(4916),e),i(r(2103),e),i(r(3244),e),i(r(8263),e);var o=r(4243);Object.defineProperty(e,"arrayContainsArray",{enumerable:!0,get:function(){return o.arrayContainsArray}}),Object.defineProperty(e,"fromAscii",{enumerable:!0,get:function(){return o.fromAscii}}),Object.defineProperty(e,"fromUtf8",{enumerable:!0,get:function(){return o.fromUtf8}}),Object.defineProperty(e,"getBinarySize",{enumerable:!0,get:function(){return o.getBinarySize}}),Object.defineProperty(e,"getKeys",{enumerable:!0,get:function(){return o.getKeys}}),Object.defineProperty(e,"isHexPrefixed",{enumerable:!0,get:function(){return o.isHexPrefixed}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return o.isHexString}}),Object.defineProperty(e,"padToEven",{enumerable:!0,get:function(){return o.padToEven}}),Object.defineProperty(e,"stripHexPrefix",{enumerable:!0,get:function(){return o.stripHexPrefix}}),Object.defineProperty(e,"toAscii",{enumerable:!0,get:function(){return o.toAscii}}),i(r(6065),e),i(r(6831),e)},4243:(t,e,r)=>{"use strict";var n=r(8834).Buffer;function i(t){if("string"!=typeof t)throw new Error("[isHexPrefixed] input must be type 'string', received type "+typeof t);return"0"===t[0]&&"x"===t[1]}Object.defineProperty(e,"__esModule",{value:!0}),e.isHexString=e.getKeys=e.fromAscii=e.fromUtf8=e.toAscii=e.arrayContainsArray=e.getBinarySize=e.padToEven=e.stripHexPrefix=e.isHexPrefixed=void 0,e.isHexPrefixed=i;function o(t){let e=t;if("string"!=typeof e)throw new Error("[padToEven] value must be type 'string', received "+typeof e);return e.length%2&&(e=`0${e}`),e}e.stripHexPrefix=t=>{if("string"!=typeof t)throw new Error("[stripHexPrefix] input must be type 'string', received "+typeof t);return i(t)?t.slice(2):t},e.padToEven=o,e.getBinarySize=function(t){if("string"!=typeof t)throw new Error("[getBinarySize] method requires input type 'string', received "+typeof t);return n.byteLength(t,"utf8")},e.arrayContainsArray=function(t,e,r){if(!0!==Array.isArray(t))throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof t}'`);if(!0!==Array.isArray(e))throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof e}'`);return e[!0===r?"some":"every"]((e=>t.indexOf(e)>=0))},e.toAscii=function(t){let e="",r=0;const n=t.length;for("0x"===t.substring(0,2)&&(r=2);r<n;r+=2){const n=parseInt(t.substr(r,2),16);e+=String.fromCharCode(n)}return e},e.fromUtf8=function(t){return`0x${o(n.from(t,"utf8").toString("hex")).replace(/^0+|0+$/g,"")}`},e.fromAscii=function(t){let e="";for(let r=0;r<t.length;r++){const n=t.charCodeAt(r).toString(16);e+=n.length<2?`0${n}`:n}return`0x${e}`},e.getKeys=function(t,e,r){if(!Array.isArray(t))throw new Error("[getKeys] method expects input 'params' to be an array, got "+typeof t);if("string"!=typeof e)throw new Error("[getKeys] method expects input 'key' to be type 'string', got "+typeof t);const n=[];for(let i=0;i<t.length;i++){let o=t[i][e];if(!0!==r||o){if("string"!=typeof o)throw new Error("invalid abi - expected type 'string', received "+typeof o)}else o="";n.push(o)}return n},e.isHexString=function(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&!(void 0!==e&&e>0&&t.length!==2+2*e)}},6065:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lock=void 0;e.Lock=class{constructor(){this.permits=1,this.promiseResolverQueue=[]}async acquire(){return this.permits>0?(this.permits-=1,Promise.resolve(!0)):new Promise((t=>this.promiseResolverQueue.push(t)))}release(){if(this.permits+=1,this.permits>1&&this.promiseResolverQueue.length>0)console.warn("Lock.permits should never be > 0 when there is someone waiting.");else if(1===this.permits&&this.promiseResolverQueue.length>0){this.permits-=1;const t=this.promiseResolverQueue.shift();t&&t(!0)}}}},6831:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getProvider=e.fetchFromProvider=void 0;const n=r(2973);e.fetchFromProvider=async(t,e)=>(await(0,n.default)(t,{headers:{"content-type":"application/json"},type:"json",data:{method:e.method,params:e.params,jsonrpc:"2.0",id:1}})).result;e.getProvider=t=>{if("string"==typeof t)return t;if(void 0!==t?.connection?.url)return t.connection.url;throw new Error("Must provide valid provider URL or Web3Provider")}},2074:(t,e,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.hashPersonalMessage=e.isValidSignature=e.fromRpcSig=e.toCompactSig=e.toRpcSig=e.ecrecover=e.ecsign=void 0;const i=r(1115),o=r(101),s=r(4916),a=r(8127),u=r(8707);function h(t,e){return t===BigInt(0)||t===BigInt(1)?t:void 0===e?t-BigInt(27):t-(e*BigInt(2)+BigInt(35))}function c(t){return t===BigInt(0)||t===BigInt(1)}e.ecsign=function(t,e,r){const i=o.secp256k1.sign(t,e),s=i.toCompactRawBytes();return{r:n.from(s.slice(0,32)),s:n.from(s.slice(32,64)),v:void 0===r?BigInt(i.recovery+27):BigInt(i.recovery+35)+BigInt(r)*BigInt(2)}};e.ecrecover=function(t,e,r,i,a){const u=n.concat([(0,s.setLengthLeft)(r,32),(0,s.setLengthLeft)(i,32)],64),f=h(e,a);if(!c(f))throw new Error("Invalid signature v value");const l=o.secp256k1.Signature.fromCompact(u).addRecoveryBit(Number(f)).recoverPublicKey(t);return n.from(l.toRawBytes(!1).slice(1))};e.toRpcSig=function(t,e,r,i){if(!c(h(t,i)))throw new Error("Invalid signature v value");return(0,s.bufferToHex)(n.concat([(0,s.setLengthLeft)(e,32),(0,s.setLengthLeft)(r,32),(0,s.toBuffer)(t)]))};e.toCompactSig=function(t,e,r,i){if(!c(h(t,i)))throw new Error("Invalid signature v value");let o=r;return(t>BigInt(28)&&t%BigInt(2)===BigInt(1)||t===BigInt(1)||t===BigInt(28))&&(o=n.from(r),o[0]|=128),(0,s.bufferToHex)(n.concat([(0,s.setLengthLeft)(e,32),(0,s.setLengthLeft)(o,32)]))};e.fromRpcSig=function(t){const e=(0,s.toBuffer)(t);let r,n,i;if(e.length>=65)r=e.slice(0,32),n=e.slice(32,64),i=(0,s.bufferToBigInt)(e.slice(64));else{if(64!==e.length)throw new Error("Invalid signature length");r=e.slice(0,32),n=e.slice(32,64),i=BigInt((0,s.bufferToInt)(e.slice(32,33))>>7),n[0]&=127}return i<27&&(i+=BigInt(27)),{v:i,r,s:n}};e.isValidSignature=function(t,e,r,n=!0,i){if(32!==e.length||32!==r.length)return!1;if(!c(h(t,i)))return!1;const o=(0,s.bufferToBigInt)(e),u=(0,s.bufferToBigInt)(r);return!(o===BigInt(0)||o>=a.SECP256K1_ORDER||u===BigInt(0)||u>=a.SECP256K1_ORDER)&&!(n&&u>=a.SECP256K1_ORDER_DIV_2)};e.hashPersonalMessage=function(t){(0,u.assertIsBuffer)(t);const e=n.from(`Ethereum Signed Message:\n${t.length}`,"utf-8");return n.from((0,i.keccak256)(n.concat([e,t])))}},2103:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toType=e.TypeOutput=void 0;const n=r(4916),i=r(4243);var o;!function(t){t[t.Number=0]="Number",t[t.BigInt=1]="BigInt",t[t.Buffer=2]="Buffer",t[t.PrefixedHexString=3]="PrefixedHexString"}(o=e.TypeOutput||(e.TypeOutput={})),e.toType=function(t,e){if(null===t)return null;if(void 0===t)return;if("string"==typeof t&&!(0,i.isHexString)(t))throw new Error(`A string must be provided with a 0x-prefix, given: ${t}`);if("number"==typeof t&&!Number.isSafeInteger(t))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");const r=(0,n.toBuffer)(t);switch(e){case o.Buffer:return r;case o.BigInt:return(0,n.bufferToBigInt)(r);case o.Number:{const t=(0,n.bufferToBigInt)(r);if(t>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative output type)");return Number(t)}case o.PrefixedHexString:return(0,n.bufferToHex)(r);default:throw new Error("unknown outputType")}}},3895:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GWEI_TO_WEI=void 0,e.GWEI_TO_WEI=BigInt(1e9)},2868:(t,e,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.Withdrawal=void 0;const i=r(8515),o=r(4916),s=r(2103);class a{constructor(t,e,r,n){this.index=t,this.validatorIndex=e,this.address=r,this.amount=n}static fromWithdrawalData(t){const{index:e,validatorIndex:r,address:n,amount:o}=t,u=(0,s.toType)(e,s.TypeOutput.BigInt),h=(0,s.toType)(r,s.TypeOutput.BigInt),c=new i.Address((0,s.toType)(n,s.TypeOutput.Buffer)),f=(0,s.toType)(o,s.TypeOutput.BigInt);return new a(u,h,c,f)}static fromValuesArray(t){if(4!==t.length)throw Error(`Invalid withdrawalArray length expected=4 actual=${t.length}`);const[e,r,n,i]=t;return a.fromWithdrawalData({index:e,validatorIndex:r,address:n,amount:i})}static toBufferArray(t){const{index:e,validatorIndex:r,address:o,amount:a}=t,u=(0,s.toType)(e,s.TypeOutput.BigInt)===BigInt(0)?n.alloc(0):(0,s.toType)(e,s.TypeOutput.Buffer),h=(0,s.toType)(r,s.TypeOutput.BigInt)===BigInt(0)?n.alloc(0):(0,s.toType)(r,s.TypeOutput.Buffer);let c;c=o instanceof i.Address?o.buf:(0,s.toType)(o,s.TypeOutput.Buffer);return[u,h,c,(0,s.toType)(a,s.TypeOutput.BigInt)===BigInt(0)?n.alloc(0):(0,s.toType)(a,s.TypeOutput.Buffer)]}raw(){return a.toBufferArray(this)}toValue(){return{index:this.index,validatorIndex:this.validatorIndex,address:this.address.buf,amount:this.amount}}toJSON(){return{index:(0,o.bigIntToHex)(this.index),validatorIndex:(0,o.bigIntToHex)(this.validatorIndex),address:"0x"+this.address.buf.toString("hex"),amount:(0,o.bigIntToHex)(this.amount)}}}e.Withdrawal=a},5123:(t,e)=>{"use strict";function r(t){if(Array.isArray(t)){const e=[];let n=0;for(let i=0;i<t.length;i++){const o=r(t[i]);e.push(o),n+=o.length}return l(o(n,192),...e)}const e=g(t);return 1===e.length&&e[0]<128?e:l(o(e.length,128),e)}function n(t,e,r){if(r>t.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return t.slice(e,r)}function i(t){if(0===t[0])throw new Error("invalid RLP: extra zeros");return c(h(t))}function o(t,e){if(t<56)return Uint8Array.from([t+e]);const r=p(t),n=p(e+55+r.length/2);return Uint8Array.from(f(n+r))}function s(t,e=!1){if(null==t||0===t.length)return Uint8Array.from([]);const r=a(g(t));if(e)return r;if(0!==r.remainder.length)throw new Error("invalid RLP: remainder must be zero");return r.data}function a(t){let e,r,o,s,u;const h=[],c=t[0];if(c<=127)return{data:t.slice(0,1),remainder:t.slice(1)};if(c<=183){if(e=c-127,o=128===c?Uint8Array.from([]):n(t,1,e),2===e&&o[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:o,remainder:t.slice(e)}}if(c<=191){if(r=c-182,t.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if(e=i(n(t,1,r)),e<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return o=n(t,r,e+r),{data:o,remainder:t.slice(e+r)}}if(c<=247){for(e=c-191,s=n(t,1,e);s.length;)u=a(s),h.push(u.data),s=u.remainder;return{data:h,remainder:t.slice(e)}}{if(r=c-246,e=i(n(t,1,r)),e<56)throw new Error("invalid RLP: encoded list too short");const o=r+e;if(o>t.length)throw new Error("invalid RLP: total length is larger than the data");for(s=n(t,r,o);s.length;)u=a(s),h.push(u.data),s=u.remainder;return{data:h,remainder:t.slice(o)}}}Object.defineProperty(e,"__esModule",{value:!0}),e.RLP=e.utils=e.decode=e.encode=void 0,e.encode=r,e.decode=s;const u=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function h(t){let e="";for(let r=0;r<t.length;r++)e+=u[t[r]];return e}function c(t){const e=Number.parseInt(t,16);if(Number.isNaN(e))throw new Error("Invalid byte sequence");return e}function f(t){if("string"!=typeof t)throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){const n=2*r;e[r]=c(t.slice(n,n+2))}return e}function l(...t){if(1===t.length)return t[0];const e=t.reduce(((t,e)=>t+e.length),0),r=new Uint8Array(e);for(let e=0,n=0;e<t.length;e++){const i=t[e];r.set(i,n),n+=i.length}return r}function d(t){return(new TextEncoder).encode(t)}function p(t){if(t<0)throw new Error("Invalid integer as argument, must be unsigned!");const e=t.toString(16);return e.length%2?`0${e}`:e}function m(t){return t.length>=2&&"0"===t[0]&&"x"===t[1]}function g(t){if(t instanceof Uint8Array)return t;if("string"==typeof t)return m(t)?f((e="string"!=typeof(r=t)?r:m(r)?r.slice(2):r).length%2?`0${e}`:e):d(t);var e,r;if("number"==typeof t||"bigint"==typeof t)return t?f(p(t)):Uint8Array.from([]);if(null==t)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof t)}e.utils={bytesToHex:h,concatBytes:l,hexToBytes:f,utf8ToBytes:d},e.RLP={encode:r,decode:s}},8872:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeSingle=e.decode=e.encodePacked=e.encodeSingle=e.encode=void 0;const n=r(7827),i=r(9777),o=r(9472);e.encode=(t,e,r,n)=>{try{return(0,o.pack)({types:t,values:e,packed:r,tight:n})}catch(t){if(t instanceof i.ParserError)throw new i.ParserError(`Unable to encode value: ${t.message}`,t);throw new i.ParserError(`An unexpected error occurred: ${(0,i.getErrorMessage)(t)}`,t)}};e.encodeSingle=(t,r)=>(0,e.encode)([t],[r]);e.encodePacked=(t,r,n)=>(0,e.encode)(t,r,!0,n);e.decode=(t,e)=>{const r=(0,n.createBytes)(e);try{return(0,o.unpack)(t,r)}catch(t){if(t instanceof i.ParserError)throw new i.ParserError(`Unable to decode value: ${t.message}`,t);throw new i.ParserError(`An unexpected error occurred: ${(0,i.getErrorMessage)(t)}`,t)}};e.decodeSingle=(t,r)=>{const o=(0,e.decode)([t],r);return(0,n.assert)(1===o.length,new i.ParserError("Decoded value array has unexpected length.")),o[0]}},9777:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ParserError=e.getErrorStack=e.getErrorMessage=void 0;const n=r(7827);e.getErrorMessage=t=>"string"==typeof t?t:t instanceof Error||(0,n.isObject)(t)&&(0,n.hasProperty)(t,"message")&&"string"==typeof t.message?t.message:"Unknown error.";e.getErrorStack=t=>{if(t instanceof Error)return t.stack};class i extends Error{constructor(t,r){super(t),this.name="ParserError";const n=(0,e.getErrorStack)(r);n&&(this.stack=n)}}e.ParserError=i},260:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(8872),e),i(r(9777),e),i(r(5858),e)},2378:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.iterate=void 0;const n=r(7827);e.iterate=function*(t,e=32){for(let r=0;r<t.length;r+=e){const i=t=>{(0,n.assert)(t>=0,"Cannot skip a negative number of bytes."),(0,n.assert)(t%e==0,"Length must be a multiple of the size."),r+=t},o=t.subarray(r);yield{skip:i,value:o}}return{skip:()=>{},value:new Uint8Array}}},9472:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unpack=e.pack=e.isDynamicParser=e.getParser=void 0;const n=r(7827),i=r(9777),o=r(2378),s=r(4206),a=r(2313);e.getParser=t=>{const e={address:s.address,array:s.array,bool:s.bool,bytes:s.bytes,fixedBytes:s.fixedBytes,function:s.fn,number:s.number,string:s.string,tuple:s.tuple},r=e[t];if(r)return r;const n=Object.values(e).find((e=>e.isType(t)));if(n)return n;throw new i.ParserError(`The type "${t}" is not supported.`)};e.isDynamicParser=(t,e)=>{const{isDynamic:r}=t;return"function"==typeof r?r(e):r};e.pack=({types:t,values:r,packed:o=!1,tight:s=!1,arrayPacked:u=!1,byteArray:h=new Uint8Array})=>{(0,n.assert)(t.length===r.length,new i.ParserError(`The number of types (${t.length}) does not match the number of values (${r.length}).`));const{staticBuffer:c,dynamicBuffer:f,pointers:l}=t.reduce((({staticBuffer:t,dynamicBuffer:i,pointers:a},h,c)=>{const f=(0,e.getParser)(h),l=r[c];if(o||u||!(0,e.isDynamicParser)(f,h))return{staticBuffer:f.encode({buffer:t,value:l,type:h,packed:o,tight:s}),dynamicBuffer:i,pointers:a};return{staticBuffer:(0,n.concatBytes)([t,new Uint8Array(32)]),dynamicBuffer:f.encode({buffer:i,value:l,type:h,packed:o,tight:s}),pointers:[...a,{position:t.length,pointer:i.length}]}}),{staticBuffer:new Uint8Array,dynamicBuffer:new Uint8Array,pointers:[]});(0,n.assert)(!o&&!u||0===f.length,new i.ParserError("Invalid pack state."));const d=c.length,p=l.reduce(((t,{pointer:e,position:r})=>{const i=(0,a.padStart)((0,n.numberToBytes)(d+e));return(0,a.set)(t,i,r)}),c);return(0,n.concatBytes)([h,p,f])};e.unpack=(t,r)=>{const s=(0,o.iterate)(r);return t.map((t=>{const{value:{value:o,skip:a},done:u}=s.next();(0,n.assert)(!u,new i.ParserError(`The encoded value is invalid for the provided types. Reached end of buffer while attempting to parse "${t}".`));const h=(0,e.getParser)(t);if((0,e.isDynamicParser)(h,t)){const e=(0,n.bytesToNumber)(o.subarray(0,32)),i=r.subarray(e);return h.decode({type:t,value:i,skip:a})}return h.decode({type:t,value:o,skip:a})}))}},7683:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.address=e.getAddress=void 0;const n=r(7827),i=r(9777),o=r(2313);e.getAddress=t=>{const e=(0,n.createBytes)(t);return(0,n.assert)(e.length<=20,new i.ParserError(`Invalid address value. Expected address to be 20 bytes long, but received ${e.length} bytes.`)),(0,o.padStart)(e,20)},e.address={isDynamic:!1,isType:t=>"address"===t,getByteLength:()=>32,encode({buffer:t,value:r,packed:i}){const s=(0,e.getAddress)(r);if(i)return(0,n.concatBytes)([t,s]);const a=(0,o.padStart)(s);return(0,n.concatBytes)([t,a])},decode:({value:t})=>(0,n.add0x)((0,n.bytesToHex)(t.slice(12,32)))}},7759:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.array=e.getTupleType=e.getArrayType=e.isArrayType=void 0;const n=r(7827),i=r(9777),o=r(9472),s=r(2313),a=r(2408),u=r(4409),h=/^(?<type>.*)\[(?<length>\d*?)\]$/u;e.isArrayType=t=>h.test(t);e.getArrayType=t=>{const e=t.match(h);return(0,n.assert)(e?.groups?.type,new i.ParserError(`Invalid array type. Expected an array type, but received "${t}".`)),[e.groups.type,e.groups.length?parseInt(e.groups.length,10):void 0]};e.getTupleType=(t,e)=>`(${new Array(e).fill(t).join(",")})`,e.array={isDynamic(t){const[r,n]=(0,e.getArrayType)(t);return void 0===n||(0,o.isDynamicParser)((0,o.getParser)(r),r)},isType:t=>(0,e.isArrayType)(t),getByteLength(t){(0,n.assert)((0,e.isArrayType)(t),new i.ParserError(`Expected an array type, but received "${t}".`));const[r,s]=(0,e.getArrayType)(t);return(0,o.isDynamicParser)(this,t)||void 0===s?32:u.tuple.getByteLength((0,e.getTupleType)(r,s))},encode({type:t,buffer:r,value:h,packed:c,tight:f}){const[l,d]=(0,e.getArrayType)(t);if((0,n.assert)(!c||!(0,e.isArrayType)(l),new i.ParserError("Cannot pack nested arrays.")),c&&(0,o.isDynamicParser)((0,o.getParser)(l),l))return(0,o.pack)({types:new Array(h.length).fill(l),values:h,byteArray:r,packed:c,arrayPacked:!0,tight:f});if(d)return(0,n.assert)(d===h.length,new i.ParserError(`Array length does not match type length. Expected a length of ${d}, but received ${h.length}.`)),u.tuple.encode({type:(0,e.getTupleType)(l,d),buffer:r,value:h,packed:a.fixedBytes.isType(l)&&f,tight:f});if(c)return(0,o.pack)({types:new Array(h.length).fill(l),values:h,byteArray:r,packed:a.fixedBytes.isType(l)&&f,arrayPacked:!0,tight:f});const p=(0,s.padStart)((0,n.numberToBytes)(h.length));return(0,o.pack)({types:new Array(h.length).fill(l),values:h,byteArray:(0,n.concatBytes)([r,p]),packed:c,tight:f})},decode({type:t,value:r,...s}){const[a,h]=(0,e.getArrayType)(t);if(h){const t=u.tuple.decode({type:(0,e.getTupleType)(a,h),value:r,...s});return(0,n.assert)(t.length===h,new i.ParserError(`Array length does not match type length. Expected a length of ${h}, but received ${t.length}.`)),t}const c=(0,n.bytesToNumber)(r.subarray(0,32));return(0,o.unpack)(new Array(c).fill(a),r.subarray(32))}}},8457:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bool=e.getBooleanValue=void 0;const n=r(7169),i=r(7827),o=r(9777),s=r(1001),a=(0,n.coerce)((0,n.boolean)(),(0,n.union)([(0,n.literal)("true"),(0,n.literal)("false")]),(t=>"true"===t));e.getBooleanValue=t=>{try{return(0,n.create)(t,a)?BigInt(1):BigInt(0)}catch{throw new o.ParserError(`Invalid boolean value. Expected a boolean literal, or the string "true" or "false", but received "${t}".`)}},e.bool={isDynamic:!1,isType:t=>"bool"===t,getByteLength:()=>32,encode({buffer:t,value:r,packed:n,tight:o}){const a=(0,e.getBooleanValue)(r);return n?(0,i.concatBytes)([t,(0,i.bigIntToBytes)(a)]):s.number.encode({type:"uint256",buffer:t,value:a,packed:n,tight:o})},decode:t=>s.number.decode({...t,type:"uint256"})===BigInt(1)}},7300:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=void 0;const n=r(7827),i=r(2313);e.bytes={isDynamic:!0,isType:t=>"bytes"===t,getByteLength:()=>32,encode({buffer:t,value:e,packed:r}){const o=(0,n.createBytes)(e);if(r)return(0,n.concatBytes)([t,o]);const s=32*Math.ceil(o.byteLength/32);return(0,n.concatBytes)([t,(0,i.padStart)((0,n.numberToBytes)(o.byteLength)),(0,i.padEnd)(o,s)])},decode({value:t}){const e=t.subarray(0,32),r=(0,n.bytesToNumber)(e);return t.slice(32,32+r)}}},2408:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fixedBytes=e.getByteLength=void 0;const n=r(7827),i=r(9777),o=r(2313),s=/^bytes([0-9]{1,2})$/u;e.getByteLength=t=>{const e=t.match(s)?.[1];(0,n.assert)(e,`Invalid byte length. Expected a number between 1 and 32, but received "${t}".`);const r=Number(e);return(0,n.assert)(r>0&&r<=32,new i.ParserError(`Invalid byte length. Expected a number between 1 and 32, but received "${t}".`)),r},e.fixedBytes={isDynamic:!1,isType:t=>s.test(t),getByteLength:()=>32,encode({type:t,buffer:r,value:s,packed:a}){const u=(0,e.getByteLength)(t),h=(0,n.createBytes)(s);return(0,n.assert)(h.length<=u,new i.ParserError(`Expected a value of length ${u}, but received a value of length ${h.length}.`)),a?(0,n.concatBytes)([r,(0,o.padEnd)(h,u)]):(0,n.concatBytes)([r,(0,o.padEnd)(h)])},decode({type:t,value:r}){const n=(0,e.getByteLength)(t);return r.slice(0,n)}}},2345:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fn=e.getFunction=void 0;const n=r(7169),i=r(7827),o=r(9777),s=r(2408),a=(0,n.coerce)((0,n.object)({address:i.StrictHexStruct,selector:i.StrictHexStruct}),(0,n.union)([i.StrictHexStruct,(0,n.instance)(Uint8Array)]),(t=>{const e=(0,i.createBytes)(t);return(0,i.assert)(24===e.length,new o.ParserError(`Invalid Solidity function. Expected function to be 24 bytes long, but received ${e.length} bytes.`)),{address:(0,i.bytesToHex)(e.subarray(0,20)),selector:(0,i.bytesToHex)(e.subarray(20,24))}}));e.getFunction=t=>{const e=(0,n.create)(t,a);return(0,i.concatBytes)([(0,i.hexToBytes)(e.address),(0,i.hexToBytes)(e.selector)])},e.fn={isDynamic:!1,isType:t=>"function"===t,getByteLength:()=>32,encode({buffer:t,value:r,packed:n,tight:i}){const o=(0,e.getFunction)(r);return s.fixedBytes.encode({type:"bytes24",buffer:t,value:o,packed:n,tight:i})},decode:({value:t})=>({address:(0,i.bytesToHex)(t.slice(0,20)),selector:(0,i.bytesToHex)(t.slice(20,24))})}},4206:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(7683),e),i(r(7759),e),i(r(8457),e),i(r(7300),e),i(r(2408),e),i(r(2345),e),i(r(1001),e),i(r(52),e),i(r(5967),e),i(r(4409),e)},1001:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.number=e.getBigInt=e.assertNumberLength=e.getLength=e.isSigned=void 0;const n=r(7827),i=r(9777),o=r(2313),s=/^u?int(?<length>[0-9]*)?$/u;e.isSigned=t=>!t.startsWith("u");e.getLength=t=>{if("int"===t||"uint"===t)return 256;const e=t.match(s);(0,n.assert)(e?.groups?.length,new i.ParserError(`Invalid number type. Expected a number type, but received "${t}".`));const r=parseInt(e.groups.length,10);return(0,n.assert)(r>=8&&r<=256,new i.ParserError(`Invalid number length. Expected a number between 8 and 256, but received "${t}".`)),(0,n.assert)(r%8==0,new i.ParserError(`Invalid number length. Expected a multiple of 8, but received "${t}".`)),r};e.assertNumberLength=(t,r)=>{const o=(0,e.getLength)(r),s=BigInt(2)**BigInt(o-((0,e.isSigned)(r)?1:0))-BigInt(1);(0,e.isSigned)(r)?(0,n.assert)(t>=-(s+BigInt(1))&&t<=s,new i.ParserError(`Number "${t}" is out of range for type "${r}".`)):(0,n.assert)(t<=s,new i.ParserError(`Number "${t}" is out of range for type "${r}".`))};e.getBigInt=t=>{try{return(0,n.createBigInt)(t)}catch{throw new i.ParserError(`Invalid number. Expected a valid number value, but received "${t}".`)}},e.number={isDynamic:!1,isType:t=>s.test(t),getByteLength:()=>32,encode({type:t,buffer:r,value:i,packed:s}){const a=(0,e.getBigInt)(i);if((0,e.assertNumberLength)(a,t),(0,e.isSigned)(t)){if(s){const i=(0,e.getLength)(t)/8;return(0,n.concatBytes)([r,(0,n.signedBigIntToBytes)(a,i)])}return(0,n.concatBytes)([r,(0,o.padStart)((0,n.signedBigIntToBytes)(a,32))])}if(s){const i=(0,e.getLength)(t)/8;return(0,n.concatBytes)([r,(0,o.padStart)((0,n.bigIntToBytes)(a),i)])}return(0,n.concatBytes)([r,(0,o.padStart)((0,n.bigIntToBytes)(a))])},decode({type:t,value:r}){const i=r.subarray(0,32);if((0,e.isSigned)(t)){const r=(0,n.bytesToSignedBigInt)(i);return(0,e.assertNumberLength)(r,t),r}const o=(0,n.bytesToBigInt)(i);return(0,e.assertNumberLength)(o,t),o}}},52:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5967:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.string=void 0;const n=r(7827),i=r(7300);e.string={isDynamic:!0,isType:t=>"string"===t,getByteLength:()=>32,encode:({buffer:t,value:e,packed:r,tight:o})=>i.bytes.encode({type:"bytes",buffer:t,value:(0,n.stringToBytes)(e),packed:r,tight:o}),decode:t=>(0,n.bytesToString)(i.bytes.decode(t))}},4409:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tuple=e.getTupleElements=void 0;const n=r(7827),i=r(9777),o=r(9472),s=/^\((.+)\)$/u;e.getTupleElements=t=>{(0,n.assert)(t.startsWith("(")&&t.endsWith(")"),new i.ParserError(`Invalid tuple type. Expected tuple type, but received "${t}".`));const e=[];let r="",o=0;for(let n=1;n<t.length-1;n++){const i=t[n];","===i&&0===o?(e.push(r.trim()),r=""):(r+=i,"("===i?o+=1:")"===i&&(o-=1))}return r.trim()&&e.push(r.trim()),e},e.tuple={isDynamic:t=>(0,e.getTupleElements)(t).some((t=>{const e=(0,o.getParser)(t);return(0,o.isDynamicParser)(e,t)})),isType:t=>(t=>s.test(t))(t),getByteLength(t){if((0,o.isDynamicParser)(this,t))return 32;return(0,e.getTupleElements)(t).reduce(((t,e)=>t+(0,o.getParser)(e).getByteLength(e)),0)},encode({type:t,buffer:r,value:n,packed:i,tight:s}){const a=(0,e.getTupleElements)(t);return(0,o.pack)({types:a,values:n,byteArray:r,packed:i,tight:s})},decode({type:t,value:r,skip:n}){const i=(0,e.getTupleElements)(t);return n(this.getByteLength(t)-32),(0,o.unpack)(i,r)}}},4163:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5858:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(4163),e)},1348:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.padEnd=e.padStart=e.set=void 0;const n=r(7827);e.set=(t,e,r)=>(0,n.concatBytes)([t.subarray(0,r),e,t.subarray(r+e.length)]);e.padStart=(t,e=32)=>{const r=new Uint8Array(Math.max(e-t.length,0)).fill(0);return(0,n.concatBytes)([r,t])};e.padEnd=(t,e=32)=>{const r=new Uint8Array(Math.max(e-t.length,0)).fill(0);return(0,n.concatBytes)([t,r])}},2313:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(1348),e)},7247:(t,e)=>{"use strict";function r(t){if(!Number.isSafeInteger(t))throw new Error(`Wrong integer: ${t}`)}function n(t){return t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name}function i(...t){const e=t=>t,r=(t,e)=>r=>t(e(r));return{encode:t.map((t=>t.encode)).reduceRight(r,e),decode:t.map((t=>t.decode)).reduce(r,e)}}function o(t){return{encode:e=>{if(!Array.isArray(e)||e.length&&"number"!=typeof e[0])throw new Error("alphabet.encode input should be an array of numbers");return e.map((e=>{if(r(e),e<0||e>=t.length)throw new Error(`Digit index outside alphabet: ${e} (alphabet: ${t.length})`);return t[e]}))},decode:e=>{if(!Array.isArray(e)||e.length&&"string"!=typeof e[0])throw new Error("alphabet.decode input should be array of strings");return e.map((e=>{if("string"!=typeof e)throw new Error(`alphabet.decode: not string element=${e}`);const r=t.indexOf(e);if(-1===r)throw new Error(`Unknown letter: "${e}". Allowed: ${t}`);return r}))}}}function s(t=""){if("string"!=typeof t)throw new Error("join separator should be string");return{encode:e=>{if(!Array.isArray(e)||e.length&&"string"!=typeof e[0])throw new Error("join.encode input should be array of strings");for(let t of e)if("string"!=typeof t)throw new Error(`join.encode: non-string input=${t}`);return e.join(t)},decode:e=>{if("string"!=typeof e)throw new Error("join.decode input should be string");return e.split(t)}}}function a(t,e="="){if(r(t),"string"!=typeof e)throw new Error("padding chr should be string");return{encode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let t of r)if("string"!=typeof t)throw new Error(`padding.encode: non-string input=${t}`);for(;r.length*t%8;)r.push(e);return r},decode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let t of r)if("string"!=typeof t)throw new Error(`padding.decode: non-string input=${t}`);let n=r.length;if(n*t%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&r[n-1]===e;n--)if(!((n-1)*t%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,n)}}}function u(t){if("function"!=typeof t)throw new Error("normalize fn should be function");return{encode:t=>t,decode:e=>t(e)}}function h(t,e,n){if(e<2)throw new Error(`convertRadix: wrong from=${e}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(t))throw new Error("convertRadix: data should be array");if(!t.length)return[];let i=0;const o=[],s=Array.from(t);for(s.forEach((t=>{if(r(t),t<0||t>=e)throw new Error(`Wrong integer: ${t}`)}));;){let t=0,r=!0;for(let o=i;o<s.length;o++){const a=s[o],u=e*t+a;if(!Number.isSafeInteger(u)||e*t/e!==t||u-a!=e*t)throw new Error("convertRadix: carry overflow");t=u%n;const h=Math.floor(u/n);if(s[o]=h,!Number.isSafeInteger(h)||h*n+t!==u)throw new Error("convertRadix: carry overflow");r&&(h?r=!1:i=o)}if(o.push(t),r)break}for(let e=0;e<t.length-1&&0===t[e];e++)o.push(0);return o.reverse()}Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.createBase58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64urlnopad=e.base64url=e.base64nopad=e.base64=e.base32crockford=e.base32hexnopad=e.base32hex=e.base32nopad=e.base32=e.base16=e.utils=e.assertNumber=void 0,e.assertNumber=r;const c=(t,e)=>e?c(e,t%e):t,f=(t,e)=>t+(e-c(t,e));function l(t,e,n,i){if(!Array.isArray(t))throw new Error("convertRadix2: data should be array");if(e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(f(e,n)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${n} carryBits=${f(e,n)}`);let o=0,s=0;const a=2**n-1,u=[];for(const i of t){if(r(i),i>=2**e)throw new Error(`convertRadix2: invalid data word=${i} from=${e}`);if(o=o<<e|i,s+e>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${e}`);for(s+=e;s>=n;s-=n)u.push((o>>s-n&a)>>>0);o&=2**s-1}if(o=o<<n-s&a,!i&&s>=e)throw new Error("Excess padding");if(!i&&o)throw new Error(`Non-zero padding: ${o}`);return i&&s>0&&u.push(o>>>0),u}function d(t){return r(t),{encode:e=>{if(!n(e))throw new Error("radix.encode input should be Uint8Array");return h(Array.from(e),256,t)},decode:e=>{if(!Array.isArray(e)||e.length&&"number"!=typeof e[0])throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(h(e,t,256))}}}function p(t,e=!1){if(r(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(f(8,t)>32||f(t,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!n(r))throw new Error("radix2.encode input should be Uint8Array");return l(Array.from(r),8,t,!e)},decode:r=>{if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(l(r,t,8,e))}}}function m(t){if("function"!=typeof t)throw new Error("unsafeWrapper fn should be function");return function(...e){try{return t.apply(null,e)}catch(t){}}}function g(t,e){if(r(t),"function"!=typeof e)throw new Error("checksum fn should be function");return{encode(r){if(!n(r))throw new Error("checksum.encode: input should be Uint8Array");const i=e(r).slice(0,t),o=new Uint8Array(r.length+t);return o.set(r),o.set(i,r.length),o},decode(r){if(!n(r))throw new Error("checksum.decode: input should be Uint8Array");const i=r.slice(0,-t),o=e(i).slice(0,t),s=r.slice(-t);for(let e=0;e<t;e++)if(o[e]!==s[e])throw new Error("Invalid checksum");return i}}}e.utils={alphabet:o,chain:i,checksum:g,convertRadix:h,convertRadix2:l,radix:d,radix2:p,join:s,padding:a},e.base16=i(p(4),o("0123456789ABCDEF"),s("")),e.base32=i(p(5),o("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),a(5),s("")),e.base32nopad=i(p(5),o("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),s("")),e.base32hex=i(p(5),o("0123456789ABCDEFGHIJKLMNOPQRSTUV"),a(5),s("")),e.base32hexnopad=i(p(5),o("0123456789ABCDEFGHIJKLMNOPQRSTUV"),s("")),e.base32crockford=i(p(5),o("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),s(""),u((t=>t.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")))),e.base64=i(p(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),a(6),s("")),e.base64nopad=i(p(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),s("")),e.base64url=i(p(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),a(6),s("")),e.base64urlnopad=i(p(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),s(""));const b=t=>i(d(58),o(t),s(""));e.base58=b("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=b("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=b("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const y=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(t){let r="";for(let n=0;n<t.length;n+=8){const i=t.subarray(n,n+8);r+=e.base58.encode(i).padStart(y[i.length],"1")}return r},decode(t){let r=[];for(let n=0;n<t.length;n+=11){const i=t.slice(n,n+11),o=y.indexOf(i.length),s=e.base58.decode(i);for(let t=0;t<s.length-o;t++)if(0!==s[t])throw new Error("base58xmr: wrong padding");r=r.concat(Array.from(s.slice(s.length-o)))}return Uint8Array.from(r)}};e.createBase58check=t=>i(g(4,(e=>t(t(e)))),e.base58),e.base58check=e.createBase58check;const v=i(o("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),s("")),w=[996825010,642813549,513874426,1027748829,705979059];function M(t){const e=t>>25;let r=(33554431&t)<<5;for(let t=0;t<w.length;t++)1==(e>>t&1)&&(r^=w[t]);return r}function E(t,e,r=1){const n=t.length;let i=1;for(let e=0;e<n;e++){const r=t.charCodeAt(e);if(r<33||r>126)throw new Error(`Invalid prefix (${t})`);i=M(i)^r>>5}i=M(i);for(let e=0;e<n;e++)i=M(i)^31&t.charCodeAt(e);for(let t of e)i=M(i)^t;for(let t=0;t<6;t++)i=M(i);return i^=r,v.encode(l([i%2**30],30,5,!1))}function S(t){const e="bech32"===t?1:734539939,r=p(5),n=r.decode,i=r.encode,o=m(n);function s(t,r=90){if("string"!=typeof t)throw new Error("bech32.decode input should be string, not "+typeof t);if(t.length<8||!1!==r&&t.length>r)throw new TypeError(`Wrong string length: ${t.length} (${t}). Expected (8..${r})`);const n=t.toLowerCase();if(t!==n&&t!==t.toUpperCase())throw new Error("String must be lowercase or uppercase");const i=n.lastIndexOf("1");if(0===i||-1===i)throw new Error('Letter "1" must be present between prefix and data only');const o=n.slice(0,i),s=n.slice(i+1);if(s.length<6)throw new Error("Data must be at least 6 characters long");const a=v.decode(s).slice(0,-6),u=E(o,a,e);if(!s.endsWith(u))throw new Error(`Invalid checksum in ${t}: expected "${u}"`);return{prefix:o,words:a}}return{encode:function(t,r,n=90){if("string"!=typeof t)throw new Error("bech32.encode prefix should be string, not "+typeof t);if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("bech32.encode words should be array of numbers, not "+typeof r);if(0===t.length)throw new TypeError(`Invalid prefix length ${t.length}`);const i=t.length+7+r.length;if(!1!==n&&i>n)throw new TypeError(`Length ${i} exceeds limit ${n}`);const o=t.toLowerCase(),s=E(o,r,e);return`${o}1${v.encode(r)}${s}`},decode:s,decodeToBytes:function(t){const{prefix:e,words:r}=s(t,!1);return{prefix:e,words:r,bytes:n(r)}},decodeUnsafe:m(s),fromWords:n,fromWordsUnsafe:o,toWords:i}}e.bech32=S("bech32"),e.bech32m=S("bech32m"),e.utf8={encode:t=>(new TextDecoder).decode(t),decode:t=>(new TextEncoder).encode(t)},e.hex=i(p(4),o("0123456789abcdef"),s(""),u((t=>{if("string"!=typeof t||t.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof t} with length ${t.length}`);return t.toLowerCase()})));const _={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},k="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr";e.bytesToString=(t,e)=>{if("string"!=typeof t||!_.hasOwnProperty(t))throw new TypeError(k);if(!n(e))throw new TypeError("bytesToString() expects Uint8Array");return _[t].encode(e)},e.str=e.bytesToString;e.stringToBytes=(t,e)=>{if(!_.hasOwnProperty(t))throw new TypeError(k);if("string"!=typeof e)throw new TypeError("stringToBytes() expects string");return _[t].decode(e)},e.bytes=e.stringToBytes},2517:function(t,e,r){"use strict";var n=r(8834).Buffer,i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&i(e,t,r);return o(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.getEncryptionPublicKey=e.decryptSafely=e.decrypt=e.encryptSafely=e.encrypt=void 0;const a=r(7434),u=s(r(717)),h=r(5491);function c({publicKey:t,data:e,version:r}){if((0,h.isNullish)(t))throw new Error("Missing publicKey parameter");if((0,h.isNullish)(e))throw new Error("Missing data parameter");if((0,h.isNullish)(r))throw new Error("Missing version parameter");if("x25519-xsalsa20-poly1305"===r){if("string"!=typeof e)throw new Error("Message data must be given as a string");const r=u.box.keyPair();let n;try{n=a.base64.decode(t)}catch(t){throw new Error("Bad public key")}const i=a.utf8.decode(e),o=u.randomBytes(u.box.nonceLength),s=u.box(i,o,n,r.secretKey);return{version:"x25519-xsalsa20-poly1305",nonce:a.base64.encode(o),ephemPublicKey:a.base64.encode(r.publicKey),ciphertext:a.base64.encode(s)}}throw new Error("Encryption type/version not supported")}function f({encryptedData:t,privateKey:e}){if((0,h.isNullish)(t))throw new Error("Missing encryptedData parameter");if((0,h.isNullish)(e))throw new Error("Missing privateKey parameter");if("x25519-xsalsa20-poly1305"===t.version){const r=n.from(e,"hex"),i=u.box.keyPair.fromSecretKey(r).secretKey,o=a.base64.decode(t.nonce),s=a.base64.decode(t.ciphertext),h=a.base64.decode(t.ephemPublicKey),c=u.box.open(s,o,h,i);try{if(!c)throw new Error;const t=a.utf8.encode(c);if(!t)throw new Error;return t}catch(t){if(t&&"string"==typeof t.message&&t.message.length)throw new Error(`Decryption failed: ${t.message}`);throw new Error("Decryption failed.")}}throw new Error("Encryption type/version not supported.")}e.encrypt=c,e.encryptSafely=function({publicKey:t,data:e,version:r}){if((0,h.isNullish)(t))throw new Error("Missing publicKey parameter");if((0,h.isNullish)(e))throw new Error("Missing data parameter");if((0,h.isNullish)(r))throw new Error("Missing version parameter");if("object"==typeof e&&e&&"toJSON"in e)throw new Error("Cannot encrypt with toJSON property. Please remove toJSON property");const i={data:e,padding:""},o=n.byteLength(JSON.stringify(i),"utf-8")%2048;let s=0;return o>0&&(s=2048-o-16),i.padding="0".repeat(s),c({publicKey:t,data:JSON.stringify(i),version:r})},e.decrypt=f,e.decryptSafely=function({encryptedData:t,privateKey:e}){if((0,h.isNullish)(t))throw new Error("Missing encryptedData parameter");if((0,h.isNullish)(e))throw new Error("Missing privateKey parameter");return JSON.parse(f({encryptedData:t,privateKey:e})).data},e.getEncryptionPublicKey=function(t){const e=n.from(t,"hex"),r=u.box.keyPair.fromSecretKey(e).publicKey;return a.base64.encode(r)}},539:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.normalize=e.concatSig=void 0,i(r(1695),e),i(r(5190),e),i(r(2517),e);var o=r(5491);Object.defineProperty(e,"concatSig",{enumerable:!0,get:function(){return o.concatSig}}),Object.defineProperty(e,"normalize",{enumerable:!0,get:function(){return o.normalize}})},1695:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extractPublicKey=e.recoverPersonalSignature=e.personalSign=void 0;const n=r(5372),i=r(5491);function o(t,e){const r=(0,n.hashPersonalMessage)((0,i.legacyToBuffer)(t));return(0,i.recoverPublicKey)(r,e)}e.personalSign=function({privateKey:t,data:e}){if((0,i.isNullish)(e))throw new Error("Missing data parameter");if((0,i.isNullish)(t))throw new Error("Missing privateKey parameter");const r=(0,i.legacyToBuffer)(e),o=(0,n.hashPersonalMessage)(r),s=(0,n.ecsign)(o,t);return(0,i.concatSig)((0,n.toBuffer)(s.v),s.r,s.s)},e.recoverPersonalSignature=function({data:t,signature:e}){if((0,i.isNullish)(t))throw new Error("Missing data parameter");if((0,i.isNullish)(e))throw new Error("Missing signature parameter");const r=o(t,e),s=(0,n.publicToAddress)(r);return(0,n.bufferToHex)(s)},e.extractPublicKey=function({data:t,signature:e}){if((0,i.isNullish)(t))throw new Error("Missing data parameter");if((0,i.isNullish)(e))throw new Error("Missing signature parameter");return`0x${o(t,e).toString("hex")}`}},5190:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.recoverTypedSignature=e.signTypedData=e.typedSignatureHash=e.TypedDataUtils=e.TYPED_MESSAGE_SCHEMA=e.SignTypedDataVersion=void 0;const n=r(5372),i=r(260),o=r(4206),s=r(2313),a=r(7487),u=r(1115),h=r(5491);var c;function f(t,e){if(!Object.keys(c).includes(t))throw new Error(`Invalid version: '${t}'`);if(e&&!e.includes(t))throw new Error(`SignTypedDataVersion not allowed: '${t}'. Allowed versions are: ${e.join(", ")}`)}function l(t,e){(0,a.assert)(null!==e,`Unable to encode value: Invalid number. Expected a valid number value, but received "${e}".`);const r=BigInt(e),n=(0,o.getLength)(t),i=BigInt(2)**BigInt(n)-BigInt(1);return(0,a.assert)(r>=-i&&r<=i,`Unable to encode value: Number "${e}" is out of range for type "${t}".`),r}function d(t){let e=BigInt(0);for(let r=0;r<t.length;r++){const n=BigInt(t.charCodeAt(r)-48);e*=BigInt(10),e+=n>=49?n-BigInt(49)+BigInt(10):n>=17?n-BigInt(17)+BigInt(10):n}return(0,s.padStart)((0,a.bigIntToBytes)(e),20)}function p(t,e,r,o,h){if(f(h,[c.V3,c.V4]),void 0!==t[r])return["bytes32",h===c.V4&&null==o?"0x0000000000000000000000000000000000000000000000000000000000000000":(0,n.arrToBufArr)((0,u.keccak256)(m(r,o,t,h)))];if("function"===r)throw new Error('Unsupported or invalid type: "function"');if(void 0===o)throw new Error(`missing value for field ${e} of type ${r}`);if("address"===r){if("number"==typeof o)return["address",(0,s.padStart)((0,a.numberToBytes)(o),20)];if((0,a.isStrictHexString)(o))return["address",(0,a.add0x)(o)];if("string"==typeof o)return["address",d(o).subarray(0,20)]}if("bool"===r)return["bool",Boolean(o)];if("bytes"===r)return"number"==typeof o?o=(0,a.numberToBytes)(o):(0,a.isStrictHexString)(o)||"0x"===o?o=(0,a.hexToBytes)(o):"string"==typeof o&&(o=(0,a.stringToBytes)(o)),["bytes32",(0,n.arrToBufArr)((0,u.keccak256)(o))];if(r.startsWith("bytes")&&"bytes"!==r&&!r.includes("["))return"number"==typeof o?o<0?["bytes32",new Uint8Array(32)]:["bytes32",(0,a.bigIntToBytes)(BigInt(o))]:(0,a.isStrictHexString)(o)?["bytes32",(0,a.hexToBytes)(o)]:["bytes32",o];if(r.startsWith("int")&&!r.includes("[")){const t=l(r,o);return t>=BigInt(0)?["uint256",t]:["int256",t]}if("string"===r)return o="number"==typeof o?(0,a.numberToBytes)(o):(0,a.stringToBytes)(null!=o?o:""),["bytes32",(0,n.arrToBufArr)((0,u.keccak256)(o))];if(r.endsWith("]")){if(h===c.V3)throw new Error("Arrays are unimplemented in encodeData; use V4 extension");const s=r.slice(0,r.lastIndexOf("[")),a=o.map((r=>p(t,e,s,r,h)));return["bytes32",(0,n.arrToBufArr)((0,u.keccak256)((0,i.encode)(a.map((([t])=>t)),a.map((([,t])=>t)))))]}return[r,o]}function m(t,e,r,o){f(o,[c.V3,c.V4]);const s=["bytes32"],a=[v(t,r)];for(const n of r[t]){if(o===c.V3&&void 0===e[n.name])continue;const[t,i]=p(r,n.name,n.type,e[n.name],o);s.push(t),a.push(i)}return(0,n.arrToBufArr)((0,i.encode)(s,a))}function g(t,e){let r="";const n=b(t,e);n.delete(t);const i=[t,...Array.from(n).sort()];for(const t of i){if(!e[t])throw new Error(`No type definition specified: ${t}`);r+=`${t}(${e[t].map((({name:t,type:e})=>`${e} ${t}`)).join(",")})`}return r}function b(t,e,r=new Set){if("string"!=typeof t)throw new Error(`Invalid findTypeDependencies input ${JSON.stringify(t)}`);const n=t.match(/^\w*/u);if([t]=n,r.has(t)||void 0===e[t])return r;r.add(t);for(const n of e[t])b(n.type,e,r);return r}function y(t,e,r,i){f(i,[c.V3,c.V4]);const o=m(t,e,r,i),s=(0,u.keccak256)(o);return(0,n.arrToBufArr)(s)}function v(t,e){const r=(0,a.stringToBytes)(g(t,e));return(0,n.arrToBufArr)((0,u.keccak256)(r))}function w(t){const r={};for(const n in e.TYPED_MESSAGE_SCHEMA.properties)t[n]&&(r[n]=t[n]);return"types"in r&&(r.types=Object.assign({EIP712Domain:[]},r.types)),r}function M(t,e){f(e,[c.V3,c.V4]);const r=w(t),{domain:n}=r;return y("EIP712Domain",n,{EIP712Domain:r.types.EIP712Domain},e)}function E(t,e){if((0,o.isArrayType)(t)&&Array.isArray(e)){const[r]=(0,o.getArrayType)(t);return e.map((t=>E(r,t)))}if("address"===t){if("number"==typeof e)return(0,s.padStart)((0,a.numberToBytes)(e),20);if((0,a.isStrictHexString)(e))return(0,s.padStart)((0,a.hexToBytes)(e).subarray(0,20),20);if(e instanceof Uint8Array)return(0,s.padStart)(e.subarray(0,20),20)}if("bool"===t)return Boolean(e);if(t.startsWith("bytes")&&"bytes"!==t){const r=(0,o.getByteLength)(t);if("number"==typeof e)return e<0?new Uint8Array:(0,a.numberToBytes)(e).subarray(0,r);if((0,a.isStrictHexString)(e))return(0,a.hexToBytes)(e).subarray(0,r);if(e instanceof Uint8Array)return e.subarray(0,r)}if(t.startsWith("uint")&&"number"==typeof e)return Math.abs(e);if(t.startsWith("int")&&"number"==typeof e){const r=(0,o.getLength)(t);return BigInt.asIntN(r,BigInt(e))}return e}function S(t,e){return e.map((e=>{if("string"==typeof e||"number"==typeof e||"bigint"==typeof e){const r=l(t,e);if(r>=BigInt(0))return(0,s.padStart)((0,a.bigIntToBytes)(r),32);const n=(0,o.getLength)(t),i=BigInt.asIntN(n,r);return(0,a.signedBigIntToBytes)(i,32)}return e}))}function _(t){const e=new Error("Expect argument to be non-empty array");if("object"!=typeof t||!("length"in t)||!t.length)throw e;const r=t.map((({name:t,type:e,value:r})=>{if("address[]"===e)return{name:t,type:"bytes32[]",value:(n=r,n.map((t=>"number"==typeof t?(0,s.padStart)((0,a.numberToBytes)(t),32):(0,a.isStrictHexString)(t)?(0,s.padStart)((0,a.hexToBytes)(t).subarray(0,32),32):t instanceof Uint8Array?(0,s.padStart)(t.subarray(0,32),32):t)))};var n;if(e.startsWith("int")&&(0,o.isArrayType)(e)){const[n,i]=(0,o.getArrayType)(e);return{name:t,type:`bytes32[${null!=i?i:""}]`,value:S(n,r)}}return{name:t,type:e,value:E(e,r)}})),c=r.map((t=>"bytes"!==t.type?t.value:(0,h.legacyToBuffer)(t.value))),f=r.map((t=>{if("function"===t.type)throw new Error('Unsupported or invalid type: "function"');return t.type})),l=t.map((t=>{if(!t.name)throw e;return`${t.type} ${t.name}`}));return(0,n.arrToBufArr)((0,u.keccak256)((0,i.encodePacked)(["bytes32","bytes32"],[(0,u.keccak256)((0,i.encodePacked)(["string[]"],[l],!0)),(0,u.keccak256)((0,i.encodePacked)(f,c,!0))])))}!function(t){t.V1="V1",t.V3="V3",t.V4="V4"}(c=e.SignTypedDataVersion||(e.SignTypedDataVersion={})),e.TYPED_MESSAGE_SCHEMA={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},e.TypedDataUtils={encodeData:m,encodeType:g,findTypeDependencies:b,hashStruct:y,hashType:v,sanitizeData:w,eip712Hash:function(t,e){f(e,[c.V3,c.V4]);const r=w(t),i=[(0,a.hexToBytes)("1901")];return i.push(M(t,e)),"EIP712Domain"!==r.primaryType&&i.push(y(r.primaryType,r.message,r.types,e)),(0,n.arrToBufArr)((0,u.keccak256)((0,a.concatBytes)(i)))},eip712DomainHash:M},e.typedSignatureHash=function(t){const e=_(t);return(0,a.bytesToHex)(e)},e.signTypedData=function({privateKey:t,data:r,version:i}){if(f(i),(0,h.isNullish)(r))throw new Error("Missing data parameter");if((0,h.isNullish)(t))throw new Error("Missing private key parameter");const o=i===c.V1?_(r):e.TypedDataUtils.eip712Hash(r,i),s=(0,n.ecsign)(o,t);return(0,h.concatSig)((0,n.arrToBufArr)((0,a.bigIntToBytes)(s.v)),s.r,s.s)},e.recoverTypedSignature=function({data:t,signature:r,version:i}){if(f(i),(0,h.isNullish)(t))throw new Error("Missing data parameter");if((0,h.isNullish)(r))throw new Error("Missing signature parameter");const o=i===c.V1?_(t):e.TypedDataUtils.eip712Hash(t,i),s=(0,h.recoverPublicKey)(o,r),u=(0,n.publicToAddress)(s);return(0,a.bytesToHex)(u)}},5491:(t,e,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.normalize=e.recoverPublicKey=e.concatSig=e.legacyToBuffer=e.isNullish=e.padWithZeroes=void 0;const i=r(5372),o=r(7487);function s(t,e){if(""!==t&&!/^[a-f0-9]+$/iu.test(t))throw new Error(`Expected an unprefixed hex string. Received: ${t}`);if(e<0)throw new Error(`Expected a non-negative integer target length. Received: ${e}`);return String.prototype.padStart.call(t,e,"0")}function a(t){return null==t}e.padWithZeroes=s,e.isNullish=a,e.legacyToBuffer=function(t){return"string"!=typeof t||(0,i.isHexString)(t)?(0,i.toBuffer)(t):n.from(t)},e.concatSig=function(t,e,r){const n=(0,i.fromSigned)(e),a=(0,i.fromSigned)(r),u=(0,i.bufferToInt)(t),h=s((0,i.toUnsigned)(n).toString("hex"),64),c=s((0,i.toUnsigned)(a).toString("hex"),64),f=(0,o.remove0x)((0,o.numberToHex)(u));return(0,o.add0x)(h.concat(c,f))},e.recoverPublicKey=function(t,e){const r=(0,i.fromRpcSig)(e);return(0,i.ecrecover)(t,r.v,r.r,r.s)},e.normalize=function(t){if(!a(t)){if("number"==typeof t){if(t<0)return"0x";const e=(0,o.numberToBytes)(t);t=(0,o.bytesToHex)(e)}if("string"!=typeof t){let e="eth-sig-util.normalize() requires hex string or integer input.";throw e+=` received ${typeof t}: ${t}`,new Error(e)}return(0,o.add0x)(t.toLowerCase())}}},7434:(t,e)=>{"use strict";function r(t){if(!Number.isSafeInteger(t))throw new Error(`Wrong integer: ${t}`)}function n(t){return t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name}function i(...t){const e=t=>t,r=(t,e)=>r=>t(e(r));return{encode:t.map((t=>t.encode)).reduceRight(r,e),decode:t.map((t=>t.decode)).reduce(r,e)}}function o(t){return{encode:e=>{if(!Array.isArray(e)||e.length&&"number"!=typeof e[0])throw new Error("alphabet.encode input should be an array of numbers");return e.map((e=>{if(r(e),e<0||e>=t.length)throw new Error(`Digit index outside alphabet: ${e} (alphabet: ${t.length})`);return t[e]}))},decode:e=>{if(!Array.isArray(e)||e.length&&"string"!=typeof e[0])throw new Error("alphabet.decode input should be array of strings");return e.map((e=>{if("string"!=typeof e)throw new Error(`alphabet.decode: not string element=${e}`);const r=t.indexOf(e);if(-1===r)throw new Error(`Unknown letter: "${e}". Allowed: ${t}`);return r}))}}}function s(t=""){if("string"!=typeof t)throw new Error("join separator should be string");return{encode:e=>{if(!Array.isArray(e)||e.length&&"string"!=typeof e[0])throw new Error("join.encode input should be array of strings");for(let t of e)if("string"!=typeof t)throw new Error(`join.encode: non-string input=${t}`);return e.join(t)},decode:e=>{if("string"!=typeof e)throw new Error("join.decode input should be string");return e.split(t)}}}function a(t,e="="){if(r(t),"string"!=typeof e)throw new Error("padding chr should be string");return{encode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let t of r)if("string"!=typeof t)throw new Error(`padding.encode: non-string input=${t}`);for(;r.length*t%8;)r.push(e);return r},decode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let t of r)if("string"!=typeof t)throw new Error(`padding.decode: non-string input=${t}`);let n=r.length;if(n*t%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&r[n-1]===e;n--)if(!((n-1)*t%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,n)}}}function u(t){if("function"!=typeof t)throw new Error("normalize fn should be function");return{encode:t=>t,decode:e=>t(e)}}function h(t,e,n){if(e<2)throw new Error(`convertRadix: wrong from=${e}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(t))throw new Error("convertRadix: data should be array");if(!t.length)return[];let i=0;const o=[],s=Array.from(t);for(s.forEach((t=>{if(r(t),t<0||t>=e)throw new Error(`Wrong integer: ${t}`)}));;){let t=0,r=!0;for(let o=i;o<s.length;o++){const a=s[o],u=e*t+a;if(!Number.isSafeInteger(u)||e*t/e!==t||u-a!=e*t)throw new Error("convertRadix: carry overflow");t=u%n;const h=Math.floor(u/n);if(s[o]=h,!Number.isSafeInteger(h)||h*n+t!==u)throw new Error("convertRadix: carry overflow");r&&(h?r=!1:i=o)}if(o.push(t),r)break}for(let e=0;e<t.length-1&&0===t[e];e++)o.push(0);return o.reverse()}Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.createBase58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64urlnopad=e.base64url=e.base64nopad=e.base64=e.base32crockford=e.base32hexnopad=e.base32hex=e.base32nopad=e.base32=e.base16=e.utils=e.assertNumber=void 0,e.assertNumber=r;const c=(t,e)=>e?c(e,t%e):t,f=(t,e)=>t+(e-c(t,e));function l(t,e,n,i){if(!Array.isArray(t))throw new Error("convertRadix2: data should be array");if(e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(f(e,n)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${n} carryBits=${f(e,n)}`);let o=0,s=0;const a=2**n-1,u=[];for(const i of t){if(r(i),i>=2**e)throw new Error(`convertRadix2: invalid data word=${i} from=${e}`);if(o=o<<e|i,s+e>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${e}`);for(s+=e;s>=n;s-=n)u.push((o>>s-n&a)>>>0);o&=2**s-1}if(o=o<<n-s&a,!i&&s>=e)throw new Error("Excess padding");if(!i&&o)throw new Error(`Non-zero padding: ${o}`);return i&&s>0&&u.push(o>>>0),u}function d(t){return r(t),{encode:e=>{if(!n(e))throw new Error("radix.encode input should be Uint8Array");return h(Array.from(e),256,t)},decode:e=>{if(!Array.isArray(e)||e.length&&"number"!=typeof e[0])throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(h(e,t,256))}}}function p(t,e=!1){if(r(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(f(8,t)>32||f(t,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!n(r))throw new Error("radix2.encode input should be Uint8Array");return l(Array.from(r),8,t,!e)},decode:r=>{if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(l(r,t,8,e))}}}function m(t){if("function"!=typeof t)throw new Error("unsafeWrapper fn should be function");return function(...e){try{return t.apply(null,e)}catch(t){}}}function g(t,e){if(r(t),"function"!=typeof e)throw new Error("checksum fn should be function");return{encode(r){if(!n(r))throw new Error("checksum.encode: input should be Uint8Array");const i=e(r).slice(0,t),o=new Uint8Array(r.length+t);return o.set(r),o.set(i,r.length),o},decode(r){if(!n(r))throw new Error("checksum.decode: input should be Uint8Array");const i=r.slice(0,-t),o=e(i).slice(0,t),s=r.slice(-t);for(let e=0;e<t;e++)if(o[e]!==s[e])throw new Error("Invalid checksum");return i}}}e.utils={alphabet:o,chain:i,checksum:g,convertRadix:h,convertRadix2:l,radix:d,radix2:p,join:s,padding:a},e.base16=i(p(4),o("0123456789ABCDEF"),s("")),e.base32=i(p(5),o("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),a(5),s("")),e.base32nopad=i(p(5),o("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),s("")),e.base32hex=i(p(5),o("0123456789ABCDEFGHIJKLMNOPQRSTUV"),a(5),s("")),e.base32hexnopad=i(p(5),o("0123456789ABCDEFGHIJKLMNOPQRSTUV"),s("")),e.base32crockford=i(p(5),o("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),s(""),u((t=>t.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")))),e.base64=i(p(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),a(6),s("")),e.base64nopad=i(p(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),s("")),e.base64url=i(p(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),a(6),s("")),e.base64urlnopad=i(p(6),o("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),s(""));const b=t=>i(d(58),o(t),s(""));e.base58=b("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=b("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=b("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const y=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(t){let r="";for(let n=0;n<t.length;n+=8){const i=t.subarray(n,n+8);r+=e.base58.encode(i).padStart(y[i.length],"1")}return r},decode(t){let r=[];for(let n=0;n<t.length;n+=11){const i=t.slice(n,n+11),o=y.indexOf(i.length),s=e.base58.decode(i);for(let t=0;t<s.length-o;t++)if(0!==s[t])throw new Error("base58xmr: wrong padding");r=r.concat(Array.from(s.slice(s.length-o)))}return Uint8Array.from(r)}};e.createBase58check=t=>i(g(4,(e=>t(t(e)))),e.base58),e.base58check=e.createBase58check;const v=i(o("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),s("")),w=[996825010,642813549,513874426,1027748829,705979059];function M(t){const e=t>>25;let r=(33554431&t)<<5;for(let t=0;t<w.length;t++)1==(e>>t&1)&&(r^=w[t]);return r}function E(t,e,r=1){const n=t.length;let i=1;for(let e=0;e<n;e++){const r=t.charCodeAt(e);if(r<33||r>126)throw new Error(`Invalid prefix (${t})`);i=M(i)^r>>5}i=M(i);for(let e=0;e<n;e++)i=M(i)^31&t.charCodeAt(e);for(let t of e)i=M(i)^t;for(let t=0;t<6;t++)i=M(i);return i^=r,v.encode(l([i%2**30],30,5,!1))}function S(t){const e="bech32"===t?1:734539939,r=p(5),n=r.decode,i=r.encode,o=m(n);function s(t,r=90){if("string"!=typeof t)throw new Error("bech32.decode input should be string, not "+typeof t);if(t.length<8||!1!==r&&t.length>r)throw new TypeError(`Wrong string length: ${t.length} (${t}). Expected (8..${r})`);const n=t.toLowerCase();if(t!==n&&t!==t.toUpperCase())throw new Error("String must be lowercase or uppercase");const i=n.lastIndexOf("1");if(0===i||-1===i)throw new Error('Letter "1" must be present between prefix and data only');const o=n.slice(0,i),s=n.slice(i+1);if(s.length<6)throw new Error("Data must be at least 6 characters long");const a=v.decode(s).slice(0,-6),u=E(o,a,e);if(!s.endsWith(u))throw new Error(`Invalid checksum in ${t}: expected "${u}"`);return{prefix:o,words:a}}return{encode:function(t,r,n=90){if("string"!=typeof t)throw new Error("bech32.encode prefix should be string, not "+typeof t);if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("bech32.encode words should be array of numbers, not "+typeof r);if(0===t.length)throw new TypeError(`Invalid prefix length ${t.length}`);const i=t.length+7+r.length;if(!1!==n&&i>n)throw new TypeError(`Length ${i} exceeds limit ${n}`);const o=t.toLowerCase(),s=E(o,r,e);return`${o}1${v.encode(r)}${s}`},decode:s,decodeToBytes:function(t){const{prefix:e,words:r}=s(t,!1);return{prefix:e,words:r,bytes:n(r)}},decodeUnsafe:m(s),fromWords:n,fromWordsUnsafe:o,toWords:i}}e.bech32=S("bech32"),e.bech32m=S("bech32m"),e.utf8={encode:t=>(new TextDecoder).decode(t),decode:t=>(new TextEncoder).encode(t)},e.hex=i(p(4),o("0123456789abcdef"),s(""),u((t=>{if("string"!=typeof t||t.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof t} with length ${t.length}`);return t.toLowerCase()})));const _={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},k="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr";e.bytesToString=(t,e)=>{if("string"!=typeof t||!_.hasOwnProperty(t))throw new TypeError(k);if(!n(e))throw new TypeError("bytesToString() expects Uint8Array");return _[t].encode(e)},e.str=e.bytesToString;e.stringToBytes=(t,e)=>{if(!_.hasOwnProperty(t))throw new TypeError(k);if("string"!=typeof e)throw new TypeError("stringToBytes() expects string");return _[t].decode(e)},e.bytes=e.stringToBytes},3525:(t,e)=>{"use strict";function r(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function n(t){if("boolean"!=typeof t)throw new Error(`Expected boolean, not ${t}`)}function i(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function o(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(t.outputLen),r(t.blockLen)}function s(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function a(t,e){i(t);const r=e.outputLen;if(t.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(e,"__esModule",{value:!0}),e.output=e.exists=e.hash=e.bytes=e.bool=e.number=void 0,e.number=r,e.bool=n,e.bytes=i,e.hash=o,e.exists=s,e.output=a;const u={number:r,bool:n,bytes:i,hash:o,exists:s,output:a};e.default=u},1655:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.add5L=e.add5H=e.add4H=e.add4L=e.add3H=e.add3L=e.add=e.rotlBL=e.rotlBH=e.rotlSL=e.rotlSH=e.rotr32L=e.rotr32H=e.rotrBL=e.rotrBH=e.rotrSL=e.rotrSH=e.shrSL=e.shrSH=e.toBig=e.split=e.fromBig=void 0;const r=BigInt(2**32-1),n=BigInt(32);function i(t,e=!1){return e?{h:Number(t&r),l:Number(t>>n&r)}:{h:0|Number(t>>n&r),l:0|Number(t&r)}}function o(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let o=0;o<t.length;o++){const{h:s,l:a}=i(t[o],e);[r[o],n[o]]=[s,a]}return[r,n]}e.fromBig=i,e.split=o;const s=(t,e)=>BigInt(t>>>0)<<n|BigInt(e>>>0);e.toBig=s;const a=(t,e,r)=>t>>>r;e.shrSH=a;const u=(t,e,r)=>t<<32-r|e>>>r;e.shrSL=u;const h=(t,e,r)=>t>>>r|e<<32-r;e.rotrSH=h;const c=(t,e,r)=>t<<32-r|e>>>r;e.rotrSL=c;const f=(t,e,r)=>t<<64-r|e>>>r-32;e.rotrBH=f;const l=(t,e,r)=>t>>>r-32|e<<64-r;e.rotrBL=l;const d=(t,e)=>e;e.rotr32H=d;const p=(t,e)=>t;e.rotr32L=p;const m=(t,e,r)=>t<<r|e>>>32-r;e.rotlSH=m;const g=(t,e,r)=>e<<r|t>>>32-r;e.rotlSL=g;const b=(t,e,r)=>e<<r-32|t>>>64-r;e.rotlBH=b;const y=(t,e,r)=>t<<r-32|e>>>64-r;function v(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:0|i}}e.rotlBL=y,e.add=v;const w=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0);e.add3L=w;const M=(t,e,r,n)=>e+r+n+(t/2**32|0)|0;e.add3H=M;const E=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0);e.add4L=E;const S=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0;e.add4H=S;const _=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0);e.add5L=_;const k=(t,e,r,n,i,o)=>e+r+n+i+o+(t/2**32|0)|0;e.add5H=k;const A={fromBig:i,split:o,toBig:s,shrSH:a,shrSL:u,rotrSH:h,rotrSL:c,rotrBH:f,rotrBL:l,rotr32H:d,rotr32L:p,rotlSH:m,rotlSL:g,rotlBH:b,rotlBL:y,add:v,add3L:w,add3H:M,add4L:E,add4H:S,add5H:k,add5L:_};e.default=A},825:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.crypto=void 0,e.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},125:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.shake256=e.shake128=e.keccak_512=e.keccak_384=e.keccak_256=e.keccak_224=e.sha3_512=e.sha3_384=e.sha3_256=e.sha3_224=e.Keccak=e.keccakP=void 0;const n=r(3525),i=r(1655),o=r(64),[s,a,u]=[[],[],[]],h=BigInt(0),c=BigInt(1),f=BigInt(2),l=BigInt(7),d=BigInt(256),p=BigInt(113);for(let t=0,e=c,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],s.push(2*(5*n+r)),a.push((t+1)*(t+2)/2%64);let i=h;for(let t=0;t<7;t++)e=(e<<c^(e>>l)*p)%d,e&f&&(i^=c<<(c<<BigInt(t))-c);u.push(i)}const[m,g]=(0,i.split)(u,!0),b=(t,e,r)=>r>32?(0,i.rotlBH)(t,e,r):(0,i.rotlSH)(t,e,r),y=(t,e,r)=>r>32?(0,i.rotlBL)(t,e,r):(0,i.rotlSL)(t,e,r);function v(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let e=0;e<10;e++)r[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){const n=(e+8)%10,i=(e+2)%10,o=r[i],s=r[i+1],a=b(o,s,1)^r[n],u=y(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)t[e+r]^=a,t[e+r+1]^=u}let e=t[2],i=t[3];for(let r=0;r<24;r++){const n=a[r],o=b(e,i,n),u=y(e,i,n),h=s[r];e=t[h],i=t[h+1],t[h]=o,t[h+1]=u}for(let e=0;e<50;e+=10){for(let n=0;n<10;n++)r[n]=t[e+n];for(let n=0;n<10;n++)t[e+n]^=~r[(n+2)%10]&r[(n+4)%10]}t[0]^=m[n],t[1]^=g[n]}r.fill(0)}e.keccakP=v;class w extends o.Hash{constructor(t,e,r,i=!1,s=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=r,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,n.number)(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,o.u32)(this.state)}keccak(){v(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){(0,n.exists)(this);const{blockLen:e,state:r}=this,i=(t=(0,o.toBytes)(t)).length;for(let n=0;n<i;){const o=Math.min(e-this.pos,i-n);for(let e=0;e<o;e++)r[this.pos++]^=t[n++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:e,pos:r,blockLen:n}=this;t[r]^=e,0!=(128&e)&&r===n-1&&this.keccak(),t[n-1]^=128,this.keccak()}writeInto(t){(0,n.exists)(this,!1),(0,n.bytes)(t),this.finish();const e=this.state,{blockLen:r}=this;for(let n=0,i=t.length;n<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-n);t.set(e.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,n.number)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,n.output)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:e,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return t||(t=new w(e,r,n,o,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=n,t.enableXOF=o,t.destroyed=this.destroyed,t}}e.Keccak=w;const M=(t,e,r)=>(0,o.wrapConstructor)((()=>new w(e,t,r)));e.sha3_224=M(6,144,28),e.sha3_256=M(6,136,32),e.sha3_384=M(6,104,48),e.sha3_512=M(6,72,64),e.keccak_224=M(1,144,28),e.keccak_256=M(1,136,32),e.keccak_384=M(1,104,48),e.keccak_512=M(1,72,64);const E=(t,e,r)=>(0,o.wrapXOFConstructorWithOpts)(((n={})=>new w(e,t,void 0===n.dkLen?r:n.dkLen,!0)));e.shake128=E(31,168,16),e.shake256=E(31,136,32)},64:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.randomBytes=e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.checkOpts=e.Hash=e.concatBytes=e.toBytes=e.utf8ToBytes=e.asyncLoop=e.nextTick=e.hexToBytes=e.bytesToHex=e.isLE=e.rotr=e.createView=e.u32=e.u8=void 0;const n=r(825),i=t=>t instanceof Uint8Array;e.u8=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength);e.u32=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4));e.createView=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.rotr=(t,e)=>t<<32-e|t>>>e,e.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!e.isLE)throw new Error("Non little-endian hardware is not supported");const o=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));e.bytesToHex=function(t){if(!i(t))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=o[t[r]];return e},e.hexToBytes=function(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(e/2);for(let e=0;e<r.length;e++){const n=2*e,i=t.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");r[e]=o}return r};function s(t){if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array((new TextEncoder).encode(t))}function a(t){if("string"==typeof t&&(t=s(t)),!i(t))throw new Error("expected Uint8Array, got "+typeof t);return t}e.nextTick=async()=>{},e.asyncLoop=async function(t,r,n){let i=Date.now();for(let o=0;o<t;o++){n(o);const t=Date.now()-i;t>=0&&t<r||(await(0,e.nextTick)(),i+=t)}},e.utf8ToBytes=s,e.toBytes=a,e.concatBytes=function(...t){const e=new Uint8Array(t.reduce(((t,e)=>t+e.length),0));let r=0;return t.forEach((t=>{if(!i(t))throw new Error("Uint8Array expected");e.set(t,r),r+=t.length})),e};e.Hash=class{clone(){return this._cloneInto()}};const u={}.toString;e.checkOpts=function(t,e){if(void 0!==e&&"[object Object]"!==u.call(e))throw new Error("Options should be object or undefined");return Object.assign(t,e)},e.wrapConstructor=function(t){const e=e=>t().update(a(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e},e.wrapConstructorWithOpts=function(t){const e=(e,r)=>t(r).update(a(e)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e},e.wrapXOFConstructorWithOpts=function(t){const e=(e,r)=>t(r).update(a(e)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e},e.randomBytes=function(t=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}},2812:(t,e,r)=>{"use strict";const n=e;n.bignum=r(735),n.define=r(5192).define,n.base=r(4798),n.constants=r(6906),n.decoders=r(8211),n.encoders=r(9116)},5192:(t,e,r)=>{"use strict";const n=r(9116),i=r(8211),o=r(1285);function s(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new s(t,e)},s.prototype._createNamed=function(t){const e=this.name;function r(t){this._initNamed(t,e)}return o(r,t),r.prototype._initNamed=function(e,r){t.call(this,e,r)},new r(this)},s.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(i[t])),this.decoders[t]},s.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},s.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(n[t])),this.encoders[t]},s.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},7362:(t,e,r)=>{"use strict";const n=r(1285),i=r(126).b,o=r(7654).Buffer;function s(t,e){i.call(this,e),o.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function a(t,e){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return a.isEncoderBuffer(t)||(t=new a(t,e)),this.length+=t.length,t}),this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=o.byteLength(t);else{if(!o.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}n(s,i),e.C=s,s.isDecoderBuffer=function(t){if(t instanceof s)return!0;return"object"==typeof t&&o.isBuffer(t.base)&&"DecoderBuffer"===t.constructor.name&&"number"==typeof t.offset&&"number"==typeof t.length&&"function"==typeof t.save&&"function"==typeof t.restore&&"function"==typeof t.isEmpty&&"function"==typeof t.readUInt8&&"function"==typeof t.skip&&"function"==typeof t.raw},s.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},s.prototype.restore=function(t){const e=new s(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,i.prototype.restore.call(this,t.reporter),e},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},s.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");const r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r},s.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},e.R=a,a.isEncoderBuffer=function(t){if(t instanceof a)return!0;return"object"==typeof t&&"EncoderBuffer"===t.constructor.name&&"number"==typeof t.length&&"function"==typeof t.join},a.prototype.join=function(t,e){return t||(t=o.alloc(this.length)),e||(e=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(t,e),e+=r.length})):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):o.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length)),t}},4798:(t,e,r)=>{"use strict";const n=e;n.Reporter=r(126).b,n.DecoderBuffer=r(7362).C,n.EncoderBuffer=r(7362).R,n.Node=r(847)},847:(t,e,r)=>{"use strict";const n=r(126).b,i=r(7362).R,o=r(7362).C,s=r(9561),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function h(t,e,r){const n={};this._baseState=n,n.name=r,n.enc=t,n.parent=e||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}t.exports=h;const c=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];h.prototype.clone=function(){const t=this._baseState,e={};c.forEach((function(r){e[r]=t[r]}));const r=new this.constructor(e.parent);return r._baseState=e,r},h.prototype._wrap=function(){const t=this._baseState;u.forEach((function(e){this[e]=function(){const r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}}),this)},h.prototype._init=function(t){const e=this._baseState;s(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),s.equal(e.children.length,1,"Root node can have only one child")},h.prototype._useArgs=function(t){const e=this._baseState,r=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==r.length&&(s(null===e.children),e.children=r,r.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(s(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!=typeof t||t.constructor!==Object)return t;const e={};return Object.keys(t).forEach((function(r){r==(0|r)&&(r|=0);const n=t[r];e[n]=r})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){h.prototype[t]=function(){const e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),a.forEach((function(t){h.prototype[t]=function(){const e=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===e.tag),e.tag=t,this._useArgs(r),this}})),h.prototype.use=function(t){s(t);const e=this._baseState;return s(null===e.use),e.use=t,this},h.prototype.optional=function(){return this._baseState.optional=!0,this},h.prototype.def=function(t){const e=this._baseState;return s(null===e.default),e.default=t,e.optional=!0,this},h.prototype.explicit=function(t){const e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.explicit=t,this},h.prototype.implicit=function(t){const e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.implicit=t,this},h.prototype.obj=function(){const t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},h.prototype.key=function(t){const e=this._baseState;return s(null===e.key),e.key=t,this},h.prototype.any=function(){return this._baseState.any=!0,this},h.prototype.choice=function(t){const e=this._baseState;return s(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},h.prototype.contains=function(t){const e=this._baseState;return s(null===e.use),e.contains=t,this},h.prototype._decode=function(t,e){const r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));let n,i=r.default,s=!0,a=null;if(null!==r.key&&(a=t.enterKey(r.key)),r.optional){let n=null;if(null!==r.explicit?n=r.explicit:null!==r.implicit?n=r.implicit:null!==r.tag&&(n=r.tag),null!==n||r.any){if(s=this._peekTag(t,n,r.any),t.isError(s))return s}else{const n=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),s=!0}catch(t){s=!1}t.restore(n)}}if(r.obj&&s&&(n=t.enterObject()),s){if(null!==r.explicit){const e=this._decodeTag(t,r.explicit);if(t.isError(e))return e;t=e}const n=t.offset;if(null===r.use&&null===r.choice){let e;r.any&&(e=t.save());const n=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(n))return n;r.any?i=t.raw(e):t=n}if(e&&e.track&&null!==r.tag&&e.track(t.path(),n,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e)),t.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(t,e)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){const n=new o(i);i=this._getUse(r.contains,t._reporterState.obj)._decode(n,e)}}return r.obj&&s&&(i=t.leaveObject(n)),null===r.key||null===i&&!0!==s?null!==a&&t.exitKey(a):t.leaveKey(a,r.key,i),i},h.prototype._decodeGeneric=function(t,e,r){const n=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,n.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&n.args?this._decodeObjid(e,n.args[0],n.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"objDesc"===t?this._decodeStr(e,t,r):"int"===t||"enum"===t?this._decodeInt(e,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},h.prototype._getUse=function(t,e){const r=this._baseState;return r.useDecoder=this._use(t,e),s(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},h.prototype._decodeChoice=function(t,e){const r=this._baseState;let n=null,i=!1;return Object.keys(r.choice).some((function(o){const s=t.save(),a=r.choice[o];try{const r=a._decode(t,e);if(t.isError(r))return!1;n={type:o,value:r},i=!0}catch(e){return t.restore(s),!1}return!0}),this),i?n:t.error("Choice not matched")},h.prototype._createEncoderBuffer=function(t){return new i(t,this.reporter)},h.prototype._encode=function(t,e,r){const n=this._baseState;if(null!==n.default&&n.default===t)return;const i=this._encodeValue(t,e,r);return void 0===i||this._skipDefault(i,e,r)?void 0:i},h.prototype._encodeValue=function(t,e,r){const i=this._baseState;if(null===i.parent)return i.children[0]._encode(t,e||new n);let o=null;if(this.reporter=e,i.optional&&void 0===t){if(null===i.default)return;t=i.default}let s=null,a=!1;if(i.any)o=this._createEncoderBuffer(t);else if(i.choice)o=this._encodeChoice(t,e);else if(i.contains)s=this._getUse(i.contains,r)._encode(t,e),a=!0;else if(i.children)s=i.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");const n=e.enterKey(r._baseState.key);if("object"!=typeof t)return e.error("Child expected, but input is not object");const i=r._encode(t[r._baseState.key],e,t);return e.leaveKey(n),i}),this).filter((function(t){return t})),s=this._createEncoderBuffer(s);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return e.error("Too many args for : "+i.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");const r=this.clone();r._baseState.implicit=null,s=this._createEncoderBuffer(t.map((function(r){const n=this._baseState;return this._getUse(n.args[0],t)._encode(r,e)}),r))}else null!==i.use?o=this._getUse(i.use,r)._encode(t,e):(s=this._encodePrimitive(i.tag,t),a=!0);if(!i.any&&null===i.choice){const t=null!==i.implicit?i.implicit:i.tag,r=null===i.implicit?"universal":"context";null===t?null===i.use&&e.error("Tag could be omitted only for .use()"):null===i.use&&(o=this._encodeComposite(t,a,r,s))}return null!==i.explicit&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o},h.prototype._encodeChoice=function(t,e){const r=this._baseState,n=r.choice[t.type];return n||s(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(t.value,e)},h.prototype._encodePrimitive=function(t,e){const r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},h.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},h.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)}},126:(t,e,r)=>{"use strict";const n=r(1285);function i(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,e){this.path=t,this.rethrow(e)}e.b=i,i.prototype.isError=function(t){return t instanceof o},i.prototype.save=function(){const t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},i.prototype.restore=function(t){const e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},i.prototype.enterKey=function(t){return this._reporterState.path.push(t)},i.prototype.exitKey=function(t){const e=this._reporterState;e.path=e.path.slice(0,t-1)},i.prototype.leaveKey=function(t,e,r){const n=this._reporterState;this.exitKey(t),null!==n.obj&&(n.obj[e]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){const t=this._reporterState,e=t.obj;return t.obj={},e},i.prototype.leaveObject=function(t){const e=this._reporterState,r=e.obj;return e.obj=t,r},i.prototype.error=function(t){let e;const r=this._reporterState,n=t instanceof o;if(e=n?t:new o(r.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!r.options.partial)throw e;return n||r.errors.push(e),e},i.prototype.wrapResult=function(t){const e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},n(o,Error),o.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},4131:(t,e)=>{"use strict";function r(t){const e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);const n=t[r];e[n]=r})),e}e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=r(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=r(e.tag)},6906:(t,e,r)=>{"use strict";const n=e;n._reverse=function(t){const e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);const n=t[r];e[n]=r})),e},n.der=r(4131)},1066:(t,e,r)=>{"use strict";const n=r(1285),i=r(735),o=r(7362).C,s=r(847),a=r(4131);function u(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new h,this.tree._init(t.body)}function h(t){s.call(this,"der",t)}function c(t,e){let r=t.readUInt8(e);if(t.isError(r))return r;const n=a.tagClass[r>>6],i=0==(32&r);if(31==(31&r)){let n=r;for(r=0;128==(128&n);){if(n=t.readUInt8(e),t.isError(n))return n;r<<=7,r|=127&n}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:a.tag[r]}}function f(t,e,r){let n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&128===n)return null;if(0==(128&n))return n;const i=127&n;if(i>4)return t.error("length octect is too long");n=0;for(let e=0;e<i;e++){n<<=8;const e=t.readUInt8(r);if(t.isError(e))return e;n|=e}return n}t.exports=u,u.prototype.decode=function(t,e){return o.isDecoderBuffer(t)||(t=new o(t,e)),this.tree._decode(t,e)},n(h,s),h.prototype._peekTag=function(t,e,r){if(t.isEmpty())return!1;const n=t.save(),i=c(t,'Failed to peek tag: "'+e+'"');return t.isError(i)?i:(t.restore(n),i.tag===e||i.tagStr===e||i.tagStr+"of"===e||r)},h.prototype._decodeTag=function(t,e,r){const n=c(t,'Failed to decode tag of "'+e+'"');if(t.isError(n))return n;let i=f(t,n.primitive,'Failed to get length of "'+e+'"');if(t.isError(i))return i;if(!r&&n.tag!==e&&n.tagStr!==e&&n.tagStr+"of"!==e)return t.error('Failed to match tag: "'+e+'"');if(n.primitive||null!==i)return t.skip(i,'Failed to match body of: "'+e+'"');const o=t.save(),s=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(s)?s:(i=t.offset-o.offset,t.restore(o),t.skip(i,'Failed to match body of: "'+e+'"'))},h.prototype._skipUntilEnd=function(t,e){for(;;){const r=c(t,e);if(t.isError(r))return r;const n=f(t,r.primitive,e);if(t.isError(n))return n;let i;if(i=r.primitive||null!==n?t.skip(n):this._skipUntilEnd(t,e),t.isError(i))return i;if("end"===r.tagStr)break}},h.prototype._decodeList=function(t,e,r,n){const i=[];for(;!t.isEmpty();){const e=this._peekTag(t,"end");if(t.isError(e))return e;const o=r.decode(t,"der",n);if(t.isError(o)&&e)break;i.push(o)}return i},h.prototype._decodeStr=function(t,e){if("bitstr"===e){const e=t.readUInt8();return t.isError(e)?e:{unused:e,data:t.raw()}}if("bmpstr"===e){const e=t.raw();if(e.length%2==1)return t.error("Decoding of string type: bmpstr length mismatch");let r="";for(let t=0;t<e.length/2;t++)r+=String.fromCharCode(e.readUInt16BE(2*t));return r}if("numstr"===e){const e=t.raw().toString("ascii");return this._isNumstr(e)?e:t.error("Decoding of string type: numstr unsupported characters")}if("octstr"===e)return t.raw();if("objDesc"===e)return t.raw();if("printstr"===e){const e=t.raw().toString("ascii");return this._isPrintstr(e)?e:t.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(e)?t.raw().toString():t.error("Decoding of string type: "+e+" unsupported")},h.prototype._decodeObjid=function(t,e,r){let n;const i=[];let o=0,s=0;for(;!t.isEmpty();)s=t.readUInt8(),o<<=7,o|=127&s,0==(128&s)&&(i.push(o),o=0);128&s&&i.push(o);const a=i[0]/40|0,u=i[0]%40;if(n=r?i:[a,u].concat(i.slice(1)),e){let t=e[n.join(" ")];void 0===t&&(t=e[n.join(".")]),void 0!==t&&(n=t)}return n},h.prototype._decodeTime=function(t,e){const r=t.raw().toString();let n,i,o,s,a,u;if("gentime"===e)n=0|r.slice(0,4),i=0|r.slice(4,6),o=0|r.slice(6,8),s=0|r.slice(8,10),a=0|r.slice(10,12),u=0|r.slice(12,14);else{if("utctime"!==e)return t.error("Decoding "+e+" time is not supported yet");n=0|r.slice(0,2),i=0|r.slice(2,4),o=0|r.slice(4,6),s=0|r.slice(6,8),a=0|r.slice(8,10),u=0|r.slice(10,12),n=n<70?2e3+n:1900+n}return Date.UTC(n,i-1,o,s,a,u,0)},h.prototype._decodeNull=function(){return null},h.prototype._decodeBool=function(t){const e=t.readUInt8();return t.isError(e)?e:0!==e},h.prototype._decodeInt=function(t,e){const r=t.raw();let n=new i(r);return e&&(n=e[n.toString(10)]||n),n},h.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getDecoder("der").tree}},8211:(t,e,r)=>{"use strict";const n=e;n.der=r(1066),n.pem=r(3956)},3956:(t,e,r)=>{"use strict";const n=r(1285),i=r(7654).Buffer,o=r(1066);function s(t){o.call(this,t),this.enc="pem"}n(s,o),t.exports=s,s.prototype.decode=function(t,e){const r=t.toString().split(/[\r\n]+/g),n=e.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/;let a=-1,u=-1;for(let t=0;t<r.length;t++){const e=r[t].match(s);if(null!==e&&e[2]===n){if(-1!==a){if("END"!==e[1])break;u=t;break}if("BEGIN"!==e[1])break;a=t}}if(-1===a||-1===u)throw new Error("PEM section not found for: "+n);const h=r.slice(a+1,u).join("");h.replace(/[^a-z0-9+/=]+/gi,"");const c=i.from(h,"base64");return o.prototype.decode.call(this,c,e)}},5758:(t,e,r)=>{"use strict";const n=r(1285),i=r(7654).Buffer,o=r(847),s=r(4131);function a(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new u,this.tree._init(t.body)}function u(t){o.call(this,"der",t)}function h(t){return t<10?"0"+t:t}t.exports=a,a.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},n(u,o),u.prototype._encodeComposite=function(t,e,r,n){const o=function(t,e,r,n){let i;"seqof"===t?t="seq":"setof"===t&&(t="set");if(s.tagByName.hasOwnProperty(t))i=s.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return n.error("Unknown tag: "+t);i=t}if(i>=31)return n.error("Multi-octet tag encoding unsupported");e||(i|=32);return i|=s.tagClassByName[r||"universal"]<<6,i}(t,e,r,this.reporter);if(n.length<128){const t=i.alloc(2);return t[0]=o,t[1]=n.length,this._createEncoderBuffer([t,n])}let a=1;for(let t=n.length;t>=256;t>>=8)a++;const u=i.alloc(2+a);u[0]=o,u[1]=128|a;for(let t=1+a,e=n.length;e>0;t--,e>>=8)u[t]=255&e;return this._createEncoderBuffer([u,n])},u.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){const e=i.alloc(2*t.length);for(let r=0;r<t.length;r++)e.writeUInt16BE(t.charCodeAt(r),2*r);return this._createEncoderBuffer(e)}return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(e)||"objDesc"===e?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+e+" unsupported")},u.prototype._encodeObjid=function(t,e,r){if("string"==typeof t){if(!e)return this.reporter.error("string objid given, but no values map found");if(!e.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=e[t].split(/[\s.]+/g);for(let e=0;e<t.length;e++)t[e]|=0}else if(Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]|=0}if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!r){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}let n=0;for(let e=0;e<t.length;e++){let r=t[e];for(n++;r>=128;r>>=7)n++}const o=i.alloc(n);let s=o.length-1;for(let e=t.length-1;e>=0;e--){let r=t[e];for(o[s--]=127&r;(r>>=7)>0;)o[s--]=128|127&r}return this._createEncoderBuffer(o)},u.prototype._encodeTime=function(t,e){let r;const n=new Date(t);return"gentime"===e?r=[h(n.getUTCFullYear()),h(n.getUTCMonth()+1),h(n.getUTCDate()),h(n.getUTCHours()),h(n.getUTCMinutes()),h(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[h(n.getUTCFullYear()%100),h(n.getUTCMonth()+1),h(n.getUTCDate()),h(n.getUTCHours()),h(n.getUTCMinutes()),h(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!i.isBuffer(t)){const e=t.toArray();!t.sign&&128&e[0]&&e.unshift(0),t=i.from(e)}if(i.isBuffer(t)){let e=t.length;0===t.length&&e++;const r=i.alloc(e);return t.copy(r),0===t.length&&(r[0]=0),this._createEncoderBuffer(r)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);let r=1;for(let e=t;e>=256;e>>=8)r++;const n=new Array(r);for(let e=n.length-1;e>=0;e--)n[e]=255&t,t>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(i.from(n))},u.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},u.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},u.prototype._skipDefault=function(t,e,r){const n=this._baseState;let i;if(null===n.default)return!1;const o=t.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,e,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i<o.length;i++)if(o[i]!==n.defaultBuffer[i])return!1;return!0}},9116:(t,e,r)=>{"use strict";const n=e;n.der=r(5758),n.pem=r(9245)},9245:(t,e,r)=>{"use strict";const n=r(1285),i=r(5758);function o(t){i.call(this,t),this.enc="pem"}n(o,i),t.exports=o,o.prototype.encode=function(t,e){const r=i.prototype.encode.call(this,t).toString("base64"),n=["-----BEGIN "+e.label+"-----"];for(let t=0;t<r.length;t+=64)n.push(r.slice(t,t+64));return n.push("-----END "+e.label+"-----"),n.join("\n")}},735:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(3397).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function h(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,c=r;c<a;c+=n)u=h(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var f=1;for(u=h(t,c,t.length,e),c=0;c<s;c++)f*=e;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","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"],f=[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],l=[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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var c=u>>>26,f=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[h]=0|f,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-i;a++)h[a]=0;for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[o-a-1]=s}return h},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,c=0|s[0],f=8191&c,l=c>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],b=8191&g,y=g>>>13,v=0|s[3],w=8191&v,M=v>>>13,E=0|s[4],S=8191&E,_=E>>>13,k=0|s[5],A=8191&k,x=k>>>13,I=0|s[6],B=8191&I,T=I>>>13,P=0|s[7],C=8191&P,R=P>>>13,O=0|s[8],L=8191&O,N=O>>>13,j=0|s[9],H=8191&j,D=j>>>13,U=0|a[0],F=8191&U,$=U>>>13,q=0|a[1],z=8191&q,G=q>>>13,V=0|a[2],J=8191&V,K=V>>>13,W=0|a[3],Z=8191&W,X=W>>>13,Y=0|a[4],Q=8191&Y,tt=Y>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],ft=8191&ct,lt=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(h+(n=Math.imul(f,F))|0)+((8191&(i=(i=Math.imul(f,$))+Math.imul(l,F)|0))<<13)|0;h=((o=Math.imul(l,$))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,$))+Math.imul(m,F)|0,o=Math.imul(m,$);var bt=(h+(n=n+Math.imul(f,z)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(l,z)|0))<<13)|0;h=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,F),i=(i=Math.imul(b,$))+Math.imul(y,F)|0,o=Math.imul(y,$),n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,z)|0,o=o+Math.imul(m,G)|0;var yt=(h+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(l,J)|0))<<13)|0;h=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,$))+Math.imul(M,F)|0,o=Math.imul(M,$),n=n+Math.imul(b,z)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,K)|0;var vt=(h+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(l,Z)|0))<<13)|0;h=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,$))+Math.imul(_,F)|0,o=Math.imul(_,$),n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,z)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,K)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var wt=(h+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(l,Q)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(A,F),i=(i=Math.imul(A,$))+Math.imul(x,F)|0,o=Math.imul(x,$),n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,K)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(h+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,F),i=(i=Math.imul(B,$))+Math.imul(T,F)|0,o=Math.imul(T,$),n=n+Math.imul(A,z)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(x,z)|0,o=o+Math.imul(x,G)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Et=(h+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,$))+Math.imul(R,F)|0,o=Math.imul(R,$),n=n+Math.imul(B,z)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,K)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(h+(n=n+Math.imul(f,ut)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,$))+Math.imul(N,F)|0,o=Math.imul(N,$),n=n+Math.imul(C,z)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,G)|0,n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,K)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,K)|0,n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,X)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var _t=(h+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(H,F),i=(i=Math.imul(H,$))+Math.imul(D,F)|0,o=Math.imul(D,$),n=n+Math.imul(L,z)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(N,z)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,K)|0,n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ft)|0,o=o+Math.imul(m,lt)|0;var kt=(h+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(H,z),i=(i=Math.imul(H,G))+Math.imul(D,z)|0,o=Math.imul(D,G),n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(y,ft)|0,o=o+Math.imul(y,lt)|0;var At=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(H,J),i=(i=Math.imul(H,K))+Math.imul(D,J)|0,o=Math.imul(D,K),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,X)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(M,ft)|0,o=o+Math.imul(M,lt)|0;var xt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(H,Z),i=(i=Math.imul(H,X))+Math.imul(D,Z)|0,o=Math.imul(D,X),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(S,ft)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,lt)|0;var It=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(H,Q),i=(i=Math.imul(H,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(A,ft)|0,i=(i=i+Math.imul(A,lt)|0)+Math.imul(x,ft)|0,o=o+Math.imul(x,lt)|0;var Bt=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(H,rt),i=(i=Math.imul(H,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ht)|0,n=n+Math.imul(B,ft)|0,i=(i=i+Math.imul(B,lt)|0)+Math.imul(T,ft)|0,o=o+Math.imul(T,lt)|0;var Tt=(h+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(H,ot),i=(i=Math.imul(H,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(L,ut)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(C,ft)|0,i=(i=i+Math.imul(C,lt)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,lt)|0;var Pt=(h+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(H,ut),i=(i=Math.imul(H,ht))+Math.imul(D,ut)|0,o=Math.imul(D,ht),n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,lt)|0)+Math.imul(N,ft)|0,o=o+Math.imul(N,lt)|0;var Ct=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(H,ft),i=(i=Math.imul(H,lt))+Math.imul(D,ft)|0,o=Math.imul(D,lt);var Rt=(h+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Ot=(h+(n=Math.imul(H,pt))|0)+((8191&(i=(i=Math.imul(H,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=bt,u[2]=yt,u[3]=vt,u[4]=wt,u[5]=Mt,u[6]=Et,u[7]=St,u[8]=_t,u[9]=kt,u[10]=At,u[11]=xt,u[12]=It,u[13]=Bt,u[14]=Tt,u[15]=Pt,u[16]=Ct,u[17]=Rt,u[18]=Ot,0!==h&&(u[19]=h,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var c=o-h,f=(0|t.words[c])*(0|e.words[h]),l=67108863&f;a=67108863&(l=l+a|0),i+=(s=(s=s+(f/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},g.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var f=u,l=h,d=0;d<s;d++){var p=r[c+d],m=n[c+d],g=r[c+d+s],b=n[c+d+s],y=f*g-l*b;b=f*b+l*g,g=y,r[c+d]=p+g,n[c+d]=m+b,r[c+d+s]=p-g,n[c+d+s]=m-b,d!==a&&(y=u*f-h*l,l=u*l+h*f,f=y)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),c=new Array(n),f=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,c,f,n,i);for(var d=0;d<n;d++){var p=a[d]*c[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),m(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var c=0;for(h=this.length-1;h>=0&&(0!==c||h>=i);h--){var f=0|this.words[h];this.words[h]=c<<26-o|f>>>o,c=f&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var l=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,f);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=l)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,l=1;0==(r.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function _(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(v,y),v.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,y),i(M,y),i(E,y),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return b[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var b=this.pow(f,new o(1).iushln(p-g-1));l=l.redMul(b),f=b.redSqr(),d=d.redMul(f),p=g}return l},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],c=u-1;c>=0;c--){var f=h>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new _(t)},i(_,S),_.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},_.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},_.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},_.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},_.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},5766:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=a(t),s=o[0],u=o[1],h=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,u)),c=0,f=u>0?s-4:s;for(r=0;r<f;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],h[c++]=e>>16&255,h[c++]=e>>8&255,h[c++]=255&e;2===u&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,h[c++]=255&e);1===u&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,h[c++]=e>>8&255,h[c++]=255&e);return h},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,h=n-i;a<h;a+=s)o.push(u(t,a,a+s>h?h:a+s));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,n){for(var i,o,s=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},6534:(t,e)=>{"use strict";e.gW=void 0;const r="qpzry9x8gf2tvdw0s3jn54khce6mua7l",n={};for(let t=0;t<32;t++){const e=r.charAt(t);n[e]=t}function i(t){const e=t>>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function o(t){let e=1;for(let r=0;r<t.length;++r){const n=t.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+t+")";e=i(e)^n>>5}e=i(e);for(let r=0;r<t.length;++r){const n=t.charCodeAt(r);e=i(e)^31&n}return e}function s(t,e,r,n){let i=0,o=0;const s=(1<<r)-1,a=[];for(let n=0;n<t.length;++n)for(i=i<<e|t[n],o+=e;o>=r;)o-=r,a.push(i>>o&s);if(n)o>0&&a.push(i<<r-o&s);else{if(o>=e)return"Excess padding";if(i<<r-o&s)return"Non-zero padding"}return a}function a(t){return s(t,8,5,!0)}function u(t){const e=s(t,5,8,!1);if(Array.isArray(e))return e}function h(t){const e=s(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}function c(t){let e;function s(t,r){if(r=r||90,t.length<8)return t+" too short";if(t.length>r)return"Exceeds length limit";const s=t.toLowerCase(),a=t.toUpperCase();if(t!==s&&t!==a)return"Mixed-case string "+t;const u=(t=s).lastIndexOf("1");if(-1===u)return"No separator character for "+t;if(0===u)return"Missing prefix for "+t;const h=t.slice(0,u),c=t.slice(u+1);if(c.length<6)return"Data too short";let f=o(h);if("string"==typeof f)return f;const l=[];for(let t=0;t<c.length;++t){const e=c.charAt(t),r=n[e];if(void 0===r)return"Unknown character "+e;f=i(f)^r,t+6>=c.length||l.push(r)}return f!==e?"Invalid checksum for "+t:{prefix:h,words:l}}return e="bech32"===t?1:734539939,{decodeUnsafe:function(t,e){const r=s(t,e);if("object"==typeof r)return r},decode:function(t,e){const r=s(t,e);if("object"==typeof r)return r;throw new Error(r)},encode:function(t,n,s){if(s=s||90,t.length+7+n.length>s)throw new TypeError("Exceeds length limit");let a=o(t=t.toLowerCase());if("string"==typeof a)throw new Error(a);let u=t+"1";for(let t=0;t<n.length;++t){const e=n[t];if(e>>5!=0)throw new Error("Non 5-bit word");a=i(a)^e,u+=r.charAt(e)}for(let t=0;t<6;++t)a=i(a);a^=e;for(let t=0;t<6;++t){u+=r.charAt(a>>5*(5-t)&31)}return u},toWords:a,fromWordsUnsafe:u,fromWords:h}}e.gW=c("bech32"),c("bech32m")},2197:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(3196).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function h(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u<a;u++){var h=t.charCodeAt(u)-48;o*=i,s=h>=49?h-49+10:h>=17?h-17+10:h,n(h>=0&&s<i,"Invalid character"),o+=s}return o}function c(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,c=r;c<a;c+=n)u=h(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var f=1;for(u=h(t,c,t.length,e),c=0;c<s;c++)f*=e;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype._move=function(t){c(t,this)},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(t){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],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];o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);o=a>>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?l[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],c=p[t];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modrn(c).toString(t);r=(f=f.idivn(c)).isZero()?m+r:l[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function m(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var c=u>>>26,f=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[h]=0|f,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===o?(r<t.length&&(t[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<t.length)for(t[r++]=n;r<t.length;)t[r++]=0},o.prototype._toArrayLikeBE=function(t,e){for(var r=t.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this._strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this._strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,c=0|s[0],f=8191&c,l=c>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],b=8191&g,y=g>>>13,v=0|s[3],w=8191&v,M=v>>>13,E=0|s[4],S=8191&E,_=E>>>13,k=0|s[5],A=8191&k,x=k>>>13,I=0|s[6],B=8191&I,T=I>>>13,P=0|s[7],C=8191&P,R=P>>>13,O=0|s[8],L=8191&O,N=O>>>13,j=0|s[9],H=8191&j,D=j>>>13,U=0|a[0],F=8191&U,$=U>>>13,q=0|a[1],z=8191&q,G=q>>>13,V=0|a[2],J=8191&V,K=V>>>13,W=0|a[3],Z=8191&W,X=W>>>13,Y=0|a[4],Q=8191&Y,tt=Y>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],ft=8191&ct,lt=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(h+(n=Math.imul(f,F))|0)+((8191&(i=(i=Math.imul(f,$))+Math.imul(l,F)|0))<<13)|0;h=((o=Math.imul(l,$))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,$))+Math.imul(m,F)|0,o=Math.imul(m,$);var bt=(h+(n=n+Math.imul(f,z)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(l,z)|0))<<13)|0;h=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,F),i=(i=Math.imul(b,$))+Math.imul(y,F)|0,o=Math.imul(y,$),n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,z)|0,o=o+Math.imul(m,G)|0;var yt=(h+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(l,J)|0))<<13)|0;h=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,$))+Math.imul(M,F)|0,o=Math.imul(M,$),n=n+Math.imul(b,z)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,K)|0;var vt=(h+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(l,Z)|0))<<13)|0;h=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,$))+Math.imul(_,F)|0,o=Math.imul(_,$),n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,z)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,K)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var wt=(h+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(l,Q)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(A,F),i=(i=Math.imul(A,$))+Math.imul(x,F)|0,o=Math.imul(x,$),n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,K)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(h+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,F),i=(i=Math.imul(B,$))+Math.imul(T,F)|0,o=Math.imul(T,$),n=n+Math.imul(A,z)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(x,z)|0,o=o+Math.imul(x,G)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Et=(h+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,$))+Math.imul(R,F)|0,o=Math.imul(R,$),n=n+Math.imul(B,z)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,K)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(h+(n=n+Math.imul(f,ut)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,$))+Math.imul(N,F)|0,o=Math.imul(N,$),n=n+Math.imul(C,z)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,G)|0,n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,K)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,K)|0,n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,X)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var _t=(h+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(H,F),i=(i=Math.imul(H,$))+Math.imul(D,F)|0,o=Math.imul(D,$),n=n+Math.imul(L,z)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(N,z)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,K)|0,n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ft)|0,o=o+Math.imul(m,lt)|0;var kt=(h+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(H,z),i=(i=Math.imul(H,G))+Math.imul(D,z)|0,o=Math.imul(D,G),n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(y,ft)|0,o=o+Math.imul(y,lt)|0;var At=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(H,J),i=(i=Math.imul(H,K))+Math.imul(D,J)|0,o=Math.imul(D,K),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,X)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(M,ft)|0,o=o+Math.imul(M,lt)|0;var xt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(H,Z),i=(i=Math.imul(H,X))+Math.imul(D,Z)|0,o=Math.imul(D,X),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(S,ft)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,lt)|0;var It=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(H,Q),i=(i=Math.imul(H,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(A,ft)|0,i=(i=i+Math.imul(A,lt)|0)+Math.imul(x,ft)|0,o=o+Math.imul(x,lt)|0;var Bt=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(H,rt),i=(i=Math.imul(H,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ht)|0,n=n+Math.imul(B,ft)|0,i=(i=i+Math.imul(B,lt)|0)+Math.imul(T,ft)|0,o=o+Math.imul(T,lt)|0;var Tt=(h+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(H,ot),i=(i=Math.imul(H,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(L,ut)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(C,ft)|0,i=(i=i+Math.imul(C,lt)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,lt)|0;var Pt=(h+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(H,ut),i=(i=Math.imul(H,ht))+Math.imul(D,ut)|0,o=Math.imul(D,ht),n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,lt)|0)+Math.imul(N,ft)|0,o=o+Math.imul(N,lt)|0;var Ct=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(H,ft),i=(i=Math.imul(H,lt))+Math.imul(D,ft)|0,o=Math.imul(D,lt);var Rt=(h+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Ot=(h+(n=Math.imul(H,pt))|0)+((8191&(i=(i=Math.imul(H,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=bt,u[2]=yt,u[3]=vt,u[4]=wt,u[5]=Mt,u[6]=Et,u[7]=St,u[8]=_t,u[9]=kt,u[10]=At,u[11]=xt,u[12]=It,u[13]=Bt,u[14]=Tt,u[15]=Pt,u[16]=Ct,u[17]=Rt,u[18]=Ot,0!==h&&(u[19]=h,r.length++),r};function b(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var c=o-h,f=(0|t.words[c])*(0|e.words[h]),l=67108863&f;a=67108863&(l=l+a|0),i+=(s=(s=s+(f/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function y(t,e,r){return b(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(g=m),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):r<63?m(this,t,e):r<1024?b(this,t,e):y(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},v.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},v.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},v.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var f=u,l=h,d=0;d<s;d++){var p=r[c+d],m=n[c+d],g=r[c+d+s],b=n[c+d+s],y=f*g-l*b;b=f*b+l*g,g=y,r[c+d]=p+g,n[c+d]=m+b,r[c+d+s]=p-g,n[c+d+s]=m-b,d!==a&&(y=u*f-h*l,l=u*l+h*f,f=y)}},v.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},v.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},v.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},v.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},v.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},v.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),c=new Array(n),f=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,c,f,n,i);for(var d=0;d<n;d++){var p=a[d]*c[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r._strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),y(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){var e=t<0;e&&(t=-t),n("number"==typeof t),n(t<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,s=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=t.words[n]>>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var c=0;for(h=this.length-1;h>=0&&(0!==c||h>=i);h--){var f=0|this.words[h];this.words[h]=c<<26-o|f>>>o,c=f&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var l=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,f);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=l)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,l=1;0==(r.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new A(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function M(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function E(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){M.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){M.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){M.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){A.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}M.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},M.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},M.prototype.split=function(t,e){t.iushrn(this.n,0,e)},M.prototype.imulK=function(t){return t.imul(this.k)},i(E,M),E.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},E.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(S,M),i(_,M),i(k,M),k.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new E;else if("p224"===t)e=new S;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new k}return w[t]=e,e},A.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},A.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(c(t,t.umod(this.m)._forceRed(this)),t)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},A.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},A.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var b=this.pow(f,new o(1).iushln(p-g-1));l=l.redMul(b),f=b.redSqr(),d=d.redMul(f),p=g}return l},A.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},A.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],c=u-1;c>=0;c--){var f=h>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},A.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},A.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new x(t)},i(x,A),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},2745:(t,e,r)=>{var n;function i(t){this.rand=t}if(t.exports=function(t){return n||(n=new i(null)),n.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(8087);if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(t){return o.randomBytes(t)}}catch(t){}},2970:(t,e,r)=>{var n=r(7834).Buffer;function i(t){n.isBuffer(t)||(t=n.from(t));for(var e=t.length/4|0,r=new Array(e),i=0;i<e;i++)r[i]=t.readUInt32BE(4*i);return r}function o(t){for(;0<t.length;t++)t[0]=0}function s(t,e,r,n,i){for(var o,s,a,u,h=r[0],c=r[1],f=r[2],l=r[3],d=t[0]^e[0],p=t[1]^e[1],m=t[2]^e[2],g=t[3]^e[3],b=4,y=1;y<i;y++)o=h[d>>>24]^c[p>>>16&255]^f[m>>>8&255]^l[255&g]^e[b++],s=h[p>>>24]^c[m>>>16&255]^f[g>>>8&255]^l[255&d]^e[b++],a=h[m>>>24]^c[g>>>16&255]^f[d>>>8&255]^l[255&p]^e[b++],u=h[g>>>24]^c[d>>>16&255]^f[p>>>8&255]^l[255&m]^e[b++],d=o,p=s,m=a,g=u;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[m>>>8&255]<<8|n[255&g])^e[b++],s=(n[p>>>24]<<24|n[m>>>16&255]<<16|n[g>>>8&255]<<8|n[255&d])^e[b++],a=(n[m>>>24]<<24|n[g>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^e[b++],u=(n[g>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&m])^e[b++],[o>>>=0,s>>>=0,a>>>=0,u>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,u=0;u<256;++u){var h=a^a<<1^a<<2^a<<3^a<<4;h=h>>>8^255&h^99,r[s]=h,n[h]=s;var c=t[s],f=t[c],l=t[f],d=257*t[h]^16843008*h;i[0][s]=d<<24|d>>>8,i[1][s]=d<<16|d>>>16,i[2][s]=d<<8|d>>>24,i[3][s]=d,d=16843009*l^65537*f^257*c^16843008*s,o[0][h]=d<<24|d>>>8,o[1][h]=d<<16|d>>>16,o[2][h]=d<<8|d>>>24,o[3][h]=d,0===s?s=a=1:(s=c^t[t[t[l^c]]],a^=t[t[a]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function h(t){this._key=i(t),this._reset()}h.blockSize=16,h.keySize=32,h.prototype.blockSize=h.blockSize,h.prototype.keySize=h.keySize,h.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],o=0;o<e;o++)i[o]=t[o];for(o=e;o<n;o++){var s=i[o-1];o%e==0?(s=s<<8|s>>>24,s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s],s^=a[o/e|0]<<24):e>6&&o%e==4&&(s=u.SBOX[s>>>24]<<24|u.SBOX[s>>>16&255]<<16|u.SBOX[s>>>8&255]<<8|u.SBOX[255&s]),i[o]=i[o-e]^s}for(var h=[],c=0;c<n;c++){var f=n-c,l=i[f-(c%4?0:4)];h[c]=c<4||f<=4?l:u.INV_SUB_MIX[0][u.SBOX[l>>>24]]^u.INV_SUB_MIX[1][u.SBOX[l>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[l>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&l]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=h},h.prototype.encryptBlockRaw=function(t){return s(t=i(t),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},h.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=n.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},h.prototype.decryptBlock=function(t){var e=(t=i(t))[1];t[1]=t[3],t[3]=e;var r=s(t,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},h.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=h},3313:(t,e,r)=>{var n=r(2970),i=r(7834).Buffer,o=r(3973),s=r(1285),a=r(2895),u=r(1313),h=r(4182);function c(t,e,r,s){o.call(this);var u=i.alloc(4,0);this._cipher=new n.AES(e);var c=this._cipher.encryptBlock(u);this._ghash=new a(c),r=function(t,e,r){if(12===e.length)return t._finID=i.concat([e,i.from([0,0,0,1])]),i.concat([e,i.from([0,0,0,2])]);var n=new a(r),o=e.length,s=o%16;n.update(e),s&&(s=16-s,n.update(i.alloc(s,0))),n.update(i.alloc(8,0));var u=8*o,c=i.alloc(8);c.writeUIntBE(u,0,8),n.update(c),t._finID=n.state;var f=i.from(t._finID);return h(f),f}(this,r,c),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}s(c,o),c.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=i.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},c.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var r=0;t.length!==e.length&&r++;for(var n=Math.min(t.length,e.length),i=0;i<n;++i)r+=t[i]^e[i];return r}(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=t,this._cipher.scrub()},c.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},c.prototype.setAuthTag=function(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t},c.prototype.setAAD=function(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length},t.exports=c},10:(t,e,r)=>{var n=r(9309),i=r(7612),o=r(9234);e.createCipher=e.Cipher=n.createCipher,e.createCipheriv=e.Cipheriv=n.createCipheriv,e.createDecipher=e.Decipher=i.createDecipher,e.createDecipheriv=e.Decipheriv=i.createDecipheriv,e.listCiphers=e.getCiphers=function(){return Object.keys(o)}},7612:(t,e,r)=>{var n=r(3313),i=r(7834).Buffer,o=r(8702),s=r(7041),a=r(3973),u=r(2970),h=r(9341);function c(t,e,r){a.call(this),this._cache=new f,this._last=void 0,this._cipher=new u.AES(e),this._prev=i.from(r),this._mode=t,this._autopadding=!0}function f(){this.cache=i.allocUnsafe(0)}function l(t,e,r){var a=o[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof e&&(e=i.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===a.type?new s(a.module,e,r,!0):"auth"===a.type?new n(a.module,e,r,!0):new c(a.module,e,r)}r(1285)(c,a),c.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),n.push(r);return i.concat(n)},c.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");var r=-1;for(;++r<e;)if(t[r+(16-e)]!==e)throw new Error("unable to decrypt data");if(16===e)return;return t.slice(0,16-e)}(this._mode.decrypt(this,t));if(t)throw new Error("data not multiple of block length")},c.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},f.prototype.add=function(t){this.cache=i.concat([this.cache,t])},f.prototype.get=function(t){var e;if(t){if(this.cache.length>16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},f.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=h(e,!1,r.key,r.iv);return l(t,n.key,n.iv)},e.createDecipheriv=l},9309:(t,e,r)=>{var n=r(8702),i=r(3313),o=r(7834).Buffer,s=r(7041),a=r(3973),u=r(2970),h=r(9341);function c(t,e,r){a.call(this),this._cache=new l,this._cipher=new u.AES(e),this._prev=o.from(r),this._mode=t,this._autopadding=!0}r(1285)(c,a),c.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get();)r=this._mode.encrypt(this,e),n.push(r);return o.concat(n)};var f=o.alloc(16,16);function l(){this.cache=o.allocUnsafe(0)}function d(t,e,r){var a=n[t.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=o.from(e)),e.length!==a.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==a.mode&&r.length!==a.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===a.type?new s(a.module,e,r):"auth"===a.type?new i(a.module,e,r):new c(a.module,e,r)}c.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(f))throw this._cipher.scrub(),new Error("data not multiple of block length")},c.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},l.prototype.add=function(t){this.cache=o.concat([this.cache,t])},l.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},l.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r<t;)e.writeUInt8(t,r);return o.concat([this.cache,e])},e.createCipheriv=d,e.createCipher=function(t,e){var r=n[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=h(e,!1,r.key,r.iv);return d(t,i.key,i.iv)}},2895:(t,e,r)=>{var n=r(7834).Buffer,i=n.alloc(16,0);function o(t){var e=n.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function s(t){this.h=t,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}s.prototype.ghash=function(t){for(var e=-1;++e<t.length;)this.state[e]^=t[e];this._multiply()},s.prototype._multiply=function(){for(var t,e,r,n=[(t=this.h).readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)],i=[0,0,0,0],s=-1;++s<128;){for(0!=(this.state[~~(s/8)]&1<<7-s%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=0!=(1&n[3]),e=3;e>0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},s.prototype.update=function(t){var e;for(this.cache=n.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},s.prototype.final=function(t,e){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=s},4182:t=>{t.exports=function(t){for(var e,r=t.length;r--;){if(255!==(e=t.readUInt8(r))){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}},8796:(t,e,r)=>{var n=r(1313);e.encrypt=function(t,e){var r=n(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},e.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return n(i,r)}},6528:(t,e,r)=>{var n=r(7834).Buffer,i=r(1313);function o(t,e,r){var o=e.length,s=i(e,t._cache);return t._cache=t._cache.slice(o),t._prev=n.concat([t._prev,r?e:s]),s}e.encrypt=function(t,e,r){for(var i,s=n.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=n.allocUnsafe(0)),!(t._cache.length<=e.length)){s=n.concat([s,o(t,e,r)]);break}i=t._cache.length,s=n.concat([s,o(t,e.slice(0,i),r)]),e=e.slice(i)}return s}},918:(t,e,r)=>{var n=r(7834).Buffer;function i(t,e,r){for(var n,i,s=-1,a=0;++s<8;)n=e&1<<7-s?128:0,a+=(128&(i=t._cipher.encryptBlock(t._prev)[0]^n))>>s%8,t._prev=o(t._prev,r?n:i);return a}function o(t,e){var r=t.length,i=-1,o=n.allocUnsafe(t.length);for(t=n.concat([t,n.from([e])]);++i<r;)o[i]=t[i]<<1|t[i+1]>>7;return o}e.encrypt=function(t,e,r){for(var o=e.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=i(t,e[a],r);return s}},7263:(t,e,r)=>{var n=r(7834).Buffer;function i(t,e,r){var i=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=n.concat([t._prev.slice(1),n.from([r?e:i])]),i}e.encrypt=function(t,e,r){for(var o=e.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=i(t,e[a],r);return s}},8219:(t,e,r)=>{var n=r(1313),i=r(7834).Buffer,o=r(4182);function s(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}e.encrypt=function(t,e){var r=Math.ceil(e.length/16),o=t._cache.length;t._cache=i.concat([t._cache,i.allocUnsafe(16*r)]);for(var a=0;a<r;a++){var u=s(t),h=o+16*a;t._cache.writeUInt32BE(u[0],h+0),t._cache.writeUInt32BE(u[1],h+4),t._cache.writeUInt32BE(u[2],h+8),t._cache.writeUInt32BE(u[3],h+12)}var c=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),n(e,c)}},7028:(t,e)=>{e.encrypt=function(t,e){return t._cipher.encryptBlock(e)},e.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},8702:(t,e,r)=>{var n={ECB:r(7028),CBC:r(8796),CFB:r(6528),CFB8:r(7263),CFB1:r(918),OFB:r(4256),CTR:r(8219),GCM:r(8219)},i=r(9234);for(var o in i)i[o].module=n[i[o].mode];t.exports=i},4256:(t,e,r)=>{var n=r(8834).Buffer,i=r(1313);function o(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}e.encrypt=function(t,e){for(;t._cache.length<e.length;)t._cache=n.concat([t._cache,o(t)]);var r=t._cache.slice(0,e.length);return t._cache=t._cache.slice(e.length),i(e,r)}},7041:(t,e,r)=>{var n=r(2970),i=r(7834).Buffer,o=r(3973);function s(t,e,r,s){o.call(this),this._cipher=new n.AES(e),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=s,this._mode=t}r(1285)(s,o),s.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},s.prototype._final=function(){this._cipher.scrub()},t.exports=s},3667:(t,e,r)=>{var n=r(7214),i=r(10),o=r(8702),s=r(2820),a=r(9341);function u(t,e,r){if(t=t.toLowerCase(),o[t])return i.createCipheriv(t,e,r);if(s[t])return new n({key:e,iv:r,mode:t});throw new TypeError("invalid suite type")}function h(t,e,r){if(t=t.toLowerCase(),o[t])return i.createDecipheriv(t,e,r);if(s[t])return new n({key:e,iv:r,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}e.createCipher=e.Cipher=function(t,e){var r,n;if(t=t.toLowerCase(),o[t])r=o[t].key,n=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,n=s[t].iv}var i=a(e,!1,r,n);return u(t,i.key,i.iv)},e.createCipheriv=e.Cipheriv=u,e.createDecipher=e.Decipher=function(t,e){var r,n;if(t=t.toLowerCase(),o[t])r=o[t].key,n=o[t].iv;else{if(!s[t])throw new TypeError("invalid suite type");r=8*s[t].key,n=s[t].iv}var i=a(e,!1,r,n);return h(t,i.key,i.iv)},e.createDecipheriv=e.Decipheriv=h,e.listCiphers=e.getCiphers=function(){return Object.keys(s).concat(i.getCiphers())}},7214:(t,e,r)=>{var n=r(3973),i=r(4387),o=r(1285),s=r(7834).Buffer,a={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function u(t){n.call(this);var e,r=t.mode.toLowerCase(),i=a[r];e=t.decrypt?"decrypt":"encrypt";var o=t.key;s.isBuffer(o)||(o=s.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=s.concat([o,o.slice(0,8)]));var u=t.iv;s.isBuffer(u)||(u=s.from(u)),this._des=i.create({key:o,iv:u,type:e})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],t.exports=u,o(u,n),u.prototype._update=function(t){return s.from(this._des.update(t))},u.prototype._final=function(){return s.from(this._des.final())}},2820:(t,e)=>{e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},1857:(t,e,r)=>{var n=r(8834).Buffer,i=r(2197),o=r(5003);function s(t){var e,r=t.modulus.byteLength();do{e=new i(o(r))}while(e.cmp(t.modulus)>=0||!e.umod(t.prime1)||!e.umod(t.prime2));return e}function a(t,e){var r=function(t){var e=s(t);return{blinder:e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(e),o=e.modulus.byteLength(),a=new i(t).mul(r.blinder).umod(e.modulus),u=a.toRed(i.mont(e.prime1)),h=a.toRed(i.mont(e.prime2)),c=e.coefficient,f=e.prime1,l=e.prime2,d=u.redPow(e.exponent1).fromRed(),p=h.redPow(e.exponent2).fromRed(),m=d.isub(p).imul(c).umod(f).imul(l);return p.iadd(m).imul(r.unblinder).umod(e.modulus).toArrayLike(n,"be",o)}a.getr=s,t.exports=a},4778:(t,e,r)=>{"use strict";t.exports=r(26)},5263:(t,e,r)=>{"use strict";var n=r(7834).Buffer,i=r(6162),o=r(7525),s=r(1285),a=r(262),u=r(5643),h=r(26);function c(t){o.Writable.call(this);var e=h[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function f(t){o.Writable.call(this);var e=h[t];if(!e)throw new Error("Unknown message digest");this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function l(t){return new c(t)}function d(t){return new f(t)}Object.keys(h).forEach((function(t){h[t].id=n.from(h[t].id,"hex"),h[t.toLowerCase()]=h[t]})),s(c,o.Writable),c.prototype._write=function(t,e,r){this._hash.update(t),r()},c.prototype.update=function(t,e){return this._hash.update("string"==typeof t?n.from(t,e):t),this},c.prototype.sign=function(t,e){this.end();var r=this._hash.digest(),n=a(r,t,this._hashType,this._signType,this._tag);return e?n.toString(e):n},s(f,o.Writable),f.prototype._write=function(t,e,r){this._hash.update(t),r()},f.prototype.update=function(t,e){return this._hash.update("string"==typeof t?n.from(t,e):t),this},f.prototype.verify=function(t,e,r){var i="string"==typeof e?n.from(e,r):e;this.end();var o=this._hash.digest();return u(i,o,t,this._signType,this._tag)},t.exports={Sign:l,Verify:d,createSign:l,createVerify:d}},262:(t,e,r)=>{"use strict";var n=r(7834).Buffer,i=r(11),o=r(1857),s=r(7554).ec,a=r(2197),u=r(8016),h=r(9167);function c(t,e,r,o){if((t=n.from(t.toArray())).length<e.byteLength()){var s=n.alloc(e.byteLength()-t.length);t=n.concat([s,t])}var a=r.length,u=function(t,e){t=f(t,e),t=t.mod(e);var r=n.from(t.toArray());if(r.length<e.byteLength()){var i=n.alloc(e.byteLength()-r.length);r=n.concat([i,r])}return r}(r,e),h=n.alloc(a);h.fill(1);var c=n.alloc(a);return c=i(o,c).update(h).update(n.from([0])).update(t).update(u).digest(),h=i(o,c).update(h).digest(),{k:c=i(o,c).update(h).update(n.from([1])).update(t).update(u).digest(),v:h=i(o,c).update(h).digest()}}function f(t,e){var r=new a(t),n=(t.length<<3)-e.bitLength();return n>0&&r.ishrn(n),r}function l(t,e,r){var o,s;do{for(o=n.alloc(0);8*o.length<t.bitLength();)e.v=i(r,e.k).update(e.v).digest(),o=n.concat([o,e.v]);s=f(o,t),e.k=i(r,e.k).update(e.v).update(n.from([0])).digest(),e.v=i(r,e.k).update(e.v).digest()}while(-1!==s.cmp(t));return s}function d(t,e,r,n){return t.toRed(a.mont(r)).redPow(e).fromRed().mod(n)}t.exports=function(t,e,r,i,p){var m=u(e);if(m.curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");return function(t,e){var r=h[e.curve.join(".")];if(!r)throw new Error("unknown curve "+e.curve.join("."));var i=new s(r).keyFromPrivate(e.privateKey),o=i.sign(t);return n.from(o.toDER())}(t,m)}if("dsa"===m.type){if("dsa"!==i)throw new Error("wrong private key type");return function(t,e,r){var i,o=e.params.priv_key,s=e.params.p,u=e.params.q,h=e.params.g,p=new a(0),m=f(t,u).mod(u),g=!1,b=c(o,u,t,r);for(;!1===g;)p=d(h,i=l(u,b,r),s,u),0===(g=i.invm(u).imul(m.add(o.mul(p))).mod(u)).cmpn(0)&&(g=!1,p=new a(0));return function(t,e){t=t.toArray(),e=e.toArray(),128&t[0]&&(t=[0].concat(t));128&e[0]&&(e=[0].concat(e));var r=t.length+e.length+4,i=[48,r,2,t.length];return i=i.concat(t,[2,e.length],e),n.from(i)}(p,g)}(t,m,r)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");if(void 0!==e.padding&&1!==e.padding)throw new Error("illegal or unsupported padding mode");t=n.concat([p,t]);for(var g=m.modulus.byteLength(),b=[0,1];t.length+b.length+1<g;)b.push(255);b.push(0);for(var y=-1;++y<t.length;)b.push(t[y]);return o(b,m)},t.exports.getKey=c,t.exports.makeKey=l},5643:(t,e,r)=>{"use strict";var n=r(7834).Buffer,i=r(2197),o=r(7554).ec,s=r(8016),a=r(9167);function u(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=0)throw new Error("invalid sig")}t.exports=function(t,e,r,h,c){var f=s(r);if("ec"===f.type){if("ecdsa"!==h&&"ecdsa/rsa"!==h)throw new Error("wrong public key type");return function(t,e,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new o(n),s=r.data.subjectPrivateKey.data;return i.verify(e,t,s)}(t,e,f)}if("dsa"===f.type){if("dsa"!==h)throw new Error("wrong public key type");return function(t,e,r){var n=r.data.p,o=r.data.q,a=r.data.g,h=r.data.pub_key,c=s.signature.decode(t,"der"),f=c.s,l=c.r;u(f,o),u(l,o);var d=i.mont(n),p=f.invm(o),m=a.toRed(d).redPow(new i(e).mul(p).mod(o)).fromRed().mul(h.toRed(d).redPow(l.mul(p).mod(o)).fromRed()).mod(n).mod(o);return 0===m.cmp(l)}(t,e,f)}if("rsa"!==h&&"ecdsa/rsa"!==h)throw new Error("wrong public key type");e=n.concat([c,e]);for(var l=f.modulus.byteLength(),d=[1],p=0;e.length+d.length+2<l;)d.push(255),p+=1;d.push(0);for(var m=-1;++m<e.length;)d.push(e[m]);d=n.from(d);var g=i.mont(f.modulus);t=(t=new i(t).toRed(g)).redPow(new i(f.publicExponent)),t=n.from(t.fromRed().toArray());var b=p<8?1:0;for(l=Math.min(t.length,d.length),t.length!==d.length&&(b=1),m=-1;++m<l;)b|=t[m]^d[m];return 0===b}},1313:(t,e,r)=>{var n=r(8834).Buffer;t.exports=function(t,e){for(var r=Math.min(t.length,e.length),i=new n(r),o=0;o<r;++o)i[o]=t[o]^e[o];return i}},8834:(t,e,r)=>{"use strict";const n=r(5766),i=r(2333),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return h(t,e,r)}function h(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|m(t,e);let n=a(r);const i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(W(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return l(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(W(t,ArrayBuffer)||t&&W(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(W(t,SharedArrayBuffer)||t&&W(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);const i=function(t){if(u.isBuffer(t)){const e=0|p(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||Z(t.length)?a(0):l(t);if("Buffer"===t.type&&Array.isArray(t.data))return l(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return c(t),a(t<0?0:0|p(t))}function l(t){const e=t.length<0?0:0|p(t.length),r=a(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,u.prototype),n}function p(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function m(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||W(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return V(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(t).length;default:if(i)return n?-1:V(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return I(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return k(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;o<a;o++)if(h(t,o)===h(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(h(t,o+n)!==h(e,n)){r=!1;break}if(r)return o}return-1}function w(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(e.substr(2*s,2),16);if(Z(n))return s;t[r+s]=n}return s}function M(t,e,r,n){return K(V(e,t.length-r),t,r,n)}function E(t,e,r,n){return K(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function S(t,e,r,n){return K(J(e),t,r,n)}function _(t,e,r,n){return K(function(t,e){let r,n,i;const o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function k(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,s=e>239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=x)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=x));return r}(n)}e.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return h(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return function(t,e,r){return c(t),t<=0?a(t):void 0!==e?"string"==typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}(t,e,r)},u.allocUnsafe=function(t){return f(t)},u.allocUnsafeSlow=function(t){return f(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(W(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),W(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=u.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(W(e,Uint8Array))i+e.length>n.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=m,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)b(this,e,e+1);return this},u.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)b(this,e,e+3),b(this,e+1,e+2);return this},u.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)b(this,e,e+7),b(this,e+1,e+6),b(this,e+2,e+5),b(this,e+3,e+4);return this},u.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?A(this,0,t):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(W(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),h=this.slice(n,i),c=t.slice(e,r);for(let t=0;t<a;++t)if(h[t]!==c[t]){o=h[t],s=c[t];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return y(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return y(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return M(this,t,e,r);case"ascii":case"latin1":case"binary":return E(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function I(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function B(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function T(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=X[t[n]];return i}function P(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function C(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function O(t,e,r,n,i){$(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function L(t,e,r,n,i){$(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function N(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(t,e,r,n,o){return e=+e,r>>>=0,o||N(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function H(t,e,r,n,o){return e=+e,r>>>=0,o||N(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Y((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=Y((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Y((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),u.prototype.readBigInt64BE=Y((function(t){q(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),u.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){R(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){R(this,t,e,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigUInt64LE=Y((function(t,e=0){return O(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Y((function(t,e=0){return L(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeBigInt64LE=Y((function(t,e=0){return O(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Y((function(t,e=0){return L(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return H(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return H(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const o=u.isBuffer(t)?t:u.from(t,n),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%s]}return this};const D={};function U(t,e,r){D[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function F(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function $(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new D.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){q(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||z(e,t.length-(r+1))}(n,i,o)}function q(t,e){if("number"!=typeof t)throw new D.ERR_INVALID_ARG_TYPE(e,"number",t)}function z(t,e,r){if(Math.floor(t)!==t)throw q(t,r),new D.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new D.ERR_BUFFER_OUT_OF_BOUNDS;throw new D.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}U("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),U("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),U("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=F(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=F(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const G=/[^+/0-9A-Za-z-_]/g;function V(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function J(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function K(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function W(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Z(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Y(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},2680:(t,e,r)=>{"use strict";var n=r(7286),i=r(9429),o=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&o(t,".prototype.")>-1?i(r):r}},9429:(t,e,r)=>{"use strict";var n=r(4090),i=r(7286),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),u=i("%Object.getOwnPropertyDescriptor%",!0),h=i("%Object.defineProperty%",!0),c=i("%Math.max%");if(h)try{h({},"a",{value:1})}catch(t){h=null}t.exports=function(t){var e=a(n,s,arguments);u&&h&&(u(e,"length").configurable&&h(e,"length",{value:1+c(0,t.length-(arguments.length-1))}));return e};var f=function(){return a(n,o,arguments)};h?h(t.exports,"apply",{value:f}):t.exports.apply=f},3973:(t,e,r)=>{var n=r(7834).Buffer,i=r(4851).Transform,o=r(214).s;function s(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(1285)(s,i),s.prototype.update=function(t,e,r){"string"==typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},s.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},s.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},t.exports=s},7108:(t,e)=>{var r;r=function(t){t.version="1.2.2";var e=function(){for(var t=0,e=new Array(256),r=0;256!=r;++r)t=1&(t=1&(t=1&(t=1&(t=1&(t=1&(t=1&(t=1&(t=r)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1,e[r]=t;return"undefined"!=typeof Int32Array?new Int32Array(e):e}(),r=function(t){var e=0,r=0,n=0,i="undefined"!=typeof Int32Array?new Int32Array(4096):new Array(4096);for(n=0;256!=n;++n)i[n]=t[n];for(n=0;256!=n;++n)for(r=t[n],e=256+n;e<4096;e+=256)r=i[e]=r>>>8^t[255&r];var o=[];for(n=1;16!=n;++n)o[n-1]="undefined"!=typeof Int32Array?i.subarray(256*n,256*n+256):i.slice(256*n,256*n+256);return o}(e),n=r[0],i=r[1],o=r[2],s=r[3],a=r[4],u=r[5],h=r[6],c=r[7],f=r[8],l=r[9],d=r[10],p=r[11],m=r[12],g=r[13],b=r[14];t.table=e,t.bstr=function(t,r){for(var n=-1^r,i=0,o=t.length;i<o;)n=n>>>8^e[255&(n^t.charCodeAt(i++))];return~n},t.buf=function(t,r){for(var y=-1^r,v=t.length-15,w=0;w<v;)y=b[t[w++]^255&y]^g[t[w++]^y>>8&255]^m[t[w++]^y>>16&255]^p[t[w++]^y>>>24]^d[t[w++]]^l[t[w++]]^f[t[w++]]^c[t[w++]]^h[t[w++]]^u[t[w++]]^a[t[w++]]^s[t[w++]]^o[t[w++]]^i[t[w++]]^n[t[w++]]^e[t[w++]];for(v+=15;w<v;)y=y>>>8^e[255&(y^t[w++])];return~y},t.str=function(t,r){for(var n=-1^r,i=0,o=t.length,s=0,a=0;i<o;)(s=t.charCodeAt(i++))<128?n=n>>>8^e[255&(n^s)]:s<2048?n=(n=n>>>8^e[255&(n^(192|s>>6&31))])>>>8^e[255&(n^(128|63&s))]:s>=55296&&s<57344?(s=64+(1023&s),a=1023&t.charCodeAt(i++),n=(n=(n=(n=n>>>8^e[255&(n^(240|s>>8&7))])>>>8^e[255&(n^(128|s>>2&63))])>>>8^e[255&(n^(128|a>>6&15|(3&s)<<4))])>>>8^e[255&(n^(128|63&a))]):n=(n=(n=n>>>8^e[255&(n^(224|s>>12&15))])>>>8^e[255&(n^(128|s>>6&63))])>>>8^e[255&(n^(128|63&s))];return~n}},"undefined"==typeof DO_NOT_EXPORT_CRC?r(e):r({})},5363:(t,e,r)=>{var n=r(8834).Buffer,i=r(7554),o=r(9239);t.exports=function(t){return new a(t)};var s={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function a(t){this.curveType=s[t],this.curveType||(this.curveType={name:t}),this.curve=new i.ec(this.curveType.name),this.keys=void 0}function u(t,e,r){Array.isArray(t)||(t=t.toArray());var i=new n(t);if(r&&i.length<r){var o=new n(r-i.length);o.fill(0),i=n.concat([o,i])}return e?i.toString(e):i}s.p224=s.secp224r1,s.p256=s.secp256r1=s.prime256v1,s.p192=s.secp192r1=s.prime192v1,s.p384=s.secp384r1,s.p521=s.secp521r1,a.prototype.generateKeys=function(t,e){return this.keys=this.curve.genKeyPair(),this.getPublicKey(t,e)},a.prototype.computeSecret=function(t,e,r){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),u(this.curve.keyFromPublic(t).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},a.prototype.getPublicKey=function(t,e){var r=this.keys.getPublic("compressed"===e,!0);return"hybrid"===e&&(r[r.length-1]%2?r[0]=7:r[0]=6),u(r,t)},a.prototype.getPrivateKey=function(t){return u(this.keys.getPrivate(),t)},a.prototype.setPublicKey=function(t,e){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),this.keys._importPublic(t),this},a.prototype.setPrivateKey=function(t,e){e=e||"utf8",n.isBuffer(t)||(t=new n(t,e));var r=new o(t);return r=r.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(r),this}},9239:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(8351).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function h(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,c=r;c<a;c+=n)u=h(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var f=1;for(u=h(t,c,t.length,e),c=0;c<s;c++)f*=e;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","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"],f=[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],l=[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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var c=u>>>26,f=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[h]=0|f,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-i;a++)h[a]=0;for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[o-a-1]=s}return h},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,c=0|s[0],f=8191&c,l=c>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],b=8191&g,y=g>>>13,v=0|s[3],w=8191&v,M=v>>>13,E=0|s[4],S=8191&E,_=E>>>13,k=0|s[5],A=8191&k,x=k>>>13,I=0|s[6],B=8191&I,T=I>>>13,P=0|s[7],C=8191&P,R=P>>>13,O=0|s[8],L=8191&O,N=O>>>13,j=0|s[9],H=8191&j,D=j>>>13,U=0|a[0],F=8191&U,$=U>>>13,q=0|a[1],z=8191&q,G=q>>>13,V=0|a[2],J=8191&V,K=V>>>13,W=0|a[3],Z=8191&W,X=W>>>13,Y=0|a[4],Q=8191&Y,tt=Y>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],ft=8191&ct,lt=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(h+(n=Math.imul(f,F))|0)+((8191&(i=(i=Math.imul(f,$))+Math.imul(l,F)|0))<<13)|0;h=((o=Math.imul(l,$))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,$))+Math.imul(m,F)|0,o=Math.imul(m,$);var bt=(h+(n=n+Math.imul(f,z)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(l,z)|0))<<13)|0;h=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,F),i=(i=Math.imul(b,$))+Math.imul(y,F)|0,o=Math.imul(y,$),n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,z)|0,o=o+Math.imul(m,G)|0;var yt=(h+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(l,J)|0))<<13)|0;h=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,$))+Math.imul(M,F)|0,o=Math.imul(M,$),n=n+Math.imul(b,z)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,K)|0;var vt=(h+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(l,Z)|0))<<13)|0;h=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,$))+Math.imul(_,F)|0,o=Math.imul(_,$),n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,z)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,K)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var wt=(h+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(l,Q)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(A,F),i=(i=Math.imul(A,$))+Math.imul(x,F)|0,o=Math.imul(x,$),n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,K)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(h+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,F),i=(i=Math.imul(B,$))+Math.imul(T,F)|0,o=Math.imul(T,$),n=n+Math.imul(A,z)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(x,z)|0,o=o+Math.imul(x,G)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Et=(h+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,$))+Math.imul(R,F)|0,o=Math.imul(R,$),n=n+Math.imul(B,z)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,K)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(h+(n=n+Math.imul(f,ut)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,$))+Math.imul(N,F)|0,o=Math.imul(N,$),n=n+Math.imul(C,z)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,G)|0,n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,K)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,K)|0,n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,X)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var _t=(h+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(H,F),i=(i=Math.imul(H,$))+Math.imul(D,F)|0,o=Math.imul(D,$),n=n+Math.imul(L,z)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(N,z)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,K)|0,n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ft)|0,o=o+Math.imul(m,lt)|0;var kt=(h+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(H,z),i=(i=Math.imul(H,G))+Math.imul(D,z)|0,o=Math.imul(D,G),n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(y,ft)|0,o=o+Math.imul(y,lt)|0;var At=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(H,J),i=(i=Math.imul(H,K))+Math.imul(D,J)|0,o=Math.imul(D,K),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,X)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(M,ft)|0,o=o+Math.imul(M,lt)|0;var xt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(H,Z),i=(i=Math.imul(H,X))+Math.imul(D,Z)|0,o=Math.imul(D,X),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(S,ft)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,lt)|0;var It=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(H,Q),i=(i=Math.imul(H,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(A,ft)|0,i=(i=i+Math.imul(A,lt)|0)+Math.imul(x,ft)|0,o=o+Math.imul(x,lt)|0;var Bt=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(H,rt),i=(i=Math.imul(H,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ht)|0,n=n+Math.imul(B,ft)|0,i=(i=i+Math.imul(B,lt)|0)+Math.imul(T,ft)|0,o=o+Math.imul(T,lt)|0;var Tt=(h+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(H,ot),i=(i=Math.imul(H,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(L,ut)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(C,ft)|0,i=(i=i+Math.imul(C,lt)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,lt)|0;var Pt=(h+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(H,ut),i=(i=Math.imul(H,ht))+Math.imul(D,ut)|0,o=Math.imul(D,ht),n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,lt)|0)+Math.imul(N,ft)|0,o=o+Math.imul(N,lt)|0;var Ct=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(H,ft),i=(i=Math.imul(H,lt))+Math.imul(D,ft)|0,o=Math.imul(D,lt);var Rt=(h+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Ot=(h+(n=Math.imul(H,pt))|0)+((8191&(i=(i=Math.imul(H,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=bt,u[2]=yt,u[3]=vt,u[4]=wt,u[5]=Mt,u[6]=Et,u[7]=St,u[8]=_t,u[9]=kt,u[10]=At,u[11]=xt,u[12]=It,u[13]=Bt,u[14]=Tt,u[15]=Pt,u[16]=Ct,u[17]=Rt,u[18]=Ot,0!==h&&(u[19]=h,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var c=o-h,f=(0|t.words[c])*(0|e.words[h]),l=67108863&f;a=67108863&(l=l+a|0),i+=(s=(s=s+(f/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},g.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var f=u,l=h,d=0;d<s;d++){var p=r[c+d],m=n[c+d],g=r[c+d+s],b=n[c+d+s],y=f*g-l*b;b=f*b+l*g,g=y,r[c+d]=p+g,n[c+d]=m+b,r[c+d+s]=p-g,n[c+d+s]=m-b,d!==a&&(y=u*f-h*l,l=u*l+h*f,f=y)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),c=new Array(n),f=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,c,f,n,i);for(var d=0;d<n;d++){var p=a[d]*c[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),m(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var c=0;for(h=this.length-1;h>=0&&(0!==c||h>=i);h--){var f=0|this.words[h];this.words[h]=c<<26-o|f>>>o,c=f&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var l=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,f);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=l)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,l=1;0==(r.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function _(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(v,y),v.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,y),i(M,y),i(E,y),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return b[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var b=this.pow(f,new o(1).iushln(p-g-1));l=l.redMul(b),f=b.redSqr(),d=d.redMul(f),p=g}return l},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],c=u-1;c>=0;c--){var f=h>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new _(t)},i(_,S),_.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},_.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},_.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},_.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},_.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6162:(t,e,r)=>{"use strict";var n=r(1285),i=r(7993),o=r(1445),s=r(9065),a=r(3973);function u(t){a.call(this,"digest"),this._hash=t}n(u,a),u.prototype._update=function(t){this._hash.update(t)},u.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new i:"rmd160"===t||"ripemd160"===t?new o:new u(s(t))}},2511:(t,e,r)=>{var n=r(7993);t.exports=function(t){return(new n).update(t).digest()}},11:(t,e,r)=>{"use strict";var n=r(1285),i=r(6456),o=r(3973),s=r(7834).Buffer,a=r(2511),u=r(1445),h=r(9065),c=s.alloc(128);function f(t,e){o.call(this,"digest"),"string"==typeof e&&(e=s.from(e));var r="sha512"===t||"sha384"===t?128:64;(this._alg=t,this._key=e,e.length>r)?e=("rmd160"===t?new u:h(t)).update(e).digest():e.length<r&&(e=s.concat([e,c],r));for(var n=this._ipad=s.allocUnsafe(r),i=this._opad=s.allocUnsafe(r),a=0;a<r;a++)n[a]=54^e[a],i[a]=92^e[a];this._hash="rmd160"===t?new u:h(t),this._hash.update(n)}n(f,o),f.prototype._update=function(t){this._hash.update(t)},f.prototype._final=function(){var t=this._hash.digest();return("rmd160"===this._alg?new u:h(this._alg)).update(this._opad).update(t).digest()},t.exports=function(t,e){return"rmd160"===(t=t.toLowerCase())||"ripemd160"===t?new f("rmd160",e):"md5"===t?new i(a,e):new f(t,e)}},6456:(t,e,r)=>{"use strict";var n=r(1285),i=r(7834).Buffer,o=r(3973),s=i.alloc(128),a=64;function u(t,e){o.call(this,"digest"),"string"==typeof e&&(e=i.from(e)),this._alg=t,this._key=e,e.length>a?e=t(e):e.length<a&&(e=i.concat([e,s],a));for(var r=this._ipad=i.allocUnsafe(a),n=this._opad=i.allocUnsafe(a),u=0;u<a;u++)r[u]=54^e[u],n[u]=92^e[u];this._hash=[r]}n(u,o),u.prototype._update=function(t){this._hash.push(t)},u.prototype._final=function(){var t=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,t]))},t.exports=u},5634:(t,e,r)=>{"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=r(5003),e.createHash=e.Hash=r(6162),e.createHmac=e.Hmac=r(11);var n=r(4778),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);e.getHashes=function(){return o};var s=r(499);e.pbkdf2=s.pbkdf2,e.pbkdf2Sync=s.pbkdf2Sync;var a=r(3667);e.Cipher=a.Cipher,e.createCipher=a.createCipher,e.Cipheriv=a.Cipheriv,e.createCipheriv=a.createCipheriv,e.Decipher=a.Decipher,e.createDecipher=a.createDecipher,e.Decipheriv=a.Decipheriv,e.createDecipheriv=a.createDecipheriv,e.getCiphers=a.getCiphers,e.listCiphers=a.listCiphers;var u=r(7602);e.DiffieHellmanGroup=u.DiffieHellmanGroup,e.createDiffieHellmanGroup=u.createDiffieHellmanGroup,e.getDiffieHellman=u.getDiffieHellman,e.createDiffieHellman=u.createDiffieHellman,e.DiffieHellman=u.DiffieHellman;var h=r(5263);e.createSign=h.createSign,e.Sign=h.Sign,e.createVerify=h.createVerify,e.Verify=h.Verify,e.createECDH=r(5363);var c=r(8493);e.publicEncrypt=c.publicEncrypt,e.privateEncrypt=c.privateEncrypt,e.publicDecrypt=c.publicDecrypt,e.privateDecrypt=c.privateDecrypt;var f=r(9631);e.randomFill=f.randomFill,e.randomFillSync=f.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},5881:t=>{var e=1e3,r=60*e,n=60*r,i=24*n,o=7*i,s=365.25*i;function a(t,e,r,n){var i=e>=1.5*r;return Math.round(t/r)+" "+n+(i?"s":"")}t.exports=function(t,u){u=u||{};var h=typeof t;if("string"===h&&t.length>0)return function(t){if((t=String(t)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!a)return;var u=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*s;case"weeks":case"week":case"w":return u*o;case"days":case"day":case"d":return u*i;case"hours":case"hour":case"hrs":case"hr":case"h":return u*n;case"minutes":case"minute":case"mins":case"min":case"m":return u*r;case"seconds":case"second":case"secs":case"sec":case"s":return u*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(t);if("number"===h&&isFinite(t))return u.long?function(t){var o=Math.abs(t);if(o>=i)return a(t,o,i,"day");if(o>=n)return a(t,o,n,"hour");if(o>=r)return a(t,o,r,"minute");if(o>=e)return a(t,o,e,"second");return t+" ms"}(t):function(t){var o=Math.abs(t);if(o>=i)return Math.round(t/i)+"d";if(o>=n)return Math.round(t/n)+"h";if(o>=r)return Math.round(t/r)+"m";if(o>=e)return Math.round(t/e)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},5130:(t,e,r)=>{e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;e.splice(1,0,r,"color: inherit");let n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(n++,"%c"===t&&(i=n))})),e.splice(i,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}!t&&"undefined"!=typeof process&&"env"in process&&(t="false");return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=r(7123)(e);const{formatters:n}=t.exports;n.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},7123:(t,e,r)=>{t.exports=function(t){function e(t){let r,i,o,s=null;function a(...t){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let s=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";s++;const o=e.formatters[i];if("function"==typeof o){const e=t[s];r=o.call(n,e),t.splice(s,1),s--}return r})),e.formatArgs.call(n,t);(n.log||e.log).apply(n,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=n,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==e.namespaces&&(i=e.namespaces,o=e.enabled(t)),o),set:t=>{s=t}}),"function"==typeof e.init&&e.init(a),a}function n(t,r){const n=e(this.namespace+(void 0===r?":":r)+t);return n.log=this.log,n}function i(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){const t=[...e.names.map(i),...e.skips.map(i).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let r;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const n=("string"==typeof t?t:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(t=n[r].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.slice(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let r,n;for(r=0,n=e.skips.length;r<n;r++)if(e.skips[r].test(t))return!1;for(r=0,n=e.names.length;r<n;r++)if(e.names[r].test(t))return!0;return!1},e.humanize=r(5881),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((r=>{e[r]=t[r]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let r=0;for(let e=0;e<t.length;e++)r=(r<<5)-r+t.charCodeAt(e),r|=0;return e.colors[Math.abs(r)%e.colors.length]},e.enable(e.load()),e}},4387:(t,e,r)=>{"use strict";e.utils=r(4112),e.Cipher=r(3639),e.DES=r(4225),e.CBC=r(9692),e.EDE=r(4335)},9692:(t,e,r)=>{"use strict";var n=r(9561),i=r(1285),o={};function s(t){n.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=t[e]}e.instantiate=function(t){function e(e){t.call(this,e),this._cbcInit()}i(e,t);for(var r=Object.keys(o),n=0;n<r.length;n++){var s=r[n];e.prototype[s]=o[s]}return e.create=function(t){return new e(t)},e},o._cbcInit=function(){var t=new s(this.options.iv);this._cbcState=t},o._update=function(t,e,r,n){var i=this._cbcState,o=this.constructor.super_.prototype,s=i.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)s[a]^=t[e+a];o._update.call(this,s,0,r,n);for(a=0;a<this.blockSize;a++)s[a]=r[n+a]}else{o._update.call(this,t,e,r,n);for(a=0;a<this.blockSize;a++)r[n+a]^=s[a];for(a=0;a<this.blockSize;a++)s[a]=t[e+a]}}},3639:(t,e,r)=>{"use strict";var n=r(9561);function i(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=!1!==t.padding}t.exports=i,i.prototype._init=function(){},i.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},i.prototype._buffer=function(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),n=0;n<r;n++)this.buffer[this.bufferOff+n]=t[e+n];return this.bufferOff+=r,r},i.prototype._flushBuffer=function(t,e){return this._update(this.buffer,0,t,e),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(t){var e=0,r=0,n=(this.bufferOff+t.length)/this.blockSize|0,i=new Array(n*this.blockSize);0!==this.bufferOff&&(e+=this._buffer(t,e),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(i,r)));for(var o=t.length-(t.length-e)%this.blockSize;e<o;e+=this.blockSize)this._update(t,e,i,r),r+=this.blockSize;for(;e<t.length;e++,this.bufferOff++)this.buffer[this.bufferOff]=t[e];return i},i.prototype._updateDecrypt=function(t){for(var e=0,r=0,n=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,i=new Array(n*this.blockSize);n>0;n--)e+=this._buffer(t,e),r+=this._flushBuffer(i,r);return e+=this._buffer(t,e),i},i.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},i.prototype._pad=function(t,e){if(0===e)return!1;for(;e<t.length;)t[e++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t},i.prototype._unpad=function(t){return t},i.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)}},4225:(t,e,r)=>{"use strict";var n=r(9561),i=r(1285),o=r(4112),s=r(3639);function a(){this.tmp=new Array(2),this.keys=null}function u(t){s.call(this,t);var e=new a;this._desState=e,this.deriveKeys(e,t.key)}i(u,s),t.exports=u,u.create=function(t){return new u(t)};var h=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];u.prototype.deriveKeys=function(t,e){t.keys=new Array(32),n.equal(e.length,this.blockSize,"Invalid key length");var r=o.readUInt32BE(e,0),i=o.readUInt32BE(e,4);o.pc1(r,i,t.tmp,0),r=t.tmp[0],i=t.tmp[1];for(var s=0;s<t.keys.length;s+=2){var a=h[s>>>1];r=o.r28shl(r,a),i=o.r28shl(i,a),o.pc2(r,i,t.keys,s)}},u.prototype._update=function(t,e,r,n){var i=this._desState,s=o.readUInt32BE(t,e),a=o.readUInt32BE(t,e+4);o.ip(s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],"encrypt"===this.type?this._encrypt(i,s,a,i.tmp,0):this._decrypt(i,s,a,i.tmp,0),s=i.tmp[0],a=i.tmp[1],o.writeUInt32BE(r,s,n),o.writeUInt32BE(r,a,n+4)},u.prototype._pad=function(t,e){if(!1===this.padding)return!1;for(var r=t.length-e,n=e;n<t.length;n++)t[n]=r;return!0},u.prototype._unpad=function(t){if(!1===this.padding)return t;for(var e=t[t.length-1],r=t.length-e;r<t.length;r++)n.equal(t[r],e);return t.slice(0,t.length-e)},u.prototype._encrypt=function(t,e,r,n,i){for(var s=e,a=r,u=0;u<t.keys.length;u+=2){var h=t.keys[u],c=t.keys[u+1];o.expand(a,t.tmp,0),h^=t.tmp[0],c^=t.tmp[1];var f=o.substitute(h,c),l=a;a=(s^o.permute(f))>>>0,s=l}o.rip(a,s,n,i)},u.prototype._decrypt=function(t,e,r,n,i){for(var s=r,a=e,u=t.keys.length-2;u>=0;u-=2){var h=t.keys[u],c=t.keys[u+1];o.expand(s,t.tmp,0),h^=t.tmp[0],c^=t.tmp[1];var f=o.substitute(h,c),l=s;s=(a^o.permute(f))>>>0,a=l}o.rip(s,a,n,i)}},4335:(t,e,r)=>{"use strict";var n=r(9561),i=r(1285),o=r(3639),s=r(4225);function a(t,e){n.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),i=e.slice(8,16),o=e.slice(16,24);this.ciphers="encrypt"===t?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:o})]:[s.create({type:"decrypt",key:o}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function u(t){o.call(this,t);var e=new a(this.type,this.options.key);this._edeState=e}i(u,o),t.exports=u,u.create=function(t){return new u(t)},u.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},u.prototype._pad=s.prototype._pad,u.prototype._unpad=s.prototype._unpad},4112:(t,e)=>{"use strict";e.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},e.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},e.ip=function(t,e,r,n){for(var i=0,o=0,s=6;s>=0;s-=2){for(var a=0;a<=24;a+=8)i<<=1,i|=e>>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=t>>>a+s&1}for(s=6;s>=0;s-=2){for(a=1;a<=25;a+=8)o<<=1,o|=e>>>a+s&1;for(a=1;a<=25;a+=8)o<<=1,o|=t>>>a+s&1}r[n+0]=i>>>0,r[n+1]=o>>>0},e.rip=function(t,e,r,n){for(var i=0,o=0,s=0;s<4;s++)for(var a=24;a>=0;a-=8)i<<=1,i|=e>>>a+s&1,i<<=1,i|=t>>>a+s&1;for(s=4;s<8;s++)for(a=24;a>=0;a-=8)o<<=1,o|=e>>>a+s&1,o<<=1,o|=t>>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.pc1=function(t,e,r,n){for(var i=0,o=0,s=7;s>=5;s--){for(var a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1;for(a=0;a<=24;a+=8)i<<=1,i|=t>>a+s&1}for(a=0;a<=24;a+=8)i<<=1,i|=e>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1;for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1}for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.r28shl=function(t,e){return t<<e&268435455|t>>>28-e};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,n,i){for(var o=0,s=0,a=r.length>>>1,u=0;u<a;u++)o<<=1,o|=t>>>r[u]&1;for(u=a;u<r.length;u++)s<<=1,s|=e>>>r[u]&1;n[i+0]=o>>>0,n[i+1]=s>>>0},e.expand=function(t,e,r){var n=0,i=0;n=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=t>>>o&63;for(o=11;o>=3;o-=4)i|=t>>>o&63,i<<=6;i|=(31&t)<<1|t>>>31,e[r+0]=n>>>0,e[r+1]=i>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(t>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(e>>>18-6*i&63)]}return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,r=0;r<i.length;r++)e<<=1,e|=t>>>i[r]&1;return e>>>0},e.padSplit=function(t,e,r){for(var n=t.toString(2);n.length<e;)n="0"+n;for(var i=[],o=0;o<e;o+=r)i.push(n.slice(o,o+r));return i.join(" ")}},7602:(t,e,r)=>{var n=r(8834).Buffer,i=r(2808),o=r(3418),s=r(767);var a={binary:!0,hex:!0,base64:!0};e.DiffieHellmanGroup=e.createDiffieHellmanGroup=e.getDiffieHellman=function(t){var e=new n(o[t].prime,"hex"),r=new n(o[t].gen,"hex");return new s(e,r)},e.createDiffieHellman=e.DiffieHellman=function t(e,r,o,u){return n.isBuffer(r)||void 0===a[r]?t(e,"binary",r,o):(r=r||"binary",u=u||"binary",o=o||new n([2]),n.isBuffer(o)||(o=new n(o,u)),"number"==typeof e?new s(i(e,o),o,!0):(n.isBuffer(e)||(e=new n(e,r)),new s(e,o,!0)))}},767:(t,e,r)=>{var n=r(8834).Buffer,i=r(3908),o=new(r(6676)),s=new i(24),a=new i(11),u=new i(10),h=new i(3),c=new i(7),f=r(2808),l=r(5003);function d(t,e){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),this._pub=new i(t),this}function p(t,e){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),this._priv=new i(t),this}t.exports=g;var m={};function g(t,e,r){this.setGenerator(e),this.__prime=new i(t),this._prime=i.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=d,this.setPrivateKey=p):this._primeCode=8}function b(t,e){var r=new n(t.toArray());return e?r.toString(e):r}Object.defineProperty(g.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(t,e){var r=e.toString("hex"),n=[r,t.toString(16)].join("_");if(n in m)return m[n];var i,l=0;if(t.isEven()||!f.simpleSieve||!f.fermatTest(t)||!o.test(t))return l+=1,l+="02"===r||"05"===r?8:4,m[n]=l,l;switch(o.test(t.shrn(1))||(l+=2),r){case"02":t.mod(s).cmp(a)&&(l+=8);break;case"05":(i=t.mod(u)).cmp(h)&&i.cmp(c)&&(l+=8);break;default:l+=4}return m[n]=l,l}(this.__prime,this.__gen)),this._primeCode}}),g.prototype.generateKeys=function(){return this._priv||(this._priv=new i(l(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},g.prototype.computeSecret=function(t){var e=(t=(t=new i(t)).toRed(this._prime)).redPow(this._priv).fromRed(),r=new n(e.toArray()),o=this.getPrime();if(r.length<o.length){var s=new n(o.length-r.length);s.fill(0),r=n.concat([s,r])}return r},g.prototype.getPublicKey=function(t){return b(this._pub,t)},g.prototype.getPrivateKey=function(t){return b(this._priv,t)},g.prototype.getPrime=function(t){return b(this.__prime,t)},g.prototype.getGenerator=function(t){return b(this._gen,t)},g.prototype.setGenerator=function(t,e){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),this.__gen=t,this._gen=new i(t),this}},2808:(t,e,r)=>{var n=r(5003);t.exports=y,y.simpleSieve=g,y.fermatTest=b;var i=r(3908),o=new i(24),s=new(r(6676)),a=new i(1),u=new i(2),h=new i(5),c=(new i(16),new i(8),new i(10)),f=new i(3),l=(new i(7),new i(11)),d=new i(4),p=(new i(12),null);function m(){if(null!==p)return p;var t=[];t[0]=2;for(var e=1,r=3;r<1048576;r+=2){for(var n=Math.ceil(Math.sqrt(r)),i=0;i<e&&t[i]<=n&&r%t[i]!=0;i++);e!==i&&t[i]<=n||(t[e++]=r)}return p=t,t}function g(t){for(var e=m(),r=0;r<e.length;r++)if(0===t.modn(e[r]))return 0===t.cmpn(e[r]);return!0}function b(t){var e=i.mont(t);return 0===u.toRed(e).redPow(t.subn(1)).fromRed().cmpn(1)}function y(t,e){if(t<16)return new i(2===e||5===e?[140,123]:[140,39]);var r,p;for(e=new i(e);;){for(r=new i(n(Math.ceil(t/8)));r.bitLength()>t;)r.ishrn(1);if(r.isEven()&&r.iadd(a),r.testn(1)||r.iadd(u),e.cmp(u)){if(!e.cmp(h))for(;r.mod(c).cmp(f);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(g(p=r.shrn(1))&&g(r)&&b(p)&&b(r)&&s.test(p)&&s.test(r))return r}}},3908:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(395).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function h(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,c=r;c<a;c+=n)u=h(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var f=1;for(u=h(t,c,t.length,e),c=0;c<s;c++)f*=e;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","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"],f=[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],l=[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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var c=u>>>26,f=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[h]=0|f,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-i;a++)h[a]=0;for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[o-a-1]=s}return h},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,c=0|s[0],f=8191&c,l=c>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],b=8191&g,y=g>>>13,v=0|s[3],w=8191&v,M=v>>>13,E=0|s[4],S=8191&E,_=E>>>13,k=0|s[5],A=8191&k,x=k>>>13,I=0|s[6],B=8191&I,T=I>>>13,P=0|s[7],C=8191&P,R=P>>>13,O=0|s[8],L=8191&O,N=O>>>13,j=0|s[9],H=8191&j,D=j>>>13,U=0|a[0],F=8191&U,$=U>>>13,q=0|a[1],z=8191&q,G=q>>>13,V=0|a[2],J=8191&V,K=V>>>13,W=0|a[3],Z=8191&W,X=W>>>13,Y=0|a[4],Q=8191&Y,tt=Y>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],ft=8191&ct,lt=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(h+(n=Math.imul(f,F))|0)+((8191&(i=(i=Math.imul(f,$))+Math.imul(l,F)|0))<<13)|0;h=((o=Math.imul(l,$))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,$))+Math.imul(m,F)|0,o=Math.imul(m,$);var bt=(h+(n=n+Math.imul(f,z)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(l,z)|0))<<13)|0;h=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,F),i=(i=Math.imul(b,$))+Math.imul(y,F)|0,o=Math.imul(y,$),n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,z)|0,o=o+Math.imul(m,G)|0;var yt=(h+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(l,J)|0))<<13)|0;h=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,$))+Math.imul(M,F)|0,o=Math.imul(M,$),n=n+Math.imul(b,z)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,K)|0;var vt=(h+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(l,Z)|0))<<13)|0;h=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,$))+Math.imul(_,F)|0,o=Math.imul(_,$),n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,z)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,K)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var wt=(h+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(l,Q)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(A,F),i=(i=Math.imul(A,$))+Math.imul(x,F)|0,o=Math.imul(x,$),n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,K)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(h+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,F),i=(i=Math.imul(B,$))+Math.imul(T,F)|0,o=Math.imul(T,$),n=n+Math.imul(A,z)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(x,z)|0,o=o+Math.imul(x,G)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Et=(h+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,$))+Math.imul(R,F)|0,o=Math.imul(R,$),n=n+Math.imul(B,z)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,K)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(h+(n=n+Math.imul(f,ut)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,$))+Math.imul(N,F)|0,o=Math.imul(N,$),n=n+Math.imul(C,z)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,G)|0,n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,K)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,K)|0,n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,X)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var _t=(h+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(H,F),i=(i=Math.imul(H,$))+Math.imul(D,F)|0,o=Math.imul(D,$),n=n+Math.imul(L,z)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(N,z)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,K)|0,n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ft)|0,o=o+Math.imul(m,lt)|0;var kt=(h+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(H,z),i=(i=Math.imul(H,G))+Math.imul(D,z)|0,o=Math.imul(D,G),n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(y,ft)|0,o=o+Math.imul(y,lt)|0;var At=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(H,J),i=(i=Math.imul(H,K))+Math.imul(D,J)|0,o=Math.imul(D,K),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,X)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(M,ft)|0,o=o+Math.imul(M,lt)|0;var xt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(H,Z),i=(i=Math.imul(H,X))+Math.imul(D,Z)|0,o=Math.imul(D,X),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(S,ft)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,lt)|0;var It=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(H,Q),i=(i=Math.imul(H,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(A,ft)|0,i=(i=i+Math.imul(A,lt)|0)+Math.imul(x,ft)|0,o=o+Math.imul(x,lt)|0;var Bt=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(H,rt),i=(i=Math.imul(H,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ht)|0,n=n+Math.imul(B,ft)|0,i=(i=i+Math.imul(B,lt)|0)+Math.imul(T,ft)|0,o=o+Math.imul(T,lt)|0;var Tt=(h+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(H,ot),i=(i=Math.imul(H,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(L,ut)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(C,ft)|0,i=(i=i+Math.imul(C,lt)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,lt)|0;var Pt=(h+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(H,ut),i=(i=Math.imul(H,ht))+Math.imul(D,ut)|0,o=Math.imul(D,ht),n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,lt)|0)+Math.imul(N,ft)|0,o=o+Math.imul(N,lt)|0;var Ct=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(H,ft),i=(i=Math.imul(H,lt))+Math.imul(D,ft)|0,o=Math.imul(D,lt);var Rt=(h+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Ot=(h+(n=Math.imul(H,pt))|0)+((8191&(i=(i=Math.imul(H,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=bt,u[2]=yt,u[3]=vt,u[4]=wt,u[5]=Mt,u[6]=Et,u[7]=St,u[8]=_t,u[9]=kt,u[10]=At,u[11]=xt,u[12]=It,u[13]=Bt,u[14]=Tt,u[15]=Pt,u[16]=Ct,u[17]=Rt,u[18]=Ot,0!==h&&(u[19]=h,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var c=o-h,f=(0|t.words[c])*(0|e.words[h]),l=67108863&f;a=67108863&(l=l+a|0),i+=(s=(s=s+(f/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},g.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var f=u,l=h,d=0;d<s;d++){var p=r[c+d],m=n[c+d],g=r[c+d+s],b=n[c+d+s],y=f*g-l*b;b=f*b+l*g,g=y,r[c+d]=p+g,n[c+d]=m+b,r[c+d+s]=p-g,n[c+d+s]=m-b,d!==a&&(y=u*f-h*l,l=u*l+h*f,f=y)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),c=new Array(n),f=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,c,f,n,i);for(var d=0;d<n;d++){var p=a[d]*c[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),m(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var c=0;for(h=this.length-1;h>=0&&(0!==c||h>=i);h--){var f=0|this.words[h];this.words[h]=c<<26-o|f>>>o,c=f&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var l=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,f);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=l)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,l=1;0==(r.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function _(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(v,y),v.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,y),i(M,y),i(E,y),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return b[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var b=this.pow(f,new o(1).iushln(p-g-1));l=l.redMul(b),f=b.redSqr(),d=d.redMul(f),p=g}return l},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],c=u-1;c>=0;c--){var f=h>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new _(t)},i(_,S),_.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},_.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},_.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},_.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},_.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},7554:(t,e,r)=>{"use strict";var n=e;n.version=r(763).i8,n.utils=r(8288),n.rand=r(2745),n.curve=r(2284),n.curves=r(1479),n.ec=r(8596),n.eddsa=r(9208)},8919:(t,e,r)=>{"use strict";var n=r(2140),i=r(8288),o=i.getNAF,s=i.getJSF,a=i.assert;function u(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function h(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var s,u,h=[];for(s=0;s<n.length;s+=r.step){u=0;for(var c=s+r.step-1;c>=s;c--)u=(u<<1)+n[c];h.push(u)}for(var f=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=i;d>0;d--){for(s=0;s<h.length;s++)(u=h[s])===d?l=l.mixedAdd(r.points[s]):u===-d&&(l=l.mixedAdd(r.points[s].neg()));f=f.add(l)}return f.toP()},u.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(e,r,this._bitLength),u=this.jpoint(null,null,null),h=s.length-1;h>=0;h--){for(var c=0;h>=0&&0===s[h];h--)c++;if(h>=0&&c++,u=u.dblp(c),h<0)break;var f=s[h];a(0!==f),u="affine"===t.type?f>0?u.mixedAdd(i[f-1>>1]):u.mixedAdd(i[-f-1>>1].neg()):f>0?u.add(i[f-1>>1]):u.add(i[-f-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){var a,u,h,c=this._wnafT1,f=this._wnafT2,l=this._wnafT3,d=0;for(a=0;a<n;a++){var p=(h=e[a])._getNAFPoints(t);c[a]=p.wnd,f[a]=p.points}for(a=n-1;a>=1;a-=2){var m=a-1,g=a;if(1===c[m]&&1===c[g]){var b=[e[m],null,null,e[g]];0===e[m].y.cmp(e[g].y)?(b[1]=e[m].add(e[g]),b[2]=e[m].toJ().mixedAdd(e[g].neg())):0===e[m].y.cmp(e[g].y.redNeg())?(b[1]=e[m].toJ().mixedAdd(e[g]),b[2]=e[m].add(e[g].neg())):(b[1]=e[m].toJ().mixedAdd(e[g]),b[2]=e[m].toJ().mixedAdd(e[g].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=s(r[m],r[g]);for(d=Math.max(v[0].length,d),l[m]=new Array(d),l[g]=new Array(d),u=0;u<d;u++){var w=0|v[0][u],M=0|v[1][u];l[m][u]=y[3*(w+1)+(M+1)],l[g][u]=0,f[m]=b}}else l[m]=o(r[m],c[m],this._bitLength),l[g]=o(r[g],c[g],this._bitLength),d=Math.max(l[m].length,d),d=Math.max(l[g].length,d)}var E=this.jpoint(null,null,null),S=this._wnafT4;for(a=d;a>=0;a--){for(var _=0;a>=0;){var k=!0;for(u=0;u<n;u++)S[u]=0|l[u][a],0!==S[u]&&(k=!1);if(!k)break;_++,a--}if(a>=0&&_++,E=E.dblp(_),a<0)break;for(u=0;u<n;u++){var A=S[u];0!==A&&(A>0?h=f[u][A-1>>1]:A<0&&(h=f[u][-A-1>>1].neg()),E="affine"===h.type?E.mixedAdd(h):E.add(h))}}for(a=0;a<n;a++)f[a]=null;return i?E:E.toP()},u.BasePoint=h,h.prototype.eq=function(){throw new Error("Not implemented")},h.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(t,e){t=i.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?a(t[t.length-1]%2==0):7===t[0]&&a(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},h.prototype.encodeCompressed=function(t){return this.encode(t,!0)},h.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},h.prototype.encode=function(t,e){return i.encode(this._encode(e),t)},h.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},h.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},h.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},h.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},h.prototype._getBeta=function(){return null},h.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},7105:(t,e,r)=>{"use strict";var n=r(8288),i=r(2140),o=r(1285),s=r(8919),a=n.assert;function u(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function h(t,e,r,n,o){s.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,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.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,s),t.exports=u,u.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},u.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},u.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var u=a.fromRed().isOdd();return(e&&!u||!e&&u)&&(a=a.redNeg()),this.point(t,a)},u.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},u.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(h,s.BasePoint),u.prototype.pointFromJSON=function(t){return h.fromJSON(this,t)},u.prototype.point=function(t,e,r,n){return new h(this,t,e,r,n)},h.fromJSON=function(t,e){return new h(t,e[0],e[1],e[2])},h.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},h.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},h.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),s=o.redSub(r),a=n.redSub(e),u=i.redMul(s),h=o.redMul(a),c=i.redMul(a),f=s.redMul(o);return this.curve.point(u,h,f,c)},h.prototype._projDbl=function(){var t,e,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var h=(n=this.curve._mulA(a)).redAdd(u);this.zOne?(t=s.redSub(a).redSub(u).redMul(h.redSub(this.curve.two)),e=h.redMul(n.redSub(u)),r=h.redSqr().redSub(h).redSub(h)):(i=this.z.redSqr(),o=h.redSub(i).redISub(i),t=s.redSub(a).redISub(u).redMul(o),e=h.redMul(n.redSub(u)),r=h.redMul(o))}else n=a.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),t=this.curve._mulC(s.redISub(n)).redMul(o),e=this.curve._mulC(n).redMul(a.redISub(u)),r=n.redMul(o);return this.curve.point(t,e,r)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},h.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),s=i.redSub(n),a=i.redAdd(n),u=r.redAdd(e),h=o.redMul(s),c=a.redMul(u),f=o.redMul(u),l=s.redMul(a);return this.curve.point(h,c,l,f)},h.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),s=this.y.redMul(t.y),a=this.curve.d.redMul(o).redMul(s),u=i.redSub(a),h=i.redAdd(a),c=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),f=n.redMul(u).redMul(c);return this.curve.twisted?(e=n.redMul(h).redMul(s.redSub(this.curve._mulA(o))),r=u.redMul(h)):(e=n.redMul(h).redMul(s.redSub(o)),r=this.curve._mulC(u).redMul(h)),this.curve.point(f,e,r)},h.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},h.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},h.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},h.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},h.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},h.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},h.prototype.getX=function(){return this.normalize(),this.x.fromRed()},h.prototype.getY=function(){return this.normalize(),this.y.fromRed()},h.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},h.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},h.prototype.toP=h.prototype.normalize,h.prototype.mixedAdd=h.prototype.add},2284:(t,e,r)=>{"use strict";var n=e;n.base=r(8919),n.short=r(7715),n.mont=r(5125),n.edwards=r(7105)},5125:(t,e,r)=>{"use strict";var n=r(2140),i=r(1285),o=r(8919),s=r(8288);function a(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),t.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},a.prototype.point=function(t,e){return new u(this,t,e)},a.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(t,e){return new u(t,e[0],e[1]||t.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),s=i.redMul(n),a=e.z.redMul(o.redAdd(s).redSqr()),u=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,u)},u.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},7715:(t,e,r)=>{"use strict";var n=r(8288),i=r(2140),o=r(1285),s=r(8919),a=n.assert;function u(t){s.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function h(t,e,r,n){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function c(t,e,r,n){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,s),t.exports=u,u.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,r,n,o,s,a,u,h,c,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=t,d=this.n.clone(),p=new i(1),m=new i(0),g=new i(0),b=new i(1),y=0;0!==l.cmpn(0);){var v=d.div(l);h=d.sub(v.mul(l)),c=g.sub(v.mul(p));var w=b.sub(v.mul(m));if(!n&&h.cmp(f)<0)e=u.neg(),r=p,n=h.neg(),o=c;else if(n&&2==++y)break;u=h,d=l,l=h,g=p,p=c,b=m,m=w}s=h.neg(),a=c;var M=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(M)>=0&&(s=e,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),h=o.mul(n.b);return{k1:t.sub(s).sub(a),k2:u.add(h).neg()}},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var s=this._endoSplit(e[o]),a=t[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*o]=a,n[2*o+1]=u,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var h=this._wnafMulAdd(1,n,i,2*o,r),c=0;c<2*o;c++)n[c]=null,i[c]=null;return h},o(h,s.BasePoint),u.prototype.point=function(t,e,r){return new h(this,t,e,r)},u.prototype.pointFromJSON=function(t,e){return h.fromJSON(this,t,e)},h.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},h.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},h.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(e){return t.point(e[0],e[1],r)}var o=e[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},h.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},h.prototype.isInfinity=function(){return this.inf},h.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},h.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},h.prototype.getX=function(){return this.x.fromRed()},h.prototype.getY=function(){return this.y.fromRed()},h.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},h.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},h.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},h.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},h.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},h.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(c,s.BasePoint),u.prototype.jpoint=function(t,e,r){return new c(this,t,e,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=a.redSqr(),c=h.redMul(a),f=n.redMul(h),l=u.redSqr().redIAdd(c).redISub(f).redISub(f),d=u.redMul(f.redISub(l)).redISub(o.redMul(c)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(l,d,p)},c.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),h=u.redMul(s),c=r.redMul(u),f=a.redSqr().redIAdd(h).redISub(c).redISub(c),l=a.redMul(c.redISub(f)).redISub(i.redMul(h)),d=this.z.redMul(s);return this.curve.jpoint(f,l,d)},c.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),h=s.redAdd(s);for(e=0;e<t;e++){var c=o.redSqr(),f=h.redSqr(),l=f.redSqr(),d=c.redAdd(c).redIAdd(c).redIAdd(n.redMul(u)),p=o.redMul(f),m=d.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),b=d.redMul(g);b=b.redIAdd(b).redISub(l);var y=h.redMul(a);e+1<t&&(u=u.redMul(l)),o=m,a=y,h=b}return this.curve.jpoint(o,h.redMul(i),a)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},c.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),u=a.redSqr().redISub(s).redISub(s),h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),t=u,e=a.redMul(s.redISub(u)).redISub(h),r=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),f=this.y.redSqr(),l=f.redSqr(),d=this.x.redAdd(f).redSqr().redISub(c).redISub(l);d=d.redIAdd(d);var p=c.redAdd(c).redIAdd(c),m=p.redSqr(),g=l.redIAdd(l);g=(g=g.redIAdd(g)).redIAdd(g),t=m.redISub(d).redISub(d),e=p.redMul(d.redISub(t)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},c.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);t=u;var h=o.redIAdd(o);h=(h=h.redIAdd(h)).redIAdd(h),e=a.redMul(s.redISub(u)).redISub(h),r=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),f=this.y.redSqr(),l=this.x.redMul(f),d=this.x.redSub(c).redMul(this.x.redAdd(c));d=d.redAdd(d).redIAdd(d);var p=l.redIAdd(l),m=(p=p.redIAdd(p)).redAdd(p);t=d.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(c);var g=f.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),e=d.redMul(p.redISub(t)).redISub(g)}return this.curve.jpoint(t,e,r)},c.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),u=e.redAdd(e),h=(u=u.redIAdd(u)).redMul(s),c=a.redSqr().redISub(h.redAdd(h)),f=h.redISub(c),l=s.redSqr();l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=a.redMul(f).redISub(l),p=r.redAdd(r).redMul(n);return this.curve.jpoint(c,d,p)},c.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var h=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),c=e.redMul(h);c=(c=c.redIAdd(c)).redIAdd(c);var f=this.x.redMul(a).redISub(c);f=(f=f.redIAdd(f)).redIAdd(f);var l=this.y.redMul(h.redMul(u.redISub(h)).redISub(s.redMul(a)));l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(f,l,d)},c.prototype.mul=function(t,e){return t=new i(t,e),this.curve._wnafMul(this,t)},c.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},c.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},c.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},1479:(t,e,r)=>{"use strict";var n,i=e,o=r(3506),s=r(2284),a=r(8288).assert;function u(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function h(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,h("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),h("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),h("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),h("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),h("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),h("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),h("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(7983)}catch(t){n=void 0}h("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},8596:(t,e,r)=>{"use strict";var n=r(2140),i=r(8873),o=r(8288),s=r(1479),a=r(2745),u=o.assert,h=r(2307),c=r(1798);function f(t){if(!(this instanceof f))return new f(t);"string"==typeof t&&(u(Object.prototype.hasOwnProperty.call(s,t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=f,f.prototype.keyPair=function(t){return new h(this,t)},f.prototype.keyFromPrivate=function(t,e){return h.fromPrivate(this,t,e)},f.prototype.keyFromPublic=function(t,e){return h.fromPublic(this,t,e)},f.prototype.genKeyPair=function(t){t||(t={});for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(e.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},f.prototype._truncateToN=function(t,e,r){var i;if(n.isBN(t)||"number"==typeof t)i=(t=new n(t,16)).byteLength();else if("object"==typeof t)i=t.length,t=new n(t,16);else{var o=t.toString();i=o.length+1>>>1,t=new n(o,16)}"number"!=typeof r&&(r=8*i);var s=r-this.n.bitLength();return s>0&&(t=t.ushrn(s)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},f.prototype.sign=function(t,e,r,o){if("object"==typeof r&&(o=r,r=null),o||(o={}),"string"!=typeof t&&"number"!=typeof t&&!n.isBN(t)){u("object"==typeof t&&t&&"number"==typeof t.length,"Expected message to be an array-like, a hex string, or a BN instance"),u(t.length>>>0===t.length);for(var s=0;s<t.length;s++)u((255&t[s])===t[s])}e=this.keyFromPrivate(e,r),t=this._truncateToN(t,!1,o.msgBitLength),u(!t.isNeg(),"Can not sign a negative message");var a=this.n.byteLength(),h=e.getPrivate().toArray("be",a),f=t.toArray("be",a);u(new n(f).eq(t),"Can not sign message");for(var l=new i({hash:this.hash,entropy:h,nonce:f,pers:o.pers,persEnc:o.persEnc||"utf8"}),d=this.n.sub(new n(1)),p=0;;p++){var m=o.k?o.k(p):new n(l.generate(this.n.byteLength()));if(!((m=this._truncateToN(m,!0)).cmpn(1)<=0||m.cmp(d)>=0)){var g=this.g.mul(m);if(!g.isInfinity()){var b=g.getX(),y=b.umod(this.n);if(0!==y.cmpn(0)){var v=m.invm(this.n).mul(y.mul(e.getPrivate()).iadd(t));if(0!==(v=v.umod(this.n)).cmpn(0)){var w=(g.getY().isOdd()?1:0)|(0!==b.cmp(y)?2:0);return o.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),w^=1),new c({r:y,s:v,recoveryParam:w})}}}}}},f.prototype.verify=function(t,e,r,n,i){i||(i={}),t=this._truncateToN(t,!1,i.msgBitLength),r=this.keyFromPublic(r,n);var o=(e=new c(e,"hex")).r,s=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,u=s.invm(this.n),h=u.mul(t).umod(this.n),f=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(h,r.getPublic(),f)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(h,r.getPublic(),f)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},f.prototype.recoverPubKey=function(t,e,r,i){u((3&r)===r,"The recovery param is more than two bits"),e=new c(e,i);var o=this.n,s=new n(t),a=e.r,h=e.s,f=1&r,l=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),f):this.curve.pointFromX(a,f);var d=e.r.invm(o),p=o.sub(s).mul(d).umod(o),m=h.mul(d).umod(o);return this.g.mulAdd(p,a,m)},f.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new c(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},2307:(t,e,r)=>{"use strict";var n=r(2140),i=r(8288).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.validate()||i(t.validate(),"public point not validated"),t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e,r){return this.ec.verify(t,e,this,void 0,r)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},1798:(t,e,r)=>{"use strict";var n=r(2140),i=r(8288),o=i.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(){this.place=0}function u(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;if(0===t[e.place])return!1;for(var i=0,o=0,s=e.place;o<n;o++,s++)i<<=8,i|=t[s],i>>>=0;return!(i<=127)&&(e.place=s,i)}function h(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function c(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=s,s.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new a;if(48!==t[r.place++])return!1;var o=u(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var s=u(t,r);if(!1===s)return!1;if(0!=(128&t[r.place]))return!1;var h=t.slice(r.place,s+r.place);if(r.place+=s,2!==t[r.place++])return!1;var c=u(t,r);if(!1===c)return!1;if(t.length!==c+r.place)return!1;if(0!=(128&t[r.place]))return!1;var f=t.slice(r.place,c+r.place);if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new n(h),this.s=new n(f),this.recoveryParam=null,!0},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=h(e),r=h(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];c(n,e.length),(n=n.concat(e)).push(2),c(n,r.length);var o=n.concat(r),s=[48];return c(s,o.length),s=s.concat(o),i.encode(s,t)}},9208:(t,e,r)=>{"use strict";var n=r(3506),i=r(1479),o=r(8288),s=o.assert,a=o.parseBytes,u=r(851),h=r(6117);function c(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof c))return new c(t);t=i[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=c,c.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),u=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},c.prototype.verify=function(t,e,r){if(t=a(t),(e=this.makeSignature(e)).S().gte(e.eddsa.curve.n)||e.S().isNeg())return!1;var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},c.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return o.intFromLE(t.digest()).umod(this.curve.n)},c.prototype.keyFromPublic=function(t){return u.fromPublic(this,t)},c.prototype.keyFromSecret=function(t){return u.fromSecret(this,t)},c.prototype.makeSignature=function(t){return t instanceof h?t:new h(this,t)},c.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},c.prototype.decodePoint=function(t){var e=(t=o.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),n=0!=(128&t[e]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},c.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},c.prototype.decodeInt=function(t){return o.intFromLE(t)},c.prototype.isPoint=function(t){return t instanceof this.pointClass}},851:(t,e,r)=>{"use strict";var n=r(8288),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}a.fromPublic=function(t,e){return e instanceof a?e:new a(t,{pub:e})},a.fromSecret=function(t,e){return e instanceof a?e:new a(t,{secret:e})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},a.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},a.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},a.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},t.exports=a},6117:(t,e,r)=>{"use strict";var n=r(2140),i=r(8288),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function u(t,e){this.eddsa=t,"object"!=typeof e&&(e=a(e)),Array.isArray(e)&&(o(e.length===2*t.encodingLength,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),o(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof n&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}s(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},t.exports=u},7983:t=>{t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},8288:(t,e,r)=>{"use strict";var n=e,i=r(2140),o=r(9561),s=r(3022);n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(t,e,r){var n,i=new Array(Math.max(t.bitLength(),r)+1);for(n=0;n<i.length;n+=1)i[n]=0;var o=1<<e+1,s=t.clone();for(n=0;n<i.length;n++){var a,u=s.andln(o-1);s.isOdd()?(a=u>(o>>1)-1?(o>>1)-u:u,s.isubn(a)):a=0,i[n]=a,s.iushrn(1)}return i},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var s,a,u=t.andln(3)+i&3,h=e.andln(3)+o&3;3===u&&(u=-1),3===h&&(h=-1),s=0==(1&u)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==h?u:-u,r[0].push(s),a=0==(1&h)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==u?h:-h,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},2140:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(488).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function h(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,c=r;c<a;c+=n)u=h(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var f=1;for(u=h(t,c,t.length,e),c=0;c<s;c++)f*=e;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","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"],f=[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],l=[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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var c=u>>>26,f=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[h]=0|f,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-i;a++)h[a]=0;for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[o-a-1]=s}return h},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,c=0|s[0],f=8191&c,l=c>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],b=8191&g,y=g>>>13,v=0|s[3],w=8191&v,M=v>>>13,E=0|s[4],S=8191&E,_=E>>>13,k=0|s[5],A=8191&k,x=k>>>13,I=0|s[6],B=8191&I,T=I>>>13,P=0|s[7],C=8191&P,R=P>>>13,O=0|s[8],L=8191&O,N=O>>>13,j=0|s[9],H=8191&j,D=j>>>13,U=0|a[0],F=8191&U,$=U>>>13,q=0|a[1],z=8191&q,G=q>>>13,V=0|a[2],J=8191&V,K=V>>>13,W=0|a[3],Z=8191&W,X=W>>>13,Y=0|a[4],Q=8191&Y,tt=Y>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],ft=8191&ct,lt=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(h+(n=Math.imul(f,F))|0)+((8191&(i=(i=Math.imul(f,$))+Math.imul(l,F)|0))<<13)|0;h=((o=Math.imul(l,$))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,$))+Math.imul(m,F)|0,o=Math.imul(m,$);var bt=(h+(n=n+Math.imul(f,z)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(l,z)|0))<<13)|0;h=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,F),i=(i=Math.imul(b,$))+Math.imul(y,F)|0,o=Math.imul(y,$),n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,z)|0,o=o+Math.imul(m,G)|0;var yt=(h+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(l,J)|0))<<13)|0;h=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,$))+Math.imul(M,F)|0,o=Math.imul(M,$),n=n+Math.imul(b,z)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,K)|0;var vt=(h+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(l,Z)|0))<<13)|0;h=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,$))+Math.imul(_,F)|0,o=Math.imul(_,$),n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,z)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,K)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var wt=(h+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(l,Q)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(A,F),i=(i=Math.imul(A,$))+Math.imul(x,F)|0,o=Math.imul(x,$),n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,K)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(h+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,F),i=(i=Math.imul(B,$))+Math.imul(T,F)|0,o=Math.imul(T,$),n=n+Math.imul(A,z)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(x,z)|0,o=o+Math.imul(x,G)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Et=(h+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,$))+Math.imul(R,F)|0,o=Math.imul(R,$),n=n+Math.imul(B,z)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,K)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(h+(n=n+Math.imul(f,ut)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,$))+Math.imul(N,F)|0,o=Math.imul(N,$),n=n+Math.imul(C,z)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,G)|0,n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,K)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,K)|0,n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,X)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var _t=(h+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(H,F),i=(i=Math.imul(H,$))+Math.imul(D,F)|0,o=Math.imul(D,$),n=n+Math.imul(L,z)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(N,z)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,K)|0,n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ft)|0,o=o+Math.imul(m,lt)|0;var kt=(h+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(H,z),i=(i=Math.imul(H,G))+Math.imul(D,z)|0,o=Math.imul(D,G),n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(y,ft)|0,o=o+Math.imul(y,lt)|0;var At=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(H,J),i=(i=Math.imul(H,K))+Math.imul(D,J)|0,o=Math.imul(D,K),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,X)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(M,ft)|0,o=o+Math.imul(M,lt)|0;var xt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(H,Z),i=(i=Math.imul(H,X))+Math.imul(D,Z)|0,o=Math.imul(D,X),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(S,ft)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,lt)|0;var It=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(H,Q),i=(i=Math.imul(H,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(A,ft)|0,i=(i=i+Math.imul(A,lt)|0)+Math.imul(x,ft)|0,o=o+Math.imul(x,lt)|0;var Bt=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(H,rt),i=(i=Math.imul(H,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ht)|0,n=n+Math.imul(B,ft)|0,i=(i=i+Math.imul(B,lt)|0)+Math.imul(T,ft)|0,o=o+Math.imul(T,lt)|0;var Tt=(h+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(H,ot),i=(i=Math.imul(H,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(L,ut)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(C,ft)|0,i=(i=i+Math.imul(C,lt)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,lt)|0;var Pt=(h+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(H,ut),i=(i=Math.imul(H,ht))+Math.imul(D,ut)|0,o=Math.imul(D,ht),n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,lt)|0)+Math.imul(N,ft)|0,o=o+Math.imul(N,lt)|0;var Ct=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(H,ft),i=(i=Math.imul(H,lt))+Math.imul(D,ft)|0,o=Math.imul(D,lt);var Rt=(h+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Ot=(h+(n=Math.imul(H,pt))|0)+((8191&(i=(i=Math.imul(H,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=bt,u[2]=yt,u[3]=vt,u[4]=wt,u[5]=Mt,u[6]=Et,u[7]=St,u[8]=_t,u[9]=kt,u[10]=At,u[11]=xt,u[12]=It,u[13]=Bt,u[14]=Tt,u[15]=Pt,u[16]=Ct,u[17]=Rt,u[18]=Ot,0!==h&&(u[19]=h,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var c=o-h,f=(0|t.words[c])*(0|e.words[h]),l=67108863&f;a=67108863&(l=l+a|0),i+=(s=(s=s+(f/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},g.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var f=u,l=h,d=0;d<s;d++){var p=r[c+d],m=n[c+d],g=r[c+d+s],b=n[c+d+s],y=f*g-l*b;b=f*b+l*g,g=y,r[c+d]=p+g,n[c+d]=m+b,r[c+d+s]=p-g,n[c+d+s]=m-b,d!==a&&(y=u*f-h*l,l=u*l+h*f,f=y)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),c=new Array(n),f=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,c,f,n,i);for(var d=0;d<n;d++){var p=a[d]*c[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),m(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var c=0;for(h=this.length-1;h>=0&&(0!==c||h>=i);h--){var f=0|this.words[h];this.words[h]=c<<26-o|f>>>o,c=f&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var l=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,f);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=l)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,l=1;0==(r.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function _(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(v,y),v.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,y),i(M,y),i(E,y),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return b[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var b=this.pow(f,new o(1).iushln(p-g-1));l=l.redMul(b),f=b.redSqr(),d=d.redMul(f),p=g}return l},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],c=u-1;c>=0;c--){var f=h>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new _(t)},i(_,S),_.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},_.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},_.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},_.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},_.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},1115:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.keccak512=e.keccak384=e.keccak256=e.keccak224=void 0;const n=r(3488),i=r(144);e.keccak224=(0,i.wrapHash)(n.keccak_224),e.keccak256=(()=>{const t=(0,i.wrapHash)(n.keccak_256);return t.create=n.keccak_256.create,t})(),e.keccak384=(0,i.wrapHash)(n.keccak_384),e.keccak512=(0,i.wrapHash)(n.keccak_512)},1019:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createCurve=e.getHash=void 0;const n=r(520),i=r(300),o=r(551);function s(t){return{hash:t,hmac:(e,...r)=>(0,n.hmac)(t,e,(0,i.concatBytes)(...r)),randomBytes:i.randomBytes}}e.getHash=s,e.createCurve=function(t,e){const r=e=>(0,o.weierstrass)({...t,...s(e)});return Object.freeze({...r(e),create:r})}},7824:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validateBasic=e.wNAF=void 0;const n=r(8767),i=r(7367),o=BigInt(0),s=BigInt(1);e.wNAF=function(t,e){const r=(t,e)=>{const r=e.negate();return t?r:e},n=t=>({windows:Math.ceil(e/t)+1,windowSize:2**(t-1)});return{constTimeNegate:r,unsafeLadder(e,r){let n=t.ZERO,i=e;for(;r>o;)r&s&&(n=n.add(i)),i=i.double(),r>>=s;return n},precomputeWindow(t,e){const{windows:r,windowSize:i}=n(e),o=[];let s=t,a=s;for(let t=0;t<r;t++){a=s,o.push(a);for(let t=1;t<i;t++)a=a.add(s),o.push(a);s=a.double()}return o},wNAF(e,i,o){const{windows:a,windowSize:u}=n(e);let h=t.ZERO,c=t.BASE;const f=BigInt(2**e-1),l=2**e,d=BigInt(e);for(let t=0;t<a;t++){const e=t*u;let n=Number(o&f);o>>=d,n>u&&(n-=l,o+=s);const a=e,p=e+Math.abs(n)-1,m=t%2!=0,g=n<0;0===n?c=c.add(r(m,i[a])):h=h.add(r(g,i[p]))}return{p:h,f:c}},wNAFCached(t,e,r,n){const i=t._WINDOW_SIZE||1;let o=e.get(t);return o||(o=this.precomputeWindow(t,i),1!==i&&e.set(t,n(o))),this.wNAF(i,o,r)}}},e.validateBasic=function(t){return(0,n.validateField)(t.Fp),(0,i.validateObject)(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,n.nLength)(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}},9173:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createHasher=e.isogenyMap=e.hash_to_field=e.expand_message_xof=e.expand_message_xmd=void 0;const n=r(8767),i=r(7367);const o=i.bytesToNumberBE;function s(t,e){if(t<0||t>=1<<8*e)throw new Error(`bad I2OSP call: value=${t} length=${e}`);const r=Array.from({length:e}).fill(0);for(let n=e-1;n>=0;n--)r[n]=255&t,t>>>=8;return new Uint8Array(r)}function a(t,e){const r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t[n]^e[n];return r}function u(t){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected")}function h(t){if(!Number.isSafeInteger(t))throw new Error("number expected")}function c(t,e,r,n){u(t),u(e),h(r),e.length>255&&(e=n((0,i.concatBytes)((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-"),e)));const{outputLen:o,blockLen:c}=n,f=Math.ceil(r/o);if(f>255)throw new Error("Invalid xmd length");const l=(0,i.concatBytes)(e,s(e.length,1)),d=s(0,c),p=s(r,2),m=new Array(f),g=n((0,i.concatBytes)(d,t,p,s(0,1),l));m[0]=n((0,i.concatBytes)(g,s(1,1),l));for(let t=1;t<=f;t++){const e=[a(g,m[t-1]),s(t+1,1),l];m[t]=n((0,i.concatBytes)(...e))}return(0,i.concatBytes)(...m).slice(0,r)}function f(t,e,r,n,o){if(u(t),u(e),h(r),e.length>255){const t=Math.ceil(2*n/8);e=o.create({dkLen:t}).update((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(e).digest()}if(r>65535||e.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return o.create({dkLen:r}).update(t).update(s(r,2)).update(e).update(s(e.length,1)).digest()}function l(t,e,r){(0,i.validateObject)(r,{DST:"string",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:s,k:a,m:l,hash:d,expand:p,DST:m}=r;u(t),h(e);const g=function(t){if(t instanceof Uint8Array)return t;if("string"==typeof t)return(0,i.utf8ToBytes)(t);throw new Error("DST must be Uint8Array or string")}(m),b=s.toString(2).length,y=Math.ceil((b+a)/8),v=e*l*y;let w;if("xmd"===p)w=c(t,g,v,d);else if("xof"===p)w=f(t,g,v,a,d);else{if("_internal_pass"!==p)throw new Error('expand must be "xmd" or "xof"');w=t}const M=new Array(e);for(let t=0;t<e;t++){const e=new Array(l);for(let r=0;r<l;r++){const i=y*(r+t*l),a=w.subarray(i,i+y);e[r]=(0,n.mod)(o(a),s)}M[t]=e}return M}e.expand_message_xmd=c,e.expand_message_xof=f,e.hash_to_field=l,e.isogenyMap=function(t,e){const r=e.map((t=>Array.from(t).reverse()));return(e,n)=>{const[i,o,s,a]=r.map((r=>r.reduce(((r,n)=>t.add(t.mul(r,e),n)))));return e=t.div(i,o),n=t.mul(n,t.div(s,a)),{x:e,y:n}}},e.createHasher=function(t,e,r){if("function"!=typeof e)throw new Error("mapToCurve() must be defined");return{hashToCurve(n,i){const o=l(n,2,{...r,DST:r.DST,...i}),s=t.fromAffine(e(o[0])),a=t.fromAffine(e(o[1])),u=s.add(a).clearCofactor();return u.assertValidity(),u},encodeToCurve(n,i){const o=l(n,1,{...r,DST:r.encodeDST,...i}),s=t.fromAffine(e(o[0])).clearCofactor();return s.assertValidity(),s}}}},8767:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hashToPrivateScalar=e.FpSqrtEven=e.FpSqrtOdd=e.Field=e.nLength=e.FpIsSquare=e.FpDiv=e.FpInvertBatch=e.FpPow=e.validateField=e.isNegativeLE=e.FpSqrt=e.tonelliShanks=e.invert=e.pow2=e.pow=e.mod=void 0;const n=r(7367),i=BigInt(0),o=BigInt(1),s=BigInt(2),a=BigInt(3),u=BigInt(4),h=BigInt(5),c=BigInt(8);BigInt(9),BigInt(16);function f(t,e){const r=t%e;return r>=i?r:e+r}function l(t,e,r){if(r<=i||e<i)throw new Error("Expected power/modulo > 0");if(r===o)return i;let n=o;for(;e>i;)e&o&&(n=n*t%r),t=t*t%r,e>>=o;return n}function d(t,e){if(t===i||e<=i)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=f(t,e),n=e,s=i,a=o,u=o,h=i;for(;r!==i;){const t=n/r,e=n%r,i=s-u*t,o=a-h*t;n=r,r=e,s=u,a=h,u=i,h=o}if(n!==o)throw new Error("invert: does not exist");return f(s,e)}function p(t){const e=(t-o)/s;let r,n,a;for(r=t-o,n=0;r%s===i;r/=s,n++);for(a=s;a<t&&l(a,e,t)!==t-o;a++);if(1===n){const e=(t+o)/u;return function(t,r){const n=t.pow(r,e);if(!t.eql(t.sqr(n),r))throw new Error("Cannot find square root");return n}}const h=(r+o)/s;return function(t,i){if(t.pow(i,e)===t.neg(t.ONE))throw new Error("Cannot find square root");let s=n,u=t.pow(t.mul(t.ONE,a),r),c=t.pow(i,h),f=t.pow(i,r);for(;!t.eql(f,t.ONE);){if(t.eql(f,t.ZERO))return t.ZERO;let e=1;for(let r=t.sqr(f);e<s&&!t.eql(r,t.ONE);e++)r=t.sqr(r);const r=t.pow(u,o<<BigInt(s-e-1));u=t.sqr(r),c=t.mul(c,r),f=t.mul(f,u),s=e}return c}}function m(t){if(t%u===a){const e=(t+o)/u;return function(t,r){const n=t.pow(r,e);if(!t.eql(t.sqr(n),r))throw new Error("Cannot find square root");return n}}if(t%c===h){const e=(t-h)/c;return function(t,r){const n=t.mul(r,s),i=t.pow(n,e),o=t.mul(r,i),a=t.mul(t.mul(o,s),i),u=t.mul(o,t.sub(a,t.ONE));if(!t.eql(t.sqr(u),r))throw new Error("Cannot find square root");return u}}return p(t)}e.mod=f,e.pow=l,e.pow2=function(t,e,r){let n=t;for(;e-- >i;)n*=n,n%=r;return n},e.invert=d,e.tonelliShanks=p,e.FpSqrt=m;e.isNegativeLE=(t,e)=>(f(t,e)&o)===o;const g=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function b(t,e,r){if(r<i)throw new Error("Expected power > 0");if(r===i)return t.ONE;if(r===o)return e;let n=t.ONE,s=e;for(;r>i;)r&o&&(n=t.mul(n,s)),s=t.sqr(s),r>>=o;return n}function y(t,e){const r=new Array(e.length),n=e.reduce(((e,n,i)=>t.is0(n)?e:(r[i]=e,t.mul(e,n))),t.ONE),i=t.inv(n);return e.reduceRight(((e,n,i)=>t.is0(n)?e:(r[i]=t.mul(e,r[i]),t.mul(e,n))),i),r}function v(t,e){const r=void 0!==e?e:t.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}e.validateField=function(t){const e=g.reduce(((t,e)=>(t[e]="function",t)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,n.validateObject)(t,e)},e.FpPow=b,e.FpInvertBatch=y,e.FpDiv=function(t,e,r){return t.mul(e,"bigint"==typeof r?d(r,t.ORDER):t.inv(r))},e.FpIsSquare=function(t){const e=(t.ORDER-o)/s;return r=>{const n=t.pow(r,e);return t.eql(n,t.ZERO)||t.eql(n,t.ONE)}},e.nLength=v,e.Field=function(t,e,r=!1,s={}){if(t<=i)throw new Error(`Expected Fp ORDER > 0, got ${t}`);const{nBitLength:a,nByteLength:u}=v(t,e);if(u>2048)throw new Error("Field lengths over 2048 bytes are not supported");const h=m(t),c=Object.freeze({ORDER:t,BITS:a,BYTES:u,MASK:(0,n.bitMask)(a),ZERO:i,ONE:o,create:e=>f(e,t),isValid:e=>{if("bigint"!=typeof e)throw new Error("Invalid field element: expected bigint, got "+typeof e);return i<=e&&e<t},is0:t=>t===i,isOdd:t=>(t&o)===o,neg:e=>f(-e,t),eql:(t,e)=>t===e,sqr:e=>f(e*e,t),add:(e,r)=>f(e+r,t),sub:(e,r)=>f(e-r,t),mul:(e,r)=>f(e*r,t),pow:(t,e)=>b(c,t,e),div:(e,r)=>f(e*d(r,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>d(e,t),sqrt:s.sqrt||(t=>h(c,t)),invertBatch:t=>y(c,t),cmov:(t,e,r)=>r?e:t,toBytes:t=>r?(0,n.numberToBytesLE)(t,u):(0,n.numberToBytesBE)(t,u),fromBytes:t=>{if(t.length!==u)throw new Error(`Fp.fromBytes: expected ${u}, got ${t.length}`);return r?(0,n.bytesToNumberLE)(t):(0,n.bytesToNumberBE)(t)}});return Object.freeze(c)},e.FpSqrtOdd=function(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");const r=t.sqrt(e);return t.isOdd(r)?r:t.neg(r)},e.FpSqrtEven=function(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");const r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r},e.hashToPrivateScalar=function(t,e,r=!1){const i=(t=(0,n.ensureBytes)("privateHash",t)).length,s=v(e).nByteLength+8;if(s<24||i<s||i>1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${i}`);return f(r?(0,n.bytesToNumberLE)(t):(0,n.bytesToNumberBE)(t),e-o)+o}},7367:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validateObject=e.createHmacDrbg=e.bitMask=e.bitSet=e.bitGet=e.bitLen=e.utf8ToBytes=e.equalBytes=e.concatBytes=e.ensureBytes=e.numberToVarBytesBE=e.numberToBytesLE=e.numberToBytesBE=e.bytesToNumberLE=e.bytesToNumberBE=e.hexToBytes=e.hexToNumber=e.numberToHexUnpadded=e.bytesToHex=void 0;const r=BigInt(0),n=BigInt(1),i=BigInt(2),o=t=>t instanceof Uint8Array,s=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function a(t){if(!o(t))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=s[t[r]];return e}function u(t){const e=t.toString(16);return 1&e.length?`0${e}`:e}function h(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);return BigInt(""===t?"0":`0x${t}`)}function c(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(e/2);for(let e=0;e<r.length;e++){const n=2*e,i=t.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");r[e]=o}return r}function f(t,e){return c(t.toString(16).padStart(2*e,"0"))}function l(...t){const e=new Uint8Array(t.reduce(((t,e)=>t+e.length),0));let r=0;return t.forEach((t=>{if(!o(t))throw new Error("Uint8Array expected");e.set(t,r),r+=t.length})),e}e.bytesToHex=a,e.numberToHexUnpadded=u,e.hexToNumber=h,e.hexToBytes=c,e.bytesToNumberBE=function(t){return h(a(t))},e.bytesToNumberLE=function(t){if(!o(t))throw new Error("Uint8Array expected");return h(a(Uint8Array.from(t).reverse()))},e.numberToBytesBE=f,e.numberToBytesLE=function(t,e){return f(t,e).reverse()},e.numberToVarBytesBE=function(t){return c(u(t))},e.ensureBytes=function(t,e,r){let n;if("string"==typeof e)try{n=c(e)}catch(r){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${r}`)}else{if(!o(e))throw new Error(`${t} must be hex string or Uint8Array`);n=Uint8Array.from(e)}const i=n.length;if("number"==typeof r&&i!==r)throw new Error(`${t} expected ${r} bytes, got ${i}`);return n},e.concatBytes=l,e.equalBytes=function(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0},e.utf8ToBytes=function(t){if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array((new TextEncoder).encode(t))},e.bitLen=function(t){let e;for(e=0;t>r;t>>=n,e+=1);return e},e.bitGet=function(t,e){return t>>BigInt(e)&n};e.bitSet=(t,e,i)=>t|(i?n:r)<<BigInt(e);e.bitMask=t=>(i<<BigInt(t-1))-n;const d=t=>new Uint8Array(t),p=t=>Uint8Array.from(t);e.createHmacDrbg=function(t,e,r){if("number"!=typeof t||t<2)throw new Error("hashLen must be a number");if("number"!=typeof e||e<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let n=d(t),i=d(t),o=0;const s=()=>{n.fill(1),i.fill(0),o=0},a=(...t)=>r(i,n,...t),u=(t=d())=>{i=a(p([0]),t),n=a(),0!==t.length&&(i=a(p([1]),t),n=a())},h=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let t=0;const r=[];for(;t<e;){n=a();const e=n.slice();r.push(e),t+=n.length}return l(...r)};return(t,e)=>{let r;for(s(),u(t);!(r=e(h()));)u();return s(),r}};const m={bigint:t=>"bigint"==typeof t,function:t=>"function"==typeof t,boolean:t=>"boolean"==typeof t,string:t=>"string"==typeof t,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>"function"==typeof t&&Number.isSafeInteger(t.outputLen)};e.validateObject=function(t,e,r={}){const n=(e,r,n)=>{const i=m[r];if("function"!=typeof i)throw new Error(`Invalid validator "${r}", expected function`);const o=t[e];if(!(n&&void 0===o||i(o,t)))throw new Error(`Invalid param ${String(e)}=${o} (${typeof o}), expected ${r}`)};for(const[t,r]of Object.entries(e))n(t,r,!1);for(const[t,e]of Object.entries(r))n(t,e,!0);return t}},551:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mapToCurveSimpleSWU=e.SWUFpSqrtRatio=e.weierstrass=e.weierstrassPoints=e.DER=void 0;const n=r(8767),i=r(7367),o=r(7367),s=r(7824);const{bytesToNumberBE:a,hexToBytes:u}=i;e.DER={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(t){const{Err:r}=e.DER;if(t.length<2||2!==t[0])throw new r("Invalid signature integer tag");const n=t[1],i=t.subarray(2,n+2);if(!n||i.length!==n)throw new r("Invalid signature integer: wrong length");if(128&i[0])throw new r("Invalid signature integer: negative");if(0===i[0]&&!(128&i[1]))throw new r("Invalid signature integer: unnecessary leading zero");return{d:a(i),l:t.subarray(n+2)}},toSig(t){const{Err:r}=e.DER,n="string"==typeof t?u(t):t;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let i=n.length;if(i<2||48!=n[0])throw new r("Invalid signature tag");if(n[1]!==i-2)throw new r("Invalid signature: incorrect length");const{d:o,l:s}=e.DER._parseInt(n.subarray(2)),{d:a,l:h}=e.DER._parseInt(s);if(h.length)throw new r("Invalid signature: left bytes after parsing");return{r:o,s:a}},hexFromSig(t){const e=t=>8&Number.parseInt(t[0],16)?"00"+t:t,r=t=>{const e=t.toString(16);return 1&e.length?`0${e}`:e},n=e(r(t.s)),i=e(r(t.r)),o=n.length/2,s=i.length/2,a=r(o),u=r(s);return`30${r(s+o+4)}02${u}${i}02${a}${n}`}};const h=BigInt(0),c=BigInt(1),f=BigInt(2),l=BigInt(3),d=BigInt(4);function p(t){const e=function(t){const e=(0,s.validateBasic)(t);i.validateObject(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:o}=e;if(r){if(!n.eql(o,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}(t),{Fp:r}=e,a=e.toBytes||((t,e,n)=>{const o=e.toAffine();return i.concatBytes(Uint8Array.from([4]),r.toBytes(o.x),r.toBytes(o.y))}),u=e.fromBytes||(t=>{const e=t.subarray(1);return{x:r.fromBytes(e.subarray(0,r.BYTES)),y:r.fromBytes(e.subarray(r.BYTES,2*r.BYTES))}});function f(t){const{a:n,b:i}=e,o=r.sqr(t),s=r.mul(o,t);return r.add(r.add(s,r.mul(t,n)),i)}if(!r.eql(r.sqr(e.Gy),f(e.Gx)))throw new Error("bad generator point: equation left != right");function d(t){return"bigint"==typeof t&&h<t&&t<e.n}function p(t){if(!d(t))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function m(t){const{allowedPrivateKeyLengths:r,nByteLength:s,wrapPrivateKey:a,n:u}=e;if(r&&"bigint"!=typeof t){if(t instanceof Uint8Array&&(t=i.bytesToHex(t)),"string"!=typeof t||!r.includes(t.length))throw new Error("Invalid key");t=t.padStart(2*s,"0")}let h;try{h="bigint"==typeof t?t:i.bytesToNumberBE((0,o.ensureBytes)("private key",t,s))}catch(e){throw new Error(`private key must be ${s} bytes, hex or bigint, not ${typeof t}`)}return a&&(h=n.mod(h,u)),p(h),h}const g=new Map;function b(t){if(!(t instanceof y))throw new Error("ProjectivePoint expected")}class y{constructor(t,e,n){if(this.px=t,this.py=e,this.pz=n,null==t||!r.isValid(t))throw new Error("x required");if(null==e||!r.isValid(e))throw new Error("y required");if(null==n||!r.isValid(n))throw new Error("z required")}static fromAffine(t){const{x:e,y:n}=t||{};if(!t||!r.isValid(e)||!r.isValid(n))throw new Error("invalid affine point");if(t instanceof y)throw new Error("projective point not allowed");const i=t=>r.eql(t,r.ZERO);return i(e)&&i(n)?y.ZERO:new y(e,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(t){const e=r.invertBatch(t.map((t=>t.pz)));return t.map(((t,r)=>t.toAffine(e[r]))).map(y.fromAffine)}static fromHex(t){const e=y.fromAffine(u((0,o.ensureBytes)("pointHex",t)));return e.assertValidity(),e}static fromPrivateKey(t){return y.BASE.multiply(m(t))}_setWindowSize(t){this._WINDOW_SIZE=t,g.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:t,y:n}=this.toAffine();if(!r.isValid(t)||!r.isValid(n))throw new Error("bad point: x or y not FE");const i=r.sqr(n),o=f(t);if(!r.eql(i,o))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:t}=this.toAffine();if(r.isOdd)return!r.isOdd(t);throw new Error("Field doesn't support isOdd")}equals(t){b(t);const{px:e,py:n,pz:i}=this,{px:o,py:s,pz:a}=t,u=r.eql(r.mul(e,a),r.mul(o,i)),h=r.eql(r.mul(n,a),r.mul(s,i));return u&&h}negate(){return new y(this.px,r.neg(this.py),this.pz)}double(){const{a:t,b:n}=e,i=r.mul(n,l),{px:o,py:s,pz:a}=this;let u=r.ZERO,h=r.ZERO,c=r.ZERO,f=r.mul(o,o),d=r.mul(s,s),p=r.mul(a,a),m=r.mul(o,s);return m=r.add(m,m),c=r.mul(o,a),c=r.add(c,c),u=r.mul(t,c),h=r.mul(i,p),h=r.add(u,h),u=r.sub(d,h),h=r.add(d,h),h=r.mul(u,h),u=r.mul(m,u),c=r.mul(i,c),p=r.mul(t,p),m=r.sub(f,p),m=r.mul(t,m),m=r.add(m,c),c=r.add(f,f),f=r.add(c,f),f=r.add(f,p),f=r.mul(f,m),h=r.add(h,f),p=r.mul(s,a),p=r.add(p,p),f=r.mul(p,m),u=r.sub(u,f),c=r.mul(p,d),c=r.add(c,c),c=r.add(c,c),new y(u,h,c)}add(t){b(t);const{px:n,py:i,pz:o}=this,{px:s,py:a,pz:u}=t;let h=r.ZERO,c=r.ZERO,f=r.ZERO;const d=e.a,p=r.mul(e.b,l);let m=r.mul(n,s),g=r.mul(i,a),v=r.mul(o,u),w=r.add(n,i),M=r.add(s,a);w=r.mul(w,M),M=r.add(m,g),w=r.sub(w,M),M=r.add(n,o);let E=r.add(s,u);return M=r.mul(M,E),E=r.add(m,v),M=r.sub(M,E),E=r.add(i,o),h=r.add(a,u),E=r.mul(E,h),h=r.add(g,v),E=r.sub(E,h),f=r.mul(d,M),h=r.mul(p,v),f=r.add(h,f),h=r.sub(g,f),f=r.add(g,f),c=r.mul(h,f),g=r.add(m,m),g=r.add(g,m),v=r.mul(d,v),M=r.mul(p,M),g=r.add(g,v),v=r.sub(m,v),v=r.mul(d,v),M=r.add(M,v),m=r.mul(g,M),c=r.add(c,m),m=r.mul(E,M),h=r.mul(w,h),h=r.sub(h,m),m=r.mul(w,g),f=r.mul(E,f),f=r.add(f,m),new y(h,c,f)}subtract(t){return this.add(t.negate())}is0(){return this.equals(y.ZERO)}wNAF(t){return w.wNAFCached(this,g,t,(t=>{const e=r.invertBatch(t.map((t=>t.pz)));return t.map(((t,r)=>t.toAffine(e[r]))).map(y.fromAffine)}))}multiplyUnsafe(t){const n=y.ZERO;if(t===h)return n;if(p(t),t===c)return this;const{endo:i}=e;if(!i)return w.unsafeLadder(this,t);let{k1neg:o,k1:s,k2neg:a,k2:u}=i.splitScalar(t),f=n,l=n,d=this;for(;s>h||u>h;)s&c&&(f=f.add(d)),u&c&&(l=l.add(d)),d=d.double(),s>>=c,u>>=c;return o&&(f=f.negate()),a&&(l=l.negate()),l=new y(r.mul(l.px,i.beta),l.py,l.pz),f.add(l)}multiply(t){p(t);let n,i,o=t;const{endo:s}=e;if(s){const{k1neg:t,k1:e,k2neg:a,k2:u}=s.splitScalar(o);let{p:h,f:c}=this.wNAF(e),{p:f,f:l}=this.wNAF(u);h=w.constTimeNegate(t,h),f=w.constTimeNegate(a,f),f=new y(r.mul(f.px,s.beta),f.py,f.pz),n=h.add(f),i=c.add(l)}else{const{p:t,f:e}=this.wNAF(o);n=t,i=e}return y.normalizeZ([n,i])[0]}multiplyAndAddUnsafe(t,e,r){const n=y.BASE,i=(t,e)=>e!==h&&e!==c&&t.equals(n)?t.multiply(e):t.multiplyUnsafe(e),o=i(this,e).add(i(t,r));return o.is0()?void 0:o}toAffine(t){const{px:e,py:n,pz:i}=this,o=this.is0();null==t&&(t=o?r.ONE:r.inv(i));const s=r.mul(e,t),a=r.mul(n,t),u=r.mul(i,t);if(o)return{x:r.ZERO,y:r.ZERO};if(!r.eql(u,r.ONE))throw new Error("invZ was invalid");return{x:s,y:a}}isTorsionFree(){const{h:t,isTorsionFree:r}=e;if(t===c)return!0;if(r)return r(y,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:t,clearCofactor:r}=e;return t===c?this:r?r(y,this):this.multiplyUnsafe(e.h)}toRawBytes(t=!0){return this.assertValidity(),a(y,this,t)}toHex(t=!0){return i.bytesToHex(this.toRawBytes(t))}}y.BASE=new y(e.Gx,e.Gy,r.ONE),y.ZERO=new y(r.ZERO,r.ONE,r.ZERO);const v=e.nBitLength,w=(0,s.wNAF)(y,e.endo?Math.ceil(v/2):v);return{CURVE:e,ProjectivePoint:y,normPrivateKeyToScalar:m,weierstrassEquation:f,isWithinCurveOrder:d}}function m(t,e){const r=t.ORDER;let n=h;for(let t=r-c;t%f===h;t/=f)n+=c;const i=n,o=f<<i-c-c,s=o*f,a=(r-c)/s,u=(a-c)/f,p=s-c,m=o,g=t.pow(e,a),b=t.pow(e,(a+c)/f);let y=(e,r)=>{let n=g,o=t.pow(r,p),s=t.sqr(o);s=t.mul(s,r);let a=t.mul(e,s);a=t.pow(a,u),a=t.mul(a,o),o=t.mul(a,r),s=t.mul(a,e);let h=t.mul(s,o);a=t.pow(h,m);let l=t.eql(a,t.ONE);o=t.mul(s,b),a=t.mul(h,n),s=t.cmov(o,s,l),h=t.cmov(a,h,l);for(let e=i;e>c;e--){let r=e-f;r=f<<r-c;let i=t.pow(h,r);const a=t.eql(i,t.ONE);o=t.mul(s,n),n=t.mul(n,n),i=t.mul(h,n),s=t.cmov(o,s,a),h=t.cmov(i,h,a)}return{isValid:l,value:s}};if(t.ORDER%d===l){const r=(t.ORDER-l)/d,n=t.sqrt(t.neg(e));y=(e,i)=>{let o=t.sqr(i);const s=t.mul(e,i);o=t.mul(o,s);let a=t.pow(o,r);a=t.mul(a,s);const u=t.mul(a,n),h=t.mul(t.sqr(a),i),c=t.eql(h,e);return{isValid:c,value:t.cmov(u,a,c)}}}return y}e.weierstrassPoints=p,e.weierstrass=function(t){const r=function(t){const e=(0,s.validateBasic)(t);return i.validateObject(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}(t),{Fp:a,n:u}=r,f=a.BYTES+1,l=2*a.BYTES+1;function d(t){return n.mod(t,u)}function m(t){return n.invert(t,u)}const{ProjectivePoint:g,normPrivateKeyToScalar:b,weierstrassEquation:y,isWithinCurveOrder:v}=p({...r,toBytes(t,e,r){const n=e.toAffine(),o=a.toBytes(n.x),s=i.concatBytes;return r?s(Uint8Array.from([e.hasEvenY()?2:3]),o):s(Uint8Array.from([4]),o,a.toBytes(n.y))},fromBytes(t){const e=t.length,r=t[0],n=t.subarray(1);if(e!==f||2!==r&&3!==r){if(e===l&&4===r){return{x:a.fromBytes(n.subarray(0,a.BYTES)),y:a.fromBytes(n.subarray(a.BYTES,2*a.BYTES))}}throw new Error(`Point of length ${e} was invalid. Expected ${f} compressed bytes or ${l} uncompressed bytes`)}{const t=i.bytesToNumberBE(n);if(!(h<(o=t)&&o<a.ORDER))throw new Error("Point is not on curve");const e=y(t);let s=a.sqrt(e);return 1==(1&r)!==((s&c)===c)&&(s=a.neg(s)),{x:t,y:s}}var o}}),w=t=>i.bytesToHex(i.numberToBytesBE(t,r.nByteLength));function M(t){return t>u>>c}const E=(t,e,r)=>i.bytesToNumberBE(t.slice(e,r));class S{constructor(t,e,r){this.r=t,this.s=e,this.recovery=r,this.assertValidity()}static fromCompact(t){const e=r.nByteLength;return t=(0,o.ensureBytes)("compactSignature",t,2*e),new S(E(t,0,e),E(t,e,2*e))}static fromDER(t){const{r,s:n}=e.DER.toSig((0,o.ensureBytes)("DER",t));return new S(r,n)}assertValidity(){if(!v(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!v(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(t){return new S(this.r,this.s,t)}recoverPublicKey(t){const{r:e,s:n,recovery:i}=this,s=x((0,o.ensureBytes)("msgHash",t));if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");const u=2===i||3===i?e+r.n:e;if(u>=a.ORDER)throw new Error("recovery id 2 or 3 invalid");const h=0==(1&i)?"02":"03",c=g.fromHex(h+w(u)),f=m(u),l=d(-s*f),p=d(n*f),b=g.BASE.multiplyAndAddUnsafe(c,l,p);if(!b)throw new Error("point at infinify");return b.assertValidity(),b}hasHighS(){return M(this.s)}normalizeS(){return this.hasHighS()?new S(this.r,d(-this.s),this.recovery):this}toDERRawBytes(){return i.hexToBytes(this.toDERHex())}toDERHex(){return e.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return i.hexToBytes(this.toCompactHex())}toCompactHex(){return w(this.r)+w(this.s)}}const _={isValidPrivateKey(t){try{return b(t),!0}catch(t){return!1}},normPrivateKeyToScalar:b,randomPrivateKey:()=>{const t=r.randomBytes(a.BYTES+8),e=n.hashToPrivateScalar(t,u);return i.numberToBytesBE(e,r.nByteLength)},precompute:(t=8,e=g.BASE)=>(e._setWindowSize(t),e.multiply(BigInt(3)),e)};function k(t){const e=t instanceof Uint8Array,r="string"==typeof t,n=(e||r)&&t.length;return e?n===f||n===l:r?n===2*f||n===2*l:t instanceof g}const A=r.bits2int||function(t){const e=i.bytesToNumberBE(t),n=8*t.length-r.nBitLength;return n>0?e>>BigInt(n):e},x=r.bits2int_modN||function(t){return d(A(t))},I=i.bitMask(r.nBitLength);function B(t){if("bigint"!=typeof t)throw new Error("bigint expected");if(!(h<=t&&t<I))throw new Error(`bigint expected < 2^${r.nBitLength}`);return i.numberToBytesBE(t,r.nByteLength)}function T(t,e,n=P){if(["recovered","canonical"].some((t=>t in n)))throw new Error("sign() legacy options not supported");const{hash:s,randomBytes:u}=r;let{lowS:f,prehash:l,extraEntropy:p}=n;null==f&&(f=!0),t=(0,o.ensureBytes)("msgHash",t),l&&(t=(0,o.ensureBytes)("prehashed msgHash",s(t)));const y=x(t),w=b(e),E=[B(w),B(y)];if(null!=p){const t=!0===p?u(a.BYTES):p;E.push((0,o.ensureBytes)("extraEntropy",t,a.BYTES))}const _=i.concatBytes(...E),k=y;return{seed:_,k2sig:function(t){const e=A(t);if(!v(e))return;const r=m(e),n=g.BASE.multiply(e).toAffine(),i=d(n.x);if(i===h)return;const o=d(r*d(k+i*w));if(o===h)return;let s=(n.x===i?0:2)|Number(n.y&c),a=o;return f&&M(o)&&(a=function(t){return M(t)?d(-t):t}(o),s^=1),new S(i,a,s)}}}const P={lowS:r.lowS,prehash:!1},C={lowS:r.lowS,prehash:!1};return g.BASE._setWindowSize(8),{CURVE:r,getPublicKey:function(t,e=!0){return g.fromPrivateKey(t).toRawBytes(e)},getSharedSecret:function(t,e,r=!0){if(k(t))throw new Error("first arg must be private key");if(!k(e))throw new Error("second arg must be public key");return g.fromHex(e).multiply(b(t)).toRawBytes(r)},sign:function(t,e,n=P){const{seed:o,k2sig:s}=T(t,e,n),a=r;return i.createHmacDrbg(a.hash.outputLen,a.nByteLength,a.hmac)(o,s)},verify:function(t,n,i,s=C){const a=t;if(n=(0,o.ensureBytes)("msgHash",n),i=(0,o.ensureBytes)("publicKey",i),"strict"in s)throw new Error("options.strict was renamed to lowS");const{lowS:u,prehash:h}=s;let c,f;try{if("string"==typeof a||a instanceof Uint8Array)try{c=S.fromDER(a)}catch(t){if(!(t instanceof e.DER.Err))throw t;c=S.fromCompact(a)}else{if("object"!=typeof a||"bigint"!=typeof a.r||"bigint"!=typeof a.s)throw new Error("PARSE");{const{r:t,s:e}=a;c=new S(t,e)}}f=g.fromHex(i)}catch(t){if("PARSE"===t.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(u&&c.hasHighS())return!1;h&&(n=r.hash(n));const{r:l,s:p}=c,b=x(n),y=m(p),v=d(b*y),w=d(l*y),M=g.BASE.multiplyAndAddUnsafe(f,v,w)?.toAffine();return!!M&&d(M.x)===l},ProjectivePoint:g,Signature:S,utils:_}},e.SWUFpSqrtRatio=m,e.mapToCurveSimpleSWU=function(t,e){if(n.validateField(t),!t.isValid(e.A)||!t.isValid(e.B)||!t.isValid(e.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const r=m(t,e.Z);if(!t.isOdd)throw new Error("Fp.isOdd is not implemented!");return n=>{let i,o,s,a,u,h,c,f;i=t.sqr(n),i=t.mul(i,e.Z),o=t.sqr(i),o=t.add(o,i),s=t.add(o,t.ONE),s=t.mul(s,e.B),a=t.cmov(e.Z,t.neg(o),!t.eql(o,t.ZERO)),a=t.mul(a,e.A),o=t.sqr(s),h=t.sqr(a),u=t.mul(h,e.A),o=t.add(o,u),o=t.mul(o,s),h=t.mul(h,a),u=t.mul(h,e.B),o=t.add(o,u),c=t.mul(i,s);const{isValid:l,value:d}=r(o,h);f=t.mul(i,n),f=t.mul(f,d),c=t.cmov(c,s,l),f=t.cmov(f,d,l);const p=t.isOdd(n)===t.isOdd(f);return f=t.cmov(t.neg(f),f,p),c=t.div(c,a),{x:c,y:f}}}},2934:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.schnorr=e.secp256k1=void 0;const n=r(3426),i=r(300),o=r(8767),s=r(551),a=r(7367),u=r(9173),h=r(1019),c=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),f=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),l=BigInt(1),d=BigInt(2),p=(t,e)=>(t+e/d)/e;function m(t){const e=c,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),a=BigInt(23),u=BigInt(44),h=BigInt(88),f=t*t*t%e,l=f*f*t%e,p=(0,o.pow2)(l,r,e)*l%e,m=(0,o.pow2)(p,r,e)*l%e,b=(0,o.pow2)(m,d,e)*f%e,y=(0,o.pow2)(b,i,e)*b%e,v=(0,o.pow2)(y,s,e)*y%e,w=(0,o.pow2)(v,u,e)*v%e,M=(0,o.pow2)(w,h,e)*w%e,E=(0,o.pow2)(M,u,e)*v%e,S=(0,o.pow2)(E,r,e)*l%e,_=(0,o.pow2)(S,a,e)*y%e,k=(0,o.pow2)(_,n,e)*f%e,A=(0,o.pow2)(k,d,e);if(!g.eql(g.sqr(A),t))throw new Error("Cannot find square root");return A}const g=(0,o.Field)(c,void 0,void 0,{sqrt:m});e.secp256k1=(0,h.createCurve)({a:BigInt(0),b:BigInt(7),Fp:g,n:f,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=f,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-l*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,a=BigInt("0x100000000000000000000000000000000"),u=p(s*t,e),h=p(-n*t,e);let c=(0,o.mod)(t-u*r-h*i,e),d=(0,o.mod)(-u*n-h*s,e);const m=c>a,g=d>a;if(m&&(c=e-c),g&&(d=e-d),c>a||d>a)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:m,k1:c,k2neg:g,k2:d}}}},n.sha256);const b=BigInt(0),y=t=>"bigint"==typeof t&&b<t&&t<c,v=t=>"bigint"==typeof t&&b<t&&t<f,w={};function M(t,...e){let r=w[t];if(void 0===r){const e=(0,n.sha256)(Uint8Array.from(t,(t=>t.charCodeAt(0))));r=(0,a.concatBytes)(e,e),w[t]=r}return(0,n.sha256)((0,a.concatBytes)(r,...e))}const E=t=>t.toRawBytes(!0).slice(1),S=t=>(0,a.numberToBytesBE)(t,32),_=t=>(0,o.mod)(t,c),k=t=>(0,o.mod)(t,f),A=e.secp256k1.ProjectivePoint,x=(t,e,r)=>A.BASE.multiplyAndAddUnsafe(t,e,r);function I(t){let r=e.secp256k1.utils.normPrivateKeyToScalar(t),n=A.fromPrivateKey(r);return{scalar:n.hasEvenY()?r:k(-r),bytes:E(n)}}function B(t){if(!y(t))throw new Error("bad x: need 0 < x < p");const e=_(t*t);let r=m(_(e*t+BigInt(7)));r%d!==b&&(r=_(-r));const n=new A(t,r,l);return n.assertValidity(),n}function T(...t){return k((0,a.bytesToNumberBE)(M("BIP0340/challenge",...t)))}function P(t){return I(t).bytes}function C(t,e,r=(0,i.randomBytes)(32)){const n=(0,a.ensureBytes)("message",t),{bytes:o,scalar:s}=I(e),u=(0,a.ensureBytes)("auxRand",r,32),h=S(s^(0,a.bytesToNumberBE)(M("BIP0340/aux",u))),c=M("BIP0340/nonce",h,o,n),f=k((0,a.bytesToNumberBE)(c));if(f===b)throw new Error("sign failed: k is zero");const{bytes:l,scalar:d}=I(f),p=T(l,o,n),m=new Uint8Array(64);if(m.set(l,0),m.set(S(k(d+p*s)),32),!R(m,n,o))throw new Error("sign: Invalid signature produced");return m}function R(t,e,r){const n=(0,a.ensureBytes)("signature",t,64),i=(0,a.ensureBytes)("message",e),o=(0,a.ensureBytes)("publicKey",r,32);try{const t=B((0,a.bytesToNumberBE)(o)),e=(0,a.bytesToNumberBE)(n.subarray(0,32));if(!y(e))return!1;const r=(0,a.bytesToNumberBE)(n.subarray(32,64));if(!v(r))return!1;const s=T(S(e),E(t),i),u=x(t,r,k(-s));return!(!u||!u.hasEvenY()||u.toAffine().x!==e)}catch(t){return!1}}e.schnorr={getPublicKey:P,sign:C,verify:R,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:B,pointToBytes:E,numberToBytesBE:a.numberToBytesBE,bytesToNumberBE:a.bytesToNumberBE,taggedHash:M,mod:o.mod}};const O=(0,u.isogenyMap)(g,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map((t=>t.map((t=>BigInt(t)))))),L=(0,s.mapToCurveSimpleSWU)(g,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:g.create(BigInt("-11"))}),N=(0,u.createHasher)(e.secp256k1.ProjectivePoint,(t=>{const{x:e,y:r}=L(g.create(t[0]));return O(e,r)}),{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:g.ORDER,m:1,k:128,expand:"xmd",hash:n.sha256});e.hashToCurve=N.hashToCurve,e.encodeToCurve=N.encodeToCurve},1839:(t,e)=>{"use strict";function r(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function n(t){if("boolean"!=typeof t)throw new Error(`Expected boolean, not ${t}`)}function i(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function o(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(t.outputLen),r(t.blockLen)}function s(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function a(t,e){i(t);const r=e.outputLen;if(t.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(e,"__esModule",{value:!0}),e.output=e.exists=e.hash=e.bytes=e.bool=e.number=void 0,e.number=r,e.bool=n,e.bytes=i,e.hash=o,e.exists=s,e.output=a;const u={number:r,bool:n,bytes:i,hash:o,exists:s,output:a};e.default=u},6214:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SHA2=void 0;const n=r(1839),i=r(300);class o extends i.Hash{constructor(t,e,r,n){super(),this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,i.createView)(this.buffer)}update(t){n.default.exists(this);const{view:e,buffer:r,blockLen:o}=this,s=(t=(0,i.toBytes)(t)).length;for(let n=0;n<s;){const a=Math.min(o-this.pos,s-n);if(a!==o)r.set(t.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===o&&(this.process(e,0),this.pos=0);else{const e=(0,i.createView)(t);for(;o<=s-n;n+=o)this.process(e,n)}}return this.length+=t.length,this.roundClean(),this}digestInto(t){n.default.exists(this),n.default.output(t,this),this.finished=!0;const{buffer:e,view:r,blockLen:o,isLE:s}=this;let{pos:a}=this;e[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(r,0),a=0);for(let t=a;t<o;t++)e[t]=0;!function(t,e,r,n){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),u=n?4:0,h=n?0:4;t.setUint32(e+u,s,n),t.setUint32(e+h,a,n)}(r,o-8,BigInt(8*this.length),s),this.process(r,0);const u=(0,i.createView)(t),h=this.outputLen;if(h%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=h/4,f=this.get();if(c>f.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<c;t++)u.setUint32(4*t,f[t],s)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return t.length=n,t.pos=s,t.finished=i,t.destroyed=o,n%e&&t.buffer.set(r),t}}e.SHA2=o},2426:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.add=e.toBig=e.split=e.fromBig=void 0;const r=BigInt(2**32-1),n=BigInt(32);function i(t,e=!1){return e?{h:Number(t&r),l:Number(t>>n&r)}:{h:0|Number(t>>n&r),l:0|Number(t&r)}}function o(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let o=0;o<t.length;o++){const{h:s,l:a}=i(t[o],e);[r[o],n[o]]=[s,a]}return[r,n]}e.fromBig=i,e.split=o;e.toBig=(t,e)=>BigInt(t>>>0)<<n|BigInt(e>>>0);function s(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:0|i}}e.add=s;const a={fromBig:i,split:o,toBig:e.toBig,shrSH:(t,e,r)=>t>>>r,shrSL:(t,e,r)=>t<<32-r|e>>>r,rotrSH:(t,e,r)=>t>>>r|e<<32-r,rotrSL:(t,e,r)=>t<<32-r|e>>>r,rotrBH:(t,e,r)=>t<<64-r|e>>>r-32,rotrBL:(t,e,r)=>t>>>r-32|e<<64-r,rotr32H:(t,e)=>e,rotr32L:(t,e)=>t,rotlSH:(t,e,r)=>t<<r|e>>>32-r,rotlSL:(t,e,r)=>e<<r|t>>>32-r,rotlBH:(t,e,r)=>e<<r-32|t>>>64-r,rotlBL:(t,e,r)=>t<<r-32|e>>>64-r,add:s,add3L:(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),add3H:(t,e,r,n)=>e+r+n+(t/2**32|0)|0,add4L:(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),add4H:(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,add5H:(t,e,r,n,i,o)=>e+r+n+i+o+(t/2**32|0)|0,add5L:(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0)};e.default=a},4937:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.crypto=void 0,e.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},520:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=e.HMAC=void 0;const n=r(1839),i=r(300);class o extends i.Hash{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,n.default.hash(t);const r=(0,i.toBytes)(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,s=new Uint8Array(o);s.set(r.length>o?t.create().update(r).digest():r);for(let t=0;t<s.length;t++)s[t]^=54;this.iHash.update(s),this.oHash=t.create();for(let t=0;t<s.length;t++)s[t]^=106;this.oHash.update(s),s.fill(0)}update(t){return n.default.exists(this),this.iHash.update(t),this}digestInto(t){n.default.exists(this),n.default.bytes(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:s}=this;return t.finished=n,t.destroyed=i,t.blockLen=o,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=o;e.hmac=(t,e,r)=>new o(t,e).update(r).digest(),e.hmac.create=(t,e)=>new o(t,e)},3426:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sha224=e.sha256=void 0;const n=r(6214),i=r(300),o=(t,e,r)=>t&e^t&r^e&r,s=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=new Uint32Array(64);class h extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){const{A:t,B:e,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[t,e,r,n,i,o,s,a]}set(t,e,r,n,i,o,s,a){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(t,e){for(let r=0;r<16;r++,e+=4)u[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=u[t-15],r=u[t-2],n=(0,i.rotr)(e,7)^(0,i.rotr)(e,18)^e>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;u[t]=o+u[t-7]+n+u[t-16]|0}let{A:r,B:n,C:a,D:h,E:c,F:f,G:l,H:d}=this;for(let t=0;t<64;t++){const e=d+((0,i.rotr)(c,6)^(0,i.rotr)(c,11)^(0,i.rotr)(c,25))+((p=c)&f^~p&l)+s[t]+u[t]|0,m=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+o(r,n,a)|0;d=l,l=f,f=c,c=h+e|0,h=a,a=n,n=r,r=e+m|0}var p;r=r+this.A|0,n=n+this.B|0,a=a+this.C|0,h=h+this.D|0,c=c+this.E|0,f=f+this.F|0,l=l+this.G|0,d=d+this.H|0,this.set(r,n,a,h,c,f,l,d)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class c extends h{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}e.sha256=(0,i.wrapConstructor)((()=>new h)),e.sha224=(0,i.wrapConstructor)((()=>new c))},3488:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.shake256=e.shake128=e.keccak_512=e.keccak_384=e.keccak_256=e.keccak_224=e.sha3_512=e.sha3_384=e.sha3_256=e.sha3_224=e.Keccak=e.keccakP=void 0;const n=r(1839),i=r(2426),o=r(300),[s,a,u]=[[],[],[]],h=BigInt(0),c=BigInt(1),f=BigInt(2),l=BigInt(7),d=BigInt(256),p=BigInt(113);for(let t=0,e=c,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],s.push(2*(5*n+r)),a.push((t+1)*(t+2)/2%64);let i=h;for(let t=0;t<7;t++)e=(e<<c^(e>>l)*p)%d,e&f&&(i^=c<<(c<<BigInt(t))-c);u.push(i)}const[m,g]=i.default.split(u,!0),b=(t,e,r)=>r>32?i.default.rotlBH(t,e,r):i.default.rotlSH(t,e,r),y=(t,e,r)=>r>32?i.default.rotlBL(t,e,r):i.default.rotlSL(t,e,r);function v(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let e=0;e<10;e++)r[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){const n=(e+8)%10,i=(e+2)%10,o=r[i],s=r[i+1],a=b(o,s,1)^r[n],u=y(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)t[e+r]^=a,t[e+r+1]^=u}let e=t[2],i=t[3];for(let r=0;r<24;r++){const n=a[r],o=b(e,i,n),u=y(e,i,n),h=s[r];e=t[h],i=t[h+1],t[h]=o,t[h+1]=u}for(let e=0;e<50;e+=10){for(let n=0;n<10;n++)r[n]=t[e+n];for(let n=0;n<10;n++)t[e+n]^=~r[(n+2)%10]&r[(n+4)%10]}t[0]^=m[n],t[1]^=g[n]}r.fill(0)}e.keccakP=v;class w extends o.Hash{constructor(t,e,r,i=!1,s=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=r,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,n.default.number(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,o.u32)(this.state)}keccak(){v(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){n.default.exists(this);const{blockLen:e,state:r}=this,i=(t=(0,o.toBytes)(t)).length;for(let n=0;n<i;){const o=Math.min(e-this.pos,i-n);for(let e=0;e<o;e++)r[this.pos++]^=t[n++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:e,pos:r,blockLen:n}=this;t[r]^=e,0!=(128&e)&&r===n-1&&this.keccak(),t[n-1]^=128,this.keccak()}writeInto(t){n.default.exists(this,!1),n.default.bytes(t),this.finish();const e=this.state,{blockLen:r}=this;for(let n=0,i=t.length;n<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-n);t.set(e.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return n.default.number(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(n.default.output(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:e,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return t||(t=new w(e,r,n,o,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=n,t.enableXOF=o,t.destroyed=this.destroyed,t}}e.Keccak=w;const M=(t,e,r)=>(0,o.wrapConstructor)((()=>new w(e,t,r)));e.sha3_224=M(6,144,28),e.sha3_256=M(6,136,32),e.sha3_384=M(6,104,48),e.sha3_512=M(6,72,64),e.keccak_224=M(1,144,28),e.keccak_256=M(1,136,32),e.keccak_384=M(1,104,48),e.keccak_512=M(1,72,64);const E=(t,e,r)=>(0,o.wrapXOFConstructorWithOpts)(((n={})=>new w(e,t,void 0===n.dkLen?r:n.dkLen,!0)));e.shake128=E(31,168,16),e.shake256=E(31,136,32)},300:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.randomBytes=e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.checkOpts=e.Hash=e.concatBytes=e.toBytes=e.utf8ToBytes=e.asyncLoop=e.nextTick=e.hexToBytes=e.bytesToHex=e.isLE=e.rotr=e.createView=e.u32=e.u8=void 0;const n=r(4937),i=t=>t instanceof Uint8Array;e.u8=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength);e.u32=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4));e.createView=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.rotr=(t,e)=>t<<32-e|t>>>e,e.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!e.isLE)throw new Error("Non little-endian hardware is not supported");const o=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));e.bytesToHex=function(t){if(!i(t))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=o[t[r]];return e},e.hexToBytes=function(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(e/2);for(let e=0;e<r.length;e++){const n=2*e,i=t.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");r[e]=o}return r};function s(t){if("string"!=typeof t)throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array((new TextEncoder).encode(t))}function a(t){if("string"==typeof t&&(t=s(t)),!i(t))throw new Error("expected Uint8Array, got "+typeof t);return t}e.nextTick=async()=>{},e.asyncLoop=async function(t,r,n){let i=Date.now();for(let o=0;o<t;o++){n(o);const t=Date.now()-i;t>=0&&t<r||(await(0,e.nextTick)(),i+=t)}},e.utf8ToBytes=s,e.toBytes=a,e.concatBytes=function(...t){const e=new Uint8Array(t.reduce(((t,e)=>t+e.length),0));let r=0;return t.forEach((t=>{if(!i(t))throw new Error("Uint8Array expected");e.set(t,r),r+=t.length})),e};e.Hash=class{clone(){return this._cloneInto()}};e.checkOpts=function(t,e){if(void 0!==e&&("object"!=typeof e||(r=e,"[object Object]"!==Object.prototype.toString.call(r)||r.constructor!==Object)))throw new Error("Options should be object or undefined");var r;return Object.assign(t,e)},e.wrapConstructor=function(t){const e=e=>t().update(a(e)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e},e.wrapConstructorWithOpts=function(t){const e=(e,r)=>t(r).update(a(e)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e},e.wrapXOFConstructorWithOpts=function(t){const e=(e,r)=>t(r).update(a(e)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e},e.randomBytes=function(t=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}},101:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.secp256k1=void 0;var n=r(2934);Object.defineProperty(e,"secp256k1",{enumerable:!0,get:function(){return n.secp256k1}})},144:function(t,e,r){"use strict";t=r.nmd(t);var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.crypto=e.wrapHash=e.equalsBytes=e.hexToBytes=e.bytesToUtf8=e.utf8ToBytes=e.createView=e.concatBytes=e.toHex=e.bytesToHex=e.assertBytes=e.assertBool=void 0;const i=n(r(1839)),o=r(300),s=i.default.bool;e.assertBool=s;const a=i.default.bytes;e.assertBytes=a;var u=r(300);Object.defineProperty(e,"bytesToHex",{enumerable:!0,get:function(){return u.bytesToHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return u.bytesToHex}}),Object.defineProperty(e,"concatBytes",{enumerable:!0,get:function(){return u.concatBytes}}),Object.defineProperty(e,"createView",{enumerable:!0,get:function(){return u.createView}}),Object.defineProperty(e,"utf8ToBytes",{enumerable:!0,get:function(){return u.utf8ToBytes}}),e.bytesToUtf8=function(t){if(!(t instanceof Uint8Array))throw new TypeError("bytesToUtf8 expected Uint8Array, got "+typeof t);return(new TextDecoder).decode(t)},e.hexToBytes=function(t){const e=t.startsWith("0x")?t.substring(2):t;return(0,o.hexToBytes)(e)},e.equalsBytes=function(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0},e.wrapHash=function(t){return e=>(i.default.bytes(e),t(e))},e.crypto=(()=>{const e="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,r="function"==typeof t.require&&t.require.bind(t);return{node:r&&!e?r("crypto"):void 0,web:e}})()},2699:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}m(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&m(t,"error",e,r)}(t,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function h(t,e,r,n){var i,o,s,h;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(t))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=s.length,h=c,console&&console.warn&&console.warn(h)}return t}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function l(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):p(i,i.length)}function d(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function m(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function i(o){n.once&&t.removeEventListener(e,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");s=t}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||i(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i="error"===t,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)n(u,this,e);else{var h=u.length,c=p(u,h);for(r=0;r<h;++r)n(c[r],this,e)}return!0},o.prototype.addListener=function(t,e){return h(this,t,e,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(t,e){return h(this,t,e,!0)},o.prototype.once=function(t,e){return a(e),this.on(t,f(this,t,e)),this},o.prototype.prependOnceListener=function(t,e){return a(e),this.prependListener(t,f(this,t,e)),this},o.prototype.removeListener=function(t,e){var r,n,i,o,s;if(a(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return l(this,t,!0)},o.prototype.rawListeners=function(t){return l(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},9341:(t,e,r)=>{var n=r(7834).Buffer,i=r(7993);t.exports=function(t,e,r,o){if(n.isBuffer(t)||(t=n.from(t,"binary")),e&&(n.isBuffer(e)||(e=n.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=r/8,a=n.alloc(s),u=n.alloc(o||0),h=n.alloc(0);s>0||o>0;){var c=new i;c.update(h),c.update(t),e&&c.update(e),h=c.digest();var f=0;if(s>0){var l=a.length-s;f=Math.min(s,h.length),h.copy(a,l,0,f),s-=f}if(f<h.length&&o>0){var d=u.length-o,p=Math.min(o,h.length-f);h.copy(u,d,f,f+p),o-=p}}return h.fill(0),{key:a,iv:u}}},3243:(t,e,r)=>{"use strict";var n=r(9680),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=r),"[object Array]"===i.call(t)?function(t,e,r){for(var n=0,i=t.length;n<i;n++)o.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,s):"string"==typeof t?function(t,e,r){for(var n=0,i=t.length;n<i;n++)null==r?e(t.charAt(n),n,t):e.call(r,t.charAt(n),n,t)}(t,e,s):function(t,e,r){for(var n in t)o.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,s)}},7795:t=>{"use strict";var e=Array.prototype.slice,r=Object.prototype.toString;t.exports=function(t){var n=this;if("function"!=typeof n||"[object Function]"!==r.call(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var i,o=e.call(arguments,1),s=Math.max(0,n.length-o.length),a=[],u=0;u<s;u++)a.push("$"+u);if(i=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof i){var r=n.apply(this,o.concat(e.call(arguments)));return Object(r)===r?r:this}return n.apply(t,o.concat(e.call(arguments)))})),n.prototype){var h=function(){};h.prototype=n.prototype,i.prototype=new h,h.prototype=null}return i}},4090:(t,e,r)=>{"use strict";var n=r(7795);t.exports=Function.prototype.bind||n},7286:(t,e,r)=>{"use strict";var n,i=SyntaxError,o=Function,s=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var h=function(){throw new s},c=u?function(){try{return h}catch(t){try{return u(arguments,"callee").get}catch(t){return h}}}():h,f=r(2636)(),l=r(8486)(),d=Object.getPrototypeOf||(l?function(t){return t.__proto__}:null),p={},m="undefined"!=typeof Uint8Array&&d?d(Uint8Array):n,g={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":f&&d?d([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f&&d?d(d([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&f&&d?d((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&f&&d?d((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f&&d?d(""[Symbol.iterator]()):n,"%Symbol%":f?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":c,"%TypedArray%":m,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(d)try{null.error}catch(t){var b=d(d(t));g["%Error.prototype%"]=b}var y=function t(e){var r;if("%AsyncFunction%"===e)r=a("async function () {}");else if("%GeneratorFunction%"===e)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=a("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&d&&(r=d(i.prototype))}return g[e]=r,r},v={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},w=r(4090),M=r(3198),E=w.call(Function.call,Array.prototype.concat),S=w.call(Function.apply,Array.prototype.splice),_=w.call(Function.call,String.prototype.replace),k=w.call(Function.call,String.prototype.slice),A=w.call(Function.call,RegExp.prototype.exec),x=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,I=/\\(\\)?/g,B=function(t,e){var r,n=t;if(M(v,n)&&(n="%"+(r=v[n])[0]+"%"),M(g,n)){var o=g[n];if(o===p&&(o=y(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===A(/^%?[^%]*%?$/,t))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=k(t,0,1),r=k(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return _(t,x,(function(t,e,r,i){n[n.length]=r?_(i,I,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=B("%"+n+"%",e),a=o.name,h=o.value,c=!1,f=o.alias;f&&(n=f[0],S(r,E([0,1],f)));for(var l=1,d=!0;l<r.length;l+=1){var p=r[l],m=k(p,0,1),b=k(p,-1);if(('"'===m||"'"===m||"`"===m||'"'===b||"'"===b||"`"===b)&&m!==b)throw new i("property names with quotes must have matching quotes");if("constructor"!==p&&d||(c=!0),M(g,a="%"+(n+="."+p)+"%"))h=g[a];else if(null!=h){if(!(p in h)){if(!e)throw new s("base intrinsic for "+t+" exists, but the property is not available.");return}if(u&&l+1>=r.length){var y=u(h,p);h=(d=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:h[p]}else d=M(h,p),h=h[p];d&&!c&&(g[a]=h)}}return h}},326:(t,e,r)=>{"use strict";var n=r(7286)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},8486:t=>{"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},2636:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(6679);t.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&i())))}},6679:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},7226:(t,e,r)=>{"use strict";var n=r(6679);t.exports=function(){return n()&&!!Symbol.toStringTag}},3198:(t,e,r)=>{"use strict";var n=r(4090);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},4485:(t,e,r)=>{"use strict";var n=r(7834).Buffer,i=r(7525).Transform;function o(t){i.call(this),this._block=n.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(1285)(o,i),o.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(t)||(t=n.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=t[i++];this._update(),this._blockOffset=0}for(;i<t.length;)r[this._blockOffset++]=t[i++];for(var s=0,a=8*t.length;a>0;++s)this._length[s]+=a,(a=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*a);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},3506:(t,e,r)=>{var n=e;n.utils=r(212),n.common=r(4495),n.sha=r(5530),n.ripemd=r(1396),n.hmac=r(5047),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},4495:(t,e,r)=>{"use strict";var n=r(212),i=r(9561);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},5047:(t,e,r)=>{"use strict";var n=r(212),i=r(9561);function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}t.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},1396:(t,e,r)=>{"use strict";var n=r(212),i=r(4495),o=n.rotl32,s=n.sum32,a=n.sum32_3,u=n.sum32_4,h=i.BlockHash;function c(){if(!(this instanceof c))return new c;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function l(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function d(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(c,h),e.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],h=this.h[3],c=this.h[4],y=r,v=n,w=i,M=h,E=c,S=0;S<80;S++){var _=s(o(u(r,f(S,n,i,h),t[p[S]+e],l(S)),g[S]),c);r=c,c=h,h=o(i,10),i=n,n=_,_=s(o(u(y,f(79-S,v,w,M),t[m[S]+e],d(S)),b[S]),E),y=E,E=M,M=o(w,10),w=v,v=_}_=a(this.h[1],i,M),this.h[1]=a(this.h[2],h,E),this.h[2]=a(this.h[3],c,y),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],n,w),this.h[0]=_},c.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],m=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],b=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},5530:(t,e,r)=>{"use strict";e.sha1=r(5079),e.sha224=r(3823),e.sha256=r(8032),e.sha384=r(5328),e.sha512=r(168)},5079:(t,e,r)=>{"use strict";var n=r(212),i=r(4495),o=r(713),s=n.rotl32,a=n.sum32,u=n.sum32_5,h=o.ft_1,c=i.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(l,c),t.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],c=this.h[2],l=this.h[3],d=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),m=u(s(i,5),h(p,o,c,l),d,r[n],f[p]);d=l,l=c,c=s(o,30),o=i,i=m}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],c),this.h[3]=a(this.h[3],l),this.h[4]=a(this.h[4],d)},l.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},3823:(t,e,r)=>{"use strict";var n=r(212),i=r(8032);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},8032:(t,e,r)=>{"use strict";var n=r(212),i=r(4495),o=r(713),s=r(9561),a=n.sum32,u=n.sum32_4,h=n.sum32_5,c=o.ch32,f=o.maj32,l=o.s0_256,d=o.s1_256,p=o.g0_256,m=o.g1_256,g=i.BlockHash,b=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=b,this.W=new Array(64)}n.inherits(y,g),t.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=u(m(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],g=this.h[2],b=this.h[3],y=this.h[4],v=this.h[5],w=this.h[6],M=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var E=h(M,d(y),c(y,v,w),this.k[n],r[n]),S=a(l(i),f(i,o,g));M=w,w=v,v=y,y=a(b,E),b=g,g=o,o=i,i=a(E,S)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],g),this.h[3]=a(this.h[3],b),this.h[4]=a(this.h[4],y),this.h[5]=a(this.h[5],v),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],M)},y.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},5328:(t,e,r)=>{"use strict";var n=r(212),i=r(168);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},168:(t,e,r)=>{"use strict";var n=r(212),i=r(4495),o=r(9561),s=n.rotr64_hi,a=n.rotr64_lo,u=n.shr64_hi,h=n.shr64_lo,c=n.sum64,f=n.sum64_hi,l=n.sum64_lo,d=n.sum64_4_hi,p=n.sum64_4_lo,m=n.sum64_5_hi,g=n.sum64_5_lo,b=i.BlockHash,y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;b.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}function w(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function M(t,e,r,n,i,o){var s=e&n^~e&o;return s<0&&(s+=4294967296),s}function E(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function S(t,e,r,n,i,o){var s=e&n^e&o^n&o;return s<0&&(s+=4294967296),s}function _(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function k(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function A(t,e){var r=s(t,e,14)^s(t,e,18)^s(e,t,9);return r<0&&(r+=4294967296),r}function x(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function I(t,e){var r=s(t,e,1)^s(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function B(t,e){var r=a(t,e,1)^a(t,e,8)^h(t,e,7);return r<0&&(r+=4294967296),r}function T(t,e){var r=s(t,e,19)^s(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}function P(t,e){var r=a(t,e,19)^a(e,t,29)^h(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(v,b),t.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=T(r[n-4],r[n-3]),o=P(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],u=I(r[n-30],r[n-29]),h=B(r[n-30],r[n-29]),c=r[n-32],f=r[n-31];r[n]=d(i,o,s,a,u,h,c,f),r[n+1]=p(i,o,s,a,u,h,c,f)}},v.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],h=this.h[5],d=this.h[6],p=this.h[7],b=this.h[8],y=this.h[9],v=this.h[10],I=this.h[11],B=this.h[12],T=this.h[13],P=this.h[14],C=this.h[15];o(this.k.length===r.length);for(var R=0;R<r.length;R+=2){var O=P,L=C,N=A(b,y),j=x(b,y),H=w(b,y,v,I,B),D=M(b,y,v,I,B,T),U=this.k[R],F=this.k[R+1],$=r[R],q=r[R+1],z=m(O,L,N,j,H,D,U,F,$,q),G=g(O,L,N,j,H,D,U,F,$,q);O=_(n,i),L=k(n,i),N=E(n,i,s,a,u),j=S(n,i,s,a,u,h);var V=f(O,L,N,j),J=l(O,L,N,j);P=B,C=T,B=v,T=I,v=b,I=y,b=f(d,p,z,G),y=l(p,p,z,G),d=u,p=h,u=s,h=a,s=n,a=i,n=f(z,G,V,J),i=l(z,G,V,J)}c(this.h,0,n,i),c(this.h,2,s,a),c(this.h,4,u,h),c(this.h,6,d,p),c(this.h,8,b,y),c(this.h,10,v,I),c(this.h,12,B,T),c(this.h,14,P,C)},v.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},713:(t,e,r)=>{"use strict";var n=r(212).rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}e.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?s(e,r,n):2===t?o(e,r,n):void 0},e.ch32=i,e.maj32=o,e.p32=s,e.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},e.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},e.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},212:(t,e,r)=>{"use strict";var n=r(9561),i=r(1285);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function u(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var s=t.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):o(t,i)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<t.length;i++)r[i]=0|t[i];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e},e.htonl=s,e.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=s(i)),r+=u(i.toString(16))}return r},e.zero2=a,e.zero8=u,e.join32=function(t,e,r,i){var o=r-e;n(o%4==0);for(var s=new Array(o/4),a=0,u=e;a<s.length;a++,u+=4){var h;h="big"===i?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[a]=h>>>0}return s},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,s=(o<n?1:0)+r+i;t[e]=s>>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,s,a){var u=0,h=e;return u+=(h=h+n>>>0)<e?1:0,u+=(h=h+o>>>0)<o?1:0,t+r+i+s+(u+=(h=h+a>>>0)<a?1:0)>>>0},e.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,s,a,u,h){var c=0,f=e;return c+=(f=f+n>>>0)<e?1:0,c+=(f=f+o>>>0)<o?1:0,c+=(f=f+a>>>0)<a?1:0,t+r+i+s+u+(c+=(f=f+h>>>0)<h?1:0)>>>0},e.sum64_5_lo=function(t,e,r,n,i,o,s,a,u,h){return e+n+o+a+h>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},8873:(t,e,r)=>{"use strict";var n=r(3506),i=r(3022),o=r(9561);function s(t){if(!(this instanceof s))return new s(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}t.exports=s,s.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=i.toArray(t,e),r=i.toArray(r,n),o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},s.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,t);return this._update(r),this._reseed++,i.encode(s,e)}},2333:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,h=u>>1,c=-7,f=r?i-1:0,l=r?-1:1,d=t[e+f];for(f+=l,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+t[e+f],f+=l,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+t[e+f],f+=l,c-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=h}return(d?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,h=8*o-i-1,c=(1<<h)-1,f=c>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?l/u:l*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=c?(a=0,s=c):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,h+=i;h>0;t[r+d]=255&s,d+=p,s/=256,h-=8);t[r+d-p]|=128*m}},1285:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},2635:(t,e,r)=>{"use strict";var n=r(7226)(),i=r(2680)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},s=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,t.exports=a?o:s},9680:t=>{"use strict";var e,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,e)}catch(t){t!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(t){try{var e=n.call(t);return o.test(e)}catch(t){return!1}},a=function(t){try{return!s(t)&&(n.call(t),!0)}catch(t){return!1}},u=Object.prototype.toString,h="function"==typeof Symbol&&!!Symbol.toStringTag,c=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var l=document.all;u.call(l)===u.call(document.all)&&(f=function(t){if((c||!t)&&(void 0===t||"object"==typeof t))try{var e=u.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=i?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!s(t)&&a(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(h)return a(t);if(s(t))return!1;var e=u.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&a(t)}},3138:(t,e,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(7226)(),u=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(s.test(o.call(t)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(t);if(!u)return!1;if(void 0===n){var e=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&u(e)}return u(t)===n}},198:(t,e,r)=>{"use strict";var n=r(2094);t.exports=function(t){return!!n(t)}},7993:(t,e,r)=>{"use strict";var n=r(1285),i=r(4485),o=r(7834).Buffer,s=new Array(16);function a(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function u(t,e){return t<<e|t>>>32-e}function h(t,e,r,n,i,o,s){return u(t+(e&r|~e&n)+i+o|0,s)+e|0}function c(t,e,r,n,i,o,s){return u(t+(e&n|r&~n)+i+o|0,s)+e|0}function f(t,e,r,n,i,o,s){return u(t+(e^r^n)+i+o|0,s)+e|0}function l(t,e,r,n,i,o,s){return u(t+(r^(e|~n))+i+o|0,s)+e|0}n(a,i),a.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d;r=h(r,n,i,o,t[0],3614090360,7),o=h(o,r,n,i,t[1],3905402710,12),i=h(i,o,r,n,t[2],606105819,17),n=h(n,i,o,r,t[3],3250441966,22),r=h(r,n,i,o,t[4],4118548399,7),o=h(o,r,n,i,t[5],1200080426,12),i=h(i,o,r,n,t[6],2821735955,17),n=h(n,i,o,r,t[7],4249261313,22),r=h(r,n,i,o,t[8],1770035416,7),o=h(o,r,n,i,t[9],2336552879,12),i=h(i,o,r,n,t[10],4294925233,17),n=h(n,i,o,r,t[11],2304563134,22),r=h(r,n,i,o,t[12],1804603682,7),o=h(o,r,n,i,t[13],4254626195,12),i=h(i,o,r,n,t[14],2792965006,17),r=c(r,n=h(n,i,o,r,t[15],1236535329,22),i,o,t[1],4129170786,5),o=c(o,r,n,i,t[6],3225465664,9),i=c(i,o,r,n,t[11],643717713,14),n=c(n,i,o,r,t[0],3921069994,20),r=c(r,n,i,o,t[5],3593408605,5),o=c(o,r,n,i,t[10],38016083,9),i=c(i,o,r,n,t[15],3634488961,14),n=c(n,i,o,r,t[4],3889429448,20),r=c(r,n,i,o,t[9],568446438,5),o=c(o,r,n,i,t[14],3275163606,9),i=c(i,o,r,n,t[3],4107603335,14),n=c(n,i,o,r,t[8],1163531501,20),r=c(r,n,i,o,t[13],2850285829,5),o=c(o,r,n,i,t[2],4243563512,9),i=c(i,o,r,n,t[7],1735328473,14),r=f(r,n=c(n,i,o,r,t[12],2368359562,20),i,o,t[5],4294588738,4),o=f(o,r,n,i,t[8],2272392833,11),i=f(i,o,r,n,t[11],1839030562,16),n=f(n,i,o,r,t[14],4259657740,23),r=f(r,n,i,o,t[1],2763975236,4),o=f(o,r,n,i,t[4],1272893353,11),i=f(i,o,r,n,t[7],4139469664,16),n=f(n,i,o,r,t[10],3200236656,23),r=f(r,n,i,o,t[13],681279174,4),o=f(o,r,n,i,t[0],3936430074,11),i=f(i,o,r,n,t[3],3572445317,16),n=f(n,i,o,r,t[6],76029189,23),r=f(r,n,i,o,t[9],3654602809,4),o=f(o,r,n,i,t[12],3873151461,11),i=f(i,o,r,n,t[15],530742520,16),r=l(r,n=f(n,i,o,r,t[2],3299628645,23),i,o,t[0],4096336452,6),o=l(o,r,n,i,t[7],1126891415,10),i=l(i,o,r,n,t[14],2878612391,15),n=l(n,i,o,r,t[5],4237533241,21),r=l(r,n,i,o,t[12],1700485571,6),o=l(o,r,n,i,t[3],2399980690,10),i=l(i,o,r,n,t[10],4293915773,15),n=l(n,i,o,r,t[1],2240044497,21),r=l(r,n,i,o,t[8],1873313359,6),o=l(o,r,n,i,t[15],4264355552,10),i=l(i,o,r,n,t[6],2734768916,15),n=l(n,i,o,r,t[13],1309151649,21),r=l(r,n,i,o,t[4],4149444226,6),o=l(o,r,n,i,t[11],3174756917,10),i=l(i,o,r,n,t[2],718787259,15),n=l(n,i,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=a},2973:(t,e,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidStatusCodeError=e.InvalidCertError=void 0;const i=Object.freeze({redirect:!0,expectStatusCode:200,headers:{},full:!1,keepAlive:!0,cors:!1,referrer:!1,sslAllowSelfSigned:!1,_redirectCount:0});class o extends Error{constructor(t,e){super(t),this.fingerprint256=e}}e.InvalidCertError=o;class s extends Error{constructor(t){super(`Request Failed. Status Code: ${t}`),this.statusCode=t}}function a(t,e){if(!e||"text"===e||"json"===e)try{let r=new TextDecoder("utf8",{fatal:!0}).decode(t);if("text"===e)return r;try{return JSON.parse(r)}catch(t){if("json"===e)throw t;return r}}catch(t){if("text"===e||"json"===e)throw t}return t}e.InvalidStatusCodeError=s;let u={};function h(t,e){let c={...i,...e};const f=r(732),l=r(9640),d=r(4087),{promisify:p}=r(3335),{resolve:m}=r(883),g=!!/^https/.test(t);let b={method:c.method||"GET",headers:{"Accept-Encoding":"gzip, deflate, br"}};const y=t=>t.replace(/:| /g,"").toLowerCase();if(c.keepAlive){const t={keepAlive:!0,keepAliveMsecs:3e4,maxFreeSockets:1024,maxCachedSessions:1024},e=[g,g&&c.sslPinnedCertificates?.map((t=>y(t))).sort()].join();b.agent=u[e]||(u[e]=new(g?l:f).Agent(t))}"json"===c.type&&(b.headers["Content-Type"]="application/json"),c.data&&(c.method||(b.method="POST"),b.body="json"===c.type?JSON.stringify(c.data):c.data),b.headers={...b.headers,...c.headers},c.sslAllowSelfSigned&&(b.rejectUnauthorized=!1);return new Promise(((e,r)=>{const i=async e=>{if(e&&"DEPTH_ZERO_SELF_SIGNED_CERT"===e.code)try{await h(t,{...c,sslAllowSelfSigned:!0,sslPinnedCertificates:[]})}catch(t){t&&t.fingerprint256&&(e=new o(`Self-signed SSL certificate: ${t.fingerprint256}`,t.fingerprint256))}r(e)},u=(g?l:f).request(t,b,(o=>{o.on("error",i),(async()=>{try{e(await(async e=>{const r=e.statusCode;if(c.redirect&&300<=r&&r<400&&e.headers.location){if(10==c._redirectCount)throw new Error("Request failed. Too much redirects.");return c._redirectCount+=1,await h(m(t,e.headers.location),c)}if(c.expectStatusCode&&r!==c.expectStatusCode)throw e.resume(),new s(r);let i=[];for await(const t of e)i.push(t);let o=n.concat(i);const u=e.headers["content-encoding"];"br"===u&&(o=await p(d.brotliDecompress)(o)),"gzip"!==u&&"deflate"!==u||(o=await p(d.unzip)(o));const f=a(o,c.type);return c.full?{headers:e.headers,status:r,body:f}:f})(o))}catch(t){r(t)}})()}));u.on("error",i);const v=c.sslPinnedCertificates?.map((t=>y(t))),w=t=>{const e=y(t.getPeerCertificate()?.fingerprint256||"");if((e||!t.isSessionReused())&&!v.includes(e))return u.emit("error",new o(`Invalid SSL certificate: ${e} Expected: ${v}`,e)),u.abort()};c.sslPinnedCertificates&&u.on("socket",(t=>{const e=t.listeners("secureConnect").map((t=>(t.name||"").replace("bound ",""))).includes("mfetchSecureConnect");e||t.on("secureConnect",w.bind(null,t))})),c.keepAlive&&u.setNoDelay(!0),b.body&&u.write(b.body),u.end()}))}const c=new Set(["Accept","Accept-Language","Content-Language","Content-Type"].map((t=>t.toLowerCase()))),f=new Set(["Accept-Charset","Accept-Encoding","Access-Control-Request-Headers","Access-Control-Request-Method","Connection","Content-Length","Cookie","Cookie2","Date","DNT","Expect","Host","Keep-Alive","Origin","Referer","TE","Trailer","Transfer-Encoding","Upgrade","Via"].map((t=>t.toLowerCase())));async function l(t,e){let r={...i,...e};const n=new Headers;"json"===r.type&&n.set("Content-Type","application/json");let o=new URL(t);if(o.username){const t=btoa(`${o.username}:${o.password}`);n.set("Authorization",`Basic ${t}`),o.username="",o.password=""}t=""+o;for(let t in r.headers){const e=t.toLowerCase();(c.has(e)||r.cors&&!f.has(e))&&n.set(t,r.headers[t])}let u={headers:n,redirect:r.redirect?"follow":"manual"};r.referrer||(u.referrerPolicy="no-referrer"),r.cors&&(u.mode="cors"),r.data&&(r.method||(u.method="POST"),u.body="json"===r.type?JSON.stringify(r.data):r.data);const h=await fetch(t,u);if(r.expectStatusCode&&h.status!==r.expectStatusCode)throw new s(h.status);const l=a(new Uint8Array(await h.arrayBuffer()),r.type);return r.full?{headers:Object.fromEntries(h.headers.entries()),status:h.status,body:l}:l}const d=!!("object"==typeof process&&process.versions&&process.versions.node&&process.versions.v8);e.default=function(t,e){return(d?h:l)(t,e)}},6676:(t,e,r)=>{var n=r(1466),i=r(2745);function o(t){this.rand=t||new i.Rand}t.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(t)>=0);return i},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var i=t.bitLength(),o=n.mont(t),s=new n(1).toRed(o);e||(e=Math.max(1,i/48|0));for(var a=t.subn(1),u=0;!a.testn(u);u++);for(var h=t.shrn(u),c=a.toRed(o);e>0;e--){var f=this._randrange(new n(2),a);r&&r(f);var l=f.toRed(o).redPow(h);if(0!==l.cmp(s)&&0!==l.cmp(c)){for(var d=1;d<u;d++){if(0===(l=l.redSqr()).cmp(s))return!1;if(0===l.cmp(c))break}if(d===u)return!1}}return!0},o.prototype.getDivisor=function(t,e){var r=t.bitLength(),i=n.mont(t),o=new n(1).toRed(i);e||(e=Math.max(1,r/48|0));for(var s=t.subn(1),a=0;!s.testn(a);a++);for(var u=t.shrn(a),h=s.toRed(i);e>0;e--){var c=this._randrange(new n(2),s),f=t.gcd(c);if(0!==f.cmpn(1))return f;var l=c.toRed(i).redPow(u);if(0!==l.cmp(o)&&0!==l.cmp(h)){for(var d=1;d<a;d++){if(0===(l=l.redSqr()).cmp(o))return l.fromRed().subn(1).gcd(t);if(0===l.cmp(h))break}if(d===a)return(l=l.redSqr()).fromRed().subn(1).gcd(t)}}return!1}},1466:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(6024).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function h(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,c=r;c<a;c+=n)u=h(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var f=1;for(u=h(t,c,t.length,e),c=0;c<s;c++)f*=e;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","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"],f=[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],l=[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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var c=u>>>26,f=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[h]=0|f,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-i;a++)h[a]=0;for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[o-a-1]=s}return h},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,c=0|s[0],f=8191&c,l=c>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],b=8191&g,y=g>>>13,v=0|s[3],w=8191&v,M=v>>>13,E=0|s[4],S=8191&E,_=E>>>13,k=0|s[5],A=8191&k,x=k>>>13,I=0|s[6],B=8191&I,T=I>>>13,P=0|s[7],C=8191&P,R=P>>>13,O=0|s[8],L=8191&O,N=O>>>13,j=0|s[9],H=8191&j,D=j>>>13,U=0|a[0],F=8191&U,$=U>>>13,q=0|a[1],z=8191&q,G=q>>>13,V=0|a[2],J=8191&V,K=V>>>13,W=0|a[3],Z=8191&W,X=W>>>13,Y=0|a[4],Q=8191&Y,tt=Y>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],ft=8191&ct,lt=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(h+(n=Math.imul(f,F))|0)+((8191&(i=(i=Math.imul(f,$))+Math.imul(l,F)|0))<<13)|0;h=((o=Math.imul(l,$))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,$))+Math.imul(m,F)|0,o=Math.imul(m,$);var bt=(h+(n=n+Math.imul(f,z)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(l,z)|0))<<13)|0;h=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,F),i=(i=Math.imul(b,$))+Math.imul(y,F)|0,o=Math.imul(y,$),n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,z)|0,o=o+Math.imul(m,G)|0;var yt=(h+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(l,J)|0))<<13)|0;h=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,$))+Math.imul(M,F)|0,o=Math.imul(M,$),n=n+Math.imul(b,z)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,K)|0;var vt=(h+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(l,Z)|0))<<13)|0;h=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,$))+Math.imul(_,F)|0,o=Math.imul(_,$),n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,z)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,K)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var wt=(h+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(l,Q)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(A,F),i=(i=Math.imul(A,$))+Math.imul(x,F)|0,o=Math.imul(x,$),n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,K)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(h+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,F),i=(i=Math.imul(B,$))+Math.imul(T,F)|0,o=Math.imul(T,$),n=n+Math.imul(A,z)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(x,z)|0,o=o+Math.imul(x,G)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Et=(h+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,$))+Math.imul(R,F)|0,o=Math.imul(R,$),n=n+Math.imul(B,z)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,K)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(h+(n=n+Math.imul(f,ut)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,$))+Math.imul(N,F)|0,o=Math.imul(N,$),n=n+Math.imul(C,z)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,G)|0,n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,K)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,K)|0,n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,X)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var _t=(h+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(H,F),i=(i=Math.imul(H,$))+Math.imul(D,F)|0,o=Math.imul(D,$),n=n+Math.imul(L,z)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(N,z)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,K)|0,n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ft)|0,o=o+Math.imul(m,lt)|0;var kt=(h+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(H,z),i=(i=Math.imul(H,G))+Math.imul(D,z)|0,o=Math.imul(D,G),n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(y,ft)|0,o=o+Math.imul(y,lt)|0;var At=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(H,J),i=(i=Math.imul(H,K))+Math.imul(D,J)|0,o=Math.imul(D,K),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,X)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(M,ft)|0,o=o+Math.imul(M,lt)|0;var xt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(H,Z),i=(i=Math.imul(H,X))+Math.imul(D,Z)|0,o=Math.imul(D,X),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(S,ft)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,lt)|0;var It=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(H,Q),i=(i=Math.imul(H,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(A,ft)|0,i=(i=i+Math.imul(A,lt)|0)+Math.imul(x,ft)|0,o=o+Math.imul(x,lt)|0;var Bt=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(H,rt),i=(i=Math.imul(H,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ht)|0,n=n+Math.imul(B,ft)|0,i=(i=i+Math.imul(B,lt)|0)+Math.imul(T,ft)|0,o=o+Math.imul(T,lt)|0;var Tt=(h+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(H,ot),i=(i=Math.imul(H,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(L,ut)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(C,ft)|0,i=(i=i+Math.imul(C,lt)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,lt)|0;var Pt=(h+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(H,ut),i=(i=Math.imul(H,ht))+Math.imul(D,ut)|0,o=Math.imul(D,ht),n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,lt)|0)+Math.imul(N,ft)|0,o=o+Math.imul(N,lt)|0;var Ct=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(H,ft),i=(i=Math.imul(H,lt))+Math.imul(D,ft)|0,o=Math.imul(D,lt);var Rt=(h+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Ot=(h+(n=Math.imul(H,pt))|0)+((8191&(i=(i=Math.imul(H,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=bt,u[2]=yt,u[3]=vt,u[4]=wt,u[5]=Mt,u[6]=Et,u[7]=St,u[8]=_t,u[9]=kt,u[10]=At,u[11]=xt,u[12]=It,u[13]=Bt,u[14]=Tt,u[15]=Pt,u[16]=Ct,u[17]=Rt,u[18]=Ot,0!==h&&(u[19]=h,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var c=o-h,f=(0|t.words[c])*(0|e.words[h]),l=67108863&f;a=67108863&(l=l+a|0),i+=(s=(s=s+(f/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},g.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var f=u,l=h,d=0;d<s;d++){var p=r[c+d],m=n[c+d],g=r[c+d+s],b=n[c+d+s],y=f*g-l*b;b=f*b+l*g,g=y,r[c+d]=p+g,n[c+d]=m+b,r[c+d+s]=p-g,n[c+d+s]=m-b,d!==a&&(y=u*f-h*l,l=u*l+h*f,f=y)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),c=new Array(n),f=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,c,f,n,i);for(var d=0;d<n;d++){var p=a[d]*c[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),m(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var c=0;for(h=this.length-1;h>=0&&(0!==c||h>=i);h--){var f=0|this.words[h];this.words[h]=c<<26-o|f>>>o,c=f&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var l=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,f);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=l)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,l=1;0==(r.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function _(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(v,y),v.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,y),i(M,y),i(E,y),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return b[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var b=this.pow(f,new o(1).iushln(p-g-1));l=l.redMul(b),f=b.redSqr(),d=d.redMul(f),p=g}return l},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],c=u-1;c>=0;c--){var f=h>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new _(t)},i(_,S),_.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},_.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},_.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},_.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},_.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},9561:t=>{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},3022:(t,e)=>{"use strict";var r=e;function n(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",r=0;r<t.length;r++)e+=n(t[r].toString(16));return e}r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e){(t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t);for(n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}},9500:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=n&&i&&"function"==typeof i.get?i.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,h=a&&u&&"function"==typeof u.get?u.get:null,c=a&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,l="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,m=Object.prototype.toString,g=Function.prototype.toString,b=String.prototype.match,y=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,M=String.prototype.toLowerCase,E=RegExp.prototype.test,S=Array.prototype.concat,_=Array.prototype.join,k=Array.prototype.slice,A=Math.floor,x="function"==typeof BigInt?BigInt.prototype.valueOf:null,I=Object.getOwnPropertySymbols,B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"==typeof Symbol&&"object"==typeof Symbol.iterator,P="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===T||"symbol")?Symbol.toStringTag:null,C=Object.prototype.propertyIsEnumerable,R=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function O(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||E.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-A(-t):A(t);if(n!==t){var i=String(n),o=y.call(e,i.length+1);return v.call(i,r,"$&_")+"."+v.call(v.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var L=r(3260),N=L.custom,j=$(N)?N:null;function H(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function D(t){return v.call(String(t),/"/g,""")}function U(t){return!("[object Array]"!==G(t)||P&&"object"==typeof t&&P in t)}function F(t){return!("[object RegExp]"!==G(t)||P&&"object"==typeof t&&P in t)}function $(t){if(T)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!B)return!1;try{return B.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,n,i){var a=r||{};if(z(a,"quoteStyle")&&"single"!==a.quoteStyle&&"double"!==a.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(z(a,"maxStringLength")&&("number"==typeof a.maxStringLength?a.maxStringLength<0&&a.maxStringLength!==1/0:null!==a.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!z(a,"customInspect")||a.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(z(a,"indent")&&null!==a.indent&&"\t"!==a.indent&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(z(a,"numericSeparator")&&"boolean"!=typeof a.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var m=a.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return J(e,a);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var w=String(e);return m?O(e,w):w}if("bigint"==typeof e){var E=String(e)+"n";return m?O(e,E):E}var A=void 0===a.depth?5:a.depth;if(void 0===n&&(n=0),n>=A&&A>0&&"object"==typeof e)return U(e)?"[Array]":"[Object]";var I=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=_.call(Array(t.indent+1)," ")}return{base:r,prev:_.call(Array(e+1),r)}}(a,n);if(void 0===i)i=[];else if(V(i,e)>=0)return"[Circular]";function N(e,r,o){if(r&&(i=k.call(i)).push(r),o){var s={depth:a.depth};return z(a,"quoteStyle")&&(s.quoteStyle=a.quoteStyle),t(e,s,n+1,i)}return t(e,a,n+1,i)}if("function"==typeof e&&!F(e)){var q=function(t){if(t.name)return t.name;var e=b.call(g.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),K=Q(e,N);return"[Function"+(q?": "+q:" (anonymous)")+"]"+(K.length>0?" { "+_.call(K,", ")+" }":"")}if($(e)){var tt=T?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):B.call(e);return"object"!=typeof e||T?tt:W(tt)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var et="<"+M.call(String(e.nodeName)),rt=e.attributes||[],nt=0;nt<rt.length;nt++)et+=" "+rt[nt].name+"="+H(D(rt[nt].value),"double",a);return et+=">",e.childNodes&&e.childNodes.length&&(et+="..."),et+="</"+M.call(String(e.nodeName))+">"}if(U(e)){if(0===e.length)return"[]";var it=Q(e,N);return I&&!function(t){for(var e=0;e<t.length;e++)if(V(t[e],"\n")>=0)return!1;return!0}(it)?"["+Y(it,I)+"]":"[ "+_.call(it,", ")+" ]"}if(function(t){return!("[object Error]"!==G(t)||P&&"object"==typeof t&&P in t)}(e)){var ot=Q(e,N);return"cause"in Error.prototype||!("cause"in e)||C.call(e,"cause")?0===ot.length?"["+String(e)+"]":"{ ["+String(e)+"] "+_.call(ot,", ")+" }":"{ ["+String(e)+"] "+_.call(S.call("[cause]: "+N(e.cause),ot),", ")+" }"}if("object"==typeof e&&u){if(j&&"function"==typeof e[j]&&L)return L(e,{depth:A-n});if("symbol"!==u&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!o||!t||"object"!=typeof t)return!1;try{o.call(t);try{h.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var st=[];return s&&s.call(e,(function(t,r){st.push(N(r,e,!0)+" => "+N(t,e))})),X("Map",o.call(e),st,I)}if(function(t){if(!h||!t||"object"!=typeof t)return!1;try{h.call(t);try{o.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var at=[];return c&&c.call(e,(function(t){at.push(N(t,e))})),X("Set",h.call(e),at,I)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{l.call(t,l)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Z("WeakMap");if(function(t){if(!l||!t||"object"!=typeof t)return!1;try{l.call(t,l);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Z("WeakSet");if(function(t){if(!d||!t||"object"!=typeof t)return!1;try{return d.call(t),!0}catch(t){}return!1}(e))return Z("WeakRef");if(function(t){return!("[object Number]"!==G(t)||P&&"object"==typeof t&&P in t)}(e))return W(N(Number(e)));if(function(t){if(!t||"object"!=typeof t||!x)return!1;try{return x.call(t),!0}catch(t){}return!1}(e))return W(N(x.call(e)));if(function(t){return!("[object Boolean]"!==G(t)||P&&"object"==typeof t&&P in t)}(e))return W(p.call(e));if(function(t){return!("[object String]"!==G(t)||P&&"object"==typeof t&&P in t)}(e))return W(N(String(e)));if(!function(t){return!("[object Date]"!==G(t)||P&&"object"==typeof t&&P in t)}(e)&&!F(e)){var ut=Q(e,N),ht=R?R(e)===Object.prototype:e instanceof Object||e.constructor===Object,ct=e instanceof Object?"":"null prototype",ft=!ht&&P&&Object(e)===e&&P in e?y.call(G(e),8,-1):ct?"Object":"",lt=(ht||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(ft||ct?"["+_.call(S.call([],ft||[],ct||[]),": ")+"] ":"");return 0===ut.length?lt+"{}":I?lt+"{"+Y(ut,I)+"}":lt+"{ "+_.call(ut,", ")+" }"}return String(e)};var q=Object.prototype.hasOwnProperty||function(t){return t in this};function z(t,e){return q.call(t,e)}function G(t){return m.call(t)}function V(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function J(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return J(y.call(t,0,e.maxStringLength),e)+n}return H(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,K),"single",e)}function K(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function W(t){return"Object("+t+")"}function Z(t){return t+" { ? }"}function X(t,e,r,n){return t+" ("+e+") {"+(n?Y(r,n):_.call(r,", "))+"}"}function Y(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+_.call(t,","+r)+"\n"+e.prev}function Q(t,e){var r=U(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=z(t,i)?e(t[i],t):""}var o,s="function"==typeof I?I(t):[];if(T){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var u in t)z(t,u)&&(r&&String(Number(u))===u&&u<t.length||T&&o["$"+u]instanceof Symbol||(E.call(/[^\w$]/,u)?n.push(e(u,t)+": "+e(t[u],t)):n.push(u+": "+e(t[u],t))));if("function"==typeof I)for(var h=0;h<s.length;h++)C.call(t,s[h])&&n.push("["+e(s[h])+"]: "+e(t[s[h]],t));return n}},8045:(t,e,r)=>{"use strict";var n=r(2812);e.certificate=r(7832);var i=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));e.RSAPrivateKey=i;var o=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));e.RSAPublicKey=o;var s=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}));e.PublicKey=s;var a=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),u=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(a),this.key("subjectPrivateKey").octstr())}));e.PrivateKey=u;var h=n.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));e.EncryptedPrivateKey=h;var c=n.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));e.DSAPrivateKey=c,e.DSAparam=n.define("DSAparam",(function(){this.int()}));var f=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(l),this.key("publicKey").optional().explicit(1).bitstr())}));e.ECPrivateKey=f;var l=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));e.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},7832:(t,e,r)=>{"use strict";var n=r(2812),i=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),s=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),a=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())})),u=n.define("RelativeDistinguishedName",(function(){this.setof(o)})),h=n.define("RDNSequence",(function(){this.seqof(u)})),c=n.define("Name",(function(){this.choice({rdnSequence:this.use(h)})})),f=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),l=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),d=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(s),this.key("issuer").use(c),this.key("validity").use(f),this.key("subject").use(c),this.key("subjectPublicKeyInfo").use(a),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(l).optional())})),p=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(s),this.key("signatureValue").bitstr())}));t.exports=p},2968:(t,e,r)=>{var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,s=r(9341),a=r(10),u=r(7834).Buffer;t.exports=function(t,e){var r,h=t.toString(),c=h.match(n);if(c){var f="aes"+c[1],l=u.from(c[2],"hex"),d=u.from(c[3].replace(/[\r\n]/g,""),"base64"),p=s(e,l.slice(0,8),parseInt(c[1],10)).key,m=[],g=a.createDecipheriv(f,p,l);m.push(g.update(d)),m.push(g.final()),r=u.concat(m)}else{var b=h.match(o);r=u.from(b[2].replace(/[\r\n]/g,""),"base64")}return{tag:h.match(i)[1],data:r}}},8016:(t,e,r)=>{var n=r(8045),i=r(8675),o=r(2968),s=r(10),a=r(499),u=r(7834).Buffer;function h(t){var e;"object"!=typeof t||u.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=u.from(t));var r,h,c=o(t,e),f=c.tag,l=c.data;switch(f){case"CERTIFICATE":h=n.certificate.decode(l,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(h||(h=n.PublicKey.decode(l,"der")),r=h.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(h.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return h.subjectPrivateKey=h.subjectPublicKey,{type:"ec",data:h};case"1.2.840.10040.4.1":return h.algorithm.params.pub_key=n.DSAparam.decode(h.subjectPublicKey.data,"der"),{type:"dsa",data:h.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":l=function(t,e){var r=t.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=i[t.algorithm.decrypt.cipher.algo.join(".")],h=t.algorithm.decrypt.cipher.iv,c=t.subjectPrivateKey,f=parseInt(o.split("-")[1],10)/8,l=a.pbkdf2Sync(e,r,n,f,"sha1"),d=s.createDecipheriv(o,l,h),p=[];return p.push(d.update(c)),p.push(d.final()),u.concat(p)}(l=n.EncryptedPrivateKey.decode(l,"der"),e);case"PRIVATE KEY":switch(r=(h=n.PrivateKey.decode(l,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(h.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:h.algorithm.curve,privateKey:n.ECPrivateKey.decode(h.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return h.algorithm.params.priv_key=n.DSAparam.decode(h.subjectPrivateKey,"der"),{type:"dsa",params:h.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(l,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(l,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(l,"der")};case"EC PRIVATE KEY":return{curve:(l=n.ECPrivateKey.decode(l,"der")).parameters.value,privateKey:l.privateKey};default:throw new Error("unknown key type "+f)}}t.exports=h,h.signature=n.signature},499:(t,e,r)=>{e.pbkdf2=r(4874),e.pbkdf2Sync=r(8840)},4874:(t,e,r)=>{var n,i,o=r(7834).Buffer,s=r(7351),a=r(5214),u=r(8840),h=r(7232),c=r.g.crypto&&r.g.crypto.subtle,f={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},l=[];function d(){return i||(i=r.g.process&&r.g.process.nextTick?r.g.process.nextTick:r.g.queueMicrotask?r.g.queueMicrotask:r.g.setImmediate?r.g.setImmediate:r.g.setTimeout)}function p(t,e,r,n,i){return c.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return c.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:i}},t,n<<3)})).then((function(t){return o.from(t)}))}t.exports=function(t,e,i,m,g,b){"function"==typeof g&&(b=g,g=void 0);var y=f[(g=g||"sha1").toLowerCase()];if(y&&"function"==typeof r.g.Promise){if(s(i,m),t=h(t,a,"Password"),e=h(e,a,"Salt"),"function"!=typeof b)throw new Error("No callback provided to pbkdf2");!function(t,e){t.then((function(t){d()((function(){e(null,t)}))}),(function(t){d()((function(){e(t)}))}))}(function(t){if(r.g.process&&!r.g.process.browser)return Promise.resolve(!1);if(!c||!c.importKey||!c.deriveBits)return Promise.resolve(!1);if(void 0!==l[t])return l[t];var e=p(n=n||o.alloc(8),n,10,128,t).then((function(){return!0})).catch((function(){return!1}));return l[t]=e,e}(y).then((function(r){return r?p(t,e,i,m,y):u(t,e,i,m,g)})),b)}else d()((function(){var r;try{r=u(t,e,i,m,g)}catch(t){return b(t)}b(null,r)}))}},5214:(t,e,r)=>{var n;if(r.g.process&&r.g.process.browser)n="utf-8";else if(r.g.process&&r.g.process.version){n=parseInt(process.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else n="utf-8";t.exports=n},7351:t=>{var e=Math.pow(2,30)-1;t.exports=function(t,r){if("number"!=typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!=typeof r)throw new TypeError("Key length not a number");if(r<0||r>e||r!=r)throw new TypeError("Bad key length")}},8840:(t,e,r)=>{var n=r(2511),i=r(1445),o=r(9065),s=r(7834).Buffer,a=r(7351),u=r(5214),h=r(7232),c=s.alloc(128),f={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(t,e,r){var a=function(t){function e(e){return o(t).update(e).digest()}function r(t){return(new i).update(t).digest()}return"rmd160"===t||"ripemd160"===t?r:"md5"===t?n:e}(t),u="sha512"===t||"sha384"===t?128:64;e.length>u?e=a(e):e.length<u&&(e=s.concat([e,c],u));for(var h=s.allocUnsafe(u+f[t]),l=s.allocUnsafe(u+f[t]),d=0;d<u;d++)h[d]=54^e[d],l[d]=92^e[d];var p=s.allocUnsafe(u+r+4);h.copy(p,0,0,u),this.ipad1=p,this.ipad2=h,this.opad=l,this.alg=t,this.blocksize=u,this.hash=a,this.size=f[t]}l.prototype.run=function(t,e){return t.copy(e,this.blocksize),this.hash(e).copy(this.opad,this.blocksize),this.hash(this.opad)},t.exports=function(t,e,r,n,i){a(r,n);var o=new l(i=i||"sha1",t=h(t,u,"Password"),(e=h(e,u,"Salt")).length),c=s.allocUnsafe(n),d=s.allocUnsafe(e.length+4);e.copy(d,0,0,e.length);for(var p=0,m=f[i],g=Math.ceil(n/m),b=1;b<=g;b++){d.writeUInt32BE(b,e.length);for(var y=o.run(d,o.ipad1),v=y,w=1;w<r;w++){v=o.run(v,o.ipad2);for(var M=0;M<m;M++)y[M]^=v[M]}y.copy(c,p),p+=m}return c}},7232:(t,e,r)=>{var n=r(7834).Buffer;t.exports=function(t,e,r){if(n.isBuffer(t))return t;if("string"==typeof t)return n.from(t,e);if(ArrayBuffer.isView(t))return n.from(t.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},9498:(t,e,r)=>{"use strict";const{ErrorWithCause:n}=r(1261),{findCauseByReference:i,getErrorCause:o,messageWithCauses:s,stackWithCauses:a}=r(1662);t.exports={ErrorWithCause:n,findCauseByReference:i,getErrorCause:o,stackWithCauses:a,messageWithCauses:s}},1261:t=>{"use strict";class e extends Error{constructor(t,{cause:r}={}){super(t),this.name=e.name,r&&(this.cause=r),this.message=t}}t.exports={ErrorWithCause:e}},1662:t=>{"use strict";const e=t=>{if(t&&"object"==typeof t&&"cause"in t){if("function"==typeof t.cause){const e=t.cause();return e instanceof Error?e:void 0}return t.cause instanceof Error?t.cause:void 0}},r=(t,n)=>{if(!(t instanceof Error))return"";const i=t.stack||"";if(n.has(t))return i+"\ncauses have become circular...";const o=e(t);return o?(n.add(t),i+"\ncaused by: "+r(o,n)):i},n=(t,r,i)=>{if(!(t instanceof Error))return"";const o=i?"":t.message||"";if(r.has(t))return o+": ...";const s=e(t);if(s){r.add(t);const e="cause"in t&&"function"==typeof t.cause;return o+(e?"":": ")+n(s,r,e)}return o};t.exports={findCauseByReference:(t,r)=>{if(!t||!r)return;if(!(t instanceof Error))return;if(!(r.prototype instanceof Error)&&r!==Error)return;const n=new Set;let i=t;for(;i&&!n.has(i);){if(n.add(i),i instanceof r)return i;i=e(i)}},getErrorCause:e,stackWithCauses:t=>r(t,new Set),messageWithCauses:t=>n(t,new Set)}},8493:(t,e,r)=>{e.publicEncrypt=r(1896),e.privateDecrypt=r(6932),e.privateEncrypt=function(t,r){return e.publicEncrypt(t,r,!0)},e.publicDecrypt=function(t,r){return e.privateDecrypt(t,r,!0)}},8525:(t,e,r)=>{var n=r(6162),i=r(7834).Buffer;function o(t){var e=i.allocUnsafe(4);return e.writeUInt32BE(t,0),e}t.exports=function(t,e){for(var r,s=i.alloc(0),a=0;s.length<e;)r=o(a++),s=i.concat([s,n("sha1").update(t).update(r).digest()]);return s.slice(0,e)}},2216:function(t,e,r){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(5862).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function h(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,c=r;c<a;c+=n)u=h(t,c,c+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var f=1;for(u=h(t,c,t.length,e),c=0;c<s;c++)f*=e;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","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"],f=[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],l=[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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h<n;h++){for(var c=u>>>26,f=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[d])+f)/67108864|0,f=67108863&s}r.words[h]=0|f,u=0|c}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[a]=s;for(;a<o;a++)h[a]=0}else{for(a=0;a<o-i;a++)h[a]=0;for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),h[o-a-1]=s}return h},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,h=0,c=0|s[0],f=8191&c,l=c>>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],b=8191&g,y=g>>>13,v=0|s[3],w=8191&v,M=v>>>13,E=0|s[4],S=8191&E,_=E>>>13,k=0|s[5],A=8191&k,x=k>>>13,I=0|s[6],B=8191&I,T=I>>>13,P=0|s[7],C=8191&P,R=P>>>13,O=0|s[8],L=8191&O,N=O>>>13,j=0|s[9],H=8191&j,D=j>>>13,U=0|a[0],F=8191&U,$=U>>>13,q=0|a[1],z=8191&q,G=q>>>13,V=0|a[2],J=8191&V,K=V>>>13,W=0|a[3],Z=8191&W,X=W>>>13,Y=0|a[4],Q=8191&Y,tt=Y>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,ct=0|a[8],ft=8191&ct,lt=ct>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(h+(n=Math.imul(f,F))|0)+((8191&(i=(i=Math.imul(f,$))+Math.imul(l,F)|0))<<13)|0;h=((o=Math.imul(l,$))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,$))+Math.imul(m,F)|0,o=Math.imul(m,$);var bt=(h+(n=n+Math.imul(f,z)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(l,z)|0))<<13)|0;h=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(b,F),i=(i=Math.imul(b,$))+Math.imul(y,F)|0,o=Math.imul(y,$),n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,z)|0,o=o+Math.imul(m,G)|0;var yt=(h+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(l,J)|0))<<13)|0;h=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,$))+Math.imul(M,F)|0,o=Math.imul(M,$),n=n+Math.imul(b,z)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,K)|0;var vt=(h+(n=n+Math.imul(f,Z)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(l,Z)|0))<<13)|0;h=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,$))+Math.imul(_,F)|0,o=Math.imul(_,$),n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(M,z)|0,o=o+Math.imul(M,G)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,K)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var wt=(h+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(l,Q)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(A,F),i=(i=Math.imul(A,$))+Math.imul(x,F)|0,o=Math.imul(x,$),n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,K)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var Mt=(h+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,F),i=(i=Math.imul(B,$))+Math.imul(T,F)|0,o=Math.imul(T,$),n=n+Math.imul(A,z)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(x,z)|0,o=o+Math.imul(x,G)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Et=(h+(n=n+Math.imul(f,ot)|0)|0)+((8191&(i=(i=i+Math.imul(f,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,$))+Math.imul(R,F)|0,o=Math.imul(R,$),n=n+Math.imul(B,z)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,K)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var St=(h+(n=n+Math.imul(f,ut)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,$))+Math.imul(N,F)|0,o=Math.imul(N,$),n=n+Math.imul(C,z)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,G)|0,n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,K)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,K)|0,n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,X)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var _t=(h+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,lt)|0)+Math.imul(l,ft)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(H,F),i=(i=Math.imul(H,$))+Math.imul(D,F)|0,o=Math.imul(D,$),n=n+Math.imul(L,z)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(N,z)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,K)|0,n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(b,ut)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(m,ft)|0,o=o+Math.imul(m,lt)|0;var kt=(h+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(H,z),i=(i=Math.imul(H,G))+Math.imul(D,z)|0,o=Math.imul(D,G),n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(y,ft)|0,o=o+Math.imul(y,lt)|0;var At=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(H,J),i=(i=Math.imul(H,K))+Math.imul(D,J)|0,o=Math.imul(D,K),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,X)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(B,rt)|0,i=(i=i+Math.imul(B,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(w,ft)|0,i=(i=i+Math.imul(w,lt)|0)+Math.imul(M,ft)|0,o=o+Math.imul(M,lt)|0;var xt=(h+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(H,Z),i=(i=Math.imul(H,X))+Math.imul(D,Z)|0,o=Math.imul(D,X),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(B,ot)|0,i=(i=i+Math.imul(B,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(S,ft)|0,i=(i=i+Math.imul(S,lt)|0)+Math.imul(_,ft)|0,o=o+Math.imul(_,lt)|0;var It=(h+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(H,Q),i=(i=Math.imul(H,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(B,ut)|0,i=(i=i+Math.imul(B,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(A,ft)|0,i=(i=i+Math.imul(A,lt)|0)+Math.imul(x,ft)|0,o=o+Math.imul(x,lt)|0;var Bt=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(H,rt),i=(i=Math.imul(H,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ht)|0,n=n+Math.imul(B,ft)|0,i=(i=i+Math.imul(B,lt)|0)+Math.imul(T,ft)|0,o=o+Math.imul(T,lt)|0;var Tt=(h+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(H,ot),i=(i=Math.imul(H,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(L,ut)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(C,ft)|0,i=(i=i+Math.imul(C,lt)|0)+Math.imul(R,ft)|0,o=o+Math.imul(R,lt)|0;var Pt=(h+(n=n+Math.imul(B,pt)|0)|0)+((8191&(i=(i=i+Math.imul(B,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(H,ut),i=(i=Math.imul(H,ht))+Math.imul(D,ut)|0,o=Math.imul(D,ht),n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,lt)|0)+Math.imul(N,ft)|0,o=o+Math.imul(N,lt)|0;var Ct=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(H,ft),i=(i=Math.imul(H,lt))+Math.imul(D,ft)|0,o=Math.imul(D,lt);var Rt=(h+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Ot=(h+(n=Math.imul(H,pt))|0)+((8191&(i=(i=Math.imul(H,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=bt,u[2]=yt,u[3]=vt,u[4]=wt,u[5]=Mt,u[6]=Et,u[7]=St,u[8]=_t,u[9]=kt,u[10]=At,u[11]=xt,u[12]=It,u[13]=Bt,u[14]=Tt,u[15]=Pt,u[16]=Ct,u[17]=Rt,u[18]=Ot,0!==h&&(u[19]=h,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(p=d),o.prototype.mulTo=function(t,e){var r,n=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=u;h++){var c=o-h,f=(0|t.words[c])*(0|e.words[h]),l=67108863&f;a=67108863&(l=l+a|0),i+=(s=(s=s+(f/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):m(this,t,e),r},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},g.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},g.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),h=Math.sin(2*Math.PI/a),c=0;c<i;c+=a)for(var f=u,l=h,d=0;d<s;d++){var p=r[c+d],m=n[c+d],g=r[c+d+s],b=n[c+d+s],y=f*g-l*b;b=f*b+l*g,g=y,r[c+d]=p+g,n[c+d]=m+b,r[c+d+s]=p-g,n[c+d+s]=m-b,d!==a&&(y=u*f-h*l,l=u*l+h*f,f=y)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},g.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},g.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},g.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),h=new Array(n),c=new Array(n),f=new Array(n),l=r.words;l.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,h,n),this.transform(s,o,a,u,n,i),this.transform(h,o,c,f,n,i);for(var d=0;d<n;d++){var p=a[d]*c[d]-u[d]*f[d];u[d]=a[d]*f[d]+u[d]*c[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,l,o,n,i),this.conjugate(l,o,n),this.normalize13b(l,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),m(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var h=0;h<s;h++)u.words[h]=this.words[h];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var c=0;for(h=this.length-1;h>=0&&(0!==c||h>=i);h--){var f=0|this.words[h];this.words[h]=c<<26-o|f>>>o,c=f&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h<a.length;h++)a.words[h]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,a&&(a.words[u]=1));for(var f=u-1;f>=0;f--){var l=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,f);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);a&&(a.words[f]=l)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),f=e.clone();!e.isZero();){for(var l=0,d=1;0==(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(f)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(f)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var f=0,l=1;0==(r.words[0]&l)&&f<26;++f,l<<=1);if(f>0)for(r.iushrn(f);f-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function _(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(v,y),v.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i<n;i++)e.words[i]=t.words[i];if(e.length=n,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&r,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,y),i(M,y),i(E,y),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new E}return b[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,i),l=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var b=this.pow(f,new o(1).iushln(p-g-1));l=l.redMul(b),f=b.redSqr(),d=d.redMul(f),p=g}return l},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var h=e.words[n],c=u-1;c>=0;c--){var f=h>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==s?(s<<=1,s|=f,(4===++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new _(t)},i(_,S),_.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},_.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},_.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},_.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},_.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6932:(t,e,r)=>{var n=r(8016),i=r(8525),o=r(1273),s=r(2216),a=r(1857),u=r(6162),h=r(6112),c=r(7834).Buffer;t.exports=function(t,e,r){var f;f=t.padding?t.padding:r?1:4;var l,d=n(t),p=d.modulus.byteLength();if(e.length>p||new s(e).cmp(d.modulus)>=0)throw new Error("decryption error");l=r?h(new s(e),d):a(e,d);var m=c.alloc(p-l.length);if(l=c.concat([m,l],p),4===f)return function(t,e){var r=t.modulus.byteLength(),n=u("sha1").update(c.alloc(0)).digest(),s=n.length;if(0!==e[0])throw new Error("decryption error");var a=e.slice(1,s+1),h=e.slice(s+1),f=o(a,i(h,s)),l=o(h,i(f,r-s-1));if(function(t,e){t=c.from(t),e=c.from(e);var r=0,n=t.length;t.length!==e.length&&(r++,n=Math.min(t.length,e.length));var i=-1;for(;++i<n;)r+=t[i]^e[i];return r}(n,l.slice(0,s)))throw new Error("decryption error");var d=s;for(;0===l[d];)d++;if(1!==l[d++])throw new Error("decryption error");return l.slice(d)}(d,l);if(1===f)return function(t,e,r){var n=e.slice(0,2),i=2,o=0;for(;0!==e[i++];)if(i>=e.length){o++;break}var s=e.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;s.length<8&&o++;if(o)throw new Error("decryption error");return e.slice(i)}(0,l,r);if(3===f)return l;throw new Error("unknown padding")}},1896:(t,e,r)=>{var n=r(8016),i=r(5003),o=r(6162),s=r(8525),a=r(1273),u=r(2216),h=r(6112),c=r(1857),f=r(7834).Buffer;t.exports=function(t,e,r){var l;l=t.padding?t.padding:r?1:4;var d,p=n(t);if(4===l)d=function(t,e){var r=t.modulus.byteLength(),n=e.length,h=o("sha1").update(f.alloc(0)).digest(),c=h.length,l=2*c;if(n>r-l-2)throw new Error("message too long");var d=f.alloc(r-n-l-2),p=r-c-1,m=i(c),g=a(f.concat([h,d,f.alloc(1,1),e],p),s(m,p)),b=a(m,s(g,c));return new u(f.concat([f.alloc(1),b,g],r))}(p,e);else if(1===l)d=function(t,e,r){var n,o=e.length,s=t.modulus.byteLength();if(o>s-11)throw new Error("message too long");n=r?f.alloc(s-o-3,255):function(t){var e,r=f.allocUnsafe(t),n=0,o=i(2*t),s=0;for(;n<t;)s===o.length&&(o=i(2*t),s=0),(e=o[s++])&&(r[n++]=e);return r}(s-o-3);return new u(f.concat([f.from([0,r?1:2]),n,f.alloc(1),e],s))}(p,e,r);else{if(3!==l)throw new Error("unknown padding");if((d=new u(e)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return r?c(d,p):h(d,p)}},6112:(t,e,r)=>{var n=r(2216),i=r(7834).Buffer;t.exports=function(t,e){return i.from(t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed().toArray())}},1273:t=>{t.exports=function(t,e){for(var r=t.length,n=-1;++n<r;)t[n]^=e[n];return t}},5003:(t,e,r)=>{"use strict";var n=65536,i=4294967295;var o=r(7834).Buffer,s=r.g.crypto||r.g.msCrypto;s&&s.getRandomValues?t.exports=function(t,e){if(t>i)throw new RangeError("requested too many random bytes");var r=o.allocUnsafe(t);if(t>0)if(t>n)for(var a=0;a<t;a+=n)s.getRandomValues(r.slice(a,a+n));else s.getRandomValues(r);if("function"==typeof e)return process.nextTick((function(){e(null,r)}));return r}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}},9631:(t,e,r)=>{"use strict";function n(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var i=r(7834),o=r(5003),s=i.Buffer,a=i.kMaxLength,u=r.g.crypto||r.g.msCrypto,h=Math.pow(2,32)-1;function c(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>h||t<0)throw new TypeError("offset must be a uint32");if(t>a||t>e)throw new RangeError("offset out of range")}function f(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>h||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>a)throw new RangeError("buffer too small")}function l(t,e,r,n){if(process.browser){var i=t.buffer,s=new Uint8Array(i,e,r);return u.getRandomValues(s),n?void process.nextTick((function(){n(null,t)})):t}if(!n)return o(r).copy(t,e),t;o(r,(function(r,i){if(r)return n(r);i.copy(t,e),n(null,t)}))}u&&u.getRandomValues||!process.browser?(e.randomFill=function(t,e,n,i){if(!(s.isBuffer(t)||t instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof e)i=e,e=0,n=t.length;else if("function"==typeof n)i=n,n=t.length-e;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return c(e,t.length),f(n,e,t.length),l(t,e,n,i)},e.randomFillSync=function(t,e,n){void 0===e&&(e=0);if(!(s.isBuffer(t)||t instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');c(e,t.length),void 0===n&&(n=t.length-e);return f(n,e,t.length),l(t,e,n)}):(e.randomFill=n,e.randomFillSync=n)},4452:t=>{"use strict";var e={};function r(t,r,n){n||(n=Error);var i=function(t){var e,n;function i(e,n,i){return t.call(this,function(t,e,n){return"string"==typeof r?r:r(t,e,n)}(e,n,i))||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,o,s,a;if("string"==typeof e&&(o="not ",e.substr(!s||s<0?0:+s,o.length)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))a="The ".concat(t," ").concat(i," ").concat(n(e,"type"));else{var u=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";a='The "'.concat(t,'" ').concat(u," ").concat(i," ").concat(n(e,"type"))}return a+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},7073:(t,e,r)=>{"use strict";var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=h;var i=r(8051),o=r(2557);r(1285)(h,i);for(var s=n(o.prototype),a=0;a<s.length;a++){var u=s[a];h.prototype[u]||(h.prototype[u]=o.prototype[u])}function h(t){if(!(this instanceof h))return new h(t);i.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||process.nextTick(f,this)}function f(t){t.end()}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(h.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(h.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})},5163:(t,e,r)=>{"use strict";t.exports=i;var n=r(7640);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(1285)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},8051:(t,e,r)=>{"use strict";var n;t.exports=_,_.ReadableState=S;r(2699).EventEmitter;var i=function(t,e){return t.listeners(e).length},o=r(5010),s=r(8834).Buffer,a=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var u,h=r(6602);u=h&&h.debuglog?h.debuglog("stream"):function(){};var c,f,l,d=r(6637),p=r(2262),m=r(7605).getHighWaterMark,g=r(4452).q,b=g.ERR_INVALID_ARG_TYPE,y=g.ERR_STREAM_PUSH_AFTER_EOF,v=g.ERR_METHOD_NOT_IMPLEMENTED,w=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(1285)(_,o);var M=p.errorOrDestroy,E=["error","close","destroy","pause","resume"];function S(t,e,i){n=n||r(7073),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=m(this,t,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(c||(c=r(214).s),this.decoder=new c(t.encoding),this.encoding=t.encoding)}function _(t){if(n=n||r(7073),!(this instanceof _))return new _(t);var e=this instanceof n;this._readableState=new S(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),o.call(this)}function k(t,e,r,n,i){u("readableAddChunk",e);var o,h=t._readableState;if(null===e)h.reading=!1,function(t,e){if(u("onEofChunk"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?B(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,T(t)))}(t,h);else if(i||(o=function(t,e){var r;n=e,s.isBuffer(n)||n instanceof a||"string"==typeof e||void 0===e||t.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],e));var n;return r}(h,e)),o)M(t,o);else if(h.objectMode||e&&e.length>0)if("string"==typeof e||h.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n)h.endEmitted?M(t,new w):A(t,h,e,!0);else if(h.ended)M(t,new y);else{if(h.destroyed)return!1;h.reading=!1,h.decoder&&!r?(e=h.decoder.write(e),h.objectMode||0!==e.length?A(t,h,e,!1):P(t,h)):A(t,h,e,!1)}else n||(h.reading=!1,P(t,h));return!h.ended&&(h.length<h.highWaterMark||0===h.length)}function A(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&B(t)),P(t,e)}Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),_.prototype.destroy=p.destroy,_.prototype._undestroy=p.undestroy,_.prototype._destroy=function(t,e){e(t)},_.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=s.from(t,e),e=""),r=!0),k(this,t,e,!1,r)},_.prototype.unshift=function(t){return k(this,t,null,!0,!1)},_.prototype.isPaused=function(){return!1===this._readableState.flowing},_.prototype.setEncoding=function(t){c||(c=r(214).s);var e=new c(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=e.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var x=1073741824;function I(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=x?t=x:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function B(t){var e=t._readableState;u("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(u("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(T,t))}function T(t){var e=t._readableState;u("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function P(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(C,t,e))}function C(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(u("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function R(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function O(t){u("readable nexttick read 0"),t.read(0)}function L(t,e){u("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(u("flow",e.flowing);e.flowing&&null!==t.read(););}function j(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function H(t){var e=t._readableState;u("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(D,e,t))}function D(t,e){if(u("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function U(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}_.prototype.read=function(t){u("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return u("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?H(this):B(this),null;if(0===(t=I(t,e))&&e.ended)return 0===e.length&&H(this),null;var n,i=e.needReadable;return u("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&u("length less than watermark",i=!0),e.ended||e.reading?u("reading or ended",i=!1):i&&(u("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=I(r,e))),null===(n=t>0?j(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&H(this)),null!==n&&this.emit("data",n),n},_.prototype._read=function(t){M(this,new v("_read()"))},_.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,e);var o=(!e||!1!==e.end)&&t!==process.stdout&&t!==process.stderr?a:m;function s(e,i){u("onunpipe"),e===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,u("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",h),t.removeListener("error",l),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",m),r.removeListener("data",f),c=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function a(){u("onend"),t.end()}n.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);var h=function(t){return function(){var e=t._readableState;u("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&i(t,"data")&&(e.flowing=!0,N(t))}}(r);t.on("drain",h);var c=!1;function f(e){u("ondata");var i=t.write(e);u("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==U(n.pipes,t))&&!c&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function l(e){u("onerror",e),m(),t.removeListener("error",l),0===i(t,"error")&&M(t,e)}function d(){t.removeListener("finish",p),m()}function p(){u("onfinish"),t.removeListener("close",d),m()}function m(){u("unpipe"),r.unpipe(t)}return r.on("data",f),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",l),t.once("close",d),t.once("finish",p),t.emit("pipe",r),n.flowing||(u("pipe resume"),r.resume()),t},_.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=U(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},_.prototype.on=function(t,e){var r=o.prototype.on.call(this,t,e),n=this._readableState;return"data"===t?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?B(this):n.reading||process.nextTick(O,this))),r},_.prototype.addListener=_.prototype.on,_.prototype.removeListener=function(t,e){var r=o.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(R,this),r},_.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||process.nextTick(R,this),e},_.prototype.resume=function(){var t=this._readableState;return t.flowing||(u("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(L,t,e))}(this,t)),t.paused=!1,this},_.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},_.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){(u("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<E.length;o++)t.on(E[o],this.emit.bind(this,E[o]));return this._read=function(e){u("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(_.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=r(1029)),f(this)}),Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(_.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(_.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),_._fromList=j,Object.defineProperty(_.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(_.from=function(t,e){return void 0===l&&(l=r(352)),l(_,t,e)})},7640:(t,e,r)=>{"use strict";t.exports=c;var n=r(4452).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(7073);function h(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function c(t){if(!(this instanceof c))return new c(t);u.call(this,t),this._transformState={afterTransform:h.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",f)}function f(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?l(this,null,null):this._flush((function(e,r){l(t,e,r)}))}function l(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new s;return t.push(null)}r(1285)(c,u),c.prototype.push=function(t,e){return this._transformState.needTransform=!1,u.prototype.push.call(this,t,e)},c.prototype._transform=function(t,e,r){r(new i("_transform()"))},c.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},c.prototype._destroy=function(t,e){u.prototype._destroy.call(this,t,(function(t){e(t)}))}},2557:(t,e,r)=>{"use strict";function n(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var i;t.exports=_,_.WritableState=S;var o={deprecate:r(5803)},s=r(5010),a=r(8834).Buffer,u=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var h,c=r(2262),f=r(7605).getHighWaterMark,l=r(4452).q,d=l.ERR_INVALID_ARG_TYPE,p=l.ERR_METHOD_NOT_IMPLEMENTED,m=l.ERR_MULTIPLE_CALLBACK,g=l.ERR_STREAM_CANNOT_PIPE,b=l.ERR_STREAM_DESTROYED,y=l.ERR_STREAM_NULL_VALUES,v=l.ERR_STREAM_WRITE_AFTER_END,w=l.ERR_UNKNOWN_ENCODING,M=c.errorOrDestroy;function E(){}function S(t,e,o){i=i||r(7073),t=t||{},"boolean"!=typeof o&&(o=e instanceof i),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=f(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new m;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(T,t,e),t._writableState.errorEmitted=!0,M(t,n)):(i(n),t._writableState.errorEmitted=!0,M(t,n),T(t,e))}(t,r,n,e,i);else{var o=I(r)||t.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||x(t,r),n?process.nextTick(A,t,r,o,i):A(t,r,o,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}function _(t){var e=this instanceof(i=i||r(7073));if(!e&&!h.call(_,this))return new _(t);this._writableState=new S(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),s.call(this)}function k(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new b("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function A(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),T(t,e)}function x(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,o=new Array(i),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)o[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;o.allBuffers=u,k(t,e,!0,e.length,o,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new n(e),e.bufferedRequestCount=0}else{for(;r;){var h=r.chunk,c=r.encoding,f=r.callback;if(k(t,e,!1,e.objectMode?1:h.length,h,c,f),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function I(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function B(t,e){t._final((function(r){e.pendingcb--,r&&M(t,r),e.prefinished=!0,t.emit("prefinish"),T(t,e)}))}function T(t,e){var r=I(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,process.nextTick(B,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}r(1285)(_,s),S.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(S.prototype,"buffer",{get:o.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(_,Symbol.hasInstance,{value:function(t){return!!h.call(this,t)||this===_&&(t&&t._writableState instanceof S)}})):h=function(t){return t instanceof this},_.prototype.pipe=function(){M(this,new g)},_.prototype.write=function(t,e,r){var n,i=this._writableState,o=!1,s=!i.objectMode&&(n=t,a.isBuffer(n)||n instanceof u);return s&&!a.isBuffer(t)&&(t=function(t){return a.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=E),i.ending?function(t,e){var r=new v;M(t,r),process.nextTick(e,r)}(this,r):(s||function(t,e,r,n){var i;return null===r?i=new y:"string"==typeof r||e.objectMode||(i=new d("chunk",["string","Buffer"],r)),!i||(M(t,i),process.nextTick(n,i),!1)}(this,i,t,r))&&(i.pendingcb++,o=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=a.from(e,r));return e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var u=e.objectMode?1:n.length;e.length+=u;var h=e.length<e.highWaterMark;h||(e.needDrain=!0);if(e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else k(t,e,!1,u,n,i,o);return h}(this,i,s,t,e,r)),o},_.prototype.cork=function(){this._writableState.corked++},_.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||x(this,t))},_.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new w(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(_.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(_.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),_.prototype._write=function(t,e,r){r(new p("_write()"))},_.prototype._writev=null,_.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,T(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(_.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(_.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),_.prototype.destroy=c.destroy,_.prototype._undestroy=c.undestroy,_.prototype._destroy=function(t,e){e(t)}},1029:(t,e,r)=>{"use strict";var n;function i(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o=r(9885),s=Symbol("lastResolve"),a=Symbol("lastReject"),u=Symbol("error"),h=Symbol("ended"),c=Symbol("lastPromise"),f=Symbol("handlePromise"),l=Symbol("stream");function d(t,e){return{value:t,done:e}}function p(t){var e=t[s];if(null!==e){var r=t[l].read();null!==r&&(t[c]=null,t[s]=null,t[a]=null,e(d(r,!1)))}}function m(t){process.nextTick(p,t)}var g=Object.getPrototypeOf((function(){})),b=Object.setPrototypeOf((i(n={get stream(){return this[l]},next:function(){var t=this,e=this[u];if(null!==e)return Promise.reject(e);if(this[h])return Promise.resolve(d(void 0,!0));if(this[l].destroyed)return new Promise((function(e,r){process.nextTick((function(){t[u]?r(t[u]):e(d(void 0,!0))}))}));var r,n=this[c];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[h]?r(d(void 0,!0)):e[f](r,n)}),n)}}(n,this));else{var i=this[l].read();if(null!==i)return Promise.resolve(d(i,!1));r=new Promise(this[f])}return this[c]=r,r}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[l].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),n),g);t.exports=function(t){var e,r=Object.create(b,(i(e={},l,{value:t,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,a,{value:null,writable:!0}),i(e,u,{value:null,writable:!0}),i(e,h,{value:t._readableState.endEmitted,writable:!0}),i(e,f,{value:function(t,e){var n=r[l].read();n?(r[c]=null,r[s]=null,r[a]=null,t(d(n,!1))):(r[s]=t,r[a]=e)},writable:!0}),e));return r[c]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[a];return null!==e&&(r[c]=null,r[s]=null,r[a]=null,e(t)),void(r[u]=t)}var n=r[s];null!==n&&(r[c]=null,r[s]=null,r[a]=null,n(d(void 0,!0))),r[h]=!0})),t.on("readable",m.bind(null,r)),r}},6637:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){o(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function o(t,e,r){return(e=a(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function a(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}var u=r(8834).Buffer,h=r(4854).inspect,c=h&&h.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r,n;return e=t,r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return u.alloc(0);for(var e,r,n,i=u.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,r=i,n=s,u.prototype.copy.call(e,r,n),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,o=t>i.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=u.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:c,value:function(t,e){return h(this,i(i({},e),{},{depth:0,customInspect:!1}))}}],r&&s(e.prototype,r),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}()},2262:t=>{"use strict";function e(t,e){n(t,e),r(t)}function r(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function n(t,e){t.emit("error",e)}t.exports={destroy:function(t,i){var o=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(i?i(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(n,this,t)):process.nextTick(n,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!i&&t?o._writableState?o._writableState.errorEmitted?process.nextTick(r,o):(o._writableState.errorEmitted=!0,process.nextTick(e,o,t)):process.nextTick(e,o,t):i?(process.nextTick(r,o),i(t)):process.nextTick(r,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},9885:(t,e,r)=>{"use strict";var n=r(4452).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&e.readable,a=r.writable||!1!==r.writable&&e.writable,u=function(){e.writable||c()},h=e._writableState&&e._writableState.finished,c=function(){a=!1,h=!0,s||o.call(e)},f=e._readableState&&e._readableState.endEmitted,l=function(){s=!1,f=!0,a||o.call(e)},d=function(t){o.call(e,t)},p=function(){var t;return s&&!f?(e._readableState&&e._readableState.ended||(t=new n),o.call(e,t)):a&&!h?(e._writableState&&e._writableState.ended||(t=new n),o.call(e,t)):void 0},m=function(){e.req.on("finish",c)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(e)?a&&!e._writableState&&(e.on("end",u),e.on("close",u)):(e.on("complete",c),e.on("abort",p),e.req?m():e.on("request",m)),e.on("end",l),e.on("finish",c),!1!==r.error&&e.on("error",d),e.on("close",p),function(){e.removeListener("complete",c),e.removeListener("abort",p),e.removeListener("request",m),e.req&&e.req.removeListener("finish",c),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("end",l),e.removeListener("error",d),e.removeListener("close",p)}}},352:t=>{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},3495:(t,e,r)=>{"use strict";var n;var i=r(4452).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function u(t){t()}function h(t,e){return t.pipe(e)}t.exports=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var c,f=function(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new o("streams");var l=e.map((function(t,i){var o=i<e.length-1;return function(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===n&&(n=r(9885)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);a=!0,o()}));var u=!1;return function(e){if(!a&&!u)return u=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}(t,o,i>0,(function(t){c||(c=t),t&&l.forEach(u),o||(l.forEach(u),f(c))}))}));return e.reduce(h)}},7605:(t,e,r)=>{"use strict";var n=r(4452).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},5010:(t,e,r)=>{t.exports=r(2699).EventEmitter},7525:(t,e,r)=>{(e=t.exports=r(8051)).Stream=e,e.Readable=e,e.Writable=r(2557),e.Duplex=r(7073),e.Transform=r(7640),e.PassThrough=r(5163),e.finished=r(9885),e.pipeline=r(3495)},1445:(t,e,r)=>{"use strict";var n=r(8834).Buffer,i=r(1285),o=r(4485),s=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],u=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],h=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],c=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],f=[0,1518500249,1859775393,2400959708,2840853838],l=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<<e|t>>>32-e}function m(t,e,r,n,i,o,s,a){return p(t+(e^r^n)+o+s|0,a)+i|0}function g(t,e,r,n,i,o,s,a){return p(t+(e&r|~e&n)+o+s|0,a)+i|0}function b(t,e,r,n,i,o,s,a){return p(t+((e|~r)^n)+o+s|0,a)+i|0}function y(t,e,r,n,i,o,s,a){return p(t+(e&n|r&~n)+o+s|0,a)+i|0}function v(t,e,r,n,i,o,s,a){return p(t+(e^(r|~n))+o+s|0,a)+i|0}i(d,o),d.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,d=0|this._e,w=0|this._a,M=0|this._b,E=0|this._c,S=0|this._d,_=0|this._e,k=0;k<80;k+=1){var A,x;k<16?(A=m(r,n,i,o,d,t[a[k]],f[0],h[k]),x=v(w,M,E,S,_,t[u[k]],l[0],c[k])):k<32?(A=g(r,n,i,o,d,t[a[k]],f[1],h[k]),x=y(w,M,E,S,_,t[u[k]],l[1],c[k])):k<48?(A=b(r,n,i,o,d,t[a[k]],f[2],h[k]),x=b(w,M,E,S,_,t[u[k]],l[2],c[k])):k<64?(A=y(r,n,i,o,d,t[a[k]],f[3],h[k]),x=g(w,M,E,S,_,t[u[k]],l[3],c[k])):(A=v(r,n,i,o,d,t[a[k]],f[4],h[k]),x=m(w,M,E,S,_,t[u[k]],l[4],c[k])),r=d,d=o,o=p(i,10),i=n,n=A,w=_,_=S,S=p(E,10),E=M,M=x}var I=this._b+i+S|0;this._b=this._c+o+_|0,this._c=this._d+d+w|0,this._d=this._e+r+M|0,this._e=this._a+n+E|0,this._a=I},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=n.alloc?n.alloc(20):new n(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},7834:(t,e,r)=>{var n=r(8834),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},7654:(t,e,r)=>{"use strict";var n,i=r(8834),o=i.Buffer,s={};for(n in i)i.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(s[n]=i[n]);var a=s.Buffer={};for(n in o)o.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(a[n]=o[n]);if(s.Buffer.prototype=o.prototype,a.from&&a.from!==Uint8Array.from||(a.from=function(t,e,r){if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof t);if(t&&void 0===t.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);return o(t,e,r)}),a.alloc||(a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError('The "size" argument must be of type number. Received type '+typeof t);if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var n=o(t);return e&&0!==e.length?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n}),!s.kStringMaxLength)try{s.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch(t){}s.constants||(s.constants={MAX_LENGTH:s.kMaxLength},s.kStringMaxLength&&(s.constants.MAX_STRING_LENGTH=s.kStringMaxLength)),t.exports=s},7847:(t,e,r)=>{const n=Symbol("SemVer ANY");class i{static get ANY(){return n}constructor(t,e){if(e=o(e),t instanceof i){if(t.loose===!!e.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),h("comparator",t,e),this.options=e,this.loose=!!e.loose,this.parse(t),this.semver===n?this.value="":this.value=this.operator+this.semver.version,h("comp",this)}parse(t){const e=this.options.loose?s[a.COMPARATORLOOSE]:s[a.COMPARATOR],r=t.match(e);if(!r)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(t){if(h("Comparator.test",t,this.options.loose),this.semver===n||t===n)return!0;if("string"==typeof t)try{t=new c(t,this.options)}catch(t){return!1}return u(t,this.operator,this.semver,this.options)}intersects(t,e){if(!(t instanceof i))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new f(t.value,e).test(this.value):""===t.operator?""===t.value||new f(this.value,e).test(t.semver):(!(e=o(e)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==t.value)&&(!(!e.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!t.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!t.operator.startsWith("<"))||(!(this.semver.version!==t.semver.version||!this.operator.includes("=")||!t.operator.includes("="))||(!!(u(this.semver,"<",t.semver,e)&&this.operator.startsWith(">")&&t.operator.startsWith("<"))||!!(u(this.semver,">",t.semver,e)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))))))}}t.exports=i;const o=r(1388),{safeRe:s,t:a}=r(4808),u=r(8117),h=r(952),c=r(2435),f=r(6843)},6843:(t,e,r)=>{class n{constructor(t,e){if(e=o(e),t instanceof n)return t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease?t:new n(t.raw,e);if(t instanceof s)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((t=>this.parseRange(t.trim()))).filter((t=>t.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const t=this.set[0];if(this.set=this.set.filter((t=>!g(t[0]))),0===this.set.length)this.set=[t];else if(this.set.length>1)for(const t of this.set)if(1===t.length&&b(t[0])){this.set=[t];break}}this.format()}format(){return this.range=this.set.map((t=>t.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(t){const e=((this.options.includePrerelease&&p)|(this.options.loose&&m))+":"+t,r=i.get(e);if(r)return r;const n=this.options.loose,o=n?h[c.HYPHENRANGELOOSE]:h[c.HYPHENRANGE];t=t.replace(o,B(this.options.includePrerelease)),a("hyphen replace",t),t=t.replace(h[c.COMPARATORTRIM],f),a("comparator trim",t),t=t.replace(h[c.TILDETRIM],l),a("tilde trim",t),t=t.replace(h[c.CARETTRIM],d),a("caret trim",t);let u=t.split(" ").map((t=>v(t,this.options))).join(" ").split(/\s+/).map((t=>I(t,this.options)));n&&(u=u.filter((t=>(a("loose invalid filter",t,this.options),!!t.match(h[c.COMPARATORLOOSE]))))),a("range list",u);const b=new Map,y=u.map((t=>new s(t,this.options)));for(const t of y){if(g(t))return[t];b.set(t.value,t)}b.size>1&&b.has("")&&b.delete("");const w=[...b.values()];return i.set(e,w),w}intersects(t,e){if(!(t instanceof n))throw new TypeError("a Range is required");return this.set.some((r=>y(r,e)&&t.set.some((t=>y(t,e)&&r.every((r=>t.every((t=>r.intersects(t,e)))))))))}test(t){if(!t)return!1;if("string"==typeof t)try{t=new u(t,this.options)}catch(t){return!1}for(let e=0;e<this.set.length;e++)if(T(this.set[e],t,this.options))return!0;return!1}}t.exports=n;const i=new(r(293))({max:1e3}),o=r(1388),s=r(7847),a=r(952),u=r(2435),{safeRe:h,t:c,comparatorTrimReplace:f,tildeTrimReplace:l,caretTrimReplace:d}=r(4808),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:m}=r(5558),g=t=>"<0.0.0-0"===t.value,b=t=>""===t.value,y=(t,e)=>{let r=!0;const n=t.slice();let i=n.pop();for(;r&&n.length;)r=n.every((t=>i.intersects(t,e))),i=n.pop();return r},v=(t,e)=>(a("comp",t,e),t=S(t,e),a("caret",t),t=M(t,e),a("tildes",t),t=k(t,e),a("xrange",t),t=x(t,e),a("stars",t),t),w=t=>!t||"x"===t.toLowerCase()||"*"===t,M=(t,e)=>t.trim().split(/\s+/).map((t=>E(t,e))).join(" "),E=(t,e)=>{const r=e.loose?h[c.TILDELOOSE]:h[c.TILDE];return t.replace(r,((e,r,n,i,o)=>{let s;return a("tilde",t,e,r,n,i,o),w(r)?s="":w(n)?s=`>=${r}.0.0 <${+r+1}.0.0-0`:w(i)?s=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(a("replaceTilde pr",o),s=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):s=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,a("tilde return",s),s}))},S=(t,e)=>t.trim().split(/\s+/).map((t=>_(t,e))).join(" "),_=(t,e)=>{a("caret",t,e);const r=e.loose?h[c.CARETLOOSE]:h[c.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,((e,r,i,o,s)=>{let u;return a("caret",t,e,r,i,o,s),w(r)?u="":w(i)?u=`>=${r}.0.0${n} <${+r+1}.0.0-0`:w(o)?u="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:s?(a("replaceCaret pr",s),u="0"===r?"0"===i?`>=${r}.${i}.${o}-${s} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}-${s} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o}-${s} <${+r+1}.0.0-0`):(a("no pr"),u="0"===r?"0"===i?`>=${r}.${i}.${o}${n} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o} <${+r+1}.0.0-0`),a("caret return",u),u}))},k=(t,e)=>(a("replaceXRanges",t,e),t.split(/\s+/).map((t=>A(t,e))).join(" ")),A=(t,e)=>{t=t.trim();const r=e.loose?h[c.XRANGELOOSE]:h[c.XRANGE];return t.replace(r,((r,n,i,o,s,u)=>{a("xRange",t,r,n,i,o,s,u);const h=w(i),c=h||w(o),f=c||w(s),l=f;return"="===n&&l&&(n=""),u=e.includePrerelease?"-0":"",h?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&l?(c&&(o=0),s=0,">"===n?(n=">=",c?(i=+i+1,o=0,s=0):(o=+o+1,s=0)):"<="===n&&(n="<",c?i=+i+1:o=+o+1),"<"===n&&(u="-0"),r=`${n+i}.${o}.${s}${u}`):c?r=`>=${i}.0.0${u} <${+i+1}.0.0-0`:f&&(r=`>=${i}.${o}.0${u} <${i}.${+o+1}.0-0`),a("xRange return",r),r}))},x=(t,e)=>(a("replaceStars",t,e),t.trim().replace(h[c.STAR],"")),I=(t,e)=>(a("replaceGTE0",t,e),t.trim().replace(h[e.includePrerelease?c.GTE0PRE:c.GTE0],"")),B=t=>(e,r,n,i,o,s,a,u,h,c,f,l,d)=>`${r=w(n)?"":w(i)?`>=${n}.0.0${t?"-0":""}`:w(o)?`>=${n}.${i}.0${t?"-0":""}`:s?`>=${r}`:`>=${r}${t?"-0":""}`} ${u=w(h)?"":w(c)?`<${+h+1}.0.0-0`:w(f)?`<${h}.${+c+1}.0-0`:l?`<=${h}.${c}.${f}-${l}`:t?`<${h}.${c}.${+f+1}-0`:`<=${u}`}`.trim(),T=(t,e,r)=>{for(let r=0;r<t.length;r++)if(!t[r].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let r=0;r<t.length;r++)if(a(t[r].semver),t[r].semver!==s.ANY&&t[r].semver.prerelease.length>0){const n=t[r].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0}},2435:(t,e,r)=>{const n=r(952),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=r(5558),{safeRe:s,t:a}=r(4808),u=r(1388),{compareIdentifiers:h}=r(4935);class c{constructor(t,e){if(e=u(e),t instanceof c){if(t.loose===!!e.loose&&t.includePrerelease===!!e.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>i)throw new TypeError(`version is longer than ${i} characters`);n("SemVer",t,e),this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease;const r=t.trim().match(e.loose?s[a.LOOSE]:s[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((t=>{if(/^[0-9]+$/.test(t)){const e=+t;if(e>=0&&e<o)return e}return t})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(n("SemVer.compare",this.version,this.options,t),!(t instanceof c)){if("string"==typeof t&&t===this.version)return 0;t=new c(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof c||(t=new c(t,this.options)),h(this.major,t.major)||h(this.minor,t.minor)||h(this.patch,t.patch)}comparePre(t){if(t instanceof c||(t=new c(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let e=0;do{const r=this.prerelease[e],i=t.prerelease[e];if(n("prerelease compare",e,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return h(r,i)}while(++e)}compareBuild(t){t instanceof c||(t=new c(t,this.options));let e=0;do{const r=this.build[e],i=t.build[e];if(n("prerelease compare",e,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return h(r,i)}while(++e)}inc(t,e,r){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e,r),this.inc("pre",e,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",e,r),this.inc("pre",e,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const t=Number(r)?1:0;if(!e&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[t];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(e===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(t)}}if(e){let n=[e,t];!1===r&&(n=[e]),0===h(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}t.exports=c},6694:(t,e,r)=>{const n=r(9943);t.exports=(t,e)=>{const r=n(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null}},8117:(t,e,r)=>{const n=r(3276),i=r(7893),o=r(6379),s=r(8463),a=r(1897),u=r(506);t.exports=(t,e,r,h)=>{switch(e){case"===":return"object"==typeof t&&(t=t.version),"object"==typeof r&&(r=r.version),t===r;case"!==":return"object"==typeof t&&(t=t.version),"object"==typeof r&&(r=r.version),t!==r;case"":case"=":case"==":return n(t,r,h);case"!=":return i(t,r,h);case">":return o(t,r,h);case">=":return s(t,r,h);case"<":return a(t,r,h);case"<=":return u(t,r,h);default:throw new TypeError(`Invalid operator: ${e}`)}}},8686:(t,e,r)=>{const n=r(2435),i=r(9943),{safeRe:o,t:s}=r(4808);t.exports=(t,e)=>{if(t instanceof n)return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;let r=null;if((e=e||{}).rtl){let e;for(;(e=o[s.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)r&&e.index+e[0].length===r.index+r[0].length||(r=e),o[s.COERCERTL].lastIndex=e.index+e[1].length+e[2].length;o[s.COERCERTL].lastIndex=-1}else r=t.match(o[s.COERCE]);return null===r?null:i(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,e)}},5914:(t,e,r)=>{const n=r(2435);t.exports=(t,e,r)=>{const i=new n(t,r),o=new n(e,r);return i.compare(o)||i.compareBuild(o)}},5404:(t,e,r)=>{const n=r(2271);t.exports=(t,e)=>n(t,e,!0)},2271:(t,e,r)=>{const n=r(2435);t.exports=(t,e,r)=>new n(t,r).compare(new n(e,r))},6007:(t,e,r)=>{const n=r(9943);t.exports=(t,e)=>{const r=n(t,null,!0),i=n(e,null,!0),o=r.compare(i);if(0===o)return null;const s=o>0,a=s?r:i,u=s?i:r,h=!!a.prerelease.length;if(!!u.prerelease.length&&!h)return u.patch||u.minor?a.patch?"patch":a.minor?"minor":"major":"major";const c=h?"pre":"";return r.major!==i.major?c+"major":r.minor!==i.minor?c+"minor":r.patch!==i.patch?c+"patch":"prerelease"}},3276:(t,e,r)=>{const n=r(2271);t.exports=(t,e,r)=>0===n(t,e,r)},6379:(t,e,r)=>{const n=r(2271);t.exports=(t,e,r)=>n(t,e,r)>0},8463:(t,e,r)=>{const n=r(2271);t.exports=(t,e,r)=>n(t,e,r)>=0},6360:(t,e,r)=>{const n=r(2435);t.exports=(t,e,r,i,o)=>{"string"==typeof r&&(o=i,i=r,r=void 0);try{return new n(t instanceof n?t.version:t,r).inc(e,i,o).version}catch(t){return null}}},1897:(t,e,r)=>{const n=r(2271);t.exports=(t,e,r)=>n(t,e,r)<0},506:(t,e,r)=>{const n=r(2271);t.exports=(t,e,r)=>n(t,e,r)<=0},4551:(t,e,r)=>{const n=r(2435);t.exports=(t,e)=>new n(t,e).major},469:(t,e,r)=>{const n=r(2435);t.exports=(t,e)=>new n(t,e).minor},7893:(t,e,r)=>{const n=r(2271);t.exports=(t,e,r)=>0!==n(t,e,r)},9943:(t,e,r)=>{const n=r(2435);t.exports=(t,e,r=!1)=>{if(t instanceof n)return t;try{return new n(t,e)}catch(t){if(!r)return null;throw t}}},4250:(t,e,r)=>{const n=r(2435);t.exports=(t,e)=>new n(t,e).patch},8204:(t,e,r)=>{const n=r(9943);t.exports=(t,e)=>{const r=n(t,e);return r&&r.prerelease.length?r.prerelease:null}},733:(t,e,r)=>{const n=r(2271);t.exports=(t,e,r)=>n(e,t,r)},2961:(t,e,r)=>{const n=r(5914);t.exports=(t,e)=>t.sort(((t,r)=>n(r,t,e)))},9844:(t,e,r)=>{const n=r(6843);t.exports=(t,e,r)=>{try{e=new n(e,r)}catch(t){return!1}return e.test(t)}},1116:(t,e,r)=>{const n=r(5914);t.exports=(t,e)=>t.sort(((t,r)=>n(t,r,e)))},7230:(t,e,r)=>{const n=r(9943);t.exports=(t,e)=>{const r=n(t,e);return r?r.version:null}},7699:(t,e,r)=>{const n=r(4808),i=r(5558),o=r(2435),s=r(4935),a=r(9943),u=r(7230),h=r(6694),c=r(6360),f=r(6007),l=r(4551),d=r(469),p=r(4250),m=r(8204),g=r(2271),b=r(733),y=r(5404),v=r(5914),w=r(1116),M=r(2961),E=r(6379),S=r(1897),_=r(3276),k=r(7893),A=r(8463),x=r(506),I=r(8117),B=r(8686),T=r(7847),P=r(6843),C=r(9844),R=r(8865),O=r(3727),L=r(4338),N=r(1542),j=r(6240),H=r(9106),D=r(995),U=r(7805),F=r(2013),$=r(1338),q=r(3122);t.exports={parse:a,valid:u,clean:h,inc:c,diff:f,major:l,minor:d,patch:p,prerelease:m,compare:g,rcompare:b,compareLoose:y,compareBuild:v,sort:w,rsort:M,gt:E,lt:S,eq:_,neq:k,gte:A,lte:x,cmp:I,coerce:B,Comparator:T,Range:P,satisfies:C,toComparators:R,maxSatisfying:O,minSatisfying:L,minVersion:N,validRange:j,outside:H,gtr:D,ltr:U,intersects:F,simplifyRange:$,subset:q,SemVer:o,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers}},5558:t=>{const e=Number.MAX_SAFE_INTEGER||9007199254740991;t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},952:t=>{const e="object"==typeof process&&process.env&&/\bsemver\b/i.test("false")?(...t)=>console.error("SEMVER",...t):()=>{};t.exports=e},4935:t=>{const e=/^[0-9]+$/,r=(t,r)=>{const n=e.test(t),i=e.test(r);return n&&i&&(t=+t,r=+r),t===r?0:n&&!i?-1:i&&!n?1:t<r?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(t,e)=>r(e,t)}},1388:t=>{const e=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=t=>t?"object"!=typeof t?e:t:r},4808:(t,e,r)=>{const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:o}=r(5558),s=r(952),a=(e=t.exports={}).re=[],u=e.safeRe=[],h=e.src=[],c=e.t={};let f=0;const l="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",o],[l,i]],p=(t,e,r)=>{const n=(t=>{for(const[e,r]of d)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t})(e),i=f++;s(t,i,e),c[t]=i,h[i]=e,a[i]=new RegExp(e,r?"g":void 0),u[i]=new RegExp(n,r?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${l}*`),p("MAINVERSION",`(${h[c.NUMERICIDENTIFIER]})\\.(${h[c.NUMERICIDENTIFIER]})\\.(${h[c.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${h[c.NUMERICIDENTIFIERLOOSE]})\\.(${h[c.NUMERICIDENTIFIERLOOSE]})\\.(${h[c.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${h[c.NUMERICIDENTIFIER]}|${h[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${h[c.NUMERICIDENTIFIERLOOSE]}|${h[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${h[c.PRERELEASEIDENTIFIER]}(?:\\.${h[c.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${h[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${h[c.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${l}+`),p("BUILD",`(?:\\+(${h[c.BUILDIDENTIFIER]}(?:\\.${h[c.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${h[c.MAINVERSION]}${h[c.PRERELEASE]}?${h[c.BUILD]}?`),p("FULL",`^${h[c.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${h[c.MAINVERSIONLOOSE]}${h[c.PRERELEASELOOSE]}?${h[c.BUILD]}?`),p("LOOSE",`^${h[c.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${h[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${h[c.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${h[c.XRANGEIDENTIFIER]})(?:\\.(${h[c.XRANGEIDENTIFIER]})(?:\\.(${h[c.XRANGEIDENTIFIER]})(?:${h[c.PRERELEASE]})?${h[c.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${h[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[c.XRANGEIDENTIFIERLOOSE]})(?:${h[c.PRERELEASELOOSE]})?${h[c.BUILD]}?)?)?`),p("XRANGE",`^${h[c.GTLT]}\\s*${h[c.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${h[c.GTLT]}\\s*${h[c.XRANGEPLAINLOOSE]}$`),p("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),p("COERCERTL",h[c.COERCE],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${h[c.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",p("TILDE",`^${h[c.LONETILDE]}${h[c.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${h[c.LONETILDE]}${h[c.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${h[c.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",p("CARET",`^${h[c.LONECARET]}${h[c.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${h[c.LONECARET]}${h[c.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${h[c.GTLT]}\\s*(${h[c.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${h[c.GTLT]}\\s*(${h[c.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${h[c.GTLT]}\\s*(${h[c.LOOSEPLAIN]}|${h[c.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${h[c.XRANGEPLAIN]})\\s+-\\s+(${h[c.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${h[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${h[c.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},293:(t,e,r)=>{"use strict";const n=r(8006),i=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),u=Symbol("maxAge"),h=Symbol("dispose"),c=Symbol("noDisposeOnSet"),f=Symbol("lruList"),l=Symbol("cache"),d=Symbol("updateAgeOnGet"),p=()=>1;const m=(t,e,r)=>{const n=t[l].get(e);if(n){const e=n.value;if(g(t,e)){if(y(t,n),!t[a])return}else r&&(t[d]&&(n.value.now=Date.now()),t[f].unshiftNode(n));return e.value}},g=(t,e)=>{if(!e||!e.maxAge&&!t[u])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[u]&&r>t[u]},b=t=>{if(t[o]>t[i])for(let e=t[f].tail;t[o]>t[i]&&null!==e;){const r=e.prev;y(t,e),e=r}},y=(t,e)=>{if(e){const r=e.value;t[h]&&t[h](r.key,r.value),t[o]-=r.length,t[l].delete(r.key),t[f].removeNode(e)}};class v{constructor(t,e,r,n,i){this.key=t,this.value=e,this.length=r,this.now=n,this.maxAge=i||0}}const w=(t,e,r,n)=>{let i=r.value;g(t,i)&&(y(t,r),t[a]||(i=void 0)),i&&e.call(n,i.value,i.key,t)};t.exports=class{constructor(t){if("number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[i]=t.max||1/0;const e=t.length||p;if(this[s]="function"!=typeof e?p:e,this[a]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[u]=t.maxAge||0,this[h]=t.dispose,this[c]=t.noDisposeOnSet||!1,this[d]=t.updateAgeOnGet||!1,this.reset()}set max(t){if("number"!=typeof t||t<0)throw new TypeError("max must be a non-negative number");this[i]=t||1/0,b(this)}get max(){return this[i]}set allowStale(t){this[a]=!!t}get allowStale(){return this[a]}set maxAge(t){if("number"!=typeof t)throw new TypeError("maxAge must be a non-negative number");this[u]=t,b(this)}get maxAge(){return this[u]}set lengthCalculator(t){"function"!=typeof t&&(t=p),t!==this[s]&&(this[s]=t,this[o]=0,this[f].forEach((t=>{t.length=this[s](t.value,t.key),this[o]+=t.length}))),b(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[f].length}rforEach(t,e){e=e||this;for(let r=this[f].tail;null!==r;){const n=r.prev;w(this,t,r,e),r=n}}forEach(t,e){e=e||this;for(let r=this[f].head;null!==r;){const n=r.next;w(this,t,r,e),r=n}}keys(){return this[f].toArray().map((t=>t.key))}values(){return this[f].toArray().map((t=>t.value))}reset(){this[h]&&this[f]&&this[f].length&&this[f].forEach((t=>this[h](t.key,t.value))),this[l]=new Map,this[f]=new n,this[o]=0}dump(){return this[f].map((t=>!g(this,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)})).toArray().filter((t=>t))}dumpLru(){return this[f]}set(t,e,r){if((r=r||this[u])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[s](e,t);if(this[l].has(t)){if(a>this[i])return y(this,this[l].get(t)),!1;const s=this[l].get(t).value;return this[h]&&(this[c]||this[h](t,s.value)),s.now=n,s.maxAge=r,s.value=e,this[o]+=a-s.length,s.length=a,this.get(t),b(this),!0}const d=new v(t,e,a,n,r);return d.length>this[i]?(this[h]&&this[h](t,e),!1):(this[o]+=d.length,this[f].unshift(d),this[l].set(t,this[f].head),b(this),!0)}has(t){if(!this[l].has(t))return!1;const e=this[l].get(t).value;return!g(this,e)}get(t){return m(this,t,!0)}peek(t){return m(this,t,!1)}pop(){const t=this[f].tail;return t?(y(this,t),t.value):null}del(t){y(this,this[l].get(t))}load(t){this.reset();const e=Date.now();for(let r=t.length-1;r>=0;r--){const n=t[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const t=i-e;t>0&&this.set(n.k,n.v,t)}}}prune(){this[l].forEach(((t,e)=>m(this,e,!1)))}}},995:(t,e,r)=>{const n=r(9106);t.exports=(t,e,r)=>n(t,e,">",r)},2013:(t,e,r)=>{const n=r(6843);t.exports=(t,e,r)=>(t=new n(t,r),e=new n(e,r),t.intersects(e,r))},7805:(t,e,r)=>{const n=r(9106);t.exports=(t,e,r)=>n(t,e,"<",r)},3727:(t,e,r)=>{const n=r(2435),i=r(6843);t.exports=(t,e,r)=>{let o=null,s=null,a=null;try{a=new i(e,r)}catch(t){return null}return t.forEach((t=>{a.test(t)&&(o&&-1!==s.compare(t)||(o=t,s=new n(o,r)))})),o}},4338:(t,e,r)=>{const n=r(2435),i=r(6843);t.exports=(t,e,r)=>{let o=null,s=null,a=null;try{a=new i(e,r)}catch(t){return null}return t.forEach((t=>{a.test(t)&&(o&&1!==s.compare(t)||(o=t,s=new n(o,r)))})),o}},1542:(t,e,r)=>{const n=r(2435),i=r(6843),o=r(6379);t.exports=(t,e)=>{t=new i(t,e);let r=new n("0.0.0");if(t.test(r))return r;if(r=new n("0.0.0-0"),t.test(r))return r;r=null;for(let e=0;e<t.set.length;++e){const i=t.set[e];let s=null;i.forEach((t=>{const e=new n(t.semver.version);switch(t.operator){case">":0===e.prerelease.length?e.patch++:e.prerelease.push(0),e.raw=e.format();case"":case">=":s&&!o(e,s)||(s=e);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${t.operator}`)}})),!s||r&&!o(r,s)||(r=s)}return r&&t.test(r)?r:null}},9106:(t,e,r)=>{const n=r(2435),i=r(7847),{ANY:o}=i,s=r(6843),a=r(9844),u=r(6379),h=r(1897),c=r(506),f=r(8463);t.exports=(t,e,r,l)=>{let d,p,m,g,b;switch(t=new n(t,l),e=new s(e,l),r){case">":d=u,p=c,m=h,g=">",b=">=";break;case"<":d=h,p=f,m=u,g="<",b="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(t,e,l))return!1;for(let r=0;r<e.set.length;++r){const n=e.set[r];let s=null,a=null;if(n.forEach((t=>{t.semver===o&&(t=new i(">=0.0.0")),s=s||t,a=a||t,d(t.semver,s.semver,l)?s=t:m(t.semver,a.semver,l)&&(a=t)})),s.operator===g||s.operator===b)return!1;if((!a.operator||a.operator===g)&&p(t,a.semver))return!1;if(a.operator===b&&m(t,a.semver))return!1}return!0}},1338:(t,e,r)=>{const n=r(9844),i=r(2271);t.exports=(t,e,r)=>{const o=[];let s=null,a=null;const u=t.sort(((t,e)=>i(t,e,r)));for(const t of u){n(t,e,r)?(a=t,s||(s=t)):(a&&o.push([s,a]),a=null,s=null)}s&&o.push([s,null]);const h=[];for(const[t,e]of o)t===e?h.push(t):e||t!==u[0]?e?t===u[0]?h.push(`<=${e}`):h.push(`${t} - ${e}`):h.push(`>=${t}`):h.push("*");const c=h.join(" || "),f="string"==typeof e.raw?e.raw:String(e);return c.length<f.length?c:e}},3122:(t,e,r)=>{const n=r(6843),i=r(7847),{ANY:o}=i,s=r(9844),a=r(2271),u=[new i(">=0.0.0-0")],h=[new i(">=0.0.0")],c=(t,e,r)=>{if(t===e)return!0;if(1===t.length&&t[0].semver===o){if(1===e.length&&e[0].semver===o)return!0;t=r.includePrerelease?u:h}if(1===e.length&&e[0].semver===o){if(r.includePrerelease)return!0;e=h}const n=new Set;let i,c,d,p,m,g,b;for(const e of t)">"===e.operator||">="===e.operator?i=f(i,e,r):"<"===e.operator||"<="===e.operator?c=l(c,e,r):n.add(e.semver);if(n.size>1)return null;if(i&&c){if(d=a(i.semver,c.semver,r),d>0)return null;if(0===d&&(">="!==i.operator||"<="!==c.operator))return null}for(const t of n){if(i&&!s(t,String(i),r))return null;if(c&&!s(t,String(c),r))return null;for(const n of e)if(!s(t,String(n),r))return!1;return!0}let y=!(!c||r.includePrerelease||!c.semver.prerelease.length)&&c.semver,v=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver;y&&1===y.prerelease.length&&"<"===c.operator&&0===y.prerelease[0]&&(y=!1);for(const t of e){if(b=b||">"===t.operator||">="===t.operator,g=g||"<"===t.operator||"<="===t.operator,i)if(v&&t.semver.prerelease&&t.semver.prerelease.length&&t.semver.major===v.major&&t.semver.minor===v.minor&&t.semver.patch===v.patch&&(v=!1),">"===t.operator||">="===t.operator){if(p=f(i,t,r),p===t&&p!==i)return!1}else if(">="===i.operator&&!s(i.semver,String(t),r))return!1;if(c)if(y&&t.semver.prerelease&&t.semver.prerelease.length&&t.semver.major===y.major&&t.semver.minor===y.minor&&t.semver.patch===y.patch&&(y=!1),"<"===t.operator||"<="===t.operator){if(m=l(c,t,r),m===t&&m!==c)return!1}else if("<="===c.operator&&!s(c.semver,String(t),r))return!1;if(!t.operator&&(c||i)&&0!==d)return!1}return!(i&&g&&!c&&0!==d)&&(!(c&&b&&!i&&0!==d)&&(!v&&!y))},f=(t,e,r)=>{if(!t)return e;const n=a(t.semver,e.semver,r);return n>0?t:n<0||">"===e.operator&&">="===t.operator?e:t},l=(t,e,r)=>{if(!t)return e;const n=a(t.semver,e.semver,r);return n<0?t:n>0||"<"===e.operator&&"<="===t.operator?e:t};t.exports=(t,e,r={})=>{if(t===e)return!0;t=new n(t,r),e=new n(e,r);let i=!1;t:for(const n of t.set){for(const t of e.set){const e=c(n,t,r);if(i=i||null!==e,e)continue t}if(i)return!1}return!0}},8865:(t,e,r)=>{const n=r(6843);t.exports=(t,e)=>new n(t,e).set.map((t=>t.map((t=>t.value)).join(" ").trim().split(" ")))},6240:(t,e,r)=>{const n=r(6843);t.exports=(t,e)=>{try{return new n(t,e).range||"*"}catch(t){return null}}},3327:(t,e,r)=>{var n=r(7834).Buffer;function i(t,e){this._block=n.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=n.from(t,e));for(var r=this._block,i=this._blockSize,o=t.length,s=this._len,a=0;a<o;){for(var u=s%i,h=Math.min(o-a,i-u),c=0;c<h;c++)r[u+c]=t[a+c];a+=h,(s+=h)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},9065:(t,e,r)=>{var n=t.exports=function(t){t=t.toLowerCase();var e=n[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};n.sha=r(8820),n.sha1=r(7885),n.sha224=r(8321),n.sha256=r(4424),n.sha384=r(213),n.sha512=r(5596)},8820:(t,e,r)=>{var n=r(1285),i=r(3327),o=r(7834).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,i.call(this,64,56)}function h(t){return t<<30|t>>>2}function c(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,f=0;f<16;++f)r[f]=t.readInt32BE(4*f);for(;f<80;++f)r[f]=r[f-3]^r[f-8]^r[f-14]^r[f-16];for(var l=0;l<80;++l){var d=~~(l/20),p=0|((e=n)<<5|e>>>27)+c(d,i,o,a)+u+r[l]+s[d];u=a,a=o,o=h(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},7885:(t,e,r)=>{var n=r(1285),i=r(3327),o=r(7834).Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,i.call(this,64,56)}function h(t){return t<<5|t>>>27}function c(t){return t<<30|t>>>2}function f(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=(e=r[l-3]^r[l-8]^r[l-14]^r[l-16])<<1|e>>>31;for(var d=0;d<80;++d){var p=~~(d/20),m=h(n)+f(p,i,o,a)+u+r[d]+s[p]|0;u=a,a=o,o=c(i),i=n,n=m}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=u},8321:(t,e,r)=>{var n=r(1285),i=r(4424),o=r(3327),s=r(7834).Buffer,a=new Array(64);function u(){this.init(),this._w=a,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var t=s.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=u},4424:(t,e,r)=>{var n=r(1285),i=r(3327),o=r(7834).Buffer,s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function u(){this.init(),this._w=a,i.call(this,64,56)}function h(t,e,r){return r^t&(e^r)}function c(t,e,r){return t&e|r&(t|e)}function f(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function l(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,p=0|this._f,m=0|this._g,g=0|this._h,b=0;b<16;++b)r[b]=t.readInt32BE(4*b);for(;b<64;++b)r[b]=0|(((e=r[b-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[b-7]+d(r[b-15])+r[b-16];for(var y=0;y<64;++y){var v=g+l(u)+h(u,p,m)+s[y]+r[y]|0,w=f(n)+c(n,i,o)|0;g=m,m=p,p=u,u=a+v|0,a=o,o=i,i=n,n=v+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0},u.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=u},213:(t,e,r)=>{var n=r(1285),i=r(5596),o=r(3327),s=r(7834).Buffer,a=new Array(160);function u(){this.init(),this._w=a,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var t=s.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=u},5596:(t,e,r)=>{var n=r(1285),i=r(3327),o=r(7834).Buffer,s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function u(){this.init(),this._w=a,i.call(this,128,112)}function h(t,e,r){return r^t&(e^r)}function c(t,e,r){return t&e|r&(t|e)}function f(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function l(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function g(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function b(t,e){return t>>>0<e>>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,u=0|this._fh,y=0|this._gh,v=0|this._hh,w=0|this._al,M=0|this._bl,E=0|this._cl,S=0|this._dl,_=0|this._el,k=0|this._fl,A=0|this._gl,x=0|this._hl,I=0;I<32;I+=2)e[I]=t.readInt32BE(4*I),e[I+1]=t.readInt32BE(4*I+4);for(;I<160;I+=2){var B=e[I-30],T=e[I-30+1],P=d(B,T),C=p(T,B),R=m(B=e[I-4],T=e[I-4+1]),O=g(T,B),L=e[I-14],N=e[I-14+1],j=e[I-32],H=e[I-32+1],D=C+N|0,U=P+L+b(D,C)|0;U=(U=U+R+b(D=D+O|0,O)|0)+j+b(D=D+H|0,H)|0,e[I]=U,e[I+1]=D}for(var F=0;F<160;F+=2){U=e[F],D=e[F+1];var $=c(r,n,i),q=c(w,M,E),z=f(r,w),G=f(w,r),V=l(a,_),J=l(_,a),K=s[F],W=s[F+1],Z=h(a,u,y),X=h(_,k,A),Y=x+J|0,Q=v+V+b(Y,x)|0;Q=(Q=(Q=Q+Z+b(Y=Y+X|0,X)|0)+K+b(Y=Y+W|0,W)|0)+U+b(Y=Y+D|0,D)|0;var tt=G+q|0,et=z+$+b(tt,G)|0;v=y,x=A,y=u,A=k,u=a,k=_,a=o+Q+b(_=S+Y|0,S)|0,o=i,S=E,i=n,E=M,n=r,M=w,r=Q+et+b(w=Y+tt|0,Y)|0}this._al=this._al+w|0,this._bl=this._bl+M|0,this._cl=this._cl+E|0,this._dl=this._dl+S|0,this._el=this._el+_|0,this._fl=this._fl+k|0,this._gl=this._gl+A|0,this._hl=this._hl+x|0,this._ah=this._ah+r+b(this._al,w)|0,this._bh=this._bh+n+b(this._bl,M)|0,this._ch=this._ch+i+b(this._cl,E)|0,this._dh=this._dh+o+b(this._dl,S)|0,this._eh=this._eh+a+b(this._el,_)|0,this._fh=this._fh+u+b(this._fl,k)|0,this._gh=this._gh+y+b(this._gl,A)|0,this._hh=this._hh+v+b(this._hl,x)|0},u.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=u},4294:(t,e,r)=>{"use strict";var n=r(7286),i=r(2680),o=r(9500),s=n("%TypeError%"),a=n("%WeakMap%",!0),u=n("%Map%",!0),h=i("WeakMap.prototype.get",!0),c=i("WeakMap.prototype.set",!0),f=i("WeakMap.prototype.has",!0),l=i("Map.prototype.get",!0),d=i("Map.prototype.set",!0),p=i("Map.prototype.has",!0),m=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new s("Side channel does not contain "+o(t))},get:function(n){if(a&&n&&("object"==typeof n||"function"==typeof n)){if(t)return h(t,n)}else if(u){if(e)return l(e,n)}else if(r)return function(t,e){var r=m(t,e);return r&&r.value}(r,n)},has:function(n){if(a&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(u){if(e)return p(e,n)}else if(r)return function(t,e){return!!m(t,e)}(r,n);return!1},set:function(n,i){a&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new a),c(t,n,i)):u?(e||(e=new u),d(e,n,i)):(r||(r={key:{},next:null}),function(t,e,r){var n=m(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,i))}};return n}},4851:(t,e,r)=>{t.exports=i;var n=r(2699).EventEmitter;function i(){n.call(this)}r(1285)(i,n),i.Readable=r(8051),i.Writable=r(2557),i.Duplex=r(7073),i.Transform=r(7640),i.PassThrough=r(5163),i.finished=r(9885),i.pipeline=r(3495),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",u));var s=!1;function a(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function h(t){if(c(),0===n.listenerCount(this,"error"))throw t}function c(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",u),r.removeListener("error",h),t.removeListener("error",h),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return r.on("error",h),t.on("error",h),r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t}},214:(t,e,r)=>{"use strict";var n=r(7834).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=h,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=c,this.end=f,e=3;break;default:return this.write=l,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function h(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function c(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var i=s(e[n]);if(i>=0)return i>0&&(t.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if(i=s(e[n]),i>=0)return i>0&&(t.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if(i=s(e[n]),i>=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},717:(t,e,r)=>{!function(t){"use strict";var e=function(t){var e,r=new Float64Array(16);if(t)for(e=0;e<t.length;e++)r[e]=t[e];return r},n=function(){throw new Error("no PRNG")},i=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var s=e(),a=e([1]),u=e([56129,1]),h=e([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),c=e([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),f=e([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),l=e([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),d=e([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(t,e,r,n){t[e]=r>>24&255,t[e+1]=r>>16&255,t[e+2]=r>>8&255,t[e+3]=255&r,t[e+4]=n>>24&255,t[e+5]=n>>16&255,t[e+6]=n>>8&255,t[e+7]=255&n}function m(t,e,r,n,i){var o,s=0;for(o=0;o<i;o++)s|=t[e+o]^r[n+o];return(1&s-1>>>8)-1}function g(t,e,r,n){return m(t,e,r,n,16)}function b(t,e,r,n){return m(t,e,r,n,32)}function y(t,e,r,n){!function(t,e,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,h=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,c=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,l=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,d=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,p=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,m=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,b=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,y=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,M=o,E=s,S=a,_=u,k=h,A=c,x=f,I=l,B=d,T=p,P=m,C=g,R=b,O=y,L=v,N=w,j=0;j<20;j+=2)M^=(i=(R^=(i=(B^=(i=(k^=(i=M+R|0)<<7|i>>>25)+M|0)<<9|i>>>23)+k|0)<<13|i>>>19)+B|0)<<18|i>>>14,A^=(i=(E^=(i=(O^=(i=(T^=(i=A+E|0)<<7|i>>>25)+A|0)<<9|i>>>23)+T|0)<<13|i>>>19)+O|0)<<18|i>>>14,P^=(i=(x^=(i=(S^=(i=(L^=(i=P+x|0)<<7|i>>>25)+P|0)<<9|i>>>23)+L|0)<<13|i>>>19)+S|0)<<18|i>>>14,N^=(i=(C^=(i=(I^=(i=(_^=(i=N+C|0)<<7|i>>>25)+N|0)<<9|i>>>23)+_|0)<<13|i>>>19)+I|0)<<18|i>>>14,M^=(i=(_^=(i=(S^=(i=(E^=(i=M+_|0)<<7|i>>>25)+M|0)<<9|i>>>23)+E|0)<<13|i>>>19)+S|0)<<18|i>>>14,A^=(i=(k^=(i=(I^=(i=(x^=(i=A+k|0)<<7|i>>>25)+A|0)<<9|i>>>23)+x|0)<<13|i>>>19)+I|0)<<18|i>>>14,P^=(i=(T^=(i=(B^=(i=(C^=(i=P+T|0)<<7|i>>>25)+P|0)<<9|i>>>23)+C|0)<<13|i>>>19)+B|0)<<18|i>>>14,N^=(i=(L^=(i=(O^=(i=(R^=(i=N+L|0)<<7|i>>>25)+N|0)<<9|i>>>23)+R|0)<<13|i>>>19)+O|0)<<18|i>>>14;M=M+o|0,E=E+s|0,S=S+a|0,_=_+u|0,k=k+h|0,A=A+c|0,x=x+f|0,I=I+l|0,B=B+d|0,T=T+p|0,P=P+m|0,C=C+g|0,R=R+b|0,O=O+y|0,L=L+v|0,N=N+w|0,t[0]=M>>>0&255,t[1]=M>>>8&255,t[2]=M>>>16&255,t[3]=M>>>24&255,t[4]=E>>>0&255,t[5]=E>>>8&255,t[6]=E>>>16&255,t[7]=E>>>24&255,t[8]=S>>>0&255,t[9]=S>>>8&255,t[10]=S>>>16&255,t[11]=S>>>24&255,t[12]=_>>>0&255,t[13]=_>>>8&255,t[14]=_>>>16&255,t[15]=_>>>24&255,t[16]=k>>>0&255,t[17]=k>>>8&255,t[18]=k>>>16&255,t[19]=k>>>24&255,t[20]=A>>>0&255,t[21]=A>>>8&255,t[22]=A>>>16&255,t[23]=A>>>24&255,t[24]=x>>>0&255,t[25]=x>>>8&255,t[26]=x>>>16&255,t[27]=x>>>24&255,t[28]=I>>>0&255,t[29]=I>>>8&255,t[30]=I>>>16&255,t[31]=I>>>24&255,t[32]=B>>>0&255,t[33]=B>>>8&255,t[34]=B>>>16&255,t[35]=B>>>24&255,t[36]=T>>>0&255,t[37]=T>>>8&255,t[38]=T>>>16&255,t[39]=T>>>24&255,t[40]=P>>>0&255,t[41]=P>>>8&255,t[42]=P>>>16&255,t[43]=P>>>24&255,t[44]=C>>>0&255,t[45]=C>>>8&255,t[46]=C>>>16&255,t[47]=C>>>24&255,t[48]=R>>>0&255,t[49]=R>>>8&255,t[50]=R>>>16&255,t[51]=R>>>24&255,t[52]=O>>>0&255,t[53]=O>>>8&255,t[54]=O>>>16&255,t[55]=O>>>24&255,t[56]=L>>>0&255,t[57]=L>>>8&255,t[58]=L>>>16&255,t[59]=L>>>24&255,t[60]=N>>>0&255,t[61]=N>>>8&255,t[62]=N>>>16&255,t[63]=N>>>24&255}(t,e,r,n)}function v(t,e,r,n){!function(t,e,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,a=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,u=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,h=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,c=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,l=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,d=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,p=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,m=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,b=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,y=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,v=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,w=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,M=0;M<20;M+=2)o^=(i=(b^=(i=(d^=(i=(h^=(i=o+b|0)<<7|i>>>25)+o|0)<<9|i>>>23)+h|0)<<13|i>>>19)+d|0)<<18|i>>>14,c^=(i=(s^=(i=(y^=(i=(p^=(i=c+s|0)<<7|i>>>25)+c|0)<<9|i>>>23)+p|0)<<13|i>>>19)+y|0)<<18|i>>>14,m^=(i=(f^=(i=(a^=(i=(v^=(i=m+f|0)<<7|i>>>25)+m|0)<<9|i>>>23)+v|0)<<13|i>>>19)+a|0)<<18|i>>>14,w^=(i=(g^=(i=(l^=(i=(u^=(i=w+g|0)<<7|i>>>25)+w|0)<<9|i>>>23)+u|0)<<13|i>>>19)+l|0)<<18|i>>>14,o^=(i=(u^=(i=(a^=(i=(s^=(i=o+u|0)<<7|i>>>25)+o|0)<<9|i>>>23)+s|0)<<13|i>>>19)+a|0)<<18|i>>>14,c^=(i=(h^=(i=(l^=(i=(f^=(i=c+h|0)<<7|i>>>25)+c|0)<<9|i>>>23)+f|0)<<13|i>>>19)+l|0)<<18|i>>>14,m^=(i=(p^=(i=(d^=(i=(g^=(i=m+p|0)<<7|i>>>25)+m|0)<<9|i>>>23)+g|0)<<13|i>>>19)+d|0)<<18|i>>>14,w^=(i=(v^=(i=(y^=(i=(b^=(i=w+v|0)<<7|i>>>25)+w|0)<<9|i>>>23)+b|0)<<13|i>>>19)+y|0)<<18|i>>>14;t[0]=o>>>0&255,t[1]=o>>>8&255,t[2]=o>>>16&255,t[3]=o>>>24&255,t[4]=c>>>0&255,t[5]=c>>>8&255,t[6]=c>>>16&255,t[7]=c>>>24&255,t[8]=m>>>0&255,t[9]=m>>>8&255,t[10]=m>>>16&255,t[11]=m>>>24&255,t[12]=w>>>0&255,t[13]=w>>>8&255,t[14]=w>>>16&255,t[15]=w>>>24&255,t[16]=f>>>0&255,t[17]=f>>>8&255,t[18]=f>>>16&255,t[19]=f>>>24&255,t[20]=l>>>0&255,t[21]=l>>>8&255,t[22]=l>>>16&255,t[23]=l>>>24&255,t[24]=d>>>0&255,t[25]=d>>>8&255,t[26]=d>>>16&255,t[27]=d>>>24&255,t[28]=p>>>0&255,t[29]=p>>>8&255,t[30]=p>>>16&255,t[31]=p>>>24&255}(t,e,r,n)}var w=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function M(t,e,r,n,i,o,s){var a,u,h=new Uint8Array(16),c=new Uint8Array(64);for(u=0;u<16;u++)h[u]=0;for(u=0;u<8;u++)h[u]=o[u];for(;i>=64;){for(y(c,h,s,w),u=0;u<64;u++)t[e+u]=r[n+u]^c[u];for(a=1,u=8;u<16;u++)a=a+(255&h[u])|0,h[u]=255&a,a>>>=8;i-=64,e+=64,n+=64}if(i>0)for(y(c,h,s,w),u=0;u<i;u++)t[e+u]=r[n+u]^c[u];return 0}function E(t,e,r,n,i){var o,s,a=new Uint8Array(16),u=new Uint8Array(64);for(s=0;s<16;s++)a[s]=0;for(s=0;s<8;s++)a[s]=n[s];for(;r>=64;){for(y(u,a,i,w),s=0;s<64;s++)t[e+s]=u[s];for(o=1,s=8;s<16;s++)o=o+(255&a[s])|0,a[s]=255&o,o>>>=8;r-=64,e+=64}if(r>0)for(y(u,a,i,w),s=0;s<r;s++)t[e+s]=u[s];return 0}function S(t,e,r,n,i){var o=new Uint8Array(32);v(o,n,i,w);for(var s=new Uint8Array(8),a=0;a<8;a++)s[a]=n[a+16];return E(t,e,r,s,o)}function _(t,e,r,n,i,o,s){var a=new Uint8Array(32);v(a,o,s,w);for(var u=new Uint8Array(8),h=0;h<8;h++)u[h]=o[h+16];return M(t,e,r,n,i,u,a)}var k=function(t){var e,r,n,i,o,s,a,u;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,e=255&t[0]|(255&t[1])<<8,this.r[0]=8191&e,r=255&t[2]|(255&t[3])<<8,this.r[1]=8191&(e>>>13|r<<3),n=255&t[4]|(255&t[5])<<8,this.r[2]=7939&(r>>>10|n<<6),i=255&t[6]|(255&t[7])<<8,this.r[3]=8191&(n>>>7|i<<9),o=255&t[8]|(255&t[9])<<8,this.r[4]=255&(i>>>4|o<<12),this.r[5]=o>>>1&8190,s=255&t[10]|(255&t[11])<<8,this.r[6]=8191&(o>>>14|s<<2),a=255&t[12]|(255&t[13])<<8,this.r[7]=8065&(s>>>11|a<<5),u=255&t[14]|(255&t[15])<<8,this.r[8]=8191&(a>>>8|u<<8),this.r[9]=u>>>5&127,this.pad[0]=255&t[16]|(255&t[17])<<8,this.pad[1]=255&t[18]|(255&t[19])<<8,this.pad[2]=255&t[20]|(255&t[21])<<8,this.pad[3]=255&t[22]|(255&t[23])<<8,this.pad[4]=255&t[24]|(255&t[25])<<8,this.pad[5]=255&t[26]|(255&t[27])<<8,this.pad[6]=255&t[28]|(255&t[29])<<8,this.pad[7]=255&t[30]|(255&t[31])<<8};function A(t,e,r,n,i,o){var s=new k(o);return s.update(r,n,i),s.finish(t,e),0}function x(t,e,r,n,i,o){var s=new Uint8Array(16);return A(s,0,r,n,i,o),g(t,e,s,0)}function I(t,e,r,n,i){var o;if(r<32)return-1;for(_(t,0,e,0,r,n,i),A(t,16,t,32,r-32,t),o=0;o<16;o++)t[o]=0;return 0}function B(t,e,r,n,i){var o,s=new Uint8Array(32);if(r<32)return-1;if(S(s,0,32,n,i),0!==x(e,16,e,32,r-32,s))return-1;for(_(t,0,e,0,r,n,i),o=0;o<32;o++)t[o]=0;return 0}function T(t,e){var r;for(r=0;r<16;r++)t[r]=0|e[r]}function P(t){var e,r,n=1;for(e=0;e<16;e++)r=t[e]+n+65535,n=Math.floor(r/65536),t[e]=r-65536*n;t[0]+=n-1+37*(n-1)}function C(t,e,r){for(var n,i=~(r-1),o=0;o<16;o++)n=i&(t[o]^e[o]),t[o]^=n,e[o]^=n}function R(t,r){var n,i,o,s=e(),a=e();for(n=0;n<16;n++)a[n]=r[n];for(P(a),P(a),P(a),i=0;i<2;i++){for(s[0]=a[0]-65517,n=1;n<15;n++)s[n]=a[n]-65535-(s[n-1]>>16&1),s[n-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),o=s[15]>>16&1,s[14]&=65535,C(a,s,1-o)}for(n=0;n<16;n++)t[2*n]=255&a[n],t[2*n+1]=a[n]>>8}function O(t,e){var r=new Uint8Array(32),n=new Uint8Array(32);return R(r,t),R(n,e),b(r,0,n,0)}function L(t){var e=new Uint8Array(32);return R(e,t),1&e[0]}function N(t,e){var r;for(r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}function j(t,e,r){for(var n=0;n<16;n++)t[n]=e[n]+r[n]}function H(t,e,r){for(var n=0;n<16;n++)t[n]=e[n]-r[n]}function D(t,e,r){var n,i,o=0,s=0,a=0,u=0,h=0,c=0,f=0,l=0,d=0,p=0,m=0,g=0,b=0,y=0,v=0,w=0,M=0,E=0,S=0,_=0,k=0,A=0,x=0,I=0,B=0,T=0,P=0,C=0,R=0,O=0,L=0,N=r[0],j=r[1],H=r[2],D=r[3],U=r[4],F=r[5],$=r[6],q=r[7],z=r[8],G=r[9],V=r[10],J=r[11],K=r[12],W=r[13],Z=r[14],X=r[15];o+=(n=e[0])*N,s+=n*j,a+=n*H,u+=n*D,h+=n*U,c+=n*F,f+=n*$,l+=n*q,d+=n*z,p+=n*G,m+=n*V,g+=n*J,b+=n*K,y+=n*W,v+=n*Z,w+=n*X,s+=(n=e[1])*N,a+=n*j,u+=n*H,h+=n*D,c+=n*U,f+=n*F,l+=n*$,d+=n*q,p+=n*z,m+=n*G,g+=n*V,b+=n*J,y+=n*K,v+=n*W,w+=n*Z,M+=n*X,a+=(n=e[2])*N,u+=n*j,h+=n*H,c+=n*D,f+=n*U,l+=n*F,d+=n*$,p+=n*q,m+=n*z,g+=n*G,b+=n*V,y+=n*J,v+=n*K,w+=n*W,M+=n*Z,E+=n*X,u+=(n=e[3])*N,h+=n*j,c+=n*H,f+=n*D,l+=n*U,d+=n*F,p+=n*$,m+=n*q,g+=n*z,b+=n*G,y+=n*V,v+=n*J,w+=n*K,M+=n*W,E+=n*Z,S+=n*X,h+=(n=e[4])*N,c+=n*j,f+=n*H,l+=n*D,d+=n*U,p+=n*F,m+=n*$,g+=n*q,b+=n*z,y+=n*G,v+=n*V,w+=n*J,M+=n*K,E+=n*W,S+=n*Z,_+=n*X,c+=(n=e[5])*N,f+=n*j,l+=n*H,d+=n*D,p+=n*U,m+=n*F,g+=n*$,b+=n*q,y+=n*z,v+=n*G,w+=n*V,M+=n*J,E+=n*K,S+=n*W,_+=n*Z,k+=n*X,f+=(n=e[6])*N,l+=n*j,d+=n*H,p+=n*D,m+=n*U,g+=n*F,b+=n*$,y+=n*q,v+=n*z,w+=n*G,M+=n*V,E+=n*J,S+=n*K,_+=n*W,k+=n*Z,A+=n*X,l+=(n=e[7])*N,d+=n*j,p+=n*H,m+=n*D,g+=n*U,b+=n*F,y+=n*$,v+=n*q,w+=n*z,M+=n*G,E+=n*V,S+=n*J,_+=n*K,k+=n*W,A+=n*Z,x+=n*X,d+=(n=e[8])*N,p+=n*j,m+=n*H,g+=n*D,b+=n*U,y+=n*F,v+=n*$,w+=n*q,M+=n*z,E+=n*G,S+=n*V,_+=n*J,k+=n*K,A+=n*W,x+=n*Z,I+=n*X,p+=(n=e[9])*N,m+=n*j,g+=n*H,b+=n*D,y+=n*U,v+=n*F,w+=n*$,M+=n*q,E+=n*z,S+=n*G,_+=n*V,k+=n*J,A+=n*K,x+=n*W,I+=n*Z,B+=n*X,m+=(n=e[10])*N,g+=n*j,b+=n*H,y+=n*D,v+=n*U,w+=n*F,M+=n*$,E+=n*q,S+=n*z,_+=n*G,k+=n*V,A+=n*J,x+=n*K,I+=n*W,B+=n*Z,T+=n*X,g+=(n=e[11])*N,b+=n*j,y+=n*H,v+=n*D,w+=n*U,M+=n*F,E+=n*$,S+=n*q,_+=n*z,k+=n*G,A+=n*V,x+=n*J,I+=n*K,B+=n*W,T+=n*Z,P+=n*X,b+=(n=e[12])*N,y+=n*j,v+=n*H,w+=n*D,M+=n*U,E+=n*F,S+=n*$,_+=n*q,k+=n*z,A+=n*G,x+=n*V,I+=n*J,B+=n*K,T+=n*W,P+=n*Z,C+=n*X,y+=(n=e[13])*N,v+=n*j,w+=n*H,M+=n*D,E+=n*U,S+=n*F,_+=n*$,k+=n*q,A+=n*z,x+=n*G,I+=n*V,B+=n*J,T+=n*K,P+=n*W,C+=n*Z,R+=n*X,v+=(n=e[14])*N,w+=n*j,M+=n*H,E+=n*D,S+=n*U,_+=n*F,k+=n*$,A+=n*q,x+=n*z,I+=n*G,B+=n*V,T+=n*J,P+=n*K,C+=n*W,R+=n*Z,O+=n*X,w+=(n=e[15])*N,s+=38*(E+=n*H),a+=38*(S+=n*D),u+=38*(_+=n*U),h+=38*(k+=n*F),c+=38*(A+=n*$),f+=38*(x+=n*q),l+=38*(I+=n*z),d+=38*(B+=n*G),p+=38*(T+=n*V),m+=38*(P+=n*J),g+=38*(C+=n*K),b+=38*(R+=n*W),y+=38*(O+=n*Z),v+=38*(L+=n*X),o=(n=(o+=38*(M+=n*j))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o+=i-1+37*(i-1),t[0]=o,t[1]=s,t[2]=a,t[3]=u,t[4]=h,t[5]=c,t[6]=f,t[7]=l,t[8]=d,t[9]=p,t[10]=m,t[11]=g,t[12]=b,t[13]=y,t[14]=v,t[15]=w}function U(t,e){D(t,e,e)}function F(t,r){var n,i=e();for(n=0;n<16;n++)i[n]=r[n];for(n=253;n>=0;n--)U(i,i),2!==n&&4!==n&&D(i,i,r);for(n=0;n<16;n++)t[n]=i[n]}function $(t,r){var n,i=e();for(n=0;n<16;n++)i[n]=r[n];for(n=250;n>=0;n--)U(i,i),1!==n&&D(i,i,r);for(n=0;n<16;n++)t[n]=i[n]}function q(t,r,n){var i,o,s=new Uint8Array(32),a=new Float64Array(80),h=e(),c=e(),f=e(),l=e(),d=e(),p=e();for(o=0;o<31;o++)s[o]=r[o];for(s[31]=127&r[31]|64,s[0]&=248,N(a,n),o=0;o<16;o++)c[o]=a[o],l[o]=h[o]=f[o]=0;for(h[0]=l[0]=1,o=254;o>=0;--o)C(h,c,i=s[o>>>3]>>>(7&o)&1),C(f,l,i),j(d,h,f),H(h,h,f),j(f,c,l),H(c,c,l),U(l,d),U(p,h),D(h,f,h),D(f,c,d),j(d,h,f),H(h,h,f),U(c,h),H(f,l,p),D(h,f,u),j(h,h,l),D(f,f,h),D(h,l,p),D(l,c,a),U(c,d),C(h,c,i),C(f,l,i);for(o=0;o<16;o++)a[o+16]=h[o],a[o+32]=f[o],a[o+48]=c[o],a[o+64]=l[o];var m=a.subarray(32),g=a.subarray(16);return F(m,m),D(g,g,m),R(t,g),0}function z(t,e){return q(t,e,o)}function G(t,e){return n(e,32),z(t,e)}function V(t,e,r){var n=new Uint8Array(32);return q(n,r,e),v(t,i,n,w)}k.prototype.blocks=function(t,e,r){for(var n,i,o,s,a,u,h,c,f,l,d,p,m,g,b,y,v,w,M,E=this.fin?0:2048,S=this.h[0],_=this.h[1],k=this.h[2],A=this.h[3],x=this.h[4],I=this.h[5],B=this.h[6],T=this.h[7],P=this.h[8],C=this.h[9],R=this.r[0],O=this.r[1],L=this.r[2],N=this.r[3],j=this.r[4],H=this.r[5],D=this.r[6],U=this.r[7],F=this.r[8],$=this.r[9];r>=16;)l=f=0,l+=(S+=8191&(n=255&t[e+0]|(255&t[e+1])<<8))*R,l+=(_+=8191&(n>>>13|(i=255&t[e+2]|(255&t[e+3])<<8)<<3))*(5*$),l+=(k+=8191&(i>>>10|(o=255&t[e+4]|(255&t[e+5])<<8)<<6))*(5*F),l+=(A+=8191&(o>>>7|(s=255&t[e+6]|(255&t[e+7])<<8)<<9))*(5*U),f=(l+=(x+=8191&(s>>>4|(a=255&t[e+8]|(255&t[e+9])<<8)<<12))*(5*D))>>>13,l&=8191,l+=(I+=a>>>1&8191)*(5*H),l+=(B+=8191&(a>>>14|(u=255&t[e+10]|(255&t[e+11])<<8)<<2))*(5*j),l+=(T+=8191&(u>>>11|(h=255&t[e+12]|(255&t[e+13])<<8)<<5))*(5*N),l+=(P+=8191&(h>>>8|(c=255&t[e+14]|(255&t[e+15])<<8)<<8))*(5*L),d=f+=(l+=(C+=c>>>5|E)*(5*O))>>>13,d+=S*O,d+=_*R,d+=k*(5*$),d+=A*(5*F),f=(d+=x*(5*U))>>>13,d&=8191,d+=I*(5*D),d+=B*(5*H),d+=T*(5*j),d+=P*(5*N),f+=(d+=C*(5*L))>>>13,d&=8191,p=f,p+=S*L,p+=_*O,p+=k*R,p+=A*(5*$),f=(p+=x*(5*F))>>>13,p&=8191,p+=I*(5*U),p+=B*(5*D),p+=T*(5*H),p+=P*(5*j),m=f+=(p+=C*(5*N))>>>13,m+=S*N,m+=_*L,m+=k*O,m+=A*R,f=(m+=x*(5*$))>>>13,m&=8191,m+=I*(5*F),m+=B*(5*U),m+=T*(5*D),m+=P*(5*H),g=f+=(m+=C*(5*j))>>>13,g+=S*j,g+=_*N,g+=k*L,g+=A*O,f=(g+=x*R)>>>13,g&=8191,g+=I*(5*$),g+=B*(5*F),g+=T*(5*U),g+=P*(5*D),b=f+=(g+=C*(5*H))>>>13,b+=S*H,b+=_*j,b+=k*N,b+=A*L,f=(b+=x*O)>>>13,b&=8191,b+=I*R,b+=B*(5*$),b+=T*(5*F),b+=P*(5*U),y=f+=(b+=C*(5*D))>>>13,y+=S*D,y+=_*H,y+=k*j,y+=A*N,f=(y+=x*L)>>>13,y&=8191,y+=I*O,y+=B*R,y+=T*(5*$),y+=P*(5*F),v=f+=(y+=C*(5*U))>>>13,v+=S*U,v+=_*D,v+=k*H,v+=A*j,f=(v+=x*N)>>>13,v&=8191,v+=I*L,v+=B*O,v+=T*R,v+=P*(5*$),w=f+=(v+=C*(5*F))>>>13,w+=S*F,w+=_*U,w+=k*D,w+=A*H,f=(w+=x*j)>>>13,w&=8191,w+=I*N,w+=B*L,w+=T*O,w+=P*R,M=f+=(w+=C*(5*$))>>>13,M+=S*$,M+=_*F,M+=k*U,M+=A*D,f=(M+=x*H)>>>13,M&=8191,M+=I*j,M+=B*N,M+=T*L,M+=P*O,S=l=8191&(f=(f=((f+=(M+=C*R)>>>13)<<2)+f|0)+(l&=8191)|0),_=d+=f>>>=13,k=p&=8191,A=m&=8191,x=g&=8191,I=b&=8191,B=y&=8191,T=v&=8191,P=w&=8191,C=M&=8191,e+=16,r-=16;this.h[0]=S,this.h[1]=_,this.h[2]=k,this.h[3]=A,this.h[4]=x,this.h[5]=I,this.h[6]=B,this.h[7]=T,this.h[8]=P,this.h[9]=C},k.prototype.finish=function(t,e){var r,n,i,o,s=new Uint16Array(10);if(this.leftover){for(o=this.leftover,this.buffer[o++]=1;o<16;o++)this.buffer[o]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,o=2;o<10;o++)this.h[o]+=r,r=this.h[o]>>>13,this.h[o]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,s[0]=this.h[0]+5,r=s[0]>>>13,s[0]&=8191,o=1;o<10;o++)s[o]=this.h[o]+r,r=s[o]>>>13,s[o]&=8191;for(s[9]-=8192,n=(1^r)-1,o=0;o<10;o++)s[o]&=n;for(n=~n,o=0;o<10;o++)this.h[o]=this.h[o]&n|s[o];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),i=this.h[0]+this.pad[0],this.h[0]=65535&i,o=1;o<8;o++)i=(this.h[o]+this.pad[o]|0)+(i>>>16)|0,this.h[o]=65535&i;t[e+0]=this.h[0]>>>0&255,t[e+1]=this.h[0]>>>8&255,t[e+2]=this.h[1]>>>0&255,t[e+3]=this.h[1]>>>8&255,t[e+4]=this.h[2]>>>0&255,t[e+5]=this.h[2]>>>8&255,t[e+6]=this.h[3]>>>0&255,t[e+7]=this.h[3]>>>8&255,t[e+8]=this.h[4]>>>0&255,t[e+9]=this.h[4]>>>8&255,t[e+10]=this.h[5]>>>0&255,t[e+11]=this.h[5]>>>8&255,t[e+12]=this.h[6]>>>0&255,t[e+13]=this.h[6]>>>8&255,t[e+14]=this.h[7]>>>0&255,t[e+15]=this.h[7]>>>8&255},k.prototype.update=function(t,e,r){var n,i;if(this.leftover){for((i=16-this.leftover)>r&&(i=r),n=0;n<i;n++)this.buffer[this.leftover+n]=t[e+n];if(r-=i,e+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(r>=16&&(i=r-r%16,this.blocks(t,e,i),e+=i,r-=i),r){for(n=0;n<r;n++)this.buffer[this.leftover+n]=t[e+n];this.leftover+=r}};var J=I,K=B;var W=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Z(t,e,r,n){for(var i,o,s,a,u,h,c,f,l,d,p,m,g,b,y,v,w,M,E,S,_,k,A,x,I,B,T=new Int32Array(16),P=new Int32Array(16),C=t[0],R=t[1],O=t[2],L=t[3],N=t[4],j=t[5],H=t[6],D=t[7],U=e[0],F=e[1],$=e[2],q=e[3],z=e[4],G=e[5],V=e[6],J=e[7],K=0;n>=128;){for(E=0;E<16;E++)S=8*E+K,T[E]=r[S+0]<<24|r[S+1]<<16|r[S+2]<<8|r[S+3],P[E]=r[S+4]<<24|r[S+5]<<16|r[S+6]<<8|r[S+7];for(E=0;E<80;E++)if(i=C,o=R,s=O,a=L,u=N,h=j,c=H,D,l=U,d=F,p=$,m=q,g=z,b=G,y=V,J,A=65535&(k=J),x=k>>>16,I=65535&(_=D),B=_>>>16,A+=65535&(k=(z>>>14|N<<18)^(z>>>18|N<<14)^(N>>>9|z<<23)),x+=k>>>16,I+=65535&(_=(N>>>14|z<<18)^(N>>>18|z<<14)^(z>>>9|N<<23)),B+=_>>>16,A+=65535&(k=z&G^~z&V),x+=k>>>16,I+=65535&(_=N&j^~N&H),B+=_>>>16,_=W[2*E],A+=65535&(k=W[2*E+1]),x+=k>>>16,I+=65535&_,B+=_>>>16,_=T[E%16],x+=(k=P[E%16])>>>16,I+=65535&_,B+=_>>>16,I+=(x+=(A+=65535&k)>>>16)>>>16,A=65535&(k=M=65535&A|x<<16),x=k>>>16,I=65535&(_=w=65535&I|(B+=I>>>16)<<16),B=_>>>16,A+=65535&(k=(U>>>28|C<<4)^(C>>>2|U<<30)^(C>>>7|U<<25)),x+=k>>>16,I+=65535&(_=(C>>>28|U<<4)^(U>>>2|C<<30)^(U>>>7|C<<25)),B+=_>>>16,x+=(k=U&F^U&$^F&$)>>>16,I+=65535&(_=C&R^C&O^R&O),B+=_>>>16,f=65535&(I+=(x+=(A+=65535&k)>>>16)>>>16)|(B+=I>>>16)<<16,v=65535&A|x<<16,A=65535&(k=m),x=k>>>16,I=65535&(_=a),B=_>>>16,x+=(k=M)>>>16,I+=65535&(_=w),B+=_>>>16,R=i,O=o,L=s,N=a=65535&(I+=(x+=(A+=65535&k)>>>16)>>>16)|(B+=I>>>16)<<16,j=u,H=h,D=c,C=f,F=l,$=d,q=p,z=m=65535&A|x<<16,G=g,V=b,J=y,U=v,E%16==15)for(S=0;S<16;S++)_=T[S],A=65535&(k=P[S]),x=k>>>16,I=65535&_,B=_>>>16,_=T[(S+9)%16],A+=65535&(k=P[(S+9)%16]),x+=k>>>16,I+=65535&_,B+=_>>>16,w=T[(S+1)%16],A+=65535&(k=((M=P[(S+1)%16])>>>1|w<<31)^(M>>>8|w<<24)^(M>>>7|w<<25)),x+=k>>>16,I+=65535&(_=(w>>>1|M<<31)^(w>>>8|M<<24)^w>>>7),B+=_>>>16,w=T[(S+14)%16],x+=(k=((M=P[(S+14)%16])>>>19|w<<13)^(w>>>29|M<<3)^(M>>>6|w<<26))>>>16,I+=65535&(_=(w>>>19|M<<13)^(M>>>29|w<<3)^w>>>6),B+=_>>>16,B+=(I+=(x+=(A+=65535&k)>>>16)>>>16)>>>16,T[S]=65535&I|B<<16,P[S]=65535&A|x<<16;A=65535&(k=U),x=k>>>16,I=65535&(_=C),B=_>>>16,_=t[0],x+=(k=e[0])>>>16,I+=65535&_,B+=_>>>16,B+=(I+=(x+=(A+=65535&k)>>>16)>>>16)>>>16,t[0]=C=65535&I|B<<16,e[0]=U=65535&A|x<<16,A=65535&(k=F),x=k>>>16,I=65535&(_=R),B=_>>>16,_=t[1],x+=(k=e[1])>>>16,I+=65535&_,B+=_>>>16,B+=(I+=(x+=(A+=65535&k)>>>16)>>>16)>>>16,t[1]=R=65535&I|B<<16,e[1]=F=65535&A|x<<16,A=65535&(k=$),x=k>>>16,I=65535&(_=O),B=_>>>16,_=t[2],x+=(k=e[2])>>>16,I+=65535&_,B+=_>>>16,B+=(I+=(x+=(A+=65535&k)>>>16)>>>16)>>>16,t[2]=O=65535&I|B<<16,e[2]=$=65535&A|x<<16,A=65535&(k=q),x=k>>>16,I=65535&(_=L),B=_>>>16,_=t[3],x+=(k=e[3])>>>16,I+=65535&_,B+=_>>>16,B+=(I+=(x+=(A+=65535&k)>>>16)>>>16)>>>16,t[3]=L=65535&I|B<<16,e[3]=q=65535&A|x<<16,A=65535&(k=z),x=k>>>16,I=65535&(_=N),B=_>>>16,_=t[4],x+=(k=e[4])>>>16,I+=65535&_,B+=_>>>16,B+=(I+=(x+=(A+=65535&k)>>>16)>>>16)>>>16,t[4]=N=65535&I|B<<16,e[4]=z=65535&A|x<<16,A=65535&(k=G),x=k>>>16,I=65535&(_=j),B=_>>>16,_=t[5],x+=(k=e[5])>>>16,I+=65535&_,B+=_>>>16,B+=(I+=(x+=(A+=65535&k)>>>16)>>>16)>>>16,t[5]=j=65535&I|B<<16,e[5]=G=65535&A|x<<16,A=65535&(k=V),x=k>>>16,I=65535&(_=H),B=_>>>16,_=t[6],x+=(k=e[6])>>>16,I+=65535&_,B+=_>>>16,B+=(I+=(x+=(A+=65535&k)>>>16)>>>16)>>>16,t[6]=H=65535&I|B<<16,e[6]=V=65535&A|x<<16,A=65535&(k=J),x=k>>>16,I=65535&(_=D),B=_>>>16,_=t[7],x+=(k=e[7])>>>16,I+=65535&_,B+=_>>>16,B+=(I+=(x+=(A+=65535&k)>>>16)>>>16)>>>16,t[7]=D=65535&I|B<<16,e[7]=J=65535&A|x<<16,K+=128,n-=128}return n}function X(t,e,r){var n,i=new Int32Array(8),o=new Int32Array(8),s=new Uint8Array(256),a=r;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,Z(i,o,e,r),r%=128,n=0;n<r;n++)s[n]=e[a-r+n];for(s[r]=128,s[(r=256-128*(r<112?1:0))-9]=0,p(s,r-8,a/536870912|0,a<<3),Z(i,o,s,r),n=0;n<8;n++)p(t,8*n,i[n],o[n]);return 0}function Y(t,r){var n=e(),i=e(),o=e(),s=e(),a=e(),u=e(),h=e(),f=e(),l=e();H(n,t[1],t[0]),H(l,r[1],r[0]),D(n,n,l),j(i,t[0],t[1]),j(l,r[0],r[1]),D(i,i,l),D(o,t[3],r[3]),D(o,o,c),D(s,t[2],r[2]),j(s,s,s),H(a,i,n),H(u,s,o),j(h,s,o),j(f,i,n),D(t[0],a,u),D(t[1],f,h),D(t[2],h,u),D(t[3],a,f)}function Q(t,e,r){var n;for(n=0;n<4;n++)C(t[n],e[n],r)}function tt(t,r){var n=e(),i=e(),o=e();F(o,r[2]),D(n,r[0],o),D(i,r[1],o),R(t,i),t[31]^=L(n)<<7}function et(t,e,r){var n,i;for(T(t[0],s),T(t[1],a),T(t[2],a),T(t[3],s),i=255;i>=0;--i)Q(t,e,n=r[i/8|0]>>(7&i)&1),Y(e,t),Y(t,t),Q(t,e,n)}function rt(t,r){var n=[e(),e(),e(),e()];T(n[0],f),T(n[1],l),T(n[2],a),D(n[3],f,l),et(t,n,r)}function nt(t,r,i){var o,s=new Uint8Array(64),a=[e(),e(),e(),e()];for(i||n(r,32),X(s,r,32),s[0]&=248,s[31]&=127,s[31]|=64,rt(a,s),tt(t,a),o=0;o<32;o++)r[o+32]=t[o];return 0}var it=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ot(t,e){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i<o;++i)e[i]+=r-16*e[n]*it[i-(n-32)],r=Math.floor((e[i]+128)/256),e[i]-=256*r;e[i]+=r,e[n]=0}for(r=0,i=0;i<32;i++)e[i]+=r-(e[31]>>4)*it[i],r=e[i]>>8,e[i]&=255;for(i=0;i<32;i++)e[i]-=r*it[i];for(n=0;n<32;n++)e[n+1]+=e[n]>>8,t[n]=255&e[n]}function st(t){var e,r=new Float64Array(64);for(e=0;e<64;e++)r[e]=t[e];for(e=0;e<64;e++)t[e]=0;ot(t,r)}function at(t,r,n,i){var o,s,a=new Uint8Array(64),u=new Uint8Array(64),h=new Uint8Array(64),c=new Float64Array(64),f=[e(),e(),e(),e()];X(a,i,32),a[0]&=248,a[31]&=127,a[31]|=64;var l=n+64;for(o=0;o<n;o++)t[64+o]=r[o];for(o=0;o<32;o++)t[32+o]=a[32+o];for(X(h,t.subarray(32),n+32),st(h),rt(f,h),tt(t,f),o=32;o<64;o++)t[o]=i[o];for(X(u,t,n+64),st(u),o=0;o<64;o++)c[o]=0;for(o=0;o<32;o++)c[o]=h[o];for(o=0;o<32;o++)for(s=0;s<32;s++)c[o+s]+=u[o]*a[s];return ot(t.subarray(32),c),l}function ut(t,r,n,i){var o,u=new Uint8Array(32),c=new Uint8Array(64),f=[e(),e(),e(),e()],l=[e(),e(),e(),e()];if(n<64)return-1;if(function(t,r){var n=e(),i=e(),o=e(),u=e(),c=e(),f=e(),l=e();return T(t[2],a),N(t[1],r),U(o,t[1]),D(u,o,h),H(o,o,t[2]),j(u,t[2],u),U(c,u),U(f,c),D(l,f,c),D(n,l,o),D(n,n,u),$(n,n),D(n,n,o),D(n,n,u),D(n,n,u),D(t[0],n,u),U(i,t[0]),D(i,i,u),O(i,o)&&D(t[0],t[0],d),U(i,t[0]),D(i,i,u),O(i,o)?-1:(L(t[0])===r[31]>>7&&H(t[0],s,t[0]),D(t[3],t[0],t[1]),0)}(l,i))return-1;for(o=0;o<n;o++)t[o]=r[o];for(o=0;o<32;o++)t[o+32]=i[o];if(X(c,t,n),st(c),et(f,l,c),rt(l,r.subarray(32)),Y(f,l),tt(u,f),n-=64,b(r,0,u,0)){for(o=0;o<n;o++)t[o]=0;return-1}for(o=0;o<n;o++)t[o]=r[o+64];return n}var ht=16,ct=64,ft=32,lt=64;function dt(t,e){if(32!==t.length)throw new Error("bad key size");if(24!==e.length)throw new Error("bad nonce size")}function pt(){for(var t=0;t<arguments.length;t++)if(!(arguments[t]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function mt(t){for(var e=0;e<t.length;e++)t[e]=0}t.lowlevel={crypto_core_hsalsa20:v,crypto_stream_xor:_,crypto_stream:S,crypto_stream_salsa20_xor:M,crypto_stream_salsa20:E,crypto_onetimeauth:A,crypto_onetimeauth_verify:x,crypto_verify_16:g,crypto_verify_32:b,crypto_secretbox:I,crypto_secretbox_open:B,crypto_scalarmult:q,crypto_scalarmult_base:z,crypto_box_beforenm:V,crypto_box_afternm:J,crypto_box:function(t,e,r,n,i,o){var s=new Uint8Array(32);return V(s,i,o),J(t,e,r,n,s)},crypto_box_open:function(t,e,r,n,i,o){var s=new Uint8Array(32);return V(s,i,o),K(t,e,r,n,s)},crypto_box_keypair:G,crypto_hash:X,crypto_sign:at,crypto_sign_keypair:nt,crypto_sign_open:ut,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:ht,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:ct,crypto_sign_PUBLICKEYBYTES:ft,crypto_sign_SECRETKEYBYTES:lt,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:e,D:h,L:it,pack25519:R,unpack25519:N,M:D,A:j,S:U,Z:H,pow2523:$,add:Y,set25519:T,modL:ot,scalarmult:et,scalarbase:rt},t.randomBytes=function(t){var e=new Uint8Array(t);return n(e,t),e},t.secretbox=function(t,e,r){pt(t,e,r),dt(r,e);for(var n=new Uint8Array(32+t.length),i=new Uint8Array(n.length),o=0;o<t.length;o++)n[o+32]=t[o];return I(i,n,n.length,e,r),i.subarray(ht)},t.secretbox.open=function(t,e,r){pt(t,e,r),dt(r,e);for(var n=new Uint8Array(ht+t.length),i=new Uint8Array(n.length),o=0;o<t.length;o++)n[o+ht]=t[o];return n.length<32||0!==B(i,n,n.length,e,r)?null:i.subarray(32)},t.secretbox.keyLength=32,t.secretbox.nonceLength=24,t.secretbox.overheadLength=ht,t.scalarMult=function(t,e){if(pt(t,e),32!==t.length)throw new Error("bad n size");if(32!==e.length)throw new Error("bad p size");var r=new Uint8Array(32);return q(r,t,e),r},t.scalarMult.base=function(t){if(pt(t),32!==t.length)throw new Error("bad n size");var e=new Uint8Array(32);return z(e,t),e},t.scalarMult.scalarLength=32,t.scalarMult.groupElementLength=32,t.box=function(e,r,n,i){var o=t.box.before(n,i);return t.secretbox(e,r,o)},t.box.before=function(t,e){pt(t,e),function(t,e){if(32!==t.length)throw new Error("bad public key size");if(32!==e.length)throw new Error("bad secret key size")}(t,e);var r=new Uint8Array(32);return V(r,t,e),r},t.box.after=t.secretbox,t.box.open=function(e,r,n,i){var o=t.box.before(n,i);return t.secretbox.open(e,r,o)},t.box.open.after=t.secretbox.open,t.box.keyPair=function(){var t=new Uint8Array(32),e=new Uint8Array(32);return G(t,e),{publicKey:t,secretKey:e}},t.box.keyPair.fromSecretKey=function(t){if(pt(t),32!==t.length)throw new Error("bad secret key size");var e=new Uint8Array(32);return z(e,t),{publicKey:e,secretKey:new Uint8Array(t)}},t.box.publicKeyLength=32,t.box.secretKeyLength=32,t.box.sharedKeyLength=32,t.box.nonceLength=24,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(t,e){if(pt(t,e),e.length!==lt)throw new Error("bad secret key size");var r=new Uint8Array(ct+t.length);return at(r,t,t.length,e),r},t.sign.open=function(t,e){if(pt(t,e),e.length!==ft)throw new Error("bad public key size");var r=new Uint8Array(t.length),n=ut(r,t,t.length,e);if(n<0)return null;for(var i=new Uint8Array(n),o=0;o<i.length;o++)i[o]=r[o];return i},t.sign.detached=function(e,r){for(var n=t.sign(e,r),i=new Uint8Array(ct),o=0;o<i.length;o++)i[o]=n[o];return i},t.sign.detached.verify=function(t,e,r){if(pt(t,e,r),e.length!==ct)throw new Error("bad signature size");if(r.length!==ft)throw new Error("bad public key size");var n,i=new Uint8Array(ct+t.length),o=new Uint8Array(ct+t.length);for(n=0;n<ct;n++)i[n]=e[n];for(n=0;n<t.length;n++)i[n+ct]=t[n];return ut(o,i,i.length,r)>=0},t.sign.keyPair=function(){var t=new Uint8Array(ft),e=new Uint8Array(lt);return nt(t,e),{publicKey:t,secretKey:e}},t.sign.keyPair.fromSecretKey=function(t){if(pt(t),t.length!==lt)throw new Error("bad secret key size");for(var e=new Uint8Array(ft),r=0;r<e.length;r++)e[r]=t[32+r];return{publicKey:e,secretKey:new Uint8Array(t)}},t.sign.keyPair.fromSeed=function(t){if(pt(t),32!==t.length)throw new Error("bad seed size");for(var e=new Uint8Array(ft),r=new Uint8Array(lt),n=0;n<32;n++)r[n]=t[n];return nt(e,r,!0),{publicKey:e,secretKey:r}},t.sign.publicKeyLength=ft,t.sign.secretKeyLength=lt,t.sign.seedLength=32,t.sign.signatureLength=ct,t.hash=function(t){pt(t);var e=new Uint8Array(64);return X(e,t,t.length),e},t.hash.hashLength=64,t.verify=function(t,e){return pt(t,e),0!==t.length&&0!==e.length&&(t.length===e.length&&0===m(t,0,e,0,t.length))},t.setPRNG=function(t){n=t},function(){var e="undefined"!=typeof self?self.crypto||self.msCrypto:null;if(e&&e.getRandomValues){t.setPRNG((function(t,r){var n,i=new Uint8Array(r);for(n=0;n<r;n+=65536)e.getRandomValues(i.subarray(n,n+Math.min(r-n,65536)));for(n=0;n<r;n++)t[n]=i[n];mt(i)}))}else(e=r(5338))&&e.randomBytes&&t.setPRNG((function(t,r){var n,i=e.randomBytes(r);for(n=0;n<r;n++)t[n]=i[n];mt(i)}))}()}(t.exports?t.exports:self.nacl=self.nacl||{})},9639:function(t,e,r){var n;t=r.nmd(t),function(i){e&&e.nodeType,t&&t.nodeType;var o="object"==typeof r.g&&r.g;o.global!==o&&o.window!==o&&o.self;var s,a=2147483647,u=36,h=1,c=26,f=38,l=700,d=72,p=128,m="-",g=/^xn--/,b=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=u-h,M=Math.floor,E=String.fromCharCode;function S(t){throw new RangeError(v[t])}function _(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function k(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+_((t=t.replace(y,".")).split("."),e).join(".")}function A(t){for(var e,r,n=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(r=t.charCodeAt(i++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--):n.push(e);return n}function x(t){return _(t,(function(t){var e="";return t>65535&&(e+=E((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=E(t)})).join("")}function I(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function B(t,e,r){var n=0;for(t=r?M(t/l):t>>1,t+=M(t/e);t>w*c>>1;n+=u)t=M(t/w);return M(n+(w+1)*t/(t+f))}function T(t){var e,r,n,i,o,s,f,l,g,b,y,v=[],w=t.length,E=0,_=p,k=d;for((r=t.lastIndexOf(m))<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&S("not-basic"),v.push(t.charCodeAt(n));for(i=r>0?r+1:0;i<w;){for(o=E,s=1,f=u;i>=w&&S("invalid-input"),((l=(y=t.charCodeAt(i++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:u)>=u||l>M((a-E)/s))&&S("overflow"),E+=l*s,!(l<(g=f<=k?h:f>=k+c?c:f-k));f+=u)s>M(a/(b=u-g))&&S("overflow"),s*=b;k=B(E-o,e=v.length+1,0==o),M(E/e)>a-_&&S("overflow"),_+=M(E/e),E%=e,v.splice(E++,0,_)}return x(v)}function P(t){var e,r,n,i,o,s,f,l,g,b,y,v,w,_,k,x=[];for(v=(t=A(t)).length,e=p,r=0,o=d,s=0;s<v;++s)(y=t[s])<128&&x.push(E(y));for(n=i=x.length,i&&x.push(m);n<v;){for(f=a,s=0;s<v;++s)(y=t[s])>=e&&y<f&&(f=y);for(f-e>M((a-r)/(w=n+1))&&S("overflow"),r+=(f-e)*w,e=f,s=0;s<v;++s)if((y=t[s])<e&&++r>a&&S("overflow"),y==e){for(l=r,g=u;!(l<(b=g<=o?h:g>=o+c?c:g-o));g+=u)k=l-b,_=u-b,x.push(E(I(b+k%_,0))),l=M(k/_);x.push(E(I(l,0))),o=B(r,w,n==i),r=0,++n}++r,++e}return x.join("")}s={version:"1.4.1",ucs2:{decode:A,encode:x},decode:T,encode:P,toASCII:function(t){return k(t,(function(t){return b.test(t)?"xn--"+P(t):t}))},toUnicode:function(t){return k(t,(function(t){return g.test(t)?T(t.slice(4).toLowerCase()):t}))}},void 0===(n=function(){return s}.call(e,r,e,t))||(t.exports=n)}()},2573:t=>{"use strict";var e=String.prototype.replace,r=/%20/g,n="RFC1738",i="RFC3986";t.exports={default:i,formatters:{RFC1738:function(t){return e.call(t,r,"+")},RFC3986:function(t){return String(t)}},RFC1738:n,RFC3986:i}},2420:(t,e,r)=>{"use strict";var n=r(3079),i=r(3177),o=r(2573);t.exports={formats:o,parse:i,stringify:n}},3177:(t,e,r)=>{"use strict";var n=r(3435),i=Object.prototype.hasOwnProperty,o=Array.isArray,s={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},u=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},h=function(t,e,r,n){if(t){var o=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,s=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(o),h=a?o.slice(0,a.index):o,c=[];if(h){if(!r.plainObjects&&i.call(Object.prototype,h)&&!r.allowPrototypes)return;c.push(h)}for(var f=0;r.depth>0&&null!==(a=s.exec(o))&&f<r.depth;){if(f+=1,!r.plainObjects&&i.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;c.push(a[1])}return a&&c.push("["+o.slice(a.index)+"]"),function(t,e,r,n){for(var i=n?e:u(e,r),o=t.length-1;o>=0;--o){var s,a=t[o];if("[]"===a&&r.parseArrays)s=[].concat(i);else{s=r.plainObjects?Object.create(null):{};var h="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,c=parseInt(h,10);r.parseArrays||""!==h?!isNaN(c)&&a!==h&&String(c)===h&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(s=[])[c]=i:"__proto__"!==h&&(s[h]=i):s={0:i}}i=s}return i}(c,e,r,n)}};t.exports=function(t,e){var r=function(t){if(!t)return s;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?s.charset:t.charset;return{allowDots:void 0===t.allowDots?s.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:s.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:s.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:s.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:s.comma,decoder:"function"==typeof t.decoder?t.decoder:s.decoder,delimiter:"string"==typeof t.delimiter||n.isRegExp(t.delimiter)?t.delimiter:s.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:s.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:s.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:s.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:s.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var c="string"==typeof t?function(t,e){var r,h={__proto__:null},c=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,f=e.parameterLimit===1/0?void 0:e.parameterLimit,l=c.split(e.delimiter,f),d=-1,p=e.charset;if(e.charsetSentinel)for(r=0;r<l.length;++r)0===l[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===l[r]?p="utf-8":"utf8=%26%2310003%3B"===l[r]&&(p="iso-8859-1"),d=r,r=l.length);for(r=0;r<l.length;++r)if(r!==d){var m,g,b=l[r],y=b.indexOf("]="),v=-1===y?b.indexOf("="):y+1;-1===v?(m=e.decoder(b,s.decoder,p,"key"),g=e.strictNullHandling?null:""):(m=e.decoder(b.slice(0,v),s.decoder,p,"key"),g=n.maybeMap(u(b.slice(v+1),e),(function(t){return e.decoder(t,s.decoder,p,"value")}))),g&&e.interpretNumericEntities&&"iso-8859-1"===p&&(g=a(g)),b.indexOf("[]=")>-1&&(g=o(g)?[g]:g),i.call(h,m)?h[m]=n.combine(h[m],g):h[m]=g}return h}(t,r):t,f=r.plainObjects?Object.create(null):{},l=Object.keys(c),d=0;d<l.length;++d){var p=l[d],m=h(p,c[p],r,"string"==typeof t);f=n.merge(f,m,r)}return!0===r.allowSparse?f:n.compact(f)}},3079:(t,e,r)=>{"use strict";var n=r(4294),i=r(3435),o=r(2573),s=Object.prototype.hasOwnProperty,a={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},u=Array.isArray,h=Array.prototype.push,c=function(t,e){h.apply(t,u(e)?e:[e])},f=Date.prototype.toISOString,l=o.default,d={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:i.encode,encodeValuesOnly:!1,format:l,formatter:o.formatters[l],indices:!1,serializeDate:function(t){return f.call(t)},skipNulls:!1,strictNullHandling:!1},p={},m=function t(e,r,o,s,a,h,f,l,m,g,b,y,v,w,M,E){for(var S,_=e,k=E,A=0,x=!1;void 0!==(k=k.get(p))&&!x;){var I=k.get(e);if(A+=1,void 0!==I){if(I===A)throw new RangeError("Cyclic object value");x=!0}void 0===k.get(p)&&(A=0)}if("function"==typeof l?_=l(r,_):_ instanceof Date?_=b(_):"comma"===o&&u(_)&&(_=i.maybeMap(_,(function(t){return t instanceof Date?b(t):t}))),null===_){if(a)return f&&!w?f(r,d.encoder,M,"key",y):r;_=""}if("string"==typeof(S=_)||"number"==typeof S||"boolean"==typeof S||"symbol"==typeof S||"bigint"==typeof S||i.isBuffer(_))return f?[v(w?r:f(r,d.encoder,M,"key",y))+"="+v(f(_,d.encoder,M,"value",y))]:[v(r)+"="+v(String(_))];var B,T=[];if(void 0===_)return T;if("comma"===o&&u(_))w&&f&&(_=i.maybeMap(_,f)),B=[{value:_.length>0?_.join(",")||null:void 0}];else if(u(l))B=l;else{var P=Object.keys(_);B=m?P.sort(m):P}for(var C=s&&u(_)&&1===_.length?r+"[]":r,R=0;R<B.length;++R){var O=B[R],L="object"==typeof O&&void 0!==O.value?O.value:_[O];if(!h||null!==L){var N=u(_)?"function"==typeof o?o(C,O):C:C+(g?"."+O:"["+O+"]");E.set(e,A);var j=n();j.set(p,E),c(T,t(L,N,o,s,a,h,"comma"===o&&w&&u(_)?null:f,l,m,g,b,y,v,w,M,j))}}return T};t.exports=function(t,e){var r,i=t,h=function(t){if(!t)return d;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||d.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=o.default;if(void 0!==t.format){if(!s.call(o.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=o.formatters[r],i=d.filter;return("function"==typeof t.filter||u(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:d.addQueryPrefix,allowDots:void 0===t.allowDots?d.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:d.charsetSentinel,delimiter:void 0===t.delimiter?d.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:d.encode,encoder:"function"==typeof t.encoder?t.encoder:d.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:d.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:d.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:d.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:d.strictNullHandling}}(e);"function"==typeof h.filter?i=(0,h.filter)("",i):u(h.filter)&&(r=h.filter);var f,l=[];if("object"!=typeof i||null===i)return"";f=e&&e.arrayFormat in a?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var p=a[f];if(e&&"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var g="comma"===p&&e&&e.commaRoundTrip;r||(r=Object.keys(i)),h.sort&&r.sort(h.sort);for(var b=n(),y=0;y<r.length;++y){var v=r[y];h.skipNulls&&null===i[v]||c(l,m(i[v],v,p,g,h.strictNullHandling,h.skipNulls,h.encode?h.encoder:null,h.filter,h.sort,h.allowDots,h.serializeDate,h.format,h.formatter,h.encodeValuesOnly,h.charset,b))}var w=l.join(h.delimiter),M=!0===h.addQueryPrefix?"?":"";return h.charsetSentinel&&("iso-8859-1"===h.charset?M+="utf8=%26%2310003%3B&":M+="utf8=%E2%9C%93&"),w.length>0?M+w:""}},3435:(t,e,r)=>{"use strict";var n=r(2573),i=Object.prototype.hasOwnProperty,o=Array.isArray,s=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),a=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n<t.length;++n)void 0!==t[n]&&(r[n]=t[n]);return r};t.exports={arrayToObject:a,assign:function(t,e){return Object.keys(e).reduce((function(t,r){return t[r]=e[r],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],n=0;n<e.length;++n)for(var i=e[n],s=i.obj[i.prop],a=Object.keys(s),u=0;u<a.length;++u){var h=a[u],c=s[h];"object"==typeof c&&null!==c&&-1===r.indexOf(c)&&(e.push({obj:s,prop:h}),r.push(c))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(o(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);e.obj[e.prop]=n}}}(e),t},decode:function(t,e,r){var n=t.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(t){return n}},encode:function(t,e,r,i,o){if(0===t.length)return t;var a=t;if("symbol"==typeof t?a=Symbol.prototype.toString.call(t):"string"!=typeof t&&(a=String(t)),"iso-8859-1"===r)return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var u="",h=0;h<a.length;++h){var c=a.charCodeAt(h);45===c||46===c||95===c||126===c||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||o===n.RFC1738&&(40===c||41===c)?u+=a.charAt(h):c<128?u+=s[c]:c<2048?u+=s[192|c>>6]+s[128|63&c]:c<55296||c>=57344?u+=s[224|c>>12]+s[128|c>>6&63]+s[128|63&c]:(h+=1,c=65536+((1023&c)<<10|1023&a.charCodeAt(h)),u+=s[240|c>>18]+s[128|c>>12&63]+s[128|c>>6&63]+s[128|63&c])}return u},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(o(t)){for(var r=[],n=0;n<t.length;n+=1)r.push(e(t[n]));return r}return e(t)},merge:function t(e,r,n){if(!r)return e;if("object"!=typeof r){if(o(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!i.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var s=e;return o(e)&&!o(r)&&(s=a(e,n)),o(e)&&o(r)?(r.forEach((function(r,o){if(i.call(e,o)){var s=e[o];s&&"object"==typeof s&&r&&"object"==typeof r?e[o]=t(s,r,n):e.push(r)}else e[o]=r})),e):Object.keys(r).reduce((function(e,o){var s=r[o];return i.call(e,o)?e[o]=t(e[o],s,n):e[o]=s,e}),s)}}},883:(t,e,r)=>{"use strict";var n=r(9639);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var o=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),h=["'"].concat(u),c=["%","/","?",";","#"].concat(h),f=["/","?","#"],l=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=r(2420);function y(t,e,r){if(t&&"object"==typeof t&&t instanceof i)return t;var n=new i;return n.parse(t,e,r),n}i.prototype.parse=function(t,e,r){if("string"!=typeof t)throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),s=-1!==i&&i<t.indexOf("#")?"?":"#",u=t.split(s);u[0]=u[0].replace(/\\/g,"/");var y=t=u.join(s);if(y=y.trim(),!r&&1===t.split("#").length){var v=a.exec(y);if(v)return this.path=y,this.href=y,this.pathname=v[1],v[2]?(this.search=v[2],this.query=e?b.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var w=o.exec(y);if(w){var M=(w=w[0]).toLowerCase();this.protocol=M,y=y.substr(w.length)}if(r||w||y.match(/^\/\/[^@/]+@[^@/]+/)){var E="//"===y.substr(0,2);!E||w&&m[w]||(y=y.substr(2),this.slashes=!0)}if(!m[w]&&(E||w&&!g[w])){for(var S,_,k=-1,A=0;A<f.length;A++){-1!==(x=y.indexOf(f[A]))&&(-1===k||x<k)&&(k=x)}-1!==(_=-1===k?y.lastIndexOf("@"):y.lastIndexOf("@",k))&&(S=y.slice(0,_),y=y.slice(_+1),this.auth=decodeURIComponent(S)),k=-1;for(A=0;A<c.length;A++){var x;-1!==(x=y.indexOf(c[A]))&&(-1===k||x<k)&&(k=x)}-1===k&&(k=y.length),this.host=y.slice(0,k),y=y.slice(k),this.parseHost(),this.hostname=this.hostname||"";var I="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!I)for(var B=this.hostname.split(/\./),T=(A=0,B.length);A<T;A++){var P=B[A];if(P&&!P.match(l)){for(var C="",R=0,O=P.length;R<O;R++)P.charCodeAt(R)>127?C+="x":C+=P[R];if(!C.match(l)){var L=B.slice(0,A),N=B.slice(A+1),j=P.match(d);j&&(L.push(j[1]),N.unshift(j[2])),N.length&&(y="/"+N.join(".")+y),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=n.toASCII(this.hostname));var H=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+H,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!p[M])for(A=0,T=h.length;A<T;A++){var U=h[A];if(-1!==y.indexOf(U)){var F=encodeURIComponent(U);F===U&&(F=escape(U)),y=y.split(U).join(F)}}var $=y.indexOf("#");-1!==$&&(this.hash=y.substr($),y=y.slice(0,$));var q=y.indexOf("?");if(-1!==q?(this.search=y.substr(q),this.query=y.substr(q+1),e&&(this.query=b.parse(this.query)),y=y.slice(0,q)):e&&(this.search="",this.query={}),y&&(this.pathname=y),g[M]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){H=this.pathname||"";var z=this.search||"";this.path=H+z}return this.href=this.format(),this},i.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=t+this.host:this.hostname&&(i=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(o=b.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||g[e])&&!1!==i?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),e+i+(r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(s=s.replace("#","%23"))+n},i.prototype.resolve=function(t){return this.resolveObject(y(t,!1,!0)).format()},i.prototype.resolveObject=function(t){if("string"==typeof t){var e=new i;e.parse(t,!1,!0),t=e}for(var r=new i,n=Object.keys(this),o=0;o<n.length;o++){var s=n[o];r[s]=this[s]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var a=Object.keys(t),u=0;u<a.length;u++){var h=a[u];"protocol"!==h&&(r[h]=t[h])}return g[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!g[t.protocol]){for(var c=Object.keys(t),f=0;f<c.length;f++){var l=c[f];r[l]=t[l]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||m[t.protocol])r.pathname=t.pathname;else{for(var d=(t.pathname||"").split("/");d.length&&!(t.host=d.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var p=r.pathname||"",b=r.search||"";r.path=p+b}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var y=r.pathname&&"/"===r.pathname.charAt(0),v=t.host||t.pathname&&"/"===t.pathname.charAt(0),w=v||y||r.host&&t.pathname,M=w,E=r.pathname&&r.pathname.split("/")||[],S=(d=t.pathname&&t.pathname.split("/")||[],r.protocol&&!g[r.protocol]);if(S&&(r.hostname="",r.port=null,r.host&&(""===E[0]?E[0]=r.host:E.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===d[0]?d[0]=t.host:d.unshift(t.host)),t.host=null),w=w&&(""===d[0]||""===E[0])),v)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,E=d;else if(d.length)E||(E=[]),E.pop(),E=E.concat(d),r.search=t.search,r.query=t.query;else if(null!=t.search){if(S)r.host=E.shift(),r.hostname=r.host,(I=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=I.shift(),r.hostname=I.shift(),r.host=r.hostname);return r.search=t.search,r.query=t.query,null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var _=E.slice(-1)[0],k=(r.host||t.host||E.length>1)&&("."===_||".."===_)||""===_,A=0,x=E.length;x>=0;x--)"."===(_=E[x])?E.splice(x,1):".."===_?(E.splice(x,1),A++):A&&(E.splice(x,1),A--);if(!w&&!M)for(;A--;A)E.unshift("..");!w||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),k&&"/"!==E.join("/").substr(-1)&&E.push("");var I,B=""===E[0]||E[0]&&"/"===E[0].charAt(0);S&&(r.hostname=B?"":E.length?E.shift():"",r.host=r.hostname,(I=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=I.shift(),r.hostname=I.shift(),r.host=r.hostname));return(w=w||r.host&&E.length)&&!B&&E.unshift(""),E.length>0?r.pathname=E.join("/"):(r.pathname=null,r.path=null),null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},e.parse=y,e.resolve=function(t,e){return y(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?y(t,!1,!0).resolveObject(e):e},e.format=function(t){return"string"==typeof t&&(t=y(t)),t instanceof i?t.format():i.prototype.format.call(t)},e.Url=i},5803:(t,e,r)=>{function n(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}},82:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},4895:(t,e,r)=>{"use strict";var n=r(2635),i=r(3138),o=r(2094),s=r(198);function a(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,h="undefined"!=typeof Symbol,c=a(Object.prototype.toString),f=a(Number.prototype.valueOf),l=a(String.prototype.valueOf),d=a(Boolean.prototype.valueOf);if(u)var p=a(BigInt.prototype.valueOf);if(h)var m=a(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function b(t){return"[object Map]"===c(t)}function y(t){return"[object Set]"===c(t)}function v(t){return"[object WeakMap]"===c(t)}function w(t){return"[object WeakSet]"===c(t)}function M(t){return"[object ArrayBuffer]"===c(t)}function E(t){return"undefined"!=typeof ArrayBuffer&&(M.working?M(t):t instanceof ArrayBuffer)}function S(t){return"[object DataView]"===c(t)}function _(t){return"undefined"!=typeof DataView&&(S.working?S(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=s,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):s(t)||_(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},b.working="undefined"!=typeof Map&&b(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(b.working?b(t):t instanceof Map)},y.working="undefined"!=typeof Set&&y(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(y.working?y(t):t instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(v.working?v(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},M.working="undefined"!=typeof ArrayBuffer&&M(new ArrayBuffer),e.isArrayBuffer=E,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=_;var k="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function A(t){return"[object SharedArrayBuffer]"===c(t)}function x(t){return void 0!==k&&(void 0===A.working&&(A.working=A(new k)),A.working?A(t):t instanceof k)}function I(t){return g(t,f)}function B(t){return g(t,l)}function T(t){return g(t,d)}function P(t){return u&&g(t,p)}function C(t){return h&&g(t,m)}e.isSharedArrayBuffer=x,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===c(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===c(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===c(t)},e.isGeneratorObject=function(t){return"[object Generator]"===c(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===c(t)},e.isNumberObject=I,e.isStringObject=B,e.isBooleanObject=T,e.isBigIntObject=P,e.isSymbolObject=C,e.isBoxedPrimitive=function(t){return I(t)||B(t)||T(t)||P(t)||C(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(E(t)||x(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},3335:(t,e,r)=>{var n=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},i=/%[sdj%]/g;e.format=function(t){if(!y(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(u(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,o=n.length,s=String(t).replace(i,(function(t){if("%%"===t)return"%";if(r>=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),a=n[r];r<o;a=n[++r])g(a)||!M(a)?s+=" "+a:s+=" "+u(a);return s},e.deprecate=function(t,r){if("undefined"!=typeof process&&!0===process.noDeprecation)return t;if("undefined"==typeof process)return function(){return e.deprecate(t,r).apply(this,arguments)};var n=!1;return function(){if(!n){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),n=!0}return t.apply(this,arguments)}};var o={},s=/^$/,a="false";function u(t,r){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&e._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=h),f(n,t,n.depth)}function h(t,e){var r=u.styles[e];return r?"["+u.colors[r][0]+"m"+t+"["+u.colors[r][1]+"m":t}function c(t,e){return t}function f(t,r,n){if(t.customInspect&&r&&_(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return y(i)||(i=f(t,i,n)),i}var o=function(t,e){if(v(e))return t.stylize("undefined","undefined");if(y(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(b(e))return t.stylize(""+e,"number");if(m(e))return t.stylize(""+e,"boolean");if(g(e))return t.stylize("null","null")}(t,r);if(o)return o;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),S(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(r);if(0===s.length){if(_(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(E(r))return t.stylize(Date.prototype.toString.call(r),"date");if(S(r))return l(r)}var h,c="",M=!1,k=["{","}"];(p(r)&&(M=!0,k=["[","]"]),_(r))&&(c=" [Function"+(r.name?": "+r.name:"")+"]");return w(r)&&(c=" "+RegExp.prototype.toString.call(r)),E(r)&&(c=" "+Date.prototype.toUTCString.call(r)),S(r)&&(c=" "+l(r)),0!==s.length||M&&0!=r.length?n<0?w(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),h=M?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s<a;++s)I(e,String(s))?o.push(d(t,e,r,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(d(t,e,r,n,i,!0))})),o}(t,r,n,a,s):s.map((function(e){return d(t,r,n,a,e,M)})),t.seen.pop(),function(t,e,r){var n=t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(n>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(h,c,k)):k[0]+c+k[1]}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),I(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=g(r)?f(t,u.value,null):f(t,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),v(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function p(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function g(t){return null===t}function b(t){return"number"==typeof t}function y(t){return"string"==typeof t}function v(t){return void 0===t}function w(t){return M(t)&&"[object RegExp]"===k(t)}function M(t){return"object"==typeof t&&null!==t}function E(t){return M(t)&&"[object Date]"===k(t)}function S(t){return M(t)&&("[object Error]"===k(t)||t instanceof Error)}function _(t){return"function"==typeof t}function k(t){return Object.prototype.toString.call(t)}function A(t){return t<10?"0"+t.toString(10):t.toString(10)}a=a.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+a+"$","i"),e.debuglog=function(t){if(t=t.toUpperCase(),!o[t])if(s.test(t)){var r=process.pid;o[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else o[t]=function(){};return o[t]},e.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(4895),e.isArray=p,e.isBoolean=m,e.isNull=g,e.isNullOrUndefined=function(t){return null==t},e.isNumber=b,e.isString=y,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=v,e.isRegExp=w,e.types.isRegExp=w,e.isObject=M,e.isDate=E,e.types.isDate=E,e.isError=S,e.types.isNativeError=S,e.isFunction=_,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(82);var x=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;console.log("%s - %s",(t=new Date,r=[A(t.getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":"),[t.getDate(),x[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(1285),e._extend=function(t,e){if(!e||!M(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var B="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function T(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(B&&t[B]){var e;if("function"!=typeof(e=t[B]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,B,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,i)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),B&&Object.defineProperty(e,B,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,n(t))},e.promisify.custom=B,e.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function e(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var n=e.pop();if("function"!=typeof n)throw new TypeError("The last argument must be of type Function");var i=this,o=function(){return n.apply(i,arguments)};t.apply(this,e).then((function(t){process.nextTick(o.bind(null,null,t))}),(function(t){process.nextTick(T.bind(null,t,o))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,n(t)),e}},2094:(t,e,r)=>{"use strict";var n=r(3243),i=r(2191),o=r(9429),s=r(2680),a=r(326),u=s("Object.prototype.toString"),h=r(7226)(),c="undefined"==typeof globalThis?r.g:globalThis,f=i(),l=s("String.prototype.slice"),d=Object.getPrototypeOf,p=s("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},m={__proto__:null};n(f,h&&a&&d?function(t){var e=new c[t];if(Symbol.toStringTag in e){var r=d(e),n=a(r,Symbol.toStringTag);if(!n){var i=d(r);n=a(i,Symbol.toStringTag)}m["$"+t]=o(n.get)}}:function(t){var e=new c[t];m["$"+t]=o(e.slice)});t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!h){var e=l(u(t),8,-1);return p(f,e)>-1?e:"Object"===e&&function(t){var e=!1;return n(m,(function(r,n){if(!e)try{r(t),e=l(n,1)}catch(t){}})),e}(t)}return a?function(t){var e=!1;return n(m,(function(r,n){if(!e)try{"$"+r(t)===n&&(e=l(n,1))}catch(t){}})),e}(t):null}},8268:t=>{"use strict";t.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}},8006:(t,e,r)=>{"use strict";function n(t){var e=this;if(e instanceof n||(e=new n),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)e.push(arguments[r]);return e}function i(t,e,r){var n=e===t.head?new a(r,null,e,t):new a(r,e,e.next,t);return null===n.next&&(t.tail=n),null===n.prev&&(t.head=n),t.length++,n}function o(t,e){t.tail=new a(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function s(t,e){t.head=new a(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function a(t,e,r,n){if(!(this instanceof a))return new a(t,e,r,n);this.list=n,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}t.exports=n,n.Node=a,n.create=n,n.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,r=t.prev;return e&&(e.prev=r),r&&(r.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=r),t.list.length--,t.next=null,t.prev=null,t.list=null,e},n.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}},n.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}},n.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)o(this,arguments[t]);return this.length},n.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)s(this,arguments[t]);return this.length},n.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}},n.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}},n.prototype.forEach=function(t,e){e=e||this;for(var r=this.head,n=0;null!==r;n++)t.call(e,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(t,e){e=e||this;for(var r=this.tail,n=this.length-1;null!==r;n--)t.call(e,r.value,n,this),r=r.prev},n.prototype.get=function(t){for(var e=0,r=this.head;null!==r&&e<t;e++)r=r.next;if(e===t&&null!==r)return r.value},n.prototype.getReverse=function(t){for(var e=0,r=this.tail;null!==r&&e<t;e++)r=r.prev;if(e===t&&null!==r)return r.value},n.prototype.map=function(t,e){e=e||this;for(var r=new n,i=this.head;null!==i;)r.push(t.call(e,i.value,this)),i=i.next;return r},n.prototype.mapReverse=function(t,e){e=e||this;for(var r=new n,i=this.tail;null!==i;)r.push(t.call(e,i.value,this)),i=i.prev;return r},n.prototype.reduce=function(t,e){var r,n=this.head;if(arguments.length>1)r=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=t(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(t,e){var r,n=this.tail;if(arguments.length>1)r=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=t(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;null!==r;e++)t[e]=r.value,r=r.next;return t},n.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;null!==r;e++)t[e]=r.value,r=r.prev;return t},n.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var r=new n;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=0,o=this.head;null!==o&&i<t;i++)o=o.next;for(;null!==o&&i<e;i++,o=o.next)r.push(o.value);return r},n.prototype.sliceReverse=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var r=new n;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=this.length,o=this.tail;null!==o&&i>e;i--)o=o.prev;for(;null!==o&&i>t;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,o=this.head;null!==o&&n<t;n++)o=o.next;var s=[];for(n=0;o&&n<e;n++)s.push(o.value),o=this.removeNode(o);null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev);for(n=0;n<r.length;n++)o=i(this,o,r[n]);return s},n.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=e,this.tail=t,this};try{r(8268)(n)}catch(t){}},8519:(t,e,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.Common=void 0;const i=r(5372),o=r(7108),s=r(2699),a=r(7295),u=r(3323),h=r(6987),c=r(2823),f=r(5810),l=r(7438),d=r(3292),p=r(7240),m=r(3337);class g extends s.EventEmitter{constructor(t){super(),this._eips=[],this._customChains=t.customChains??[],this._chainParams=this.setChain(t.chain),this.DEFAULT_HARDFORK=this._chainParams.defaultHardfork??d.Hardfork.Merge,this.HARDFORK_CHANGES=this.hardforks().map((t=>[t.name,p.hardforks[t.name]])),this._hardfork=this.DEFAULT_HARDFORK,void 0!==t.hardfork&&this.setHardfork(t.hardfork),t.eips&&this.setEIPs(t.eips)}static custom(t,e={}){const r=e.baseChain??"mainnet",n={...g._getChainParams(r)};if(n.name="custom-chain","string"!=typeof t)return new g({chain:{...n,...t},...e});if(t===d.CustomChain.PolygonMainnet)return g.custom({name:d.CustomChain.PolygonMainnet,chainId:137,networkId:137},e);if(t===d.CustomChain.PolygonMumbai)return g.custom({name:d.CustomChain.PolygonMumbai,chainId:80001,networkId:80001},e);if(t===d.CustomChain.ArbitrumRinkebyTestnet)return g.custom({name:d.CustomChain.ArbitrumRinkebyTestnet,chainId:421611,networkId:421611},e);if(t===d.CustomChain.ArbitrumOne)return g.custom({name:d.CustomChain.ArbitrumOne,chainId:42161,networkId:42161},e);if(t===d.CustomChain.xDaiChain)return g.custom({name:d.CustomChain.xDaiChain,chainId:100,networkId:100},e);if(t===d.CustomChain.OptimisticKovan)return g.custom({name:d.CustomChain.OptimisticKovan,chainId:69,networkId:69},{hardfork:d.Hardfork.Berlin,...e});if(t===d.CustomChain.OptimisticEthereum)return g.custom({name:d.CustomChain.OptimisticEthereum,chainId:10,networkId:10},{hardfork:d.Hardfork.Berlin,...e});throw new Error(`Custom chain ${t} not supported`)}static fromGethGenesis(t,{chain:e,eips:r,genesisHash:n,hardfork:i,mergeForkIdPostMerge:o}){const s=(0,m.parseGethGenesis)(t,e,o),a=new g({chain:s.name??"custom",customChains:[s],eips:r,hardfork:i??s.hardfork});return void 0!==n&&a.setForkHashes(n),a}static isSupportedChainId(t){const e=this._getInitializedChains();return Boolean(e.names[t.toString()])}static _getChainParams(t,e){const r=this._getInitializedChains(e);if("number"==typeof t||"bigint"==typeof t){if(t=t.toString(),r.names[t]){return r[r.names[t]]}throw new Error(`Chain with ID ${t} not supported`)}if(void 0!==r[t])return r[t];throw new Error(`Chain with name ${t} not supported`)}setChain(t){if("number"==typeof t||"bigint"==typeof t||"string"==typeof t)this._chainParams=g._getChainParams(t,this._customChains);else{if("object"!=typeof t)throw new Error("Wrong input format");{if(this._customChains.length>0)throw new Error("Chain must be a string, number, or bigint when initialized with customChains passed in");const e=["networkId","genesis","hardforks","bootstrapNodes"];for(const r of e)if(!(r in t))throw new Error(`Missing required chain parameter: ${r}`);this._chainParams=t}}for(const t of this.hardforks())if(void 0===t.block)throw new Error("Hardfork cannot have undefined block number");return this._chainParams}setHardfork(t){let e=!1;for(const r of this.HARDFORK_CHANGES)r[0]===t&&(this._hardfork!==t&&(this._hardfork=t,this.emit("hardforkChanged",t)),e=!0);if(!e)throw new Error(`Hardfork with name ${t} not supported`)}getHardforkByBlockNumber(t,e,r){t=(0,i.toType)(t,i.TypeOutput.BigInt),e=(0,i.toType)(e,i.TypeOutput.BigInt),r=(0,i.toType)(r,i.TypeOutput.Number);const n=this.hardforks().filter((t=>null!==t.block||null!==t.ttd&&void 0!==t.ttd||void 0!==t.timestamp)),o=n.findIndex((t=>null!==t.ttd&&void 0!==t.ttd));if(n.slice(o+1).findIndex((t=>null!==t.ttd&&void 0!==t.ttd))>=0)throw Error("More than one merge hardforks found with ttd specified");let s=n.findIndex((e=>null!==e.block&&e.block>t||void 0!==r&&Number(e.timestamp)>r));if(-1===s)s=n.length;else if(0===s)throw Error("Must have at least one hardfork at block 0");if(void 0===r){s-=n.slice(0,s).reverse().findIndex((t=>null!==t.block||void 0!==t.ttd))}if(s-=1,null===n[s].block&&void 0===n[s].timestamp)(null==e||BigInt(n[s].ttd)>e)&&(s-=1);else if(o>=0&&null!=e){if(s>=o&&BigInt(n[o].ttd)>e)throw Error("Maximum HF determined by total difficulty is lower than the block number HF");if(s<o&&BigInt(n[o].ttd)<=e)throw Error("HF determined by block number is lower than the minimum total difficulty HF")}const a=s;for(;s<n.length-1&&(n[s].block===n[s+1].block&&n[s].timestamp===n[s+1].timestamp);s++);if(r){if(n.slice(0,a).reduce(((t,e)=>Math.max(Number(e.timestamp??"0"),t)),0)>r)throw Error("Maximum HF determined by timestamp is lower than the block number/ttd HF");if(n.slice(s+1).reduce(((t,e)=>Math.min(Number(e.timestamp??r),t)),r)<r)throw Error("Maximum HF determined by block number/ttd is lower than timestamp HF")}return n[s].name}setHardforkByBlockNumber(t,e,r){const n=this.getHardforkByBlockNumber(t,e,r);return this.setHardfork(n),n}_getHardfork(t){const e=this.hardforks();for(const r of e)if(r.name===t)return r;return null}setEIPs(t=[]){for(const e of t){if(!(e in l.EIPs))throw new Error(`${e} not supported`);const r=this.gteHardfork(l.EIPs[e].minimumHardfork);if(!r)throw new Error(`${e} cannot be activated on hardfork ${this.hardfork()}, minimumHardfork: ${r}`);if(void 0!==l.EIPs[e].requiredEIPs)for(const r of l.EIPs[e].requiredEIPs)if(!t.includes(r)&&!this.isActivatedEIP(r))throw new Error(`${e} requires EIP ${r}, but is not included in the EIP list`)}this._eips=t}param(t,e){let r;for(const n of this._eips)if(r=this.paramByEIP(t,e,n),void 0!==r)return r;return this.paramByHardfork(t,e,this._hardfork)}paramByHardfork(t,e,r){let n=null;for(const i of this.HARDFORK_CHANGES){if("eips"in i[1]){const r=i[1].eips;for(const i of r){const r=this.paramByEIP(t,e,i);n="bigint"==typeof r?r:n}}else{if(void 0===i[1][t])throw new Error(`Topic ${t} not defined`);void 0!==i[1][t][e]&&(n=i[1][t][e].v)}if(i[0]===r)break}return BigInt(n??0)}paramByEIP(t,e,r){if(!(r in l.EIPs))throw new Error(`${r} not supported`);const n=l.EIPs[r];if(!(t in n))throw new Error(`Topic ${t} not defined`);if(void 0===n[t][e])return;const i=n[t][e].v;return BigInt(i)}paramByBlock(t,e,r,n,i){const o=this.getHardforkByBlockNumber(r,n,i);return this.paramByHardfork(t,e,o)}isActivatedEIP(t){if(this.eips().includes(t))return!0;for(const e of this.HARDFORK_CHANGES){const r=e[1];if(this.gteHardfork(r.name)&&"eips"in r&&r.eips.includes(t))return!0}return!1}hardforkIsActiveOnBlock(t,e){e=(0,i.toType)(e,i.TypeOutput.BigInt),t=t??this._hardfork;const r=this.hardforkBlock(t);return"bigint"==typeof r&&r!==BigInt(0)&&e>=r}activeOnBlock(t){return this.hardforkIsActiveOnBlock(null,t)}hardforkGteHardfork(t,e){t=t??this._hardfork;const r=this.hardforks();let n=-1,i=-1,o=0;for(const s of r)s.name===t&&(n=o),s.name===e&&(i=o),o+=1;return n>=i&&-1!==i}gteHardfork(t){return this.hardforkGteHardfork(null,t)}hardforkBlock(t){t=t??this._hardfork;const e=this._getHardfork(t)?.block;return null==e?null:BigInt(e)}hardforkTimestamp(t){t=t??this._hardfork;const e=this._getHardfork(t)?.timestamp;return null==e?null:BigInt(e)}eipBlock(t){for(const e of this.HARDFORK_CHANGES){const r=e[1];if("eips"in r&&r.eips.includes(t))return this.hardforkBlock(e[0])}return null}hardforkTTD(t){t=t??this._hardfork;const e=this._getHardfork(t)?.ttd;return null==e?null:BigInt(e)}isHardforkBlock(t,e){t=(0,i.toType)(t,i.TypeOutput.BigInt),e=e??this._hardfork;const r=this.hardforkBlock(e);return"bigint"==typeof r&&r!==BigInt(0)&&r===t}nextHardforkBlockOrTimestamp(t){t=t??this._hardfork;const e=this.hardforks();let r=e.findIndex((e=>e.name===t));if(t===d.Hardfork.Merge&&(r-=1),r<0)return null;let n=e[r].timestamp??e[r].block;n=null!=n?Number(n):null;const i=e.slice(r+1).find((t=>{let e=t.timestamp??t.block;return e=null!=e?Number(e):null,t.name!==d.Hardfork.Merge&&null!=e&&e!==n}));if(void 0===i)return null;const o=i.timestamp??i.block;return null==o?null:BigInt(o)}nextHardforkBlock(t){t=t??this._hardfork;let e=this.hardforkBlock(t);if(null===e&&t===d.Hardfork.Merge){const t=this.hardforks(),r=t.findIndex((t=>null!==t.ttd&&void 0!==t.ttd));if(r<0)throw Error("Merge hardfork should have been found");e=this.hardforkBlock(t[r-1].name)}if(null===e)return null;return this.hardforks().reduce(((t,r)=>{const n=BigInt(null===r.block||void 0!==r.ttd&&null!==r.ttd?0:r.block);return n>e&&null===t?n:t}),null)}isNextHardforkBlock(t,e){t=(0,i.toType)(t,i.TypeOutput.BigInt),e=e??this._hardfork;const r=this.nextHardforkBlock(e);return null!==r&&r===t}_calcForkHash(t,e){let r=n.alloc(0),s=0;for(const e of this.hardforks()){const{block:i,timestamp:o,name:a}=e;let u=o??i;if(u=null!==u?Number(u):null,"number"==typeof u&&0!==u&&u!==s&&a!==d.Hardfork.Merge){const t=n.from(u.toString(16).padStart(16,"0"),"hex");r=n.concat([r,t]),s=u}if(e.name===t)break}const a=n.concat([e,r]);return`0x${(0,i.intToBuffer)((0,o.buf)(a)>>>0).toString("hex")}`}forkHash(t,e){t=t??this._hardfork;const r=this._getHardfork(t);if(null===r||null===r?.block&&void 0===r?.timestamp&&void 0===r?.ttd){throw new Error("No fork hash calculation possible for future hardfork")}if(null!=r?.forkHash)return r.forkHash;if(!e)throw new Error("genesisHash required for forkHash calculation");return this._calcForkHash(t,e)}hardforkForForkHash(t){const e=this.hardforks().filter((e=>e.forkHash===t));return e.length>=1?e[e.length-1]:null}setForkHashes(t){for(const e of this.hardforks()){const r=e.timestamp??e.block;null!==e.forkHash&&void 0!==e.forkHash||null==r&&void 0===e.ttd||(e.forkHash=this.forkHash(e.name,t))}}genesis(){return this._chainParams.genesis}hardforks(){return this._chainParams.hardforks}bootstrapNodes(){return this._chainParams.bootstrapNodes}dnsNetworks(){return this._chainParams.dnsNetworks}hardfork(){return this._hardfork}chainId(){return BigInt(this._chainParams.chainId)}chainName(){return this._chainParams.name}networkId(){return BigInt(this._chainParams.networkId)}eips(){return this._eips}consensusType(){const t=this.hardfork();let e;for(const r of this.HARDFORK_CHANGES)if("consensus"in r[1]&&(e=r[1].consensus.type),r[0]===t)break;return e??this._chainParams.consensus.type}consensusAlgorithm(){const t=this.hardfork();let e;for(const r of this.HARDFORK_CHANGES)if("consensus"in r[1]&&(e=r[1].consensus.algorithm),r[0]===t)break;return e??this._chainParams.consensus.algorithm}consensusConfig(){const t=this.hardfork();let e;for(const r of this.HARDFORK_CHANGES)if("consensus"in r[1]&&(e=r[1].consensus[r[1].consensus.algorithm]),r[0]===t)break;return e??this._chainParams.consensus[this.consensusAlgorithm()]??{}}copy(){const t=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return t.removeAllListeners(),t}static _getInitializedChains(t){const e={};for(const[t,r]of Object.entries(d.Chain))e[r]=t.toLowerCase();const r={mainnet:u,ropsten:c,rinkeby:h,goerli:a,sepolia:f};if(t)for(const n of t){const{name:t}=n;e[n.chainId.toString()]=t,r[t]=n}return r.names=e,r}}e.Common=g},7438:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EIPs=void 0,e.EIPs={1153:r(4104),1559:r(1187),2315:r(2643),2537:r(7158),2565:r(8499),2718:r(6796),2929:r(8345),2930:r(8185),3074:r(9579),3198:r(445),3529:r(6102),3540:r(1800),3541:r(2867),3554:r(8691),3607:r(4519),3651:r(7459),3670:r(3632),3675:r(1794),3855:r(7749),3860:r(9063),4345:r(7113),4399:r(9602),4844:r(4240),4895:r(5357),5133:r(4304)}},3292:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CustomChain=e.ConsensusAlgorithm=e.ConsensusType=e.Hardfork=e.Chain=void 0,function(t){t[t.Mainnet=1]="Mainnet",t[t.Ropsten=3]="Ropsten",t[t.Rinkeby=4]="Rinkeby",t[t.Goerli=5]="Goerli",t[t.Sepolia=11155111]="Sepolia"}(e.Chain||(e.Chain={})),function(t){t.Chainstart="chainstart",t.Homestead="homestead",t.Dao="dao",t.TangerineWhistle="tangerineWhistle",t.SpuriousDragon="spuriousDragon",t.Byzantium="byzantium",t.Constantinople="constantinople",t.Petersburg="petersburg",t.Istanbul="istanbul",t.MuirGlacier="muirGlacier",t.Berlin="berlin",t.London="london",t.ArrowGlacier="arrowGlacier",t.GrayGlacier="grayGlacier",t.MergeForkIdTransition="mergeForkIdTransition",t.Merge="merge",t.Shanghai="shanghai",t.ShardingForkDev="shardingFork"}(e.Hardfork||(e.Hardfork={})),function(t){t.ProofOfStake="pos",t.ProofOfWork="pow",t.ProofOfAuthority="poa"}(e.ConsensusType||(e.ConsensusType={})),function(t){t.Ethash="ethash",t.Clique="clique",t.Casper="casper"}(e.ConsensusAlgorithm||(e.ConsensusAlgorithm={})),function(t){t.PolygonMainnet="polygon-mainnet",t.PolygonMumbai="polygon-mumbai",t.ArbitrumRinkebyTestnet="arbitrum-rinkeby-testnet",t.ArbitrumOne="arbitrum-one",t.xDaiChain="x-dai-chain",t.OptimisticKovan="optimistic-kovan",t.OptimisticEthereum="optimistic-ethereum"}(e.CustomChain||(e.CustomChain={}))},7240:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hardforks=void 0,e.hardforks={chainstart:r(8158),homestead:r(5516),dao:r(6888),tangerineWhistle:r(4350),spuriousDragon:r(2146),byzantium:r(3099),constantinople:r(3068),petersburg:r(3385),istanbul:r(208),muirGlacier:r(50),berlin:r(5880),london:r(3352),shanghai:r(369),arrowGlacier:r(4211),grayGlacier:r(7184),mergeForkIdTransition:r(9402),merge:r(977),shardingFork:r(7968)}},7783:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(8519),e),i(r(3292),e),i(r(6530),e),i(r(3337),e)},6530:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3337:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseGethGenesis=void 0;const n=r(5372),i=r(3292);function o(t,e=!0){const{name:r,config:o,difficulty:s,mixHash:a,gasLimit:u,coinbase:h,baseFeePerGas:c}=t;let{extraData:f,timestamp:l,nonce:d}=t;const p=Number(l),{chainId:m}=o;if(""===f&&(f="0x"),(0,n.isHexPrefixed)(l)||(l=(0,n.intToHex)(parseInt(l))),18!==d.length&&(d=function(t){return t&&"0x0"!==t?(0,n.isHexPrefixed)(t)?"0x"+(0,n.stripHexPrefix)(t).padStart(16,"0"):"0x"+t.padStart(16,"0"):"0x0000000000000000"}(d)),o.eip155Block!==o.eip158Block)throw new Error("EIP155 block number must equal EIP 158 block number since both are part of SpuriousDragon hardfork and the client only supports activating the full hardfork");const g={name:r,chainId:m,networkId:m,genesis:{timestamp:l,gasLimit:parseInt(u),difficulty:parseInt(s),nonce:d,extraData:f,mixHash:a,coinbase:h,baseFeePerGas:c},hardfork:void 0,hardforks:[],bootstrapNodes:[],consensus:void 0!==o.clique?{type:"poa",algorithm:"clique",clique:{period:o.clique.period??o.clique.blockperiodseconds,epoch:o.clique.epoch??o.clique.epochlength}}:{type:"pow",algorithm:"ethash",ethash:{}}},b={[i.Hardfork.Homestead]:{name:"homesteadBlock"},[i.Hardfork.Dao]:{name:"daoForkBlock"},[i.Hardfork.TangerineWhistle]:{name:"eip150Block"},[i.Hardfork.SpuriousDragon]:{name:"eip155Block"},[i.Hardfork.Byzantium]:{name:"byzantiumBlock"},[i.Hardfork.Constantinople]:{name:"constantinopleBlock"},[i.Hardfork.Petersburg]:{name:"petersburgBlock"},[i.Hardfork.Istanbul]:{name:"istanbulBlock"},[i.Hardfork.MuirGlacier]:{name:"muirGlacierBlock"},[i.Hardfork.Berlin]:{name:"berlinBlock"},[i.Hardfork.London]:{name:"londonBlock"},[i.Hardfork.MergeForkIdTransition]:{name:"mergeForkBlock",postMerge:e},[i.Hardfork.Shanghai]:{name:"shanghaiTime",postMerge:!0,isTimestamp:!0},[i.Hardfork.ShardingForkDev]:{name:"shardingForkTime",postMerge:!0,isTimestamp:!0}},y=Object.keys(b).reduce(((t,e)=>(t[b[e].name]=e,t)),{}),v=Object.keys(o).filter((t=>void 0!==y[t]&&void 0!==o[t]&&null!==o[t]));if(g.hardforks=v.map((t=>({name:y[t],block:!0===b[y[t]].isTimestamp||"number"!=typeof o[t]?null:o[t],timestamp:!0===b[y[t]].isTimestamp&&"number"==typeof o[t]?o[t]:void 0}))).filter((t=>null!==t.block||void 0!==t.timestamp)),g.hardforks.sort((function(t,e){return(t.block??1/0)-(e.block??1/0)})),g.hardforks.sort((function(t,e){return(t.timestamp??p)-(e.timestamp??p)})),void 0!==o.terminalTotalDifficulty){const t={name:i.Hardfork.Merge,ttd:o.terminalTotalDifficulty,block:null},e=g.hardforks.findIndex((t=>!0===b[t.name]?.postMerge));-1!==e?g.hardforks.splice(e,0,t):g.hardforks.push(t)}const w=g.hardforks.length>0?g.hardforks.slice(-1)[0]:void 0;return g.hardfork=w?.name,g.hardforks.unshift({name:i.Hardfork.Chainstart,block:0}),g}e.parseGethGenesis=function(t,e,r){try{if(["config","difficulty","gasLimit","alloc"].some((e=>!(e in t))))throw new Error("Invalid format, expected geth genesis fields missing");return void 0!==e&&(t.name=e),o(t,r)}catch(t){throw new Error(`Error parsing parameters file: ${t.message}`)}}},3397:()=>{},3196:()=>{},8087:()=>{},8351:()=>{},395:()=>{},488:()=>{},732:()=>{},9640:()=>{},4087:()=>{},6024:()=>{},3260:()=>{},5862:()=>{},4854:()=>{},6602:()=>{},5338:()=>{},2404:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assertExhaustive=e.assertStruct=e.assert=e.AssertionError=void 0;const n=r(7169),i=r(3862);function o(t,e){return r=t,Boolean("string"==typeof r?.prototype?.constructor?.name)?new t({message:e}):t({message:e});var r}class s extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}e.AssertionError=s,e.assert=function(t,e="Assertion failed.",r=s){if(!t){if(e instanceof Error)throw e;throw o(r,e)}},e.assertStruct=function(t,e,r="Assertion failed",a=s){try{(0,n.assert)(t,e)}catch(t){throw o(a,`${r}: ${function(t){return(0,i.getErrorMessage)(t).replace(/\.$/u,"")}(t)}.`)}},e.assertExhaustive=function(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}},8434:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.base64=void 0;const n=r(7169),i=r(2404);e.base64=(t,e={})=>{const r=e.paddingRequired??!1,o=e.characterSet??"base64";let s,a;return"base64"===o?s=String.raw`[A-Za-z0-9+\/]`:((0,i.assert)("base64url"===o),s=String.raw`[-_A-Za-z0-9]`),a=r?new RegExp(`^(?:${s}{4})*(?:${s}{3}=|${s}{2}==)?$`,"u"):new RegExp(`^(?:${s}{4})*(?:${s}{2,3}|${s}{3}=|${s}{2}==)?$`,"u"),(0,n.pattern)(t,a)}},5723:(t,e,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.createDataView=e.concatBytes=e.valueToBytes=e.base64ToBytes=e.stringToBytes=e.numberToBytes=e.signedBigIntToBytes=e.bigIntToBytes=e.hexToBytes=e.bytesToBase64=e.bytesToString=e.bytesToNumber=e.bytesToSignedBigInt=e.bytesToBigInt=e.bytesToHex=e.assertIsBytes=e.isBytes=void 0;const i=r(7247),o=r(2404),s=r(5477),a=48,u=58,h=87;const c=function(){const t=[];return()=>{if(0===t.length)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}();function f(t){return t instanceof Uint8Array}function l(t){(0,o.assert)(f(t),"Value must be a Uint8Array.")}function d(t){if(l(t),0===t.length)return"0x";const e=c(),r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=e[t[n]];return(0,s.add0x)(r.join(""))}function p(t){l(t);const e=d(t);return BigInt(e)}function m(t){if("0x"===t?.toLowerCase?.())return new Uint8Array;(0,s.assertIsHexString)(t);const e=(0,s.remove0x)(t).toLowerCase(),r=e.length%2==0?e:`0${e}`,n=new Uint8Array(r.length/2);for(let t=0;t<n.length;t++){const e=r.charCodeAt(2*t),i=r.charCodeAt(2*t+1),o=e-(e<u?a:h),s=i-(i<u?a:h);n[t]=16*o+s}return n}function g(t){(0,o.assert)("bigint"==typeof t,"Value must be a bigint."),(0,o.assert)(t>=BigInt(0),"Value must be a non-negative bigint.");return m(t.toString(16))}function b(t){(0,o.assert)("number"==typeof t,"Value must be a number."),(0,o.assert)(t>=0,"Value must be a non-negative number."),(0,o.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");return m(t.toString(16))}function y(t){return(0,o.assert)("string"==typeof t,"Value must be a string."),(new TextEncoder).encode(t)}function v(t){if("bigint"==typeof t)return g(t);if("number"==typeof t)return b(t);if("string"==typeof t)return t.startsWith("0x")?m(t):y(t);if(f(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}e.isBytes=f,e.assertIsBytes=l,e.bytesToHex=d,e.bytesToBigInt=p,e.bytesToSignedBigInt=function(t){l(t);let e=BigInt(0);for(const r of t)e=(e<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*t.length,e)},e.bytesToNumber=function(t){l(t);const e=p(t);return(0,o.assert)(e<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(e)},e.bytesToString=function(t){return l(t),(new TextDecoder).decode(t)},e.bytesToBase64=function(t){return l(t),i.base64.encode(t)},e.hexToBytes=m,e.bigIntToBytes=g,e.signedBigIntToBytes=function(t,e){(0,o.assert)("bigint"==typeof t,"Value must be a bigint."),(0,o.assert)("number"==typeof e,"Byte length must be a number."),(0,o.assert)(e>0,"Byte length must be greater than 0."),(0,o.assert)(function(t,e){(0,o.assert)(e>0);const r=t>>BigInt(31);return!((~t&r)+(t&~r)>>BigInt(8*e-1))}(t,e),"Byte length is too small to represent the given value.");let r=t;const n=new Uint8Array(e);for(let t=0;t<n.length;t++)n[t]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()},e.numberToBytes=b,e.stringToBytes=y,e.base64ToBytes=function(t){return(0,o.assert)("string"==typeof t,"Value must be a string."),i.base64.decode(t)},e.valueToBytes=v,e.concatBytes=function(t){const e=new Array(t.length);let r=0;for(let n=0;n<t.length;n++){const i=v(t[n]);e[n]=i,r+=i.length}const n=new Uint8Array(r);for(let t=0,r=0;t<e.length;t++)n.set(e[t],r),r+=e[t].length;return n},e.createDataView=function(t){if(void 0!==n&&t instanceof n){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new DataView(e)}return new DataView(t.buffer,t.byteOffset,t.byteLength)}},8170:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toCaipChainId=e.parseCaipAccountId=e.parseCaipChainId=e.isCaipAccountAddress=e.isCaipAccountId=e.isCaipReference=e.isCaipNamespace=e.isCaipChainId=e.KnownCaipNamespace=e.CaipAccountAddressStruct=e.CaipAccountIdStruct=e.CaipReferenceStruct=e.CaipNamespaceStruct=e.CaipChainIdStruct=e.CAIP_ACCOUNT_ADDRESS_REGEX=e.CAIP_ACCOUNT_ID_REGEX=e.CAIP_REFERENCE_REGEX=e.CAIP_NAMESPACE_REGEX=e.CAIP_CHAIN_ID_REGEX=void 0;const n=r(7169);function i(t){return(0,n.is)(t,e.CaipNamespaceStruct)}function o(t){return(0,n.is)(t,e.CaipReferenceStruct)}e.CAIP_CHAIN_ID_REGEX=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,e.CAIP_NAMESPACE_REGEX=/^[-a-z0-9]{3,8}$/u,e.CAIP_REFERENCE_REGEX=/^[-_a-zA-Z0-9]{1,32}$/u,e.CAIP_ACCOUNT_ID_REGEX=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u,e.CAIP_ACCOUNT_ADDRESS_REGEX=/^[-.%a-zA-Z0-9]{1,128}$/u,e.CaipChainIdStruct=(0,n.pattern)((0,n.string)(),e.CAIP_CHAIN_ID_REGEX),e.CaipNamespaceStruct=(0,n.pattern)((0,n.string)(),e.CAIP_NAMESPACE_REGEX),e.CaipReferenceStruct=(0,n.pattern)((0,n.string)(),e.CAIP_REFERENCE_REGEX),e.CaipAccountIdStruct=(0,n.pattern)((0,n.string)(),e.CAIP_ACCOUNT_ID_REGEX),e.CaipAccountAddressStruct=(0,n.pattern)((0,n.string)(),e.CAIP_ACCOUNT_ADDRESS_REGEX),function(t){t.Eip155="eip155"}(e.KnownCaipNamespace||(e.KnownCaipNamespace={})),e.isCaipChainId=function(t){return(0,n.is)(t,e.CaipChainIdStruct)},e.isCaipNamespace=i,e.isCaipReference=o,e.isCaipAccountId=function(t){return(0,n.is)(t,e.CaipAccountIdStruct)},e.isCaipAccountAddress=function(t){return(0,n.is)(t,e.CaipAccountAddressStruct)},e.parseCaipChainId=function(t){const r=e.CAIP_CHAIN_ID_REGEX.exec(t);if(!r?.groups)throw new Error("Invalid CAIP chain ID.");return{namespace:r.groups.namespace,reference:r.groups.reference}},e.parseCaipAccountId=function(t){const r=e.CAIP_ACCOUNT_ID_REGEX.exec(t);if(!r?.groups)throw new Error("Invalid CAIP account ID.");return{address:r.groups.accountAddress,chainId:r.groups.chainId,chain:{namespace:r.groups.namespace,reference:r.groups.reference}}},e.toCaipChainId=function(t,r){if(!i(t))throw new Error(`Invalid "namespace", must match: ${e.CAIP_NAMESPACE_REGEX.toString()}`);if(!o(r))throw new Error(`Invalid "reference", must match: ${e.CAIP_REFERENCE_REGEX.toString()}`);return`${t}:${r}`}},9052:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChecksumStruct=void 0;const n=r(7169),i=r(8434);e.ChecksumStruct=(0,n.size)((0,i.base64)((0,n.string)(),{paddingRequired:!0}),44,44)},3275:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createHex=e.createBytes=e.createBigInt=e.createNumber=void 0;const n=r(7169),i=r(2404),o=r(5723),s=r(5477),a=(0,n.union)([(0,n.number)(),(0,n.bigint)(),(0,n.string)(),s.StrictHexStruct]),u=(0,n.coerce)((0,n.number)(),a,Number),h=(0,n.coerce)((0,n.bigint)(),a,BigInt),c=((0,n.union)([s.StrictHexStruct,(0,n.instance)(Uint8Array)]),(0,n.coerce)((0,n.instance)(Uint8Array),(0,n.union)([s.StrictHexStruct]),o.hexToBytes)),f=(0,n.coerce)(s.StrictHexStruct,(0,n.instance)(Uint8Array),o.bytesToHex);e.createNumber=function(t){try{const e=(0,n.create)(t,u);return(0,i.assert)(Number.isFinite(e),`Expected a number-like value, got "${t}".`),e}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a number-like value, got "${t}".`);throw e}},e.createBigInt=function(t){try{return(0,n.create)(t,h)}catch(t){if(t instanceof n.StructError)throw new Error(`Expected a number-like value, got "${String(t.value)}".`);throw t}},e.createBytes=function(t){if("string"==typeof t&&"0x"===t.toLowerCase())return new Uint8Array;try{return(0,n.create)(t,c)}catch(t){if(t instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(t.value)}".`);throw t}},e.createHex=function(t){if(t instanceof Uint8Array&&0===t.length||"string"==typeof t&&"0x"===t.toLowerCase())return"0x";try{return(0,n.create)(t,f)}catch(t){if(t instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(t.value)}".`);throw t}}},4489:function(t,e){"use strict";var r,n,i=this&&this.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)},o=this&&this.__classPrivateFieldSet||function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r};Object.defineProperty(e,"__esModule",{value:!0}),e.FrozenSet=e.FrozenMap=void 0;class s{get size(){return i(this,r,"f").size}[(r=new WeakMap,Symbol.iterator)](){return i(this,r,"f")[Symbol.iterator]()}constructor(t){r.set(this,void 0),o(this,r,new Map(t),"f"),Object.freeze(this)}entries(){return i(this,r,"f").entries()}forEach(t,e){return i(this,r,"f").forEach(((r,n,i)=>t.call(e,r,n,this)))}get(t){return i(this,r,"f").get(t)}has(t){return i(this,r,"f").has(t)}keys(){return i(this,r,"f").keys()}values(){return i(this,r,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([t,e])=>`${String(t)} => ${String(e)}`)).join(", ")} `:""}}`}}e.FrozenMap=s;class a{get size(){return i(this,n,"f").size}[(n=new WeakMap,Symbol.iterator)](){return i(this,n,"f")[Symbol.iterator]()}constructor(t){n.set(this,void 0),o(this,n,new Set(t),"f"),Object.freeze(this)}entries(){return i(this,n,"f").entries()}forEach(t,e){return i(this,n,"f").forEach(((r,n,i)=>t.call(e,r,n,this)))}has(t){return i(this,n,"f").has(t)}keys(){return i(this,n,"f").keys()}values(){return i(this,n,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((t=>String(t))).join(", ")} `:""}}`}}e.FrozenSet=a,Object.freeze(s),Object.freeze(s.prototype),Object.freeze(a),Object.freeze(a.prototype)},3790:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3862:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.wrapError=e.getErrorMessage=e.isErrorWithStack=e.isErrorWithMessage=e.isErrorWithCode=void 0;const n=r(9498),i=r(823);function o(t){return"object"==typeof t&&null!==t&&"code"in t}function s(t){return"object"==typeof t&&null!==t&&"message"in t}e.isErrorWithCode=o,e.isErrorWithMessage=s,e.isErrorWithStack=function(t){return"object"==typeof t&&null!==t&&"stack"in t},e.getErrorMessage=function(t){return s(t)&&"string"==typeof t.message?t.message:(0,i.isNullOrUndefined)(t)?"":String(t)},e.wrapError=function(t,e){if((r=t)instanceof Error||(0,i.isObject)(r)&&"Error"===r.constructor.name){let r;return r=2===Error.length?new Error(e,{cause:t}):new n.ErrorWithCause(e,{cause:t}),o(t)&&(r.code=t.code),r}var r;return e.length>0?new Error(`${String(t)}: ${e}`):new Error(String(t))}},5477:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.isValidChecksumAddress=e.getChecksumAddress=e.isValidHexAddress=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.HexChecksumAddressStruct=e.HexAddressStruct=e.StrictHexStruct=e.HexStruct=void 0;const n=r(7169),i=r(125),o=r(2404),s=r(5723);function a(t){return(0,n.is)(t,e.HexStruct)}function u(t){return(0,n.is)(t,e.StrictHexStruct)}function h(t){(0,o.assert)((0,n.is)(t,e.HexChecksumAddressStruct),"Invalid hex address.");const r=f(t.toLowerCase()),a=f((0,s.bytesToHex)((0,i.keccak_256)(r)));return`0x${r.split("").map(((t,e)=>{const r=a[e];return(0,o.assert)((0,n.is)(r,(0,n.string)()),"Hash shorter than address."),parseInt(r,16)>7?t.toUpperCase():t})).join("")}`}function c(t){return!!(0,n.is)(t,e.HexChecksumAddressStruct)&&h(t)===t}function f(t){return t.startsWith("0x")||t.startsWith("0X")?t.substring(2):t}e.HexStruct=(0,n.pattern)((0,n.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-f]+$/iu),e.HexAddressStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-f]{40}$/u),e.HexChecksumAddressStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-fA-F]{40}$/u),e.isHexString=a,e.isStrictHexString=u,e.assertIsHexString=function(t){(0,o.assert)(a(t),"Value must be a hexadecimal string.")},e.assertIsStrictHexString=function(t){(0,o.assert)(u(t),'Value must be a hexadecimal string, starting with "0x".')},e.isValidHexAddress=function(t){return(0,n.is)(t,e.HexAddressStruct)||c(t)},e.getChecksumAddress=h,e.isValidChecksumAddress=c,e.add0x=function(t){return t.startsWith("0x")?t:t.startsWith("0X")?`0x${t.substring(2)}`:`0x${t}`},e.remove0x=f},7827:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(2404),e),i(r(8434),e),i(r(5723),e),i(r(8170),e),i(r(9052),e),i(r(3275),e),i(r(4489),e),i(r(3790),e),i(r(3862),e),i(r(5477),e),i(r(5876),e),i(r(6916),e),i(r(4716),e),i(r(823),e),i(r(4608),e),i(r(8189),e),i(r(6792),e),i(r(5688),e),i(r(5549),e),i(r(8610),e)},5876:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.getSafeJson=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=e.exactOptional=e.object=void 0;const n=r(7169),i=r(2404),o=r(823);function s({path:t,branch:e}){const r=t[t.length-1];return(0,o.hasProperty)(e[e.length-2],r)}function a(t){return new n.Struct({...t,type:`optional ${t.type}`,validator:(e,r)=>!s(r)||t.validator(e,r),refiner:(e,r)=>!s(r)||t.refiner(e,r)})}e.object=t=>(0,n.object)(t),e.exactOptional=a;function u(t){return(0,n.create)(t,e.JsonStruct)}e.UnsafeJsonStruct=(0,n.union)([(0,n.literal)(null),(0,n.boolean)(),(0,n.define)("finite number",(t=>(0,n.is)(t,(0,n.number)())&&Number.isFinite(t))),(0,n.string)(),(0,n.array)((0,n.lazy)((()=>e.UnsafeJsonStruct))),(0,n.record)((0,n.string)(),(0,n.lazy)((()=>e.UnsafeJsonStruct)))]),e.JsonStruct=(0,n.coerce)(e.UnsafeJsonStruct,(0,n.any)(),(t=>((0,i.assertStruct)(t,e.UnsafeJsonStruct),JSON.parse(JSON.stringify(t,((t,e)=>{if("__proto__"!==t&&"constructor"!==t)return e})))))),e.isValidJson=function(t){try{return u(t),!0}catch{return!1}},e.getSafeJson=u,e.getJsonSize=function(t){(0,i.assertStruct)(t,e.JsonStruct,"Invalid JSON value");const r=JSON.stringify(t);return(new TextEncoder).encode(r).byteLength},e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,n.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,n.nullable)((0,n.union)([(0,n.number)(),(0,n.string)()])),e.JsonRpcErrorStruct=(0,e.object)({code:(0,n.integer)(),message:(0,n.string)(),data:a(e.JsonStruct),stack:a((0,n.string)())}),e.JsonRpcParamsStruct=(0,n.union)([(0,n.record)((0,n.string)(),e.JsonStruct),(0,n.array)(e.JsonStruct)]),e.JsonRpcRequestStruct=(0,e.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,n.string)(),params:a(e.JsonRpcParamsStruct)}),e.JsonRpcNotificationStruct=(0,e.object)({jsonrpc:e.JsonRpcVersionStruct,method:(0,n.string)(),params:a(e.JsonRpcParamsStruct)}),e.isJsonRpcNotification=function(t){return(0,n.is)(t,e.JsonRpcNotificationStruct)},e.assertIsJsonRpcNotification=function(t,r){(0,i.assertStruct)(t,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",r)},e.isJsonRpcRequest=function(t){return(0,n.is)(t,e.JsonRpcRequestStruct)},e.assertIsJsonRpcRequest=function(t,r){(0,i.assertStruct)(t,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",r)},e.PendingJsonRpcResponseStruct=(0,n.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,n.optional)((0,n.unknown)()),error:(0,n.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,e.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,e.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,n.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]),e.isPendingJsonRpcResponse=function(t){return(0,n.is)(t,e.PendingJsonRpcResponseStruct)},e.assertIsPendingJsonRpcResponse=function(t,r){(0,i.assertStruct)(t,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",r)},e.isJsonRpcResponse=function(t){return(0,n.is)(t,e.JsonRpcResponseStruct)},e.assertIsJsonRpcResponse=function(t,r){(0,i.assertStruct)(t,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",r)},e.isJsonRpcSuccess=function(t){return(0,n.is)(t,e.JsonRpcSuccessStruct)},e.assertIsJsonRpcSuccess=function(t,r){(0,i.assertStruct)(t,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",r)},e.isJsonRpcFailure=function(t){return(0,n.is)(t,e.JsonRpcFailureStruct)},e.assertIsJsonRpcFailure=function(t,r){(0,i.assertStruct)(t,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",r)},e.isJsonRpcError=function(t){return(0,n.is)(t,e.JsonRpcErrorStruct)},e.assertIsJsonRpcError=function(t,r){(0,i.assertStruct)(t,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",r)},e.getJsonRpcIdValidator=function(t){const{permitEmptyString:e,permitFractions:r,permitNull:n}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...t};return t=>Boolean("number"==typeof t&&(r||Number.isInteger(t))||"string"==typeof t&&(e||t.length>0)||n&&null===t)}},6916:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4716:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.createProjectLogger=void 0;const i=(0,n(r(5130)).default)("metamask");e.createProjectLogger=function(t){return i.extend(t)},e.createModuleLogger=function(t,e){return t.extend(e)}},823:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.getKnownPropertyNames=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0,e.isNonEmptyArray=function(t){return Array.isArray(t)&&t.length>0},e.isNullOrUndefined=function(t){return null==t},e.isObject=function(t){return Boolean(t)&&"object"==typeof t&&!Array.isArray(t)};function r(t){return t.charCodeAt(0)<=127}e.hasProperty=(t,e)=>Object.hasOwnProperty.call(t,e),e.getKnownPropertyNames=function(t){return Object.getOwnPropertyNames(t)},function(t){t[t.Null=4]="Null",t[t.Comma=1]="Comma",t[t.Wrapper=1]="Wrapper",t[t.True=4]="True",t[t.False=5]="False",t[t.Quote=1]="Quote",t[t.Colon=1]="Colon",t[t.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,e.isPlainObject=function(t){if("object"!=typeof t||null===t)return!1;try{let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}catch(t){return!1}},e.isASCII=r,e.calculateStringSize=function(t){return t.split("").reduce(((t,e)=>r(e)?t+1:t+2),0)+(t.match(e.ESCAPE_CHARACTERS_REGEXP)??[]).length},e.calculateNumberSize=function(t){return t.toString().length}},4608:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hexToBigInt=e.hexToNumber=e.bigIntToHex=e.numberToHex=void 0;const n=r(2404),i=r(5477);e.numberToHex=t=>((0,n.assert)("number"==typeof t,"Value must be a number."),(0,n.assert)(t>=0,"Value must be a non-negative number."),(0,n.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,i.add0x)(t.toString(16)));e.bigIntToHex=t=>((0,n.assert)("bigint"==typeof t,"Value must be a bigint."),(0,n.assert)(t>=0,"Value must be a non-negative bigint."),(0,i.add0x)(t.toString(16)));e.hexToNumber=t=>{(0,i.assertIsHexString)(t);const e=parseInt(t,16);return(0,n.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};e.hexToBigInt=t=>((0,i.assertIsHexString)(t),BigInt((0,i.add0x)(t)))},8189:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6792:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createDeferredPromise=void 0,e.createDeferredPromise=function({suppressUnhandledRejection:t=!1}={}){let e,r;const n=new Promise(((t,n)=>{e=t,r=n}));return t&&n.catch((t=>{})),{promise:n,resolve:e,reject:r}}},5688:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(t){t[t.Millisecond=1]="Millisecond",t[t.Second=1e3]="Second",t[t.Minute=6e4]="Minute",t[t.Hour=36e5]="Hour",t[t.Day=864e5]="Day",t[t.Week=6048e5]="Week",t[t.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const r=(t,e)=>{if(!(t=>Number.isInteger(t)&&t>=0)(t))throw new Error(`"${e}" must be a non-negative integer. Received: "${t}".`)};e.inMilliseconds=function(t,e){return r(t,"count"),t*e},e.timeSince=function(t){return r(t,"timestamp"),Date.now()-t}},5549:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},8610:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const n=r(7169),i=r(7699),o=r(2404);e.VersionStruct=(0,n.refine)((0,n.string)(),"Version",(t=>null!==(0,i.valid)(t)||`Expected SemVer version, got "${t}"`)),e.VersionRangeStruct=(0,n.refine)((0,n.string)(),"Version range",(t=>null!==(0,i.validRange)(t)||`Expected SemVer range, got "${t}"`)),e.isValidSemVerVersion=function(t){return(0,n.is)(t,e.VersionStruct)},e.isValidSemVerRange=function(t){return(0,n.is)(t,e.VersionRangeStruct)},e.assertIsSemVerVersion=function(t){(0,o.assertStruct)(t,e.VersionStruct)},e.assertIsSemVerRange=function(t){(0,o.assertStruct)(t,e.VersionRangeStruct)},e.gtVersion=function(t,e){return(0,i.gt)(t,e)},e.gtRange=function(t,e){return(0,i.gtr)(t,e)},e.satisfiesVersionRange=function(t,e){return(0,i.satisfies)(t,e,{includePrerelease:!0})}},257:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assertExhaustive=e.assertStruct=e.assert=e.AssertionError=void 0;const n=r(7169),i=r(107);function o(t,e){return r=t,Boolean("string"==typeof r?.prototype?.constructor?.name)?new t({message:e}):t({message:e});var r}class s extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}e.AssertionError=s,e.assert=function(t,e="Assertion failed.",r=s){if(!t){if(e instanceof Error)throw e;throw o(r,e)}},e.assertStruct=function(t,e,r="Assertion failed",a=s){try{(0,n.assert)(t,e)}catch(t){throw o(a,`${r}: ${function(t){return(0,i.getErrorMessage)(t).replace(/\.$/u,"")}(t)}.`)}},e.assertExhaustive=function(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}},8732:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.base64=void 0;const n=r(7169),i=r(257);e.base64=(t,e={})=>{const r=e.paddingRequired??!1,o=e.characterSet??"base64";let s,a;return"base64"===o?s=String.raw`[A-Za-z0-9+\/]`:((0,i.assert)("base64url"===o),s=String.raw`[-_A-Za-z0-9]`),a=r?new RegExp(`^(?:${s}{4})*(?:${s}{3}=|${s}{2}==)?$`,"u"):new RegExp(`^(?:${s}{4})*(?:${s}{2,3}|${s}{3}=|${s}{2}==)?$`,"u"),(0,n.pattern)(t,a)}},4585:(t,e,r)=>{"use strict";var n=r(8834).Buffer;Object.defineProperty(e,"__esModule",{value:!0}),e.createDataView=e.concatBytes=e.valueToBytes=e.base64ToBytes=e.stringToBytes=e.numberToBytes=e.signedBigIntToBytes=e.bigIntToBytes=e.hexToBytes=e.bytesToBase64=e.bytesToString=e.bytesToNumber=e.bytesToSignedBigInt=e.bytesToBigInt=e.bytesToHex=e.assertIsBytes=e.isBytes=void 0;const i=r(7434),o=r(257),s=r(4126),a=48,u=58,h=87;const c=function(){const t=[];return()=>{if(0===t.length)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}();function f(t){return t instanceof Uint8Array}function l(t){(0,o.assert)(f(t),"Value must be a Uint8Array.")}function d(t){if(l(t),0===t.length)return"0x";const e=c(),r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=e[t[n]];return(0,s.add0x)(r.join(""))}function p(t){l(t);const e=d(t);return BigInt(e)}function m(t){if("0x"===t?.toLowerCase?.())return new Uint8Array;(0,s.assertIsHexString)(t);const e=(0,s.remove0x)(t).toLowerCase(),r=e.length%2==0?e:`0${e}`,n=new Uint8Array(r.length/2);for(let t=0;t<n.length;t++){const e=r.charCodeAt(2*t),i=r.charCodeAt(2*t+1),o=e-(e<u?a:h),s=i-(i<u?a:h);n[t]=16*o+s}return n}function g(t){(0,o.assert)("bigint"==typeof t,"Value must be a bigint."),(0,o.assert)(t>=BigInt(0),"Value must be a non-negative bigint.");return m(t.toString(16))}function b(t){(0,o.assert)("number"==typeof t,"Value must be a number."),(0,o.assert)(t>=0,"Value must be a non-negative number."),(0,o.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");return m(t.toString(16))}function y(t){return(0,o.assert)("string"==typeof t,"Value must be a string."),(new TextEncoder).encode(t)}function v(t){if("bigint"==typeof t)return g(t);if("number"==typeof t)return b(t);if("string"==typeof t)return t.startsWith("0x")?m(t):y(t);if(f(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}e.isBytes=f,e.assertIsBytes=l,e.bytesToHex=d,e.bytesToBigInt=p,e.bytesToSignedBigInt=function(t){l(t);let e=BigInt(0);for(const r of t)e=(e<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*t.length,e)},e.bytesToNumber=function(t){l(t);const e=p(t);return(0,o.assert)(e<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(e)},e.bytesToString=function(t){return l(t),(new TextDecoder).decode(t)},e.bytesToBase64=function(t){return l(t),i.base64.encode(t)},e.hexToBytes=m,e.bigIntToBytes=g,e.signedBigIntToBytes=function(t,e){(0,o.assert)("bigint"==typeof t,"Value must be a bigint."),(0,o.assert)("number"==typeof e,"Byte length must be a number."),(0,o.assert)(e>0,"Byte length must be greater than 0."),(0,o.assert)(function(t,e){(0,o.assert)(e>0);const r=t>>BigInt(31);return!((~t&r)+(t&~r)>>BigInt(8*e-1))}(t,e),"Byte length is too small to represent the given value.");let r=t;const n=new Uint8Array(e);for(let t=0;t<n.length;t++)n[t]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()},e.numberToBytes=b,e.stringToBytes=y,e.base64ToBytes=function(t){return(0,o.assert)("string"==typeof t,"Value must be a string."),i.base64.decode(t)},e.valueToBytes=v,e.concatBytes=function(t){const e=new Array(t.length);let r=0;for(let n=0;n<t.length;n++){const i=v(t[n]);e[n]=i,r+=i.length}const n=new Uint8Array(r);for(let t=0,r=0;t<e.length;t++)n.set(e[t],r),r+=e[t].length;return n},e.createDataView=function(t){if(void 0!==n&&t instanceof n){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new DataView(e)}return new DataView(t.buffer,t.byteOffset,t.byteLength)}},3470:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toCaipChainId=e.parseCaipAccountId=e.parseCaipChainId=e.isCaipAccountAddress=e.isCaipAccountId=e.isCaipReference=e.isCaipNamespace=e.isCaipChainId=e.KnownCaipNamespace=e.CaipAccountAddressStruct=e.CaipAccountIdStruct=e.CaipReferenceStruct=e.CaipNamespaceStruct=e.CaipChainIdStruct=e.CAIP_ACCOUNT_ADDRESS_REGEX=e.CAIP_ACCOUNT_ID_REGEX=e.CAIP_REFERENCE_REGEX=e.CAIP_NAMESPACE_REGEX=e.CAIP_CHAIN_ID_REGEX=void 0;const n=r(7169);function i(t){return(0,n.is)(t,e.CaipNamespaceStruct)}function o(t){return(0,n.is)(t,e.CaipReferenceStruct)}e.CAIP_CHAIN_ID_REGEX=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,e.CAIP_NAMESPACE_REGEX=/^[-a-z0-9]{3,8}$/u,e.CAIP_REFERENCE_REGEX=/^[-_a-zA-Z0-9]{1,32}$/u,e.CAIP_ACCOUNT_ID_REGEX=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u,e.CAIP_ACCOUNT_ADDRESS_REGEX=/^[-.%a-zA-Z0-9]{1,128}$/u,e.CaipChainIdStruct=(0,n.pattern)((0,n.string)(),e.CAIP_CHAIN_ID_REGEX),e.CaipNamespaceStruct=(0,n.pattern)((0,n.string)(),e.CAIP_NAMESPACE_REGEX),e.CaipReferenceStruct=(0,n.pattern)((0,n.string)(),e.CAIP_REFERENCE_REGEX),e.CaipAccountIdStruct=(0,n.pattern)((0,n.string)(),e.CAIP_ACCOUNT_ID_REGEX),e.CaipAccountAddressStruct=(0,n.pattern)((0,n.string)(),e.CAIP_ACCOUNT_ADDRESS_REGEX),function(t){t.Eip155="eip155"}(e.KnownCaipNamespace||(e.KnownCaipNamespace={})),e.isCaipChainId=function(t){return(0,n.is)(t,e.CaipChainIdStruct)},e.isCaipNamespace=i,e.isCaipReference=o,e.isCaipAccountId=function(t){return(0,n.is)(t,e.CaipAccountIdStruct)},e.isCaipAccountAddress=function(t){return(0,n.is)(t,e.CaipAccountAddressStruct)},e.parseCaipChainId=function(t){const r=e.CAIP_CHAIN_ID_REGEX.exec(t);if(!r?.groups)throw new Error("Invalid CAIP chain ID.");return{namespace:r.groups.namespace,reference:r.groups.reference}},e.parseCaipAccountId=function(t){const r=e.CAIP_ACCOUNT_ID_REGEX.exec(t);if(!r?.groups)throw new Error("Invalid CAIP account ID.");return{address:r.groups.accountAddress,chainId:r.groups.chainId,chain:{namespace:r.groups.namespace,reference:r.groups.reference}}},e.toCaipChainId=function(t,r){if(!i(t))throw new Error(`Invalid "namespace", must match: ${e.CAIP_NAMESPACE_REGEX.toString()}`);if(!o(r))throw new Error(`Invalid "reference", must match: ${e.CAIP_REFERENCE_REGEX.toString()}`);return`${t}:${r}`}},3497:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChecksumStruct=void 0;const n=r(7169),i=r(8732);e.ChecksumStruct=(0,n.size)((0,i.base64)((0,n.string)(),{paddingRequired:!0}),44,44)},7425:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createHex=e.createBytes=e.createBigInt=e.createNumber=void 0;const n=r(7169),i=r(257),o=r(4585),s=r(4126),a=(0,n.union)([(0,n.number)(),(0,n.bigint)(),(0,n.string)(),s.StrictHexStruct]),u=(0,n.coerce)((0,n.number)(),a,Number),h=(0,n.coerce)((0,n.bigint)(),a,BigInt),c=((0,n.union)([s.StrictHexStruct,(0,n.instance)(Uint8Array)]),(0,n.coerce)((0,n.instance)(Uint8Array),(0,n.union)([s.StrictHexStruct]),o.hexToBytes)),f=(0,n.coerce)(s.StrictHexStruct,(0,n.instance)(Uint8Array),o.bytesToHex);e.createNumber=function(t){try{const e=(0,n.create)(t,u);return(0,i.assert)(Number.isFinite(e),`Expected a number-like value, got "${t}".`),e}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a number-like value, got "${t}".`);throw e}},e.createBigInt=function(t){try{return(0,n.create)(t,h)}catch(t){if(t instanceof n.StructError)throw new Error(`Expected a number-like value, got "${String(t.value)}".`);throw t}},e.createBytes=function(t){if("string"==typeof t&&"0x"===t.toLowerCase())return new Uint8Array;try{return(0,n.create)(t,c)}catch(t){if(t instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(t.value)}".`);throw t}},e.createHex=function(t){if(t instanceof Uint8Array&&0===t.length||"string"==typeof t&&"0x"===t.toLowerCase())return"0x";try{return(0,n.create)(t,f)}catch(t){if(t instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(t.value)}".`);throw t}}},2107:function(t,e){"use strict";var r,n,i=this&&this.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)},o=this&&this.__classPrivateFieldSet||function(t,e,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,r):i?i.value=r:e.set(t,r),r};Object.defineProperty(e,"__esModule",{value:!0}),e.FrozenSet=e.FrozenMap=void 0;class s{get size(){return i(this,r,"f").size}[(r=new WeakMap,Symbol.iterator)](){return i(this,r,"f")[Symbol.iterator]()}constructor(t){r.set(this,void 0),o(this,r,new Map(t),"f"),Object.freeze(this)}entries(){return i(this,r,"f").entries()}forEach(t,e){return i(this,r,"f").forEach(((r,n,i)=>t.call(e,r,n,this)))}get(t){return i(this,r,"f").get(t)}has(t){return i(this,r,"f").has(t)}keys(){return i(this,r,"f").keys()}values(){return i(this,r,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([t,e])=>`${String(t)} => ${String(e)}`)).join(", ")} `:""}}`}}e.FrozenMap=s;class a{get size(){return i(this,n,"f").size}[(n=new WeakMap,Symbol.iterator)](){return i(this,n,"f")[Symbol.iterator]()}constructor(t){n.set(this,void 0),o(this,n,new Set(t),"f"),Object.freeze(this)}entries(){return i(this,n,"f").entries()}forEach(t,e){return i(this,n,"f").forEach(((r,n,i)=>t.call(e,r,n,this)))}has(t){return i(this,n,"f").has(t)}keys(){return i(this,n,"f").keys()}values(){return i(this,n,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((t=>String(t))).join(", ")} `:""}}`}}e.FrozenSet=a,Object.freeze(s),Object.freeze(s.prototype),Object.freeze(a),Object.freeze(a.prototype)},9624:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},107:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.wrapError=e.getErrorMessage=e.isErrorWithStack=e.isErrorWithMessage=e.isErrorWithCode=void 0;const n=r(9498),i=r(6774);function o(t){return"object"==typeof t&&null!==t&&"code"in t}function s(t){return"object"==typeof t&&null!==t&&"message"in t}e.isErrorWithCode=o,e.isErrorWithMessage=s,e.isErrorWithStack=function(t){return"object"==typeof t&&null!==t&&"stack"in t},e.getErrorMessage=function(t){return s(t)&&"string"==typeof t.message?t.message:(0,i.isNullOrUndefined)(t)?"":String(t)},e.wrapError=function(t,e){if((r=t)instanceof Error||(0,i.isObject)(r)&&"Error"===r.constructor.name){let r;return r=2===Error.length?new Error(e,{cause:t}):new n.ErrorWithCause(e,{cause:t}),o(t)&&(r.code=t.code),r}var r;return e.length>0?new Error(`${String(t)}: ${e}`):new Error(String(t))}},4126:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.isValidChecksumAddress=e.getChecksumAddress=e.isValidHexAddress=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.HexChecksumAddressStruct=e.HexAddressStruct=e.StrictHexStruct=e.HexStruct=void 0;const n=r(7169),i=r(125),o=r(257),s=r(4585);function a(t){return(0,n.is)(t,e.HexStruct)}function u(t){return(0,n.is)(t,e.StrictHexStruct)}function h(t){(0,o.assert)((0,n.is)(t,e.HexChecksumAddressStruct),"Invalid hex address.");const r=f(t.toLowerCase()),a=f((0,s.bytesToHex)((0,i.keccak_256)(r)));return`0x${r.split("").map(((t,e)=>{const r=a[e];return(0,o.assert)((0,n.is)(r,(0,n.string)()),"Hash shorter than address."),parseInt(r,16)>7?t.toUpperCase():t})).join("")}`}function c(t){return!!(0,n.is)(t,e.HexChecksumAddressStruct)&&h(t)===t}function f(t){return t.startsWith("0x")||t.startsWith("0X")?t.substring(2):t}e.HexStruct=(0,n.pattern)((0,n.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-f]+$/iu),e.HexAddressStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-f]{40}$/u),e.HexChecksumAddressStruct=(0,n.pattern)((0,n.string)(),/^0x[0-9a-fA-F]{40}$/u),e.isHexString=a,e.isStrictHexString=u,e.assertIsHexString=function(t){(0,o.assert)(a(t),"Value must be a hexadecimal string.")},e.assertIsStrictHexString=function(t){(0,o.assert)(u(t),'Value must be a hexadecimal string, starting with "0x".')},e.isValidHexAddress=function(t){return(0,n.is)(t,e.HexAddressStruct)||c(t)},e.getChecksumAddress=h,e.isValidChecksumAddress=c,e.add0x=function(t){return t.startsWith("0x")?t:t.startsWith("0X")?`0x${t.substring(2)}`:`0x${t}`},e.remove0x=f},7487:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(257),e),i(r(8732),e),i(r(4585),e),i(r(3470),e),i(r(3497),e),i(r(7425),e),i(r(2107),e),i(r(9624),e),i(r(107),e),i(r(4126),e),i(r(397),e),i(r(6913),e),i(r(8971),e),i(r(6774),e),i(r(1527),e),i(r(9734),e),i(r(2380),e),i(r(633),e),i(r(121),e),i(r(7791),e)},397:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.getSafeJson=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=e.exactOptional=e.object=void 0;const n=r(7169),i=r(257),o=r(6774);function s({path:t,branch:e}){const r=t[t.length-1];return(0,o.hasProperty)(e[e.length-2],r)}function a(t){return new n.Struct({...t,type:`optional ${t.type}`,validator:(e,r)=>!s(r)||t.validator(e,r),refiner:(e,r)=>!s(r)||t.refiner(e,r)})}e.object=t=>(0,n.object)(t),e.exactOptional=a;function u(t){return(0,n.create)(t,e.JsonStruct)}e.UnsafeJsonStruct=(0,n.union)([(0,n.literal)(null),(0,n.boolean)(),(0,n.define)("finite number",(t=>(0,n.is)(t,(0,n.number)())&&Number.isFinite(t))),(0,n.string)(),(0,n.array)((0,n.lazy)((()=>e.UnsafeJsonStruct))),(0,n.record)((0,n.string)(),(0,n.lazy)((()=>e.UnsafeJsonStruct)))]),e.JsonStruct=(0,n.coerce)(e.UnsafeJsonStruct,(0,n.any)(),(t=>((0,i.assertStruct)(t,e.UnsafeJsonStruct),JSON.parse(JSON.stringify(t,((t,e)=>{if("__proto__"!==t&&"constructor"!==t)return e})))))),e.isValidJson=function(t){try{return u(t),!0}catch{return!1}},e.getSafeJson=u,e.getJsonSize=function(t){(0,i.assertStruct)(t,e.JsonStruct,"Invalid JSON value");const r=JSON.stringify(t);return(new TextEncoder).encode(r).byteLength},e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,n.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,n.nullable)((0,n.union)([(0,n.number)(),(0,n.string)()])),e.JsonRpcErrorStruct=(0,e.object)({code:(0,n.integer)(),message:(0,n.string)(),data:a(e.JsonStruct),stack:a((0,n.string)())}),e.JsonRpcParamsStruct=(0,n.union)([(0,n.record)((0,n.string)(),e.JsonStruct),(0,n.array)(e.JsonStruct)]),e.JsonRpcRequestStruct=(0,e.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,n.string)(),params:a(e.JsonRpcParamsStruct)}),e.JsonRpcNotificationStruct=(0,e.object)({jsonrpc:e.JsonRpcVersionStruct,method:(0,n.string)(),params:a(e.JsonRpcParamsStruct)}),e.isJsonRpcNotification=function(t){return(0,n.is)(t,e.JsonRpcNotificationStruct)},e.assertIsJsonRpcNotification=function(t,r){(0,i.assertStruct)(t,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",r)},e.isJsonRpcRequest=function(t){return(0,n.is)(t,e.JsonRpcRequestStruct)},e.assertIsJsonRpcRequest=function(t,r){(0,i.assertStruct)(t,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",r)},e.PendingJsonRpcResponseStruct=(0,n.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,n.optional)((0,n.unknown)()),error:(0,n.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,e.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,e.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,n.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]),e.isPendingJsonRpcResponse=function(t){return(0,n.is)(t,e.PendingJsonRpcResponseStruct)},e.assertIsPendingJsonRpcResponse=function(t,r){(0,i.assertStruct)(t,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",r)},e.isJsonRpcResponse=function(t){return(0,n.is)(t,e.JsonRpcResponseStruct)},e.assertIsJsonRpcResponse=function(t,r){(0,i.assertStruct)(t,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",r)},e.isJsonRpcSuccess=function(t){return(0,n.is)(t,e.JsonRpcSuccessStruct)},e.assertIsJsonRpcSuccess=function(t,r){(0,i.assertStruct)(t,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",r)},e.isJsonRpcFailure=function(t){return(0,n.is)(t,e.JsonRpcFailureStruct)},e.assertIsJsonRpcFailure=function(t,r){(0,i.assertStruct)(t,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",r)},e.isJsonRpcError=function(t){return(0,n.is)(t,e.JsonRpcErrorStruct)},e.assertIsJsonRpcError=function(t,r){(0,i.assertStruct)(t,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",r)},e.getJsonRpcIdValidator=function(t){const{permitEmptyString:e,permitFractions:r,permitNull:n}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...t};return t=>Boolean("number"==typeof t&&(r||Number.isInteger(t))||"string"==typeof t&&(e||t.length>0)||n&&null===t)}},6913:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},8971:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.createProjectLogger=void 0;const i=(0,n(r(5130)).default)("metamask");e.createProjectLogger=function(t){return i.extend(t)},e.createModuleLogger=function(t,e){return t.extend(e)}},6774:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.getKnownPropertyNames=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0,e.isNonEmptyArray=function(t){return Array.isArray(t)&&t.length>0},e.isNullOrUndefined=function(t){return null==t},e.isObject=function(t){return Boolean(t)&&"object"==typeof t&&!Array.isArray(t)};function r(t){return t.charCodeAt(0)<=127}e.hasProperty=(t,e)=>Object.hasOwnProperty.call(t,e),e.getKnownPropertyNames=function(t){return Object.getOwnPropertyNames(t)},function(t){t[t.Null=4]="Null",t[t.Comma=1]="Comma",t[t.Wrapper=1]="Wrapper",t[t.True=4]="True",t[t.False=5]="False",t[t.Quote=1]="Quote",t[t.Colon=1]="Colon",t[t.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,e.isPlainObject=function(t){if("object"!=typeof t||null===t)return!1;try{let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}catch(t){return!1}},e.isASCII=r,e.calculateStringSize=function(t){return t.split("").reduce(((t,e)=>r(e)?t+1:t+2),0)+(t.match(e.ESCAPE_CHARACTERS_REGEXP)??[]).length},e.calculateNumberSize=function(t){return t.toString().length}},1527:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hexToBigInt=e.hexToNumber=e.bigIntToHex=e.numberToHex=void 0;const n=r(257),i=r(4126);e.numberToHex=t=>((0,n.assert)("number"==typeof t,"Value must be a number."),(0,n.assert)(t>=0,"Value must be a non-negative number."),(0,n.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,i.add0x)(t.toString(16)));e.bigIntToHex=t=>((0,n.assert)("bigint"==typeof t,"Value must be a bigint."),(0,n.assert)(t>=0,"Value must be a non-negative bigint."),(0,i.add0x)(t.toString(16)));e.hexToNumber=t=>{(0,i.assertIsHexString)(t);const e=parseInt(t,16);return(0,n.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};e.hexToBigInt=t=>((0,i.assertIsHexString)(t),BigInt((0,i.add0x)(t)))},9734:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2380:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createDeferredPromise=void 0,e.createDeferredPromise=function({suppressUnhandledRejection:t=!1}={}){let e,r;const n=new Promise(((t,n)=>{e=t,r=n}));return t&&n.catch((t=>{})),{promise:n,resolve:e,reject:r}}},633:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(t){t[t.Millisecond=1]="Millisecond",t[t.Second=1e3]="Second",t[t.Minute=6e4]="Minute",t[t.Hour=36e5]="Hour",t[t.Day=864e5]="Day",t[t.Week=6048e5]="Week",t[t.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const r=(t,e)=>{if(!(t=>Number.isInteger(t)&&t>=0)(t))throw new Error(`"${e}" must be a non-negative integer. Received: "${t}".`)};e.inMilliseconds=function(t,e){return r(t,"count"),t*e},e.timeSince=function(t){return r(t,"timestamp"),Date.now()-t}},121:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},7791:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const n=r(7169),i=r(7699),o=r(257);e.VersionStruct=(0,n.refine)((0,n.string)(),"Version",(t=>null!==(0,i.valid)(t)||`Expected SemVer version, got "${t}"`)),e.VersionRangeStruct=(0,n.refine)((0,n.string)(),"Version range",(t=>null!==(0,i.validRange)(t)||`Expected SemVer range, got "${t}"`)),e.isValidSemVerVersion=function(t){return(0,n.is)(t,e.VersionStruct)},e.isValidSemVerRange=function(t){return(0,n.is)(t,e.VersionRangeStruct)},e.assertIsSemVerVersion=function(t){(0,o.assertStruct)(t,e.VersionStruct)},e.assertIsSemVerRange=function(t){(0,o.assertStruct)(t,e.VersionRangeStruct)},e.gtVersion=function(t,e){return(0,i.gt)(t,e)},e.gtRange=function(t,e){return(0,i.gtr)(t,e)},e.satisfiesVersionRange=function(t,e){return(0,i.satisfies)(t,e,{includePrerelease:!0})}},6566:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StructError=void 0;class r extends TypeError{constructor(t,e){let r;const{message:n,explanation:i,...o}=t,{path:s}=t,a=0===s.length?n:`At path: ${s.join(".")} -- ${n}`;super(i??a),null!=i&&(this.cause=a),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[t,...e()])}}e.StructError=r},7169:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(6566),e),i(r(9695),e),i(r(4621),e),i(r(3675),e),i(r(5792),e),i(r(2712),e)},9695:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validate=e.is=e.mask=e.create=e.assert=e.Struct=void 0;const n=r(6566),i=r(9595);function o(t,e,r){const n=h(t,e,{message:r});if(n[0])throw n[0]}function s(t,e,r){const n=h(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function a(t,e,r){const n=h(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function u(t,e){return!h(t,e)[0]}function h(t,e,r={}){const o=(0,i.run)(t,e,r),s=(0,i.shiftIterator)(o);if(s[0]){return[new n.StructError(s[0],(function*(){for(const t of o)t[0]&&(yield t[0])})),void 0]}return[void 0,s[1]]}e.Struct=class{constructor(t){const{type:e,schema:r,validator:n,refiner:o,coercer:s=(t=>t),entries:a=function*(){}}=t;this.type=e,this.schema=r,this.entries=a,this.coercer=s,this.validator=n?(t,e)=>{const r=n(t,e);return(0,i.toFailures)(r,e,this,t)}:()=>[],this.refiner=o?(t,e)=>{const r=o(t,e);return(0,i.toFailures)(r,e,this,t)}:()=>[]}assert(t,e){return o(t,this,e)}create(t,e){return s(t,this,e)}is(t){return u(t,this)}mask(t,e){return a(t,this,e)}validate(t,e={}){return h(t,this,e)}},e.assert=o,e.create=s,e.mask=a,e.is=u,e.validate=h},4621:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.trimmed=e.defaulted=e.coerce=void 0;const n=r(9695),i=r(9595),o=r(5792);function s(t,e,r){return new n.Struct({...t,coercer:(i,o)=>(0,n.is)(i,e)?t.coercer(r(i,o),o):t.coercer(i,o)})}e.coerce=s,e.defaulted=function(t,e,r={}){return s(t,(0,o.unknown)(),(t=>{const n="function"==typeof e?e():e;if(void 0===t)return n;if(!r.strict&&(0,i.isPlainObject)(t)&&(0,i.isPlainObject)(n)){const e={...t};let r=!1;for(const t in n)void 0===e[t]&&(e[t]=n[t],r=!0);if(r)return e}return t}))},e.trimmed=function(t){return s(t,(0,o.string)(),(t=>t.trim()))}},3675:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.refine=e.size=e.pattern=e.nonempty=e.min=e.max=e.empty=void 0;const n=r(9695),i=r(9595);function o(t){return t instanceof Map||t instanceof Set?t.size:t.length}function s(t,e,r){return new n.Struct({...t,*refiner(n,o){yield*t.refiner(n,o);const s=r(n,o),a=(0,i.toFailures)(s,o,t,n);for(const t of a)yield{...t,refinement:e}}})}e.empty=function(t){return s(t,"empty",(e=>{const r=o(e);return 0===r||`Expected an empty ${t.type} but received one with a size of \`${r}\``}))},e.max=function(t,e,r={}){const{exclusive:n}=r;return s(t,"max",(r=>n?r<e:r<=e||`Expected a ${t.type} less than ${n?"":"or equal to "}${e} but received \`${r}\``))},e.min=function(t,e,r={}){const{exclusive:n}=r;return s(t,"min",(r=>n?r>e:r>=e||`Expected a ${t.type} greater than ${n?"":"or equal to "}${e} but received \`${r}\``))},e.nonempty=function(t){return s(t,"nonempty",(e=>o(e)>0||`Expected a nonempty ${t.type} but received an empty one`))},e.pattern=function(t,e){return s(t,"pattern",(r=>e.test(r)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${r}"`))},e.size=function(t,e,r=e){const n=`Expected a ${t.type}`,i=e===r?`of \`${e}\``:`between \`${e}\` and \`${r}\``;return s(t,"size",(t=>{if("number"==typeof t||t instanceof Date)return e<=t&&t<=r||`${n} ${i} but received \`${t}\``;if(t instanceof Map||t instanceof Set){const{size:o}=t;return e<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}const{length:o}=t;return e<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}))},e.refine=s},5792:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unknown=e.union=e.type=e.tuple=e.string=e.set=e.regexp=e.record=e.optional=e.object=e.number=e.nullable=e.never=e.map=e.literal=e.intersection=e.integer=e.instance=e.func=e.enums=e.date=e.boolean=e.bigint=e.array=e.any=void 0;const n=r(9695),i=r(9595),o=r(2712);function s(){return(0,o.define)("never",(()=>!1))}e.any=function(){return(0,o.define)("any",(()=>!0))},e.array=function(t){return new n.Struct({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||`Expected an array value, but received: ${(0,i.print)(t)}`})},e.bigint=function(){return(0,o.define)("bigint",(t=>"bigint"==typeof t))},e.boolean=function(){return(0,o.define)("boolean",(t=>"boolean"==typeof t))},e.date=function(){return(0,o.define)("date",(t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${(0,i.print)(t)}`))},e.enums=function(t){const e={},r=t.map((t=>(0,i.print)(t))).join();for(const r of t)e[r]=r;return new n.Struct({type:"enums",schema:e,validator:e=>t.includes(e)||`Expected one of \`${r}\`, but received: ${(0,i.print)(e)}`})},e.func=function(){return(0,o.define)("func",(t=>"function"==typeof t||`Expected a function, but received: ${(0,i.print)(t)}`))},e.instance=function(t){return(0,o.define)("instance",(e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${(0,i.print)(e)}`))},e.integer=function(){return(0,o.define)("integer",(t=>"number"==typeof t&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${(0,i.print)(t)}`))},e.intersection=function(t){return new n.Struct({type:"intersection",schema:null,*entries(e,r){for(const{entries:n}of t)yield*n(e,r)},*validator(e,r){for(const{validator:n}of t)yield*n(e,r)},*refiner(e,r){for(const{refiner:n}of t)yield*n(e,r)}})},e.literal=function(t){const e=(0,i.print)(t),r=typeof t;return new n.Struct({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?t:null,validator:r=>r===t||`Expected the literal \`${e}\`, but received: ${(0,i.print)(r)}`})},e.map=function(t,e){return new n.Struct({type:"map",schema:null,*entries(r){if(t&&e&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,t],yield[n,i,e]},coercer:t=>t instanceof Map?new Map(t):t,validator:t=>t instanceof Map||`Expected a \`Map\` object, but received: ${(0,i.print)(t)}`})},e.never=s,e.nullable=function(t){return new n.Struct({...t,validator:(e,r)=>null===e||t.validator(e,r),refiner:(e,r)=>null===e||t.refiner(e,r)})},e.number=function(){return(0,o.define)("number",(t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${(0,i.print)(t)}`))},e.object=function(t){const e=t?Object.keys(t):[],r=s();return new n.Struct({type:"object",schema:t??null,*entries(n){if(t&&(0,i.isObject)(n)){const i=new Set(Object.keys(n));for(const r of e)i.delete(r),yield[r,n[r],t[r]];for(const t of i)yield[t,n[t],r]}},validator:t=>(0,i.isObject)(t)||`Expected an object, but received: ${(0,i.print)(t)}`,coercer:t=>(0,i.isObject)(t)?{...t}:t})},e.optional=function(t){return new n.Struct({...t,validator:(e,r)=>void 0===e||t.validator(e,r),refiner:(e,r)=>void 0===e||t.refiner(e,r)})},e.record=function(t,e){return new n.Struct({type:"record",schema:null,*entries(r){if((0,i.isObject)(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator:t=>(0,i.isObject)(t)||`Expected an object, but received: ${(0,i.print)(t)}`})},e.regexp=function(){return(0,o.define)("regexp",(t=>t instanceof RegExp))},e.set=function(t){return new n.Struct({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const r of e)yield[r,r,t]},coercer:t=>t instanceof Set?new Set(t):t,validator:t=>t instanceof Set||`Expected a \`Set\` object, but received: ${(0,i.print)(t)}`})},e.string=function(){return(0,o.define)("string",(t=>"string"==typeof t||`Expected a string, but received: ${(0,i.print)(t)}`))},e.tuple=function(t){const e=s();return new n.Struct({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],t[i]||e]}},validator:t=>Array.isArray(t)||`Expected an array, but received: ${(0,i.print)(t)}`})},e.type=function(t){const e=Object.keys(t);return new n.Struct({type:"type",schema:t,*entries(r){if((0,i.isObject)(r))for(const n of e)yield[n,r[n],t[n]]},validator:t=>(0,i.isObject)(t)||`Expected an object, but received: ${(0,i.print)(t)}`,coercer:t=>(0,i.isObject)(t)?{...t}:t})},e.union=function(t){const e=t.map((t=>t.type)).join(" | ");return new n.Struct({type:"union",schema:null,coercer(e){for(const r of t){const[t,n]=r.validate(e,{coerce:!0});if(!t)return n}return e},validator(r,n){const o=[];for(const e of t){const[...t]=(0,i.run)(r,e,n),[s]=t;if(!s?.[0])return[];for(const[e]of t)e&&o.push(e)}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${(0,i.print)(r)}`,...o]}})},e.unknown=function(){return(0,o.define)("unknown",(()=>!0))}},2712:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.pick=e.partial=e.omit=e.lazy=e.dynamic=e.deprecated=e.define=e.assign=void 0;const n=r(9695),i=r(5792);e.assign=function(...t){const e="type"===t[0]?.type,r=t.map((({schema:t})=>t)),n=Object.assign({},...r);return e?(0,i.type)(n):(0,i.object)(n)},e.define=function(t,e){return new n.Struct({type:t,schema:null,validator:e})},e.deprecated=function(t,e){return new n.Struct({...t,refiner:(e,r)=>void 0===e||t.refiner(e,r),validator:(r,n)=>void 0===r||(e(r,n),t.validator(r,n))})},e.dynamic=function(t){return new n.Struct({type:"dynamic",schema:null,*entries(e,r){const n=t(e,r);yield*n.entries(e,r)},validator:(e,r)=>t(e,r).validator(e,r),coercer:(e,r)=>t(e,r).coercer(e,r),refiner:(e,r)=>t(e,r).refiner(e,r)})},e.lazy=function(t){let e;return new n.Struct({type:"lazy",schema:null,*entries(r,n){e??(e=t()),yield*e.entries(r,n)},validator:(r,n)=>(e??(e=t()),e.validator(r,n)),coercer:(r,n)=>(e??(e=t()),e.coercer(r,n)),refiner:(r,n)=>(e??(e=t()),e.refiner(r,n))})},e.omit=function(t,e){const{schema:r}=t,n={...r};for(const t of e)delete n[t];return"type"===t.type?(0,i.type)(n):(0,i.object)(n)},e.partial=function(t){const e=t instanceof n.Struct,r=e?{...t.schema}:{...t};for(const t in r)r[t]=(0,i.optional)(r[t]);return e&&"type"===t.type?(0,i.type)(r):(0,i.object)(r)},e.pick=function(t,e){const{schema:r}=t,n={};for(const t of e)n[t]=r[t];return"type"===t.type?(0,i.type)(n):(0,i.object)(n)}},9595:(t,e)=>{"use strict";function r(t){return"object"==typeof t&&null!==t}function n(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function i(t,e,r,i){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});const{path:o,branch:s}=e,{type:a}=r,{refinement:u,message:h=`Expected a value of type \`${a}\`${u?` with refinement \`${u}\``:""}, but received: \`${n(i)}\``}=t;return{value:i,type:a,refinement:u,key:o[o.length-1],path:o,branch:s,...t,message:h}}Object.defineProperty(e,"__esModule",{value:!0}),e.run=e.toFailures=e.toFailure=e.shiftIterator=e.print=e.isPlainObject=e.isObject=void 0,e.isObject=r,e.isPlainObject=function(t){if("[object Object]"!==Object.prototype.toString.call(t))return!1;const e=Object.getPrototypeOf(t);return null===e||e===Object.prototype},e.print=n,e.shiftIterator=function(t){const{done:e,value:r}=t.next();return e?void 0:r},e.toFailure=i,e.toFailures=function*(t,e,n,o){(function(t){return r(t)&&"function"==typeof t[Symbol.iterator]})(t)||(t=[t]);for(const r of t){const t=i(r,e,n,o);t&&(yield t)}},e.run=function*t(e,n,i={}){const{path:o=[],branch:s=[e],coerce:a=!1,mask:u=!1}=i,h={path:o,branch:s};if(a&&(e=n.coercer(e,h),u&&"type"!==n.type&&r(n.schema)&&r(e)&&!Array.isArray(e)))for(const t in e)void 0===n.schema[t]&&delete e[t];let c="valid";for(const t of n.validator(e,h))t.explanation=i.message,c="not_valid",yield[t,void 0];for(let[f,l,d]of n.entries(e,h)){const n=t(l,d,{path:void 0===f?o:[...o,f],branch:void 0===f?s:[...s,l],coerce:a,mask:u,message:i.message});for(const t of n)t[0]?(c=null===t[0].refinement||void 0===t[0].refinement?"not_valid":"not_refined",yield[t[0],void 0]):a&&(l=t[1],void 0===f?e=l:e instanceof Map?e.set(f,l):e instanceof Set?e.add(l):r(e)&&(void 0!==l||f in e)&&(e[f]=l))}if("not_valid"!==c)for(const t of n.refiner(e,h))t.explanation=i.message,c="not_refined",yield[t,void 0];"valid"===c&&(yield[void 0,e])}},2191:(t,e,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e<n.length;e++)"function"==typeof i[n[e]]&&(t[t.length]=n[e]);return t}},346:t=>{"use strict";t.exports=JSON.parse('{"name":"goerli","chainId":5,"networkId":5,"defaultHardfork":"merge","consensus":{"type":"poa","algorithm":"clique","clique":{"period":15,"epoch":30000}},"comment":"Cross-client PoA test network","url":"https://github.com/goerli/testnet","genesis":{"timestamp":"0x5c51a607","gasLimit":10485760,"difficulty":1,"nonce":"0x0000000000000000","extraData":"0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0xa3f5ab08"},{"name":"homestead","block":0,"forkHash":"0xa3f5ab08"},{"name":"tangerineWhistle","block":0,"forkHash":"0xa3f5ab08"},{"name":"spuriousDragon","block":0,"forkHash":"0xa3f5ab08"},{"name":"byzantium","block":0,"forkHash":"0xa3f5ab08"},{"name":"constantinople","block":0,"forkHash":"0xa3f5ab08"},{"name":"petersburg","block":0,"forkHash":"0xa3f5ab08"},{"name":"istanbul","block":1561651,"forkHash":"0xc25efa5c"},{"name":"berlin","block":4460644,"forkHash":"0x757a1c47"},{"name":"london","block":5062605,"forkHash":"0xb8c6299d"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://goerli.etherscan.io/block/7382818","name":"merge","ttd":"10790000","block":7382819,"forkHash":"0xb8c6299d"},{"name":"mergeForkIdTransition","block":null,"forkHash":null},{"name":"shanghai","block":null,"timestamp":"1678832736","forkHash":"0xf9843abf"}],"bootstrapNodes":[{"ip":"51.141.78.53","port":30303,"id":"011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a","location":"","comment":"Upstream bootnode 1"},{"ip":"13.93.54.137","port":30303,"id":"176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b","location":"","comment":"Upstream bootnode 2"},{"ip":"94.237.54.114","port":30313,"id":"46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291","location":"","comment":"Upstream bootnode 3"},{"ip":"18.218.250.66","port":30313,"id":"b5948a2d3e9d486c4d75bf32713221c2bd6cf86463302339299bd227dc2e276cd5a1c7ca4f43a0e9122fe9af884efed563bd2a1fd28661f3b5f5ad7bf1de5949","location":"","comment":"Upstream bootnode 4"},{"ip":"3.11.147.67","port":30303,"id":"a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91","location":"","comment":"Ethereum Foundation bootnode"},{"ip":"51.15.116.226","port":30303,"id":"a869b02cec167211fb4815a82941db2e7ed2936fd90e78619c53eb17753fcf0207463e3419c264e2a1dd8786de0df7e68cf99571ab8aeb7c4e51367ef186b1dd","location":"","comment":"Goerli Initiative bootnode"},{"ip":"51.15.119.157","port":30303,"id":"807b37ee4816ecf407e9112224494b74dd5933625f655962d892f2f0f02d7fbbb3e2a94cf87a96609526f30c998fd71e93e2f53015c558ffc8b03eceaf30ee33","location":"","comment":"Goerli Initiative bootnode"},{"ip":"51.15.119.157","port":40303,"id":"a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd","location":"","comment":"Goerli Initiative bootnode"}],"dnsNetworks":["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net"]}')},318:t=>{"use strict";t.exports=JSON.parse('{"name":"mainnet","chainId":1,"networkId":1,"defaultHardfork":"merge","consensus":{"type":"pow","algorithm":"ethash","ethash":{}},"comment":"The Ethereum main chain","url":"https://ethstats.net/","genesis":{"gasLimit":5000,"difficulty":17179869184,"nonce":"0x0000000000000042","extraData":"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0xfc64ec04"},{"name":"homestead","block":1150000,"forkHash":"0x97c2c34c"},{"name":"dao","block":1920000,"forkHash":"0x91d1f948"},{"name":"tangerineWhistle","block":2463000,"forkHash":"0x7a64da13"},{"name":"spuriousDragon","block":2675000,"forkHash":"0x3edd5b10"},{"name":"byzantium","block":4370000,"forkHash":"0xa00bc324"},{"name":"constantinople","block":7280000,"forkHash":"0x668db0af"},{"name":"petersburg","block":7280000,"forkHash":"0x668db0af"},{"name":"istanbul","block":9069000,"forkHash":"0x879d6e30"},{"name":"muirGlacier","block":9200000,"forkHash":"0xe029e991"},{"name":"berlin","block":12244000,"forkHash":"0x0eb440f6"},{"name":"london","block":12965000,"forkHash":"0xb715077d"},{"name":"arrowGlacier","block":13773000,"forkHash":"0x20c327fc"},{"name":"grayGlacier","block":15050000,"forkHash":"0xf0afd0e3"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://etherscan.io/block/15537393","name":"merge","ttd":"58750000000000000000000","block":15537394,"forkHash":"0xf0afd0e3"},{"name":"mergeForkIdTransition","block":null,"forkHash":null},{"name":"shanghai","block":null,"timestamp":"1681338455","forkHash":"0xdce96c2d"}],"bootstrapNodes":[{"ip":"18.138.108.67","port":30303,"id":"d860a01f9722d78051619d1e2351aba3f43f943f6f00718d1b9baa4101932a1f5011f16bb2b1bb35db20d6fe28fa0bf09636d26a87d31de9ec6203eeedb1f666","location":"ap-southeast-1-001","comment":"bootnode-aws-ap-southeast-1-001"},{"ip":"3.209.45.79","port":30303,"id":"22a8232c3abc76a16ae9d6c3b164f98775fe226f0917b0ca871128a74a8e9630b458460865bab457221f1d448dd9791d24c4e5d88786180ac185df813a68d4de","location":"us-east-1-001","comment":"bootnode-aws-us-east-1-001"},{"ip":"65.108.70.101","port":30303,"id":"2b252ab6a1d0f971d9722cb839a42cb81db019ba44c08754628ab4a823487071b5695317c8ccd085219c3a03af063495b2f1da8d18218da2d6a82981b45e6ffc","location":"eu-west-1-001","comment":"bootnode-hetzner-hel"},{"ip":"157.90.35.166","port":30303,"id":"4aeb4ab6c14b23e2c4cfdce879c04b0748a20d8e9b59e25ded2a08143e265c6c25936e74cbc8e641e3312ca288673d91f2f93f8e277de3cfa444ecdaaf982052","location":"eu-central-1-001","comment":"bootnode-hetzner-fsn"}],"dnsNetworks":["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.mainnet.ethdisco.net"]}')},4008:t=>{"use strict";t.exports=JSON.parse('{"name":"rinkeby","chainId":4,"networkId":4,"defaultHardfork":"london","consensus":{"type":"poa","algorithm":"clique","clique":{"period":15,"epoch":30000}},"comment":"PoA test network","url":"https://www.rinkeby.io","genesis":{"timestamp":"0x58ee40ba","gasLimit":4700000,"difficulty":1,"nonce":"0x0000000000000000","extraData":"0x52657370656374206d7920617574686f7269746168207e452e436172746d616e42eb768f2244c8811c63729a21a3569731535f067ffc57839b00206d1ad20c69a1981b489f772031b279182d99e65703f0076e4812653aab85fca0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0x3b8e0691"},{"name":"homestead","block":1,"forkHash":"0x60949295"},{"name":"tangerineWhistle","block":2,"forkHash":"0x8bde40dd"},{"name":"spuriousDragon","block":3,"forkHash":"0xcb3a64bb"},{"name":"byzantium","block":1035301,"forkHash":"0x8d748b57"},{"name":"constantinople","block":3660663,"forkHash":"0xe49cab14"},{"name":"petersburg","block":4321234,"forkHash":"0xafec6b27"},{"name":"istanbul","block":5435345,"forkHash":"0xcbdb8838"},{"name":"berlin","block":8290928,"forkHash":"0x6910c8bd"},{"name":"london","block":8897988,"forkHash":"0x8e29f2f3"},{"name":"merge","block":null,"forkHash":null},{"name":"shanghai","block":null,"forkHash":null}],"bootstrapNodes":[{"ip":"52.169.42.101","port":30303,"id":"a24ac7c5484ef4ed0c5eb2d36620ba4e4aa13b8c84684e1b4aab0cebea2ae45cb4d375b77eab56516d34bfbd3c1a833fc51296ff084b770b94fb9028c4d25ccf","location":"","comment":"IE"},{"ip":"52.3.158.184","port":30303,"id":"343149e4feefa15d882d9fe4ac7d88f885bd05ebb735e547f12e12080a9fa07c8014ca6fd7f373123488102fe5e34111f8509cf0b7de3f5b44339c9f25e87cb8","location":"","comment":"INFURA"},{"ip":"159.89.28.211","port":30303,"id":"b6b28890b006743680c52e64e0d16db57f28124885595fa03a562be1d2bf0f3a1da297d56b13da25fb992888fd556d4c1a27b1f39d531bde7de1921c90061cc6","location":"","comment":"AKASHA"}],"dnsNetworks":["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.rinkeby.ethdisco.net"]}')},5669:t=>{"use strict";t.exports=JSON.parse('{"name":"ropsten","chainId":3,"networkId":3,"defaultHardfork":"merge","consensus":{"type":"pow","algorithm":"ethash","ethash":{}},"comment":"PoW test network","url":"https://github.com/ethereum/ropsten","genesis":{"gasLimit":16777216,"difficulty":1048576,"nonce":"0x0000000000000042","extraData":"0x3535353535353535353535353535353535353535353535353535353535353535"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0x30c7ddbc"},{"name":"homestead","block":0,"forkHash":"0x30c7ddbc"},{"name":"tangerineWhistle","block":0,"forkHash":"0x30c7ddbc"},{"name":"spuriousDragon","block":10,"forkHash":"0x63760190"},{"name":"byzantium","block":1700000,"forkHash":"0x3ea159c7"},{"name":"constantinople","block":4230000,"forkHash":"0x97b544f3"},{"name":"petersburg","block":4939394,"forkHash":"0xd6e2149b"},{"name":"istanbul","block":6485846,"forkHash":"0x4bc66396"},{"name":"muirGlacier","block":7117117,"forkHash":"0x6727ef90"},{"name":"berlin","block":9812189,"forkHash":"0xa157d377"},{"name":"london","block":10499401,"forkHash":"0x7119b6b3"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge","name":"merge","ttd":"50000000000000000","block":null,"forkHash":"0x7119b6b3"},{"name":"mergeForkIdTransition","block":null,"forkHash":null},{"name":"shanghai","block":null,"forkHash":null}],"bootstrapNodes":[{"ip":"52.176.7.10","port":30303,"id":"30b7ab30a01c124a6cceca36863ece12c4f5fa68e3ba9b0b51407ccc002eeed3b3102d20a88f1c1d3c3154e2449317b8ef95090e77b312d5cc39354f86d5d606","location":"","comment":"US-Azure geth"},{"ip":"52.176.100.77","port":30303,"id":"865a63255b3bb68023b6bffd5095118fcc13e79dcf014fe4e47e065c350c7cc72af2e53eff895f11ba1bbb6a2b33271c1116ee870f266618eadfc2e78aa7349c","location":"","comment":"US-Azure parity"},{"ip":"52.232.243.152","port":30303,"id":"6332792c4a00e3e4ee0926ed89e0d27ef985424d97b6a45bf0f23e51f0dcb5e66b875777506458aea7af6f9e4ffb69f43f3778ee73c81ed9d34c51c4b16b0b0f","location":"","comment":"Parity"},{"ip":"192.81.208.223","port":30303,"id":"94c15d1b9e2fe7ce56e458b9a3b672ef11894ddedd0c6f247e0f1d3487f52b66208fb4aeb8179fce6e3a749ea93ed147c37976d67af557508d199d9594c35f09","location":"","comment":"@gpip"}],"dnsNetworks":["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.ropsten.ethdisco.net"]}')},7958:t=>{"use strict";t.exports=JSON.parse('{"name":"sepolia","chainId":11155111,"networkId":11155111,"defaultHardfork":"merge","consensus":{"type":"pow","algorithm":"ethash","ethash":{}},"comment":"PoW test network to replace Ropsten","url":"https://github.com/ethereum/go-ethereum/pull/23730","genesis":{"timestamp":"0x6159af19","gasLimit":30000000,"difficulty":131072,"nonce":"0x0000000000000000","extraData":"0x5365706f6c69612c20417468656e732c204174746963612c2047726565636521"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0xfe3366e7"},{"name":"homestead","block":0,"forkHash":"0xfe3366e7"},{"name":"tangerineWhistle","block":0,"forkHash":"0xfe3366e7"},{"name":"spuriousDragon","block":0,"forkHash":"0xfe3366e7"},{"name":"byzantium","block":0,"forkHash":"0xfe3366e7"},{"name":"constantinople","block":0,"forkHash":"0xfe3366e7"},{"name":"petersburg","block":0,"forkHash":"0xfe3366e7"},{"name":"istanbul","block":0,"forkHash":"0xfe3366e7"},{"name":"muirGlacier","block":0,"forkHash":"0xfe3366e7"},{"name":"berlin","block":0,"forkHash":"0xfe3366e7"},{"name":"london","block":0,"forkHash":"0xfe3366e7"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://sepolia.etherscan.io/block/1450408","name":"merge","ttd":"17000000000000000","block":1450409,"forkHash":"0xfe3366e7"},{"name":"mergeForkIdTransition","block":1735371,"forkHash":"0xb96cbd13"},{"name":"shanghai","block":null,"timestamp":"1677557088","forkHash":"0xf7f9bc08"}],"bootstrapNodes":[{"ip":"18.168.182.86","port":30303,"id":"9246d00bc8fd1742e5ad2428b80fc4dc45d786283e05ef6edbd9002cbc335d40998444732fbe921cb88e1d2c73d1b1de53bae6a2237996e9bfe14f871baf7066","location":"","comment":"geth"},{"ip":"52.14.151.177","port":30303,"id":"ec66ddcf1a974950bd4c782789a7e04f8aa7110a72569b6e65fcd51e937e74eed303b1ea734e4d19cfaec9fbff9b6ee65bf31dcb50ba79acce9dd63a6aca61c7","location":"","comment":"besu"},{"ip":"165.22.196.173","port":30303,"id":"ce970ad2e9daa9e14593de84a8b49da3d54ccfdf83cbc4fe519cb8b36b5918ed4eab087dedd4a62479b8d50756b492d5f762367c8d20329a7854ec01547568a6","location":"","comment":"EF"},{"ip":"65.108.95.67","port":30303,"id":"075503b13ed736244896efcde2a992ec0b451357d46cb7a8132c0384721742597fc8f0d91bbb40bb52e7d6e66728d36a1fda09176294e4a30cfac55dcce26bc6","location":"","comment":"lodestar"}],"dnsNetworks":["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.sepolia.ethdisco.net"]}')},6174:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-1153","number":1153,"comment":"Transient Storage","url":"https://eips.ethereum.org/EIPS/eip-1153","status":"Review","minimumHardfork":"chainstart","requiredEIPs":[],"gasConfig":{},"gasPrices":{"tstore":{"v":100,"d":"Base fee of the TSTORE opcode"},"tload":{"v":100,"d":"Base fee of the TLOAD opcode"}},"vm":{},"pow":{}}')},4559:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-1559","number":1559,"comment":"Fee market change for ETH 1.0 chain","url":"https://eips.ethereum.org/EIPS/eip-1559","status":"Final","minimumHardfork":"berlin","requiredEIPs":[2930],"gasConfig":{"baseFeeMaxChangeDenominator":{"v":8,"d":"Maximum base fee change denominator"},"elasticityMultiplier":{"v":2,"d":"Maximum block gas target elasticity"},"initialBaseFee":{"v":1000000000,"d":"Initial base fee on first EIP1559 block"}},"gasPrices":{},"vm":{},"pow":{}}')},9328:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-2315","number":2315,"comment":"Simple subroutines for the EVM","url":"https://eips.ethereum.org/EIPS/eip-2315","status":"Draft","minimumHardfork":"istanbul","gasConfig":{},"gasPrices":{"beginsub":{"v":2,"d":"Base fee of the BEGINSUB opcode"},"returnsub":{"v":5,"d":"Base fee of the RETURNSUB opcode"},"jumpsub":{"v":10,"d":"Base fee of the JUMPSUB opcode"}},"vm":{},"pow":{}}')},7026:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-2537","number":2537,"comment":"BLS12-381 precompiles","url":"https://eips.ethereum.org/EIPS/eip-2537","status":"Draft","minimumHardfork":"chainstart","gasConfig":{},"gasPrices":{"Bls12381G1AddGas":{"v":600,"d":"Gas cost of a single BLS12-381 G1 addition precompile-call"},"Bls12381G1MulGas":{"v":12000,"d":"Gas cost of a single BLS12-381 G1 multiplication precompile-call"},"Bls12381G2AddGas":{"v":4500,"d":"Gas cost of a single BLS12-381 G2 addition precompile-call"},"Bls12381G2MulGas":{"v":55000,"d":"Gas cost of a single BLS12-381 G2 multiplication precompile-call"},"Bls12381PairingBaseGas":{"v":115000,"d":"Base gas cost of BLS12-381 pairing check"},"Bls12381PairingPerPairGas":{"v":23000,"d":"Per-pair gas cost of BLS12-381 pairing check"},"Bls12381MapG1Gas":{"v":5500,"d":"Gas cost of BLS12-381 map field element to G1"},"Bls12381MapG2Gas":{"v":110000,"d":"Gas cost of BLS12-381 map field element to G2"},"Bls12381MultiExpGasDiscount":{"v":[[1,1200],[2,888],[3,764],[4,641],[5,594],[6,547],[7,500],[8,453],[9,438],[10,423],[11,408],[12,394],[13,379],[14,364],[15,349],[16,334],[17,330],[18,326],[19,322],[20,318],[21,314],[22,310],[23,306],[24,302],[25,298],[26,294],[27,289],[28,285],[29,281],[30,277],[31,273],[32,269],[33,268],[34,266],[35,265],[36,263],[37,262],[38,260],[39,259],[40,257],[41,256],[42,254],[43,253],[44,251],[45,250],[46,248],[47,247],[48,245],[49,244],[50,242],[51,241],[52,239],[53,238],[54,236],[55,235],[56,233],[57,232],[58,231],[59,229],[60,228],[61,226],[62,225],[63,223],[64,222],[65,221],[66,220],[67,219],[68,219],[69,218],[70,217],[71,216],[72,216],[73,215],[74,214],[75,213],[76,213],[77,212],[78,211],[79,211],[80,210],[81,209],[82,208],[83,208],[84,207],[85,206],[86,205],[87,205],[88,204],[89,203],[90,202],[91,202],[92,201],[93,200],[94,199],[95,199],[96,198],[97,197],[98,196],[99,196],[100,195],[101,194],[102,193],[103,193],[104,192],[105,191],[106,191],[107,190],[108,189],[109,188],[110,188],[111,187],[112,186],[113,185],[114,185],[115,184],[116,183],[117,182],[118,182],[119,181],[120,180],[121,179],[122,179],[123,178],[124,177],[125,176],[126,176],[127,175],[128,174]],"d":"Discount gas costs of calls to the MultiExp precompiles with `k` (point, scalar) pair"}},"vm":{},"pow":{}}')},5718:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-2565","number":2565,"comment":"ModExp gas cost","url":"https://eips.ethereum.org/EIPS/eip-2565","status":"Final","minimumHardfork":"byzantium","gasConfig":{},"gasPrices":{"modexpGquaddivisor":{"v":3,"d":"Gquaddivisor from modexp precompile for gas calculation"}},"vm":{},"pow":{}}')},7153:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-2718","comment":"Typed Transaction Envelope","url":"https://eips.ethereum.org/EIPS/eip-2718","status":"Final","minimumHardfork":"chainstart","gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},9067:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-2929","comment":"Gas cost increases for state access opcodes","url":"https://eips.ethereum.org/EIPS/eip-2929","status":"Final","minimumHardfork":"chainstart","gasConfig":{},"gasPrices":{"coldsload":{"v":2100,"d":"Gas cost of the first read of storage from a given location (per transaction)"},"coldaccountaccess":{"v":2600,"d":"Gas cost of the first read of a given address (per transaction)"},"warmstorageread":{"v":100,"d":"Gas cost of reading storage locations which have already loaded \'cold\'"},"sstoreCleanGasEIP2200":{"v":2900,"d":"Once per SSTORE operation from clean non-zero to something else"},"sstoreNoopGasEIP2200":{"v":100,"d":"Once per SSTORE operation if the value doesn\'t change"},"sstoreDirtyGasEIP2200":{"v":100,"d":"Once per SSTORE operation if a dirty value is changed"},"sstoreInitRefundEIP2200":{"v":19900,"d":"Once per SSTORE operation for resetting to the original zero value"},"sstoreCleanRefundEIP2200":{"v":4900,"d":"Once per SSTORE operation for resetting to the original non-zero value"},"call":{"v":0,"d":"Base fee of the CALL opcode"},"callcode":{"v":0,"d":"Base fee of the CALLCODE opcode"},"delegatecall":{"v":0,"d":"Base fee of the DELEGATECALL opcode"},"staticcall":{"v":0,"d":"Base fee of the STATICCALL opcode"},"balance":{"v":0,"d":"Base fee of the BALANCE opcode"},"extcodesize":{"v":0,"d":"Base fee of the EXTCODESIZE opcode"},"extcodecopy":{"v":0,"d":"Base fee of the EXTCODECOPY opcode"},"extcodehash":{"v":0,"d":"Base fee of the EXTCODEHASH opcode"},"sload":{"v":0,"d":"Base fee of the SLOAD opcode"},"sstore":{"v":0,"d":"Base fee of the SSTORE opcode"}},"vm":{},"pow":{}}')},398:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-2930","comment":"Optional access lists","url":"https://eips.ethereum.org/EIPS/eip-2930","status":"Final","minimumHardfork":"istanbul","requiredEIPs":[2718,2929],"gasConfig":{},"gasPrices":{"accessListStorageKeyCost":{"v":1900,"d":"Gas cost per storage key in an Access List transaction"},"accessListAddressCost":{"v":2400,"d":"Gas cost per storage key in an Access List transaction"}},"vm":{},"pow":{}}')},756:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3074","number":3074,"comment":"AUTH and AUTHCALL opcodes","url":"https://eips.ethereum.org/EIPS/eip-3074","status":"Review","minimumHardfork":"london","gasConfig":{},"gasPrices":{"auth":{"v":3100,"d":"Gas cost of the AUTH opcode"},"authcall":{"v":0,"d":"Gas cost of the AUTHCALL opcode"},"authcallValueTransfer":{"v":6700,"d":"Paid for CALL when the value transfer is non-zero"}},"vm":{},"pow":{}}')},5920:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3198","number":3198,"comment":"BASEFEE opcode","url":"https://eips.ethereum.org/EIPS/eip-3198","status":"Final","minimumHardfork":"london","gasConfig":{},"gasPrices":{"basefee":{"v":2,"d":"Gas cost of the BASEFEE opcode"}},"vm":{},"pow":{}}')},805:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3529","comment":"Reduction in refunds","url":"https://eips.ethereum.org/EIPS/eip-3529","status":"Final","minimumHardfork":"berlin","requiredEIPs":[2929],"gasConfig":{"maxRefundQuotient":{"v":5,"d":"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},"gasPrices":{"selfdestructRefund":{"v":0,"d":"Refunded following a selfdestruct operation"},"sstoreClearRefundEIP2200":{"v":4800,"d":"Once per SSTORE operation for clearing an originally existing storage slot"}},"vm":{},"pow":{}}')},9240:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3540","number":3540,"comment":"EVM Object Format (EOF) v1","url":"https://eips.ethereum.org/EIPS/eip-3540","status":"Review","minimumHardfork":"london","requiredEIPs":[3541],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},5662:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3541","comment":"Reject new contracts starting with the 0xEF byte","url":"https://eips.ethereum.org/EIPS/eip-3541","status":"Final","minimumHardfork":"berlin","requiredEIPs":[],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},1190:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3554","comment":"Reduction in refunds","url":"Difficulty Bomb Delay to December 1st 2021","status":"Final","minimumHardfork":"muirGlacier","requiredEIPs":[],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{"difficultyBombDelay":{"v":9500000,"d":"the amount of blocks to delay the difficulty bomb with"}}}')},549:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3607","number":3607,"comment":"Reject transactions from senders with deployed code","url":"https://eips.ethereum.org/EIPS/eip-3607","status":"Final","minimumHardfork":"chainstart","requiredEIPs":[],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},1682:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3651","number":3198,"comment":"Warm COINBASE","url":"https://eips.ethereum.org/EIPS/eip-3651","status":"Review","minimumHardfork":"london","requiredEIPs":[2929],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},4513:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3670","number":3670,"comment":"EOF - Code Validation","url":"https://eips.ethereum.org/EIPS/eip-3670","status":"Review","minimumHardfork":"london","requiredEIPs":[3540],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},7598:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3675","number":3675,"comment":"Upgrade consensus to Proof-of-Stake","url":"https://eips.ethereum.org/EIPS/eip-3675","status":"Final","minimumHardfork":"london","requiredEIPs":[],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},4264:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3855","number":3855,"comment":"PUSH0 instruction","url":"https://eips.ethereum.org/EIPS/eip-3855","status":"Review","minimumHardfork":"chainstart","requiredEIPs":[],"gasConfig":{},"gasPrices":{"push0":{"v":2,"d":"Base fee of the PUSH0 opcode"}},"vm":{},"pow":{}}')},863:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3860","number":3860,"comment":"Limit and meter initcode","url":"https://eips.ethereum.org/EIPS/eip-3860","status":"Review","minimumHardfork":"spuriousDragon","requiredEIPs":[],"gasConfig":{},"gasPrices":{"initCodeWordCost":{"v":2,"d":"Gas to pay for each word (32 bytes) of initcode when creating a contract"}},"vm":{"maxInitCodeSize":{"v":49152,"d":"Maximum length of initialization code when creating a contract"}},"pow":{}}')},5475:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-4345","number":4345,"comment":"Difficulty Bomb Delay to June 2022","url":"https://eips.ethereum.org/EIPS/eip-4345","status":"Final","minimumHardfork":"london","gasConfig":{},"gasPrices":{},"vm":{},"pow":{"difficultyBombDelay":{"v":10700000,"d":"the amount of blocks to delay the difficulty bomb with"}}}')},8816:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-4399","number":4399,"comment":"Supplant DIFFICULTY opcode with PREVRANDAO","url":"https://eips.ethereum.org/EIPS/eip-4399","status":"Review","minimumHardfork":"london","requiredEIPs":[],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},7377:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-4844","number":4844,"comment":"Shard Blob Transactions","url":"https://eips.ethereum.org/EIPS/eip-4844","status":"Draft","minimumHardfork":"merge","requiredEIPs":[1559,2718,2930,4895],"gasConfig":{"dataGasPerBlob":{"v":131072,"d":"The base fee for data gas per blob"},"targetDataGasPerBlock":{"v":262144,"d":"The target data gas consumed per block"},"maxDataGasPerBlock":{"v":524288,"d":"The max data gas allowable per block"},"dataGasPriceUpdateFraction":{"v":2225652,"d":"The denominator used in the exponential when calculating a data gas price"}},"gasPrices":{"simpleGasPerBlob":{"v":12000,"d":"The basic gas fee for each blob"},"minDataGasPrice":{"v":1,"d":"The minimum fee per data gas"},"kzgPointEvaluationGasPrecompilePrice":{"v":50000,"d":"The fee associated with the point evaluation precompile"},"datahash":{"v":3,"d":"Base fee of the DATAHASH opcode"}},"sharding":{"blobCommitmentVersionKzg":{"v":1,"d":"The number indicated a versioned hash is a KZG commitment"},"fieldElementsPerBlob":{"v":4096,"d":"The number of field elements allowed per blob"}},"vm":{},"pow":{}}')},4887:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-4895","number":4895,"comment":"Beacon chain push withdrawals as operations","url":"https://eips.ethereum.org/EIPS/eip-4895","status":"Review","minimumHardfork":"merge","requiredEIPs":[],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},4265:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-5133","number":5133,"comment":"Delaying Difficulty Bomb to mid-September 2022","url":"https://eips.ethereum.org/EIPS/eip-5133","status":"Draft","minimumHardfork":"grayGlacier","gasConfig":{},"gasPrices":{},"vm":{},"pow":{"difficultyBombDelay":{"v":11400000,"d":"the amount of blocks to delay the difficulty bomb with"}}}')},3338:t=>{"use strict";t.exports=JSON.parse('{"name":"arrowGlacier","comment":"HF to delay the difficulty bomb","url":"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/arrow-glacier.md","status":"Final","eips":[4345],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},2278:t=>{"use strict";t.exports=JSON.parse('{"name":"berlin","comment":"HF targeted for July 2020 following the Muir Glacier HF","url":"https://eips.ethereum.org/EIPS/eip-2070","status":"Final","eips":[2565,2929,2718,2930]}')},5449:t=>{"use strict";t.exports=JSON.parse('{"name":"byzantium","comment":"Hardfork with new precompiles, instructions and other protocol changes","url":"https://eips.ethereum.org/EIPS/eip-609","status":"Final","gasConfig":{},"gasPrices":{"modexpGquaddivisor":{"v":20,"d":"Gquaddivisor from modexp precompile for gas calculation"},"ecAdd":{"v":500,"d":"Gas costs for curve addition precompile"},"ecMul":{"v":40000,"d":"Gas costs for curve multiplication precompile"},"ecPairing":{"v":100000,"d":"Base gas costs for curve pairing precompile"},"ecPairingWord":{"v":80000,"d":"Gas costs regarding curve pairing precompile input length"},"revert":{"v":0,"d":"Base fee of the REVERT opcode"},"staticcall":{"v":700,"d":"Base fee of the STATICCALL opcode"},"returndatasize":{"v":2,"d":"Base fee of the RETURNDATASIZE opcode"},"returndatacopy":{"v":3,"d":"Base fee of the RETURNDATACOPY opcode"}},"vm":{},"pow":{"minerReward":{"v":"3000000000000000000","d":"the amount a miner get rewarded for mining a block"},"difficultyBombDelay":{"v":3000000,"d":"the amount of blocks to delay the difficulty bomb with"}}}')},8050:t=>{"use strict";t.exports=JSON.parse('{"name":"chainstart","comment":"Start of the Ethereum main chain","url":"","status":"","gasConfig":{"minGasLimit":{"v":5000,"d":"Minimum the gas limit may ever be"},"gasLimitBoundDivisor":{"v":1024,"d":"The bound divisor of the gas limit, used in update calculations"},"maxRefundQuotient":{"v":2,"d":"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},"gasPrices":{"base":{"v":2,"d":"Gas base cost, used e.g. for ChainID opcode (Istanbul)"},"tierStep":{"v":[0,2,3,5,8,10,20],"d":"Once per operation, for a selection of them"},"exp":{"v":10,"d":"Base fee of the EXP opcode"},"expByte":{"v":10,"d":"Times ceil(log256(exponent)) for the EXP instruction"},"sha3":{"v":30,"d":"Base fee of the SHA3 opcode"},"sha3Word":{"v":6,"d":"Once per word of the SHA3 operation\'s data"},"sload":{"v":50,"d":"Base fee of the SLOAD opcode"},"sstoreSet":{"v":20000,"d":"Once per SSTORE operation if the zeroness changes from zero"},"sstoreReset":{"v":5000,"d":"Once per SSTORE operation if the zeroness does not change from zero"},"sstoreRefund":{"v":15000,"d":"Once per SSTORE operation if the zeroness changes to zero"},"jumpdest":{"v":1,"d":"Base fee of the JUMPDEST opcode"},"log":{"v":375,"d":"Base fee of the LOG opcode"},"logData":{"v":8,"d":"Per byte in a LOG* operation\'s data"},"logTopic":{"v":375,"d":"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas"},"create":{"v":32000,"d":"Base fee of the CREATE opcode"},"call":{"v":40,"d":"Base fee of the CALL opcode"},"callStipend":{"v":2300,"d":"Free gas given at beginning of call"},"callValueTransfer":{"v":9000,"d":"Paid for CALL when the value transfor is non-zero"},"callNewAccount":{"v":25000,"d":"Paid for CALL when the destination address didn\'t exist prior"},"selfdestructRefund":{"v":24000,"d":"Refunded following a selfdestruct operation"},"memory":{"v":3,"d":"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL"},"quadCoeffDiv":{"v":512,"d":"Divisor for the quadratic particle of the memory cost equation"},"createData":{"v":200,"d":""},"tx":{"v":21000,"d":"Per transaction. NOTE: Not payable on data of calls between transactions"},"txCreation":{"v":32000,"d":"The cost of creating a contract via tx"},"txDataZero":{"v":4,"d":"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions"},"txDataNonZero":{"v":68,"d":"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},"copy":{"v":3,"d":"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added"},"ecRecover":{"v":3000,"d":""},"sha256":{"v":60,"d":""},"sha256Word":{"v":12,"d":""},"ripemd160":{"v":600,"d":""},"ripemd160Word":{"v":120,"d":""},"identity":{"v":15,"d":""},"identityWord":{"v":3,"d":""},"stop":{"v":0,"d":"Base fee of the STOP opcode"},"add":{"v":3,"d":"Base fee of the ADD opcode"},"mul":{"v":5,"d":"Base fee of the MUL opcode"},"sub":{"v":3,"d":"Base fee of the SUB opcode"},"div":{"v":5,"d":"Base fee of the DIV opcode"},"sdiv":{"v":5,"d":"Base fee of the SDIV opcode"},"mod":{"v":5,"d":"Base fee of the MOD opcode"},"smod":{"v":5,"d":"Base fee of the SMOD opcode"},"addmod":{"v":8,"d":"Base fee of the ADDMOD opcode"},"mulmod":{"v":8,"d":"Base fee of the MULMOD opcode"},"signextend":{"v":5,"d":"Base fee of the SIGNEXTEND opcode"},"lt":{"v":3,"d":"Base fee of the LT opcode"},"gt":{"v":3,"d":"Base fee of the GT opcode"},"slt":{"v":3,"d":"Base fee of the SLT opcode"},"sgt":{"v":3,"d":"Base fee of the SGT opcode"},"eq":{"v":3,"d":"Base fee of the EQ opcode"},"iszero":{"v":3,"d":"Base fee of the ISZERO opcode"},"and":{"v":3,"d":"Base fee of the AND opcode"},"or":{"v":3,"d":"Base fee of the OR opcode"},"xor":{"v":3,"d":"Base fee of the XOR opcode"},"not":{"v":3,"d":"Base fee of the NOT opcode"},"byte":{"v":3,"d":"Base fee of the BYTE opcode"},"address":{"v":2,"d":"Base fee of the ADDRESS opcode"},"balance":{"v":20,"d":"Base fee of the BALANCE opcode"},"origin":{"v":2,"d":"Base fee of the ORIGIN opcode"},"caller":{"v":2,"d":"Base fee of the CALLER opcode"},"callvalue":{"v":2,"d":"Base fee of the CALLVALUE opcode"},"calldataload":{"v":3,"d":"Base fee of the CALLDATALOAD opcode"},"calldatasize":{"v":2,"d":"Base fee of the CALLDATASIZE opcode"},"calldatacopy":{"v":3,"d":"Base fee of the CALLDATACOPY opcode"},"codesize":{"v":2,"d":"Base fee of the CODESIZE opcode"},"codecopy":{"v":3,"d":"Base fee of the CODECOPY opcode"},"gasprice":{"v":2,"d":"Base fee of the GASPRICE opcode"},"extcodesize":{"v":20,"d":"Base fee of the EXTCODESIZE opcode"},"extcodecopy":{"v":20,"d":"Base fee of the EXTCODECOPY opcode"},"blockhash":{"v":20,"d":"Base fee of the BLOCKHASH opcode"},"coinbase":{"v":2,"d":"Base fee of the COINBASE opcode"},"timestamp":{"v":2,"d":"Base fee of the TIMESTAMP opcode"},"number":{"v":2,"d":"Base fee of the NUMBER opcode"},"difficulty":{"v":2,"d":"Base fee of the DIFFICULTY opcode"},"gaslimit":{"v":2,"d":"Base fee of the GASLIMIT opcode"},"pop":{"v":2,"d":"Base fee of the POP opcode"},"mload":{"v":3,"d":"Base fee of the MLOAD opcode"},"mstore":{"v":3,"d":"Base fee of the MSTORE opcode"},"mstore8":{"v":3,"d":"Base fee of the MSTORE8 opcode"},"sstore":{"v":0,"d":"Base fee of the SSTORE opcode"},"jump":{"v":8,"d":"Base fee of the JUMP opcode"},"jumpi":{"v":10,"d":"Base fee of the JUMPI opcode"},"pc":{"v":2,"d":"Base fee of the PC opcode"},"msize":{"v":2,"d":"Base fee of the MSIZE opcode"},"gas":{"v":2,"d":"Base fee of the GAS opcode"},"push":{"v":3,"d":"Base fee of the PUSH opcode"},"dup":{"v":3,"d":"Base fee of the DUP opcode"},"swap":{"v":3,"d":"Base fee of the SWAP opcode"},"callcode":{"v":40,"d":"Base fee of the CALLCODE opcode"},"return":{"v":0,"d":"Base fee of the RETURN opcode"},"invalid":{"v":0,"d":"Base fee of the INVALID opcode"},"selfdestruct":{"v":0,"d":"Base fee of the SELFDESTRUCT opcode"}},"vm":{"stackLimit":{"v":1024,"d":"Maximum size of VM stack allowed"},"callCreateDepth":{"v":1024,"d":"Maximum depth of call/create stack"},"maxExtraDataSize":{"v":32,"d":"Maximum size extra data may be after Genesis"}},"pow":{"minimumDifficulty":{"v":131072,"d":"The minimum that the difficulty may ever be"},"difficultyBoundDivisor":{"v":2048,"d":"The bound divisor of the difficulty, used in the update calculations"},"durationLimit":{"v":13,"d":"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not"},"epochDuration":{"v":30000,"d":"Duration between proof-of-work epochs"},"timebombPeriod":{"v":100000,"d":"Exponential difficulty timebomb period"},"minerReward":{"v":"5000000000000000000","d":"the amount a miner get rewarded for mining a block"},"difficultyBombDelay":{"v":0,"d":"the amount of blocks to delay the difficulty bomb with"}}}')},3360:t=>{"use strict";t.exports=JSON.parse('{"name":"constantinople","comment":"Postponed hardfork including EIP-1283 (SSTORE gas metering changes)","url":"https://eips.ethereum.org/EIPS/eip-1013","status":"Final","gasConfig":{},"gasPrices":{"netSstoreNoopGas":{"v":200,"d":"Once per SSTORE operation if the value doesn\'t change"},"netSstoreInitGas":{"v":20000,"d":"Once per SSTORE operation from clean zero"},"netSstoreCleanGas":{"v":5000,"d":"Once per SSTORE operation from clean non-zero"},"netSstoreDirtyGas":{"v":200,"d":"Once per SSTORE operation from dirty"},"netSstoreClearRefund":{"v":15000,"d":"Once per SSTORE operation for clearing an originally existing storage slot"},"netSstoreResetRefund":{"v":4800,"d":"Once per SSTORE operation for resetting to the original non-zero value"},"netSstoreResetClearRefund":{"v":19800,"d":"Once per SSTORE operation for resetting to the original zero value"},"shl":{"v":3,"d":"Base fee of the SHL opcode"},"shr":{"v":3,"d":"Base fee of the SHR opcode"},"sar":{"v":3,"d":"Base fee of the SAR opcode"},"extcodehash":{"v":400,"d":"Base fee of the EXTCODEHASH opcode"},"create2":{"v":32000,"d":"Base fee of the CREATE2 opcode"}},"vm":{},"pow":{"minerReward":{"v":"2000000000000000000","d":"The amount a miner gets rewarded for mining a block"},"difficultyBombDelay":{"v":5000000,"d":"the amount of blocks to delay the difficulty bomb with"}}}')},1243:t=>{"use strict";t.exports=JSON.parse('{"name":"dao","comment":"DAO rescue hardfork","url":"https://eips.ethereum.org/EIPS/eip-779","status":"Final","gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},8126:t=>{"use strict";t.exports=JSON.parse('{"name":"grayGlacier","comment":"Delaying the difficulty bomb to Mid September 2022","url":"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/gray-glacier.md","status":"Draft","eips":[5133],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},6544:t=>{"use strict";t.exports=JSON.parse('{"name":"homestead","comment":"Homestead hardfork with protocol and network changes","url":"https://eips.ethereum.org/EIPS/eip-606","status":"Final","gasConfig":{},"gasPrices":{"delegatecall":{"v":40,"d":"Base fee of the DELEGATECALL opcode"}},"vm":{},"pow":{}}')},1155:t=>{"use strict";t.exports=JSON.parse('{"name":"istanbul","comment":"HF targeted for December 2019 following the Constantinople/Petersburg HF","url":"https://eips.ethereum.org/EIPS/eip-1679","status":"Final","gasConfig":{},"gasPrices":{"blake2Round":{"v":1,"d":"Gas cost per round for the Blake2 F precompile"},"ecAdd":{"v":150,"d":"Gas costs for curve addition precompile"},"ecMul":{"v":6000,"d":"Gas costs for curve multiplication precompile"},"ecPairing":{"v":45000,"d":"Base gas costs for curve pairing precompile"},"ecPairingWord":{"v":34000,"d":"Gas costs regarding curve pairing precompile input length"},"txDataNonZero":{"v":16,"d":"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},"sstoreSentryGasEIP2200":{"v":2300,"d":"Minimum gas required to be present for an SSTORE call, not consumed"},"sstoreNoopGasEIP2200":{"v":800,"d":"Once per SSTORE operation if the value doesn\'t change"},"sstoreDirtyGasEIP2200":{"v":800,"d":"Once per SSTORE operation if a dirty value is changed"},"sstoreInitGasEIP2200":{"v":20000,"d":"Once per SSTORE operation from clean zero to non-zero"},"sstoreInitRefundEIP2200":{"v":19200,"d":"Once per SSTORE operation for resetting to the original zero value"},"sstoreCleanGasEIP2200":{"v":5000,"d":"Once per SSTORE operation from clean non-zero to something else"},"sstoreCleanRefundEIP2200":{"v":4200,"d":"Once per SSTORE operation for resetting to the original non-zero value"},"sstoreClearRefundEIP2200":{"v":15000,"d":"Once per SSTORE operation for clearing an originally existing storage slot"},"balance":{"v":700,"d":"Base fee of the BALANCE opcode"},"extcodehash":{"v":700,"d":"Base fee of the EXTCODEHASH opcode"},"chainid":{"v":2,"d":"Base fee of the CHAINID opcode"},"selfbalance":{"v":5,"d":"Base fee of the SELFBALANCE opcode"},"sload":{"v":800,"d":"Base fee of the SLOAD opcode"}},"vm":{},"pow":{}}')},8684:t=>{"use strict";t.exports=JSON.parse('{"name":"london","comment":"HF targeted for July 2021 following the Berlin fork","url":"https://github.com/ethereum/eth1.0-specs/blob/master/network-upgrades/mainnet-upgrades/london.md","status":"Final","eips":[1559,3198,3529,3541]}')},8518:t=>{"use strict";t.exports=JSON.parse('{"name":"merge","comment":"Hardfork to upgrade the consensus mechanism to Proof-of-Stake","url":"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/merge.md","status":"Final","consensus":{"type":"pos","algorithm":"casper","casper":{}},"eips":[3675,4399]}')},1687:t=>{"use strict";t.exports=JSON.parse('{"name":"mergeForkIdTransition","comment":"Pre-merge hardfork to fork off non-upgraded clients","url":"https://eips.ethereum.org/EIPS/eip-3675","status":"Draft","eips":[]}')},2991:t=>{"use strict";t.exports=JSON.parse('{"name":"muirGlacier","comment":"HF to delay the difficulty bomb","url":"https://eips.ethereum.org/EIPS/eip-2384","status":"Final","gasConfig":{},"gasPrices":{},"vm":{},"pow":{"difficultyBombDelay":{"v":9000000,"d":"the amount of blocks to delay the difficulty bomb with"}}}')},1898:t=>{"use strict";t.exports=JSON.parse('{"name":"petersburg","comment":"Aka constantinopleFix, removes EIP-1283, activate together with or after constantinople","url":"https://eips.ethereum.org/EIPS/eip-1716","status":"Final","gasConfig":{},"gasPrices":{"netSstoreNoopGas":{"v":null,"d":"Removed along EIP-1283"},"netSstoreInitGas":{"v":null,"d":"Removed along EIP-1283"},"netSstoreCleanGas":{"v":null,"d":"Removed along EIP-1283"},"netSstoreDirtyGas":{"v":null,"d":"Removed along EIP-1283"},"netSstoreClearRefund":{"v":null,"d":"Removed along EIP-1283"},"netSstoreResetRefund":{"v":null,"d":"Removed along EIP-1283"},"netSstoreResetClearRefund":{"v":null,"d":"Removed along EIP-1283"}},"vm":{},"pow":{}}')},7644:t=>{"use strict";t.exports=JSON.parse('{"name":"shanghai","comment":"Next feature hardfork after the merge hardfork having withdrawals, warm coinbase, push0, limit/meter initcode","url":"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md","status":"Final","eips":[3651,3855,3860,4895]}')},2551:t=>{"use strict";t.exports=JSON.parse('{"name":"shardingFork","comment":"Internal hardfork to test proto-danksharding (do not use in production)","url":"https://eips.ethereum.org/EIPS/eip-4844","status":"Experimental","eips":[4844]}')},2800:t=>{"use strict";t.exports=JSON.parse('{"name":"spuriousDragon","comment":"HF with EIPs for simple replay attack protection, EXP cost increase, state trie clearing, contract code size limit","url":"https://eips.ethereum.org/EIPS/eip-607","status":"Final","gasConfig":{},"gasPrices":{"expByte":{"v":50,"d":"Times ceil(log256(exponent)) for the EXP instruction"}},"vm":{"maxCodeSize":{"v":24576,"d":"Maximum length of contract code"}},"pow":{}}')},3193:t=>{"use strict";t.exports=JSON.parse('{"name":"tangerineWhistle","comment":"Hardfork with gas cost changes for IO-heavy operations","url":"https://eips.ethereum.org/EIPS/eip-608","status":"Final","gasConfig":{},"gasPrices":{"sload":{"v":200,"d":"Once per SLOAD operation"},"call":{"v":700,"d":"Once per CALL operation & message call transaction"},"extcodesize":{"v":700,"d":"Base fee of the EXTCODESIZE opcode"},"extcodecopy":{"v":700,"d":"Base fee of the EXTCODECOPY opcode"},"balance":{"v":400,"d":"Base fee of the BALANCE opcode"},"delegatecall":{"v":700,"d":"Base fee of the DELEGATECALL opcode"},"callcode":{"v":700,"d":"Base fee of the CALLCODE opcode"},"selfdestruct":{"v":5000,"d":"Base fee of the SELFDESTRUCT opcode"}},"vm":{},"pow":{}}')},9234:t=>{"use strict";t.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},26:t=>{"use strict";t.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},9167:t=>{"use strict";t.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},3418:t=>{"use strict";t.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},763:t=>{"use strict";t.exports={i8:"6.6.1"}},8675:t=>{"use strict";t.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},7295:t=>{"use strict";t.exports=JSON.parse('{"name":"goerli","chainId":5,"networkId":5,"defaultHardfork":"merge","consensus":{"type":"poa","algorithm":"clique","clique":{"period":15,"epoch":30000}},"comment":"Cross-client PoA test network","url":"https://github.com/goerli/testnet","genesis":{"timestamp":"0x5c51a607","gasLimit":10485760,"difficulty":1,"nonce":"0x0000000000000000","extraData":"0x22466c6578692069732061207468696e6722202d204166726900000000000000e0a2bd4258d2768837baa26a28fe71dc079f84c70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0xa3f5ab08"},{"name":"homestead","block":0,"forkHash":"0xa3f5ab08"},{"name":"tangerineWhistle","block":0,"forkHash":"0xa3f5ab08"},{"name":"spuriousDragon","block":0,"forkHash":"0xa3f5ab08"},{"name":"byzantium","block":0,"forkHash":"0xa3f5ab08"},{"name":"constantinople","block":0,"forkHash":"0xa3f5ab08"},{"name":"petersburg","block":0,"forkHash":"0xa3f5ab08"},{"name":"istanbul","block":1561651,"forkHash":"0xc25efa5c"},{"name":"berlin","block":4460644,"forkHash":"0x757a1c47"},{"name":"london","block":5062605,"forkHash":"0xb8c6299d"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://goerli.etherscan.io/block/7382818","name":"merge","ttd":"10790000","block":7382819,"forkHash":"0xb8c6299d"},{"name":"mergeForkIdTransition","block":null,"forkHash":null},{"name":"shanghai","block":null,"timestamp":"1678832736","forkHash":"0xf9843abf"}],"bootstrapNodes":[{"ip":"51.141.78.53","port":30303,"id":"011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a","location":"","comment":"Upstream bootnode 1"},{"ip":"13.93.54.137","port":30303,"id":"176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b","location":"","comment":"Upstream bootnode 2"},{"ip":"94.237.54.114","port":30313,"id":"46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291","location":"","comment":"Upstream bootnode 3"},{"ip":"18.218.250.66","port":30313,"id":"b5948a2d3e9d486c4d75bf32713221c2bd6cf86463302339299bd227dc2e276cd5a1c7ca4f43a0e9122fe9af884efed563bd2a1fd28661f3b5f5ad7bf1de5949","location":"","comment":"Upstream bootnode 4"},{"ip":"3.11.147.67","port":30303,"id":"a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91","location":"","comment":"Ethereum Foundation bootnode"},{"ip":"51.15.116.226","port":30303,"id":"a869b02cec167211fb4815a82941db2e7ed2936fd90e78619c53eb17753fcf0207463e3419c264e2a1dd8786de0df7e68cf99571ab8aeb7c4e51367ef186b1dd","location":"","comment":"Goerli Initiative bootnode"},{"ip":"51.15.119.157","port":30303,"id":"807b37ee4816ecf407e9112224494b74dd5933625f655962d892f2f0f02d7fbbb3e2a94cf87a96609526f30c998fd71e93e2f53015c558ffc8b03eceaf30ee33","location":"","comment":"Goerli Initiative bootnode"},{"ip":"51.15.119.157","port":40303,"id":"a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd","location":"","comment":"Goerli Initiative bootnode"}],"dnsNetworks":["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.goerli.ethdisco.net"]}')},3323:t=>{"use strict";t.exports=JSON.parse('{"name":"mainnet","chainId":1,"networkId":1,"defaultHardfork":"merge","consensus":{"type":"pow","algorithm":"ethash","ethash":{}},"comment":"The Ethereum main chain","url":"https://ethstats.net/","genesis":{"gasLimit":5000,"difficulty":17179869184,"nonce":"0x0000000000000042","extraData":"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0xfc64ec04"},{"name":"homestead","block":1150000,"forkHash":"0x97c2c34c"},{"name":"dao","block":1920000,"forkHash":"0x91d1f948"},{"name":"tangerineWhistle","block":2463000,"forkHash":"0x7a64da13"},{"name":"spuriousDragon","block":2675000,"forkHash":"0x3edd5b10"},{"name":"byzantium","block":4370000,"forkHash":"0xa00bc324"},{"name":"constantinople","block":7280000,"forkHash":"0x668db0af"},{"name":"petersburg","block":7280000,"forkHash":"0x668db0af"},{"name":"istanbul","block":9069000,"forkHash":"0x879d6e30"},{"name":"muirGlacier","block":9200000,"forkHash":"0xe029e991"},{"name":"berlin","block":12244000,"forkHash":"0x0eb440f6"},{"name":"london","block":12965000,"forkHash":"0xb715077d"},{"name":"arrowGlacier","block":13773000,"forkHash":"0x20c327fc"},{"name":"grayGlacier","block":15050000,"forkHash":"0xf0afd0e3"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://etherscan.io/block/15537393","name":"merge","ttd":"58750000000000000000000","block":15537394,"forkHash":"0xf0afd0e3"},{"name":"mergeForkIdTransition","block":null,"forkHash":null},{"name":"shanghai","block":null,"timestamp":"1681338455","forkHash":"0xdce96c2d"}],"bootstrapNodes":[{"ip":"18.138.108.67","port":30303,"id":"d860a01f9722d78051619d1e2351aba3f43f943f6f00718d1b9baa4101932a1f5011f16bb2b1bb35db20d6fe28fa0bf09636d26a87d31de9ec6203eeedb1f666","location":"ap-southeast-1-001","comment":"bootnode-aws-ap-southeast-1-001"},{"ip":"3.209.45.79","port":30303,"id":"22a8232c3abc76a16ae9d6c3b164f98775fe226f0917b0ca871128a74a8e9630b458460865bab457221f1d448dd9791d24c4e5d88786180ac185df813a68d4de","location":"us-east-1-001","comment":"bootnode-aws-us-east-1-001"},{"ip":"65.108.70.101","port":30303,"id":"2b252ab6a1d0f971d9722cb839a42cb81db019ba44c08754628ab4a823487071b5695317c8ccd085219c3a03af063495b2f1da8d18218da2d6a82981b45e6ffc","location":"eu-west-1-001","comment":"bootnode-hetzner-hel"},{"ip":"157.90.35.166","port":30303,"id":"4aeb4ab6c14b23e2c4cfdce879c04b0748a20d8e9b59e25ded2a08143e265c6c25936e74cbc8e641e3312ca288673d91f2f93f8e277de3cfa444ecdaaf982052","location":"eu-central-1-001","comment":"bootnode-hetzner-fsn"}],"dnsNetworks":["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.mainnet.ethdisco.net"]}')},6987:t=>{"use strict";t.exports=JSON.parse('{"name":"rinkeby","chainId":4,"networkId":4,"defaultHardfork":"london","consensus":{"type":"poa","algorithm":"clique","clique":{"period":15,"epoch":30000}},"comment":"PoA test network","url":"https://www.rinkeby.io","genesis":{"timestamp":"0x58ee40ba","gasLimit":4700000,"difficulty":1,"nonce":"0x0000000000000000","extraData":"0x52657370656374206d7920617574686f7269746168207e452e436172746d616e42eb768f2244c8811c63729a21a3569731535f067ffc57839b00206d1ad20c69a1981b489f772031b279182d99e65703f0076e4812653aab85fca0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0x3b8e0691"},{"name":"homestead","block":1,"forkHash":"0x60949295"},{"name":"tangerineWhistle","block":2,"forkHash":"0x8bde40dd"},{"name":"spuriousDragon","block":3,"forkHash":"0xcb3a64bb"},{"name":"byzantium","block":1035301,"forkHash":"0x8d748b57"},{"name":"constantinople","block":3660663,"forkHash":"0xe49cab14"},{"name":"petersburg","block":4321234,"forkHash":"0xafec6b27"},{"name":"istanbul","block":5435345,"forkHash":"0xcbdb8838"},{"name":"berlin","block":8290928,"forkHash":"0x6910c8bd"},{"name":"london","block":8897988,"forkHash":"0x8e29f2f3"},{"name":"merge","block":null,"forkHash":null},{"name":"shanghai","block":null,"forkHash":null}],"bootstrapNodes":[{"ip":"52.169.42.101","port":30303,"id":"a24ac7c5484ef4ed0c5eb2d36620ba4e4aa13b8c84684e1b4aab0cebea2ae45cb4d375b77eab56516d34bfbd3c1a833fc51296ff084b770b94fb9028c4d25ccf","location":"","comment":"IE"},{"ip":"52.3.158.184","port":30303,"id":"343149e4feefa15d882d9fe4ac7d88f885bd05ebb735e547f12e12080a9fa07c8014ca6fd7f373123488102fe5e34111f8509cf0b7de3f5b44339c9f25e87cb8","location":"","comment":"INFURA"},{"ip":"159.89.28.211","port":30303,"id":"b6b28890b006743680c52e64e0d16db57f28124885595fa03a562be1d2bf0f3a1da297d56b13da25fb992888fd556d4c1a27b1f39d531bde7de1921c90061cc6","location":"","comment":"AKASHA"}],"dnsNetworks":["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.rinkeby.ethdisco.net"]}')},2823:t=>{"use strict";t.exports=JSON.parse('{"name":"ropsten","chainId":3,"networkId":3,"defaultHardfork":"merge","consensus":{"type":"pow","algorithm":"ethash","ethash":{}},"comment":"PoW test network","url":"https://github.com/ethereum/ropsten","genesis":{"gasLimit":16777216,"difficulty":1048576,"nonce":"0x0000000000000042","extraData":"0x3535353535353535353535353535353535353535353535353535353535353535"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0x30c7ddbc"},{"name":"homestead","block":0,"forkHash":"0x30c7ddbc"},{"name":"tangerineWhistle","block":0,"forkHash":"0x30c7ddbc"},{"name":"spuriousDragon","block":10,"forkHash":"0x63760190"},{"name":"byzantium","block":1700000,"forkHash":"0x3ea159c7"},{"name":"constantinople","block":4230000,"forkHash":"0x97b544f3"},{"name":"petersburg","block":4939394,"forkHash":"0xd6e2149b"},{"name":"istanbul","block":6485846,"forkHash":"0x4bc66396"},{"name":"muirGlacier","block":7117117,"forkHash":"0x6727ef90"},{"name":"berlin","block":9812189,"forkHash":"0xa157d377"},{"name":"london","block":10499401,"forkHash":"0x7119b6b3"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge","name":"merge","ttd":"50000000000000000","block":null,"forkHash":"0x7119b6b3"},{"name":"mergeForkIdTransition","block":null,"forkHash":null},{"name":"shanghai","block":null,"forkHash":null}],"bootstrapNodes":[{"ip":"52.176.7.10","port":30303,"id":"30b7ab30a01c124a6cceca36863ece12c4f5fa68e3ba9b0b51407ccc002eeed3b3102d20a88f1c1d3c3154e2449317b8ef95090e77b312d5cc39354f86d5d606","location":"","comment":"US-Azure geth"},{"ip":"52.176.100.77","port":30303,"id":"865a63255b3bb68023b6bffd5095118fcc13e79dcf014fe4e47e065c350c7cc72af2e53eff895f11ba1bbb6a2b33271c1116ee870f266618eadfc2e78aa7349c","location":"","comment":"US-Azure parity"},{"ip":"52.232.243.152","port":30303,"id":"6332792c4a00e3e4ee0926ed89e0d27ef985424d97b6a45bf0f23e51f0dcb5e66b875777506458aea7af6f9e4ffb69f43f3778ee73c81ed9d34c51c4b16b0b0f","location":"","comment":"Parity"},{"ip":"192.81.208.223","port":30303,"id":"94c15d1b9e2fe7ce56e458b9a3b672ef11894ddedd0c6f247e0f1d3487f52b66208fb4aeb8179fce6e3a749ea93ed147c37976d67af557508d199d9594c35f09","location":"","comment":"@gpip"}],"dnsNetworks":["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.ropsten.ethdisco.net"]}')},5810:t=>{"use strict";t.exports=JSON.parse('{"name":"sepolia","chainId":11155111,"networkId":11155111,"defaultHardfork":"merge","consensus":{"type":"pow","algorithm":"ethash","ethash":{}},"comment":"PoW test network to replace Ropsten","url":"https://github.com/ethereum/go-ethereum/pull/23730","genesis":{"timestamp":"0x6159af19","gasLimit":30000000,"difficulty":131072,"nonce":"0x0000000000000000","extraData":"0x5365706f6c69612c20417468656e732c204174746963612c2047726565636521"},"hardforks":[{"name":"chainstart","block":0,"forkHash":"0xfe3366e7"},{"name":"homestead","block":0,"forkHash":"0xfe3366e7"},{"name":"tangerineWhistle","block":0,"forkHash":"0xfe3366e7"},{"name":"spuriousDragon","block":0,"forkHash":"0xfe3366e7"},{"name":"byzantium","block":0,"forkHash":"0xfe3366e7"},{"name":"constantinople","block":0,"forkHash":"0xfe3366e7"},{"name":"petersburg","block":0,"forkHash":"0xfe3366e7"},{"name":"istanbul","block":0,"forkHash":"0xfe3366e7"},{"name":"muirGlacier","block":0,"forkHash":"0xfe3366e7"},{"name":"berlin","block":0,"forkHash":"0xfe3366e7"},{"name":"london","block":0,"forkHash":"0xfe3366e7"},{"//_comment":"The forkHash will remain same as mergeForkIdTransition is post merge, terminal block: https://sepolia.etherscan.io/block/1450408","name":"merge","ttd":"17000000000000000","block":1450409,"forkHash":"0xfe3366e7"},{"name":"mergeForkIdTransition","block":1735371,"forkHash":"0xb96cbd13"},{"name":"shanghai","block":null,"timestamp":"1677557088","forkHash":"0xf7f9bc08"}],"bootstrapNodes":[{"ip":"18.168.182.86","port":30303,"id":"9246d00bc8fd1742e5ad2428b80fc4dc45d786283e05ef6edbd9002cbc335d40998444732fbe921cb88e1d2c73d1b1de53bae6a2237996e9bfe14f871baf7066","location":"","comment":"geth"},{"ip":"52.14.151.177","port":30303,"id":"ec66ddcf1a974950bd4c782789a7e04f8aa7110a72569b6e65fcd51e937e74eed303b1ea734e4d19cfaec9fbff9b6ee65bf31dcb50ba79acce9dd63a6aca61c7","location":"","comment":"besu"},{"ip":"165.22.196.173","port":30303,"id":"ce970ad2e9daa9e14593de84a8b49da3d54ccfdf83cbc4fe519cb8b36b5918ed4eab087dedd4a62479b8d50756b492d5f762367c8d20329a7854ec01547568a6","location":"","comment":"EF"},{"ip":"65.108.95.67","port":30303,"id":"075503b13ed736244896efcde2a992ec0b451357d46cb7a8132c0384721742597fc8f0d91bbb40bb52e7d6e66728d36a1fda09176294e4a30cfac55dcce26bc6","location":"","comment":"lodestar"}],"dnsNetworks":["enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@all.sepolia.ethdisco.net"]}')},4104:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-1153","number":1153,"comment":"Transient Storage","url":"https://eips.ethereum.org/EIPS/eip-1153","status":"Review","minimumHardfork":"chainstart","requiredEIPs":[],"gasConfig":{},"gasPrices":{"tstore":{"v":100,"d":"Base fee of the TSTORE opcode"},"tload":{"v":100,"d":"Base fee of the TLOAD opcode"}},"vm":{},"pow":{}}')},1187:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-1559","number":1559,"comment":"Fee market change for ETH 1.0 chain","url":"https://eips.ethereum.org/EIPS/eip-1559","status":"Final","minimumHardfork":"berlin","requiredEIPs":[2930],"gasConfig":{"baseFeeMaxChangeDenominator":{"v":8,"d":"Maximum base fee change denominator"},"elasticityMultiplier":{"v":2,"d":"Maximum block gas target elasticity"},"initialBaseFee":{"v":1000000000,"d":"Initial base fee on first EIP1559 block"}},"gasPrices":{},"vm":{},"pow":{}}')},2643:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-2315","number":2315,"comment":"Simple subroutines for the EVM","url":"https://eips.ethereum.org/EIPS/eip-2315","status":"Draft","minimumHardfork":"istanbul","gasConfig":{},"gasPrices":{"beginsub":{"v":2,"d":"Base fee of the BEGINSUB opcode"},"returnsub":{"v":5,"d":"Base fee of the RETURNSUB opcode"},"jumpsub":{"v":10,"d":"Base fee of the JUMPSUB opcode"}},"vm":{},"pow":{}}')},7158:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-2537","number":2537,"comment":"BLS12-381 precompiles","url":"https://eips.ethereum.org/EIPS/eip-2537","status":"Draft","minimumHardfork":"chainstart","gasConfig":{},"gasPrices":{"Bls12381G1AddGas":{"v":600,"d":"Gas cost of a single BLS12-381 G1 addition precompile-call"},"Bls12381G1MulGas":{"v":12000,"d":"Gas cost of a single BLS12-381 G1 multiplication precompile-call"},"Bls12381G2AddGas":{"v":4500,"d":"Gas cost of a single BLS12-381 G2 addition precompile-call"},"Bls12381G2MulGas":{"v":55000,"d":"Gas cost of a single BLS12-381 G2 multiplication precompile-call"},"Bls12381PairingBaseGas":{"v":115000,"d":"Base gas cost of BLS12-381 pairing check"},"Bls12381PairingPerPairGas":{"v":23000,"d":"Per-pair gas cost of BLS12-381 pairing check"},"Bls12381MapG1Gas":{"v":5500,"d":"Gas cost of BLS12-381 map field element to G1"},"Bls12381MapG2Gas":{"v":110000,"d":"Gas cost of BLS12-381 map field element to G2"},"Bls12381MultiExpGasDiscount":{"v":[[1,1200],[2,888],[3,764],[4,641],[5,594],[6,547],[7,500],[8,453],[9,438],[10,423],[11,408],[12,394],[13,379],[14,364],[15,349],[16,334],[17,330],[18,326],[19,322],[20,318],[21,314],[22,310],[23,306],[24,302],[25,298],[26,294],[27,289],[28,285],[29,281],[30,277],[31,273],[32,269],[33,268],[34,266],[35,265],[36,263],[37,262],[38,260],[39,259],[40,257],[41,256],[42,254],[43,253],[44,251],[45,250],[46,248],[47,247],[48,245],[49,244],[50,242],[51,241],[52,239],[53,238],[54,236],[55,235],[56,233],[57,232],[58,231],[59,229],[60,228],[61,226],[62,225],[63,223],[64,222],[65,221],[66,220],[67,219],[68,219],[69,218],[70,217],[71,216],[72,216],[73,215],[74,214],[75,213],[76,213],[77,212],[78,211],[79,211],[80,210],[81,209],[82,208],[83,208],[84,207],[85,206],[86,205],[87,205],[88,204],[89,203],[90,202],[91,202],[92,201],[93,200],[94,199],[95,199],[96,198],[97,197],[98,196],[99,196],[100,195],[101,194],[102,193],[103,193],[104,192],[105,191],[106,191],[107,190],[108,189],[109,188],[110,188],[111,187],[112,186],[113,185],[114,185],[115,184],[116,183],[117,182],[118,182],[119,181],[120,180],[121,179],[122,179],[123,178],[124,177],[125,176],[126,176],[127,175],[128,174]],"d":"Discount gas costs of calls to the MultiExp precompiles with `k` (point, scalar) pair"}},"vm":{},"pow":{}}')},8499:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-2565","number":2565,"comment":"ModExp gas cost","url":"https://eips.ethereum.org/EIPS/eip-2565","status":"Final","minimumHardfork":"byzantium","gasConfig":{},"gasPrices":{"modexpGquaddivisor":{"v":3,"d":"Gquaddivisor from modexp precompile for gas calculation"}},"vm":{},"pow":{}}')},6796:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-2718","comment":"Typed Transaction Envelope","url":"https://eips.ethereum.org/EIPS/eip-2718","status":"Final","minimumHardfork":"chainstart","gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},8345:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-2929","comment":"Gas cost increases for state access opcodes","url":"https://eips.ethereum.org/EIPS/eip-2929","status":"Final","minimumHardfork":"chainstart","gasConfig":{},"gasPrices":{"coldsload":{"v":2100,"d":"Gas cost of the first read of storage from a given location (per transaction)"},"coldaccountaccess":{"v":2600,"d":"Gas cost of the first read of a given address (per transaction)"},"warmstorageread":{"v":100,"d":"Gas cost of reading storage locations which have already loaded \'cold\'"},"sstoreCleanGasEIP2200":{"v":2900,"d":"Once per SSTORE operation from clean non-zero to something else"},"sstoreNoopGasEIP2200":{"v":100,"d":"Once per SSTORE operation if the value doesn\'t change"},"sstoreDirtyGasEIP2200":{"v":100,"d":"Once per SSTORE operation if a dirty value is changed"},"sstoreInitRefundEIP2200":{"v":19900,"d":"Once per SSTORE operation for resetting to the original zero value"},"sstoreCleanRefundEIP2200":{"v":4900,"d":"Once per SSTORE operation for resetting to the original non-zero value"},"call":{"v":0,"d":"Base fee of the CALL opcode"},"callcode":{"v":0,"d":"Base fee of the CALLCODE opcode"},"delegatecall":{"v":0,"d":"Base fee of the DELEGATECALL opcode"},"staticcall":{"v":0,"d":"Base fee of the STATICCALL opcode"},"balance":{"v":0,"d":"Base fee of the BALANCE opcode"},"extcodesize":{"v":0,"d":"Base fee of the EXTCODESIZE opcode"},"extcodecopy":{"v":0,"d":"Base fee of the EXTCODECOPY opcode"},"extcodehash":{"v":0,"d":"Base fee of the EXTCODEHASH opcode"},"sload":{"v":0,"d":"Base fee of the SLOAD opcode"},"sstore":{"v":0,"d":"Base fee of the SSTORE opcode"}},"vm":{},"pow":{}}')},8185:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-2930","comment":"Optional access lists","url":"https://eips.ethereum.org/EIPS/eip-2930","status":"Final","minimumHardfork":"istanbul","requiredEIPs":[2718,2929],"gasConfig":{},"gasPrices":{"accessListStorageKeyCost":{"v":1900,"d":"Gas cost per storage key in an Access List transaction"},"accessListAddressCost":{"v":2400,"d":"Gas cost per storage key in an Access List transaction"}},"vm":{},"pow":{}}')},9579:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3074","number":3074,"comment":"AUTH and AUTHCALL opcodes","url":"https://eips.ethereum.org/EIPS/eip-3074","status":"Review","minimumHardfork":"london","gasConfig":{},"gasPrices":{"auth":{"v":3100,"d":"Gas cost of the AUTH opcode"},"authcall":{"v":0,"d":"Gas cost of the AUTHCALL opcode"},"authcallValueTransfer":{"v":6700,"d":"Paid for CALL when the value transfer is non-zero"}},"vm":{},"pow":{}}')},445:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3198","number":3198,"comment":"BASEFEE opcode","url":"https://eips.ethereum.org/EIPS/eip-3198","status":"Final","minimumHardfork":"london","gasConfig":{},"gasPrices":{"basefee":{"v":2,"d":"Gas cost of the BASEFEE opcode"}},"vm":{},"pow":{}}')},6102:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3529","comment":"Reduction in refunds","url":"https://eips.ethereum.org/EIPS/eip-3529","status":"Final","minimumHardfork":"berlin","requiredEIPs":[2929],"gasConfig":{"maxRefundQuotient":{"v":5,"d":"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},"gasPrices":{"selfdestructRefund":{"v":0,"d":"Refunded following a selfdestruct operation"},"sstoreClearRefundEIP2200":{"v":4800,"d":"Once per SSTORE operation for clearing an originally existing storage slot"}},"vm":{},"pow":{}}')},1800:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3540","number":3540,"comment":"EVM Object Format (EOF) v1","url":"https://eips.ethereum.org/EIPS/eip-3540","status":"Review","minimumHardfork":"london","requiredEIPs":[3541],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},2867:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3541","comment":"Reject new contracts starting with the 0xEF byte","url":"https://eips.ethereum.org/EIPS/eip-3541","status":"Final","minimumHardfork":"berlin","requiredEIPs":[],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},8691:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3554","comment":"Reduction in refunds","url":"Difficulty Bomb Delay to December 1st 2021","status":"Final","minimumHardfork":"muirGlacier","requiredEIPs":[],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{"difficultyBombDelay":{"v":9500000,"d":"the amount of blocks to delay the difficulty bomb with"}}}')},4519:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3607","number":3607,"comment":"Reject transactions from senders with deployed code","url":"https://eips.ethereum.org/EIPS/eip-3607","status":"Final","minimumHardfork":"chainstart","requiredEIPs":[],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},7459:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3651","number":3198,"comment":"Warm COINBASE","url":"https://eips.ethereum.org/EIPS/eip-3651","status":"Review","minimumHardfork":"london","requiredEIPs":[2929],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},3632:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3670","number":3670,"comment":"EOF - Code Validation","url":"https://eips.ethereum.org/EIPS/eip-3670","status":"Review","minimumHardfork":"london","requiredEIPs":[3540],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},1794:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3675","number":3675,"comment":"Upgrade consensus to Proof-of-Stake","url":"https://eips.ethereum.org/EIPS/eip-3675","status":"Final","minimumHardfork":"london","requiredEIPs":[],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},7749:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3855","number":3855,"comment":"PUSH0 instruction","url":"https://eips.ethereum.org/EIPS/eip-3855","status":"Review","minimumHardfork":"chainstart","requiredEIPs":[],"gasConfig":{},"gasPrices":{"push0":{"v":2,"d":"Base fee of the PUSH0 opcode"}},"vm":{},"pow":{}}')},9063:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-3860","number":3860,"comment":"Limit and meter initcode","url":"https://eips.ethereum.org/EIPS/eip-3860","status":"Review","minimumHardfork":"spuriousDragon","requiredEIPs":[],"gasConfig":{},"gasPrices":{"initCodeWordCost":{"v":2,"d":"Gas to pay for each word (32 bytes) of initcode when creating a contract"}},"vm":{"maxInitCodeSize":{"v":49152,"d":"Maximum length of initialization code when creating a contract"}},"pow":{}}')},7113:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-4345","number":4345,"comment":"Difficulty Bomb Delay to June 2022","url":"https://eips.ethereum.org/EIPS/eip-4345","status":"Final","minimumHardfork":"london","gasConfig":{},"gasPrices":{},"vm":{},"pow":{"difficultyBombDelay":{"v":10700000,"d":"the amount of blocks to delay the difficulty bomb with"}}}')},9602:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-4399","number":4399,"comment":"Supplant DIFFICULTY opcode with PREVRANDAO","url":"https://eips.ethereum.org/EIPS/eip-4399","status":"Review","minimumHardfork":"london","requiredEIPs":[],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},4240:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-4844","number":4844,"comment":"Shard Blob Transactions","url":"https://eips.ethereum.org/EIPS/eip-4844","status":"Draft","minimumHardfork":"merge","requiredEIPs":[1559,2718,2930,4895],"gasConfig":{"dataGasPerBlob":{"v":131072,"d":"The base fee for data gas per blob"},"targetDataGasPerBlock":{"v":262144,"d":"The target data gas consumed per block"},"maxDataGasPerBlock":{"v":524288,"d":"The max data gas allowable per block"},"dataGasPriceUpdateFraction":{"v":2225652,"d":"The denominator used in the exponential when calculating a data gas price"}},"gasPrices":{"simpleGasPerBlob":{"v":12000,"d":"The basic gas fee for each blob"},"minDataGasPrice":{"v":1,"d":"The minimum fee per data gas"},"kzgPointEvaluationGasPrecompilePrice":{"v":50000,"d":"The fee associated with the point evaluation precompile"},"datahash":{"v":3,"d":"Base fee of the DATAHASH opcode"}},"sharding":{"blobCommitmentVersionKzg":{"v":1,"d":"The number indicated a versioned hash is a KZG commitment"},"fieldElementsPerBlob":{"v":4096,"d":"The number of field elements allowed per blob"}},"vm":{},"pow":{}}')},5357:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-4895","number":4895,"comment":"Beacon chain push withdrawals as operations","url":"https://eips.ethereum.org/EIPS/eip-4895","status":"Review","minimumHardfork":"merge","requiredEIPs":[],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},4304:t=>{"use strict";t.exports=JSON.parse('{"name":"EIP-5133","number":5133,"comment":"Delaying Difficulty Bomb to mid-September 2022","url":"https://eips.ethereum.org/EIPS/eip-5133","status":"Draft","minimumHardfork":"grayGlacier","gasConfig":{},"gasPrices":{},"vm":{},"pow":{"difficultyBombDelay":{"v":11400000,"d":"the amount of blocks to delay the difficulty bomb with"}}}')},4211:t=>{"use strict";t.exports=JSON.parse('{"name":"arrowGlacier","comment":"HF to delay the difficulty bomb","url":"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/arrow-glacier.md","status":"Final","eips":[4345],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},5880:t=>{"use strict";t.exports=JSON.parse('{"name":"berlin","comment":"HF targeted for July 2020 following the Muir Glacier HF","url":"https://eips.ethereum.org/EIPS/eip-2070","status":"Final","eips":[2565,2929,2718,2930]}')},3099:t=>{"use strict";t.exports=JSON.parse('{"name":"byzantium","comment":"Hardfork with new precompiles, instructions and other protocol changes","url":"https://eips.ethereum.org/EIPS/eip-609","status":"Final","gasConfig":{},"gasPrices":{"modexpGquaddivisor":{"v":20,"d":"Gquaddivisor from modexp precompile for gas calculation"},"ecAdd":{"v":500,"d":"Gas costs for curve addition precompile"},"ecMul":{"v":40000,"d":"Gas costs for curve multiplication precompile"},"ecPairing":{"v":100000,"d":"Base gas costs for curve pairing precompile"},"ecPairingWord":{"v":80000,"d":"Gas costs regarding curve pairing precompile input length"},"revert":{"v":0,"d":"Base fee of the REVERT opcode"},"staticcall":{"v":700,"d":"Base fee of the STATICCALL opcode"},"returndatasize":{"v":2,"d":"Base fee of the RETURNDATASIZE opcode"},"returndatacopy":{"v":3,"d":"Base fee of the RETURNDATACOPY opcode"}},"vm":{},"pow":{"minerReward":{"v":"3000000000000000000","d":"the amount a miner get rewarded for mining a block"},"difficultyBombDelay":{"v":3000000,"d":"the amount of blocks to delay the difficulty bomb with"}}}')},8158:t=>{"use strict";t.exports=JSON.parse('{"name":"chainstart","comment":"Start of the Ethereum main chain","url":"","status":"","gasConfig":{"minGasLimit":{"v":5000,"d":"Minimum the gas limit may ever be"},"gasLimitBoundDivisor":{"v":1024,"d":"The bound divisor of the gas limit, used in update calculations"},"maxRefundQuotient":{"v":2,"d":"Maximum refund quotient; max tx refund is min(tx.gasUsed/maxRefundQuotient, tx.gasRefund)"}},"gasPrices":{"base":{"v":2,"d":"Gas base cost, used e.g. for ChainID opcode (Istanbul)"},"tierStep":{"v":[0,2,3,5,8,10,20],"d":"Once per operation, for a selection of them"},"exp":{"v":10,"d":"Base fee of the EXP opcode"},"expByte":{"v":10,"d":"Times ceil(log256(exponent)) for the EXP instruction"},"sha3":{"v":30,"d":"Base fee of the SHA3 opcode"},"sha3Word":{"v":6,"d":"Once per word of the SHA3 operation\'s data"},"sload":{"v":50,"d":"Base fee of the SLOAD opcode"},"sstoreSet":{"v":20000,"d":"Once per SSTORE operation if the zeroness changes from zero"},"sstoreReset":{"v":5000,"d":"Once per SSTORE operation if the zeroness does not change from zero"},"sstoreRefund":{"v":15000,"d":"Once per SSTORE operation if the zeroness changes to zero"},"jumpdest":{"v":1,"d":"Base fee of the JUMPDEST opcode"},"log":{"v":375,"d":"Base fee of the LOG opcode"},"logData":{"v":8,"d":"Per byte in a LOG* operation\'s data"},"logTopic":{"v":375,"d":"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas"},"create":{"v":32000,"d":"Base fee of the CREATE opcode"},"call":{"v":40,"d":"Base fee of the CALL opcode"},"callStipend":{"v":2300,"d":"Free gas given at beginning of call"},"callValueTransfer":{"v":9000,"d":"Paid for CALL when the value transfor is non-zero"},"callNewAccount":{"v":25000,"d":"Paid for CALL when the destination address didn\'t exist prior"},"selfdestructRefund":{"v":24000,"d":"Refunded following a selfdestruct operation"},"memory":{"v":3,"d":"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL"},"quadCoeffDiv":{"v":512,"d":"Divisor for the quadratic particle of the memory cost equation"},"createData":{"v":200,"d":""},"tx":{"v":21000,"d":"Per transaction. NOTE: Not payable on data of calls between transactions"},"txCreation":{"v":32000,"d":"The cost of creating a contract via tx"},"txDataZero":{"v":4,"d":"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions"},"txDataNonZero":{"v":68,"d":"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},"copy":{"v":3,"d":"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added"},"ecRecover":{"v":3000,"d":""},"sha256":{"v":60,"d":""},"sha256Word":{"v":12,"d":""},"ripemd160":{"v":600,"d":""},"ripemd160Word":{"v":120,"d":""},"identity":{"v":15,"d":""},"identityWord":{"v":3,"d":""},"stop":{"v":0,"d":"Base fee of the STOP opcode"},"add":{"v":3,"d":"Base fee of the ADD opcode"},"mul":{"v":5,"d":"Base fee of the MUL opcode"},"sub":{"v":3,"d":"Base fee of the SUB opcode"},"div":{"v":5,"d":"Base fee of the DIV opcode"},"sdiv":{"v":5,"d":"Base fee of the SDIV opcode"},"mod":{"v":5,"d":"Base fee of the MOD opcode"},"smod":{"v":5,"d":"Base fee of the SMOD opcode"},"addmod":{"v":8,"d":"Base fee of the ADDMOD opcode"},"mulmod":{"v":8,"d":"Base fee of the MULMOD opcode"},"signextend":{"v":5,"d":"Base fee of the SIGNEXTEND opcode"},"lt":{"v":3,"d":"Base fee of the LT opcode"},"gt":{"v":3,"d":"Base fee of the GT opcode"},"slt":{"v":3,"d":"Base fee of the SLT opcode"},"sgt":{"v":3,"d":"Base fee of the SGT opcode"},"eq":{"v":3,"d":"Base fee of the EQ opcode"},"iszero":{"v":3,"d":"Base fee of the ISZERO opcode"},"and":{"v":3,"d":"Base fee of the AND opcode"},"or":{"v":3,"d":"Base fee of the OR opcode"},"xor":{"v":3,"d":"Base fee of the XOR opcode"},"not":{"v":3,"d":"Base fee of the NOT opcode"},"byte":{"v":3,"d":"Base fee of the BYTE opcode"},"address":{"v":2,"d":"Base fee of the ADDRESS opcode"},"balance":{"v":20,"d":"Base fee of the BALANCE opcode"},"origin":{"v":2,"d":"Base fee of the ORIGIN opcode"},"caller":{"v":2,"d":"Base fee of the CALLER opcode"},"callvalue":{"v":2,"d":"Base fee of the CALLVALUE opcode"},"calldataload":{"v":3,"d":"Base fee of the CALLDATALOAD opcode"},"calldatasize":{"v":2,"d":"Base fee of the CALLDATASIZE opcode"},"calldatacopy":{"v":3,"d":"Base fee of the CALLDATACOPY opcode"},"codesize":{"v":2,"d":"Base fee of the CODESIZE opcode"},"codecopy":{"v":3,"d":"Base fee of the CODECOPY opcode"},"gasprice":{"v":2,"d":"Base fee of the GASPRICE opcode"},"extcodesize":{"v":20,"d":"Base fee of the EXTCODESIZE opcode"},"extcodecopy":{"v":20,"d":"Base fee of the EXTCODECOPY opcode"},"blockhash":{"v":20,"d":"Base fee of the BLOCKHASH opcode"},"coinbase":{"v":2,"d":"Base fee of the COINBASE opcode"},"timestamp":{"v":2,"d":"Base fee of the TIMESTAMP opcode"},"number":{"v":2,"d":"Base fee of the NUMBER opcode"},"difficulty":{"v":2,"d":"Base fee of the DIFFICULTY opcode"},"gaslimit":{"v":2,"d":"Base fee of the GASLIMIT opcode"},"pop":{"v":2,"d":"Base fee of the POP opcode"},"mload":{"v":3,"d":"Base fee of the MLOAD opcode"},"mstore":{"v":3,"d":"Base fee of the MSTORE opcode"},"mstore8":{"v":3,"d":"Base fee of the MSTORE8 opcode"},"sstore":{"v":0,"d":"Base fee of the SSTORE opcode"},"jump":{"v":8,"d":"Base fee of the JUMP opcode"},"jumpi":{"v":10,"d":"Base fee of the JUMPI opcode"},"pc":{"v":2,"d":"Base fee of the PC opcode"},"msize":{"v":2,"d":"Base fee of the MSIZE opcode"},"gas":{"v":2,"d":"Base fee of the GAS opcode"},"push":{"v":3,"d":"Base fee of the PUSH opcode"},"dup":{"v":3,"d":"Base fee of the DUP opcode"},"swap":{"v":3,"d":"Base fee of the SWAP opcode"},"callcode":{"v":40,"d":"Base fee of the CALLCODE opcode"},"return":{"v":0,"d":"Base fee of the RETURN opcode"},"invalid":{"v":0,"d":"Base fee of the INVALID opcode"},"selfdestruct":{"v":0,"d":"Base fee of the SELFDESTRUCT opcode"}},"vm":{"stackLimit":{"v":1024,"d":"Maximum size of VM stack allowed"},"callCreateDepth":{"v":1024,"d":"Maximum depth of call/create stack"},"maxExtraDataSize":{"v":32,"d":"Maximum size extra data may be after Genesis"}},"pow":{"minimumDifficulty":{"v":131072,"d":"The minimum that the difficulty may ever be"},"difficultyBoundDivisor":{"v":2048,"d":"The bound divisor of the difficulty, used in the update calculations"},"durationLimit":{"v":13,"d":"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not"},"epochDuration":{"v":30000,"d":"Duration between proof-of-work epochs"},"timebombPeriod":{"v":100000,"d":"Exponential difficulty timebomb period"},"minerReward":{"v":"5000000000000000000","d":"the amount a miner get rewarded for mining a block"},"difficultyBombDelay":{"v":0,"d":"the amount of blocks to delay the difficulty bomb with"}}}')},3068:t=>{"use strict";t.exports=JSON.parse('{"name":"constantinople","comment":"Postponed hardfork including EIP-1283 (SSTORE gas metering changes)","url":"https://eips.ethereum.org/EIPS/eip-1013","status":"Final","gasConfig":{},"gasPrices":{"netSstoreNoopGas":{"v":200,"d":"Once per SSTORE operation if the value doesn\'t change"},"netSstoreInitGas":{"v":20000,"d":"Once per SSTORE operation from clean zero"},"netSstoreCleanGas":{"v":5000,"d":"Once per SSTORE operation from clean non-zero"},"netSstoreDirtyGas":{"v":200,"d":"Once per SSTORE operation from dirty"},"netSstoreClearRefund":{"v":15000,"d":"Once per SSTORE operation for clearing an originally existing storage slot"},"netSstoreResetRefund":{"v":4800,"d":"Once per SSTORE operation for resetting to the original non-zero value"},"netSstoreResetClearRefund":{"v":19800,"d":"Once per SSTORE operation for resetting to the original zero value"},"shl":{"v":3,"d":"Base fee of the SHL opcode"},"shr":{"v":3,"d":"Base fee of the SHR opcode"},"sar":{"v":3,"d":"Base fee of the SAR opcode"},"extcodehash":{"v":400,"d":"Base fee of the EXTCODEHASH opcode"},"create2":{"v":32000,"d":"Base fee of the CREATE2 opcode"}},"vm":{},"pow":{"minerReward":{"v":"2000000000000000000","d":"The amount a miner gets rewarded for mining a block"},"difficultyBombDelay":{"v":5000000,"d":"the amount of blocks to delay the difficulty bomb with"}}}')},6888:t=>{"use strict";t.exports=JSON.parse('{"name":"dao","comment":"DAO rescue hardfork","url":"https://eips.ethereum.org/EIPS/eip-779","status":"Final","gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},7184:t=>{"use strict";t.exports=JSON.parse('{"name":"grayGlacier","comment":"Delaying the difficulty bomb to Mid September 2022","url":"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/gray-glacier.md","status":"Draft","eips":[5133],"gasConfig":{},"gasPrices":{},"vm":{},"pow":{}}')},5516:t=>{"use strict";t.exports=JSON.parse('{"name":"homestead","comment":"Homestead hardfork with protocol and network changes","url":"https://eips.ethereum.org/EIPS/eip-606","status":"Final","gasConfig":{},"gasPrices":{"delegatecall":{"v":40,"d":"Base fee of the DELEGATECALL opcode"}},"vm":{},"pow":{}}')},208:t=>{"use strict";t.exports=JSON.parse('{"name":"istanbul","comment":"HF targeted for December 2019 following the Constantinople/Petersburg HF","url":"https://eips.ethereum.org/EIPS/eip-1679","status":"Final","gasConfig":{},"gasPrices":{"blake2Round":{"v":1,"d":"Gas cost per round for the Blake2 F precompile"},"ecAdd":{"v":150,"d":"Gas costs for curve addition precompile"},"ecMul":{"v":6000,"d":"Gas costs for curve multiplication precompile"},"ecPairing":{"v":45000,"d":"Base gas costs for curve pairing precompile"},"ecPairingWord":{"v":34000,"d":"Gas costs regarding curve pairing precompile input length"},"txDataNonZero":{"v":16,"d":"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions"},"sstoreSentryGasEIP2200":{"v":2300,"d":"Minimum gas required to be present for an SSTORE call, not consumed"},"sstoreNoopGasEIP2200":{"v":800,"d":"Once per SSTORE operation if the value doesn\'t change"},"sstoreDirtyGasEIP2200":{"v":800,"d":"Once per SSTORE operation if a dirty value is changed"},"sstoreInitGasEIP2200":{"v":20000,"d":"Once per SSTORE operation from clean zero to non-zero"},"sstoreInitRefundEIP2200":{"v":19200,"d":"Once per SSTORE operation for resetting to the original zero value"},"sstoreCleanGasEIP2200":{"v":5000,"d":"Once per SSTORE operation from clean non-zero to something else"},"sstoreCleanRefundEIP2200":{"v":4200,"d":"Once per SSTORE operation for resetting to the original non-zero value"},"sstoreClearRefundEIP2200":{"v":15000,"d":"Once per SSTORE operation for clearing an originally existing storage slot"},"balance":{"v":700,"d":"Base fee of the BALANCE opcode"},"extcodehash":{"v":700,"d":"Base fee of the EXTCODEHASH opcode"},"chainid":{"v":2,"d":"Base fee of the CHAINID opcode"},"selfbalance":{"v":5,"d":"Base fee of the SELFBALANCE opcode"},"sload":{"v":800,"d":"Base fee of the SLOAD opcode"}},"vm":{},"pow":{}}')},3352:t=>{"use strict";t.exports=JSON.parse('{"name":"london","comment":"HF targeted for July 2021 following the Berlin fork","url":"https://github.com/ethereum/eth1.0-specs/blob/master/network-upgrades/mainnet-upgrades/london.md","status":"Final","eips":[1559,3198,3529,3541]}')},977:t=>{"use strict";t.exports=JSON.parse('{"name":"merge","comment":"Hardfork to upgrade the consensus mechanism to Proof-of-Stake","url":"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/merge.md","status":"Final","consensus":{"type":"pos","algorithm":"casper","casper":{}},"eips":[3675,4399]}')},9402:t=>{"use strict";t.exports=JSON.parse('{"name":"mergeForkIdTransition","comment":"Pre-merge hardfork to fork off non-upgraded clients","url":"https://eips.ethereum.org/EIPS/eip-3675","status":"Draft","eips":[]}')},50:t=>{"use strict";t.exports=JSON.parse('{"name":"muirGlacier","comment":"HF to delay the difficulty bomb","url":"https://eips.ethereum.org/EIPS/eip-2384","status":"Final","gasConfig":{},"gasPrices":{},"vm":{},"pow":{"difficultyBombDelay":{"v":9000000,"d":"the amount of blocks to delay the difficulty bomb with"}}}')},3385:t=>{"use strict";t.exports=JSON.parse('{"name":"petersburg","comment":"Aka constantinopleFix, removes EIP-1283, activate together with or after constantinople","url":"https://eips.ethereum.org/EIPS/eip-1716","status":"Final","gasConfig":{},"gasPrices":{"netSstoreNoopGas":{"v":null,"d":"Removed along EIP-1283"},"netSstoreInitGas":{"v":null,"d":"Removed along EIP-1283"},"netSstoreCleanGas":{"v":null,"d":"Removed along EIP-1283"},"netSstoreDirtyGas":{"v":null,"d":"Removed along EIP-1283"},"netSstoreClearRefund":{"v":null,"d":"Removed along EIP-1283"},"netSstoreResetRefund":{"v":null,"d":"Removed along EIP-1283"},"netSstoreResetClearRefund":{"v":null,"d":"Removed along EIP-1283"}},"vm":{},"pow":{}}')},369:t=>{"use strict";t.exports=JSON.parse('{"name":"shanghai","comment":"Next feature hardfork after the merge hardfork having withdrawals, warm coinbase, push0, limit/meter initcode","url":"https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md","status":"Final","eips":[3651,3855,3860,4895]}')},7968:t=>{"use strict";t.exports=JSON.parse('{"name":"shardingFork","comment":"Internal hardfork to test proto-danksharding (do not use in production)","url":"https://eips.ethereum.org/EIPS/eip-4844","status":"Experimental","eips":[4844]}')},2146:t=>{"use strict";t.exports=JSON.parse('{"name":"spuriousDragon","comment":"HF with EIPs for simple replay attack protection, EXP cost increase, state trie clearing, contract code size limit","url":"https://eips.ethereum.org/EIPS/eip-607","status":"Final","gasConfig":{},"gasPrices":{"expByte":{"v":50,"d":"Times ceil(log256(exponent)) for the EXP instruction"}},"vm":{"maxCodeSize":{"v":24576,"d":"Maximum length of contract code"}},"pow":{}}')},4350:t=>{"use strict";t.exports=JSON.parse('{"name":"tangerineWhistle","comment":"Hardfork with gas cost changes for IO-heavy operations","url":"https://eips.ethereum.org/EIPS/eip-608","status":"Final","gasConfig":{},"gasPrices":{"sload":{"v":200,"d":"Once per SLOAD operation"},"call":{"v":700,"d":"Once per CALL operation & message call transaction"},"extcodesize":{"v":700,"d":"Base fee of the EXTCODESIZE opcode"},"extcodecopy":{"v":700,"d":"Base fee of the EXTCODECOPY opcode"},"balance":{"v":400,"d":"Base fee of the BALANCE opcode"},"delegatecall":{"v":700,"d":"Base fee of the DELEGATECALL opcode"},"callcode":{"v":700,"d":"Base fee of the CALLCODE opcode"},"selfdestruct":{"v":5000,"d":"Base fee of the SELFDESTRUCT opcode"}},"vm":{},"pow":{}}')}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={id:n,loaded:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var n={};(()=>{"use strict";r.r(n),r.d(n,{handleOnboarding:()=>Nr,onCronjob:()=>Ur,onHomePage:()=>$r,onKeyringRequest:()=>Hr,onRpcRequest:()=>jr,onUserInput:()=>Fr});class t extends TypeError{constructor(t,e){let r;const{message:n,explanation:i,...o}=t,{path:s}=t,a=0===s.length?n:`At path: ${s.join(".")} -- ${n}`;super(i??a),null!=i&&(this.cause=a),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[t,...e()])}}function e(t){return"object"==typeof t&&null!==t}function i(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function o(t,e,r,n){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});const{path:o,branch:s}=e,{type:a}=r,{refinement:u,message:h=`Expected a value of type \`${a}\`${u?` with refinement \`${u}\``:""}, but received: \`${i(n)}\``}=t;return{value:n,type:a,refinement:u,key:o[o.length-1],path:o,branch:s,...t,message:h}}function*s(t,r,n,i){(function(t){return e(t)&&"function"==typeof t[Symbol.iterator]})(t)||(t=[t]);for(const e of t){const t=o(e,r,n,i);t&&(yield t)}}function*a(t,r,n={}){const{path:i=[],branch:o=[t],coerce:s=!1,mask:u=!1}=n,h={path:i,branch:o};if(s&&(t=r.coercer(t,h),u&&"type"!==r.type&&e(r.schema)&&e(t)&&!Array.isArray(t)))for(const e in t)void 0===r.schema[e]&&delete t[e];let c="valid";for(const e of r.validator(t,h))e.explanation=n.message,c="not_valid",yield[e,void 0];for(let[f,l,d]of r.entries(t,h)){const r=a(l,d,{path:void 0===f?i:[...i,f],branch:void 0===f?o:[...o,l],coerce:s,mask:u,message:n.message});for(const n of r)n[0]?(c=null===n[0].refinement||void 0===n[0].refinement?"not_valid":"not_refined",yield[n[0],void 0]):s&&(l=n[1],void 0===f?t=l:t instanceof Map?t.set(f,l):t instanceof Set?t.add(l):e(t)&&(void 0!==l||f in t)&&(t[f]=l))}if("not_valid"!==c)for(const e of r.refiner(t,h))e.explanation=n.message,c="not_refined",yield[e,void 0];"valid"===c&&(yield[void 0,t])}class u{constructor(t){const{type:e,schema:r,validator:n,refiner:i,coercer:o=(t=>t),entries:a=function*(){}}=t;this.type=e,this.schema=r,this.entries=a,this.coercer=o,this.validator=n?(t,e)=>s(n(t,e),e,this,t):()=>[],this.refiner=i?(t,e)=>s(i(t,e),e,this,t):()=>[]}assert(t,e){return h(t,this,e)}create(t,e){return function(t,e,r){const n=f(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}(t,this,e)}is(t){return c(t,this)}mask(t,e){return function(t,e,r){const n=f(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}(t,this,e)}validate(t,e={}){return f(t,this,e)}}function h(t,e,r){const n=f(t,e,{message:r});if(n[0])throw n[0]}function c(t,e){return!f(t,e)[0]}function f(e,r,n={}){const i=a(e,r,n),o=function(t){const{done:e,value:r}=t.next();return e?void 0:r}(i);if(o[0]){return[new t(o[0],(function*(){for(const t of i)t[0]&&(yield t[0])})),void 0]}return[void 0,o[1]]}function l(t,e){return new u({type:t,schema:null,validator:e})}function d(t){let e;return new u({type:"lazy",schema:null,*entries(r,n){e??(e=t()),yield*e.entries(r,n)},validator:(r,n)=>(e??(e=t()),e.validator(r,n)),coercer:(r,n)=>(e??(e=t()),e.coercer(r,n)),refiner:(r,n)=>(e??(e=t()),e.refiner(r,n))})}function p(t){return new u({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||`Expected an array value, but received: ${i(t)}`})}function m(){return l("boolean",(t=>"boolean"==typeof t))}function g(t){const e={},r=t.map((t=>i(t))).join();for(const r of t)e[r]=r;return new u({type:"enums",schema:e,validator:e=>t.includes(e)||`Expected one of \`${r}\`, but received: ${i(e)}`})}function b(t){const e=i(t),r=typeof t;return new u({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?t:null,validator:r=>r===t||`Expected the literal \`${e}\`, but received: ${i(r)}`})}function y(){return l("never",(()=>!1))}function v(){return l("number",(t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${i(t)}`))}function w(t){const r=t?Object.keys(t):[],n=y();return new u({type:"object",schema:t??null,*entries(i){if(t&&e(i)){const e=new Set(Object.keys(i));for(const n of r)e.delete(n),yield[n,i[n],t[n]];for(const t of e)yield[t,i[t],n]}},validator:t=>e(t)||`Expected an object, but received: ${i(t)}`,coercer:t=>e(t)?{...t}:t})}function M(t){return new u({...t,validator:(e,r)=>void 0===e||t.validator(e,r),refiner:(e,r)=>void 0===e||t.refiner(e,r)})}function E(t,r){return new u({type:"record",schema:null,*entries(n){if(e(n))for(const e in n){const i=n[e];yield[e,e,t],yield[e,i,r]}},validator:t=>e(t)||`Expected an object, but received: ${i(t)}`})}function S(){return l("string",(t=>"string"==typeof t||`Expected a string, but received: ${i(t)}`))}function _(t){const e=t.map((t=>t.type)).join(" | ");return new u({type:"union",schema:null,coercer(e){for(const r of t){const[t,n]=r.validate(e,{coerce:!0});if(!t)return n}return e},validator(r,n){const o=[];for(const e of t){const[...t]=a(r,e,n),[i]=t;if(!i?.[0])return[];for(const[e]of t)e&&o.push(e)}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${i(r)}`,...o]}})}function k(t,e,r){return new u({...t,coercer:(n,i)=>c(n,e)?t.coercer(r(n,i),i):t.coercer(n,i)})}const A=(t,e)=>Object.hasOwnProperty.call(t,e);var x;!function(t){t[t.Null=4]="Null",t[t.Comma=1]="Comma",t[t.Wrapper=1]="Wrapper",t[t.True=4]="True",t[t.False=5]="False",t[t.Quote=1]="Quote",t[t.Colon=1]="Colon",t[t.Date=24]="Date"}(x=x||(x={}));function I(t){return function(t){return function(t){return"object"==typeof t&&null!==t&&"message"in t}(t)&&"string"==typeof t.message?t.message:null==t?"":String(t)}(t).replace(/\.$/u,"")}function B(t,e){return r=t,Boolean("string"==typeof r?.prototype?.constructor?.name)?new t({message:e}):t({message:e});var r}class T extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}const P=t=>w(t);function C({path:t,branch:e}){const r=t[t.length-1];return A(e[e.length-2],r)}function R(t){return new u({...t,type:`optional ${t.type}`,validator:(e,r)=>!C(r)||t.validator(e,r),refiner:(e,r)=>!C(r)||t.refiner(e,r)})}const O=_([b(null),m(),l("finite number",(t=>c(t,v())&&Number.isFinite(t))),S(),p(d((()=>O))),E(S(),d((()=>O)))]),L=k(O,l("any",(()=>!0)),(t=>(function(t,e,r="Assertion failed",n=T){try{h(t,e)}catch(t){throw B(n,`${r}: ${I(t)}.`)}}(t,O),JSON.parse(JSON.stringify(t,((t,e)=>{if("__proto__"!==t&&"constructor"!==t)return e}))))));const N=b("2.0"),j=(H=_([v(),S()]),new u({...H,validator:(t,e)=>null===t||H.validator(t,e),refiner:(t,e)=>null===t||H.refiner(t,e)}));var H;const D=P({code:l("integer",(t=>"number"==typeof t&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${i(t)}`)),message:S(),data:R(L),stack:R(S())}),U=_([E(S(),L),p(L)]);P({id:j,jsonrpc:N,method:S(),params:R(U)}),P({jsonrpc:N,method:S(),params:R(U)});w({id:j,jsonrpc:N,result:M(l("unknown",(()=>!0))),error:M(D)});const F=P({id:j,jsonrpc:N,result:L}),$=P({id:j,jsonrpc:N,error:D});_([F,$]);function q(t){return w(t)}function z(t){return t.path[t.path.length-1]in t.branch[t.branch.length-2]}function G(t){return new u({...t,validator:(e,r)=>!z(r)||t.validator(e,r),refiner:(e,r)=>!z(r)||t.refiner(e,r)})}function V(t,e){return l(t,(t=>"string"==typeof t&&e.test(t)))}const J=V("UuidV4",/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu),K=l("Url",(t=>{try{const e=new URL(t);return"http:"===e.protocol||"https:"===e.protocol}catch{return!1}})),W=V("StringNumber",/^\d+(\.\d+)?$/u);var Z,X,Y;!function(t){t.Eoa="eip155:eoa",t.Erc4337="eip155:erc4337"}(Z||(Z={})),function(t){t.P2wpkh="bip122:p2wpkh"}(X||(X={})),function(t){t.DataAccount="solana:data-account"}(Y||(Y={}));const Q=q({id:J,type:g([`${Z.Eoa}`,`${Z.Erc4337}`,`${X.P2wpkh}`,`${Y.DataAccount}`]),address:S(),options:E(S(),L),methods:p(S())}),tt=q({amount:W,unit:S()}),et=V("CaipAssetType",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u);V("CaipAssetId",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u);E(S(),L);const rt=q({id:J,scope:S(),account:J,request:q({method:S(),params:G(_([p(L),E(S(),L)]))})});_([q({pending:b(!0),redirect:G(q({message:G(S()),url:G(S())}))}),q({pending:b(!1),result:L})]);function nt(t,e,r){return new u({...t,*refiner(n,i){yield*t.refiner(n,i);const o=s(r(n,i),i,t,n);for(const t of o)yield{...t,refinement:e}}})}var it=r(6534);const ot=nt(S(),"BtcP2wpkhAddressStruct",(t=>{try{it.gW.decode(t)}catch(t){return new Error(`Could not decode P2WPKH address: ${t.message}`)}return!0}));var st;!function(t){t.SendBitcoin="sendBitcoin"}(st||(st={}));const at=q({...Q.schema,address:ot,type:b(`${X.P2wpkh}`),methods:p(g([`${st.SendBitcoin}`]))}),ut=V("EthBytes",/^0x[0-9a-f]*$/iu),ht=V("EthAddress",/^0x[0-9a-f]{40}$/iu),ct=V("EthUint256",/^0x([1-9a-f][0-9a-f]*|0)$/iu);var ft;!function(t){t.PersonalSign="personal_sign",t.Sign="eth_sign",t.SignTransaction="eth_signTransaction",t.SignTypedDataV1="eth_signTypedData_v1",t.SignTypedDataV3="eth_signTypedData_v3",t.SignTypedDataV4="eth_signTypedData_v4",t.PrepareUserOperation="eth_prepareUserOperation",t.PatchUserOperation="eth_patchUserOperation",t.SignUserOperation="eth_signUserOperation"}(ft||(ft={}));const lt=q({...Q.schema,address:ht,type:b(`${Z.Eoa}`),methods:p(g([`${ft.PersonalSign}`,`${ft.Sign}`,`${ft.SignTransaction}`,`${ft.SignTypedDataV1}`,`${ft.SignTypedDataV3}`,`${ft.SignTypedDataV4}`]))}),dt=q({...Q.schema,address:ht,type:b(`${Z.Erc4337}`),methods:p(g([`${ft.PersonalSign}`,`${ft.Sign}`,`${ft.SignTypedDataV1}`,`${ft.SignTypedDataV3}`,`${ft.SignTypedDataV4}`,`${ft.PrepareUserOperation}`,`${ft.PatchUserOperation}`,`${ft.SignUserOperation}`]))});q({sender:ht,nonce:ct,initCode:ut,callData:ut,callGasLimit:ct,verificationGasLimit:ct,preVerificationGas:ct,maxFeePerGas:ct,maxPriorityFeePerGas:ct,paymasterAndData:ut,signature:ut}),q({to:ht,value:ct,data:ut}),q({nonce:ct,initCode:ut,callData:ut,gasLimits:G(q({callGasLimit:ct,verificationGasLimit:ct,preVerificationGas:ct})),dummyPaymasterAndData:ut,dummySignature:ut,bundlerUrl:K}),q({paymasterAndData:ut,callGasLimit:G(ct),verificationGasLimit:G(ct),preVerificationGas:G(ct)});const pt=V("SolAddress",/^[1-9A-HJ-NP-Za-km-z]{32,44}$/iu);var mt;!function(t){t.SendAndConfirmTransaction="sendAndConfirmTransaction"}(mt||(mt={}));const gt=q({...Q.schema,address:pt,type:b(`${Y.DataAccount}`),methods:p(g([`${mt.SendAndConfirmTransaction}`]))});var bt,yt;!function(t){t.AccountCreated="notify:accountCreated",t.AccountUpdated="notify:accountUpdated",t.AccountDeleted="notify:accountDeleted",t.RequestApproved="notify:requestApproved",t.RequestRejected="notify:requestRejected"}(bt||(bt={})),function(t){t.ListAccounts="keyring_listAccounts",t.GetAccount="keyring_getAccount",t.CreateAccount="keyring_createAccount",t.GetAccountBalances="keyring_getAccountBalances",t.FilterAccountChains="keyring_filterAccountChains",t.UpdateAccount="keyring_updateAccount",t.DeleteAccount="keyring_deleteAccount",t.ExportAccount="keyring_exportAccount",t.ListRequests="keyring_listRequests",t.GetRequest="keyring_getRequest",t.SubmitRequest="keyring_submitRequest",t.ApproveRequest="keyring_approveRequest",t.RejectRequest="keyring_rejectRequest"}(yt||(yt={}));const vt={jsonrpc:b("2.0"),id:_([S(),v(),b(null)])},wt=q({...vt,method:b("keyring_listAccounts")}),Mt=(p(Q),q({...vt,method:b("keyring_getAccount"),params:q({id:J})})),Et=q({...vt,method:b("keyring_createAccount"),params:q({options:E(S(),L)})}),St=q({...vt,method:b(`${yt.GetAccountBalances}`),params:q({id:J,assets:p(et)})}),_t=(E(et,tt),q({...vt,method:b("keyring_filterAccountChains"),params:q({id:J,chains:p(S())})})),kt=(p(S()),q({...vt,method:b("keyring_updateAccount"),params:q({account:Q})})),At=(b(null),q({...vt,method:b("keyring_deleteAccount"),params:q({id:J})})),xt=(b(null),q({...vt,method:b("keyring_exportAccount"),params:q({id:J})})),It=q({...vt,method:b("keyring_listRequests")}),Bt=(p(rt),q({...vt,method:b("keyring_getRequest"),params:q({id:J})})),Tt=q({...vt,method:b("keyring_submitRequest"),params:rt}),Pt=q({...vt,method:b("keyring_approveRequest"),params:q({id:J,data:E(S(),L)})}),Ct=(b(null),q({...vt,method:b("keyring_rejectRequest"),params:q({id:J})})),Rt=(b(null),q({method:b(`${bt.AccountCreated}`),params:q({account:Q,accountNameSuggestion:G(S()),displayConfirmation:G(m())})}),q({method:b(`${bt.AccountUpdated}`),params:q({account:Q})}),q({method:b(`${bt.AccountDeleted}`),params:q({id:J})}),q({method:b(`${bt.RequestApproved}`),params:q({id:J,result:L})}),q({method:b(`${bt.RequestRejected}`),params:q({id:J})}),q({metadata:q({name:S(),nameLastUpdatedAt:G(v()),snap:G(q({id:S(),enabled:m(),name:S()})),lastSelected:G(v()),importTime:v(),keyring:q({type:S()})})})),Ot=q({...lt.schema,...Rt.schema}),Lt=q({...dt.schema,...Rt.schema}),Nt=q({...at.schema,...Rt.schema}),jt=q({...gt.schema,...Rt.schema}),Ht=(Z.Eoa,Z.Erc4337,X.P2wpkh,Y.DataAccount,q({...Q.schema,...Rt.schema}),q({jsonrpc:b("2.0"),id:_([S(),v(),b(null)]),method:S(),params:G(_([p(L),E(S(),L)]))})),Dt={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Ut;const Ft=new Uint8Array(16);function $t(){if(!Ut&&(Ut="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ut))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ut(Ft)}const qt=[];for(let t=0;t<256;++t)qt.push((t+256).toString(16).slice(1));function zt(t,e=0){return qt[t[e+0]]+qt[t[e+1]]+qt[t[e+2]]+qt[t[e+3]]+"-"+qt[t[e+4]]+qt[t[e+5]]+"-"+qt[t[e+6]]+qt[t[e+7]]+"-"+qt[t[e+8]]+qt[t[e+9]]+"-"+qt[t[e+10]]+qt[t[e+11]]+qt[t[e+12]]+qt[t[e+13]]+qt[t[e+14]]+qt[t[e+15]]}const Gt=function(t,e,r){if(Dt.randomUUID&&!e&&!t)return Dt.randomUUID();const n=(t=t||{}).random||(t.rng||$t)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=n[t];return e}return zt(n)};var Vt,Jt=function(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};Vt=new WeakMap,new WeakSet;new WeakMap,new WeakMap;class Kt extends Error{constructor(t){super(`Method not supported: ${t}`)}}async function Wt(t,e){try{return await async function(t,e){switch(h(e,Ht),e.method){case`${yt.ListAccounts}`:return h(e,wt),t.listAccounts();case`${yt.GetAccount}`:return h(e,Mt),t.getAccount(e.params.id);case`${yt.CreateAccount}`:return h(e,Et),t.createAccount(e.params.options);case`${yt.GetAccountBalances}`:if(void 0===t.getAccountBalances)throw new Kt(e.method);return h(e,St),t.getAccountBalances(e.params.id,e.params.assets);case`${yt.FilterAccountChains}`:return h(e,_t),t.filterAccountChains(e.params.id,e.params.chains);case`${yt.UpdateAccount}`:return h(e,kt),t.updateAccount(e.params.account);case`${yt.DeleteAccount}`:return h(e,At),t.deleteAccount(e.params.id);case`${yt.ExportAccount}`:if(void 0===t.exportAccount)throw new Kt(e.method);return h(e,xt),t.exportAccount(e.params.id);case`${yt.ListRequests}`:if(void 0===t.listRequests)throw new Kt(e.method);return h(e,It),t.listRequests();case`${yt.GetRequest}`:if(void 0===t.getRequest)throw new Kt(e.method);return h(e,Bt),t.getRequest(e.params.id);case`${yt.SubmitRequest}`:return h(e,Tt),t.submitRequest(e.params);case`${yt.ApproveRequest}`:if(void 0===t.approveRequest)throw new Kt(e.method);return h(e,Pt),t.approveRequest(e.params.id,e.params.data);case`${yt.RejectRequest}`:if(void 0===t.rejectRequest)throw new Kt(e.method);return h(e,Ct),t.rejectRequest(e.params.id);default:throw new Kt(e.method)}}(t,e)}catch(t){const e=t instanceof Error&&"string"==typeof t.message?t.message:"An unknown error occurred while handling the keyring request";throw new Error(e)}}async function Zt(t,e,r){await t.request({method:"snap_manageAccounts",params:{method:e,params:{...r}}})}function Xt(t,e,r){if("string"==typeof t)throw new Error(`An HTML element ("${String(t)}") was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.`);if(!t)throw new Error("A JSX fragment was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.");return t({...e,key:r})}function Yt(t,e,r){return Xt(t,e,r)}function Qt(t){return Object.fromEntries(Object.entries(t).filter((([,t])=>void 0!==t)))}function te(t){return e=>{const{key:r=null,...n}=e;return{type:t,props:Qt(n),key:r}}}const ee=te("Container"),re=te("Box"),ne=te("Heading"),ie=te("Form"),oe=te("Field"),se=te("Input"),ae=te("Footer"),ue=te("Button");var he;!function(t){t[t.BitGo=-2]="BitGo",t[t.Cactus=-1]="Cactus",t[t.JSONRPC=1]="JSONRPC",t[t.ECA3=3]="ECA3"}(he||(he={}));const ce=[{refreshTokenUrl:null,name:"bitgo-test",displayName:"BitGo Test",enabled:!1,apiBaseUrl:"https://app.bitgo-test.com/defi/v2",apiVersion:he.BitGo,custodianPublishesTransaction:!1,iconUrl:"https://dashboard.metamask-institutional.io/custodian-icons/bitgo-icon.svg",isManualTokenInputSupported:!1,onboardingUrl:"https://app.bitgo-test.com",allowedOnboardingDomains:["app.bitgo-test.com"]},{refreshTokenUrl:null,name:"bitgo-prod",legacyName:"bitgo",displayName:"BitGo",enabled:!0,apiBaseUrl:"https://app.bitgo.com/defi/v2",apiVersion:he.BitGo,custodianPublishesTransaction:!0,iconUrl:"https://dashboard.metamask-institutional.io/custodian-icons/bitgo-icon.svg",isManualTokenInputSupported:!1,onboardingUrl:"https://app.bitgo.com",allowedOnboardingDomains:["app.bitgo.com"]},{refreshTokenUrl:null,name:"cactus",displayName:"Cactus Custody",enabled:!0,apiVersion:he.Cactus,custodianPublishesTransaction:!0,iconUrl:"https://dashboard.metamask-institutional.io/custodian-icons/cactus-icon.svg",isManualTokenInputSupported:!1,apiBaseUrl:"https://api.mycactus.com/custody/v1/mmi-api",onboardingUrl:"https://www.mycactus.com",allowedOnboardingDomains:["www.mycactus.com"]},{refreshTokenUrl:"http://localhost:8090/oauth/token",name:"gk8-prod",displayName:"GK8 ECA-1",enabled:!0,apiBaseUrl:"http://localhost:8090",apiVersion:he.JSONRPC,custodianPublishesTransaction:!0,iconUrl:"https://www.gk8.io/wp-content/uploads/2021/04/6-layers-4.svg",isManualTokenInputSupported:!0,onboardingUrl:"https://www.gk8.io",allowedOnboardingDomains:[]},{refreshTokenUrl:"http://localhost:8090/oauth/token",name:"gk8-eca3-prod",displayName:"GK8 ECA-3",enabled:!0,apiBaseUrl:"http://localhost:8090",apiVersion:he.ECA3,custodianPublishesTransaction:!0,iconUrl:"https://www.gk8.io/wp-content/uploads/2021/04/6-layers-4.svg",isManualTokenInputSupported:!0,onboardingUrl:"https://www.gk8.io",allowedOnboardingDomains:[]},{refreshTokenUrl:"https://safe-mmi.staging.gnosisdev.com/api/v1/oauth/token/",name:"gnosis-safe-dev",displayName:"Safe",enabled:!1,apiBaseUrl:"https://safe-mmi.staging.gnosisdev.com/api",apiVersion:he.JSONRPC,custodianPublishesTransaction:!0,iconUrl:"https://raw.githubusercontent.com/safe-global/safe-react/dev/public/resources/logo.svg",isManualTokenInputSupported:!1,onboardingUrl:"https://safe.global",allowedOnboardingDomains:["apps-portal.safe.global"]},{refreshTokenUrl:"https://safe-mmi.safe.global/api/v1/oauth/token/",name:"safe-prod",displayName:"Safe",enabled:!0,apiBaseUrl:"https://safe-mmi.safe.global/api",apiVersion:he.JSONRPC,custodianPublishesTransaction:!0,iconUrl:"https://raw.githubusercontent.com/safe-global/safe-react/dev/public/resources/logo.svg",isManualTokenInputSupported:!1,onboardingUrl:"https://safe.global",allowedOnboardingDomains:["apps-portal.safe.global"]},{refreshTokenUrl:"https://safe-mmi.staging.5afe.dev/api/v1/oauth/token/",name:"gnosis-safe-staging",displayName:"Gnosis Safe Staging",enabled:!1,apiBaseUrl:"https://safe-mmi.staging.5afe.dev/api",apiVersion:he.JSONRPC,custodianPublishesTransaction:!0,iconUrl:"https://raw.githubusercontent.com/safe-global/safe-react/dev/public/resources/logo.svg",isManualTokenInputSupported:!1,onboardingUrl:"https://safe.global",allowedOnboardingDomains:["apps-portal.safe.global"]},{refreshTokenUrl:"https://saturn-custody.metamask-institutional.io/oauth/token",name:"saturn-prod",displayName:"Saturn Custody",enabled:!1,apiBaseUrl:"https://saturn-custody.metamask-institutional.io/eth",apiVersion:he.JSONRPC,custodianPublishesTransaction:!0,iconUrl:"https://saturn-custody-ui.metamask-institutional.io/saturn.svg",isManualTokenInputSupported:!1,onboardingUrl:"https://saturn-custody-ui.metamask-institutional.io",allowedOnboardingDomains:["saturn-custody-ui.metamask-institutional.io"]},{refreshTokenUrl:"https://api.mpcvault.com/mmi/token-refresh",name:"mpcvault-prod",displayName:"MPCVault",enabled:!0,apiBaseUrl:"https://api.mpcvault.com/mmi",apiVersion:he.ECA3,custodianPublishesTransaction:!0,iconUrl:"https://metamask-institutional.io/custodian-icons/mpcvault-icon.svg",isManualTokenInputSupported:!1,onboardingUrl:"https://console.mpcvault.com/",allowedOnboardingDomains:["console.mpcvault.com"]},{refreshTokenUrl:"https://neptune-custody.metamask-institutional.io/oauth/token",name:"neptune-custody-prod",displayName:"Neptune Custody",enabled:!1,apiBaseUrl:"https://neptune-custody.metamask-institutional.io/eth",apiVersion:he.ECA3,custodianPublishesTransaction:!1,iconUrl:"https://metamask-institutional.io/custodian-icons/neptune-icon.svg",isManualTokenInputSupported:!1,onboardingUrl:"https://neptune-custody-ui.metamask-institutional.io",allowedOnboardingDomains:["neptune-custody-ui.metamask-institutional.io"]},{refreshTokenUrl:"https://api-preprod.uat.zodia.io/oauth/token",name:"zodia-preprod",displayName:"Zodia Preprod",enabled:!1,apiBaseUrl:"https://api-preprod.uat.zodia.io",apiVersion:he.JSONRPC,custodianPublishesTransaction:!0,iconUrl:"https://zodia.io/wp-content/uploads/2023/01/cropped-ico.png",isManualTokenInputSupported:!1,onboardingUrl:"https://zodia.io",allowedOnboardingDomains:["zodia.io"]},{refreshTokenUrl:"https://mmi.fireblocks.io/v1/auth/access",name:"fireblocks-prod",displayName:"Fireblocks",enabled:!0,apiBaseUrl:"https://mmi.fireblocks.io",apiVersion:he.JSONRPC,custodianPublishesTransaction:!0,iconUrl:"https://metamask-institutional.io/custodian-icons/fireblocks-icon.svg",isManualTokenInputSupported:!1,onboardingUrl:"https://console.fireblocks.io/v2/",allowedOnboardingDomains:["console.fireblocks.io"]},{refreshTokenUrl:"https://zapi.custody.zodia.io/oauth/token",name:"zodia-prod",displayName:"Zodia",enabled:!0,apiBaseUrl:"https://zapi.custody.zodia.io",apiVersion:he.JSONRPC,custodianPublishesTransaction:!0,iconUrl:"https://zodia.io/wp-content/uploads/2023/01/cropped-ico.png",isManualTokenInputSupported:!1,onboardingUrl:"https://zodia.io",allowedOnboardingDomains:["zodia.io"]},{refreshTokenUrl:"https://api.sit.zodia.io/oauth/token",name:"zodia-sit",displayName:"Zodia SIT",enabled:!1,apiBaseUrl:"https://api.sit.zodia.io",apiVersion:he.JSONRPC,custodianPublishesTransaction:!0,iconUrl:"https://zodia.io/wp-content/uploads/2023/01/cropped-ico.png",isManualTokenInputSupported:!1,onboardingUrl:"https://zodia.io",allowedOnboardingDomains:["sit.zodia.io"]},{refreshTokenUrl:"https://saturn-custody.dev.metamask-institutional.io/oauth/token",name:"saturn-dev",displayName:"Saturn Custody",enabled:!1,apiBaseUrl:"https://saturn-custody.dev.metamask-institutional.io/eth",apiVersion:he.JSONRPC,custodianPublishesTransaction:!0,iconUrl:"https://saturn-custody-ui.dev.metamask-institutional.io/saturn.svg",isManualTokenInputSupported:!1,onboardingUrl:"https://saturn-custody-ui.dev.metamask-institutional.io",allowedOnboardingDomains:["saturn-custody-ui.dev.metamask-institutional.io"]},{refreshTokenUrl:"https://api-qa.qa.zodia.io/oauth/token",name:"zodia-qa",displayName:"Zodia QA",enabled:!1,apiBaseUrl:"https://api-qa.qa.zodia.io",apiVersion:he.JSONRPC,custodianPublishesTransaction:!0,iconUrl:"https://zodia.io/wp-content/uploads/2023/01/cropped-ico.png",isManualTokenInputSupported:!1,onboardingUrl:"https://zodia.io",allowedOnboardingDomains:["qa.zodia.io"]},{refreshTokenUrl:"http://localhost:8090/oauth/token",name:"gk8-eca3-dev",displayName:"GK8",enabled:!1,apiBaseUrl:"http://localhost:8090",apiVersion:he.ECA3,custodianPublishesTransaction:!0,iconUrl:"https://www.gk8.io/wp-content/uploads/2021/04/6-layers-4.svg",isManualTokenInputSupported:!0,onboardingUrl:"https://www.gk8.io",allowedOnboardingDomains:[]},{refreshTokenUrl:"https://api.dev.mpcvault.com/mmi/token-refresh",name:"mpcvault-dev",displayName:"MPCVault",enabled:!1,apiBaseUrl:"https://api.dev.mpcvault.com/mmi",apiVersion:he.ECA3,custodianPublishesTransaction:!1,iconUrl:"https://dev.metamask-institutional.io/custodian-icons/mpcvault-icon.svg",isManualTokenInputSupported:!1,onboardingUrl:"https://console.mpcvault.com/",allowedOnboardingDomains:["console.dev.mpcvault.com"]},{refreshTokenUrl:"https://gamma.signer.cubist.dev/v0/oauth/token",name:"cubist-gamma",displayName:"Cubist Gamma",enabled:!1,apiBaseUrl:"https://gamma.signer.cubist.dev/v0/mmi",apiVersion:he.ECA3,custodianPublishesTransaction:!1,iconUrl:"https://assets-global.website-files.com/638a2693daaf8527290065a3/651802cf8d04ec5f1a09ce86_Logo.svg",isManualTokenInputSupported:!0,allowedOnboardingDomains:[]},{refreshTokenUrl:"https://dg5z0qnzb9s65.cloudfront.net/v0/oauth/token",name:"cubist-test",displayName:"Cubist Test",enabled:!1,apiBaseUrl:"https://dg5z0qnzb9s65.cloudfront.net/v0/mmi",apiVersion:he.ECA3,custodianPublishesTransaction:!1,iconUrl:"https://assets-global.website-files.com/638a2693daaf8527290065a3/651802cf8d04ec5f1a09ce86_Logo.svg",isManualTokenInputSupported:!0,allowedOnboardingDomains:[]},{refreshTokenUrl:"https://neptune-custody.dev.metamask-institutional.io/oauth/token",name:"neptune-custody-dev",displayName:"Neptune Custody Dev",enabled:!0,apiBaseUrl:"https://neptune-custody.dev.metamask-institutional.io/eth",apiVersion:he.ECA3,custodianPublishesTransaction:!1,iconUrl:"https://dev.metamask-institutional.io/custodian-icons/neptune-icon.svg",isManualTokenInputSupported:!1,onboardingUrl:"https://neptune-custody-ui.dev.metamask-institutional.io",allowedOnboardingDomains:["neptune-custody-ui.dev.metamask-institutional.io"]},{refreshTokenUrl:"http://localhost:3330/oauth/token",apiBaseUrl:"http://localhost:3330",apiVersion:he.ECA3,custodianPublishesTransaction:!1,name:"local-dev",displayName:"Local Dev",enabled:!1,iconUrl:"https://dev.metamask-institutional.io/custodian-icons/neptune-icon.svg",isManualTokenInputSupported:!0,allowedOnboardingDomains:["localhost:8000","http://localhost:8000"]},{refreshTokenUrl:"http://localhost:3330/oauth/token",apiBaseUrl:"http://localhost:3330",apiVersion:he.ECA3,custodianPublishesTransaction:!1,name:"local-dev",displayName:"Local Dev",enabled:!1,iconUrl:"https://dev.metamask-institutional.io/custodian-icons/neptune-icon.svg",isManualTokenInputSupported:!0}];var fe,le;!function(t){t.RemoveCustodianToken="homepage-remove-custodian-token",t.CancelRemoveToken="homepage-cancel-remove-token",t.RemoveToken="homepage-remove-token",t.CancelToken="homepage-cancel-token"}(fe||(fe={})),function(t){t.SelectCustodian="homepage-select-",t.ConnectToken="homepage-connect-token-"}(le||(le={}));const de=({custodianName:t})=>{var e,r;if(!t)throw new Error("Custodian name is required");const n=ce.find((e=>e.name===t));return Yt(ee,{children:[Yt(re,{children:[Xt(ne,{children:"Add Refresh Token"}),Yt(ie,{name:"addTokenForm",children:[Xt(oe,{label:"Paste your Refresh Token",children:Xt(se,{name:"token",placeholder:"Enter your Refresh Token"})}),Xt(oe,{label:`${(null===(e=n)||void 0===e?void 0:e.displayName)??"Custodian"} API URL`,children:Xt(se,{name:"apiUrl",placeholder:null===(r=n)||void 0===r?void 0:r.apiBaseUrl})})]})]}),Yt(ae,{children:[Xt(ue,{name:fe.CancelToken,children:"Cancel"}),Xt(ue,{name:`${le.ConnectToken}${t}`,children:"Connect"})]})]})},pe=te("Link"),me=te("Text"),ge=te("Section"),be=te("Image"),ye='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 -34.5 129 129">\n <g>\n <g>\n <g>\n <g>\n <path fill="#00e6e6" d="M104.997 52.376a7.849 7.849 0 1 1 0-15.698 7.849 7.849 0 0 1 0 15.698zm9.814-19.595a12.908 12.908 0 0 0 3.149-8.463c0-7.159-5.804-12.962-12.963-12.962-7.159 0-12.962 5.803-12.962 12.962 0 3.235 1.188 6.191 3.148 8.463a15.275 15.275 0 0 0-5.494 11.747c0 8.454 6.853 15.308 15.308 15.308s15.309-6.854 15.309-15.308c0-4.72-2.137-8.939-5.495-11.747z"/>\n </g>\n <g>\n <path fill="#00e6e6" d="M23.375 59.153c-6.372 0-11.862-2.235-16.466-6.707C2.303 47.975 0 42.284 0 35.375c0-6.909 2.303-12.61 6.909-17.105 4.604-4.493 10.239-6.74 16.903-6.74 4.964 0 9.379 1.219 13.247 3.655a20.356 20.356 0 0 1 5.935 5.658c1.38 1.987-.02 4.706-2.44 4.706h-2.58a2.952 2.952 0 0 1-2.46-1.298c-2.552-3.83-6.453-5.745-11.702-5.745-4.696 0-8.531 1.542-11.504 4.628-2.975 3.085-4.46 7.166-4.46 12.241 0 5.076 1.485 9.156 4.46 12.241 2.973 3.086 6.674 4.629 11.101 4.629 4.428 0 7.949-1.174 10.564-3.522 1.663-1.492 2.906-3.323 3.729-5.493.744-1.962-.687-4.065-2.785-4.065H24.18a2.984 2.984 0 1 1 0-5.97H43.9a2.984 2.984 0 0 1 2.985 2.985v2.774c0 .14-.009.281-.028.421-.75 5.499-3.245 10.157-7.484 13.976-4.293 3.869-9.625 5.802-15.998 5.802z"/>\n </g>\n <g>\n <path fill="#00e6e6" d="M57.103 58.65h-.307a3.67 3.67 0 0 1-3.67-3.67V15.703a3.67 3.67 0 0 1 3.67-3.67h.307a3.67 3.67 0 0 1 3.67 3.67v17.594l17.65-20.02a3.669 3.669 0 0 1 2.753-1.243c3.192 0 4.862 3.794 2.706 6.148L70.316 32.99a3.67 3.67 0 0 0-.027 4.928l13.102 14.614c2.119 2.362.442 6.118-2.732 6.118h-.165a3.669 3.669 0 0 1-2.776-1.269L60.772 37.79v17.19a3.67 3.67 0 0 1-3.669 3.67z"/>\n </g>\n </g>\n <g>\n <path fill="#00e6e6" d="M117.587 5.706a5.706 5.706 0 1 1 11.413 0 5.706 5.706 0 0 1-11.413 0z"/>\n </g>\n </g>\n </g>\n</svg>',ve={"bitgo-prod":'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 32 32" fill="none">\n<g clip-path="url(#clip0_4284_19554)">\n<rect width="32" height="32" rx="4" fill="white"/>\n<path d="M15.9583 27.5C15.9583 27.5 25.7914 24.1545 25.7914 11.8674V7.44457C25.7914 6.9598 25.4144 6.57078 24.9415 6.54085C23.158 6.45108 18.9268 6.09199 15.9583 4.5C12.9956 6.09199 8.75836 6.45108 6.97486 6.53486C6.50205 6.57078 6.125 6.9598 6.125 7.44457V11.8674C6.125 24.1545 15.9583 27.5 15.9583 27.5Z" fill="#00AEEF"/>\n<path d="M19.9316 13.4826C19.812 12.1419 18.6628 11.6811 17.2025 11.5434L17.2085 9.67017L16.0773 9.67615L16.0833 11.4896C15.7841 11.4896 15.4668 11.4896 15.1617 11.4956V9.6582L14.0186 9.66419L14.0246 11.5255C13.7791 11.5315 11.7383 11.5315 11.7383 11.5315V12.7225H13.1866L13.1807 18.7073L11.9118 18.7133L11.8999 20.078C11.8999 20.078 13.6953 20.072 13.9587 20.072L13.9647 21.9572L15.0898 21.9632L15.1018 20.09C15.4131 20.0958 15.7122 20.1018 16.0056 20.1078L15.9996 21.9632H17.1427L17.1367 20.09C19.0398 19.9941 20.3805 19.5213 20.5601 17.7378C20.7037 16.2955 20.0333 15.6491 18.9501 15.3857C19.6085 15.0506 20.0215 14.4641 19.9316 13.4826ZM18.3217 17.4925C18.3097 18.899 15.9277 18.7253 15.1557 18.7193L15.1497 16.2237C15.9217 16.2296 18.3337 16.0262 18.3217 17.4925ZM17.819 13.9733C17.807 15.2541 15.82 15.0925 15.1856 15.0865L15.1796 12.8242C15.814 12.8242 17.825 12.6387 17.819 13.9733Z" fill="white"/>\n</g>\n<defs>\n<clipPath id="clip0_4284_19554">\n<rect width="32" height="32" rx="4" fill="white"/>\n</clipPath>\n</defs>\n</svg>',"gk8-prod":ye,"gk8-eca3-prod":ye,"safe-prod":'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 90 90" fill="none">\n <g transform="translate(0, 29)">\n<path d="M44.5568 15.3278C43.7367 15.0109 42.735 14.7468 41.5518 14.5349H41.5267C40.3772 14.3399 39.5148 14.1609 38.9401 13.9979C38.3653 13.8358 37.9133 13.6162 37.5834 13.3395C37.2535 13.0633 37.0891 12.6811 37.0891 12.193C37.0891 11.4775 37.3682 10.9327 37.9258 10.5588C38.484 10.1848 39.2191 9.99761 40.1318 9.99761C41.1294 9.99761 41.936 10.2414 42.5535 10.7296C43.1076 11.1679 43.447 11.7247 43.5717 12.399C43.5964 12.5335 43.7145 12.6327 43.8563 12.6342L46.6622 12.6545C46.8342 12.6559 46.972 12.5137 46.9549 12.3487C46.8608 11.4465 46.5516 10.626 46.0276 9.88779C45.4443 9.06683 44.6413 8.42826 43.6185 7.97254C42.5957 7.51732 41.4337 7.28946 40.1318 7.28946C38.8978 7.28946 37.7866 7.50909 36.7975 7.94836C35.8089 8.38762 35.0395 8.99717 34.4899 9.77798C33.9403 10.5588 33.6658 11.4368 33.6658 12.4126C33.6658 13.4861 33.9107 14.3482 34.4009 14.9983C34.8912 15.649 35.5333 16.141 36.3278 16.4743C37.1223 16.8077 38.0772 17.0718 39.193 17.2672L39.3197 17.2914C40.5024 17.5028 41.3864 17.6901 41.9697 17.8526C42.553 18.0156 43.0131 18.243 43.3515 18.5357C43.6894 18.8284 43.8584 19.227 43.8584 19.7311C43.8584 20.4471 43.5541 21.0078 42.9457 21.4141C42.3373 21.821 41.5508 22.0242 40.5874 22.0242C39.4374 22.0242 38.5081 21.7436 37.7981 21.1824C37.152 20.672 36.7718 20.0165 36.6577 19.2163C36.6381 19.078 36.5184 18.973 36.3736 18.9711L33.5712 18.9304C33.4008 18.928 33.263 19.0664 33.2761 19.2299C33.3555 20.2139 33.6753 21.1006 34.2355 21.8902C34.8525 22.7605 35.7018 23.4435 36.7839 23.9394C37.8655 24.4358 39.108 24.6834 40.5114 24.6834C41.8128 24.6834 42.9794 24.4561 44.0107 24.0004C45.0415 23.5451 45.8491 22.9148 46.4324 22.1098C47.0157 21.3048 47.3073 20.3982 47.3073 19.3895C47.3073 18.3161 47.0534 17.4501 46.5465 16.7912C46.0397 16.1323 45.3759 15.6447 44.5563 15.3273L44.5568 15.3278Z" fill="#121312"/>\n<path d="M61.7876 21.9027H61.3497C61.0962 21.9027 60.8971 21.8379 60.7538 21.7073C60.61 21.5776 60.5381 21.3657 60.5381 21.0731V16.4134C60.5381 14.9335 60.0478 13.8073 59.0678 13.0347C58.0872 12.2626 56.9327 11.8688 55.124 11.8688C53.4163 11.8688 52.0823 12.2259 51.0344 12.9249C50.079 13.5625 49.5032 14.4357 49.3061 15.546C49.2754 15.7187 49.4112 15.8769 49.5927 15.8769H52.1698C52.299 15.8769 52.4147 15.7951 52.4489 15.6751C52.5665 15.2644 52.826 14.9292 53.2273 14.6694C53.6919 14.3685 54.244 14.218 54.9711 14.218C56.3424 14.218 57.3174 15.0312 57.3174 16.2426V16.6214C57.3174 16.7762 57.1871 16.9015 57.0262 16.9015H54.6921C52.7989 16.9015 51.3617 17.2595 50.3817 17.975C49.4012 18.691 48.9109 19.7074 48.9109 21.0242C48.9109 22.163 49.3589 23.0575 50.255 23.7077C50.9273 24.1953 51.7308 24.4769 52.558 24.6002C53.1901 24.6946 53.8392 24.7289 54.4728 24.6312C55.1366 24.5291 55.6756 24.266 56.2152 23.8905C56.6999 23.5538 57.1042 23.1223 57.4733 22.596C57.6533 22.2985 58.1255 22.4179 58.1255 22.7619V23.1755C58.125 23.9273 58.758 24.5369 59.5394 24.5369H61.7876C61.9486 24.5369 62.0788 24.4116 62.0788 24.2568V22.1823C62.0788 22.0275 61.9486 21.9022 61.7876 21.9022V21.9027ZM57.3179 19.39C57.3179 19.9918 57.1866 20.5162 56.9247 20.9632C56.3756 21.9008 55.393 22.3904 54.2873 22.3904C53.6446 22.3904 53.1292 22.2443 52.7405 21.9516C52.3513 21.6589 52.1572 21.2685 52.1572 20.7804C52.1572 20.2279 52.3729 19.8007 52.8039 19.4998C53.2348 19.1994 53.8473 19.0485 54.6423 19.0485H57.0267C57.1877 19.0485 57.3179 19.1738 57.3179 19.3286V19.39V19.39Z" fill="#121312"/>\n<path d="M71.1823 7.46796H67.8288C66.0598 7.46796 64.6257 8.84767 64.6257 10.5496V11.9037C64.6257 12.0585 64.4955 12.1838 64.3346 12.1838H62.4197C62.2588 12.1838 62.1286 12.3091 62.1286 12.4639V14.5625C62.1286 14.7173 62.2588 14.8426 62.4197 14.8426H64.3346C64.4955 14.8426 64.6257 14.9679 64.6257 15.1227V24.2572C64.6257 24.412 64.7559 24.5373 64.9169 24.5373H67.5296C67.6905 24.5373 67.8208 24.412 67.8208 24.2572V15.1227C67.8208 14.9679 67.951 14.8426 68.1119 14.8426H71.1566C71.3175 14.8426 71.4478 14.7173 71.4478 14.5625V12.4639C71.4478 12.3091 71.3175 12.1838 71.1566 12.1838H68.1119C67.951 12.1838 67.8208 12.0585 67.8208 11.9037V10.687C67.8208 10.3774 68.0817 10.1268 68.403 10.1268H71.1817C71.3427 10.1268 71.4729 10.0015 71.4729 9.84666V7.74806C71.4729 7.59325 71.3427 7.46796 71.1817 7.46796H71.1823Z" fill="#121312"/>\n<path d="M83.9825 14.7062C83.4163 13.7957 82.6425 13.0962 81.6624 12.608C80.6819 12.1204 79.549 11.8693 78.2647 11.8693C76.9805 11.8693 75.8722 12.1407 74.8922 12.669C73.9116 13.1978 73.1508 13.9457 72.6103 14.9132C72.0692 15.8812 71.7987 17.0152 71.7987 18.3165C71.7987 19.6179 72.0778 20.7035 72.6354 21.671C73.1936 22.6385 73.9921 23.3826 75.0315 23.9031C76.0708 24.4237 77.2922 24.6839 78.6957 24.6839C79.7773 24.6839 80.7453 24.4928 81.5991 24.1107C82.4524 23.729 83.1413 23.2041 83.6653 22.5374C84.1138 21.9666 84.42 21.3416 84.5839 20.6628C84.6267 20.4867 84.4884 20.3174 84.3003 20.3174H81.6755C81.5498 20.3174 81.4397 20.3958 81.3995 20.5104C81.2144 21.0363 80.8881 21.4519 80.4199 21.7566C79.8955 22.0982 79.2448 22.2689 78.4674 22.2689C77.8248 22.2689 77.2631 22.1388 76.7814 21.8785C76.2996 21.6188 75.9195 21.2525 75.6404 20.7809C75.5303 20.5946 75.4403 20.3977 75.3684 20.195C75.2914 19.9773 75.2361 19.7529 75.1979 19.5255C75.1848 19.4461 75.1728 19.3658 75.1627 19.2855C75.1431 19.1201 75.2794 18.9754 75.4524 18.9754H84.504C84.6508 18.9754 84.7765 18.8709 84.7931 18.7302C84.8057 18.6271 84.8142 18.5221 84.8188 18.4143C84.8273 18.2193 84.8313 18.0403 84.8313 17.8778C84.8313 16.6746 84.5482 15.6176 83.982 14.7066L83.9825 14.7062ZM81.2627 16.8526H75.5936C75.4076 16.8526 75.2673 16.6867 75.3085 16.5121C75.3991 16.1294 75.5559 15.784 75.7792 15.4744C76.0663 15.0762 76.4384 14.771 76.895 14.5596C77.3516 14.3482 77.8499 14.2422 78.391 14.2422C79.2699 14.2422 79.997 14.4701 80.5718 14.9253C81.0651 15.3162 81.3899 15.8445 81.5473 16.5106C81.5885 16.6857 81.4492 16.8526 81.2627 16.8526V16.8526Z" fill="#121312"/>\n<path d="M26.7572 15.9983H24.2722C23.53 15.9983 22.9286 16.5769 22.9286 17.291V20.761C22.9286 21.4751 22.3272 22.0537 21.585 22.0537H11.6986C10.9564 22.0537 10.355 22.6323 10.355 23.3463V25.7371C10.355 26.4512 10.9564 27.0298 11.6986 27.0298H22.1572C22.8994 27.0298 23.4923 26.4512 23.4923 25.7371V23.819C23.4923 23.1049 24.0937 22.5984 24.8359 22.5984H26.7567C27.4989 22.5984 28.1003 22.0198 28.1003 21.3058V17.276C28.1003 16.5619 27.4989 15.9983 26.7567 15.9983H26.7572Z" fill="#121312"/>\n<path d="M10.3545 11.2487C10.3545 10.5346 10.9559 9.95602 11.6981 9.95602H21.5785C22.3206 9.95602 22.922 9.37743 22.922 8.66338V6.27259C22.922 5.55854 22.3206 4.97995 21.5785 4.97995H11.1254C10.3832 4.97995 9.7818 5.55854 9.7818 6.27259V8.11479C9.7818 8.82883 9.1804 9.40742 8.43821 9.40742H6.5259C5.78371 9.40742 5.18231 9.98601 5.18231 10.7001V14.7342C5.18231 15.4483 5.78622 15.9978 6.52842 15.9978H9.01346C9.75565 15.9978 10.357 15.4192 10.357 14.7052L10.3545 11.2491V11.2487Z" fill="#121312"/>\n<path d="M15.4719 13.4851H17.8589C18.6368 13.4851 19.2679 14.0928 19.2679 14.8407V17.1371C19.2679 17.8855 18.6363 18.4927 17.8589 18.4927H15.4719C14.6941 18.4927 14.063 17.885 14.063 17.1371V14.8407C14.063 14.0923 14.6946 13.4851 15.4719 13.4851V13.4851Z" fill="#121312"/>\n</g>\n</svg>',"mpcvault-prod":'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 1024 1024" fill="none">\n<path d="M409.166 218.478C454.87 141.841 569.13 141.841 614.834 218.478L895.914 689.798C941.618 766.435 884.488 862.232 793.08 862.232H230.92C139.512 862.232 82.3816 766.435 128.086 689.798L409.166 218.478Z" fill="black"/>\n</svg>',"fireblocks-prod":'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">\n<path d="M23.0522 0C23.5757 0 24 0.429807 24 0.96V23.04C24 23.5702 23.5757 24 23.0522 24H0.947791C0.424341 24 0 23.5702 0 23.04V0.96C0 0.429807 0.424341 0 0.947791 0H23.0522ZM11.9999 6.66667L5.33328 17.3333H18.6666L11.9999 6.66667Z" fill="#002E7F"/>\n</svg>',"neptune-custody-dev":'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 480 480" fill="none">\n<g clip-path="url(#clip0_1_2)">\n<path d="M480 240C480 372.547 372.547 480 240 480C107.453 480 -3.05176e-05 372.547 -3.05176e-05 240C-3.05176e-05 107.453 107.453 -3.05176e-05 240 -3.05176e-05C372.547 -3.05176e-05 480 107.453 480 240ZM398.187 79.4266C394.192 81.0898 393.034 87.432 395.6 93.5915C398.166 99.7511 403.482 103.399 407.477 101.736C411.472 100.072 412.63 93.7302 410.064 87.5706C407.498 81.4111 402.18 77.7635 398.187 79.4266ZM382.442 422.44C341.108 438.44 263.331 446.216 197.553 443.549C233.558 457.352 337.148 456.509 382.442 422.44ZM269.166 180.6C263.571 180.6 259.038 182.867 259.038 185.666C259.038 188.466 263.571 190.732 269.166 190.732C274.762 190.732 279.295 188.464 279.295 185.666C279.293 182.867 274.76 180.6 269.166 180.6ZM422.411 137.939C413.104 148.044 398.581 158.157 386.666 164.333C412.916 157.404 423.626 162.019 432.932 155.255C438.979 150.852 431.839 127.704 422.41 137.939H422.411ZM264.411 360.534C187.788 359.345 222.336 383.58 259.734 383.911C293.044 384.204 339.792 361.703 264.411 360.534ZM177.557 264.663C170 260.439 155.781 252.22 146 245.106C154 247.772 164.443 248.663 191.111 247.33C173.778 245.772 144.889 238.439 121.778 231.996C132.444 244.22 152.444 260.663 177.56 264.663L177.557 264.663ZM271.335 305.106C247.778 304.215 214.224 300.439 189.78 295.106C212.649 308.349 240.824 314.673 271.335 305.106ZM286.892 297.772C304.668 284.882 290.892 275.548 272.002 265.548C287.559 265.772 350.668 259.324 375.006 246.328C324.668 256.333 234.668 249.996 207.113 247.772C231.561 256.22 275.562 273.554 286.895 297.772H286.892Z" fill="url(#paint0_linear_1_2)"/>\n</g>\n<defs>\n<linearGradient id="paint0_linear_1_2" x1="62.6666" y1="43.1667" x2="287" y2="296.5" gradientUnits="userSpaceOnUse">\n<stop stop-color="#444FAC"/>\n<stop offset="1" stop-color="#8BBAF9"/>\n</linearGradient>\n<clipPath id="clip0_1_2">\n<rect width="480" height="480" fill="white"/>\n</clipPath>\n</defs>\n</svg>',"zodia-prod":'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="-517.605 -517.605 1879.26 1879.26"><g fill="#007978"><path d="m794.78 0c-22.41 0-41.59 13.76-49.61 33.29l-455.23 86.05c-9.55-14.79-26.14-24.6-45.05-24.6-29.62 0-53.62 24.01-53.62 53.62s22.02 51.51 49.88 53.43l54.66 142.72-208.27 133.49c-9.24-7.56-21.05-12.11-33.92-12.11-29.62 0-53.62 24.01-53.62 53.62s24.01 53.62 53.62 53.62c8.77 0 17.03-2.15 24.33-5.88l363.21 221.33c-.02.64-.1 1.27-.1 1.92 0 29.62 24.01 53.62 53.62 53.62s53.62-24.01 53.62-53.62c0-26.97-19.93-49.22-45.85-53l-142.43-371.89 411.53-263.72c7.04 3.39 14.9 5.35 23.24 5.35 29.62 0 53.62-24.01 53.62-53.62s-24.01-53.62-53.63-53.62zm-352.03 728.17-332.36-202.54 204.58-131.12 127.78 333.65zm-101.86-412.53-52.22-136.36c1.6-2.26 3.01-4.65 4.25-7.14l385.62-72.89-337.64 216.4z"/><path d="m770.61 683.14c10.34-6.29 22.29-9.44 35.85-9.44 15.51 0 28.51 4.05 39 12.16 10.48 8.11 17.26 19.5 20.33 34.18h-11.32c-3.08-11.46-8.88-20.3-17.4-26.52-8.53-6.22-18.94-9.33-31.24-9.33-11.18 0-20.97 2.72-29.36 8.18-8.39 5.45-14.88 13.03-19.5 22.75-4.61 9.72-6.92 20.8-6.92 33.23s2.31 23.52 6.92 33.23c4.61 9.72 11.11 17.3 19.5 22.75s18.17 8.18 29.36 8.18c12.58 0 23.03-3.08 31.34-9.23 8.32-6.15 14.01-15.09 17.09-26.84h11.32c-3.22 14.82-9.96 26.28-20.23 34.38-10.27 8.11-23.24 12.16-38.89 12.16-13.56 0-25.51-3.11-35.85-9.33-10.35-6.22-18.31-14.99-23.9-26.31s-8.39-24.32-8.39-39 2.8-27.46 8.39-38.79c5.59-11.32 13.56-20.13 23.9-26.42z"/><path d="m939.62 761.76c0 17.05 3.42 29.78 10.27 38.16 6.85 8.39 17.47 12.58 31.87 12.58s25.27-4.19 32.18-12.58c6.92-8.39 10.38-21.11 10.38-38.16v-86.8h11.32v86.17c0 41.23-17.96 61.85-53.88 61.85s-53.46-20.62-53.46-61.85v-86.17h11.32z"/><path d="m1122.26 802.76c7.83 6.5 17.96 9.75 30.41 9.75s21.63-2.69 28.83-8.07 10.8-12.75 10.8-22.12c0-6.71-1.92-12.02-5.76-15.94-3.84-3.91-8.77-6.81-14.79-8.7-6.01-1.89-13.69-3.6-23.06-5.14-9.79-1.67-17.96-3.74-24.53-6.18s-12.02-6.22-16.35-11.32c-4.34-5.1-6.5-12.06-6.5-20.86 0-8.1 2.03-15.24 6.08-21.38s9.82-10.9 17.29-14.26c7.48-3.35 16.11-5.03 25.89-5.03 14.54 0 26.38 3.81 35.54 11.43 9.15 7.62 14.29 17.72 15.41 30.3l-11.11.21c-1.26-9.65-5.45-17.33-12.58-23.06s-16.21-8.6-27.26-8.6c-11.6 0-20.83 2.62-27.68 7.86s-10.27 12.54-10.27 21.91c0 6.57 1.81 11.74 5.45 15.52s8.21 6.5 13.74 8.18c5.52 1.68 13.1 3.35 22.75 5.03 9.78 1.54 18.14 3.6 25.06 6.18 6.92 2.59 12.65 6.53 17.19 11.85 4.55 5.31 6.81 12.37 6.81 21.17 0 8.11-2.13 15.31-6.39 21.59-4.26 6.29-10.24 11.18-17.92 14.68-7.69 3.49-16.63 5.24-26.84 5.24s-19.96-1.92-27.99-5.76-14.32-9.3-18.87-16.36-7.02-15.2-7.44-24.43h11.32c.7 11.04 4.96 19.81 12.79 26.31z"/><path d="m1361.94 674.97v10.48h-50.32v136.28h-11.32v-136.28h-50.32v-10.48z"/><path d="m1507.15 813.44c-10.41 6.36-22.26 9.54-35.54 9.54s-25.12-3.18-35.53-9.54-18.52-15.24-24.32-26.63-8.7-24.22-8.7-38.47 2.9-27.08 8.7-38.47c5.8-11.4 13.91-20.27 24.32-26.63s22.26-9.54 35.53-9.54 25.13 3.18 35.54 9.54 18.52 15.24 24.32 26.63 8.7 24.22 8.7 38.47-2.9 27.08-8.7 38.47-13.91 20.27-24.32 26.63zm-64.99-9.11c8.6 5.45 18.42 8.18 29.45 8.18s20.9-2.72 29.57-8.18c8.67-5.45 15.41-13.03 20.23-22.75 4.82-9.71 7.23-20.79 7.23-33.23s-2.41-23.51-7.23-33.23c-4.82-9.71-11.57-17.29-20.23-22.75-8.67-5.45-18.52-8.18-29.57-8.18s-20.86 2.72-29.45 8.18c-8.6 5.45-15.31 13.03-20.13 22.75s-7.23 20.8-7.23 33.23 2.41 23.52 7.23 33.23c4.82 9.72 11.53 17.3 20.13 22.75z"/><path d="m1642.95 674.97c15.37 0 28.58 3.01 39.63 9.02 11.04 6.01 19.5 14.53 25.37 25.58 5.87 11.04 8.81 23.97 8.81 38.79s-2.93 27.75-8.81 38.79c-5.87 11.04-14.32 19.57-25.37 25.58-11.04 6.01-24.25 9.02-39.63 9.02h-39.42v-146.76h39.42zm45.91 119.4c10.9-11.25 16.35-26.6 16.35-46.02s-5.42-34.94-16.25-46.12-26.17-16.78-46.02-16.78h-28.1v125.8h28.1c19.71 0 35.01-5.63 45.92-16.87z"/><path d="m1768.77 674.76 48.65 80.51 49.06-80.51h12.79l-56.19 92.88v54.09h-11.32v-54.09l-56.19-92.88h13.21z"/><path d="m948.1 346.36v-30.87h-202.2v37.35h147.42l-153.89 185.77v30.88h215.15v-37.36h-160.87z"/><path d="m1163 328.93c-19.09-10.96-40.92-16.43-65.49-16.43s-46.4 5.48-65.49 16.43c-19.09 10.96-33.95 26.23-44.57 45.82-10.63 19.59-15.94 42.17-15.94 67.73s5.31 48.14 15.94 67.74c10.62 19.59 25.48 34.86 44.57 45.82s40.93 16.44 65.49 16.44 46.4-5.48 65.49-16.44 33.95-26.23 44.58-45.82c10.62-19.59 15.94-42.17 15.94-67.74s-5.31-48.14-15.94-67.73c-10.62-19.59-25.49-34.86-44.58-45.82zm8.22 161.87c-6.97 14.27-16.85 25.4-29.63 33.36-12.78 7.97-27.47 11.95-44.07 11.95s-31.3-3.98-44.08-11.95-22.66-19.09-29.63-33.36c-6.97-14.28-10.46-30.38-10.46-48.31s3.49-34.03 10.46-48.31 16.85-25.4 29.63-33.37 27.48-11.95 44.08-11.95 31.29 3.99 44.07 11.95c12.78 7.97 22.66 19.09 29.63 33.37s10.46 30.38 10.46 48.31-3.49 34.03-10.46 48.31z"/><path d="m1470.54 354.33c-8.3-12.95-19.76-23.16-34.37-30.63s-32.2-11.21-52.79-11.21c-23.24 0-44.16 5.48-62.76 16.43-18.59 10.96-33.12 26.23-43.58 45.82s-15.69 42.17-15.69 67.73c0 26.89 5.23 50.14 15.69 69.73s24.9 34.53 43.33 44.82 39.43 15.44 63 15.44c36.85 0 65.9-14.61 87.16-43.83l5.48 40.84h35.36v-348.61h-40.84v133.47zm-9.96 137.21c-6.97 14.11-16.85 25.07-29.63 32.87s-27.31 11.7-43.58 11.7c-25.23 0-45.57-8.71-61.01-26.15-15.44-17.43-23.16-39.93-23.16-67.49s7.72-50.05 23.16-67.48 35.78-26.15 61.01-26.15c16.27 0 30.79 3.99 43.58 11.95 12.78 7.97 22.66 19.17 29.63 33.62 6.97 14.44 10.46 30.79 10.46 49.06s-3.49 33.95-10.46 48.06z"/><path d="m1567.16 315.49h40.84v254h-40.84z"/><path d="m1587.58 217.37c-7.63 0-13.95 2.49-18.92 7.47-4.98 4.98-7.47 11.29-7.47 18.93s2.49 13.95 7.47 18.93 11.29 7.47 18.92 7.47 13.95-2.49 18.93-7.47 7.47-11.29 7.47-18.93-2.49-13.95-7.47-18.93-11.29-7.47-18.93-7.47z"/><path d="m1845.31 336.16c-17.76-15.77-42.92-23.66-75.45-23.66-30.55 0-55.37 6.97-74.46 20.92s-30.13 33.37-33.12 58.27h40.84c2.66-12.95 9.71-23.32 21.16-31.13 11.46-7.81 25.98-11.71 43.58-11.71 19.92 0 35.44 4.65 46.56 13.95s16.68 22.25 16.68 38.85v17.43h-74.7c-33.2 0-58.52 6.81-75.95 20.42s-26.15 33.2-26.15 58.77c0 22.91 8.55 41 25.65 54.28 17.1 13.29 39.76 19.93 67.98 19.93 37.19 0 65.58-14.11 85.16-42.33v39.13h38.73v-.05s.08 0 .12.01v-165.1c0-29.55-8.88-52.21-26.64-67.98zm-14.2 129.74c0 21.58-7.14 38.93-21.42 52.04-14.28 13.12-33.87 19.67-58.77 19.67-16.94 0-30.38-3.82-40.34-11.45-9.96-7.64-14.94-17.76-14.94-30.38 0-28.22 18.92-42.33 56.78-42.33h78.69v12.46z"/></g></svg>',cactus:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 32 32" fill="none">\n<rect width="32" height="32" rx="4" fill="white"/>\n<g clip-path="url(#clip0_4284_19593)">\n<path d="M16.0193 19.9909C13.8104 19.9909 12.0199 18.2019 12.0221 15.996C12.0164 13.7992 13.7952 12.0147 15.995 12.009H16.0377C17.7967 12.0168 19.2872 13.1588 19.8136 14.7403C19.8583 14.875 19.9444 14.9923 20.0596 15.0754C20.1748 15.1586 20.3133 15.2034 20.4554 15.2035H23.976C24.0197 15.2035 24.0617 15.1861 24.0926 15.1552C24.1236 15.1243 24.141 15.0824 24.141 15.0387V14.132C24.141 14.1126 24.1487 14.094 24.1625 14.0802C24.1762 14.0665 24.1949 14.0588 24.2143 14.0588H25.0721C25.0915 14.0588 25.1102 14.0665 25.1239 14.0802C25.1377 14.094 25.1454 14.1126 25.1454 14.132V15.0389C25.1454 15.0826 25.1628 15.1245 25.1938 15.1554C25.2247 15.1863 25.2667 15.2037 25.3105 15.2037H25.8121C25.8559 15.2037 25.8979 15.1863 25.9288 15.1554C25.9598 15.1245 25.9772 15.0826 25.9772 15.0389V14.132C25.9772 14.1126 25.9849 14.094 25.9986 14.0802C26.0124 14.0665 26.031 14.0588 26.0505 14.0588H26.9083C26.9277 14.0588 26.9464 14.0665 26.9601 14.0802C26.9739 14.094 26.9816 14.1126 26.9816 14.132V15.0389C26.9816 15.0826 26.999 15.1245 27.0299 15.1554C27.0609 15.1863 27.1029 15.2037 27.1466 15.2037H27.8342C27.878 15.2037 27.92 15.1863 27.9509 15.1554C27.9819 15.1245 27.9993 15.0826 27.9993 15.0389C27.9993 15.0343 27.9993 15.0296 27.9993 15.025C27.5029 8.85639 22.333 4.00385 16.0269 4C9.39083 3.99597 4 9.37502 4 16.0002C4 22.6254 9.38129 28 16.0193 28C22.3288 28 27.5027 23.1462 27.9994 16.9747C28.0012 16.9531 27.9987 16.9314 27.9921 16.9108C27.9855 16.8902 27.9749 16.8711 27.9609 16.8546C27.9469 16.8381 27.9297 16.8245 27.9105 16.8146C27.8912 16.8047 27.8701 16.7987 27.8485 16.7969C27.8438 16.7969 27.8392 16.7969 27.8344 16.7969H20.4558C20.3129 16.7974 20.1738 16.8428 20.0582 16.9267C19.9427 17.0106 19.8565 17.1287 19.812 17.2643C19.2824 18.8485 17.7846 19.9909 16.0193 19.9909Z" fill="#1C46A0"/>\n</g>\n<defs>\n<clipPath id="clip0_4284_19593">\n<rect width="24" height="24" fill="white" transform="translate(4 4)"/>\n</clipPath>\n</defs>\n</svg>'},we=({accounts:t})=>{var e;const r=t=>t.name.startsWith("gk8")||t.name.startsWith("neptune")?Xt(ue,{name:`${le.SelectCustodian}${t.name}`,children:"Select"}):t.onboardingUrl?Xt(pe,{href:t.onboardingUrl,children:"Select"}):null;return Yt(ee,{children:[Yt(re,{children:[Xt(ne,{children:"Select custodian"}),Xt(me,{children:"Connect your existing accounts or select a custody or self-custody solution"}),ce.filter((t=>t.enabled)).map((t=>Yt(ge,{direction:"horizontal",alignment:"space-between",children:[Yt(re,{direction:"horizontal",children:[Xt(be,{src:ve[t.name]??'<svg width="24" height="25" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M17.037 0H6.975C2.605 0 0 2.617 0 6.987v10.05c0 4.37 2.605 6.975 6.975 6.975h10.05c4.37 0 6.975-2.605 6.975-6.976V6.988C24.012 2.617 21.407 0 17.037 0ZM11.49 17.757c0 .36-.18.684-.492.876a.975.975 0 0 1-.54.156 1.11 1.11 0 0 1-.469-.108l-4.202-2.1a1.811 1.811 0 0 1-.985-1.61v-3.973c0-.36.18-.685.493-.877a1.04 1.04 0 0 1 1.008-.048l4.202 2.101a1.8 1.8 0 0 1 .997 1.609v3.974h-.012Zm-.252-6.423L6.723 8.896a1.045 1.045 0 0 1-.528-.924c0-.384.204-.744.528-.924l4.515-2.438a1.631 1.631 0 0 1 1.524 0l4.515 2.438c.324.18.528.528.528.924s-.204.744-.528.924l-4.515 2.438c-.24.132-.504.192-.768.192a1.54 1.54 0 0 1-.756-.192Zm7.972 3.638c0 .684-.385 1.308-.997 1.608l-4.202 2.101c-.144.072-.3.108-.468.108a.975.975 0 0 1-.54-.156 1.017 1.017 0 0 1-.493-.876v-3.974c0-.684.384-1.309.997-1.609l4.202-2.101a1.04 1.04 0 0 1 1.008.048c.313.192.493.516.493.877v3.974Z" fill="#24272A"/></svg>\n'}),Xt(me,{children:t.displayName})]}),r(t)]},t.name)))]}),Xt(ae,{children:Xt(ue,{name:fe.RemoveCustodianToken,disabled:!(null===(e=t)||void 0===e?void 0:e.length),children:"Remove custodian token"})})]})},Me=te("Avatar"),Ee=({accounts:t})=>Yt(ee,{children:[Yt(re,{children:[Xt(ne,{children:"Remove Custodian Token"}),Xt(me,{children:"Are you sure you want to remove this toke? All custodial accounts assigned to this token will be removed from the extension as well."}),t.map((t=>Yt(ge,{direction:"horizontal",alignment:"space-between",children:[Yt(re,{direction:"horizontal",children:[Xt(Me,{address:`eip155:1:${t.address}`}),Yt(re,{children:[t.options.accountName?Xt(me,{children:t.options.accountName}):null,Yt(me,{children:[t.address.slice(0,6),"...",t.address.slice(-4)]})]})]}),Xt(me,{children:t.options.custodian.displayName})]})))]}),Yt(ae,{children:[Xt(ue,{name:fe.CancelRemoveToken,children:"Cancel"}),Xt(ue,{name:fe.RemoveToken,children:"Remove"})]})]});async function Se(t,e){return snap.request({method:"snap_createInterface",params:{ui:t,context:e}})}async function _e(t,e,r){return snap.request({method:"snap_updateInterface",params:{id:t,ui:e,context:r}})}async function ke(t){return snap.request({method:"snap_getInterfaceState",params:{id:t}})}async function Ae(t,e){return snap.request({method:"snap_resolveInterface",params:{id:t,value:e}})}const xe={log:(...t)=>console.log("[Institutional snap]",...t.map((t=>"object"==typeof t?JSON.stringify(t,null,2):t))),info:(...t)=>console.info("[Institutional snap]",...t.map((t=>"object"==typeof t?JSON.stringify(t,null,2):t))),warn:(...t)=>console.warn("[Institutional snap]",...t.map((t=>"object"==typeof t?JSON.stringify(t,null,2):t))),error:(...t)=>{console.error("[Institutional snap]",...t.map((t=>"object"==typeof t?JSON.stringify(t,null,2):t))),console.error(t)},debug:(...t)=>console.debug("[Institutional snap]",...t.map((t=>"object"==typeof t?JSON.stringify(t,null,2):t)))};async function Ie({id:t,context:e}){await _e(t,Xt(we,{accounts:e.accounts}),e)}const Be={[fe.RemoveCustodianToken]:async function({id:t,context:e}){await _e(t,Xt(Ee,{accounts:e.accounts}),e)},[fe.CancelRemoveToken]:Ie,[fe.RemoveToken]:async function({id:t,context:e,snapContext:r}){var n;for(const t of(null===(n=e.accounts)||void 0===n?void 0:n.map((t=>t.id)))??[])try{var i;await(null===(i=r.keyring)||void 0===i?void 0:i.deleteAccount(t))}catch(t){xe.error("Error deleting account",t)}await _e(t,Xt(we,{accounts:e.accounts}),e)},[fe.CancelToken]:Ie},Te={[le.SelectCustodian]:async function({id:t,event:e,context:r}){var n;await _e(t,Xt(de,{custodianName:(null===(n=e.name)||void 0===n?void 0:n.replace(le.SelectCustodian,""))??""}),r)},[le.ConnectToken]:async function({id:t,event:e}){var r,n,i,o,s,a;const u=(null===(r=e.name)||void 0===r?void 0:r.replace(le.ConnectToken,""))??"",h=ce.find((t=>t.name===u)),c=await ke(t),{apiUrl:f,token:l}=c.addTokenForm,d={custodianType:`ECA${(null===(n=h)||void 0===n?void 0:n.apiVersion.toString())??""}`,custodianEnvironment:(null===(i=h)||void 0===i?void 0:i.name)??"",custodianApiUrl:(null===(o=h)||void 0===o?void 0:o.apiBaseUrl)??"",custodianDisplayName:(null===(s=h)||void 0===s?void 0:s.displayName)??"",apiUrl:f,token:l,refreshTokenUrl:(null===(a=h)||void 0===a?void 0:a.refreshTokenUrl)??""};await Nr(d)}};async function Pe(t){return await Se(Xt(we,{accounts:t.accounts}),t)}const Ce=({title:t,message:e})=>Xt(ee,{children:Yt(re,{children:[Xt(ne,{children:t}),Xt(me,{children:e})]})});var Re;!function(t){t.ConfirmButton="onboarding-confirm",t.CancelButton="onboarding-cancel"}(Re||(Re={}));const Oe="onboarding-address-selector-";const Le={[Re.ConfirmButton]:async function({id:t,context:e}){const r=await ke(t),n=Object.keys(r).filter((t=>!0===r[t])).map((t=>t.replace(Oe,""))).map((t=>e.accounts.filter((e=>e.address===t)))).flat().map((t=>({address:t.address,name:t.name})));0===n.length?await _e(t,Xt(Ce,{title:"No accounts imported",message:"No accounts were selected"}),e):await Ae(t,n)},[Re.CancelButton]:async function({id:t}){await Ae(t,[])}},Ne=te("Checkbox"),je=te("Divider");var He=r(7783),De=r(8834).Buffer;function Ue(t){throw new Error(t)}const Fe=t=>{if(t&&"0x"!==t)return"string"==typeof t?t.startsWith("0x")?t:`0x${t}`:`0x${De.from(t).toString("hex")}`};function $e(t){return`${t.slice(0,6)}...${t.slice(-4)}`}const qe=({accounts:t})=>0===t.length?Yt(ee,{children:[Xt(re,{children:Xt(ne,{children:"No accounts found"})}),Xt(ae,{children:Xt(ue,{name:Re.CancelButton,children:"Cancel"})})]}):Yt(ee,{children:[Yt(re,{children:[Xt(ne,{children:"Accounts"}),t.map((t=>{return Yt(re,{children:[Xt(Ne,{name:`${Oe}${t.address}`,label:t.name}),Xt(pe,{href:(e=t.address,`https://etherscan.io/address/${e}`),children:$e(t.address)}),Xt(je,{})]},t.address);var e}))]}),Yt(ae,{children:[Xt(ue,{name:Re.CancelButton,children:"Cancel"}),Xt(ue,{name:Re.ConfirmButton,children:"Confirm"})]})]});async function ze(t){const e=t.accounts.map((t=>({address:t.address,name:t.name}))),r=await Se(Xt(qe,{accounts:e}),t),n=await async function(t){return snap.request({method:"snap_dialog",params:{id:t}})}(r);return n}var Ge=r(539);const Ve="refresh_token_change",Je="token_expired";class Ke{static async signTypedData(t,e,r,n={version:Ge.SignTypedDataVersion.V4}){if(!e)throw new Error("Typed data is required");return await r.signTypedData_v4(t,e,n.version,{chainId:"0x420"})}static async signPersonalMessage(t,e,r){return await r.signPersonalMessage(t,e,{chainId:"0x420"})}}var We=r(4670);function Ze(t){return`0x${BigInt(t).toString(16)}`}const Xe="0",Ye="2";var Qe=r(8834).Buffer;class tr{static createTransactionPayload(t){const e=void 0!==t.maxFeePerGas,r={...t,type:e?Ye:Xe,data:Fe(t.data)};return e?{...r,maxFeePerGas:t.maxFeePerGas?BigInt(t.maxFeePerGas).toString():"0",maxPriorityFeePerGas:t.maxPriorityFeePerGas?BigInt(t.maxPriorityFeePerGas).toString():"0"}:{...r,gasPrice:t.gasPrice?BigInt(t.gasPrice).toString():"0"}}static async getTransactionSignature(t,e){if(t.signedRawTransaction){var r,n,i;xe.info("Transaction is signed",t.signedRawTransaction);const o=this.getTypedTransaction(t,e);return{v:Ze((null===(r=o.v)||void 0===r?void 0:r.toString())??"0"),r:Ze((null===(n=o.r)||void 0===n?void 0:n.toString())??"0"),s:Ze((null===(i=o.s)||void 0===i?void 0:i.toString())??"0")}}xe.debug("Fetching signature from the network",t.transactionHash);const o=await ethereum.request({method:"eth_getTransactionByHash",params:[t.transactionHash]});return xe.debug("Got signature from the network",o),{v:o.v,r:o.r,s:o.s}}static getTypedTransaction(t,e){if(!t.signedRawTransaction)throw new Error("Transaction is not signed");const r=((t,e)=>He.Common.custom({chainId:parseInt(e)},{hardfork:t.maxPriorityFeePerGas||t.maxFeePerGas?He.Hardfork.London:He.Hardfork.Istanbul}))(t,e),n=Qe.from(t.signedRawTransaction.substring(2),"hex");return We.TransactionFactory.fromSerializedData(n,{common:r})}static validateTransaction(t,e){const r=this.getTypedTransaction(e,t.chainId);return Number(t.nonce)!==Number(r.nonce)?{isValid:!1,error:`Custodian altered the nonce from the request: ${Number(t.nonce)} to ${Number(r.nonce)}`}:"gasPrice"in t&&"gasPrice"in r&&Number(t.gasPrice)!==Number(r.gasPrice)?{isValid:!1,error:`Custodian altered the gas price from the request: ${t.gasPrice} to ${r.gasPrice}`}:"maxFeePerGas"in t&&"maxFeePerGas"in r&&Number(t.maxFeePerGas)!==Number(r.maxFeePerGas)?{isValid:!1,error:`Custodian altered the maxFeePerGas from the request: ${t.maxFeePerGas} to ${r.maxFeePerGas}`}:"maxPriorityFeePerGas"in t&&"maxPriorityFeePerGas"in r&&Number(t.maxPriorityFeePerGas)!==Number(r.maxPriorityFeePerGas)?{isValid:!1,error:`Custodian altered the maxPriorityFeePerGas from the request: ${t.maxPriorityFeePerGas} to ${r.maxPriorityFeePerGas}`}:{isValid:!0}}}var er=r(2699),rr=r.n(er);async function nr(t,e){let r,n=`Error with request. Status: ${t.status} Status text: ${t.statusText}. URL: ${t.url}. ${e??""}`;if(!t.ok){var i;const e=await t.json();throw(null===(i=e.error)||void 0===i?void 0:i.message)?n+=`. Error message: ${e.error.message}`:e.message&&(n+=`. Error message: ${e.message}`),new Error(n)}try{r=await t.json()}catch(t){throw new Error(`Failed to parse JSON. ${n}`)}return r}class ir{#t;#e;constructor(t,e){this.#t=t,this.#e=e}getHeaders(){return{"Content-Type":"application/json",Authorization:`Bearer ${this.#e}`}}async getEthereumAccounts(){const t=this.getHeaders(),e=await fetch(`${this.#t}/wallets`,{headers:t});return(await nr(e,"Error fetching wallet accounts")).data}async getEthereumAccountByAddress(t){const e=this.getHeaders(),r=await fetch(`${this.#t}/mmi/wallets/address/${t}`,{headers:e}),n=`Error fetching account for address ${t}`,i=await nr(r,n);return i.data.length&&i.data[0]?i.data[0]:null}async createTransaction(t,e){const r=this.getHeaders(),n=await fetch(`${this.#t}/mmi/${t.coinId}/wallet/${t.walletId}/tx/build`,{method:"POST",headers:r,body:JSON.stringify({txParams:e})});return(await nr(n,"Error creating transaction")).data}async getTransaction(t){const e=this.getHeaders(),r=await fetch(`${this.#t}/mmi/wallets/transactions/${t}`,{headers:e}),n=`Error getting transaction with id ${t}`,i=await nr(r,n);return i.data.length&&i.data[0]?i.data[0]:null}async getTransactions(){const t=this.getHeaders(),e=await fetch(`${this.#t}/custodian/transaction`,{headers:t});return(await nr(e,"Error getting transactions")).data}async getCustomerProof(){const t=this.getHeaders(),e=await fetch(`${this.#t}/mmi/customer-proof`,{method:"POST",headers:t,body:JSON.stringify({version:"n/a"})});return await nr(e,"Error getting Customer Proof")}async signTypedData_v4(t,e,r,n,i){const o=await this.getHeaders(),s={address:t,payload:e,encodingVersion:i||"v4"},a=await fetch(`${this.#t}/mmi/${r}/wallet/${n}/messages/typed`,{method:"POST",body:JSON.stringify(s),headers:o}),u=`Error doing signTypedData from address: ${t}`;return await nr(a,u)}async signPersonalMessage(t,e,r,n){const i=await this.getHeaders(),o={address:t,message:e},s=await fetch(`${this.#t}/mmi/${r}/wallet/${n}/messages/personal`,{method:"POST",body:JSON.stringify(o),headers:i}),a=`Error doing signPersonalMessage from address: ${t}`;return await nr(s,a)}async getSignedMessage(t,e,r){const n=await this.getHeaders(),i=await fetch(`${this.#t}/mmi/${e}/wallet/${r}/messages/${t}`,{headers:n}),o=`Error getting signed message with id ${t}`;return await nr(i,o)}}const or="https://app.bitgo.com/defi/v2";function sr(t,e){switch(t){case"created":return{finished:!1,submitted:!1,signed:!1,success:!1,displayText:"Created",reason:e??""};case"signed":return{finished:!1,submitted:!1,signed:!0,success:!1,displayText:"Signed",reason:e??""};case"submitted":return{finished:!1,submitted:!0,signed:!0,success:!1,displayText:"Submitted",reason:e??""};case"mined":return{finished:!0,submitted:!0,signed:!0,success:!0,displayText:"Mined",reason:e??""};case"completed":return{finished:!0,submitted:!0,signed:!0,success:!0,displayText:"Completed",reason:e??""};case"failed":return{finished:!0,submitted:!0,signed:!0,success:!1,displayText:"Failed",reason:e??""};case"rejected":return{finished:!0,submitted:!1,signed:!1,success:!1,displayText:"Rejected",reason:e??""};case"aborted":return{finished:!0,submitted:!1,signed:!1,success:!1,displayText:"Aborted",reason:e??""};case"confirmed":return{finished:!0,submitted:!0,signed:!0,success:!0,displayText:"Confirmed",reason:e??""};default:return{finished:!1,submitted:!1,signed:!1,success:!1,displayText:"Unknown",reason:e??""}}}class ar extends er.EventEmitter{#r;constructor(t,e=or,r){super();const{refreshToken:n}=t;this.#r=new ir(e,n)}async getEthereumAccounts(t){const e=(await this.#r.getEthereumAccounts()).map((t=>{var e;return{name:(null===(e=t.labels.find((t=>"Wallet Name"===t.key)))||void 0===e?void 0:e.value)??"Unnamed Bitgo Wallet",address:t.address,balance:t.balance,custodianDetails:{accountId:t.custodianDetails.id,coinId:t.custodianDetails.coin},chainId:t.chainId,labels:t.labels.filter((t=>"Wallet Name"!==t.key))}}));return t?e.filter((e=>e.chainId===t)):e}async getEthereumAccountsByAddress(t){return(await this.getEthereumAccounts()).filter((e=>e.address.toLowerCase().includes(t.toLowerCase())))}async getEthereumAccountsByLabelOrAddressName(t){return(await this.getEthereumAccounts()).filter((e=>e.name.includes(t)))}async createTransaction(t){var e;const r=t.from,n=await this.getEthereumAccountsByAddress(r);if(!n.length||!(null===(e=n[0])||void 0===e?void 0:e.custodianDetails))throw new Error("No such ethereum account!");const i=n[0].custodianDetails.accountId,{coinId:o}=n[0].custodianDetails;t.gasLimit=(Number(t.gasLimit)+1e5).toString();const s=await this.#r.createTransaction({walletId:i,coinId:o},t);return{transactionStatus:sr(s.transactionStatus),custodianTransactionId:s.custodianTransactionId,from:s.from,gasLimit:s.gasLimit??null,gasPrice:s.gasPrice??null,maxFeePerGas:s.maxFeePerGas??null,maxPriorityFeePerGas:s.maxPriorityFeePerGas??null,nonce:s.nonce??null,transactionHash:s.transactionHash,custodianPublishesTransaction:!0}}async getTransaction(t,e){const r=await this.#r.getTransaction(e);return r?{transactionStatus:sr(r.transactionStatus),custodianTransactionId:r.custodianTransactionId,from:r.from,gasLimit:r.gasLimit??null,gasPrice:r.gasPrice??null,maxFeePerGas:r.maxFeePerGas??null,maxPriorityFeePerGas:r.maxPriorityFeePerGas??null,nonce:r.nonce??null,transactionHash:r.transactionHash,custodianPublishesTransaction:!0}:null}async getCustomerProof(){const{data:t}=await this.#r.getCustomerProof();return t}async getSupportedChains(t){const e=await this.#r.getEthereumAccountByAddress(t);return e?[e.chainId.toString()]:[]}async getTransactionLink(t){return null}async getSignedMessageLink(t){return null}changeRefreshTokenAuthDetails(t){throw new Error("BitGo does not support refresh tokens")}async getSignedMessage(t,e){var r;const n=await this.getEthereumAccountsByAddress(t);if(!n.length)throw new Error("No such ethereum account!");if(!(null===(r=n[0])||void 0===r?void 0:r.custodianDetails))throw new Error("No such ethereum account!");const i=n[0].custodianDetails.accountId,{coinId:o}=n[0].custodianDetails,s=await this.#r.getSignedMessage(e,o,i);return s?{id:s.data.id,signature:s.data.signature,status:s.data.status}:null}async signTypedData_v4(t,e,r){var n;const i=await this.getEthereumAccountsByAddress(t);if(!i.length||!(null===(n=i[0])||void 0===n?void 0:n.custodianDetails))throw new Error("No such ethereum account!");const o=i[0].custodianDetails.accountId,{coinId:s}=i[0].custodianDetails,a=await this.#r.signTypedData_v4(t,e,s,o,r);return{id:a.data.id,signature:a.data.signature,status:a.data.status,from:t}}async signPersonalMessage(t,e){var r;const n=await this.getEthereumAccountsByAddress(t);if(!n.length||!(null===(r=n[0])||void 0===r?void 0:r.custodianDetails))throw new Error("No such ethereum account!");const i=n[0].custodianDetails.accountId,{coinId:o}=n[0].custodianDetails,s=await this.#r.signPersonalMessage(t,e,o,i);return{id:s.data.id,signature:s.data.signature,status:s.data.status,from:t}}}class ur{#n={};async tryCaching(t,e,r){if(e>=0&&this.cacheExists(t)&&this.cacheValid(t,e))return this.#n[t].results;const n=await r();return this.#n[t]={results:n,timestamp:(new Date).getTime()},n}setCache(t,e){this.#n[t]={results:e,timestamp:(new Date).getTime()}}getCache(t){return this.#n[t].results}cacheExists(t){return Boolean(Object.prototype.hasOwnProperty.call(this.#n,t)&&this.#n[t].results)}cacheValid(t,e){const r=this.#n[t],n=1e3*e;return!!r&&(new Date).getTime()-r.timestamp<n}deleteCache(t){this.cacheExists(t)&&delete this.#n[t]}}class hr{#n=new ur;#i;#o;constructor(t,e){this.#i=t,this.#o=e}async getHeaders(){return{"Content-Type":"application/json",Authorization:`Bearer ${await this.#n.tryCaching("accessToken",7200,(async()=>this.getAccessToken()))}`}}async getAccessToken(){const t=await fetch(`${this.#i}/tokens`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grantType:"refresh_token",refreshToken:this.#o})}),e=await nr(t,"Error fetching the access token");if(!e.jwt)throw new Error("No access token");return e.jwt}async getEthereumAccounts(){const t=await this.getHeaders(),e=await fetch(`${this.#i}/eth-accounts`,{headers:t});return await nr(e,"Error fetching accounts")}async createTransaction(t,e){const r=await this.getHeaders(),n={to:e.to,from:e.from,value:e.value,data:e.data,gasLimit:e.gasLimit,note:t.note};"0"===e.type||"1"===e.type?n.gasPrice=e.gasPrice:"2"===e.type&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas,n.maxFeePerGas=e.maxFeePerGas);const i=await fetch(`${this.#i}/transactions?chainId=${t.chainId}`,{method:"POST",body:JSON.stringify(n),headers:r});return await nr(i,"Error creating transaction")}async getSignedMessage(t){const e=await this.getHeaders(),r=await fetch(`${this.#i}/signatures?transactionId=${t}`,{headers:e}),n=`Error getting signed message with id ${t}`,i=await nr(r,n);return i.length&&i[0]?i[0]:null}async getTransaction(t){const e=await this.getHeaders(),r=await fetch(`${this.#i}/transactions?transactionId=${t}`,{headers:e}),n=`Error getting transaction with id ${t}`,i=await nr(r,n);return i.length&&i[0]?i[0]:null}async getTransactions(t){const e=await this.getHeaders(),r=await fetch(`${this.#i}/transactions?chainId=${t}`,{headers:e}),n=`Error getting transactions with chainId ${t}`;return await nr(r,n)}async getCustomerProof(){const t=await this.getHeaders(),e=await fetch(`${this.#i}/customer-proof`,{method:"POST",headers:t,body:JSON.stringify({})});return await nr(e,"Error getting Custommer Proof")}async signTypedData_v4(t,e,r,n){const i=await this.getHeaders(),o={address:t,payload:e,signatureVersion:r};let s=`${this.#i}/signatures`;n&&(s+=`?chainId=${n}`);const a=await fetch(s,{method:"POST",body:JSON.stringify(o),headers:i}),u=`Error doing signTypedData from address: ${t}`;return await nr(a,u)}async signPersonalMessage(t,e){const r=await this.getHeaders(),n={address:t,payload:{message:e},signatureVersion:"personalSign"},i=await fetch(`${this.#i}/signatures`,{method:"POST",body:JSON.stringify(n),headers:r}),o=`Error doing signPersonalMessage from address: ${t}`;return await nr(i,o)}async getChainIds(){const t=await this.getHeaders(),e=await fetch(`${this.#i}/chainIds`,{headers:t});return await nr(e,"Error getting chainIds")}}const cr="https://api.mycactus.com/custody/v1/mmi-api";class fr extends er.EventEmitter{#r;#n=new ur;#s;constructor(t,e=cr,r){super(),this.#s=r,this.#r=new hr(e,t.refreshToken)}async getEthereumAccounts(){return(await this.#r.getEthereumAccounts()).map((t=>({name:t.name||"Cactus wallet",address:t.address,balance:t.balance,custodianDetails:{walletId:t.custodianDetails.walletId,chainId:t.chainId},labels:t.labels?t.labels.map((t=>({key:"label",value:t}))):[]})))}async getEthereumAccountsByAddress(t){return(await this.getEthereumAccounts()).filter((e=>e.address.toLowerCase().includes(t.toLowerCase())))}async getEthereumAccountsByLabelOrAddressName(t){const e=await this.getEthereumAccounts();return t.length?e.filter((e=>new RegExp(t,"u").test(e.name))):e}async createTransaction(t,e){const r=await this.#r.createTransaction({chainId:Number(e.chainId),note:e.note??""},t);return{transactionStatus:sr(r.transactionStatus),custodianTransactionId:r.custodian_transactionId,from:r.from,gasLimit:r.gasLimit,gasPrice:r.gasPrice,maxFeePerGas:r.maxFeePerGas,maxPriorityFeePerGas:r.maxFeePerGas,nonce:r.nonce,transactionHash:r.transactionHash,custodianPublishesTransaction:!0}}async getTransaction(t,e){const r=await this.#r.getTransaction(e);return r?{transactionStatus:sr(r.transactionStatus),custodianTransactionId:r.custodian_transactionId,from:r.from,gasLimit:r.gasLimit,gasPrice:r.gasPrice,maxFeePerGas:r.maxFeePerGas,maxPriorityFeePerGas:r.maxPriorityFeePerGas,nonce:r.nonce,transactionHash:r.transactionHash,custodianPublishesTransaction:!0}:null}async getSignedMessage(t,e){const r=await this.#r.getSignedMessage(e);return r?{id:r.custodian_transactionId??"",signature:r.signature,status:sr(r.transactionStatus),from:t}:null}async getCustomerProof(){const{jwt:t}=await this.#r.getCustomerProof();return t}async signTypedData_v4(t,e,r){var n;const i=await this.#r.signTypedData_v4(t,e,r,null===(n=e.domain)||void 0===n?void 0:n.chainId);return{id:i.custodian_transactionId,status:sr(i.transactionStatus),from:t,signature:null}}async signPersonalMessage(t,e){const r=await this.#r.signPersonalMessage(t,e);return{id:r.custodian_transactionId,status:sr(r.transactionStatus),from:t,signature:null}}async getErc20Tokens(){return{}}async getSupportedChains(){const{networks:t}=await this.#r.getChainIds();return this.#n.tryCaching("getSupportedChains",this.#s,(async()=>t.map((t=>t.chainID))))}async getTransactionLink(t){return null}async getSignedMessageLink(t){return null}changeRefreshTokenAuthDetails(t){throw new Error("Not implemented yet")}}var lr,dr=r(5634);function pr(t){let e=0;return async function(r,n,i){let o,s;e+=1,console.debug("JSON-RPC >",r,e,n,t);try{if(o=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify({jsonrpc:"2.0",id:e,method:r,params:n}),credentials:"same-origin"}),s=await o.json(),s.error)throw console.error("JSON-RPC <",r,e,s,t,s),new Error(s.error.message);console.debug("JSON-RPC <",r,e,s.result,t)}catch(n){throw console.log("JSON-RPC <",r,e,n,t),console.error(n),n}return s}}class mr extends er.EventEmitter{#a;#n;#s=null;#u;#o;#h;constructor(t,e,r){super(),this.#u=t,this.#o=e,this.#h=r,this.#a=pr(`${t}/v1/json-rpc`),this.#n=new ur}setRefreshToken(t){const e={oldRefreshToken:this.#o,newRefreshToken:t,apiUrl:this.#u};this.emit(Ve,e),this.#o=t}async getAccessToken(){if(this.#s){if(this.#n.cacheExists("accessToken")&&this.#n.cacheValid("accessToken",this.#s))return this.#n.getCache("accessToken")}try{var t;const e=`grant_type=refresh_token&refresh_token=${encodeURIComponent(this.#o)}`,r={headers:{"Content-Type":"application/x-www-form-urlencoded"}},n=await fetch(this.#h,{method:"POST",body:e,headers:r.headers,credentials:"same-origin"}),i=await n.json();if(401===(null===(t=n)||void 0===t?void 0:t.status)&&i.url){const t=i.url,e=this.#o,r=dr.createHash("sha256").update(e+t).digest("hex");throw this.emit(Je,{url:t,oldRefreshToken:r}),new Error("Refresh token provided is no longer valid.")}if(!n.ok){const t=i.message;throw new Error(`Request failed with status ${n.status}: ${t}`)}if(this.#s=i.expires_in,this.#n.setCache("accessToken",i.access_token),i.refresh_token&&i.refresh_token!==this.#o){const t=i.refresh_token;console.log(`ECA1Client: Refresh token changed to ${t.substring(0,5)}...${t.substring(t.length-5)}`);const e=this.#o;this.setRefreshToken(t);const r={apiUrl:this.#u,oldRefreshToken:e,newRefreshToken:t};this.emit(Ve,r)}return i.access_token}catch(t){const{message:e}=t;throw new Error(`Error getting the Access Token: ${e}`)}}async listAccounts(){const t=await this.getAccessToken();return this.#a("custodian_listAccounts",{},t)}async getCustomerProof(){const t=await this.getAccessToken();return this.#a("custodian_getCustomerProof",{},t)}async createTransaction(t){const e=await this.getAccessToken();return this.#a("custodian_createTransaction",t,e)}async getAccountChainIds(t){const e=await this.getAccessToken();return this.#a("custodian_listAccountChainIds",t,e)}async signPersonalMessage(t){const e=await this.getAccessToken();return this.#a("custodian_sign",t,e)}async signTypedData(t){const e=await this.getAccessToken();return this.#a("custodian_signTypedData",t,e)}async getTransaction(t){const e=await this.getAccessToken();return this.#a("custodian_getTransactionById",t,e)}async getSignedMessage(t){const e=await this.getAccessToken();return this.#a("custodian_getSignedMessageById",t,e)}async getTransactionLink(t){const e=await this.getAccessToken();return this.#a("custodian_getTransactionLink",t,e)}}class gr extends(rr()){#r;#n=new ur;#s;constructor(t,e,r){super();const{refreshToken:n}=t;this.#r=new mr(e,n,t.refreshTokenUrl),this.#s=r,this.#r.on(Ve,(t=>{this.emit(Ve,t)})),this.#r.on(Je,(t=>{this.emit(Je,t)}))}async getEthereumAccounts(){return(await this.#r.listAccounts()).result.map((t=>({name:t.name,address:t.address,custodianDetails:null,labels:t.tags.map((t=>({key:t.name,value:t.value})))})))}async getEthereumAccountsByAddress(t){return(await this.getEthereumAccounts()).filter((e=>e.address.toLowerCase().includes(t.toLowerCase())))}async getEthereumAccountsByLabelOrAddressName(t){return(await this.getEthereumAccounts()).filter((e=>e.name.includes(t)))}async createTransaction(t,e){var r;const n=await this.getEthereumAccountsByAddress(t.from);if(!n.length||!(null===(r=n[0])||void 0===r?void 0:r.address))throw new Error("No such ethereum account!");const i={from:n[0].address,to:t.to,...t.data&&{data:t.data},...t.value&&{value:Ze(t.value)},...t.gasLimit&&{gas:Ze(t.gasLimit)},...t.type&&{type:Ze(t.type)}};2===Number(t.type)?(i.maxFeePerGas=Ze(t.maxFeePerGas),i.maxPriorityFeePerGas=Ze(t.maxPriorityFeePerGas)):i.gasPrice=Ze(t.gasPrice);const o={chainId:Ze(e.chainId),...e.origin&&{originUrl:e.origin},...e.note&&{note:e.note},...e.transactionCategory&&{transactionCategory:e.transactionCategory}},{result:s}=await this.#r.createTransaction([i,o]);if("string"!=typeof s)throw new Error("Failed to create transaction");return{custodianTransactionId:s,transactionStatus:sr("created"),from:n[0].address,custodianPublishesTransaction:!0}}async getTransaction(t,e){const{result:r}=await this.#r.getTransaction([e]);return r?{transactionStatus:r.status,custodianTransactionId:r.id,from:r.from,gasLimit:r.gas??null,gasPrice:r.gasPrice??null,maxFeePerGas:r.maxFeePerGas??null,maxPriorityFeePerGas:r.maxPriorityFeePerGas??null,nonce:r.nonce,transactionHash:r.hash,reason:r.status.reason,to:r.to,custodianPublishesTransaction:!0}:null}async getSignedMessage(t,e){const{result:r}=await this.#r.getSignedMessage([e]);return r?{id:e,signature:r.signature,status:r.status}:null}async getTransactionLink(t){const{result:e}=await this.#r.getTransactionLink([t]);return e?{id:t,url:e.url,text:e.text,action:e.action,ethereum:e.ethereum??{accounts:[],chainId:[]}}:null}async getSignedMessageLink(t){const{result:e}=await this.#r.getTransactionLink([t]);return e?{id:t,url:e.url,text:e.text,action:e.action,ethereum:e.ethereum??{accounts:[],chainId:[]}}:null}async getCustomerProof(){const{result:t}=await this.#r.getCustomerProof();return t.jwt}async signTypedData_v4(t,e,r,n){if(!(await this.getEthereumAccountsByAddress(t)).length)throw new Error("No such ethereum account!");const i=r.toLowerCase(),{result:o}=await this.#r.signTypedData([t,e,i]);return{id:o,signature:null,status:sr("created"),from:t}}async signPersonalMessage(t,e,r){if(!(await this.getEthereumAccountsByAddress(t)).length)throw new Error("No such ethereum account!");const{result:n}=await this.#r.signPersonalMessage([t,e]);return{id:n,status:sr("created"),signature:null,from:t}}async getSupportedChains(t){return this.#n.tryCaching(`getSupportedChains-${t}`,this.#s,(async()=>{const{result:e}=await this.#r.getAccountChainIds([t]);return e}))}changeRefreshTokenAuthDetails(t){this.#r.setRefreshToken(t.refreshToken)}}class br extends er.EventEmitter{#a;#n;#u;#o;#h;#s=null;constructor(t,e,r){super(),this.#u=t,this.#o=e,this.#h=r,this.#a=pr(`${t}/v3/json-rpc`),this.#n=new ur}setRefreshToken(t){const e={oldRefreshToken:this.#o,newRefreshToken:t,apiUrl:this.#u};this.emit(Ve,e),this.#o=t}async getAccessToken(){if(this.#s){if(this.#n.cacheExists("accessToken")&&this.#n.cacheValid("accessToken",this.#s))return this.#n.getCache("accessToken")}try{var t;const e={grant_type:"refresh_token",refresh_token:this.#o},r={headers:{"Content-Type":"application/json"}},n=await fetch(this.#h,{method:"POST",body:JSON.stringify(e),headers:r.headers,credentials:"same-origin"}),i=await n.json();if(401===(null===(t=n)||void 0===t?void 0:t.status)&&i.url){const t=i.url,e=this.#o,r=dr.createHash("sha256").update(e+t).digest("hex");throw this.emit(Je,{url:t,oldRefreshToken:r}),new Error("Refresh token provided is no longer valid.")}if(!n.ok){const t=i.message;throw new Error(`Request failed with status ${n.status}: ${t}`)}if(this.#s=i.expires_in,this.#n.setCache("accessToken",i.access_token),i.refresh_token&&i.refresh_token!==this.#o){const t=i.refresh_token;console.log(`ECA3Client: Refresh token changed to ${t.substring(0,5)}...${t.substring(t.length-5)}`);const e=this.#o;this.setRefreshToken(t);const r={apiUrl:this.#u,oldRefreshToken:e,newRefreshToken:i.refresh_token};this.emit(Ve,r)}return i.access_token}catch(t){const{message:e}=t;throw new Error(`Error getting the Access Token: ${e}`)}}async listAccounts(){const t=await this.getAccessToken();return this.#a("custodian_listAccounts",{},t)}async listAccountsSigned(){const t=await this.getAccessToken();return this.#a("custodian_listAccountsSigned",{},t)}async replaceTransaction(t){const e=await this.getAccessToken();return this.#a("custodian_replaceTransaction",t,e)}async getCustomerProof(){const t=await this.getAccessToken();return this.#a("custodian_getCustomerProof",{},t)}async createTransaction(t){const e=await this.getAccessToken();return this.#a("custodian_createTransaction",t,e)}async getAccountChainIds(t){const e=await this.getAccessToken();return this.#a("custodian_listAccountChainIds",t,e)}async signPersonalMessage(t){const e=await this.getAccessToken();return this.#a("custodian_sign",t,e)}async signTypedData(t){const e=await this.getAccessToken();return this.#a("custodian_signTypedData",t,e)}async getTransaction(t){const e=await this.getAccessToken();return this.#a("custodian_getTransactionById",t,e)}async getSignedMessage(t){const e=await this.getAccessToken();return this.#a("custodian_getSignedMessageById",t,e)}async getTransactionLink(t){const e=await this.getAccessToken();return this.#a("custodian_getTransactionLink",t,e)}async getSignedMessageLink(t){const e=await this.getAccessToken();return this.#a("custodian_getSignedMessageLink",t,e)}}class yr extends er.EventEmitter{#r;#n=new ur;#s;constructor(t,e,r){super();const{refreshToken:n}=t;this.#r=new br(e,n,t.refreshTokenUrl),this.#s=r,this.#r.on(Ve,(t=>{this.emit(Ve,t)})),this.#r.on(Je,(t=>{this.emit(Je,t)}))}async getEthereumAccounts(){return(await this.#r.listAccounts()).result.map((t=>({name:t.name,address:t.address,custodianDetails:null,labels:t.tags.map((t=>({key:t.name,value:t.value}))),metadata:t.metadata})))}async getEthereumAccountsByAddress(t){return(await this.getEthereumAccounts()).filter((e=>e.address.toLowerCase().includes(t.toLowerCase())))}async getListAccountsSigned(){const{result:t}=await this.#r.listAccountsSigned();return t.jwt}async getEthereumAccountsByLabelOrAddressName(t){return(await this.getEthereumAccounts()).filter((e=>e.name.includes(t)))}async createTransaction(t,e){var r;const n=t.from,i=await this.getEthereumAccountsByAddress(n);if(!i.length||!(null===(r=i[0])||void 0===r?void 0:r.address))throw new Error("No such ethereum account!");const o={from:i[0].address,to:t.to,...t.data&&{data:t.data},...t.value&&{value:Ze(t.value)},...t.gasLimit&&{gas:Ze(t.gasLimit)},...t.type&&{type:Ze(t.type)}};2===Number(t.type)?(o.maxFeePerGas=Ze(t.maxFeePerGas),o.maxPriorityFeePerGas=Ze(t.maxPriorityFeePerGas)):o.gasPrice=Ze(t.gasPrice);const s={chainId:Ze(e.chainId),...e.origin&&{originUrl:e.origin},...e.note&&{note:e.note},...e.transactionCategory&&{transactionCategory:e.transactionCategory},..."boolean"==typeof e.custodianPublishesTransaction&&{custodianPublishesTransaction:e.custodianPublishesTransaction},...e.rpcUrl&&{rpcUrl:e.rpcUrl}},{result:a}=await this.#r.createTransaction([o,s]);if("string"!=typeof a)throw new Error("Failed to create transaction");return{custodianTransactionId:a,transactionStatus:sr("created"),from:i[0].address,custodianPublishesTransaction:e.custodianPublishesTransaction}}async getTransaction(t,e){var r,n;const{result:i}=await this.#r.getTransaction([e]);return i?{transactionStatus:i.transaction.status,custodianTransactionId:i.transaction.id,from:i.transaction.from,gasLimit:i.transaction.gas??null,gasPrice:i.transaction.gasPrice??null,maxFeePerGas:i.transaction.maxFeePerGas??null,maxPriorityFeePerGas:i.transaction.maxPriorityFeePerGas??null,nonce:i.transaction.nonce,transactionHash:i.transaction.hash,reason:i.transaction.status.reason,to:i.transaction.to,signedRawTransaction:i.transaction.signedRawTransaction??null,chainId:i.metadata.chainId,custodianPublishesTransaction:(null===(r=i.metadata)||void 0===r?void 0:r.custodianPublishesTransaction)??!0,rpcUrl:(null===(n=i.metadata)||void 0===n?void 0:n.rpcUrl)??null}:null}async replaceTransaction(t){const e={transactionId:t.transactionId,action:t.action},r={};t.gasLimit&&(r.gas=Ze(t.gasLimit)),t.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=Ze(t.maxPriorityFeePerGas)),t.maxFeePerGas&&(r.maxFeePerGas=Ze(t.maxFeePerGas));const{result:n}=await this.#r.replaceTransaction([e,r]);return{transactionId:n.transactionId}}async getSignedMessage(t,e){const{result:r}=await this.#r.getSignedMessage([e]);return r?{id:e,signature:r.signature,status:r.status}:null}async getTransactionLink(t){const{result:e}=await this.#r.getTransactionLink([t]);return e?{id:t,url:e.url,text:e.text,action:e.action,ethereum:e.ethereum??{accounts:[],chainId:[]}}:null}async getSignedMessageLink(t){const{result:e}=await this.#r.getSignedMessageLink([t]);return e?{id:t,url:e.url,text:e.text,action:e.action,ethereum:e.ethereum??{accounts:[],chainId:[]}}:null}async getCustomerProof(){const{result:t}=await this.#r.getCustomerProof();return t.jwt}async signTypedData_v4(t,e,r,n){if(!(await this.getEthereumAccountsByAddress(t)).length)throw new Error("No such ethereum account!");const i=r.toLowerCase(),{result:o}=await this.#r.signTypedData([{address:t,data:e,version:i},n]);return{id:o,status:sr("created"),signature:null,from:t}}async signPersonalMessage(t,e,r){if(!(await this.getEthereumAccountsByAddress(t)).length)throw new Error("No such ethereum account!");const{result:n}=await this.#r.signPersonalMessage([{address:t,message:e},r]);return{id:n,status:sr("created"),signature:null,from:t}}async getSupportedChains(t){return this.#n.tryCaching(`getSupportedChains-${t}`,this.#s,(async()=>{const{result:e}=await this.#r.getAccountChainIds([t]);return e}))}changeRefreshTokenAuthDetails(t){this.#r.setRefreshToken(t.refreshToken)}}!function(t){t.ECA3="ECA3",t.ECA1="ECA1",t.BitGo="BitGo",t.Cactus="Cactus"}(lr||(lr={}));const vr={[lr.ECA3]:yr,[lr.ECA1]:gr,[lr.BitGo]:ar,[lr.Cactus]:fr},wr={wallets:{},requests:{}};async function Mr(){const t=await snap.request({method:"snap_manageState",params:{operation:"get"}});return xe.debug("Retrieved state:",JSON.stringify(t)),{...wr,...t}}async function Er(t){xe.debug("Saving state:",JSON.stringify(t)),await snap.request({method:"snap_manageState",params:{operation:"update",newState:t}})}class Sr{#c;#f;#l;constructor(t,e){this.#c=t,this.#f={},this.#l=e}async listAccounts(){return Object.values(this.#c.wallets).map((t=>t.account))}async getAccount(t){var e;return(null===(e=this.#c.wallets[t])||void 0===e?void 0:e.account)??Ue(`Account '${t}' not found`)}async accountExists(t){return void 0!==this.#c.wallets[t]}async createAccount(t){const e=ce.find((e=>e.apiBaseUrl===t.details.custodianApiUrl)),{address:r,name:n}=t;if(!function(t,e){return!e.find((e=>e.account.address===t))}(r,Object.values(this.#c.wallets)))throw new Error(`Account address already in use: ${r}`);try{var i;const o={id:Gt(),options:{custodian:{displayName:t.details.custodianDisplayName,deferPublication:(null===(i=e)||void 0===i?void 0:i.custodianPublishesTransaction)??!0},accountName:n},address:r,methods:[ft.SignTransaction,ft.PersonalSign,ft.SignTypedDataV3,ft.SignTypedDataV4],type:Z.Eoa};return await this.#d(bt.AccountCreated,{account:o,accountNameSuggestion:n??"Custodial Account",displayConfirmation:!1}),this.#c.wallets[o.id]={account:o,details:t.details},await this.#p(),o}catch(t){throw new Error(t.message)}}async filterAccountChains(t,e){const{address:r}=await this.getAccount(t),n=this.getCustodianApiForAddress(r),i=await n.getSupportedChains();return e.filter((t=>i.includes(`eip155:${parseInt(t,16)}`)))}async updateAccount(t){const e=this.#c.wallets[t.id]??Ue(`Account '${t.id}' not found`),r={...e.account,...t,address:e.account.address,options:{...e.account.options,...t.options}};try{await this.#d(bt.AccountUpdated,{account:r}),e.account=r,await this.#p()}catch(t){Ue(t.message)}}async deleteAccount(t){try{await this.#d(bt.AccountDeleted,{id:t}),delete this.#c.wallets[t],await this.#p()}catch(t){Ue(t.message)}}async removeAccounts(t){await Promise.all(t.map((t=>delete this.#c.wallets[t]))),await this.#p()}async listRequests(){return(await this.#l.listRequests()).map((t=>t.keyringRequest))}async getRequest(t){const e=(await this.#l.listRequests()).find((e=>e.keyringRequest.id===t));if(!e)throw new Error(`Request '${t}' not found`);return e.keyringRequest}async submitRequest(t){return this.#m(t)}async approveRequest(t){throw new Error("Method not implemented.")}async rejectRequest(t){throw new Error("Method not implemented.")}getCustodianApiForAddress(t){if(!this.#f[t]){const e=this.#g(t),r=this.#b(e.details);this.#f[t]=r,r.on(Je,(t=>{this.#y(t).catch(console.error)}))}return this.#f[t]}#b(t){return new(0,vr[t.custodianType])({refreshToken:t.token,refreshTokenUrl:t.refreshTokenUrl},t.custodianApiUrl,1e3)}async#y(t){const e=Object.values(this.#c.wallets).filter((e=>e.details.token===t.oldRefreshToken&&e.details.custodianApiUrl===t.apiUrl));e.forEach((e=>{e.details.token=t.newRefreshToken})),e.forEach((t=>{delete this.#f[t.account.address]})),await this.#p()}async#m(t){var e,r;const n=await this.#v(t.request.method,t.request.params??[],t),{address:i}=await this.getAccount(t.account);let o=null;try{o=t.request.method===ft.SignTransaction?await this.getCustodianApiForAddress(i).getTransactionLink(n):await this.getCustodianApiForAddress(i).getSignedMessageLink(n)}catch(t){console.error("Error getting deep link",t)}return{pending:!0,redirect:{message:(null===(e=o)||void 0===e?void 0:e.text)??"Complete in Custodian App",...(null===(r=o)||void 0===r?void 0:r.url)?{url:o.url}:{}}}}#g(t){return Object.values(this.#c.wallets).find((e=>e.account.address.toLowerCase()===t.toLowerCase()))??Ue(`Account '${t}' not found`)}async#v(t,e,r){switch(t){case ft.PersonalSign:{const[t,n]=e,i=this.getCustodianApiForAddress(n),o=await Ke.signPersonalMessage(n,t,i);return await this.#l.addPendingRequest({keyringRequest:r,type:"message",subType:"personalSign",fulfilled:!1,rejected:!1,message:o,signature:null}),o.id}case ft.SignTransaction:{const[t]=e;return await this.#w(t,r)}case ft.SignTypedDataV3:{const[t,n]=e,i=this.getCustodianApiForAddress(t),o=await Ke.signTypedData(t,n,i,{version:Ge.SignTypedDataVersion.V3});return await this.#l.addPendingRequest({keyringRequest:r,type:"message",subType:"v3",fulfilled:!1,rejected:!1,message:o,signature:null}),o.id}case ft.SignTypedDataV4:{const[t,n]=e,i=this.getCustodianApiForAddress(t),o=await Ke.signTypedData(t,n,i,{version:Ge.SignTypedDataVersion.V3});return await this.#l.addPendingRequest({keyringRequest:r,type:"message",subType:"v4",fulfilled:!1,rejected:!1,message:o,signature:null}),o.id}default:throw new Error(`EVM method '${t}' not supported`)}}async#w(t,e){try{const r=this.getCustodianApiForAddress(t.from),n=tr.createTransactionPayload(t),i=this.#g(t.from).account.options.custodian.deferPublication,o=await r.createTransaction(n,{chainId:t.chainId,custodianPublishesTransaction:i});return await this.#l.addPendingRequest({keyringRequest:e,type:"transaction",fulfilled:!1,rejected:!1,transaction:o,signature:null}),o.custodianTransactionId}catch(t){throw console.error("Transaction signing failed:",t),new Error(`Failed to sign transaction: ${t.message}`)}}async#p(){await Er(this.#c)}async#d(t,e){await Zt(snap,t,e)}}const _r={dev:!0};var kr;!function(t){t.Onboard="authentication.onboard",t.ClearAllRequests="snap.internal.clearAllRequests"}(kr||(kr={}));const Ar=new Map([["metamask",[yt.ListAccounts,yt.GetAccount,yt.FilterAccountChains,yt.DeleteAccount,yt.ListRequests,yt.GetRequest,yt.SubmitRequest,yt.RejectRequest]]]);ce.forEach((t=>{t.allowedOnboardingDomains&&t.allowedOnboardingDomains.forEach((t=>{Ar.set(t,[kr.Onboard]),Ar.set(`https://${t}`,[kr.Onboard])}))}));const xr=[yt.ListAccounts,yt.GetAccount,yt.CreateAccount,yt.FilterAccountChains,yt.UpdateAccount,yt.DeleteAccount,yt.ExportAccount,yt.ListRequests,yt.GetRequest,yt.ApproveRequest,yt.RejectRequest,kr.Onboard,kr.ClearAllRequests];_r.dev&&Ar.set("http://localhost:8000",xr);class Ir{#c;#M;constructor(t,e){this.#c=t,this.#M=e}listRequests(){return Object.values(this.#c.requests)}async addPendingRequest(t){this.#c.requests[t.keyringRequest.id]=t,await Er(this.#c)}async removePendingRequest(t){delete this.#c.requests[t],await Er(this.#c)}async getChainIdFromPendingRequest(t){const e=this.getRequestParams(t);if(!e.chainId)throw new Error(`Request ${t} has no chainId`);return e.chainId}getRequestParams(t){var e;if(!this.#c.requests[t])throw new Error(`Request ${t} not found`);const r=null===(e=this.#c.requests[t])||void 0===e?void 0:e.keyringRequest.request.params;if(!Array.isArray(r)||0===r.length)throw new Error(`Request ${t} has invalid params`);return r[0]}async clearAllRequests(){this.#c.requests={},await Er(this.#c)}async poll(){const t=this.listRequests().filter((t=>!t.fulfilled));for(const e of t)if("message"===e.type)try{await this.pollSignedMessage(e.keyringRequest.id,e)}catch(t){xe.info(`Error polling signed message request ${e.keyringRequest.id}`),xe.error(t)}else if("transaction"===e.type)try{await this.pollTransaction(e.keyringRequest.id,e)}catch(t){xe.info(`Error polling transaction request ${e.keyringRequest.id}`),console.error(t),xe.error(t)}}async pollTransaction(t,e){var r,n,i;const{account:o}=e.keyringRequest,{address:s}=await this.#M.getAccount(o),a=await this.#M.getCustodianApiForAddress(s),{custodianTransactionId:u}=e.transaction,h=await a.getTransaction(s,u);if((null===(r=h)||void 0===r?void 0:r.transactionStatus.finished)&&!h.transactionStatus.success)return await this.emitRejectedEvent(t),void await this.removePendingRequest(t);if((null===(n=h)||void 0===n?void 0:n.transactionStatus.finished)&&h.transactionStatus.success||(null===(i=h)||void 0===i?void 0:i.signedRawTransaction)){const r=await this.getChainIdFromPendingRequest(t),n=await tr.getTransactionSignature(h,r);if(h.signedRawTransaction){const e=tr.validateTransaction(this.getRequestParams(t),h);if(!e.isValid){if(e.error){const t=`Transaction ${u} was signed by custodian but failed validation: ${e.error}`;await async function(t){await snap.request({method:"snap_notify",params:{type:"inApp",message:t}})}(t)}return await this.emitRejectedEvent(t),void await this.removePendingRequest(t)}}const i={...e,fulfilled:!0,result:n};Object.assign(e,i),await this.emitApprovedEvent(t,n),await this.removePendingRequest(t)}}async pollSignedMessage(t,e){var r,n;const{account:i}=e.keyringRequest,{address:o}=await this.#M.getAccount(i),s=await this.#M.getCustodianApiForAddress(o),a=await s.getSignedMessage(o,e.message.id);if(null===(n=a)||void 0===n||null===(r=n.status)||void 0===r?void 0:r.finished){if(a.status.success){const r={...e,fulfilled:!0,result:a.signature};Object.assign(e,r),await this.emitApprovedEvent(t,a.signature)}else await this.emitRejectedEvent(t);await this.removePendingRequest(t)}}async emitApprovedEvent(t,e){try{await Zt(snap,bt.RequestApproved,{id:t,result:e})}catch(e){if(!e.message.includes(`Request '${t}' not found`))throw e;xe.info(`Request '${t}' not found, removing from state`),await this.removePendingRequest(t)}}async emitRejectedEvent(t){try{await Zt(snap,bt.RequestRejected,{id:t})}catch(e){if(!e.message.includes(`Request '${t}' not found`))throw e;xe.info(`Request '${t}' not found, removing from state`),await this.removePendingRequest(t)}}}let Br,Tr;const Pr={addPendingRequest:async t=>(Tr=await Or(),Tr.addPendingRequest(t)),listRequests:async()=>(Tr=await Or(),Tr.listRequests())},Cr={getCustodianApiForAddress:async t=>(Br=await Rr(),Br.getCustodianApiForAddress(t)),getAccount:async t=>(Br=await Rr(),Br.getAccount(t))};async function Rr(){if(!Br){const t=await Mr();Br||(Br=new Sr(t,Pr))}return Br}async function Or(){return Tr||(Tr=new Ir(await Mr(),Cr)),Tr}function Lr(t,e){var r;return(null===(r=Ar.get(t))||void 0===r?void 0:r.includes(e))??!1}const Nr=async t=>{const e=vr[t.custodianType];if(Br=await Rr(),!Object.values(lr).includes(t.custodianType))throw new Error(`Custodian type ${t.custodianType} not supported`);const r=new e({refreshToken:t.token,refreshTokenUrl:t.refreshTokenUrl},t.custodianApiUrl,1e3);let n=await r.getEthereumAccounts();const i=await Br.listAccounts();for(const t of i)n=n.filter((e=>e.address!==t.address));let o;try{o=await ze({selectedAccounts:[],request:t,accounts:n,activity:"onboarding"})}catch(t){throw xe.error("Error choosing account",t),t}if(null===o)return[];const s=o.map((e=>({address:e.address,name:e.name,details:{...t}})));for(const t of s)try{await Br.createAccount(t)}catch(t){xe.error("Error creating account",t)}return s},jr=async({origin:t,request:e})=>{if(xe.debug(`RPC request (origin="${t}"):`,JSON.stringify(e,void 0,2)),!Lr(t,e.method))throw new Error(`Origin '${t}' is not allowed to call '${e.method}'`);switch(e.method){case kr.Onboard:return await Nr(e.params);case kr.ClearAllRequests:{const t=await Or();return await t.clearAllRequests()}default:throw new Kt(e.method)}},Hr=async({origin:t,request:e})=>{if(xe.debug(`Keyring request (origin="${t}"):`,JSON.stringify(e,void 0,2)),!Lr(t,e.method))throw new Error(`Origin '${t}' is not allowed to call '${e.method}'`);return Wt(await Rr(),e)},Dr=async()=>{xe.info("Polling requests");try{await(await Or()).poll()}catch(t){throw xe.error("Error polling requests",t),t}},Ur=async({request:t})=>{if("execute"!==t.method)throw new Error("Method not found.");{const t=Date.now(),e=6e4;for(let r=0;r<6;r++){if(Date.now()-t>=e)return;await Dr(),r<5&&await new Promise((t=>setTimeout(t,1e4)))}}},Fr=async({id:t,event:e,context:r})=>{if(!e.name)return;const n={...Le,...Be},i={...Te},o=n[e.name]??i[Object.keys(i).find((t=>{var r;return null===(r=e.name)||void 0===r?void 0:r.startsWith(t)}))??""];if(!o)return;const s={keyring:Br};await o({id:t,event:e,context:r,snapContext:s})},$r=async()=>{Br=await Rr();const t=await async function(t){return{activity:"homepage",accounts:await t.keyring.listAccounts()}}({keyring:Br});return{id:await Pe(t)}}})();var i=exports;for(var o in n)i[o]=n[o];n.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})();
|