@peerbit/server 5.4.2 → 5.4.3

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.
@@ -63,4 +63,4 @@ Error generating stack: `+ge.message+`
63
63
  `,T9=f=>new Uint8Array(py.keccak256.update(Li([Yi(L9),Yi(String(f.length)),f])).arrayBuffer());var La;(function(f){f[f.NONE=0]="NONE",f[f.SHA_256=1]="SHA_256",f[f.ETH_KECCAK_256=3]="ETH_KECCAK_256"})(La||(La={}));const jf=(f,o)=>{if(o===La.NONE)return f;if(o===La.SHA_256)return VE(f);if(o===La.ETH_KECCAK_256)return T9(f);throw new Error("Unsupported")};function mA(f){return"0x"+py.keccak_256(Nt(f))}const J9="rlp/5.8.0",O9=new zt(J9);function S8(f){const o=[];for(;f;)o.unshift(f&255),f>>=8;return o}function yy(f){if(Array.isArray(f)){let h=[];if(f.forEach(function(I){h=h.concat(yy(I))}),h.length<=55)return h.unshift(192+h.length),h;const b=S8(h.length);return b.unshift(247+b.length),b.concat(h)}Zd(f)||O9.throwArgumentError("RLP object must be BytesLike","object",f);const o=Array.prototype.slice.call(Nt(f));if(o.length===1&&o[0]<=127)return o;if(o.length<=55)return o.unshift(128+o.length),o;const c=S8(o.length);return c.unshift(183+c.length),c.concat(o)}function b1(f){return or(yy(f))}const z9="address/5.8.0",sf=new zt(z9);function D8(f){QA(f,20)||sf.throwArgumentError("invalid address","address",f),f=f.toLowerCase();const o=f.substring(2).split(""),c=new Uint8Array(40);for(let b=0;b<40;b++)c[b]=o[b].charCodeAt(0);const h=Nt(mA(c));for(let b=0;b<40;b+=2)h[b>>1]>>4>=8&&(o[b]=o[b].toUpperCase()),(h[b>>1]&15)>=8&&(o[b+1]=o[b+1].toUpperCase());return"0x"+o.join("")}const q9=9007199254740991;function j9(f){return Math.log10?Math.log10(f):Math.log(f)/Math.LN10}const $d={};for(let f=0;f<10;f++)$d[String(f)]=String(f);for(let f=0;f<26;f++)$d[String.fromCharCode(65+f)]=String(10+f);const k8=Math.floor(j9(q9));function V9(f){f=f.toUpperCase(),f=f.substring(4)+f.substring(0,2)+"00";let o=f.split("").map(h=>$d[h]).join("");for(;o.length>=k8;){let h=o.substring(0,k8);o=parseInt(h,10)%97+o.substring(h.length)}let c=String(98-parseInt(o,10)%97);for(;c.length<2;)c="0"+c;return c}function Ti(f){let o=null;if(typeof f!="string"&&sf.throwArgumentError("invalid address","address",f),f.match(/^(0x)?[0-9a-fA-F]{40}$/))f.substring(0,2)!=="0x"&&(f="0x"+f),o=D8(f),f.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&o!==f&&sf.throwArgumentError("bad address checksum","address",f);else if(f.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(f.substring(2,4)!==V9(f)&&sf.throwArgumentError("bad icap checksum","address",f),o=U9(f.substring(4));o.length<40;)o="0"+o;o=D8("0x"+o)}else sf.throwArgumentError("invalid address","address",f);return o}const X9="properties/5.8.0";var W9=function(f,o,c,h){function b(I){return I instanceof c?I:new c(function(y){y(I)})}return new(c||(c=Promise))(function(I,y){function S(R){try{N(h.next(R))}catch(B){y(B)}}function k(R){try{N(h.throw(R))}catch(B){y(B)}}function N(R){R.done?I(R.value):b(R.value).then(S,k)}N((h=h.apply(f,o||[])).next())})};const v1=new zt(X9);function lr(f,o,c){Object.defineProperty(f,o,{enumerable:!0,value:c,writable:!1})}function as(f){return W9(this,void 0,void 0,function*(){const o=Object.keys(f).map(h=>{const b=f[h];return Promise.resolve(b).then(I=>({key:h,value:I}))});return(yield Promise.all(o)).reduce((h,b)=>(h[b.key]=b.value,h),{})})}function Z9(f,o){(!f||typeof f!="object")&&v1.throwArgumentError("invalid object","object",f),Object.keys(f).forEach(c=>{o[c]||v1.throwArgumentError("invalid object key - "+c,"transaction:"+c,f)})}function Zh(f){const o={};for(const c in f)o[c]=f[c];return o}const $9={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function Cy(f){if(f==null||$9[typeof f])return!0;if(Array.isArray(f)||typeof f=="object"){if(!Object.isFrozen(f))return!1;const o=Object.keys(f);for(let c=0;c<o.length;c++){let h=null;try{h=f[o[c]]}catch{continue}if(!Cy(h))return!1}return!0}return v1.throwArgumentError(`Cannot deepCopy ${typeof f}`,"object",f)}function eB(f){if(Cy(f))return f;if(Array.isArray(f))return Object.freeze(f.map(o=>x1(o)));if(typeof f=="object"){const o={};for(const c in f){const h=f[c];h!==void 0&&lr(o,c,x1(h))}return o}return v1.throwArgumentError(`Cannot deepCopy ${typeof f}`,"object",f)}function x1(f){return eB(f)}class Iy{constructor(o){for(const c in o)this[c]=x1(o[c])}}const tB="abstract-provider/5.8.0";var rB=function(f,o,c,h){function b(I){return I instanceof c?I:new c(function(y){y(I)})}return new(c||(c=Promise))(function(I,y){function S(R){try{N(h.next(R))}catch(B){y(B)}}function k(R){try{N(h.throw(R))}catch(B){y(B)}}function N(R){R.done?I(R.value):b(R.value).then(S,k)}N((h=h.apply(f,o||[])).next())})};const nB=new zt(tB);class eg{constructor(){nB.checkAbstract(new.target,eg),lr(this,"_isProvider",!0)}getFeeData(){return rB(this,void 0,void 0,function*(){const{block:o,gasPrice:c}=yield as({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(y=>null)});let h=null,b=null,I=null;return o&&o.baseFeePerGas&&(h=o.baseFeePerGas,I=Zr.from("1500000000"),b=o.baseFeePerGas.mul(2).add(I)),{lastBaseFeePerGas:h,maxFeePerGas:b,maxPriorityFeePerGas:I,gasPrice:c}})}addListener(o,c){return this.on(o,c)}removeListener(o,c){return this.off(o,c)}static isProvider(o){return!!(o&&o._isProvider)}}const AB="abstract-signer/5.8.0";var Pi=function(f,o,c,h){function b(I){return I instanceof c?I:new c(function(y){y(I)})}return new(c||(c=Promise))(function(I,y){function S(R){try{N(h.next(R))}catch(B){y(B)}}function k(R){try{N(h.throw(R))}catch(B){y(B)}}function N(R){R.done?I(R.value):b(R.value).then(S,k)}N((h=h.apply(f,o||[])).next())})};const Ki=new zt(AB),iB=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],aB=[zt.errors.INSUFFICIENT_FUNDS,zt.errors.NONCE_EXPIRED,zt.errors.REPLACEMENT_UNDERPRICED];class tg{constructor(){Ki.checkAbstract(new.target,tg),lr(this,"_isSigner",!0)}getBalance(o){return Pi(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),o)})}getTransactionCount(o){return Pi(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),o)})}estimateGas(o){return Pi(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const c=yield as(this.checkTransaction(o));return yield this.provider.estimateGas(c)})}call(o,c){return Pi(this,void 0,void 0,function*(){this._checkProvider("call");const h=yield as(this.checkTransaction(o));return yield this.provider.call(h,c)})}sendTransaction(o){return Pi(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const c=yield this.populateTransaction(o),h=yield this.signTransaction(c);return yield this.provider.sendTransaction(h)})}getChainId(){return Pi(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Pi(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Pi(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(o){return Pi(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(o)})}checkTransaction(o){for(const h in o)iB.indexOf(h)===-1&&Ki.throwArgumentError("invalid transaction key: "+h,"transaction",o);const c=Zh(o);return c.from==null?c.from=this.getAddress():c.from=Promise.all([Promise.resolve(c.from),this.getAddress()]).then(h=>(h[0].toLowerCase()!==h[1].toLowerCase()&&Ki.throwArgumentError("from address mismatch","transaction",o),h[0])),c}populateTransaction(o){return Pi(this,void 0,void 0,function*(){const c=yield as(this.checkTransaction(o));c.to!=null&&(c.to=Promise.resolve(c.to).then(b=>Pi(this,void 0,void 0,function*(){if(b==null)return null;const I=yield this.resolveName(b);return I==null&&Ki.throwArgumentError("provided ENS name resolves to null","tx.to",b),I})),c.to.catch(b=>{}));const h=c.maxFeePerGas!=null||c.maxPriorityFeePerGas!=null;if(c.gasPrice!=null&&(c.type===2||h)?Ki.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",o):(c.type===0||c.type===1)&&h&&Ki.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",o),(c.type===2||c.type==null)&&c.maxFeePerGas!=null&&c.maxPriorityFeePerGas!=null)c.type=2;else if(c.type===0||c.type===1)c.gasPrice==null&&(c.gasPrice=this.getGasPrice());else{const b=yield this.getFeeData();if(c.type==null)if(b.maxFeePerGas!=null&&b.maxPriorityFeePerGas!=null)if(c.type=2,c.gasPrice!=null){const I=c.gasPrice;delete c.gasPrice,c.maxFeePerGas=I,c.maxPriorityFeePerGas=I}else c.maxFeePerGas==null&&(c.maxFeePerGas=b.maxFeePerGas),c.maxPriorityFeePerGas==null&&(c.maxPriorityFeePerGas=b.maxPriorityFeePerGas);else b.gasPrice!=null?(h&&Ki.throwError("network does not support EIP-1559",zt.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),c.gasPrice==null&&(c.gasPrice=b.gasPrice),c.type=0):Ki.throwError("failed to get consistent fee data",zt.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else c.type===2&&(c.maxFeePerGas==null&&(c.maxFeePerGas=b.maxFeePerGas),c.maxPriorityFeePerGas==null&&(c.maxPriorityFeePerGas=b.maxPriorityFeePerGas))}return c.nonce==null&&(c.nonce=this.getTransactionCount("pending")),c.gasLimit==null&&(c.gasLimit=this.estimateGas(c).catch(b=>{if(aB.indexOf(b.code)>=0)throw b;return Ki.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",zt.errors.UNPREDICTABLE_GAS_LIMIT,{error:b,tx:c})})),c.chainId==null?c.chainId=this.getChainId():c.chainId=Promise.all([Promise.resolve(c.chainId),this.getChainId()]).then(b=>(b[1]!==0&&b[0]!==b[1]&&Ki.throwArgumentError("chainId address mismatch","transaction",o),b[0])),yield as(c)})}_checkProvider(o){this.provider||Ki.throwError("missing provider",zt.errors.UNSUPPORTED_OPERATION,{operation:o||"_checkProvider"})}static isSigner(o){return!!(o&&o._isSigner)}}function rg(f){return mA(Yi(f))}const oB="hash/5.8.0",sB=`Ethereum Signed Message:
64
64
  `;function fB(f){return typeof f=="string"&&(f=Yi(f)),mA(No([Yi(sB),Yi(String(f.length)),f]))}var cB=function(f,o,c,h){function b(I){return I instanceof c?I:new c(function(y){y(I)})}return new(c||(c=Promise))(function(I,y){function S(R){try{N(h.next(R))}catch(B){y(B)}}function k(R){try{N(h.throw(R))}catch(B){y(B)}}function N(R){R.done?I(R.value):b(R.value).then(S,k)}N((h=h.apply(f,o||[])).next())})};const ln=new zt(oB),by=new Uint8Array(32);by.fill(0);const uB=Zr.from(-1),vy=Zr.from(0),xy=Zr.from(1),lB=Zr.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function hB(f){const o=Nt(f),c=o.length%32;return c?gs([o,by.slice(c)]):or(o)}const dB=yi(xy.toHexString(),32),gB=yi(vy.toHexString(),32),M8={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Rl=["name","version","chainId","verifyingContract","salt"];function N8(f){return function(o){return typeof o!="string"&&ln.throwArgumentError(`invalid domain value for ${JSON.stringify(f)}`,`domain.${f}`,o),o}}const pB={name:N8("name"),version:N8("version"),chainId:function(f){try{return Zr.from(f).toString()}catch{}return ln.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",f)},verifyingContract:function(f){try{return Ti(f).toLowerCase()}catch{}return ln.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",f)},salt:function(f){try{const o=Nt(f);if(o.length!==32)throw new Error("bad length");return or(o)}catch{}return ln.throwArgumentError('invalid domain value "salt"',"domain.salt",f)}};function Gl(f){{const o=f.match(/^(u?)int(\d*)$/);if(o){const c=o[1]==="",h=parseInt(o[2]||"256");(h%8!==0||h>256||o[2]&&o[2]!==String(h))&&ln.throwArgumentError("invalid numeric width","type",f);const b=lB.mask(c?h-1:h),I=c?b.add(xy).mul(uB):vy;return function(y){const S=Zr.from(y);return(S.lt(I)||S.gt(b))&&ln.throwArgumentError(`value out-of-bounds for ${f}`,"value",y),yi(S.toTwos(256).toHexString(),32)}}}{const o=f.match(/^bytes(\d+)$/);if(o){const c=parseInt(o[1]);return(c===0||c>32||o[1]!==String(c))&&ln.throwArgumentError("invalid bytes width","type",f),function(h){return Nt(h).length!==c&&ln.throwArgumentError(`invalid length for ${f}`,"value",h),hB(h)}}}switch(f){case"address":return function(o){return yi(Ti(o),32)};case"bool":return function(o){return o?dB:gB};case"bytes":return function(o){return mA(o)};case"string":return function(o){return rg(o)}}return null}function F8(f,o){return`${f}(${o.map(({name:c,type:h})=>h+" "+c).join(",")})`}class WA{constructor(o){lr(this,"types",Object.freeze(x1(o))),lr(this,"_encoderCache",{}),lr(this,"_types",{});const c={},h={},b={};Object.keys(o).forEach(S=>{c[S]={},h[S]=[],b[S]={}});for(const S in o){const k={};o[S].forEach(N=>{k[N.name]&&ln.throwArgumentError(`duplicate variable name ${JSON.stringify(N.name)} in ${JSON.stringify(S)}`,"types",o),k[N.name]=!0;const R=N.type.match(/^([^\x5b]*)(\x5b|$)/)[1];R===S&&ln.throwArgumentError(`circular type reference to ${JSON.stringify(R)}`,"types",o),!Gl(R)&&(h[R]||ln.throwArgumentError(`unknown type ${JSON.stringify(R)}`,"types",o),h[R].push(S),c[S][R]=!0)})}const I=Object.keys(h).filter(S=>h[S].length===0);I.length===0?ln.throwArgumentError("missing primary type","types",o):I.length>1&&ln.throwArgumentError(`ambiguous primary types or unused types: ${I.map(S=>JSON.stringify(S)).join(", ")}`,"types",o),lr(this,"primaryType",I[0]);function y(S,k){k[S]&&ln.throwArgumentError(`circular type reference to ${JSON.stringify(S)}`,"types",o),k[S]=!0,Object.keys(c[S]).forEach(N=>{h[N]&&(y(N,k),Object.keys(k).forEach(R=>{b[R][N]=!0}))}),delete k[S]}y(this.primaryType,{});for(const S in b){const k=Object.keys(b[S]);k.sort(),this._types[S]=F8(S,o[S])+k.map(N=>F8(N,o[N])).join("")}}getEncoder(o){let c=this._encoderCache[o];return c||(c=this._encoderCache[o]=this._getEncoder(o)),c}_getEncoder(o){{const b=Gl(o);if(b)return b}const c=o.match(/^(.*)(\x5b(\d*)\x5d)$/);if(c){const b=c[1],I=this.getEncoder(b),y=parseInt(c[3]);return S=>{y>=0&&S.length!==y&&ln.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",S);let k=S.map(I);return this._types[b]&&(k=k.map(mA)),mA(gs(k))}}const h=this.types[o];if(h){const b=rg(this._types[o]);return I=>{const y=h.map(({name:S,type:k})=>{const N=this.getEncoder(k)(I[S]);return this._types[k]?mA(N):N});return y.unshift(b),gs(y)}}return ln.throwArgumentError(`unknown type: ${o}`,"type",o)}encodeType(o){const c=this._types[o];return c||ln.throwArgumentError(`unknown type: ${JSON.stringify(o)}`,"name",o),c}encodeData(o,c){return this.getEncoder(o)(c)}hashStruct(o,c){return mA(this.encodeData(o,c))}encode(o){return this.encodeData(this.primaryType,o)}hash(o){return this.hashStruct(this.primaryType,o)}_visit(o,c,h){if(Gl(o))return h(o,c);const b=o.match(/^(.*)(\x5b(\d*)\x5d)$/);if(b){const y=b[1],S=parseInt(b[3]);return S>=0&&c.length!==S&&ln.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",c),c.map(k=>this._visit(y,k,h))}const I=this.types[o];return I?I.reduce((y,{name:S,type:k})=>(y[S]=this._visit(k,c[S],h),y),{}):ln.throwArgumentError(`unknown type: ${o}`,"type",o)}visit(o,c){return this._visit(this.primaryType,o,c)}static from(o){return new WA(o)}static getPrimaryType(o){return WA.from(o).primaryType}static hashStruct(o,c,h){return WA.from(c).hashStruct(o,h)}static hashDomain(o){const c=[];for(const h in o){const b=M8[h];b||ln.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(h)}`,"domain",o),c.push({name:h,type:b})}return c.sort((h,b)=>Rl.indexOf(h.name)-Rl.indexOf(b.name)),WA.hashStruct("EIP712Domain",{EIP712Domain:c},o)}static encode(o,c,h){return gs(["0x1901",WA.hashDomain(o),WA.from(c).hash(h)])}static hash(o,c,h){return mA(WA.encode(o,c,h))}static resolveNames(o,c,h,b){return cB(this,void 0,void 0,function*(){o=Zh(o);const I={};o.verifyingContract&&!QA(o.verifyingContract,20)&&(I[o.verifyingContract]="0x");const y=WA.from(c);y.visit(h,(S,k)=>(S==="address"&&!QA(k,20)&&(I[k]="0x"),k));for(const S in I)I[S]=yield b(S);return o.verifyingContract&&I[o.verifyingContract]&&(o.verifyingContract=I[o.verifyingContract]),h=y.visit(h,(S,k)=>S==="address"&&I[k]?I[k]:k),{domain:o,value:h}})}static getPayload(o,c,h){WA.hashDomain(o);const b={},I=[];Rl.forEach(k=>{const N=o[k];N!=null&&(b[k]=pB[k](N),I.push({name:k,type:M8[k]}))});const y=WA.from(c),S=Zh(c);return S.EIP712Domain?ln.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",c):S.EIP712Domain=I,y.encode(h),{types:S,domain:b,primaryType:y.primaryType,message:y.visit(h,(k,N)=>{if(k.match(/^bytes(\d*)/))return or(Nt(N));if(k.match(/^u?int/))return Zr.from(N).toString();switch(k){case"address":return N.toLowerCase();case"bool":return!!N;case"string":return typeof N!="string"&&ln.throwArgumentError("invalid string","value",N),N}return ln.throwArgumentError("unsupported type","type",k)})}}}class Ey{constructor(o){lr(this,"alphabet",o),lr(this,"base",o.length),lr(this,"_alphabetMap",{}),lr(this,"_leader",o.charAt(0));for(let c=0;c<o.length;c++)this._alphabetMap[o.charAt(c)]=c}encode(o){let c=Nt(o);if(c.length===0)return"";let h=[0];for(let I=0;I<c.length;++I){let y=c[I];for(let S=0;S<h.length;++S)y+=h[S]<<8,h[S]=y%this.base,y=y/this.base|0;for(;y>0;)h.push(y%this.base),y=y/this.base|0}let b="";for(let I=0;c[I]===0&&I<c.length-1;++I)b+=this._leader;for(let I=h.length-1;I>=0;--I)b+=this.alphabet[h[I]];return b}decode(o){if(typeof o!="string")throw new TypeError("Expected String");let c=[];if(o.length===0)return new Uint8Array(c);c.push(0);for(let h=0;h<o.length;h++){let b=this._alphabetMap[o[h]];if(b===void 0)throw new Error("Non-base"+this.base+" character");let I=b;for(let y=0;y<c.length;++y)I+=c[y]*this.base,c[y]=I&255,I>>=8;for(;I>0;)c.push(I&255),I>>=8}for(let h=0;o[h]===this._leader&&h<o.length-1;++h)c.push(0);return Nt(new Uint8Array(c.reverse()))}}new Ey("abcdefghijklmnopqrstuvwxyz234567");const _y=new Ey("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var Yl={},Vr={},Ll,P8;function C2(){if(P8)return Ll;P8=1,Ll=f;function f(o,c){if(!o)throw new Error(c||"Assertion failed")}return f.equal=function(c,h,b){if(c!=h)throw new Error(b||"Assertion failed: "+c+" != "+h)},Ll}var Lc={exports:{}},K8;function Z1(){return K8||(K8=1,typeof Object.create=="function"?Lc.exports=function(o,c){c&&(o.super_=c,o.prototype=Object.create(c.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}))}:Lc.exports=function(o,c){if(c){o.super_=c;var h=function(){};h.prototype=c.prototype,o.prototype=new h,o.prototype.constructor=o}}),Lc.exports}var U8;function ya(){if(U8)return Vr;U8=1;var f=C2(),o=Z1();Vr.inherits=o;function c(q,J){return(q.charCodeAt(J)&64512)!==55296||J<0||J+1>=q.length?!1:(q.charCodeAt(J+1)&64512)===56320}function h(q,J){if(Array.isArray(q))return q.slice();if(!q)return[];var Q=[];if(typeof q=="string")if(J){if(J==="hex")for(q=q.replace(/[^a-z0-9]+/ig,""),q.length%2!==0&&(q="0"+q),W=0;W<q.length;W+=2)Q.push(parseInt(q[W]+q[W+1],16))}else for(var L=0,W=0;W<q.length;W++){var Ae=q.charCodeAt(W);Ae<128?Q[L++]=Ae:Ae<2048?(Q[L++]=Ae>>6|192,Q[L++]=Ae&63|128):c(q,W)?(Ae=65536+((Ae&1023)<<10)+(q.charCodeAt(++W)&1023),Q[L++]=Ae>>18|240,Q[L++]=Ae>>12&63|128,Q[L++]=Ae>>6&63|128,Q[L++]=Ae&63|128):(Q[L++]=Ae>>12|224,Q[L++]=Ae>>6&63|128,Q[L++]=Ae&63|128)}else for(W=0;W<q.length;W++)Q[W]=q[W]|0;return Q}Vr.toArray=h;function b(q){for(var J="",Q=0;Q<q.length;Q++)J+=S(q[Q].toString(16));return J}Vr.toHex=b;function I(q){var J=q>>>24|q>>>8&65280|q<<8&16711680|(q&255)<<24;return J>>>0}Vr.htonl=I;function y(q,J){for(var Q="",L=0;L<q.length;L++){var W=q[L];J==="little"&&(W=I(W)),Q+=k(W.toString(16))}return Q}Vr.toHex32=y;function S(q){return q.length===1?"0"+q:q}Vr.zero2=S;function k(q){return q.length===7?"0"+q:q.length===6?"00"+q:q.length===5?"000"+q:q.length===4?"0000"+q:q.length===3?"00000"+q:q.length===2?"000000"+q:q.length===1?"0000000"+q:q}Vr.zero8=k;function N(q,J,Q,L){var W=Q-J;f(W%4===0);for(var Ae=new Array(W/4),ie=0,fe=J;ie<Ae.length;ie++,fe+=4){var z;L==="big"?z=q[fe]<<24|q[fe+1]<<16|q[fe+2]<<8|q[fe+3]:z=q[fe+3]<<24|q[fe+2]<<16|q[fe+1]<<8|q[fe],Ae[ie]=z>>>0}return Ae}Vr.join32=N;function R(q,J){for(var Q=new Array(q.length*4),L=0,W=0;L<q.length;L++,W+=4){var Ae=q[L];J==="big"?(Q[W]=Ae>>>24,Q[W+1]=Ae>>>16&255,Q[W+2]=Ae>>>8&255,Q[W+3]=Ae&255):(Q[W+3]=Ae>>>24,Q[W+2]=Ae>>>16&255,Q[W+1]=Ae>>>8&255,Q[W]=Ae&255)}return Q}Vr.split32=R;function B(q,J){return q>>>J|q<<32-J}Vr.rotr32=B;function oe(q,J){return q<<J|q>>>32-J}Vr.rotl32=oe;function Ee(q,J){return q+J>>>0}Vr.sum32=Ee;function pe(q,J,Q){return q+J+Q>>>0}Vr.sum32_3=pe;function V(q,J,Q,L){return q+J+Q+L>>>0}Vr.sum32_4=V;function Ie(q,J,Q,L,W){return q+J+Q+L+W>>>0}Vr.sum32_5=Ie;function Ce(q,J,Q,L){var W=q[J],Ae=q[J+1],ie=L+Ae>>>0,fe=(ie<L?1:0)+Q+W;q[J]=fe>>>0,q[J+1]=ie}Vr.sum64=Ce;function _e(q,J,Q,L){var W=J+L>>>0,Ae=(W<J?1:0)+q+Q;return Ae>>>0}Vr.sum64_hi=_e;function te(q,J,Q,L){var W=J+L;return W>>>0}Vr.sum64_lo=te;function r0(q,J,Q,L,W,Ae,ie,fe){var z=0,G=J;G=G+L>>>0,z+=G<J?1:0,G=G+Ae>>>0,z+=G<Ae?1:0,G=G+fe>>>0,z+=G<fe?1:0;var T=q+Q+W+ie+z;return T>>>0}Vr.sum64_4_hi=r0;function ve(q,J,Q,L,W,Ae,ie,fe){var z=J+L+Ae+fe;return z>>>0}Vr.sum64_4_lo=ve;function Ne(q,J,Q,L,W,Ae,ie,fe,z,G){var T=0,Be=J;Be=Be+L>>>0,T+=Be<J?1:0,Be=Be+Ae>>>0,T+=Be<Ae?1:0,Be=Be+fe>>>0,T+=Be<fe?1:0,Be=Be+G>>>0,T+=Be<G?1:0;var Te=q+Q+W+ie+z+T;return Te>>>0}Vr.sum64_5_hi=Ne;function ye(q,J,Q,L,W,Ae,ie,fe,z,G){var T=J+L+Ae+fe+G;return T>>>0}Vr.sum64_5_lo=ye;function Xe(q,J,Q){var L=J<<32-Q|q>>>Q;return L>>>0}Vr.rotr64_hi=Xe;function he(q,J,Q){var L=q<<32-Q|J>>>Q;return L>>>0}Vr.rotr64_lo=he;function v0(q,J,Q){return q>>>Q}Vr.shr64_hi=v0;function He(q,J,Q){var L=q<<32-Q|J>>>Q;return L>>>0}return Vr.shr64_lo=He,Vr}var Tl={},H8;function Vf(){if(H8)return Tl;H8=1;var f=ya(),o=C2();function c(){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}return Tl.BlockHash=c,c.prototype.update=function(b,I){if(b=f.toArray(b,I),this.pending?this.pending=this.pending.concat(b):this.pending=b,this.pendingTotal+=b.length,this.pending.length>=this._delta8){b=this.pending;var y=b.length%this._delta8;this.pending=b.slice(b.length-y,b.length),this.pending.length===0&&(this.pending=null),b=f.join32(b,0,b.length-y,this.endian);for(var S=0;S<b.length;S+=this._delta32)this._update(b,S,S+this._delta32)}return this},c.prototype.digest=function(b){return this.update(this._pad()),o(this.pending===null),this._digest(b)},c.prototype._pad=function(){var b=this.pendingTotal,I=this._delta8,y=I-(b+this.padLength)%I,S=new Array(y+this.padLength);S[0]=128;for(var k=1;k<y;k++)S[k]=0;if(b<<=3,this.endian==="big"){for(var N=8;N<this.padLength;N++)S[k++]=0;S[k++]=0,S[k++]=0,S[k++]=0,S[k++]=0,S[k++]=b>>>24&255,S[k++]=b>>>16&255,S[k++]=b>>>8&255,S[k++]=b&255}else for(S[k++]=b&255,S[k++]=b>>>8&255,S[k++]=b>>>16&255,S[k++]=b>>>24&255,S[k++]=0,S[k++]=0,S[k++]=0,S[k++]=0,N=8;N<this.padLength;N++)S[k++]=0;return S},Tl}var o2={},sa={},R8;function By(){if(R8)return sa;R8=1;var f=ya(),o=f.rotr32;function c(R,B,oe,Ee){if(R===0)return h(B,oe,Ee);if(R===1||R===3)return I(B,oe,Ee);if(R===2)return b(B,oe,Ee)}sa.ft_1=c;function h(R,B,oe){return R&B^~R&oe}sa.ch32=h;function b(R,B,oe){return R&B^R&oe^B&oe}sa.maj32=b;function I(R,B,oe){return R^B^oe}sa.p32=I;function y(R){return o(R,2)^o(R,13)^o(R,22)}sa.s0_256=y;function S(R){return o(R,6)^o(R,11)^o(R,25)}sa.s1_256=S;function k(R){return o(R,7)^o(R,18)^R>>>3}sa.g0_256=k;function N(R){return o(R,17)^o(R,19)^R>>>10}return sa.g1_256=N,sa}var Jl,G8;function yB(){if(G8)return Jl;G8=1;var f=ya(),o=Vf(),c=By(),h=f.rotl32,b=f.sum32,I=f.sum32_5,y=c.ft_1,S=o.BlockHash,k=[1518500249,1859775393,2400959708,3395469782];function N(){if(!(this instanceof N))return new N;S.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return f.inherits(N,S),Jl=N,N.blockSize=512,N.outSize=160,N.hmacStrength=80,N.padLength=64,N.prototype._update=function(B,oe){for(var Ee=this.W,pe=0;pe<16;pe++)Ee[pe]=B[oe+pe];for(;pe<Ee.length;pe++)Ee[pe]=h(Ee[pe-3]^Ee[pe-8]^Ee[pe-14]^Ee[pe-16],1);var V=this.h[0],Ie=this.h[1],Ce=this.h[2],_e=this.h[3],te=this.h[4];for(pe=0;pe<Ee.length;pe++){var r0=~~(pe/20),ve=I(h(V,5),y(r0,Ie,Ce,_e),te,Ee[pe],k[r0]);te=_e,_e=Ce,Ce=h(Ie,30),Ie=V,V=ve}this.h[0]=b(this.h[0],V),this.h[1]=b(this.h[1],Ie),this.h[2]=b(this.h[2],Ce),this.h[3]=b(this.h[3],_e),this.h[4]=b(this.h[4],te)},N.prototype._digest=function(B){return B==="hex"?f.toHex32(this.h,"big"):f.split32(this.h,"big")},Jl}var Ol,Y8;function wy(){if(Y8)return Ol;Y8=1;var f=ya(),o=Vf(),c=By(),h=C2(),b=f.sum32,I=f.sum32_4,y=f.sum32_5,S=c.ch32,k=c.maj32,N=c.s0_256,R=c.s1_256,B=c.g0_256,oe=c.g1_256,Ee=o.BlockHash,pe=[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 V(){if(!(this instanceof V))return new V;Ee.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=pe,this.W=new Array(64)}return f.inherits(V,Ee),Ol=V,V.blockSize=512,V.outSize=256,V.hmacStrength=192,V.padLength=64,V.prototype._update=function(Ce,_e){for(var te=this.W,r0=0;r0<16;r0++)te[r0]=Ce[_e+r0];for(;r0<te.length;r0++)te[r0]=I(oe(te[r0-2]),te[r0-7],B(te[r0-15]),te[r0-16]);var ve=this.h[0],Ne=this.h[1],ye=this.h[2],Xe=this.h[3],he=this.h[4],v0=this.h[5],He=this.h[6],q=this.h[7];for(h(this.k.length===te.length),r0=0;r0<te.length;r0++){var J=y(q,R(he),S(he,v0,He),this.k[r0],te[r0]),Q=b(N(ve),k(ve,Ne,ye));q=He,He=v0,v0=he,he=b(Xe,J),Xe=ye,ye=Ne,Ne=ve,ve=b(J,Q)}this.h[0]=b(this.h[0],ve),this.h[1]=b(this.h[1],Ne),this.h[2]=b(this.h[2],ye),this.h[3]=b(this.h[3],Xe),this.h[4]=b(this.h[4],he),this.h[5]=b(this.h[5],v0),this.h[6]=b(this.h[6],He),this.h[7]=b(this.h[7],q)},V.prototype._digest=function(Ce){return Ce==="hex"?f.toHex32(this.h,"big"):f.split32(this.h,"big")},Ol}var zl,L8;function CB(){if(L8)return zl;L8=1;var f=ya(),o=wy();function c(){if(!(this instanceof c))return new c;o.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return f.inherits(c,o),zl=c,c.blockSize=512,c.outSize=224,c.hmacStrength=192,c.padLength=64,c.prototype._digest=function(b){return b==="hex"?f.toHex32(this.h.slice(0,7),"big"):f.split32(this.h.slice(0,7),"big")},zl}var ql,T8;function my(){if(T8)return ql;T8=1;var f=ya(),o=Vf(),c=C2(),h=f.rotr64_hi,b=f.rotr64_lo,I=f.shr64_hi,y=f.shr64_lo,S=f.sum64,k=f.sum64_hi,N=f.sum64_lo,R=f.sum64_4_hi,B=f.sum64_4_lo,oe=f.sum64_5_hi,Ee=f.sum64_5_lo,pe=o.BlockHash,V=[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 Ie(){if(!(this instanceof Ie))return new Ie;pe.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=V,this.W=new Array(160)}f.inherits(Ie,pe),ql=Ie,Ie.blockSize=1024,Ie.outSize=512,Ie.hmacStrength=192,Ie.padLength=128,Ie.prototype._prepareBlock=function(Q,L){for(var W=this.W,Ae=0;Ae<32;Ae++)W[Ae]=Q[L+Ae];for(;Ae<W.length;Ae+=2){var ie=He(W[Ae-4],W[Ae-3]),fe=q(W[Ae-4],W[Ae-3]),z=W[Ae-14],G=W[Ae-13],T=he(W[Ae-30],W[Ae-29]),Be=v0(W[Ae-30],W[Ae-29]),Te=W[Ae-32],se=W[Ae-31];W[Ae]=R(ie,fe,z,G,T,Be,Te,se),W[Ae+1]=B(ie,fe,z,G,T,Be,Te,se)}},Ie.prototype._update=function(Q,L){this._prepareBlock(Q,L);var W=this.W,Ae=this.h[0],ie=this.h[1],fe=this.h[2],z=this.h[3],G=this.h[4],T=this.h[5],Be=this.h[6],Te=this.h[7],se=this.h[8],ze=this.h[9],s0=this.h[10],l0=this.h[11],p0=this.h[12],G0=this.h[13],X0=this.h[14],Y0=this.h[15];c(this.k.length===W.length);for(var Ze=0;Ze<W.length;Ze+=2){var ot=X0,Pe=Y0,e0=ye(se,ze),o0=Xe(se,ze),ne=Ce(se,ze,s0,l0,p0),B0=_e(se,ze,s0,l0,p0,G0),K0=this.k[Ze],N0=this.k[Ze+1],st=W[Ze],Z0=W[Ze+1],W0=oe(ot,Pe,e0,o0,ne,B0,K0,N0,st,Z0),vt=Ee(ot,Pe,e0,o0,ne,B0,K0,N0,st,Z0);ot=ve(Ae,ie),Pe=Ne(Ae,ie),e0=te(Ae,ie,fe,z,G),o0=r0(Ae,ie,fe,z,G,T);var er=k(ot,Pe,e0,o0),Yt=N(ot,Pe,e0,o0);X0=p0,Y0=G0,p0=s0,G0=l0,s0=se,l0=ze,se=k(Be,Te,W0,vt),ze=N(Te,Te,W0,vt),Be=G,Te=T,G=fe,T=z,fe=Ae,z=ie,Ae=k(W0,vt,er,Yt),ie=N(W0,vt,er,Yt)}S(this.h,0,Ae,ie),S(this.h,2,fe,z),S(this.h,4,G,T),S(this.h,6,Be,Te),S(this.h,8,se,ze),S(this.h,10,s0,l0),S(this.h,12,p0,G0),S(this.h,14,X0,Y0)},Ie.prototype._digest=function(Q){return Q==="hex"?f.toHex32(this.h,"big"):f.split32(this.h,"big")};function Ce(J,Q,L,W,Ae){var ie=J&L^~J&Ae;return ie<0&&(ie+=4294967296),ie}function _e(J,Q,L,W,Ae,ie){var fe=Q&W^~Q&ie;return fe<0&&(fe+=4294967296),fe}function te(J,Q,L,W,Ae){var ie=J&L^J&Ae^L&Ae;return ie<0&&(ie+=4294967296),ie}function r0(J,Q,L,W,Ae,ie){var fe=Q&W^Q&ie^W&ie;return fe<0&&(fe+=4294967296),fe}function ve(J,Q){var L=h(J,Q,28),W=h(Q,J,2),Ae=h(Q,J,7),ie=L^W^Ae;return ie<0&&(ie+=4294967296),ie}function Ne(J,Q){var L=b(J,Q,28),W=b(Q,J,2),Ae=b(Q,J,7),ie=L^W^Ae;return ie<0&&(ie+=4294967296),ie}function ye(J,Q){var L=h(J,Q,14),W=h(J,Q,18),Ae=h(Q,J,9),ie=L^W^Ae;return ie<0&&(ie+=4294967296),ie}function Xe(J,Q){var L=b(J,Q,14),W=b(J,Q,18),Ae=b(Q,J,9),ie=L^W^Ae;return ie<0&&(ie+=4294967296),ie}function he(J,Q){var L=h(J,Q,1),W=h(J,Q,8),Ae=I(J,Q,7),ie=L^W^Ae;return ie<0&&(ie+=4294967296),ie}function v0(J,Q){var L=b(J,Q,1),W=b(J,Q,8),Ae=y(J,Q,7),ie=L^W^Ae;return ie<0&&(ie+=4294967296),ie}function He(J,Q){var L=h(J,Q,19),W=h(Q,J,29),Ae=I(J,Q,6),ie=L^W^Ae;return ie<0&&(ie+=4294967296),ie}function q(J,Q){var L=b(J,Q,19),W=b(Q,J,29),Ae=y(J,Q,6),ie=L^W^Ae;return ie<0&&(ie+=4294967296),ie}return ql}var jl,J8;function IB(){if(J8)return jl;J8=1;var f=ya(),o=my();function c(){if(!(this instanceof c))return new c;o.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return f.inherits(c,o),jl=c,c.blockSize=1024,c.outSize=384,c.hmacStrength=192,c.padLength=128,c.prototype._digest=function(b){return b==="hex"?f.toHex32(this.h.slice(0,12),"big"):f.split32(this.h.slice(0,12),"big")},jl}var O8;function bB(){return O8||(O8=1,o2.sha1=yB(),o2.sha224=CB(),o2.sha256=wy(),o2.sha384=IB(),o2.sha512=my()),o2}var Vl={},z8;function vB(){if(z8)return Vl;z8=1;var f=ya(),o=Vf(),c=f.rotl32,h=f.sum32,b=f.sum32_3,I=f.sum32_4,y=o.BlockHash;function S(){if(!(this instanceof S))return new S;y.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}f.inherits(S,y),Vl.ripemd160=S,S.blockSize=512,S.outSize=160,S.hmacStrength=192,S.padLength=64,S.prototype._update=function(Ie,Ce){for(var _e=this.h[0],te=this.h[1],r0=this.h[2],ve=this.h[3],Ne=this.h[4],ye=_e,Xe=te,he=r0,v0=ve,He=Ne,q=0;q<80;q++){var J=h(c(I(_e,k(q,te,r0,ve),Ie[B[q]+Ce],N(q)),Ee[q]),Ne);_e=Ne,Ne=ve,ve=c(r0,10),r0=te,te=J,J=h(c(I(ye,k(79-q,Xe,he,v0),Ie[oe[q]+Ce],R(q)),pe[q]),He),ye=He,He=v0,v0=c(he,10),he=Xe,Xe=J}J=b(this.h[1],r0,v0),this.h[1]=b(this.h[2],ve,He),this.h[2]=b(this.h[3],Ne,ye),this.h[3]=b(this.h[4],_e,Xe),this.h[4]=b(this.h[0],te,he),this.h[0]=J},S.prototype._digest=function(Ie){return Ie==="hex"?f.toHex32(this.h,"little"):f.split32(this.h,"little")};function k(V,Ie,Ce,_e){return V<=15?Ie^Ce^_e:V<=31?Ie&Ce|~Ie&_e:V<=47?(Ie|~Ce)^_e:V<=63?Ie&_e|Ce&~_e:Ie^(Ce|~_e)}function N(V){return V<=15?0:V<=31?1518500249:V<=47?1859775393:V<=63?2400959708:2840853838}function R(V){return V<=15?1352829926:V<=31?1548603684:V<=47?1836072691:V<=63?2053994217:0}var B=[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],oe=[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],Ee=[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],pe=[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];return Vl}var Xl,q8;function xB(){if(q8)return Xl;q8=1;var f=ya(),o=C2();function c(h,b,I){if(!(this instanceof c))return new c(h,b,I);this.Hash=h,this.blockSize=h.blockSize/8,this.outSize=h.outSize/8,this.inner=null,this.outer=null,this._init(f.toArray(b,I))}return Xl=c,c.prototype._init=function(b){b.length>this.blockSize&&(b=new this.Hash().update(b).digest()),o(b.length<=this.blockSize);for(var I=b.length;I<this.blockSize;I++)b.push(0);for(I=0;I<b.length;I++)b[I]^=54;for(this.inner=new this.Hash().update(b),I=0;I<b.length;I++)b[I]^=106;this.outer=new this.Hash().update(b)},c.prototype.update=function(b,I){return this.inner.update(b,I),this},c.prototype.digest=function(b){return this.outer.update(this.inner.digest()),this.outer.digest(b)},Xl}var j8;function $1(){return j8||(j8=1,function(f){var o=f;o.utils=ya(),o.common=Vf(),o.sha=bB(),o.ripemd=vB(),o.hmac=xB(),o.sha1=o.sha.sha1,o.sha256=o.sha.sha256,o.sha224=o.sha.sha224,o.sha384=o.sha.sha384,o.sha512=o.sha.sha512,o.ripemd160=o.ripemd.ripemd160}(Yl)),Yl}var EB=$1();const ZA=Ji(EB);var wf;(function(f){f.sha256="sha256",f.sha512="sha512"})(wf||(wf={}));const _B="sha2/5.8.0",BB=new zt(_B);function wB(f){return"0x"+ZA.ripemd160().update(Nt(f)).digest("hex")}function mf(f){return"0x"+ZA.sha256().update(Nt(f)).digest("hex")}function E1(f,o,c){return wf[f]||BB.throwError("unsupported algorithm "+f,zt.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:f}),"0x"+ZA.hmac(ZA[f],Nt(o)).update(Nt(c)).digest("hex")}function ng(f,o,c,h,b){f=Nt(f),o=Nt(o);let I,y=1;const S=new Uint8Array(h),k=new Uint8Array(o.length+4);k.set(o);let N,R;for(let B=1;B<=y;B++){k[o.length]=B>>24&255,k[o.length+1]=B>>16&255,k[o.length+2]=B>>8&255,k[o.length+3]=B&255;let oe=Nt(E1(b,f,k));I||(I=oe.length,R=new Uint8Array(I),y=Math.ceil(h/I),N=h-(y-1)*I),R.set(oe);for(let V=1;V<c;V++){oe=Nt(E1(b,f,oe));for(let Ie=0;Ie<I;Ie++)R[Ie]^=oe[Ie]}const Ee=(B-1)*I,pe=B===y?N:I;S.set(Nt(R).slice(0,pe),Ee)}return or(S)}function Fs(f,o,c){return c={path:o,exports:{},require:function(h,b){return mB(h,b??c.path)}},f(c,c.exports),c.exports}function mB(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Ag=Qy;function Qy(f,o){if(!f)throw new Error(o||"Assertion failed")}Qy.equal=function(o,c,h){if(o!=c)throw new Error(h||"Assertion failed: "+o+" != "+c)};var Gi=Fs(function(f,o){var c=o;function h(y,S){if(Array.isArray(y))return y.slice();if(!y)return[];var k=[];if(typeof y!="string"){for(var N=0;N<y.length;N++)k[N]=y[N]|0;return k}if(S==="hex"){y=y.replace(/[^a-z0-9]+/ig,""),y.length%2!==0&&(y="0"+y);for(var N=0;N<y.length;N+=2)k.push(parseInt(y[N]+y[N+1],16))}else for(var N=0;N<y.length;N++){var R=y.charCodeAt(N),B=R>>8,oe=R&255;B?k.push(B,oe):k.push(oe)}return k}c.toArray=h;function b(y){return y.length===1?"0"+y:y}c.zero2=b;function I(y){for(var S="",k=0;k<y.length;k++)S+=b(y[k].toString(16));return S}c.toHex=I,c.encode=function(S,k){return k==="hex"?I(S):S}}),Ai=Fs(function(f,o){var c=o;c.assert=Ag,c.toArray=Gi.toArray,c.zero2=Gi.zero2,c.toHex=Gi.toHex,c.encode=Gi.encode;function h(k,N,R){var B=new Array(Math.max(k.bitLength(),R)+1),oe;for(oe=0;oe<B.length;oe+=1)B[oe]=0;var Ee=1<<N+1,pe=k.clone();for(oe=0;oe<B.length;oe++){var V,Ie=pe.andln(Ee-1);pe.isOdd()?(Ie>(Ee>>1)-1?V=(Ee>>1)-Ie:V=Ie,pe.isubn(V)):V=0,B[oe]=V,pe.iushrn(1)}return B}c.getNAF=h;function b(k,N){var R=[[],[]];k=k.clone(),N=N.clone();for(var B=0,oe=0,Ee;k.cmpn(-B)>0||N.cmpn(-oe)>0;){var pe=k.andln(3)+B&3,V=N.andln(3)+oe&3;pe===3&&(pe=-1),V===3&&(V=-1);var Ie;(pe&1)===0?Ie=0:(Ee=k.andln(7)+B&7,(Ee===3||Ee===5)&&V===2?Ie=-pe:Ie=pe),R[0].push(Ie);var Ce;(V&1)===0?Ce=0:(Ee=N.andln(7)+oe&7,(Ee===3||Ee===5)&&pe===2?Ce=-V:Ce=V),R[1].push(Ce),2*B===Ie+1&&(B=1-B),2*oe===Ce+1&&(oe=1-oe),k.iushrn(1),N.iushrn(1)}return R}c.getJSF=b;function I(k,N,R){var B="_"+N;k.prototype[N]=function(){return this[B]!==void 0?this[B]:this[B]=R.call(this)}}c.cachedProperty=I;function y(k){return typeof k=="string"?c.toArray(k,"hex"):k}c.parseBytes=y;function S(k){return new ir(k,"hex","le")}c.intFromLE=S}),_1=Ai.getNAF,QB=Ai.getJSF,B1=Ai.assert;function Ho(f,o){this.type=f,this.p=new ir(o.p,16),this.red=o.prime?ir.red(o.prime):ir.mont(this.p),this.zero=new ir(0).toRed(this.red),this.one=new ir(1).toRed(this.red),this.two=new ir(2).toRed(this.red),this.n=o.n&&new ir(o.n,16),this.g=o.g&&this.pointFromJSON(o.g,o.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 c=this.n&&this.p.div(this.n);!c||c.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var I2=Ho;Ho.prototype.point=function(){throw new Error("Not implemented")};Ho.prototype.validate=function(){throw new Error("Not implemented")};Ho.prototype._fixedNafMul=function(o,c){B1(o.precomputed);var h=o._getDoubles(),b=_1(c,1,this._bitLength),I=(1<<h.step+1)-(h.step%2===0?2:1);I/=3;var y=[],S,k;for(S=0;S<b.length;S+=h.step){k=0;for(var N=S+h.step-1;N>=S;N--)k=(k<<1)+b[N];y.push(k)}for(var R=this.jpoint(null,null,null),B=this.jpoint(null,null,null),oe=I;oe>0;oe--){for(S=0;S<y.length;S++)k=y[S],k===oe?B=B.mixedAdd(h.points[S]):k===-oe&&(B=B.mixedAdd(h.points[S].neg()));R=R.add(B)}return R.toP()};Ho.prototype._wnafMul=function(o,c){var h=4,b=o._getNAFPoints(h);h=b.wnd;for(var I=b.points,y=_1(c,h,this._bitLength),S=this.jpoint(null,null,null),k=y.length-1;k>=0;k--){for(var N=0;k>=0&&y[k]===0;k--)N++;if(k>=0&&N++,S=S.dblp(N),k<0)break;var R=y[k];B1(R!==0),o.type==="affine"?R>0?S=S.mixedAdd(I[R-1>>1]):S=S.mixedAdd(I[-R-1>>1].neg()):R>0?S=S.add(I[R-1>>1]):S=S.add(I[-R-1>>1].neg())}return o.type==="affine"?S.toP():S};Ho.prototype._wnafMulAdd=function(o,c,h,b,I){var y=this._wnafT1,S=this._wnafT2,k=this._wnafT3,N=0,R,B,oe;for(R=0;R<b;R++){oe=c[R];var Ee=oe._getNAFPoints(o);y[R]=Ee.wnd,S[R]=Ee.points}for(R=b-1;R>=1;R-=2){var pe=R-1,V=R;if(y[pe]!==1||y[V]!==1){k[pe]=_1(h[pe],y[pe],this._bitLength),k[V]=_1(h[V],y[V],this._bitLength),N=Math.max(k[pe].length,N),N=Math.max(k[V].length,N);continue}var Ie=[c[pe],null,null,c[V]];c[pe].y.cmp(c[V].y)===0?(Ie[1]=c[pe].add(c[V]),Ie[2]=c[pe].toJ().mixedAdd(c[V].neg())):c[pe].y.cmp(c[V].y.redNeg())===0?(Ie[1]=c[pe].toJ().mixedAdd(c[V]),Ie[2]=c[pe].add(c[V].neg())):(Ie[1]=c[pe].toJ().mixedAdd(c[V]),Ie[2]=c[pe].toJ().mixedAdd(c[V].neg()));var Ce=[-3,-1,-5,-7,0,7,5,1,3],_e=QB(h[pe],h[V]);for(N=Math.max(_e[0].length,N),k[pe]=new Array(N),k[V]=new Array(N),B=0;B<N;B++){var te=_e[0][B]|0,r0=_e[1][B]|0;k[pe][B]=Ce[(te+1)*3+(r0+1)],k[V][B]=0,S[pe]=Ie}}var ve=this.jpoint(null,null,null),Ne=this._wnafT4;for(R=N;R>=0;R--){for(var ye=0;R>=0;){var Xe=!0;for(B=0;B<b;B++)Ne[B]=k[B][R]|0,Ne[B]!==0&&(Xe=!1);if(!Xe)break;ye++,R--}if(R>=0&&ye++,ve=ve.dblp(ye),R<0)break;for(B=0;B<b;B++){var he=Ne[B];he!==0&&(he>0?oe=S[B][he-1>>1]:he<0&&(oe=S[B][-he-1>>1].neg()),oe.type==="affine"?ve=ve.mixedAdd(oe):ve=ve.add(oe))}}for(R=0;R<b;R++)S[R]=null;return I?ve:ve.toP()};function vi(f,o){this.curve=f,this.type=o,this.precomputed=null}Ho.BasePoint=vi;vi.prototype.eq=function(){throw new Error("Not implemented")};vi.prototype.validate=function(){return this.curve.validate(this)};Ho.prototype.decodePoint=function(o,c){o=Ai.toArray(o,c);var h=this.p.byteLength();if((o[0]===4||o[0]===6||o[0]===7)&&o.length-1===2*h){o[0]===6?B1(o[o.length-1]%2===0):o[0]===7&&B1(o[o.length-1]%2===1);var b=this.point(o.slice(1,1+h),o.slice(1+h,1+2*h));return b}else if((o[0]===2||o[0]===3)&&o.length-1===h)return this.pointFromX(o.slice(1,1+h),o[0]===3);throw new Error("Unknown point format")};vi.prototype.encodeCompressed=function(o){return this.encode(o,!0)};vi.prototype._encode=function(o){var c=this.curve.p.byteLength(),h=this.getX().toArray("be",c);return o?[this.getY().isEven()?2:3].concat(h):[4].concat(h,this.getY().toArray("be",c))};vi.prototype.encode=function(o,c){return Ai.encode(this._encode(c),o)};vi.prototype.precompute=function(o){if(this.precomputed)return this;var c={doubles:null,naf:null,beta:null};return c.naf=this._getNAFPoints(8),c.doubles=this._getDoubles(4,o),c.beta=this._getBeta(),this.precomputed=c,this};vi.prototype._hasDoubles=function(o){if(!this.precomputed)return!1;var c=this.precomputed.doubles;return c?c.points.length>=Math.ceil((o.bitLength()+1)/c.step):!1};vi.prototype._getDoubles=function(o,c){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var h=[this],b=this,I=0;I<c;I+=o){for(var y=0;y<o;y++)b=b.dbl();h.push(b)}return{step:o,points:h}};vi.prototype._getNAFPoints=function(o){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var c=[this],h=(1<<o)-1,b=h===1?null:this.dbl(),I=1;I<h;I++)c[I]=c[I-1].add(b);return{wnd:o,points:c}};vi.prototype._getBeta=function(){return null};vi.prototype.dblp=function(o){for(var c=this,h=0;h<o;h++)c=c.dbl();return c};var ig=Fs(function(f){typeof Object.create=="function"?f.exports=function(c,h){h&&(c.super_=h,c.prototype=Object.create(h.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}))}:f.exports=function(c,h){if(h){c.super_=h;var b=function(){};b.prototype=h.prototype,c.prototype=new b,c.prototype.constructor=c}}}),SB=Ai.assert;function xi(f){I2.call(this,"short",f),this.a=new ir(f.a,16).toRed(this.red),this.b=new ir(f.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(f),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}ig(xi,I2);var DB=xi;xi.prototype._getEndomorphism=function(o){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var c,h;if(o.beta)c=new ir(o.beta,16).toRed(this.red);else{var b=this._getEndoRoots(this.p);c=b[0].cmp(b[1])<0?b[0]:b[1],c=c.toRed(this.red)}if(o.lambda)h=new ir(o.lambda,16);else{var I=this._getEndoRoots(this.n);this.g.mul(I[0]).x.cmp(this.g.x.redMul(c))===0?h=I[0]:(h=I[1],SB(this.g.mul(h).x.cmp(this.g.x.redMul(c))===0))}var y;return o.basis?y=o.basis.map(function(S){return{a:new ir(S.a,16),b:new ir(S.b,16)}}):y=this._getEndoBasis(h),{beta:c,lambda:h,basis:y}}};xi.prototype._getEndoRoots=function(o){var c=o===this.p?this.red:ir.mont(o),h=new ir(2).toRed(c).redInvm(),b=h.redNeg(),I=new ir(3).toRed(c).redNeg().redSqrt().redMul(h),y=b.redAdd(I).fromRed(),S=b.redSub(I).fromRed();return[y,S]};xi.prototype._getEndoBasis=function(o){for(var c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=o,b=this.n.clone(),I=new ir(1),y=new ir(0),S=new ir(0),k=new ir(1),N,R,B,oe,Ee,pe,V,Ie=0,Ce,_e;h.cmpn(0)!==0;){var te=b.div(h);Ce=b.sub(te.mul(h)),_e=S.sub(te.mul(I));var r0=k.sub(te.mul(y));if(!B&&Ce.cmp(c)<0)N=V.neg(),R=I,B=Ce.neg(),oe=_e;else if(B&&++Ie===2)break;V=Ce,b=h,h=Ce,S=I,I=_e,k=y,y=r0}Ee=Ce.neg(),pe=_e;var ve=B.sqr().add(oe.sqr()),Ne=Ee.sqr().add(pe.sqr());return Ne.cmp(ve)>=0&&(Ee=N,pe=R),B.negative&&(B=B.neg(),oe=oe.neg()),Ee.negative&&(Ee=Ee.neg(),pe=pe.neg()),[{a:B,b:oe},{a:Ee,b:pe}]};xi.prototype._endoSplit=function(o){var c=this.endo.basis,h=c[0],b=c[1],I=b.b.mul(o).divRound(this.n),y=h.b.neg().mul(o).divRound(this.n),S=I.mul(h.a),k=y.mul(b.a),N=I.mul(h.b),R=y.mul(b.b),B=o.sub(S).sub(k),oe=N.add(R).neg();return{k1:B,k2:oe}};xi.prototype.pointFromX=function(o,c){o=new ir(o,16),o.red||(o=o.toRed(this.red));var h=o.redSqr().redMul(o).redIAdd(o.redMul(this.a)).redIAdd(this.b),b=h.redSqrt();if(b.redSqr().redSub(h).cmp(this.zero)!==0)throw new Error("invalid point");var I=b.fromRed().isOdd();return(c&&!I||!c&&I)&&(b=b.redNeg()),this.point(o,b)};xi.prototype.validate=function(o){if(o.inf)return!0;var c=o.x,h=o.y,b=this.a.redMul(c),I=c.redSqr().redMul(c).redIAdd(b).redIAdd(this.b);return h.redSqr().redISub(I).cmpn(0)===0};xi.prototype._endoWnafMulAdd=function(o,c,h){for(var b=this._endoWnafT1,I=this._endoWnafT2,y=0;y<o.length;y++){var S=this._endoSplit(c[y]),k=o[y],N=k._getBeta();S.k1.negative&&(S.k1.ineg(),k=k.neg(!0)),S.k2.negative&&(S.k2.ineg(),N=N.neg(!0)),b[y*2]=k,b[y*2+1]=N,I[y*2]=S.k1,I[y*2+1]=S.k2}for(var R=this._wnafMulAdd(1,b,I,y*2,h),B=0;B<y*2;B++)b[B]=null,I[B]=null;return R};function qn(f,o,c,h){I2.BasePoint.call(this,f,"affine"),o===null&&c===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new ir(o,16),this.y=new ir(c,16),h&&(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)}ig(qn,I2.BasePoint);xi.prototype.point=function(o,c,h){return new qn(this,o,c,h)};xi.prototype.pointFromJSON=function(o,c){return qn.fromJSON(this,o,c)};qn.prototype._getBeta=function(){if(this.curve.endo){var o=this.precomputed;if(o&&o.beta)return o.beta;var c=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(o){var h=this.curve,b=function(I){return h.point(I.x.redMul(h.endo.beta),I.y)};o.beta=c,c.precomputed={beta:null,naf:o.naf&&{wnd:o.naf.wnd,points:o.naf.points.map(b)},doubles:o.doubles&&{step:o.doubles.step,points:o.doubles.points.map(b)}}}return c}};qn.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]};qn.fromJSON=function(o,c,h){typeof c=="string"&&(c=JSON.parse(c));var b=o.point(c[0],c[1],h);if(!c[2])return b;function I(S){return o.point(S[0],S[1],h)}var y=c[2];return b.precomputed={beta:null,doubles:y.doubles&&{step:y.doubles.step,points:[b].concat(y.doubles.points.map(I))},naf:y.naf&&{wnd:y.naf.wnd,points:[b].concat(y.naf.points.map(I))}},b};qn.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)+">"};qn.prototype.isInfinity=function(){return this.inf};qn.prototype.add=function(o){if(this.inf)return o;if(o.inf)return this;if(this.eq(o))return this.dbl();if(this.neg().eq(o))return this.curve.point(null,null);if(this.x.cmp(o.x)===0)return this.curve.point(null,null);var c=this.y.redSub(o.y);c.cmpn(0)!==0&&(c=c.redMul(this.x.redSub(o.x).redInvm()));var h=c.redSqr().redISub(this.x).redISub(o.x),b=c.redMul(this.x.redSub(h)).redISub(this.y);return this.curve.point(h,b)};qn.prototype.dbl=function(){if(this.inf)return this;var o=this.y.redAdd(this.y);if(o.cmpn(0)===0)return this.curve.point(null,null);var c=this.curve.a,h=this.x.redSqr(),b=o.redInvm(),I=h.redAdd(h).redIAdd(h).redIAdd(c).redMul(b),y=I.redSqr().redISub(this.x.redAdd(this.x)),S=I.redMul(this.x.redSub(y)).redISub(this.y);return this.curve.point(y,S)};qn.prototype.getX=function(){return this.x.fromRed()};qn.prototype.getY=function(){return this.y.fromRed()};qn.prototype.mul=function(o){return o=new ir(o,16),this.isInfinity()?this:this._hasDoubles(o)?this.curve._fixedNafMul(this,o):this.curve.endo?this.curve._endoWnafMulAdd([this],[o]):this.curve._wnafMul(this,o)};qn.prototype.mulAdd=function(o,c,h){var b=[this,c],I=[o,h];return this.curve.endo?this.curve._endoWnafMulAdd(b,I):this.curve._wnafMulAdd(1,b,I,2)};qn.prototype.jmulAdd=function(o,c,h){var b=[this,c],I=[o,h];return this.curve.endo?this.curve._endoWnafMulAdd(b,I,!0):this.curve._wnafMulAdd(1,b,I,2,!0)};qn.prototype.eq=function(o){return this===o||this.inf===o.inf&&(this.inf||this.x.cmp(o.x)===0&&this.y.cmp(o.y)===0)};qn.prototype.neg=function(o){if(this.inf)return this;var c=this.curve.point(this.x,this.y.redNeg());if(o&&this.precomputed){var h=this.precomputed,b=function(I){return I.neg()};c.precomputed={naf:h.naf&&{wnd:h.naf.wnd,points:h.naf.points.map(b)},doubles:h.doubles&&{step:h.doubles.step,points:h.doubles.points.map(b)}}}return c};qn.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var o=this.curve.jpoint(this.x,this.y,this.curve.one);return o};function tA(f,o,c,h){I2.BasePoint.call(this,f,"jacobian"),o===null&&c===null&&h===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ir(0)):(this.x=new ir(o,16),this.y=new ir(c,16),this.z=new ir(h,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}ig(tA,I2.BasePoint);xi.prototype.jpoint=function(o,c,h){return new tA(this,o,c,h)};tA.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var o=this.z.redInvm(),c=o.redSqr(),h=this.x.redMul(c),b=this.y.redMul(c).redMul(o);return this.curve.point(h,b)};tA.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};tA.prototype.add=function(o){if(this.isInfinity())return o;if(o.isInfinity())return this;var c=o.z.redSqr(),h=this.z.redSqr(),b=this.x.redMul(c),I=o.x.redMul(h),y=this.y.redMul(c.redMul(o.z)),S=o.y.redMul(h.redMul(this.z)),k=b.redSub(I),N=y.redSub(S);if(k.cmpn(0)===0)return N.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var R=k.redSqr(),B=R.redMul(k),oe=b.redMul(R),Ee=N.redSqr().redIAdd(B).redISub(oe).redISub(oe),pe=N.redMul(oe.redISub(Ee)).redISub(y.redMul(B)),V=this.z.redMul(o.z).redMul(k);return this.curve.jpoint(Ee,pe,V)};tA.prototype.mixedAdd=function(o){if(this.isInfinity())return o.toJ();if(o.isInfinity())return this;var c=this.z.redSqr(),h=this.x,b=o.x.redMul(c),I=this.y,y=o.y.redMul(c).redMul(this.z),S=h.redSub(b),k=I.redSub(y);if(S.cmpn(0)===0)return k.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var N=S.redSqr(),R=N.redMul(S),B=h.redMul(N),oe=k.redSqr().redIAdd(R).redISub(B).redISub(B),Ee=k.redMul(B.redISub(oe)).redISub(I.redMul(R)),pe=this.z.redMul(S);return this.curve.jpoint(oe,Ee,pe)};tA.prototype.dblp=function(o){if(o===0)return this;if(this.isInfinity())return this;if(!o)return this.dbl();var c;if(this.curve.zeroA||this.curve.threeA){var h=this;for(c=0;c<o;c++)h=h.dbl();return h}var b=this.curve.a,I=this.curve.tinv,y=this.x,S=this.y,k=this.z,N=k.redSqr().redSqr(),R=S.redAdd(S);for(c=0;c<o;c++){var B=y.redSqr(),oe=R.redSqr(),Ee=oe.redSqr(),pe=B.redAdd(B).redIAdd(B).redIAdd(b.redMul(N)),V=y.redMul(oe),Ie=pe.redSqr().redISub(V.redAdd(V)),Ce=V.redISub(Ie),_e=pe.redMul(Ce);_e=_e.redIAdd(_e).redISub(Ee);var te=R.redMul(k);c+1<o&&(N=N.redMul(Ee)),y=Ie,k=te,R=_e}return this.curve.jpoint(y,R.redMul(I),k)};tA.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};tA.prototype._zeroDbl=function(){var o,c,h;if(this.zOne){var b=this.x.redSqr(),I=this.y.redSqr(),y=I.redSqr(),S=this.x.redAdd(I).redSqr().redISub(b).redISub(y);S=S.redIAdd(S);var k=b.redAdd(b).redIAdd(b),N=k.redSqr().redISub(S).redISub(S),R=y.redIAdd(y);R=R.redIAdd(R),R=R.redIAdd(R),o=N,c=k.redMul(S.redISub(N)).redISub(R),h=this.y.redAdd(this.y)}else{var B=this.x.redSqr(),oe=this.y.redSqr(),Ee=oe.redSqr(),pe=this.x.redAdd(oe).redSqr().redISub(B).redISub(Ee);pe=pe.redIAdd(pe);var V=B.redAdd(B).redIAdd(B),Ie=V.redSqr(),Ce=Ee.redIAdd(Ee);Ce=Ce.redIAdd(Ce),Ce=Ce.redIAdd(Ce),o=Ie.redISub(pe).redISub(pe),c=V.redMul(pe.redISub(o)).redISub(Ce),h=this.y.redMul(this.z),h=h.redIAdd(h)}return this.curve.jpoint(o,c,h)};tA.prototype._threeDbl=function(){var o,c,h;if(this.zOne){var b=this.x.redSqr(),I=this.y.redSqr(),y=I.redSqr(),S=this.x.redAdd(I).redSqr().redISub(b).redISub(y);S=S.redIAdd(S);var k=b.redAdd(b).redIAdd(b).redIAdd(this.curve.a),N=k.redSqr().redISub(S).redISub(S);o=N;var R=y.redIAdd(y);R=R.redIAdd(R),R=R.redIAdd(R),c=k.redMul(S.redISub(N)).redISub(R),h=this.y.redAdd(this.y)}else{var B=this.z.redSqr(),oe=this.y.redSqr(),Ee=this.x.redMul(oe),pe=this.x.redSub(B).redMul(this.x.redAdd(B));pe=pe.redAdd(pe).redIAdd(pe);var V=Ee.redIAdd(Ee);V=V.redIAdd(V);var Ie=V.redAdd(V);o=pe.redSqr().redISub(Ie),h=this.y.redAdd(this.z).redSqr().redISub(oe).redISub(B);var Ce=oe.redSqr();Ce=Ce.redIAdd(Ce),Ce=Ce.redIAdd(Ce),Ce=Ce.redIAdd(Ce),c=pe.redMul(V.redISub(o)).redISub(Ce)}return this.curve.jpoint(o,c,h)};tA.prototype._dbl=function(){var o=this.curve.a,c=this.x,h=this.y,b=this.z,I=b.redSqr().redSqr(),y=c.redSqr(),S=h.redSqr(),k=y.redAdd(y).redIAdd(y).redIAdd(o.redMul(I)),N=c.redAdd(c);N=N.redIAdd(N);var R=N.redMul(S),B=k.redSqr().redISub(R.redAdd(R)),oe=R.redISub(B),Ee=S.redSqr();Ee=Ee.redIAdd(Ee),Ee=Ee.redIAdd(Ee),Ee=Ee.redIAdd(Ee);var pe=k.redMul(oe).redISub(Ee),V=h.redAdd(h).redMul(b);return this.curve.jpoint(B,pe,V)};tA.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var o=this.x.redSqr(),c=this.y.redSqr(),h=this.z.redSqr(),b=c.redSqr(),I=o.redAdd(o).redIAdd(o),y=I.redSqr(),S=this.x.redAdd(c).redSqr().redISub(o).redISub(b);S=S.redIAdd(S),S=S.redAdd(S).redIAdd(S),S=S.redISub(y);var k=S.redSqr(),N=b.redIAdd(b);N=N.redIAdd(N),N=N.redIAdd(N),N=N.redIAdd(N);var R=I.redIAdd(S).redSqr().redISub(y).redISub(k).redISub(N),B=c.redMul(R);B=B.redIAdd(B),B=B.redIAdd(B);var oe=this.x.redMul(k).redISub(B);oe=oe.redIAdd(oe),oe=oe.redIAdd(oe);var Ee=this.y.redMul(R.redMul(N.redISub(R)).redISub(S.redMul(k)));Ee=Ee.redIAdd(Ee),Ee=Ee.redIAdd(Ee),Ee=Ee.redIAdd(Ee);var pe=this.z.redAdd(S).redSqr().redISub(h).redISub(k);return this.curve.jpoint(oe,Ee,pe)};tA.prototype.mul=function(o,c){return o=new ir(o,c),this.curve._wnafMul(this,o)};tA.prototype.eq=function(o){if(o.type==="affine")return this.eq(o.toJ());if(this===o)return!0;var c=this.z.redSqr(),h=o.z.redSqr();if(this.x.redMul(h).redISub(o.x.redMul(c)).cmpn(0)!==0)return!1;var b=c.redMul(this.z),I=h.redMul(o.z);return this.y.redMul(I).redISub(o.y.redMul(b)).cmpn(0)===0};tA.prototype.eqXToP=function(o){var c=this.z.redSqr(),h=o.toRed(this.curve.red).redMul(c);if(this.x.cmp(h)===0)return!0;for(var b=o.clone(),I=this.curve.redN.redMul(c);;){if(b.iadd(this.curve.n),b.cmp(this.curve.p)>=0)return!1;if(h.redIAdd(I),this.x.cmp(h)===0)return!0}};tA.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)+">"};tA.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var $c=Fs(function(f,o){var c=o;c.base=I2,c.short=DB,c.mont=null,c.edwards=null}),e1=Fs(function(f,o){var c=o,h=Ai.assert;function b(S){S.type==="short"?this.curve=new $c.short(S):S.type==="edwards"?this.curve=new $c.edwards(S):this.curve=new $c.mont(S),this.g=this.curve.g,this.n=this.curve.n,this.hash=S.hash,h(this.g.validate(),"Invalid curve"),h(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}c.PresetCurve=b;function I(S,k){Object.defineProperty(c,S,{configurable:!0,enumerable:!0,get:function(){var N=new b(k);return Object.defineProperty(c,S,{configurable:!0,enumerable:!0,value:N}),N}})}I("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:ZA.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),I("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:ZA.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),I("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:ZA.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),I("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:ZA.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"]}),I("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:ZA.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"]}),I("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ZA.sha256,gRed:!1,g:["9"]}),I("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:ZA.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var y;try{y=null.crash()}catch{y=void 0}I("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:ZA.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",y]})});function Fo(f){if(!(this instanceof Fo))return new Fo(f);this.hash=f.hash,this.predResist=!!f.predResist,this.outLen=this.hash.outSize,this.minEntropy=f.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var o=Gi.toArray(f.entropy,f.entropyEnc||"hex"),c=Gi.toArray(f.nonce,f.nonceEnc||"hex"),h=Gi.toArray(f.pers,f.persEnc||"hex");Ag(o.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(o,c,h)}var Sy=Fo;Fo.prototype._init=function(o,c,h){var b=o.concat(c).concat(h);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(b),this._reseed=1,this.reseedInterval=281474976710656};Fo.prototype._hmac=function(){return new ZA.hmac(this.hash,this.K)};Fo.prototype._update=function(o){var c=this._hmac().update(this.V).update([0]);o&&(c=c.update(o)),this.K=c.digest(),this.V=this._hmac().update(this.V).digest(),o&&(this.K=this._hmac().update(this.V).update([1]).update(o).digest(),this.V=this._hmac().update(this.V).digest())};Fo.prototype.reseed=function(o,c,h,b){typeof c!="string"&&(b=h,h=c,c=null),o=Gi.toArray(o,c),h=Gi.toArray(h,b),Ag(o.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(o.concat(h||[])),this._reseed=1};Fo.prototype.generate=function(o,c,h,b){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof c!="string"&&(b=h,h=c,c=null),h&&(h=Gi.toArray(h,b||"hex"),this._update(h));for(var I=[];I.length<o;)this.V=this._hmac().update(this.V).digest(),I=I.concat(this.V);var y=I.slice(0,o);return this._update(h),this._reseed++,Gi.encode(y,c)};var $h=Ai.assert;function pA(f,o){this.ec=f,this.priv=null,this.pub=null,o.priv&&this._importPrivate(o.priv,o.privEnc),o.pub&&this._importPublic(o.pub,o.pubEnc)}var ag=pA;pA.fromPublic=function(o,c,h){return c instanceof pA?c:new pA(o,{pub:c,pubEnc:h})};pA.fromPrivate=function(o,c,h){return c instanceof pA?c:new pA(o,{priv:c,privEnc:h})};pA.prototype.validate=function(){var o=this.getPublic();return o.isInfinity()?{result:!1,reason:"Invalid public key"}:o.validate()?o.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"}};pA.prototype.getPublic=function(o,c){return typeof o=="string"&&(c=o,o=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),c?this.pub.encode(c,o):this.pub};pA.prototype.getPrivate=function(o){return o==="hex"?this.priv.toString(16,2):this.priv};pA.prototype._importPrivate=function(o,c){this.priv=new ir(o,c||16),this.priv=this.priv.umod(this.ec.curve.n)};pA.prototype._importPublic=function(o,c){if(o.x||o.y){this.ec.curve.type==="mont"?$h(o.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&$h(o.x&&o.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(o.x,o.y);return}this.pub=this.ec.curve.decodePoint(o,c)};pA.prototype.derive=function(o){return o.validate()||$h(o.validate(),"public point not validated"),o.mul(this.priv).getX()};pA.prototype.sign=function(o,c,h){return this.ec.sign(o,this,c,h)};pA.prototype.verify=function(o,c,h){return this.ec.verify(o,c,this,void 0,h)};pA.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var kB=Ai.assert;function eu(f,o){if(f instanceof eu)return f;this._importDER(f,o)||(kB(f.r&&f.s,"Signature without r or s"),this.r=new ir(f.r,16),this.s=new ir(f.s,16),f.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=f.recoveryParam)}var tu=eu;function MB(){this.place=0}function Wl(f,o){var c=f[o.place++];if(!(c&128))return c;var h=c&15;if(h===0||h>4||f[o.place]===0)return!1;for(var b=0,I=0,y=o.place;I<h;I++,y++)b<<=8,b|=f[y],b>>>=0;return b<=127?!1:(o.place=y,b)}function V8(f){for(var o=0,c=f.length-1;!f[o]&&!(f[o+1]&128)&&o<c;)o++;return o===0?f:f.slice(o)}eu.prototype._importDER=function(o,c){o=Ai.toArray(o,c);var h=new MB;if(o[h.place++]!==48)return!1;var b=Wl(o,h);if(b===!1||b+h.place!==o.length||o[h.place++]!==2)return!1;var I=Wl(o,h);if(I===!1||(o[h.place]&128)!==0)return!1;var y=o.slice(h.place,I+h.place);if(h.place+=I,o[h.place++]!==2)return!1;var S=Wl(o,h);if(S===!1||o.length!==S+h.place||(o[h.place]&128)!==0)return!1;var k=o.slice(h.place,S+h.place);if(y[0]===0)if(y[1]&128)y=y.slice(1);else return!1;if(k[0]===0)if(k[1]&128)k=k.slice(1);else return!1;return this.r=new ir(y),this.s=new ir(k),this.recoveryParam=null,!0};function Zl(f,o){if(o<128){f.push(o);return}var c=1+(Math.log(o)/Math.LN2>>>3);for(f.push(c|128);--c;)f.push(o>>>(c<<3)&255);f.push(o)}eu.prototype.toDER=function(o){var c=this.r.toArray(),h=this.s.toArray();for(c[0]&128&&(c=[0].concat(c)),h[0]&128&&(h=[0].concat(h)),c=V8(c),h=V8(h);!h[0]&&!(h[1]&128);)h=h.slice(1);var b=[2];Zl(b,c.length),b=b.concat(c),b.push(2),Zl(b,h.length);var I=b.concat(h),y=[48];return Zl(y,I.length),y=y.concat(I),Ai.encode(y,o)};var NB=function(){throw new Error("unsupported")},f2=Ai.assert;function Ii(f){if(!(this instanceof Ii))return new Ii(f);typeof f=="string"&&(f2(Object.prototype.hasOwnProperty.call(e1,f),"Unknown curve "+f),f=e1[f]),f instanceof e1.PresetCurve&&(f={curve:f}),this.curve=f.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=f.curve.g,this.g.precompute(f.curve.n.bitLength()+1),this.hash=f.hash||f.curve.hash}var FB=Ii;Ii.prototype.keyPair=function(o){return new ag(this,o)};Ii.prototype.keyFromPrivate=function(o,c){return ag.fromPrivate(this,o,c)};Ii.prototype.keyFromPublic=function(o,c){return ag.fromPublic(this,o,c)};Ii.prototype.genKeyPair=function(o){o||(o={});for(var c=new Sy({hash:this.hash,pers:o.pers,persEnc:o.persEnc||"utf8",entropy:o.entropy||NB(this.hash.hmacStrength),entropyEnc:o.entropy&&o.entropyEnc||"utf8",nonce:this.n.toArray()}),h=this.n.byteLength(),b=this.n.sub(new ir(2));;){var I=new ir(c.generate(h));if(!(I.cmp(b)>0))return I.iaddn(1),this.keyFromPrivate(I)}};Ii.prototype._truncateToN=function(o,c,h){var b;if(ir.isBN(o)||typeof o=="number")o=new ir(o,16),b=o.byteLength();else if(typeof o=="object")b=o.length,o=new ir(o,16);else{var I=o.toString();b=I.length+1>>>1,o=new ir(I,16)}typeof h!="number"&&(h=b*8);var y=h-this.n.bitLength();return y>0&&(o=o.ushrn(y)),!c&&o.cmp(this.n)>=0?o.sub(this.n):o};Ii.prototype.sign=function(o,c,h,b){if(typeof h=="object"&&(b=h,h=null),b||(b={}),typeof o!="string"&&typeof o!="number"&&!ir.isBN(o)){f2(typeof o=="object"&&o&&typeof o.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),f2(o.length>>>0===o.length);for(var I=0;I<o.length;I++)f2((o[I]&255)===o[I])}c=this.keyFromPrivate(c,h),o=this._truncateToN(o,!1,b.msgBitLength),f2(!o.isNeg(),"Can not sign a negative message");var y=this.n.byteLength(),S=c.getPrivate().toArray("be",y),k=o.toArray("be",y);f2(new ir(k).eq(o),"Can not sign message");for(var N=new Sy({hash:this.hash,entropy:S,nonce:k,pers:b.pers,persEnc:b.persEnc||"utf8"}),R=this.n.sub(new ir(1)),B=0;;B++){var oe=b.k?b.k(B):new ir(N.generate(this.n.byteLength()));if(oe=this._truncateToN(oe,!0),!(oe.cmpn(1)<=0||oe.cmp(R)>=0)){var Ee=this.g.mul(oe);if(!Ee.isInfinity()){var pe=Ee.getX(),V=pe.umod(this.n);if(V.cmpn(0)!==0){var Ie=oe.invm(this.n).mul(V.mul(c.getPrivate()).iadd(o));if(Ie=Ie.umod(this.n),Ie.cmpn(0)!==0){var Ce=(Ee.getY().isOdd()?1:0)|(pe.cmp(V)!==0?2:0);return b.canonical&&Ie.cmp(this.nh)>0&&(Ie=this.n.sub(Ie),Ce^=1),new tu({r:V,s:Ie,recoveryParam:Ce})}}}}}};Ii.prototype.verify=function(o,c,h,b,I){I||(I={}),o=this._truncateToN(o,!1,I.msgBitLength),h=this.keyFromPublic(h,b),c=new tu(c,"hex");var y=c.r,S=c.s;if(y.cmpn(1)<0||y.cmp(this.n)>=0||S.cmpn(1)<0||S.cmp(this.n)>=0)return!1;var k=S.invm(this.n),N=k.mul(o).umod(this.n),R=k.mul(y).umod(this.n),B;return this.curve._maxwellTrick?(B=this.g.jmulAdd(N,h.getPublic(),R),B.isInfinity()?!1:B.eqXToP(y)):(B=this.g.mulAdd(N,h.getPublic(),R),B.isInfinity()?!1:B.getX().umod(this.n).cmp(y)===0)};Ii.prototype.recoverPubKey=function(f,o,c,h){f2((3&c)===c,"The recovery param is more than two bits"),o=new tu(o,h);var b=this.n,I=new ir(f),y=o.r,S=o.s,k=c&1,N=c>>1;if(y.cmp(this.curve.p.umod(this.curve.n))>=0&&N)throw new Error("Unable to find sencond key candinate");N?y=this.curve.pointFromX(y.add(this.curve.n),k):y=this.curve.pointFromX(y,k);var R=o.r.invm(b),B=b.sub(I).mul(R).umod(b),oe=S.mul(R).umod(b);return this.g.mulAdd(B,y,oe)};Ii.prototype.getKeyRecoveryParam=function(f,o,c,h){if(o=new tu(o,h),o.recoveryParam!==null)return o.recoveryParam;for(var b=0;b<4;b++){var I;try{I=this.recoverPubKey(f,o,b)}catch{continue}if(I.eq(c))return b}throw new Error("Unable to find valid recovery factor")};var PB=Fs(function(f,o){var c=o;c.version="6.6.1",c.utils=Ai,c.rand=function(){throw new Error("unsupported")},c.curve=$c,c.curves=e1,c.ec=FB,c.eddsa=null}),KB=PB.ec;const UB="signing-key/5.8.0",ed=new zt(UB);let $l=null;function s2(){return $l||($l=new KB("secp256k1")),$l}class ps{constructor(o){lr(this,"curve","secp256k1"),lr(this,"privateKey",or(o)),gy(this.privateKey)!==32&&ed.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const c=s2().keyFromPrivate(Nt(this.privateKey));lr(this,"publicKey","0x"+c.getPublic(!1,"hex")),lr(this,"compressedPublicKey","0x"+c.getPublic(!0,"hex")),lr(this,"_isSigningKey",!0)}_addPoint(o){const c=s2().keyFromPublic(Nt(this.publicKey)),h=s2().keyFromPublic(Nt(o));return"0x"+c.pub.add(h.pub).encodeCompressed("hex")}signDigest(o){const c=s2().keyFromPrivate(Nt(this.privateKey)),h=Nt(o);h.length!==32&&ed.throwArgumentError("bad digest length","digest",o);const b=c.sign(h,{canonical:!0});return Ns({recoveryParam:b.recoveryParam,r:yi("0x"+b.r.toString(16),32),s:yi("0x"+b.s.toString(16),32)})}computeSharedSecret(o){const c=s2().keyFromPrivate(Nt(this.privateKey)),h=s2().keyFromPublic(Nt(Dy(o)));return yi("0x"+c.derive(h.getPublic()).toString(16),32)}static isSigningKey(o){return!!(o&&o._isSigningKey)}}function Dy(f,o){const c=Nt(f);return c.length===32?new ps(c).publicKey:c.length===33?"0x"+s2().keyFromPublic(c).getPublic(!1,"hex"):c.length===65?or(c):ed.throwArgumentError("invalid public or private key","key","[REDACTED]")}const HB="transactions/5.8.0",Ri=new zt(HB);var X8;(function(f){f[f.legacy=0]="legacy",f[f.eip2930=1]="eip2930",f[f.eip1559=2]="eip1559"})(X8||(X8={}));const RB=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],GB={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function ys(f){const o=Dy(f);return Ti(_f(mA(_f(o,1)),12))}function $A(f,o){const c=So(Zr.from(f).toHexString());return c.length>32&&Ri.throwArgumentError("invalid length for "+o,"transaction:"+o,f),c}function eh(f,o){return{address:Ti(f),storageKeys:(o||[]).map((c,h)=>(gy(c)!==32&&Ri.throwArgumentError("invalid access list storageKey",`accessList[${f}:${h}]`,c),c.toLowerCase()))}}function YB(f){if(Array.isArray(f))return f.map((c,h)=>Array.isArray(c)?(c.length>2&&Ri.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${h}]`,c),eh(c[0],c[1])):eh(c.address,c.storageKeys));const o=Object.keys(f).map(c=>{const h=f[c].reduce((b,I)=>(b[I]=!0,b),{});return eh(c,Object.keys(h).sort())});return o.sort((c,h)=>c.address.localeCompare(h.address)),o}function ky(f){return YB(f).map(o=>[o.address,o.storageKeys])}function LB(f,o){if(f.gasPrice!=null){const h=Zr.from(f.gasPrice),b=Zr.from(f.maxFeePerGas||0);h.eq(b)||Ri.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:h,maxFeePerGas:b})}const c=[$A(f.chainId||0,"chainId"),$A(f.nonce||0,"nonce"),$A(f.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),$A(f.maxFeePerGas||0,"maxFeePerGas"),$A(f.gasLimit||0,"gasLimit"),f.to!=null?Ti(f.to):"0x",$A(f.value||0,"value"),f.data||"0x",ky(f.accessList||[])];if(o){const h=Ns(o);c.push($A(h.recoveryParam,"recoveryParam")),c.push(So(h.r)),c.push(So(h.s))}return gs(["0x02",b1(c)])}function TB(f,o){const c=[$A(f.chainId||0,"chainId"),$A(f.nonce||0,"nonce"),$A(f.gasPrice||0,"gasPrice"),$A(f.gasLimit||0,"gasLimit"),f.to!=null?Ti(f.to):"0x",$A(f.value||0,"value"),f.data||"0x",ky(f.accessList||[])];if(o){const h=Ns(o);c.push($A(h.recoveryParam,"recoveryParam")),c.push(So(h.r)),c.push(So(h.s))}return gs(["0x01",b1(c)])}function JB(f,o){Z9(f,GB);const c=[];RB.forEach(function(y){let S=f[y.name]||[];const k={};y.numeric&&(k.hexPad="left"),S=Nt(or(S,k)),y.length&&S.length!==y.length&&S.length>0&&Ri.throwArgumentError("invalid length for "+y.name,"transaction:"+y.name,S),y.maxLength&&(S=So(S),S.length>y.maxLength&&Ri.throwArgumentError("invalid length for "+y.name,"transaction:"+y.name,S)),c.push(or(S))});let h=0;if(f.chainId!=null?(h=f.chainId,typeof h!="number"&&Ri.throwArgumentError("invalid transaction.chainId","transaction",f)):o&&!Zd(o)&&o.v>28&&(h=Math.floor((o.v-35)/2)),h!==0&&(c.push(or(h)),c.push("0x"),c.push("0x")),!o)return b1(c);const b=Ns(o);let I=27+b.recoveryParam;return h!==0?(c.pop(),c.pop(),c.pop(),I+=h*2+8,b.v>28&&b.v!==I&&Ri.throwArgumentError("transaction.chainId/signature.v mismatch","signature",o)):b.v!==I&&Ri.throwArgumentError("transaction.chainId/signature.v mismatch","signature",o),c.push(or(I)),c.push(So(Nt(b.r))),c.push(So(Nt(b.s))),b1(c)}function W8(f,o){if(f.type==null||f.type===0)return f.accessList!=null&&Ri.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",f),JB(f,o);switch(f.type){case 1:return TB(f,o);case 2:return LB(f,o)}return Ri.throwError(`unsupported transaction type: ${f.type}`,zt.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:f.type})}const OB="wordlists/5.8.0",zB=new zt(OB);class Xf{constructor(o){zB.checkAbstract(new.target,Xf),lr(this,"locale",o)}split(o){return o.toLowerCase().split(/ +/g)}join(o){return o.join(" ")}static check(o){const c=[];for(let h=0;h<2048;h++){const b=o.getWord(h);if(h!==o.getWordIndex(b))return"0x";c.push(b)}return rg(c.join(`
65
65
  `)+`
66
- `)}static register(o,c){c||(c=o.locale)}}const qB="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo";let gf=null;function Z8(f){if(gf==null&&(gf=qB.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),Xf.check(f)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw gf=null,new Error("BIP39 Wordlist for en (English) FAILED")}class jB extends Xf{constructor(){super("en")}getWord(o){return Z8(this),gf[o]}getWordIndex(o){return Z8(this),gf.indexOf(o)}}const My=new jB;Xf.register(My);const $8={en:My},VB="hdnode/5.8.0",w1=new zt(VB),XB=Zr.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),WB=Yi("Bitcoin seed"),Tc=2147483648;function Ny(f){return(1<<f)-1<<8-f}function ZB(f){return(1<<f)-1}function Jc(f){return yi(or(f),32)}function ep(f){return _y.encode(No([f,_f(mf(mf(f)),0,4)]))}function og(f){if(f==null)return $8.en;if(typeof f=="string"){const o=$8[f];return o==null&&w1.throwArgumentError("unknown locale","wordlist",f),o}return f}const ns={},Qf="m/44'/60'/0'/0/0";class gi{constructor(o,c,h,b,I,y,S,k){if(o!==ns)throw new Error("HDNode constructor cannot be called directly");if(c){const N=new ps(c);lr(this,"privateKey",N.privateKey),lr(this,"publicKey",N.compressedPublicKey)}else lr(this,"privateKey",null),lr(this,"publicKey",or(h));lr(this,"parentFingerprint",b),lr(this,"fingerprint",_f(wB(mf(this.publicKey)),0,4)),lr(this,"address",ys(this.publicKey)),lr(this,"chainCode",I),lr(this,"index",y),lr(this,"depth",S),k==null?(lr(this,"mnemonic",null),lr(this,"path",null)):typeof k=="string"?(lr(this,"mnemonic",null),lr(this,"path",k)):(lr(this,"mnemonic",k),lr(this,"path",k.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return ep(No([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",or(this.depth),this.parentFingerprint,yi(or(this.index),4),this.chainCode,this.privateKey!=null?No(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new gi(ns,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(o){if(o>4294967295)throw new Error("invalid index - "+String(o));let c=this.path;c&&(c+="/"+(o&2147483647));const h=new Uint8Array(37);if(o&Tc){if(!this.privateKey)throw new Error("cannot derive child of neutered node");h.set(Nt(this.privateKey),1),c&&(c+="'")}else h.set(Nt(this.publicKey));for(let B=24;B>=0;B-=8)h[33+(B>>3)]=o>>24-B&255;const b=Nt(E1(wf.sha512,this.chainCode,h)),I=b.slice(0,32),y=b.slice(32);let S=null,k=null;this.privateKey?S=Jc(Zr.from(I).add(this.privateKey).mod(XB)):k=new ps(or(I))._addPoint(this.publicKey);let N=c;const R=this.mnemonic;return R&&(N=Object.freeze({phrase:R.phrase,path:c,locale:R.locale||"en"})),new gi(ns,S,k,this.fingerprint,Jc(y),o,this.depth+1,N)}derivePath(o){const c=o.split("/");if(c.length===0||c[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+o);c[0]==="m"&&c.shift();let h=this;for(let b=0;b<c.length;b++){const I=c[b];if(I.match(/^[0-9]+'$/)){const y=parseInt(I.substring(0,I.length-1));if(y>=Tc)throw new Error("invalid path index - "+I);h=h._derive(Tc+y)}else if(I.match(/^[0-9]+$/)){const y=parseInt(I);if(y>=Tc)throw new Error("invalid path index - "+I);h=h._derive(y)}else throw new Error("invalid path component - "+I)}return h}static _fromSeed(o,c){const h=Nt(o);if(h.length<16||h.length>64)throw new Error("invalid seed");const b=Nt(E1(wf.sha512,WB,h));return new gi(ns,Jc(b.slice(0,32)),null,"0x00000000",Jc(b.slice(32)),0,0,c)}static fromMnemonic(o,c,h){return h=og(h),o=sg(Fy(o,h),h),gi._fromSeed($B(o,c),{phrase:o,path:"m",locale:h.locale})}static fromSeed(o){return gi._fromSeed(o,null)}static fromExtendedKey(o){const c=_y.decode(o);(c.length!==82||ep(c.slice(0,78))!==o)&&w1.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const h=c[4],b=or(c.slice(5,9)),I=parseInt(or(c.slice(9,13)).substring(2),16),y=or(c.slice(13,45)),S=c.slice(45,78);switch(or(c.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new gi(ns,null,or(S),b,y,I,h,null);case"0x0488ade4":case"0x04358394 ":if(S[0]!==0)break;return new gi(ns,or(S.slice(1)),null,b,y,I,h,null)}return w1.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function $B(f,o){o||(o="");const c=Yi("mnemonic"+o,y2.NFKD);return ng(Yi(f,y2.NFKD),c,2048,64,"sha512")}function Fy(f,o){o=og(o),w1.checkNormalize();const c=o.split(f);if(c.length%3!==0)throw new Error("invalid mnemonic");const h=Nt(new Uint8Array(Math.ceil(11*c.length/8)));let b=0;for(let N=0;N<c.length;N++){let R=o.getWordIndex(c[N].normalize("NFKD"));if(R===-1)throw new Error("invalid mnemonic");for(let B=0;B<11;B++)R&1<<10-B&&(h[b>>3]|=1<<7-b%8),b++}const I=32*c.length/3,y=c.length/3,S=Ny(y);if((Nt(mf(h.slice(0,I/8)))[0]&S)!==(h[h.length-1]&S))throw new Error("invalid checksum");return or(h.slice(0,I/8))}function sg(f,o){if(o=og(o),f=Nt(f),f.length%4!==0||f.length<16||f.length>32)throw new Error("invalid entropy");const c=[0];let h=11;for(let y=0;y<f.length;y++)h>8?(c[c.length-1]<<=8,c[c.length-1]|=f[y],h-=8):(c[c.length-1]<<=h,c[c.length-1]|=f[y]>>8-h,c.push(f[y]&ZB(8-h)),h+=3);const b=f.length/4,I=Nt(mf(f))[0]&Ny(b);return c[c.length-1]<<=b,c[c.length-1]|=I>>8-b,o.join(c.map(y=>o.getWord(y)))}const ew="random/5.8.0",td=new zt(ew);function tw(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const tp=tw();let t1=tp.crypto||tp.msCrypto;(!t1||!t1.getRandomValues)&&(td.warn("WARNING: Missing strong random number source"),t1={getRandomValues:function(f){return td.throwError("no secure random source avaialble",zt.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function ff(f){(f<=0||f>1024||f%1||f!=f)&&td.throwArgumentError("invalid length","length",f);const o=new Uint8Array(f);return t1.getRandomValues(o),Nt(o)}var th={exports:{}},rp;function rw(){return rp||(rp=1,function(f,o){(function(c){function h(G){return parseInt(G)===G}function b(G){if(!h(G.length))return!1;for(var T=0;T<G.length;T++)if(!h(G[T])||G[T]<0||G[T]>255)return!1;return!0}function I(G,T){if(G.buffer&&ArrayBuffer.isView(G)&&G.name==="Uint8Array")return T&&(G.slice?G=G.slice():G=Array.prototype.slice.call(G)),G;if(Array.isArray(G)){if(!b(G))throw new Error("Array contains invalid value: "+G);return new Uint8Array(G)}if(h(G.length)&&b(G))return new Uint8Array(G);throw new Error("unsupported array-like object")}function y(G){return new Uint8Array(G)}function S(G,T,Be,Te,se){(Te!=null||se!=null)&&(G.slice?G=G.slice(Te,se):G=Array.prototype.slice.call(G,Te,se)),T.set(G,Be)}var k=function(){function G(Be){var Te=[],se=0;for(Be=encodeURI(Be);se<Be.length;){var ze=Be.charCodeAt(se++);ze===37?(Te.push(parseInt(Be.substr(se,2),16)),se+=2):Te.push(ze)}return I(Te)}function T(Be){for(var Te=[],se=0;se<Be.length;){var ze=Be[se];ze<128?(Te.push(String.fromCharCode(ze)),se++):ze>191&&ze<224?(Te.push(String.fromCharCode((ze&31)<<6|Be[se+1]&63)),se+=2):(Te.push(String.fromCharCode((ze&15)<<12|(Be[se+1]&63)<<6|Be[se+2]&63)),se+=3)}return Te.join("")}return{toBytes:G,fromBytes:T}}(),N=function(){function G(Te){for(var se=[],ze=0;ze<Te.length;ze+=2)se.push(parseInt(Te.substr(ze,2),16));return se}var T="0123456789abcdef";function Be(Te){for(var se=[],ze=0;ze<Te.length;ze++){var s0=Te[ze];se.push(T[(s0&240)>>4]+T[s0&15])}return se.join("")}return{toBytes:G,fromBytes:Be}}(),R={16:10,24:12,32:14},B=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],oe=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],Ee=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],pe=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],V=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],Ie=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],Ce=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],_e=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],te=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],r0=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],ve=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Ne=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],ye=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],Xe=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],he=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function v0(G){for(var T=[],Be=0;Be<G.length;Be+=4)T.push(G[Be]<<24|G[Be+1]<<16|G[Be+2]<<8|G[Be+3]);return T}var He=function(G){if(!(this instanceof He))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:I(G,!0)}),this._prepare()};He.prototype._prepare=function(){var G=R[this.key.length];if(G==null)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var T=0;T<=G;T++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(var Be=(G+1)*4,Te=this.key.length/4,se=v0(this.key),ze,T=0;T<Te;T++)ze=T>>2,this._Ke[ze][T%4]=se[T],this._Kd[G-ze][T%4]=se[T];for(var s0=0,l0=Te,p0;l0<Be;){if(p0=se[Te-1],se[0]^=oe[p0>>16&255]<<24^oe[p0>>8&255]<<16^oe[p0&255]<<8^oe[p0>>24&255]^B[s0]<<24,s0+=1,Te!=8)for(var T=1;T<Te;T++)se[T]^=se[T-1];else{for(var T=1;T<Te/2;T++)se[T]^=se[T-1];p0=se[Te/2-1],se[Te/2]^=oe[p0&255]^oe[p0>>8&255]<<8^oe[p0>>16&255]<<16^oe[p0>>24&255]<<24;for(var T=Te/2+1;T<Te;T++)se[T]^=se[T-1]}for(var T=0,G0,X0;T<Te&&l0<Be;)G0=l0>>2,X0=l0%4,this._Ke[G0][X0]=se[T],this._Kd[G-G0][X0]=se[T++],l0++}for(var G0=1;G0<G;G0++)for(var X0=0;X0<4;X0++)p0=this._Kd[G0][X0],this._Kd[G0][X0]=Ne[p0>>24&255]^ye[p0>>16&255]^Xe[p0>>8&255]^he[p0&255]},He.prototype.encrypt=function(G){if(G.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");for(var T=this._Ke.length-1,Be=[0,0,0,0],Te=v0(G),se=0;se<4;se++)Te[se]^=this._Ke[0][se];for(var ze=1;ze<T;ze++){for(var se=0;se<4;se++)Be[se]=pe[Te[se]>>24&255]^V[Te[(se+1)%4]>>16&255]^Ie[Te[(se+2)%4]>>8&255]^Ce[Te[(se+3)%4]&255]^this._Ke[ze][se];Te=Be.slice()}for(var s0=y(16),l0,se=0;se<4;se++)l0=this._Ke[T][se],s0[4*se]=(oe[Te[se]>>24&255]^l0>>24)&255,s0[4*se+1]=(oe[Te[(se+1)%4]>>16&255]^l0>>16)&255,s0[4*se+2]=(oe[Te[(se+2)%4]>>8&255]^l0>>8)&255,s0[4*se+3]=(oe[Te[(se+3)%4]&255]^l0)&255;return s0},He.prototype.decrypt=function(G){if(G.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var T=this._Kd.length-1,Be=[0,0,0,0],Te=v0(G),se=0;se<4;se++)Te[se]^=this._Kd[0][se];for(var ze=1;ze<T;ze++){for(var se=0;se<4;se++)Be[se]=_e[Te[se]>>24&255]^te[Te[(se+3)%4]>>16&255]^r0[Te[(se+2)%4]>>8&255]^ve[Te[(se+1)%4]&255]^this._Kd[ze][se];Te=Be.slice()}for(var s0=y(16),l0,se=0;se<4;se++)l0=this._Kd[T][se],s0[4*se]=(Ee[Te[se]>>24&255]^l0>>24)&255,s0[4*se+1]=(Ee[Te[(se+3)%4]>>16&255]^l0>>16)&255,s0[4*se+2]=(Ee[Te[(se+2)%4]>>8&255]^l0>>8)&255,s0[4*se+3]=(Ee[Te[(se+1)%4]&255]^l0)&255;return s0};var q=function(G){if(!(this instanceof q))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new He(G)};q.prototype.encrypt=function(G){if(G=I(G),G.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var T=y(G.length),Be=y(16),Te=0;Te<G.length;Te+=16)S(G,Be,0,Te,Te+16),Be=this._aes.encrypt(Be),S(Be,T,Te);return T},q.prototype.decrypt=function(G){if(G=I(G),G.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var T=y(G.length),Be=y(16),Te=0;Te<G.length;Te+=16)S(G,Be,0,Te,Te+16),Be=this._aes.decrypt(Be),S(Be,T,Te);return T};var J=function(G,T){if(!(this instanceof J))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",!T)T=y(16);else if(T.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastCipherblock=I(T,!0),this._aes=new He(G)};J.prototype.encrypt=function(G){if(G=I(G),G.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var T=y(G.length),Be=y(16),Te=0;Te<G.length;Te+=16){S(G,Be,0,Te,Te+16);for(var se=0;se<16;se++)Be[se]^=this._lastCipherblock[se];this._lastCipherblock=this._aes.encrypt(Be),S(this._lastCipherblock,T,Te)}return T},J.prototype.decrypt=function(G){if(G=I(G),G.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var T=y(G.length),Be=y(16),Te=0;Te<G.length;Te+=16){S(G,Be,0,Te,Te+16),Be=this._aes.decrypt(Be);for(var se=0;se<16;se++)T[Te+se]=Be[se]^this._lastCipherblock[se];S(G,this._lastCipherblock,0,Te,Te+16)}return T};var Q=function(G,T,Be){if(!(this instanceof Q))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",!T)T=y(16);else if(T.length!=16)throw new Error("invalid initialation vector size (must be 16 size)");Be||(Be=1),this.segmentSize=Be,this._shiftRegister=I(T,!0),this._aes=new He(G)};Q.prototype.encrypt=function(G){if(G.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var T=I(G,!0),Be,Te=0;Te<T.length;Te+=this.segmentSize){Be=this._aes.encrypt(this._shiftRegister);for(var se=0;se<this.segmentSize;se++)T[Te+se]^=Be[se];S(this._shiftRegister,this._shiftRegister,0,this.segmentSize),S(T,this._shiftRegister,16-this.segmentSize,Te,Te+this.segmentSize)}return T},Q.prototype.decrypt=function(G){if(G.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var T=I(G,!0),Be,Te=0;Te<T.length;Te+=this.segmentSize){Be=this._aes.encrypt(this._shiftRegister);for(var se=0;se<this.segmentSize;se++)T[Te+se]^=Be[se];S(this._shiftRegister,this._shiftRegister,0,this.segmentSize),S(G,this._shiftRegister,16-this.segmentSize,Te,Te+this.segmentSize)}return T};var L=function(G,T){if(!(this instanceof L))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",!T)T=y(16);else if(T.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastPrecipher=I(T,!0),this._lastPrecipherIndex=16,this._aes=new He(G)};L.prototype.encrypt=function(G){for(var T=I(G,!0),Be=0;Be<T.length;Be++)this._lastPrecipherIndex===16&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),T[Be]^=this._lastPrecipher[this._lastPrecipherIndex++];return T},L.prototype.decrypt=L.prototype.encrypt;var W=function(G){if(!(this instanceof W))throw Error("Counter must be instanitated with `new`");G!==0&&!G&&(G=1),typeof G=="number"?(this._counter=y(16),this.setValue(G)):this.setBytes(G)};W.prototype.setValue=function(G){if(typeof G!="number"||parseInt(G)!=G)throw new Error("invalid counter value (must be an integer)");for(var T=15;T>=0;--T)this._counter[T]=G%256,G=G>>8},W.prototype.setBytes=function(G){if(G=I(G,!0),G.length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=G},W.prototype.increment=function(){for(var G=15;G>=0;G--)if(this._counter[G]===255)this._counter[G]=0;else{this._counter[G]++;break}};var Ae=function(G,T){if(!(this instanceof Ae))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",T instanceof W||(T=new W(T)),this._counter=T,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new He(G)};Ae.prototype.encrypt=function(G){for(var T=I(G,!0),Be=0;Be<T.length;Be++)this._remainingCounterIndex===16&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),T[Be]^=this._remainingCounter[this._remainingCounterIndex++];return T},Ae.prototype.decrypt=Ae.prototype.encrypt;function ie(G){G=I(G,!0);var T=16-G.length%16,Be=y(G.length+T);S(G,Be);for(var Te=G.length;Te<Be.length;Te++)Be[Te]=T;return Be}function fe(G){if(G=I(G,!0),G.length<16)throw new Error("PKCS#7 invalid length");var T=G[G.length-1];if(T>16)throw new Error("PKCS#7 padding byte out of range");for(var Be=G.length-T,Te=0;Te<T;Te++)if(G[Be+Te]!==T)throw new Error("PKCS#7 invalid padding byte");var se=y(Be);return S(G,se,0,0,Be),se}var z={AES:He,Counter:W,ModeOfOperation:{ecb:q,cbc:J,cfb:Q,ofb:L,ctr:Ae},utils:{hex:N,utf8:k},padding:{pkcs7:{pad:ie,strip:fe}},_arrayTest:{coerceArray:I,createArray:y,copyArray:S}};f.exports=z})()}(th)),th.exports}var nw=rw();const ua=Ji(nw),Py="json-wallets/5.8.0";function g2(f){return typeof f=="string"&&f.substring(0,2)!=="0x"&&(f="0x"+f),Nt(f)}function Af(f,o){for(f=String(f);f.length<o;)f="0"+f;return f}function fg(f){return typeof f=="string"?Yi(f,y2.NFKC):Nt(f)}function Bn(f,o){let c=f;const h=o.toLowerCase().split("/");for(let b=0;b<h.length;b++){let I=null;for(const y in c)if(y.toLowerCase()===h[b]){I=c[y];break}if(I===null)return null;c=I}return c}function Aw(f){const o=Nt(f);o[6]=o[6]&15|64,o[8]=o[8]&63|128;const c=or(o);return[c.substring(2,10),c.substring(10,14),c.substring(14,18),c.substring(18,22),c.substring(22,34)].join("-")}const iw=new zt(Py);class aw extends Iy{isCrowdsaleAccount(o){return!!(o&&o._isCrowdsaleAccount)}}function Ky(f,o){const c=JSON.parse(f);o=fg(o);const h=Ti(Bn(c,"ethaddr")),b=g2(Bn(c,"encseed"));(!b||b.length%16!==0)&&iw.throwArgumentError("invalid encseed","json",f);const I=Nt(ng(o,o,2e3,32,"sha256")).slice(0,16),y=b.slice(0,16),S=b.slice(16),k=new ua.ModeOfOperation.cbc(I,y),N=ua.padding.pkcs7.strip(Nt(k.decrypt(S)));let R="";for(let Ee=0;Ee<N.length;Ee++)R+=String.fromCharCode(N[Ee]);const B=Yi(R),oe=mA(B);return new aw({_isCrowdsaleAccount:!0,address:h,privateKey:oe})}function Uy(f){let o=null;try{o=JSON.parse(f)}catch{return!1}return o.encseed&&o.ethaddr}function Hy(f){let o=null;try{o=JSON.parse(f)}catch{return!1}return!(!o.version||parseInt(o.version)!==o.version||parseInt(o.version)!==3)}var rh={exports:{}},np;function ow(){return np||(np=1,function(f,o){(function(c){function b(V){const Ie=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]);let Ce=1779033703,_e=3144134277,te=1013904242,r0=2773480762,ve=1359893119,Ne=2600822924,ye=528734635,Xe=1541459225;const he=new Uint32Array(64);function v0(Ae){let ie=0,fe=Ae.length;for(;fe>=64;){let z=Ce,G=_e,T=te,Be=r0,Te=ve,se=Ne,ze=ye,s0=Xe,l0,p0,G0,X0,Y0;for(p0=0;p0<16;p0++)G0=ie+p0*4,he[p0]=(Ae[G0]&255)<<24|(Ae[G0+1]&255)<<16|(Ae[G0+2]&255)<<8|Ae[G0+3]&255;for(p0=16;p0<64;p0++)l0=he[p0-2],X0=(l0>>>17|l0<<15)^(l0>>>19|l0<<13)^l0>>>10,l0=he[p0-15],Y0=(l0>>>7|l0<<25)^(l0>>>18|l0<<14)^l0>>>3,he[p0]=(X0+he[p0-7]|0)+(Y0+he[p0-16]|0)|0;for(p0=0;p0<64;p0++)X0=(((Te>>>6|Te<<26)^(Te>>>11|Te<<21)^(Te>>>25|Te<<7))+(Te&se^~Te&ze)|0)+(s0+(Ie[p0]+he[p0]|0)|0)|0,Y0=((z>>>2|z<<30)^(z>>>13|z<<19)^(z>>>22|z<<10))+(z&G^z&T^G&T)|0,s0=ze,ze=se,se=Te,Te=Be+X0|0,Be=T,T=G,G=z,z=X0+Y0|0;Ce=Ce+z|0,_e=_e+G|0,te=te+T|0,r0=r0+Be|0,ve=ve+Te|0,Ne=Ne+se|0,ye=ye+ze|0,Xe=Xe+s0|0,ie+=64,fe-=64}}v0(V);let He,q=V.length%64,J=V.length/536870912|0,Q=V.length<<3,L=q<56?56:120,W=V.slice(V.length-q,V.length);for(W.push(128),He=q+1;He<L;He++)W.push(0);return W.push(J>>>24&255),W.push(J>>>16&255),W.push(J>>>8&255),W.push(J>>>0&255),W.push(Q>>>24&255),W.push(Q>>>16&255),W.push(Q>>>8&255),W.push(Q>>>0&255),v0(W),[Ce>>>24&255,Ce>>>16&255,Ce>>>8&255,Ce>>>0&255,_e>>>24&255,_e>>>16&255,_e>>>8&255,_e>>>0&255,te>>>24&255,te>>>16&255,te>>>8&255,te>>>0&255,r0>>>24&255,r0>>>16&255,r0>>>8&255,r0>>>0&255,ve>>>24&255,ve>>>16&255,ve>>>8&255,ve>>>0&255,Ne>>>24&255,Ne>>>16&255,Ne>>>8&255,Ne>>>0&255,ye>>>24&255,ye>>>16&255,ye>>>8&255,ye>>>0&255,Xe>>>24&255,Xe>>>16&255,Xe>>>8&255,Xe>>>0&255]}function I(V,Ie,Ce){V=V.length<=64?V:b(V);const _e=64+Ie.length+4,te=new Array(_e),r0=new Array(64);let ve,Ne=[];for(ve=0;ve<64;ve++)te[ve]=54;for(ve=0;ve<V.length;ve++)te[ve]^=V[ve];for(ve=0;ve<Ie.length;ve++)te[64+ve]=Ie[ve];for(ve=_e-4;ve<_e;ve++)te[ve]=0;for(ve=0;ve<64;ve++)r0[ve]=92;for(ve=0;ve<V.length;ve++)r0[ve]^=V[ve];function ye(){for(let Xe=_e-1;Xe>=_e-4;Xe--){if(te[Xe]++,te[Xe]<=255)return;te[Xe]=0}}for(;Ce>=32;)ye(),Ne=Ne.concat(b(r0.concat(b(te)))),Ce-=32;return Ce>0&&(ye(),Ne=Ne.concat(b(r0.concat(b(te))).slice(0,Ce))),Ne}function y(V,Ie,Ce,_e,te){let r0;for(R(V,(2*Ce-1)*16,te,0,16),r0=0;r0<2*Ce;r0++)N(V,r0*16,te,16),k(te,_e),R(te,0,V,Ie+r0*16,16);for(r0=0;r0<Ce;r0++)R(V,Ie+r0*2*16,V,r0*16,16);for(r0=0;r0<Ce;r0++)R(V,Ie+(r0*2+1)*16,V,(r0+Ce)*16,16)}function S(V,Ie){return V<<Ie|V>>>32-Ie}function k(V,Ie){R(V,0,Ie,0,16);for(let Ce=8;Ce>0;Ce-=2)Ie[4]^=S(Ie[0]+Ie[12],7),Ie[8]^=S(Ie[4]+Ie[0],9),Ie[12]^=S(Ie[8]+Ie[4],13),Ie[0]^=S(Ie[12]+Ie[8],18),Ie[9]^=S(Ie[5]+Ie[1],7),Ie[13]^=S(Ie[9]+Ie[5],9),Ie[1]^=S(Ie[13]+Ie[9],13),Ie[5]^=S(Ie[1]+Ie[13],18),Ie[14]^=S(Ie[10]+Ie[6],7),Ie[2]^=S(Ie[14]+Ie[10],9),Ie[6]^=S(Ie[2]+Ie[14],13),Ie[10]^=S(Ie[6]+Ie[2],18),Ie[3]^=S(Ie[15]+Ie[11],7),Ie[7]^=S(Ie[3]+Ie[15],9),Ie[11]^=S(Ie[7]+Ie[3],13),Ie[15]^=S(Ie[11]+Ie[7],18),Ie[1]^=S(Ie[0]+Ie[3],7),Ie[2]^=S(Ie[1]+Ie[0],9),Ie[3]^=S(Ie[2]+Ie[1],13),Ie[0]^=S(Ie[3]+Ie[2],18),Ie[6]^=S(Ie[5]+Ie[4],7),Ie[7]^=S(Ie[6]+Ie[5],9),Ie[4]^=S(Ie[7]+Ie[6],13),Ie[5]^=S(Ie[4]+Ie[7],18),Ie[11]^=S(Ie[10]+Ie[9],7),Ie[8]^=S(Ie[11]+Ie[10],9),Ie[9]^=S(Ie[8]+Ie[11],13),Ie[10]^=S(Ie[9]+Ie[8],18),Ie[12]^=S(Ie[15]+Ie[14],7),Ie[13]^=S(Ie[12]+Ie[15],9),Ie[14]^=S(Ie[13]+Ie[12],13),Ie[15]^=S(Ie[14]+Ie[13],18);for(let Ce=0;Ce<16;++Ce)V[Ce]+=Ie[Ce]}function N(V,Ie,Ce,_e){for(let te=0;te<_e;te++)Ce[te]^=V[Ie+te]}function R(V,Ie,Ce,_e,te){for(;te--;)Ce[_e++]=V[Ie++]}function B(V){if(!V||typeof V.length!="number")return!1;for(let Ie=0;Ie<V.length;Ie++){const Ce=V[Ie];if(typeof Ce!="number"||Ce%1||Ce<0||Ce>=256)return!1}return!0}function oe(V,Ie){if(typeof V!="number"||V%1)throw new Error("invalid "+Ie);return V}function Ee(V,Ie,Ce,_e,te,r0,ve){if(Ce=oe(Ce,"N"),_e=oe(_e,"r"),te=oe(te,"p"),r0=oe(r0,"dkLen"),Ce===0||(Ce&Ce-1)!==0)throw new Error("N must be power of 2");if(Ce>2147483647/128/_e)throw new Error("N too large");if(_e>2147483647/128/te)throw new Error("r too large");if(!B(V))throw new Error("password must be an array or buffer");if(V=Array.prototype.slice.call(V),!B(Ie))throw new Error("salt must be an array or buffer");Ie=Array.prototype.slice.call(Ie);let Ne=I(V,Ie,te*128*_e);const ye=new Uint32Array(te*32*_e);for(let Te=0;Te<ye.length;Te++){const se=Te*4;ye[Te]=(Ne[se+3]&255)<<24|(Ne[se+2]&255)<<16|(Ne[se+1]&255)<<8|(Ne[se+0]&255)<<0}const Xe=new Uint32Array(64*_e),he=new Uint32Array(32*_e*Ce),v0=32*_e,He=new Uint32Array(16),q=new Uint32Array(16),J=te*Ce*2;let Q=0,L=null,W=!1,Ae=0,ie=0,fe,z;const G=ve?parseInt(1e3/_e):4294967295,T=typeof setImmediate<"u"?setImmediate:setTimeout,Be=function(){if(W)return ve(new Error("cancelled"),Q/J);let Te;switch(Ae){case 0:z=ie*32*_e,R(ye,z,Xe,0,v0),Ae=1,fe=0;case 1:Te=Ce-fe,Te>G&&(Te=G);for(let ze=0;ze<Te;ze++)R(Xe,0,he,(fe+ze)*v0,v0),y(Xe,v0,_e,He,q);if(fe+=Te,Q+=Te,ve){const ze=parseInt(1e3*Q/J);if(ze!==L){if(W=ve(null,Q/J),W)break;L=ze}}if(fe<Ce)break;fe=0,Ae=2;case 2:Te=Ce-fe,Te>G&&(Te=G);for(let ze=0;ze<Te;ze++){const s0=(2*_e-1)*16,l0=Xe[s0]&Ce-1;N(he,l0*v0,Xe,v0),y(Xe,v0,_e,He,q)}if(fe+=Te,Q+=Te,ve){const ze=parseInt(1e3*Q/J);if(ze!==L){if(W=ve(null,Q/J),W)break;L=ze}}if(fe<Ce)break;if(R(Xe,0,ye,z,v0),ie++,ie<te){Ae=0;break}Ne=[];for(let ze=0;ze<ye.length;ze++)Ne.push(ye[ze]>>0&255),Ne.push(ye[ze]>>8&255),Ne.push(ye[ze]>>16&255),Ne.push(ye[ze]>>24&255);const se=I(V,Ne,r0);return ve&&ve(null,1,se),se}ve&&T(Be)};if(!ve)for(;;){const Te=Be();if(Te!=null)return Te}Be()}const pe={scrypt:function(V,Ie,Ce,_e,te,r0,ve){return new Promise(function(Ne,ye){let Xe=0;ve&&ve(0),Ee(V,Ie,Ce,_e,te,r0,function(he,v0,He){if(he)ye(he);else if(He)ve&&Xe!==1&&ve(1),Ne(new Uint8Array(He));else if(ve&&v0!==Xe)return Xe=v0,ve(v0)})})},syncScrypt:function(V,Ie,Ce,_e,te,r0){return new Uint8Array(Ee(V,Ie,Ce,_e,te,r0))}};f.exports=pe})()}(rh)),rh.exports}var sw=ow();const cg=Ji(sw);var fw=function(f,o,c,h){function b(I){return I instanceof c?I:new c(function(y){y(I)})}return new(c||(c=Promise))(function(I,y){function S(R){try{N(h.next(R))}catch(B){y(B)}}function k(R){try{N(h.throw(R))}catch(B){y(B)}}function N(R){R.done?I(R.value):b(R.value).then(S,k)}N((h=h.apply(f,o||[])).next())})};const rd=new zt(Py);function Ap(f){return f!=null&&f.mnemonic&&f.mnemonic.phrase}class cw extends Iy{isKeystoreAccount(o){return!!(o&&o._isKeystoreAccount)}}function uw(f,o,c){if(Bn(f,"crypto/cipher")==="aes-128-ctr"){const b=g2(Bn(f,"crypto/cipherparams/iv")),I=new ua.Counter(b),y=new ua.ModeOfOperation.ctr(o,I);return Nt(y.decrypt(c))}return null}function Ry(f,o){const c=g2(Bn(f,"crypto/ciphertext"));if(or(mA(No([o.slice(16,32),c]))).substring(2)!==Bn(f,"crypto/mac").toLowerCase())throw new Error("invalid password");const b=uw(f,o.slice(0,16),c);b||rd.throwError("unsupported cipher",zt.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const I=o.slice(32,64),y=ys(b);if(f.address){let k=f.address.toLowerCase();if(k.substring(0,2)!=="0x"&&(k="0x"+k),Ti(k)!==y)throw new Error("address mismatch")}const S={_isKeystoreAccount:!0,address:y,privateKey:or(b)};if(Bn(f,"x-ethers/version")==="0.1"){const k=g2(Bn(f,"x-ethers/mnemonicCiphertext")),N=g2(Bn(f,"x-ethers/mnemonicCounter")),R=new ua.Counter(N),B=new ua.ModeOfOperation.ctr(I,R),oe=Bn(f,"x-ethers/path")||Qf,Ee=Bn(f,"x-ethers/locale")||"en",pe=Nt(B.decrypt(k));try{const V=sg(pe,Ee),Ie=gi.fromMnemonic(V,null,Ee).derivePath(oe);if(Ie.privateKey!=S.privateKey)throw new Error("mnemonic mismatch");S.mnemonic=Ie.mnemonic}catch(V){if(V.code!==zt.errors.INVALID_ARGUMENT||V.argument!=="wordlist")throw V}}return new cw(S)}function Gy(f,o,c,h,b){return Nt(ng(f,o,c,h,b))}function lw(f,o,c,h,b){return Promise.resolve(Gy(f,o,c,h,b))}function Yy(f,o,c,h,b){const I=fg(o),y=Bn(f,"crypto/kdf");if(y&&typeof y=="string"){const S=function(k,N){return rd.throwArgumentError("invalid key-derivation function parameters",k,N)};if(y.toLowerCase()==="scrypt"){const k=g2(Bn(f,"crypto/kdfparams/salt")),N=parseInt(Bn(f,"crypto/kdfparams/n")),R=parseInt(Bn(f,"crypto/kdfparams/r")),B=parseInt(Bn(f,"crypto/kdfparams/p"));(!N||!R||!B)&&S("kdf",y),(N&N-1)!==0&&S("N",N);const oe=parseInt(Bn(f,"crypto/kdfparams/dklen"));return oe!==32&&S("dklen",oe),h(I,k,N,R,B,64,b)}else if(y.toLowerCase()==="pbkdf2"){const k=g2(Bn(f,"crypto/kdfparams/salt"));let N=null;const R=Bn(f,"crypto/kdfparams/prf");R==="hmac-sha256"?N="sha256":R==="hmac-sha512"?N="sha512":S("prf",R);const B=parseInt(Bn(f,"crypto/kdfparams/c")),oe=parseInt(Bn(f,"crypto/kdfparams/dklen"));return oe!==32&&S("dklen",oe),c(I,k,B,oe,N)}}return rd.throwArgumentError("unsupported key-derivation function","kdf",y)}function hw(f,o){const c=JSON.parse(f),h=Yy(c,o,Gy,cg.syncScrypt);return Ry(c,h)}function dw(f,o,c){return fw(this,void 0,void 0,function*(){const h=JSON.parse(f),b=yield Yy(h,o,lw,cg.scrypt,c);return Ry(h,b)})}function gw(f,o,c,h){try{if(Ti(f.address)!==ys(f.privateKey))throw new Error("address/privateKey mismatch");if(Ap(f)){const Ie=f.mnemonic;if(gi.fromMnemonic(Ie.phrase,null,Ie.locale).derivePath(Ie.path||Qf).privateKey!=f.privateKey)throw new Error("mnemonic mismatch")}}catch(Ie){return Promise.reject(Ie)}typeof c=="function"&&!h&&(h=c,c={}),c||(c={});const b=Nt(f.privateKey),I=fg(o);let y=null,S=null,k=null;if(Ap(f)){const Ie=f.mnemonic;y=Nt(Fy(Ie.phrase,Ie.locale||"en")),S=Ie.path||Qf,k=Ie.locale||"en"}let N=c.client;N||(N="ethers.js");let R=null;c.salt?R=Nt(c.salt):R=ff(32);let B=null;if(c.iv){if(B=Nt(c.iv),B.length!==16)throw new Error("invalid iv")}else B=ff(16);let oe=null;if(c.uuid){if(oe=Nt(c.uuid),oe.length!==16)throw new Error("invalid uuid")}else oe=ff(16);let Ee=1<<17,pe=8,V=1;return c.scrypt&&(c.scrypt.N&&(Ee=c.scrypt.N),c.scrypt.r&&(pe=c.scrypt.r),c.scrypt.p&&(V=c.scrypt.p)),cg.scrypt(I,R,Ee,pe,V,64,h).then(Ie=>{Ie=Nt(Ie);const Ce=Ie.slice(0,16),_e=Ie.slice(16,32),te=Ie.slice(32,64),r0=new ua.Counter(B),ve=new ua.ModeOfOperation.ctr(Ce,r0),Ne=Nt(ve.encrypt(b)),ye=mA(No([_e,Ne])),Xe={address:f.address.substring(2).toLowerCase(),id:Aw(oe),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:or(B).substring(2)},ciphertext:or(Ne).substring(2),kdf:"scrypt",kdfparams:{salt:or(R).substring(2),n:Ee,dklen:32,p:V,r:pe},mac:ye.substring(2)}};if(y){const he=ff(16),v0=new ua.Counter(he),He=new ua.ModeOfOperation.ctr(te,v0),q=Nt(He.encrypt(y)),J=new Date,Q=J.getUTCFullYear()+"-"+Af(J.getUTCMonth()+1,2)+"-"+Af(J.getUTCDate(),2)+"T"+Af(J.getUTCHours(),2)+"-"+Af(J.getUTCMinutes(),2)+"-"+Af(J.getUTCSeconds(),2)+".0Z";Xe["x-ethers"]={client:N,gethFilename:"UTC--"+Q+"--"+Xe.address,mnemonicCounter:or(he).substring(2),mnemonicCiphertext:or(q).substring(2),path:S,locale:k,version:"0.1"}}return JSON.stringify(Xe)})}function pw(f,o,c){if(Uy(f)){c&&c(0);const h=Ky(f,o);return c&&c(1),Promise.resolve(h)}return Hy(f)?dw(f,o,c):Promise.reject(new Error("invalid JSON wallet"))}function yw(f,o){if(Uy(f))return Ky(f,o);if(Hy(f))return hw(f,o);throw new Error("invalid JSON wallet")}const Cw="wallet/5.8.0";var ip=function(f,o,c,h){function b(I){return I instanceof c?I:new c(function(y){y(I)})}return new(c||(c=Promise))(function(I,y){function S(R){try{N(h.next(R))}catch(B){y(B)}}function k(R){try{N(h.throw(R))}catch(B){y(B)}}function N(R){R.done?I(R.value):b(R.value).then(S,k)}N((h=h.apply(f,o||[])).next())})};const As=new zt(Cw);function Iw(f){return f!=null&&QA(f.privateKey,32)&&f.address!=null}function bw(f){const o=f.mnemonic;return o&&o.phrase}class c2 extends tg{constructor(o,c){if(super(),Iw(o)){const h=new ps(o.privateKey);if(lr(this,"_signingKey",()=>h),lr(this,"address",ys(this.publicKey)),this.address!==Ti(o.address)&&As.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),bw(o)){const b=o.mnemonic;lr(this,"_mnemonic",()=>({phrase:b.phrase,path:b.path||Qf,locale:b.locale||"en"}));const I=this.mnemonic,y=gi.fromMnemonic(I.phrase,null,I.locale).derivePath(I.path);ys(y.privateKey)!==this.address&&As.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else lr(this,"_mnemonic",()=>null)}else{if(ps.isSigningKey(o))o.curve!=="secp256k1"&&As.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),lr(this,"_signingKey",()=>o);else{typeof o=="string"&&o.match(/^[0-9a-f]*$/i)&&o.length===64&&(o="0x"+o);const h=new ps(o);lr(this,"_signingKey",()=>h)}lr(this,"_mnemonic",()=>null),lr(this,"address",ys(this.publicKey))}c&&!eg.isProvider(c)&&As.throwArgumentError("invalid provider","provider",c),lr(this,"provider",c||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(o){return new c2(this,o)}signTransaction(o){return as(o).then(c=>{c.from!=null&&(Ti(c.from)!==this.address&&As.throwArgumentError("transaction from address mismatch","transaction.from",o.from),delete c.from);const h=this._signingKey().signDigest(mA(W8(c)));return W8(c,h)})}signMessage(o){return ip(this,void 0,void 0,function*(){return Wh(this._signingKey().signDigest(fB(o)))})}_signTypedData(o,c,h){return ip(this,void 0,void 0,function*(){const b=yield WA.resolveNames(o,c,h,I=>(this.provider==null&&As.throwError("cannot resolve ENS names without a provider",zt.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:I}),this.provider.resolveName(I)));return Wh(this._signingKey().signDigest(WA.hash(b.domain,c,b.value)))})}encrypt(o,c,h){if(typeof c=="function"&&!h&&(h=c,c={}),h&&typeof h!="function")throw new Error("invalid callback");return c||(c={}),gw(this,o,c,h)}static createRandom(o){let c=ff(16);o||(o={}),o.extraEntropy&&(c=Nt(_f(mA(No([c,o.extraEntropy])),0,16)));const h=sg(c,o.locale);return c2.fromMnemonic(h,o.path,o.locale)}static fromEncryptedJson(o,c,h){return pw(o,c,h).then(b=>new c2(b))}static fromEncryptedJsonSync(o,c){return new c2(yw(o,c))}static fromMnemonic(o,c,h){return c||(c=Qf),new c2(gi.fromMnemonic(o,null,h).derivePath(c))}}var nh={};const vw="6.6.1",xw={version:vw};var Ah={},r1={exports:{}},Ew=r1.exports,ap;function Oa(){return ap||(ap=1,function(f){(function(o,c){function h(He,q){if(!He)throw new Error(q||"Assertion failed")}function b(He,q){He.super_=q;var J=function(){};J.prototype=q.prototype,He.prototype=new J,He.prototype.constructor=He}function I(He,q,J){if(I.isBN(He))return He;this.negative=0,this.words=null,this.length=0,this.red=null,He!==null&&((q==="le"||q==="be")&&(J=q,q=10),this._init(He||0,q||10,J||"be"))}typeof o=="object"?o.exports=I:c.BN=I,I.BN=I,I.wordSize=26;var y;try{typeof window<"u"&&typeof window.Buffer<"u"?y=window.Buffer:y=Ra.Buffer}catch{}I.isBN=function(q){return q instanceof I?!0:q!==null&&typeof q=="object"&&q.constructor.wordSize===I.wordSize&&Array.isArray(q.words)},I.max=function(q,J){return q.cmp(J)>0?q:J},I.min=function(q,J){return q.cmp(J)<0?q:J},I.prototype._init=function(q,J,Q){if(typeof q=="number")return this._initNumber(q,J,Q);if(typeof q=="object")return this._initArray(q,J,Q);J==="hex"&&(J=16),h(J===(J|0)&&J>=2&&J<=36),q=q.toString().replace(/\s+/g,"");var L=0;q[0]==="-"&&(L++,this.negative=1),L<q.length&&(J===16?this._parseHex(q,L,Q):(this._parseBase(q,J,L),Q==="le"&&this._initArray(this.toArray(),J,Q)))},I.prototype._initNumber=function(q,J,Q){q<0&&(this.negative=1,q=-q),q<67108864?(this.words=[q&67108863],this.length=1):q<4503599627370496?(this.words=[q&67108863,q/67108864&67108863],this.length=2):(h(q<9007199254740992),this.words=[q&67108863,q/67108864&67108863,1],this.length=3),Q==="le"&&this._initArray(this.toArray(),J,Q)},I.prototype._initArray=function(q,J,Q){if(h(typeof q.length=="number"),q.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(q.length/3),this.words=new Array(this.length);for(var L=0;L<this.length;L++)this.words[L]=0;var W,Ae,ie=0;if(Q==="be")for(L=q.length-1,W=0;L>=0;L-=3)Ae=q[L]|q[L-1]<<8|q[L-2]<<16,this.words[W]|=Ae<<ie&67108863,this.words[W+1]=Ae>>>26-ie&67108863,ie+=24,ie>=26&&(ie-=26,W++);else if(Q==="le")for(L=0,W=0;L<q.length;L+=3)Ae=q[L]|q[L+1]<<8|q[L+2]<<16,this.words[W]|=Ae<<ie&67108863,this.words[W+1]=Ae>>>26-ie&67108863,ie+=24,ie>=26&&(ie-=26,W++);return this.strip()};function S(He,q){var J=He.charCodeAt(q);return J>=65&&J<=70?J-55:J>=97&&J<=102?J-87:J-48&15}function k(He,q,J){var Q=S(He,J);return J-1>=q&&(Q|=S(He,J-1)<<4),Q}I.prototype._parseHex=function(q,J,Q){this.length=Math.ceil((q.length-J)/6),this.words=new Array(this.length);for(var L=0;L<this.length;L++)this.words[L]=0;var W=0,Ae=0,ie;if(Q==="be")for(L=q.length-1;L>=J;L-=2)ie=k(q,J,L)<<W,this.words[Ae]|=ie&67108863,W>=18?(W-=18,Ae+=1,this.words[Ae]|=ie>>>26):W+=8;else{var fe=q.length-J;for(L=fe%2===0?J+1:J;L<q.length;L+=2)ie=k(q,J,L)<<W,this.words[Ae]|=ie&67108863,W>=18?(W-=18,Ae+=1,this.words[Ae]|=ie>>>26):W+=8}this.strip()};function N(He,q,J,Q){for(var L=0,W=Math.min(He.length,J),Ae=q;Ae<W;Ae++){var ie=He.charCodeAt(Ae)-48;L*=Q,ie>=49?L+=ie-49+10:ie>=17?L+=ie-17+10:L+=ie}return L}I.prototype._parseBase=function(q,J,Q){this.words=[0],this.length=1;for(var L=0,W=1;W<=67108863;W*=J)L++;L--,W=W/J|0;for(var Ae=q.length-Q,ie=Ae%L,fe=Math.min(Ae,Ae-ie)+Q,z=0,G=Q;G<fe;G+=L)z=N(q,G,G+L,J),this.imuln(W),this.words[0]+z<67108864?this.words[0]+=z:this._iaddn(z);if(ie!==0){var T=1;for(z=N(q,G,q.length,J),G=0;G<ie;G++)T*=J;this.imuln(T),this.words[0]+z<67108864?this.words[0]+=z:this._iaddn(z)}this.strip()},I.prototype.copy=function(q){q.words=new Array(this.length);for(var J=0;J<this.length;J++)q.words[J]=this.words[J];q.length=this.length,q.negative=this.negative,q.red=this.red},I.prototype.clone=function(){var q=new I(null);return this.copy(q),q},I.prototype._expand=function(q){for(;this.length<q;)this.words[this.length++]=0;return this},I.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},I.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},I.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var R=["","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"],B=[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],oe=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];I.prototype.toString=function(q,J){q=q||10,J=J|0||1;var Q;if(q===16||q==="hex"){Q="";for(var L=0,W=0,Ae=0;Ae<this.length;Ae++){var ie=this.words[Ae],fe=((ie<<L|W)&16777215).toString(16);W=ie>>>24-L&16777215,L+=2,L>=26&&(L-=26,Ae--),W!==0||Ae!==this.length-1?Q=R[6-fe.length]+fe+Q:Q=fe+Q}for(W!==0&&(Q=W.toString(16)+Q);Q.length%J!==0;)Q="0"+Q;return this.negative!==0&&(Q="-"+Q),Q}if(q===(q|0)&&q>=2&&q<=36){var z=B[q],G=oe[q];Q="";var T=this.clone();for(T.negative=0;!T.isZero();){var Be=T.modn(G).toString(q);T=T.idivn(G),T.isZero()?Q=Be+Q:Q=R[z-Be.length]+Be+Q}for(this.isZero()&&(Q="0"+Q);Q.length%J!==0;)Q="0"+Q;return this.negative!==0&&(Q="-"+Q),Q}h(!1,"Base should be between 2 and 36")},I.prototype.toNumber=function(){var q=this.words[0];return this.length===2?q+=this.words[1]*67108864:this.length===3&&this.words[2]===1?q+=4503599627370496+this.words[1]*67108864:this.length>2&&h(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-q:q},I.prototype.toJSON=function(){return this.toString(16)},I.prototype.toBuffer=function(q,J){return h(typeof y<"u"),this.toArrayLike(y,q,J)},I.prototype.toArray=function(q,J){return this.toArrayLike(Array,q,J)},I.prototype.toArrayLike=function(q,J,Q){var L=this.byteLength(),W=Q||Math.max(1,L);h(L<=W,"byte array longer than desired length"),h(W>0,"Requested array length <= 0"),this.strip();var Ae=J==="le",ie=new q(W),fe,z,G=this.clone();if(Ae){for(z=0;!G.isZero();z++)fe=G.andln(255),G.iushrn(8),ie[z]=fe;for(;z<W;z++)ie[z]=0}else{for(z=0;z<W-L;z++)ie[z]=0;for(z=0;!G.isZero();z++)fe=G.andln(255),G.iushrn(8),ie[W-z-1]=fe}return ie},Math.clz32?I.prototype._countBits=function(q){return 32-Math.clz32(q)}:I.prototype._countBits=function(q){var J=q,Q=0;return J>=4096&&(Q+=13,J>>>=13),J>=64&&(Q+=7,J>>>=7),J>=8&&(Q+=4,J>>>=4),J>=2&&(Q+=2,J>>>=2),Q+J},I.prototype._zeroBits=function(q){if(q===0)return 26;var J=q,Q=0;return(J&8191)===0&&(Q+=13,J>>>=13),(J&127)===0&&(Q+=7,J>>>=7),(J&15)===0&&(Q+=4,J>>>=4),(J&3)===0&&(Q+=2,J>>>=2),(J&1)===0&&Q++,Q},I.prototype.bitLength=function(){var q=this.words[this.length-1],J=this._countBits(q);return(this.length-1)*26+J};function Ee(He){for(var q=new Array(He.bitLength()),J=0;J<q.length;J++){var Q=J/26|0,L=J%26;q[J]=(He.words[Q]&1<<L)>>>L}return q}I.prototype.zeroBits=function(){if(this.isZero())return 0;for(var q=0,J=0;J<this.length;J++){var Q=this._zeroBits(this.words[J]);if(q+=Q,Q!==26)break}return q},I.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},I.prototype.toTwos=function(q){return this.negative!==0?this.abs().inotn(q).iaddn(1):this.clone()},I.prototype.fromTwos=function(q){return this.testn(q-1)?this.notn(q).iaddn(1).ineg():this.clone()},I.prototype.isNeg=function(){return this.negative!==0},I.prototype.neg=function(){return this.clone().ineg()},I.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},I.prototype.iuor=function(q){for(;this.length<q.length;)this.words[this.length++]=0;for(var J=0;J<q.length;J++)this.words[J]=this.words[J]|q.words[J];return this.strip()},I.prototype.ior=function(q){return h((this.negative|q.negative)===0),this.iuor(q)},I.prototype.or=function(q){return this.length>q.length?this.clone().ior(q):q.clone().ior(this)},I.prototype.uor=function(q){return this.length>q.length?this.clone().iuor(q):q.clone().iuor(this)},I.prototype.iuand=function(q){var J;this.length>q.length?J=q:J=this;for(var Q=0;Q<J.length;Q++)this.words[Q]=this.words[Q]&q.words[Q];return this.length=J.length,this.strip()},I.prototype.iand=function(q){return h((this.negative|q.negative)===0),this.iuand(q)},I.prototype.and=function(q){return this.length>q.length?this.clone().iand(q):q.clone().iand(this)},I.prototype.uand=function(q){return this.length>q.length?this.clone().iuand(q):q.clone().iuand(this)},I.prototype.iuxor=function(q){var J,Q;this.length>q.length?(J=this,Q=q):(J=q,Q=this);for(var L=0;L<Q.length;L++)this.words[L]=J.words[L]^Q.words[L];if(this!==J)for(;L<J.length;L++)this.words[L]=J.words[L];return this.length=J.length,this.strip()},I.prototype.ixor=function(q){return h((this.negative|q.negative)===0),this.iuxor(q)},I.prototype.xor=function(q){return this.length>q.length?this.clone().ixor(q):q.clone().ixor(this)},I.prototype.uxor=function(q){return this.length>q.length?this.clone().iuxor(q):q.clone().iuxor(this)},I.prototype.inotn=function(q){h(typeof q=="number"&&q>=0);var J=Math.ceil(q/26)|0,Q=q%26;this._expand(J),Q>0&&J--;for(var L=0;L<J;L++)this.words[L]=~this.words[L]&67108863;return Q>0&&(this.words[L]=~this.words[L]&67108863>>26-Q),this.strip()},I.prototype.notn=function(q){return this.clone().inotn(q)},I.prototype.setn=function(q,J){h(typeof q=="number"&&q>=0);var Q=q/26|0,L=q%26;return this._expand(Q+1),J?this.words[Q]=this.words[Q]|1<<L:this.words[Q]=this.words[Q]&~(1<<L),this.strip()},I.prototype.iadd=function(q){var J;if(this.negative!==0&&q.negative===0)return this.negative=0,J=this.isub(q),this.negative^=1,this._normSign();if(this.negative===0&&q.negative!==0)return q.negative=0,J=this.isub(q),q.negative=1,J._normSign();var Q,L;this.length>q.length?(Q=this,L=q):(Q=q,L=this);for(var W=0,Ae=0;Ae<L.length;Ae++)J=(Q.words[Ae]|0)+(L.words[Ae]|0)+W,this.words[Ae]=J&67108863,W=J>>>26;for(;W!==0&&Ae<Q.length;Ae++)J=(Q.words[Ae]|0)+W,this.words[Ae]=J&67108863,W=J>>>26;if(this.length=Q.length,W!==0)this.words[this.length]=W,this.length++;else if(Q!==this)for(;Ae<Q.length;Ae++)this.words[Ae]=Q.words[Ae];return this},I.prototype.add=function(q){var J;return q.negative!==0&&this.negative===0?(q.negative=0,J=this.sub(q),q.negative^=1,J):q.negative===0&&this.negative!==0?(this.negative=0,J=q.sub(this),this.negative=1,J):this.length>q.length?this.clone().iadd(q):q.clone().iadd(this)},I.prototype.isub=function(q){if(q.negative!==0){q.negative=0;var J=this.iadd(q);return q.negative=1,J._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(q),this.negative=1,this._normSign();var Q=this.cmp(q);if(Q===0)return this.negative=0,this.length=1,this.words[0]=0,this;var L,W;Q>0?(L=this,W=q):(L=q,W=this);for(var Ae=0,ie=0;ie<W.length;ie++)J=(L.words[ie]|0)-(W.words[ie]|0)+Ae,Ae=J>>26,this.words[ie]=J&67108863;for(;Ae!==0&&ie<L.length;ie++)J=(L.words[ie]|0)+Ae,Ae=J>>26,this.words[ie]=J&67108863;if(Ae===0&&ie<L.length&&L!==this)for(;ie<L.length;ie++)this.words[ie]=L.words[ie];return this.length=Math.max(this.length,ie),L!==this&&(this.negative=1),this.strip()},I.prototype.sub=function(q){return this.clone().isub(q)};function pe(He,q,J){J.negative=q.negative^He.negative;var Q=He.length+q.length|0;J.length=Q,Q=Q-1|0;var L=He.words[0]|0,W=q.words[0]|0,Ae=L*W,ie=Ae&67108863,fe=Ae/67108864|0;J.words[0]=ie;for(var z=1;z<Q;z++){for(var G=fe>>>26,T=fe&67108863,Be=Math.min(z,q.length-1),Te=Math.max(0,z-He.length+1);Te<=Be;Te++){var se=z-Te|0;L=He.words[se]|0,W=q.words[Te]|0,Ae=L*W+T,G+=Ae/67108864|0,T=Ae&67108863}J.words[z]=T|0,fe=G|0}return fe!==0?J.words[z]=fe|0:J.length--,J.strip()}var V=function(q,J,Q){var L=q.words,W=J.words,Ae=Q.words,ie=0,fe,z,G,T=L[0]|0,Be=T&8191,Te=T>>>13,se=L[1]|0,ze=se&8191,s0=se>>>13,l0=L[2]|0,p0=l0&8191,G0=l0>>>13,X0=L[3]|0,Y0=X0&8191,Ze=X0>>>13,ot=L[4]|0,Pe=ot&8191,e0=ot>>>13,o0=L[5]|0,ne=o0&8191,B0=o0>>>13,K0=L[6]|0,N0=K0&8191,st=K0>>>13,Z0=L[7]|0,W0=Z0&8191,vt=Z0>>>13,er=L[8]|0,Yt=er&8191,yr=er>>>13,xr=L[9]|0,Lt=xr&8191,hr=xr>>>13,kr=W[0]|0,qt=kr&8191,Er=kr>>>13,Mr=W[1]|0,Jt=Mr&8191,Qr=Mr>>>13,Sr=W[2]|0,$t=Sr&8191,Dr=Sr>>>13,Cr=W[3]|0,Ut=Cr&8191,br=Cr>>>13,dr=W[4]|0,jt=dr&8191,Fr=dr>>>13,Pr=W[5]|0,Vt=Pr&8191,_r=Pr>>>13,vr=W[6]|0,Ot=vr&8191,Ir=vr>>>13,Kr=W[7]|0,Xt=Kr&8191,a0=Kr>>>13,Br=W[8]|0,Ye=Br&8191,n0=Br>>>13,u0=W[9]|0,d0=u0&8191,E0=u0>>>13;Q.negative=q.negative^J.negative,Q.length=19,fe=Math.imul(Be,qt),z=Math.imul(Be,Er),z=z+Math.imul(Te,qt)|0,G=Math.imul(Te,Er);var P0=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(P0>>>26)|0,P0&=67108863,fe=Math.imul(ze,qt),z=Math.imul(ze,Er),z=z+Math.imul(s0,qt)|0,G=Math.imul(s0,Er),fe=fe+Math.imul(Be,Jt)|0,z=z+Math.imul(Be,Qr)|0,z=z+Math.imul(Te,Jt)|0,G=G+Math.imul(Te,Qr)|0;var L0=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(L0>>>26)|0,L0&=67108863,fe=Math.imul(p0,qt),z=Math.imul(p0,Er),z=z+Math.imul(G0,qt)|0,G=Math.imul(G0,Er),fe=fe+Math.imul(ze,Jt)|0,z=z+Math.imul(ze,Qr)|0,z=z+Math.imul(s0,Jt)|0,G=G+Math.imul(s0,Qr)|0,fe=fe+Math.imul(Be,$t)|0,z=z+Math.imul(Be,Dr)|0,z=z+Math.imul(Te,$t)|0,G=G+Math.imul(Te,Dr)|0;var it=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(it>>>26)|0,it&=67108863,fe=Math.imul(Y0,qt),z=Math.imul(Y0,Er),z=z+Math.imul(Ze,qt)|0,G=Math.imul(Ze,Er),fe=fe+Math.imul(p0,Jt)|0,z=z+Math.imul(p0,Qr)|0,z=z+Math.imul(G0,Jt)|0,G=G+Math.imul(G0,Qr)|0,fe=fe+Math.imul(ze,$t)|0,z=z+Math.imul(ze,Dr)|0,z=z+Math.imul(s0,$t)|0,G=G+Math.imul(s0,Dr)|0,fe=fe+Math.imul(Be,Ut)|0,z=z+Math.imul(Be,br)|0,z=z+Math.imul(Te,Ut)|0,G=G+Math.imul(Te,br)|0;var Et=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(Et>>>26)|0,Et&=67108863,fe=Math.imul(Pe,qt),z=Math.imul(Pe,Er),z=z+Math.imul(e0,qt)|0,G=Math.imul(e0,Er),fe=fe+Math.imul(Y0,Jt)|0,z=z+Math.imul(Y0,Qr)|0,z=z+Math.imul(Ze,Jt)|0,G=G+Math.imul(Ze,Qr)|0,fe=fe+Math.imul(p0,$t)|0,z=z+Math.imul(p0,Dr)|0,z=z+Math.imul(G0,$t)|0,G=G+Math.imul(G0,Dr)|0,fe=fe+Math.imul(ze,Ut)|0,z=z+Math.imul(ze,br)|0,z=z+Math.imul(s0,Ut)|0,G=G+Math.imul(s0,br)|0,fe=fe+Math.imul(Be,jt)|0,z=z+Math.imul(Be,Fr)|0,z=z+Math.imul(Te,jt)|0,G=G+Math.imul(Te,Fr)|0;var Bt=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,fe=Math.imul(ne,qt),z=Math.imul(ne,Er),z=z+Math.imul(B0,qt)|0,G=Math.imul(B0,Er),fe=fe+Math.imul(Pe,Jt)|0,z=z+Math.imul(Pe,Qr)|0,z=z+Math.imul(e0,Jt)|0,G=G+Math.imul(e0,Qr)|0,fe=fe+Math.imul(Y0,$t)|0,z=z+Math.imul(Y0,Dr)|0,z=z+Math.imul(Ze,$t)|0,G=G+Math.imul(Ze,Dr)|0,fe=fe+Math.imul(p0,Ut)|0,z=z+Math.imul(p0,br)|0,z=z+Math.imul(G0,Ut)|0,G=G+Math.imul(G0,br)|0,fe=fe+Math.imul(ze,jt)|0,z=z+Math.imul(ze,Fr)|0,z=z+Math.imul(s0,jt)|0,G=G+Math.imul(s0,Fr)|0,fe=fe+Math.imul(Be,Vt)|0,z=z+Math.imul(Be,_r)|0,z=z+Math.imul(Te,Vt)|0,G=G+Math.imul(Te,_r)|0;var C=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(C>>>26)|0,C&=67108863,fe=Math.imul(N0,qt),z=Math.imul(N0,Er),z=z+Math.imul(st,qt)|0,G=Math.imul(st,Er),fe=fe+Math.imul(ne,Jt)|0,z=z+Math.imul(ne,Qr)|0,z=z+Math.imul(B0,Jt)|0,G=G+Math.imul(B0,Qr)|0,fe=fe+Math.imul(Pe,$t)|0,z=z+Math.imul(Pe,Dr)|0,z=z+Math.imul(e0,$t)|0,G=G+Math.imul(e0,Dr)|0,fe=fe+Math.imul(Y0,Ut)|0,z=z+Math.imul(Y0,br)|0,z=z+Math.imul(Ze,Ut)|0,G=G+Math.imul(Ze,br)|0,fe=fe+Math.imul(p0,jt)|0,z=z+Math.imul(p0,Fr)|0,z=z+Math.imul(G0,jt)|0,G=G+Math.imul(G0,Fr)|0,fe=fe+Math.imul(ze,Vt)|0,z=z+Math.imul(ze,_r)|0,z=z+Math.imul(s0,Vt)|0,G=G+Math.imul(s0,_r)|0,fe=fe+Math.imul(Be,Ot)|0,z=z+Math.imul(Be,Ir)|0,z=z+Math.imul(Te,Ot)|0,G=G+Math.imul(Te,Ir)|0;var e=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(e>>>26)|0,e&=67108863,fe=Math.imul(W0,qt),z=Math.imul(W0,Er),z=z+Math.imul(vt,qt)|0,G=Math.imul(vt,Er),fe=fe+Math.imul(N0,Jt)|0,z=z+Math.imul(N0,Qr)|0,z=z+Math.imul(st,Jt)|0,G=G+Math.imul(st,Qr)|0,fe=fe+Math.imul(ne,$t)|0,z=z+Math.imul(ne,Dr)|0,z=z+Math.imul(B0,$t)|0,G=G+Math.imul(B0,Dr)|0,fe=fe+Math.imul(Pe,Ut)|0,z=z+Math.imul(Pe,br)|0,z=z+Math.imul(e0,Ut)|0,G=G+Math.imul(e0,br)|0,fe=fe+Math.imul(Y0,jt)|0,z=z+Math.imul(Y0,Fr)|0,z=z+Math.imul(Ze,jt)|0,G=G+Math.imul(Ze,Fr)|0,fe=fe+Math.imul(p0,Vt)|0,z=z+Math.imul(p0,_r)|0,z=z+Math.imul(G0,Vt)|0,G=G+Math.imul(G0,_r)|0,fe=fe+Math.imul(ze,Ot)|0,z=z+Math.imul(ze,Ir)|0,z=z+Math.imul(s0,Ot)|0,G=G+Math.imul(s0,Ir)|0,fe=fe+Math.imul(Be,Xt)|0,z=z+Math.imul(Be,a0)|0,z=z+Math.imul(Te,Xt)|0,G=G+Math.imul(Te,a0)|0;var s=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(s>>>26)|0,s&=67108863,fe=Math.imul(Yt,qt),z=Math.imul(Yt,Er),z=z+Math.imul(yr,qt)|0,G=Math.imul(yr,Er),fe=fe+Math.imul(W0,Jt)|0,z=z+Math.imul(W0,Qr)|0,z=z+Math.imul(vt,Jt)|0,G=G+Math.imul(vt,Qr)|0,fe=fe+Math.imul(N0,$t)|0,z=z+Math.imul(N0,Dr)|0,z=z+Math.imul(st,$t)|0,G=G+Math.imul(st,Dr)|0,fe=fe+Math.imul(ne,Ut)|0,z=z+Math.imul(ne,br)|0,z=z+Math.imul(B0,Ut)|0,G=G+Math.imul(B0,br)|0,fe=fe+Math.imul(Pe,jt)|0,z=z+Math.imul(Pe,Fr)|0,z=z+Math.imul(e0,jt)|0,G=G+Math.imul(e0,Fr)|0,fe=fe+Math.imul(Y0,Vt)|0,z=z+Math.imul(Y0,_r)|0,z=z+Math.imul(Ze,Vt)|0,G=G+Math.imul(Ze,_r)|0,fe=fe+Math.imul(p0,Ot)|0,z=z+Math.imul(p0,Ir)|0,z=z+Math.imul(G0,Ot)|0,G=G+Math.imul(G0,Ir)|0,fe=fe+Math.imul(ze,Xt)|0,z=z+Math.imul(ze,a0)|0,z=z+Math.imul(s0,Xt)|0,G=G+Math.imul(s0,a0)|0,fe=fe+Math.imul(Be,Ye)|0,z=z+Math.imul(Be,n0)|0,z=z+Math.imul(Te,Ye)|0,G=G+Math.imul(Te,n0)|0;var an=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(an>>>26)|0,an&=67108863,fe=Math.imul(Lt,qt),z=Math.imul(Lt,Er),z=z+Math.imul(hr,qt)|0,G=Math.imul(hr,Er),fe=fe+Math.imul(Yt,Jt)|0,z=z+Math.imul(Yt,Qr)|0,z=z+Math.imul(yr,Jt)|0,G=G+Math.imul(yr,Qr)|0,fe=fe+Math.imul(W0,$t)|0,z=z+Math.imul(W0,Dr)|0,z=z+Math.imul(vt,$t)|0,G=G+Math.imul(vt,Dr)|0,fe=fe+Math.imul(N0,Ut)|0,z=z+Math.imul(N0,br)|0,z=z+Math.imul(st,Ut)|0,G=G+Math.imul(st,br)|0,fe=fe+Math.imul(ne,jt)|0,z=z+Math.imul(ne,Fr)|0,z=z+Math.imul(B0,jt)|0,G=G+Math.imul(B0,Fr)|0,fe=fe+Math.imul(Pe,Vt)|0,z=z+Math.imul(Pe,_r)|0,z=z+Math.imul(e0,Vt)|0,G=G+Math.imul(e0,_r)|0,fe=fe+Math.imul(Y0,Ot)|0,z=z+Math.imul(Y0,Ir)|0,z=z+Math.imul(Ze,Ot)|0,G=G+Math.imul(Ze,Ir)|0,fe=fe+Math.imul(p0,Xt)|0,z=z+Math.imul(p0,a0)|0,z=z+Math.imul(G0,Xt)|0,G=G+Math.imul(G0,a0)|0,fe=fe+Math.imul(ze,Ye)|0,z=z+Math.imul(ze,n0)|0,z=z+Math.imul(s0,Ye)|0,G=G+Math.imul(s0,n0)|0,fe=fe+Math.imul(Be,d0)|0,z=z+Math.imul(Be,E0)|0,z=z+Math.imul(Te,d0)|0,G=G+Math.imul(Te,E0)|0;var gt=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(gt>>>26)|0,gt&=67108863,fe=Math.imul(Lt,Jt),z=Math.imul(Lt,Qr),z=z+Math.imul(hr,Jt)|0,G=Math.imul(hr,Qr),fe=fe+Math.imul(Yt,$t)|0,z=z+Math.imul(Yt,Dr)|0,z=z+Math.imul(yr,$t)|0,G=G+Math.imul(yr,Dr)|0,fe=fe+Math.imul(W0,Ut)|0,z=z+Math.imul(W0,br)|0,z=z+Math.imul(vt,Ut)|0,G=G+Math.imul(vt,br)|0,fe=fe+Math.imul(N0,jt)|0,z=z+Math.imul(N0,Fr)|0,z=z+Math.imul(st,jt)|0,G=G+Math.imul(st,Fr)|0,fe=fe+Math.imul(ne,Vt)|0,z=z+Math.imul(ne,_r)|0,z=z+Math.imul(B0,Vt)|0,G=G+Math.imul(B0,_r)|0,fe=fe+Math.imul(Pe,Ot)|0,z=z+Math.imul(Pe,Ir)|0,z=z+Math.imul(e0,Ot)|0,G=G+Math.imul(e0,Ir)|0,fe=fe+Math.imul(Y0,Xt)|0,z=z+Math.imul(Y0,a0)|0,z=z+Math.imul(Ze,Xt)|0,G=G+Math.imul(Ze,a0)|0,fe=fe+Math.imul(p0,Ye)|0,z=z+Math.imul(p0,n0)|0,z=z+Math.imul(G0,Ye)|0,G=G+Math.imul(G0,n0)|0,fe=fe+Math.imul(ze,d0)|0,z=z+Math.imul(ze,E0)|0,z=z+Math.imul(s0,d0)|0,G=G+Math.imul(s0,E0)|0;var on=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(on>>>26)|0,on&=67108863,fe=Math.imul(Lt,$t),z=Math.imul(Lt,Dr),z=z+Math.imul(hr,$t)|0,G=Math.imul(hr,Dr),fe=fe+Math.imul(Yt,Ut)|0,z=z+Math.imul(Yt,br)|0,z=z+Math.imul(yr,Ut)|0,G=G+Math.imul(yr,br)|0,fe=fe+Math.imul(W0,jt)|0,z=z+Math.imul(W0,Fr)|0,z=z+Math.imul(vt,jt)|0,G=G+Math.imul(vt,Fr)|0,fe=fe+Math.imul(N0,Vt)|0,z=z+Math.imul(N0,_r)|0,z=z+Math.imul(st,Vt)|0,G=G+Math.imul(st,_r)|0,fe=fe+Math.imul(ne,Ot)|0,z=z+Math.imul(ne,Ir)|0,z=z+Math.imul(B0,Ot)|0,G=G+Math.imul(B0,Ir)|0,fe=fe+Math.imul(Pe,Xt)|0,z=z+Math.imul(Pe,a0)|0,z=z+Math.imul(e0,Xt)|0,G=G+Math.imul(e0,a0)|0,fe=fe+Math.imul(Y0,Ye)|0,z=z+Math.imul(Y0,n0)|0,z=z+Math.imul(Ze,Ye)|0,G=G+Math.imul(Ze,n0)|0,fe=fe+Math.imul(p0,d0)|0,z=z+Math.imul(p0,E0)|0,z=z+Math.imul(G0,d0)|0,G=G+Math.imul(G0,E0)|0;var vn=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(vn>>>26)|0,vn&=67108863,fe=Math.imul(Lt,Ut),z=Math.imul(Lt,br),z=z+Math.imul(hr,Ut)|0,G=Math.imul(hr,br),fe=fe+Math.imul(Yt,jt)|0,z=z+Math.imul(Yt,Fr)|0,z=z+Math.imul(yr,jt)|0,G=G+Math.imul(yr,Fr)|0,fe=fe+Math.imul(W0,Vt)|0,z=z+Math.imul(W0,_r)|0,z=z+Math.imul(vt,Vt)|0,G=G+Math.imul(vt,_r)|0,fe=fe+Math.imul(N0,Ot)|0,z=z+Math.imul(N0,Ir)|0,z=z+Math.imul(st,Ot)|0,G=G+Math.imul(st,Ir)|0,fe=fe+Math.imul(ne,Xt)|0,z=z+Math.imul(ne,a0)|0,z=z+Math.imul(B0,Xt)|0,G=G+Math.imul(B0,a0)|0,fe=fe+Math.imul(Pe,Ye)|0,z=z+Math.imul(Pe,n0)|0,z=z+Math.imul(e0,Ye)|0,G=G+Math.imul(e0,n0)|0,fe=fe+Math.imul(Y0,d0)|0,z=z+Math.imul(Y0,E0)|0,z=z+Math.imul(Ze,d0)|0,G=G+Math.imul(Ze,E0)|0;var Un=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(Un>>>26)|0,Un&=67108863,fe=Math.imul(Lt,jt),z=Math.imul(Lt,Fr),z=z+Math.imul(hr,jt)|0,G=Math.imul(hr,Fr),fe=fe+Math.imul(Yt,Vt)|0,z=z+Math.imul(Yt,_r)|0,z=z+Math.imul(yr,Vt)|0,G=G+Math.imul(yr,_r)|0,fe=fe+Math.imul(W0,Ot)|0,z=z+Math.imul(W0,Ir)|0,z=z+Math.imul(vt,Ot)|0,G=G+Math.imul(vt,Ir)|0,fe=fe+Math.imul(N0,Xt)|0,z=z+Math.imul(N0,a0)|0,z=z+Math.imul(st,Xt)|0,G=G+Math.imul(st,a0)|0,fe=fe+Math.imul(ne,Ye)|0,z=z+Math.imul(ne,n0)|0,z=z+Math.imul(B0,Ye)|0,G=G+Math.imul(B0,n0)|0,fe=fe+Math.imul(Pe,d0)|0,z=z+Math.imul(Pe,E0)|0,z=z+Math.imul(e0,d0)|0,G=G+Math.imul(e0,E0)|0;var Nn=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(Nn>>>26)|0,Nn&=67108863,fe=Math.imul(Lt,Vt),z=Math.imul(Lt,_r),z=z+Math.imul(hr,Vt)|0,G=Math.imul(hr,_r),fe=fe+Math.imul(Yt,Ot)|0,z=z+Math.imul(Yt,Ir)|0,z=z+Math.imul(yr,Ot)|0,G=G+Math.imul(yr,Ir)|0,fe=fe+Math.imul(W0,Xt)|0,z=z+Math.imul(W0,a0)|0,z=z+Math.imul(vt,Xt)|0,G=G+Math.imul(vt,a0)|0,fe=fe+Math.imul(N0,Ye)|0,z=z+Math.imul(N0,n0)|0,z=z+Math.imul(st,Ye)|0,G=G+Math.imul(st,n0)|0,fe=fe+Math.imul(ne,d0)|0,z=z+Math.imul(ne,E0)|0,z=z+Math.imul(B0,d0)|0,G=G+Math.imul(B0,E0)|0;var TA=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(TA>>>26)|0,TA&=67108863,fe=Math.imul(Lt,Ot),z=Math.imul(Lt,Ir),z=z+Math.imul(hr,Ot)|0,G=Math.imul(hr,Ir),fe=fe+Math.imul(Yt,Xt)|0,z=z+Math.imul(Yt,a0)|0,z=z+Math.imul(yr,Xt)|0,G=G+Math.imul(yr,a0)|0,fe=fe+Math.imul(W0,Ye)|0,z=z+Math.imul(W0,n0)|0,z=z+Math.imul(vt,Ye)|0,G=G+Math.imul(vt,n0)|0,fe=fe+Math.imul(N0,d0)|0,z=z+Math.imul(N0,E0)|0,z=z+Math.imul(st,d0)|0,G=G+Math.imul(st,E0)|0;var SA=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(SA>>>26)|0,SA&=67108863,fe=Math.imul(Lt,Xt),z=Math.imul(Lt,a0),z=z+Math.imul(hr,Xt)|0,G=Math.imul(hr,a0),fe=fe+Math.imul(Yt,Ye)|0,z=z+Math.imul(Yt,n0)|0,z=z+Math.imul(yr,Ye)|0,G=G+Math.imul(yr,n0)|0,fe=fe+Math.imul(W0,d0)|0,z=z+Math.imul(W0,E0)|0,z=z+Math.imul(vt,d0)|0,G=G+Math.imul(vt,E0)|0;var Ve=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,fe=Math.imul(Lt,Ye),z=Math.imul(Lt,n0),z=z+Math.imul(hr,Ye)|0,G=Math.imul(hr,n0),fe=fe+Math.imul(Yt,d0)|0,z=z+Math.imul(Yt,E0)|0,z=z+Math.imul(yr,d0)|0,G=G+Math.imul(yr,E0)|0;var w=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(w>>>26)|0,w&=67108863,fe=Math.imul(Lt,d0),z=Math.imul(Lt,E0),z=z+Math.imul(hr,d0)|0,G=Math.imul(hr,E0);var rA=(ie+fe|0)+((z&8191)<<13)|0;return ie=(G+(z>>>13)|0)+(rA>>>26)|0,rA&=67108863,Ae[0]=P0,Ae[1]=L0,Ae[2]=it,Ae[3]=Et,Ae[4]=Bt,Ae[5]=C,Ae[6]=e,Ae[7]=s,Ae[8]=an,Ae[9]=gt,Ae[10]=on,Ae[11]=vn,Ae[12]=Un,Ae[13]=Nn,Ae[14]=TA,Ae[15]=SA,Ae[16]=Ve,Ae[17]=w,Ae[18]=rA,ie!==0&&(Ae[19]=ie,Q.length++),Q};Math.imul||(V=pe);function Ie(He,q,J){J.negative=q.negative^He.negative,J.length=He.length+q.length;for(var Q=0,L=0,W=0;W<J.length-1;W++){var Ae=L;L=0;for(var ie=Q&67108863,fe=Math.min(W,q.length-1),z=Math.max(0,W-He.length+1);z<=fe;z++){var G=W-z,T=He.words[G]|0,Be=q.words[z]|0,Te=T*Be,se=Te&67108863;Ae=Ae+(Te/67108864|0)|0,se=se+ie|0,ie=se&67108863,Ae=Ae+(se>>>26)|0,L+=Ae>>>26,Ae&=67108863}J.words[W]=ie,Q=Ae,Ae=L}return Q!==0?J.words[W]=Q:J.length--,J.strip()}function Ce(He,q,J){var Q=new _e;return Q.mulp(He,q,J)}I.prototype.mulTo=function(q,J){var Q,L=this.length+q.length;return this.length===10&&q.length===10?Q=V(this,q,J):L<63?Q=pe(this,q,J):L<1024?Q=Ie(this,q,J):Q=Ce(this,q,J),Q};function _e(He,q){this.x=He,this.y=q}_e.prototype.makeRBT=function(q){for(var J=new Array(q),Q=I.prototype._countBits(q)-1,L=0;L<q;L++)J[L]=this.revBin(L,Q,q);return J},_e.prototype.revBin=function(q,J,Q){if(q===0||q===Q-1)return q;for(var L=0,W=0;W<J;W++)L|=(q&1)<<J-W-1,q>>=1;return L},_e.prototype.permute=function(q,J,Q,L,W,Ae){for(var ie=0;ie<Ae;ie++)L[ie]=J[q[ie]],W[ie]=Q[q[ie]]},_e.prototype.transform=function(q,J,Q,L,W,Ae){this.permute(Ae,q,J,Q,L,W);for(var ie=1;ie<W;ie<<=1)for(var fe=ie<<1,z=Math.cos(2*Math.PI/fe),G=Math.sin(2*Math.PI/fe),T=0;T<W;T+=fe)for(var Be=z,Te=G,se=0;se<ie;se++){var ze=Q[T+se],s0=L[T+se],l0=Q[T+se+ie],p0=L[T+se+ie],G0=Be*l0-Te*p0;p0=Be*p0+Te*l0,l0=G0,Q[T+se]=ze+l0,L[T+se]=s0+p0,Q[T+se+ie]=ze-l0,L[T+se+ie]=s0-p0,se!==fe&&(G0=z*Be-G*Te,Te=z*Te+G*Be,Be=G0)}},_e.prototype.guessLen13b=function(q,J){var Q=Math.max(J,q)|1,L=Q&1,W=0;for(Q=Q/2|0;Q;Q=Q>>>1)W++;return 1<<W+1+L},_e.prototype.conjugate=function(q,J,Q){if(!(Q<=1))for(var L=0;L<Q/2;L++){var W=q[L];q[L]=q[Q-L-1],q[Q-L-1]=W,W=J[L],J[L]=-J[Q-L-1],J[Q-L-1]=-W}},_e.prototype.normalize13b=function(q,J){for(var Q=0,L=0;L<J/2;L++){var W=Math.round(q[2*L+1]/J)*8192+Math.round(q[2*L]/J)+Q;q[L]=W&67108863,W<67108864?Q=0:Q=W/67108864|0}return q},_e.prototype.convert13b=function(q,J,Q,L){for(var W=0,Ae=0;Ae<J;Ae++)W=W+(q[Ae]|0),Q[2*Ae]=W&8191,W=W>>>13,Q[2*Ae+1]=W&8191,W=W>>>13;for(Ae=2*J;Ae<L;++Ae)Q[Ae]=0;h(W===0),h((W&-8192)===0)},_e.prototype.stub=function(q){for(var J=new Array(q),Q=0;Q<q;Q++)J[Q]=0;return J},_e.prototype.mulp=function(q,J,Q){var L=2*this.guessLen13b(q.length,J.length),W=this.makeRBT(L),Ae=this.stub(L),ie=new Array(L),fe=new Array(L),z=new Array(L),G=new Array(L),T=new Array(L),Be=new Array(L),Te=Q.words;Te.length=L,this.convert13b(q.words,q.length,ie,L),this.convert13b(J.words,J.length,G,L),this.transform(ie,Ae,fe,z,L,W),this.transform(G,Ae,T,Be,L,W);for(var se=0;se<L;se++){var ze=fe[se]*T[se]-z[se]*Be[se];z[se]=fe[se]*Be[se]+z[se]*T[se],fe[se]=ze}return this.conjugate(fe,z,L),this.transform(fe,z,Te,Ae,L,W),this.conjugate(Te,Ae,L),this.normalize13b(Te,L),Q.negative=q.negative^J.negative,Q.length=q.length+J.length,Q.strip()},I.prototype.mul=function(q){var J=new I(null);return J.words=new Array(this.length+q.length),this.mulTo(q,J)},I.prototype.mulf=function(q){var J=new I(null);return J.words=new Array(this.length+q.length),Ce(this,q,J)},I.prototype.imul=function(q){return this.clone().mulTo(q,this)},I.prototype.imuln=function(q){h(typeof q=="number"),h(q<67108864);for(var J=0,Q=0;Q<this.length;Q++){var L=(this.words[Q]|0)*q,W=(L&67108863)+(J&67108863);J>>=26,J+=L/67108864|0,J+=W>>>26,this.words[Q]=W&67108863}return J!==0&&(this.words[Q]=J,this.length++),this.length=q===0?1:this.length,this},I.prototype.muln=function(q){return this.clone().imuln(q)},I.prototype.sqr=function(){return this.mul(this)},I.prototype.isqr=function(){return this.imul(this.clone())},I.prototype.pow=function(q){var J=Ee(q);if(J.length===0)return new I(1);for(var Q=this,L=0;L<J.length&&J[L]===0;L++,Q=Q.sqr());if(++L<J.length)for(var W=Q.sqr();L<J.length;L++,W=W.sqr())J[L]!==0&&(Q=Q.mul(W));return Q},I.prototype.iushln=function(q){h(typeof q=="number"&&q>=0);var J=q%26,Q=(q-J)/26,L=67108863>>>26-J<<26-J,W;if(J!==0){var Ae=0;for(W=0;W<this.length;W++){var ie=this.words[W]&L,fe=(this.words[W]|0)-ie<<J;this.words[W]=fe|Ae,Ae=ie>>>26-J}Ae&&(this.words[W]=Ae,this.length++)}if(Q!==0){for(W=this.length-1;W>=0;W--)this.words[W+Q]=this.words[W];for(W=0;W<Q;W++)this.words[W]=0;this.length+=Q}return this.strip()},I.prototype.ishln=function(q){return h(this.negative===0),this.iushln(q)},I.prototype.iushrn=function(q,J,Q){h(typeof q=="number"&&q>=0);var L;J?L=(J-J%26)/26:L=0;var W=q%26,Ae=Math.min((q-W)/26,this.length),ie=67108863^67108863>>>W<<W,fe=Q;if(L-=Ae,L=Math.max(0,L),fe){for(var z=0;z<Ae;z++)fe.words[z]=this.words[z];fe.length=Ae}if(Ae!==0)if(this.length>Ae)for(this.length-=Ae,z=0;z<this.length;z++)this.words[z]=this.words[z+Ae];else this.words[0]=0,this.length=1;var G=0;for(z=this.length-1;z>=0&&(G!==0||z>=L);z--){var T=this.words[z]|0;this.words[z]=G<<26-W|T>>>W,G=T&ie}return fe&&G!==0&&(fe.words[fe.length++]=G),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},I.prototype.ishrn=function(q,J,Q){return h(this.negative===0),this.iushrn(q,J,Q)},I.prototype.shln=function(q){return this.clone().ishln(q)},I.prototype.ushln=function(q){return this.clone().iushln(q)},I.prototype.shrn=function(q){return this.clone().ishrn(q)},I.prototype.ushrn=function(q){return this.clone().iushrn(q)},I.prototype.testn=function(q){h(typeof q=="number"&&q>=0);var J=q%26,Q=(q-J)/26,L=1<<J;if(this.length<=Q)return!1;var W=this.words[Q];return!!(W&L)},I.prototype.imaskn=function(q){h(typeof q=="number"&&q>=0);var J=q%26,Q=(q-J)/26;if(h(this.negative===0,"imaskn works only with positive numbers"),this.length<=Q)return this;if(J!==0&&Q++,this.length=Math.min(Q,this.length),J!==0){var L=67108863^67108863>>>J<<J;this.words[this.length-1]&=L}return this.strip()},I.prototype.maskn=function(q){return this.clone().imaskn(q)},I.prototype.iaddn=function(q){return h(typeof q=="number"),h(q<67108864),q<0?this.isubn(-q):this.negative!==0?this.length===1&&(this.words[0]|0)<q?(this.words[0]=q-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(q),this.negative=1,this):this._iaddn(q)},I.prototype._iaddn=function(q){this.words[0]+=q;for(var J=0;J<this.length&&this.words[J]>=67108864;J++)this.words[J]-=67108864,J===this.length-1?this.words[J+1]=1:this.words[J+1]++;return this.length=Math.max(this.length,J+1),this},I.prototype.isubn=function(q){if(h(typeof q=="number"),h(q<67108864),q<0)return this.iaddn(-q);if(this.negative!==0)return this.negative=0,this.iaddn(q),this.negative=1,this;if(this.words[0]-=q,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var J=0;J<this.length&&this.words[J]<0;J++)this.words[J]+=67108864,this.words[J+1]-=1;return this.strip()},I.prototype.addn=function(q){return this.clone().iaddn(q)},I.prototype.subn=function(q){return this.clone().isubn(q)},I.prototype.iabs=function(){return this.negative=0,this},I.prototype.abs=function(){return this.clone().iabs()},I.prototype._ishlnsubmul=function(q,J,Q){var L=q.length+Q,W;this._expand(L);var Ae,ie=0;for(W=0;W<q.length;W++){Ae=(this.words[W+Q]|0)+ie;var fe=(q.words[W]|0)*J;Ae-=fe&67108863,ie=(Ae>>26)-(fe/67108864|0),this.words[W+Q]=Ae&67108863}for(;W<this.length-Q;W++)Ae=(this.words[W+Q]|0)+ie,ie=Ae>>26,this.words[W+Q]=Ae&67108863;if(ie===0)return this.strip();for(h(ie===-1),ie=0,W=0;W<this.length;W++)Ae=-(this.words[W]|0)+ie,ie=Ae>>26,this.words[W]=Ae&67108863;return this.negative=1,this.strip()},I.prototype._wordDiv=function(q,J){var Q=this.length-q.length,L=this.clone(),W=q,Ae=W.words[W.length-1]|0,ie=this._countBits(Ae);Q=26-ie,Q!==0&&(W=W.ushln(Q),L.iushln(Q),Ae=W.words[W.length-1]|0);var fe=L.length-W.length,z;if(J!=="mod"){z=new I(null),z.length=fe+1,z.words=new Array(z.length);for(var G=0;G<z.length;G++)z.words[G]=0}var T=L.clone()._ishlnsubmul(W,1,fe);T.negative===0&&(L=T,z&&(z.words[fe]=1));for(var Be=fe-1;Be>=0;Be--){var Te=(L.words[W.length+Be]|0)*67108864+(L.words[W.length+Be-1]|0);for(Te=Math.min(Te/Ae|0,67108863),L._ishlnsubmul(W,Te,Be);L.negative!==0;)Te--,L.negative=0,L._ishlnsubmul(W,1,Be),L.isZero()||(L.negative^=1);z&&(z.words[Be]=Te)}return z&&z.strip(),L.strip(),J!=="div"&&Q!==0&&L.iushrn(Q),{div:z||null,mod:L}},I.prototype.divmod=function(q,J,Q){if(h(!q.isZero()),this.isZero())return{div:new I(0),mod:new I(0)};var L,W,Ae;return this.negative!==0&&q.negative===0?(Ae=this.neg().divmod(q,J),J!=="mod"&&(L=Ae.div.neg()),J!=="div"&&(W=Ae.mod.neg(),Q&&W.negative!==0&&W.iadd(q)),{div:L,mod:W}):this.negative===0&&q.negative!==0?(Ae=this.divmod(q.neg(),J),J!=="mod"&&(L=Ae.div.neg()),{div:L,mod:Ae.mod}):(this.negative&q.negative)!==0?(Ae=this.neg().divmod(q.neg(),J),J!=="div"&&(W=Ae.mod.neg(),Q&&W.negative!==0&&W.isub(q)),{div:Ae.div,mod:W}):q.length>this.length||this.cmp(q)<0?{div:new I(0),mod:this}:q.length===1?J==="div"?{div:this.divn(q.words[0]),mod:null}:J==="mod"?{div:null,mod:new I(this.modn(q.words[0]))}:{div:this.divn(q.words[0]),mod:new I(this.modn(q.words[0]))}:this._wordDiv(q,J)},I.prototype.div=function(q){return this.divmod(q,"div",!1).div},I.prototype.mod=function(q){return this.divmod(q,"mod",!1).mod},I.prototype.umod=function(q){return this.divmod(q,"mod",!0).mod},I.prototype.divRound=function(q){var J=this.divmod(q);if(J.mod.isZero())return J.div;var Q=J.div.negative!==0?J.mod.isub(q):J.mod,L=q.ushrn(1),W=q.andln(1),Ae=Q.cmp(L);return Ae<0||W===1&&Ae===0?J.div:J.div.negative!==0?J.div.isubn(1):J.div.iaddn(1)},I.prototype.modn=function(q){h(q<=67108863);for(var J=(1<<26)%q,Q=0,L=this.length-1;L>=0;L--)Q=(J*Q+(this.words[L]|0))%q;return Q},I.prototype.idivn=function(q){h(q<=67108863);for(var J=0,Q=this.length-1;Q>=0;Q--){var L=(this.words[Q]|0)+J*67108864;this.words[Q]=L/q|0,J=L%q}return this.strip()},I.prototype.divn=function(q){return this.clone().idivn(q)},I.prototype.egcd=function(q){h(q.negative===0),h(!q.isZero());var J=this,Q=q.clone();J.negative!==0?J=J.umod(q):J=J.clone();for(var L=new I(1),W=new I(0),Ae=new I(0),ie=new I(1),fe=0;J.isEven()&&Q.isEven();)J.iushrn(1),Q.iushrn(1),++fe;for(var z=Q.clone(),G=J.clone();!J.isZero();){for(var T=0,Be=1;(J.words[0]&Be)===0&&T<26;++T,Be<<=1);if(T>0)for(J.iushrn(T);T-- >0;)(L.isOdd()||W.isOdd())&&(L.iadd(z),W.isub(G)),L.iushrn(1),W.iushrn(1);for(var Te=0,se=1;(Q.words[0]&se)===0&&Te<26;++Te,se<<=1);if(Te>0)for(Q.iushrn(Te);Te-- >0;)(Ae.isOdd()||ie.isOdd())&&(Ae.iadd(z),ie.isub(G)),Ae.iushrn(1),ie.iushrn(1);J.cmp(Q)>=0?(J.isub(Q),L.isub(Ae),W.isub(ie)):(Q.isub(J),Ae.isub(L),ie.isub(W))}return{a:Ae,b:ie,gcd:Q.iushln(fe)}},I.prototype._invmp=function(q){h(q.negative===0),h(!q.isZero());var J=this,Q=q.clone();J.negative!==0?J=J.umod(q):J=J.clone();for(var L=new I(1),W=new I(0),Ae=Q.clone();J.cmpn(1)>0&&Q.cmpn(1)>0;){for(var ie=0,fe=1;(J.words[0]&fe)===0&&ie<26;++ie,fe<<=1);if(ie>0)for(J.iushrn(ie);ie-- >0;)L.isOdd()&&L.iadd(Ae),L.iushrn(1);for(var z=0,G=1;(Q.words[0]&G)===0&&z<26;++z,G<<=1);if(z>0)for(Q.iushrn(z);z-- >0;)W.isOdd()&&W.iadd(Ae),W.iushrn(1);J.cmp(Q)>=0?(J.isub(Q),L.isub(W)):(Q.isub(J),W.isub(L))}var T;return J.cmpn(1)===0?T=L:T=W,T.cmpn(0)<0&&T.iadd(q),T},I.prototype.gcd=function(q){if(this.isZero())return q.abs();if(q.isZero())return this.abs();var J=this.clone(),Q=q.clone();J.negative=0,Q.negative=0;for(var L=0;J.isEven()&&Q.isEven();L++)J.iushrn(1),Q.iushrn(1);do{for(;J.isEven();)J.iushrn(1);for(;Q.isEven();)Q.iushrn(1);var W=J.cmp(Q);if(W<0){var Ae=J;J=Q,Q=Ae}else if(W===0||Q.cmpn(1)===0)break;J.isub(Q)}while(!0);return Q.iushln(L)},I.prototype.invm=function(q){return this.egcd(q).a.umod(q)},I.prototype.isEven=function(){return(this.words[0]&1)===0},I.prototype.isOdd=function(){return(this.words[0]&1)===1},I.prototype.andln=function(q){return this.words[0]&q},I.prototype.bincn=function(q){h(typeof q=="number");var J=q%26,Q=(q-J)/26,L=1<<J;if(this.length<=Q)return this._expand(Q+1),this.words[Q]|=L,this;for(var W=L,Ae=Q;W!==0&&Ae<this.length;Ae++){var ie=this.words[Ae]|0;ie+=W,W=ie>>>26,ie&=67108863,this.words[Ae]=ie}return W!==0&&(this.words[Ae]=W,this.length++),this},I.prototype.isZero=function(){return this.length===1&&this.words[0]===0},I.prototype.cmpn=function(q){var J=q<0;if(this.negative!==0&&!J)return-1;if(this.negative===0&&J)return 1;this.strip();var Q;if(this.length>1)Q=1;else{J&&(q=-q),h(q<=67108863,"Number is too big");var L=this.words[0]|0;Q=L===q?0:L<q?-1:1}return this.negative!==0?-Q|0:Q},I.prototype.cmp=function(q){if(this.negative!==0&&q.negative===0)return-1;if(this.negative===0&&q.negative!==0)return 1;var J=this.ucmp(q);return this.negative!==0?-J|0:J},I.prototype.ucmp=function(q){if(this.length>q.length)return 1;if(this.length<q.length)return-1;for(var J=0,Q=this.length-1;Q>=0;Q--){var L=this.words[Q]|0,W=q.words[Q]|0;if(L!==W){L<W?J=-1:L>W&&(J=1);break}}return J},I.prototype.gtn=function(q){return this.cmpn(q)===1},I.prototype.gt=function(q){return this.cmp(q)===1},I.prototype.gten=function(q){return this.cmpn(q)>=0},I.prototype.gte=function(q){return this.cmp(q)>=0},I.prototype.ltn=function(q){return this.cmpn(q)===-1},I.prototype.lt=function(q){return this.cmp(q)===-1},I.prototype.lten=function(q){return this.cmpn(q)<=0},I.prototype.lte=function(q){return this.cmp(q)<=0},I.prototype.eqn=function(q){return this.cmpn(q)===0},I.prototype.eq=function(q){return this.cmp(q)===0},I.red=function(q){return new he(q)},I.prototype.toRed=function(q){return h(!this.red,"Already a number in reduction context"),h(this.negative===0,"red works only with positives"),q.convertTo(this)._forceRed(q)},I.prototype.fromRed=function(){return h(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},I.prototype._forceRed=function(q){return this.red=q,this},I.prototype.forceRed=function(q){return h(!this.red,"Already a number in reduction context"),this._forceRed(q)},I.prototype.redAdd=function(q){return h(this.red,"redAdd works only with red numbers"),this.red.add(this,q)},I.prototype.redIAdd=function(q){return h(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,q)},I.prototype.redSub=function(q){return h(this.red,"redSub works only with red numbers"),this.red.sub(this,q)},I.prototype.redISub=function(q){return h(this.red,"redISub works only with red numbers"),this.red.isub(this,q)},I.prototype.redShl=function(q){return h(this.red,"redShl works only with red numbers"),this.red.shl(this,q)},I.prototype.redMul=function(q){return h(this.red,"redMul works only with red numbers"),this.red._verify2(this,q),this.red.mul(this,q)},I.prototype.redIMul=function(q){return h(this.red,"redMul works only with red numbers"),this.red._verify2(this,q),this.red.imul(this,q)},I.prototype.redSqr=function(){return h(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},I.prototype.redISqr=function(){return h(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},I.prototype.redSqrt=function(){return h(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},I.prototype.redInvm=function(){return h(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},I.prototype.redNeg=function(){return h(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},I.prototype.redPow=function(q){return h(this.red&&!q.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,q)};var te={k256:null,p224:null,p192:null,p25519:null};function r0(He,q){this.name=He,this.p=new I(q,16),this.n=this.p.bitLength(),this.k=new I(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}r0.prototype._tmp=function(){var q=new I(null);return q.words=new Array(Math.ceil(this.n/13)),q},r0.prototype.ireduce=function(q){var J=q,Q;do this.split(J,this.tmp),J=this.imulK(J),J=J.iadd(this.tmp),Q=J.bitLength();while(Q>this.n);var L=Q<this.n?-1:J.ucmp(this.p);return L===0?(J.words[0]=0,J.length=1):L>0?J.isub(this.p):J.strip!==void 0?J.strip():J._strip(),J},r0.prototype.split=function(q,J){q.iushrn(this.n,0,J)},r0.prototype.imulK=function(q){return q.imul(this.k)};function ve(){r0.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}b(ve,r0),ve.prototype.split=function(q,J){for(var Q=4194303,L=Math.min(q.length,9),W=0;W<L;W++)J.words[W]=q.words[W];if(J.length=L,q.length<=9){q.words[0]=0,q.length=1;return}var Ae=q.words[9];for(J.words[J.length++]=Ae&Q,W=10;W<q.length;W++){var ie=q.words[W]|0;q.words[W-10]=(ie&Q)<<4|Ae>>>22,Ae=ie}Ae>>>=22,q.words[W-10]=Ae,Ae===0&&q.length>10?q.length-=10:q.length-=9},ve.prototype.imulK=function(q){q.words[q.length]=0,q.words[q.length+1]=0,q.length+=2;for(var J=0,Q=0;Q<q.length;Q++){var L=q.words[Q]|0;J+=L*977,q.words[Q]=J&67108863,J=L*64+(J/67108864|0)}return q.words[q.length-1]===0&&(q.length--,q.words[q.length-1]===0&&q.length--),q};function Ne(){r0.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}b(Ne,r0);function ye(){r0.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}b(ye,r0);function Xe(){r0.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}b(Xe,r0),Xe.prototype.imulK=function(q){for(var J=0,Q=0;Q<q.length;Q++){var L=(q.words[Q]|0)*19+J,W=L&67108863;L>>>=26,q.words[Q]=W,J=L}return J!==0&&(q.words[q.length++]=J),q},I._prime=function(q){if(te[q])return te[q];var J;if(q==="k256")J=new ve;else if(q==="p224")J=new Ne;else if(q==="p192")J=new ye;else if(q==="p25519")J=new Xe;else throw new Error("Unknown prime "+q);return te[q]=J,J};function he(He){if(typeof He=="string"){var q=I._prime(He);this.m=q.p,this.prime=q}else h(He.gtn(1),"modulus must be greater than 1"),this.m=He,this.prime=null}he.prototype._verify1=function(q){h(q.negative===0,"red works only with positives"),h(q.red,"red works only with red numbers")},he.prototype._verify2=function(q,J){h((q.negative|J.negative)===0,"red works only with positives"),h(q.red&&q.red===J.red,"red works only with red numbers")},he.prototype.imod=function(q){return this.prime?this.prime.ireduce(q)._forceRed(this):q.umod(this.m)._forceRed(this)},he.prototype.neg=function(q){return q.isZero()?q.clone():this.m.sub(q)._forceRed(this)},he.prototype.add=function(q,J){this._verify2(q,J);var Q=q.add(J);return Q.cmp(this.m)>=0&&Q.isub(this.m),Q._forceRed(this)},he.prototype.iadd=function(q,J){this._verify2(q,J);var Q=q.iadd(J);return Q.cmp(this.m)>=0&&Q.isub(this.m),Q},he.prototype.sub=function(q,J){this._verify2(q,J);var Q=q.sub(J);return Q.cmpn(0)<0&&Q.iadd(this.m),Q._forceRed(this)},he.prototype.isub=function(q,J){this._verify2(q,J);var Q=q.isub(J);return Q.cmpn(0)<0&&Q.iadd(this.m),Q},he.prototype.shl=function(q,J){return this._verify1(q),this.imod(q.ushln(J))},he.prototype.imul=function(q,J){return this._verify2(q,J),this.imod(q.imul(J))},he.prototype.mul=function(q,J){return this._verify2(q,J),this.imod(q.mul(J))},he.prototype.isqr=function(q){return this.imul(q,q.clone())},he.prototype.sqr=function(q){return this.mul(q,q)},he.prototype.sqrt=function(q){if(q.isZero())return q.clone();var J=this.m.andln(3);if(h(J%2===1),J===3){var Q=this.m.add(new I(1)).iushrn(2);return this.pow(q,Q)}for(var L=this.m.subn(1),W=0;!L.isZero()&&L.andln(1)===0;)W++,L.iushrn(1);h(!L.isZero());var Ae=new I(1).toRed(this),ie=Ae.redNeg(),fe=this.m.subn(1).iushrn(1),z=this.m.bitLength();for(z=new I(2*z*z).toRed(this);this.pow(z,fe).cmp(ie)!==0;)z.redIAdd(ie);for(var G=this.pow(z,L),T=this.pow(q,L.addn(1).iushrn(1)),Be=this.pow(q,L),Te=W;Be.cmp(Ae)!==0;){for(var se=Be,ze=0;se.cmp(Ae)!==0;ze++)se=se.redSqr();h(ze<Te);var s0=this.pow(G,new I(1).iushln(Te-ze-1));T=T.redMul(s0),G=s0.redSqr(),Be=Be.redMul(G),Te=ze}return T},he.prototype.invm=function(q){var J=q._invmp(this.m);return J.negative!==0?(J.negative=0,this.imod(J).redNeg()):this.imod(J)},he.prototype.pow=function(q,J){if(J.isZero())return new I(1).toRed(this);if(J.cmpn(1)===0)return q.clone();var Q=4,L=new Array(1<<Q);L[0]=new I(1).toRed(this),L[1]=q;for(var W=2;W<L.length;W++)L[W]=this.mul(L[W-1],q);var Ae=L[0],ie=0,fe=0,z=J.bitLength()%26;for(z===0&&(z=26),W=J.length-1;W>=0;W--){for(var G=J.words[W],T=z-1;T>=0;T--){var Be=G>>T&1;if(Ae!==L[0]&&(Ae=this.sqr(Ae)),Be===0&&ie===0){fe=0;continue}ie<<=1,ie|=Be,fe++,!(fe!==Q&&(W!==0||T!==0))&&(Ae=this.mul(Ae,L[ie]),fe=0,ie=0)}z=26}return Ae},he.prototype.convertTo=function(q){var J=q.umod(this.m);return J===q?J.clone():J},he.prototype.convertFrom=function(q){var J=q.clone();return J.red=null,J},I.mont=function(q){return new v0(q)};function v0(He){he.call(this,He),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new I(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b(v0,he),v0.prototype.convertTo=function(q){return this.imod(q.ushln(this.shift))},v0.prototype.convertFrom=function(q){var J=this.imod(q.mul(this.rinv));return J.red=null,J},v0.prototype.imul=function(q,J){if(q.isZero()||J.isZero())return q.words[0]=0,q.length=1,q;var Q=q.imul(J),L=Q.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),W=Q.isub(L).iushrn(this.shift),Ae=W;return W.cmp(this.m)>=0?Ae=W.isub(this.m):W.cmpn(0)<0&&(Ae=W.iadd(this.m)),Ae._forceRed(this)},v0.prototype.mul=function(q,J){if(q.isZero()||J.isZero())return new I(0)._forceRed(this);var Q=q.mul(J),L=Q.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),W=Q.isub(L).iushrn(this.shift),Ae=W;return W.cmp(this.m)>=0?Ae=W.isub(this.m):W.cmpn(0)<0&&(Ae=W.iadd(this.m)),Ae._forceRed(this)},v0.prototype.invm=function(q){var J=this.imod(q._invmp(this.m).mul(this.r2));return J._forceRed(this)}})(f,Ew)}(r1)),r1.exports}var ih={},op;function Ly(){return op||(op=1,function(f){var o=f;function c(I,y){if(Array.isArray(I))return I.slice();if(!I)return[];var S=[];if(typeof I!="string"){for(var k=0;k<I.length;k++)S[k]=I[k]|0;return S}if(y==="hex"){I=I.replace(/[^a-z0-9]+/ig,""),I.length%2!==0&&(I="0"+I);for(var k=0;k<I.length;k+=2)S.push(parseInt(I[k]+I[k+1],16))}else for(var k=0;k<I.length;k++){var N=I.charCodeAt(k),R=N>>8,B=N&255;R?S.push(R,B):S.push(B)}return S}o.toArray=c;function h(I){return I.length===1?"0"+I:I}o.zero2=h;function b(I){for(var y="",S=0;S<I.length;S++)y+=h(I[S].toString(16));return y}o.toHex=b,o.encode=function(y,S){return S==="hex"?b(y):y}}(ih)),ih}var sp;function Ei(){return sp||(sp=1,function(f){var o=f,c=Oa(),h=C2(),b=Ly();o.assert=h,o.toArray=b.toArray,o.zero2=b.zero2,o.toHex=b.toHex,o.encode=b.encode;function I(R,B,oe){var Ee=new Array(Math.max(R.bitLength(),oe)+1),pe;for(pe=0;pe<Ee.length;pe+=1)Ee[pe]=0;var V=1<<B+1,Ie=R.clone();for(pe=0;pe<Ee.length;pe++){var Ce,_e=Ie.andln(V-1);Ie.isOdd()?(_e>(V>>1)-1?Ce=(V>>1)-_e:Ce=_e,Ie.isubn(Ce)):Ce=0,Ee[pe]=Ce,Ie.iushrn(1)}return Ee}o.getNAF=I;function y(R,B){var oe=[[],[]];R=R.clone(),B=B.clone();for(var Ee=0,pe=0,V;R.cmpn(-Ee)>0||B.cmpn(-pe)>0;){var Ie=R.andln(3)+Ee&3,Ce=B.andln(3)+pe&3;Ie===3&&(Ie=-1),Ce===3&&(Ce=-1);var _e;(Ie&1)===0?_e=0:(V=R.andln(7)+Ee&7,(V===3||V===5)&&Ce===2?_e=-Ie:_e=Ie),oe[0].push(_e);var te;(Ce&1)===0?te=0:(V=B.andln(7)+pe&7,(V===3||V===5)&&Ie===2?te=-Ce:te=Ce),oe[1].push(te),2*Ee===_e+1&&(Ee=1-Ee),2*pe===te+1&&(pe=1-pe),R.iushrn(1),B.iushrn(1)}return oe}o.getJSF=y;function S(R,B,oe){var Ee="_"+B;R.prototype[B]=function(){return this[Ee]!==void 0?this[Ee]:this[Ee]=oe.call(this)}}o.cachedProperty=S;function k(R){return typeof R=="string"?o.toArray(R,"hex"):R}o.parseBytes=k;function N(R){return new c(R,"hex","le")}o.intFromLE=N}(Ah)),Ah}var Oc={exports:{}},fp;function Ty(){if(fp)return Oc.exports;fp=1;var f;Oc.exports=function(b){return f||(f=new o(null)),f.generate(b)};function o(h){this.rand=h}if(Oc.exports.Rand=o,o.prototype.generate=function(b){return this._rand(b)},o.prototype._rand=function(b){if(this.rand.getBytes)return this.rand.getBytes(b);for(var I=new Uint8Array(b),y=0;y<I.length;y++)I[y]=this.rand.getByte();return I},typeof self=="object")self.crypto&&self.crypto.getRandomValues?o.prototype._rand=function(b){var I=new Uint8Array(b);return self.crypto.getRandomValues(I),I}:self.msCrypto&&self.msCrypto.getRandomValues?o.prototype._rand=function(b){var I=new Uint8Array(b);return self.msCrypto.getRandomValues(I),I}:typeof window=="object"&&(o.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var c=Ra;if(typeof c.randomBytes!="function")throw new Error("Not supported");o.prototype._rand=function(b){return c.randomBytes(b)}}catch{}return Oc.exports}var ah={},oh,cp;function ru(){if(cp)return oh;cp=1;var f=Oa(),o=Ei(),c=o.getNAF,h=o.getJSF,b=o.assert;function I(S,k){this.type=S,this.p=new f(k.p,16),this.red=k.prime?f.red(k.prime):f.mont(this.p),this.zero=new f(0).toRed(this.red),this.one=new f(1).toRed(this.red),this.two=new f(2).toRed(this.red),this.n=k.n&&new f(k.n,16),this.g=k.g&&this.pointFromJSON(k.g,k.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var N=this.n&&this.p.div(this.n);!N||N.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}oh=I,I.prototype.point=function(){throw new Error("Not implemented")},I.prototype.validate=function(){throw new Error("Not implemented")},I.prototype._fixedNafMul=function(k,N){b(k.precomputed);var R=k._getDoubles(),B=c(N,1,this._bitLength),oe=(1<<R.step+1)-(R.step%2===0?2:1);oe/=3;var Ee=[],pe,V;for(pe=0;pe<B.length;pe+=R.step){V=0;for(var Ie=pe+R.step-1;Ie>=pe;Ie--)V=(V<<1)+B[Ie];Ee.push(V)}for(var Ce=this.jpoint(null,null,null),_e=this.jpoint(null,null,null),te=oe;te>0;te--){for(pe=0;pe<Ee.length;pe++)V=Ee[pe],V===te?_e=_e.mixedAdd(R.points[pe]):V===-te&&(_e=_e.mixedAdd(R.points[pe].neg()));Ce=Ce.add(_e)}return Ce.toP()},I.prototype._wnafMul=function(k,N){var R=4,B=k._getNAFPoints(R);R=B.wnd;for(var oe=B.points,Ee=c(N,R,this._bitLength),pe=this.jpoint(null,null,null),V=Ee.length-1;V>=0;V--){for(var Ie=0;V>=0&&Ee[V]===0;V--)Ie++;if(V>=0&&Ie++,pe=pe.dblp(Ie),V<0)break;var Ce=Ee[V];b(Ce!==0),k.type==="affine"?Ce>0?pe=pe.mixedAdd(oe[Ce-1>>1]):pe=pe.mixedAdd(oe[-Ce-1>>1].neg()):Ce>0?pe=pe.add(oe[Ce-1>>1]):pe=pe.add(oe[-Ce-1>>1].neg())}return k.type==="affine"?pe.toP():pe},I.prototype._wnafMulAdd=function(k,N,R,B,oe){var Ee=this._wnafT1,pe=this._wnafT2,V=this._wnafT3,Ie=0,Ce,_e,te;for(Ce=0;Ce<B;Ce++){te=N[Ce];var r0=te._getNAFPoints(k);Ee[Ce]=r0.wnd,pe[Ce]=r0.points}for(Ce=B-1;Ce>=1;Ce-=2){var ve=Ce-1,Ne=Ce;if(Ee[ve]!==1||Ee[Ne]!==1){V[ve]=c(R[ve],Ee[ve],this._bitLength),V[Ne]=c(R[Ne],Ee[Ne],this._bitLength),Ie=Math.max(V[ve].length,Ie),Ie=Math.max(V[Ne].length,Ie);continue}var ye=[N[ve],null,null,N[Ne]];N[ve].y.cmp(N[Ne].y)===0?(ye[1]=N[ve].add(N[Ne]),ye[2]=N[ve].toJ().mixedAdd(N[Ne].neg())):N[ve].y.cmp(N[Ne].y.redNeg())===0?(ye[1]=N[ve].toJ().mixedAdd(N[Ne]),ye[2]=N[ve].add(N[Ne].neg())):(ye[1]=N[ve].toJ().mixedAdd(N[Ne]),ye[2]=N[ve].toJ().mixedAdd(N[Ne].neg()));var Xe=[-3,-1,-5,-7,0,7,5,1,3],he=h(R[ve],R[Ne]);for(Ie=Math.max(he[0].length,Ie),V[ve]=new Array(Ie),V[Ne]=new Array(Ie),_e=0;_e<Ie;_e++){var v0=he[0][_e]|0,He=he[1][_e]|0;V[ve][_e]=Xe[(v0+1)*3+(He+1)],V[Ne][_e]=0,pe[ve]=ye}}var q=this.jpoint(null,null,null),J=this._wnafT4;for(Ce=Ie;Ce>=0;Ce--){for(var Q=0;Ce>=0;){var L=!0;for(_e=0;_e<B;_e++)J[_e]=V[_e][Ce]|0,J[_e]!==0&&(L=!1);if(!L)break;Q++,Ce--}if(Ce>=0&&Q++,q=q.dblp(Q),Ce<0)break;for(_e=0;_e<B;_e++){var W=J[_e];W!==0&&(W>0?te=pe[_e][W-1>>1]:W<0&&(te=pe[_e][-W-1>>1].neg()),te.type==="affine"?q=q.mixedAdd(te):q=q.add(te))}}for(Ce=0;Ce<B;Ce++)pe[Ce]=null;return oe?q:q.toP()};function y(S,k){this.curve=S,this.type=k,this.precomputed=null}return I.BasePoint=y,y.prototype.eq=function(){throw new Error("Not implemented")},y.prototype.validate=function(){return this.curve.validate(this)},I.prototype.decodePoint=function(k,N){k=o.toArray(k,N);var R=this.p.byteLength();if((k[0]===4||k[0]===6||k[0]===7)&&k.length-1===2*R){k[0]===6?b(k[k.length-1]%2===0):k[0]===7&&b(k[k.length-1]%2===1);var B=this.point(k.slice(1,1+R),k.slice(1+R,1+2*R));return B}else if((k[0]===2||k[0]===3)&&k.length-1===R)return this.pointFromX(k.slice(1,1+R),k[0]===3);throw new Error("Unknown point format")},y.prototype.encodeCompressed=function(k){return this.encode(k,!0)},y.prototype._encode=function(k){var N=this.curve.p.byteLength(),R=this.getX().toArray("be",N);return k?[this.getY().isEven()?2:3].concat(R):[4].concat(R,this.getY().toArray("be",N))},y.prototype.encode=function(k,N){return o.encode(this._encode(N),k)},y.prototype.precompute=function(k){if(this.precomputed)return this;var N={doubles:null,naf:null,beta:null};return N.naf=this._getNAFPoints(8),N.doubles=this._getDoubles(4,k),N.beta=this._getBeta(),this.precomputed=N,this},y.prototype._hasDoubles=function(k){if(!this.precomputed)return!1;var N=this.precomputed.doubles;return N?N.points.length>=Math.ceil((k.bitLength()+1)/N.step):!1},y.prototype._getDoubles=function(k,N){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var R=[this],B=this,oe=0;oe<N;oe+=k){for(var Ee=0;Ee<k;Ee++)B=B.dbl();R.push(B)}return{step:k,points:R}},y.prototype._getNAFPoints=function(k){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var N=[this],R=(1<<k)-1,B=R===1?null:this.dbl(),oe=1;oe<R;oe++)N[oe]=N[oe-1].add(B);return{wnd:k,points:N}},y.prototype._getBeta=function(){return null},y.prototype.dblp=function(k){for(var N=this,R=0;R<k;R++)N=N.dbl();return N},oh}var sh,up;function _w(){if(up)return sh;up=1;var f=Ei(),o=Oa(),c=Z1(),h=ru(),b=f.assert;function I(k){h.call(this,"short",k),this.a=new o(k.a,16).toRed(this.red),this.b=new o(k.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(k),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}c(I,h),sh=I,I.prototype._getEndomorphism=function(N){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var R,B;if(N.beta)R=new o(N.beta,16).toRed(this.red);else{var oe=this._getEndoRoots(this.p);R=oe[0].cmp(oe[1])<0?oe[0]:oe[1],R=R.toRed(this.red)}if(N.lambda)B=new o(N.lambda,16);else{var Ee=this._getEndoRoots(this.n);this.g.mul(Ee[0]).x.cmp(this.g.x.redMul(R))===0?B=Ee[0]:(B=Ee[1],b(this.g.mul(B).x.cmp(this.g.x.redMul(R))===0))}var pe;return N.basis?pe=N.basis.map(function(V){return{a:new o(V.a,16),b:new o(V.b,16)}}):pe=this._getEndoBasis(B),{beta:R,lambda:B,basis:pe}}},I.prototype._getEndoRoots=function(N){var R=N===this.p?this.red:o.mont(N),B=new o(2).toRed(R).redInvm(),oe=B.redNeg(),Ee=new o(3).toRed(R).redNeg().redSqrt().redMul(B),pe=oe.redAdd(Ee).fromRed(),V=oe.redSub(Ee).fromRed();return[pe,V]},I.prototype._getEndoBasis=function(N){for(var R=this.n.ushrn(Math.floor(this.n.bitLength()/2)),B=N,oe=this.n.clone(),Ee=new o(1),pe=new o(0),V=new o(0),Ie=new o(1),Ce,_e,te,r0,ve,Ne,ye,Xe=0,he,v0;B.cmpn(0)!==0;){var He=oe.div(B);he=oe.sub(He.mul(B)),v0=V.sub(He.mul(Ee));var q=Ie.sub(He.mul(pe));if(!te&&he.cmp(R)<0)Ce=ye.neg(),_e=Ee,te=he.neg(),r0=v0;else if(te&&++Xe===2)break;ye=he,oe=B,B=he,V=Ee,Ee=v0,Ie=pe,pe=q}ve=he.neg(),Ne=v0;var J=te.sqr().add(r0.sqr()),Q=ve.sqr().add(Ne.sqr());return Q.cmp(J)>=0&&(ve=Ce,Ne=_e),te.negative&&(te=te.neg(),r0=r0.neg()),ve.negative&&(ve=ve.neg(),Ne=Ne.neg()),[{a:te,b:r0},{a:ve,b:Ne}]},I.prototype._endoSplit=function(N){var R=this.endo.basis,B=R[0],oe=R[1],Ee=oe.b.mul(N).divRound(this.n),pe=B.b.neg().mul(N).divRound(this.n),V=Ee.mul(B.a),Ie=pe.mul(oe.a),Ce=Ee.mul(B.b),_e=pe.mul(oe.b),te=N.sub(V).sub(Ie),r0=Ce.add(_e).neg();return{k1:te,k2:r0}},I.prototype.pointFromX=function(N,R){N=new o(N,16),N.red||(N=N.toRed(this.red));var B=N.redSqr().redMul(N).redIAdd(N.redMul(this.a)).redIAdd(this.b),oe=B.redSqrt();if(oe.redSqr().redSub(B).cmp(this.zero)!==0)throw new Error("invalid point");var Ee=oe.fromRed().isOdd();return(R&&!Ee||!R&&Ee)&&(oe=oe.redNeg()),this.point(N,oe)},I.prototype.validate=function(N){if(N.inf)return!0;var R=N.x,B=N.y,oe=this.a.redMul(R),Ee=R.redSqr().redMul(R).redIAdd(oe).redIAdd(this.b);return B.redSqr().redISub(Ee).cmpn(0)===0},I.prototype._endoWnafMulAdd=function(N,R,B){for(var oe=this._endoWnafT1,Ee=this._endoWnafT2,pe=0;pe<N.length;pe++){var V=this._endoSplit(R[pe]),Ie=N[pe],Ce=Ie._getBeta();V.k1.negative&&(V.k1.ineg(),Ie=Ie.neg(!0)),V.k2.negative&&(V.k2.ineg(),Ce=Ce.neg(!0)),oe[pe*2]=Ie,oe[pe*2+1]=Ce,Ee[pe*2]=V.k1,Ee[pe*2+1]=V.k2}for(var _e=this._wnafMulAdd(1,oe,Ee,pe*2,B),te=0;te<pe*2;te++)oe[te]=null,Ee[te]=null;return _e};function y(k,N,R,B){h.BasePoint.call(this,k,"affine"),N===null&&R===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new o(N,16),this.y=new o(R,16),B&&(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)}c(y,h.BasePoint),I.prototype.point=function(N,R,B){return new y(this,N,R,B)},I.prototype.pointFromJSON=function(N,R){return y.fromJSON(this,N,R)},y.prototype._getBeta=function(){if(this.curve.endo){var N=this.precomputed;if(N&&N.beta)return N.beta;var R=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(N){var B=this.curve,oe=function(Ee){return B.point(Ee.x.redMul(B.endo.beta),Ee.y)};N.beta=R,R.precomputed={beta:null,naf:N.naf&&{wnd:N.naf.wnd,points:N.naf.points.map(oe)},doubles:N.doubles&&{step:N.doubles.step,points:N.doubles.points.map(oe)}}}return R}},y.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]},y.fromJSON=function(N,R,B){typeof R=="string"&&(R=JSON.parse(R));var oe=N.point(R[0],R[1],B);if(!R[2])return oe;function Ee(V){return N.point(V[0],V[1],B)}var pe=R[2];return oe.precomputed={beta:null,doubles:pe.doubles&&{step:pe.doubles.step,points:[oe].concat(pe.doubles.points.map(Ee))},naf:pe.naf&&{wnd:pe.naf.wnd,points:[oe].concat(pe.naf.points.map(Ee))}},oe},y.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)+">"},y.prototype.isInfinity=function(){return this.inf},y.prototype.add=function(N){if(this.inf)return N;if(N.inf)return this;if(this.eq(N))return this.dbl();if(this.neg().eq(N))return this.curve.point(null,null);if(this.x.cmp(N.x)===0)return this.curve.point(null,null);var R=this.y.redSub(N.y);R.cmpn(0)!==0&&(R=R.redMul(this.x.redSub(N.x).redInvm()));var B=R.redSqr().redISub(this.x).redISub(N.x),oe=R.redMul(this.x.redSub(B)).redISub(this.y);return this.curve.point(B,oe)},y.prototype.dbl=function(){if(this.inf)return this;var N=this.y.redAdd(this.y);if(N.cmpn(0)===0)return this.curve.point(null,null);var R=this.curve.a,B=this.x.redSqr(),oe=N.redInvm(),Ee=B.redAdd(B).redIAdd(B).redIAdd(R).redMul(oe),pe=Ee.redSqr().redISub(this.x.redAdd(this.x)),V=Ee.redMul(this.x.redSub(pe)).redISub(this.y);return this.curve.point(pe,V)},y.prototype.getX=function(){return this.x.fromRed()},y.prototype.getY=function(){return this.y.fromRed()},y.prototype.mul=function(N){return N=new o(N,16),this.isInfinity()?this:this._hasDoubles(N)?this.curve._fixedNafMul(this,N):this.curve.endo?this.curve._endoWnafMulAdd([this],[N]):this.curve._wnafMul(this,N)},y.prototype.mulAdd=function(N,R,B){var oe=[this,R],Ee=[N,B];return this.curve.endo?this.curve._endoWnafMulAdd(oe,Ee):this.curve._wnafMulAdd(1,oe,Ee,2)},y.prototype.jmulAdd=function(N,R,B){var oe=[this,R],Ee=[N,B];return this.curve.endo?this.curve._endoWnafMulAdd(oe,Ee,!0):this.curve._wnafMulAdd(1,oe,Ee,2,!0)},y.prototype.eq=function(N){return this===N||this.inf===N.inf&&(this.inf||this.x.cmp(N.x)===0&&this.y.cmp(N.y)===0)},y.prototype.neg=function(N){if(this.inf)return this;var R=this.curve.point(this.x,this.y.redNeg());if(N&&this.precomputed){var B=this.precomputed,oe=function(Ee){return Ee.neg()};R.precomputed={naf:B.naf&&{wnd:B.naf.wnd,points:B.naf.points.map(oe)},doubles:B.doubles&&{step:B.doubles.step,points:B.doubles.points.map(oe)}}}return R},y.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var N=this.curve.jpoint(this.x,this.y,this.curve.one);return N};function S(k,N,R,B){h.BasePoint.call(this,k,"jacobian"),N===null&&R===null&&B===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new o(0)):(this.x=new o(N,16),this.y=new o(R,16),this.z=new o(B,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}return c(S,h.BasePoint),I.prototype.jpoint=function(N,R,B){return new S(this,N,R,B)},S.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var N=this.z.redInvm(),R=N.redSqr(),B=this.x.redMul(R),oe=this.y.redMul(R).redMul(N);return this.curve.point(B,oe)},S.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},S.prototype.add=function(N){if(this.isInfinity())return N;if(N.isInfinity())return this;var R=N.z.redSqr(),B=this.z.redSqr(),oe=this.x.redMul(R),Ee=N.x.redMul(B),pe=this.y.redMul(R.redMul(N.z)),V=N.y.redMul(B.redMul(this.z)),Ie=oe.redSub(Ee),Ce=pe.redSub(V);if(Ie.cmpn(0)===0)return Ce.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var _e=Ie.redSqr(),te=_e.redMul(Ie),r0=oe.redMul(_e),ve=Ce.redSqr().redIAdd(te).redISub(r0).redISub(r0),Ne=Ce.redMul(r0.redISub(ve)).redISub(pe.redMul(te)),ye=this.z.redMul(N.z).redMul(Ie);return this.curve.jpoint(ve,Ne,ye)},S.prototype.mixedAdd=function(N){if(this.isInfinity())return N.toJ();if(N.isInfinity())return this;var R=this.z.redSqr(),B=this.x,oe=N.x.redMul(R),Ee=this.y,pe=N.y.redMul(R).redMul(this.z),V=B.redSub(oe),Ie=Ee.redSub(pe);if(V.cmpn(0)===0)return Ie.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var Ce=V.redSqr(),_e=Ce.redMul(V),te=B.redMul(Ce),r0=Ie.redSqr().redIAdd(_e).redISub(te).redISub(te),ve=Ie.redMul(te.redISub(r0)).redISub(Ee.redMul(_e)),Ne=this.z.redMul(V);return this.curve.jpoint(r0,ve,Ne)},S.prototype.dblp=function(N){if(N===0)return this;if(this.isInfinity())return this;if(!N)return this.dbl();var R;if(this.curve.zeroA||this.curve.threeA){var B=this;for(R=0;R<N;R++)B=B.dbl();return B}var oe=this.curve.a,Ee=this.curve.tinv,pe=this.x,V=this.y,Ie=this.z,Ce=Ie.redSqr().redSqr(),_e=V.redAdd(V);for(R=0;R<N;R++){var te=pe.redSqr(),r0=_e.redSqr(),ve=r0.redSqr(),Ne=te.redAdd(te).redIAdd(te).redIAdd(oe.redMul(Ce)),ye=pe.redMul(r0),Xe=Ne.redSqr().redISub(ye.redAdd(ye)),he=ye.redISub(Xe),v0=Ne.redMul(he);v0=v0.redIAdd(v0).redISub(ve);var He=_e.redMul(Ie);R+1<N&&(Ce=Ce.redMul(ve)),pe=Xe,Ie=He,_e=v0}return this.curve.jpoint(pe,_e.redMul(Ee),Ie)},S.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},S.prototype._zeroDbl=function(){var N,R,B;if(this.zOne){var oe=this.x.redSqr(),Ee=this.y.redSqr(),pe=Ee.redSqr(),V=this.x.redAdd(Ee).redSqr().redISub(oe).redISub(pe);V=V.redIAdd(V);var Ie=oe.redAdd(oe).redIAdd(oe),Ce=Ie.redSqr().redISub(V).redISub(V),_e=pe.redIAdd(pe);_e=_e.redIAdd(_e),_e=_e.redIAdd(_e),N=Ce,R=Ie.redMul(V.redISub(Ce)).redISub(_e),B=this.y.redAdd(this.y)}else{var te=this.x.redSqr(),r0=this.y.redSqr(),ve=r0.redSqr(),Ne=this.x.redAdd(r0).redSqr().redISub(te).redISub(ve);Ne=Ne.redIAdd(Ne);var ye=te.redAdd(te).redIAdd(te),Xe=ye.redSqr(),he=ve.redIAdd(ve);he=he.redIAdd(he),he=he.redIAdd(he),N=Xe.redISub(Ne).redISub(Ne),R=ye.redMul(Ne.redISub(N)).redISub(he),B=this.y.redMul(this.z),B=B.redIAdd(B)}return this.curve.jpoint(N,R,B)},S.prototype._threeDbl=function(){var N,R,B;if(this.zOne){var oe=this.x.redSqr(),Ee=this.y.redSqr(),pe=Ee.redSqr(),V=this.x.redAdd(Ee).redSqr().redISub(oe).redISub(pe);V=V.redIAdd(V);var Ie=oe.redAdd(oe).redIAdd(oe).redIAdd(this.curve.a),Ce=Ie.redSqr().redISub(V).redISub(V);N=Ce;var _e=pe.redIAdd(pe);_e=_e.redIAdd(_e),_e=_e.redIAdd(_e),R=Ie.redMul(V.redISub(Ce)).redISub(_e),B=this.y.redAdd(this.y)}else{var te=this.z.redSqr(),r0=this.y.redSqr(),ve=this.x.redMul(r0),Ne=this.x.redSub(te).redMul(this.x.redAdd(te));Ne=Ne.redAdd(Ne).redIAdd(Ne);var ye=ve.redIAdd(ve);ye=ye.redIAdd(ye);var Xe=ye.redAdd(ye);N=Ne.redSqr().redISub(Xe),B=this.y.redAdd(this.z).redSqr().redISub(r0).redISub(te);var he=r0.redSqr();he=he.redIAdd(he),he=he.redIAdd(he),he=he.redIAdd(he),R=Ne.redMul(ye.redISub(N)).redISub(he)}return this.curve.jpoint(N,R,B)},S.prototype._dbl=function(){var N=this.curve.a,R=this.x,B=this.y,oe=this.z,Ee=oe.redSqr().redSqr(),pe=R.redSqr(),V=B.redSqr(),Ie=pe.redAdd(pe).redIAdd(pe).redIAdd(N.redMul(Ee)),Ce=R.redAdd(R);Ce=Ce.redIAdd(Ce);var _e=Ce.redMul(V),te=Ie.redSqr().redISub(_e.redAdd(_e)),r0=_e.redISub(te),ve=V.redSqr();ve=ve.redIAdd(ve),ve=ve.redIAdd(ve),ve=ve.redIAdd(ve);var Ne=Ie.redMul(r0).redISub(ve),ye=B.redAdd(B).redMul(oe);return this.curve.jpoint(te,Ne,ye)},S.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var N=this.x.redSqr(),R=this.y.redSqr(),B=this.z.redSqr(),oe=R.redSqr(),Ee=N.redAdd(N).redIAdd(N),pe=Ee.redSqr(),V=this.x.redAdd(R).redSqr().redISub(N).redISub(oe);V=V.redIAdd(V),V=V.redAdd(V).redIAdd(V),V=V.redISub(pe);var Ie=V.redSqr(),Ce=oe.redIAdd(oe);Ce=Ce.redIAdd(Ce),Ce=Ce.redIAdd(Ce),Ce=Ce.redIAdd(Ce);var _e=Ee.redIAdd(V).redSqr().redISub(pe).redISub(Ie).redISub(Ce),te=R.redMul(_e);te=te.redIAdd(te),te=te.redIAdd(te);var r0=this.x.redMul(Ie).redISub(te);r0=r0.redIAdd(r0),r0=r0.redIAdd(r0);var ve=this.y.redMul(_e.redMul(Ce.redISub(_e)).redISub(V.redMul(Ie)));ve=ve.redIAdd(ve),ve=ve.redIAdd(ve),ve=ve.redIAdd(ve);var Ne=this.z.redAdd(V).redSqr().redISub(B).redISub(Ie);return this.curve.jpoint(r0,ve,Ne)},S.prototype.mul=function(N,R){return N=new o(N,R),this.curve._wnafMul(this,N)},S.prototype.eq=function(N){if(N.type==="affine")return this.eq(N.toJ());if(this===N)return!0;var R=this.z.redSqr(),B=N.z.redSqr();if(this.x.redMul(B).redISub(N.x.redMul(R)).cmpn(0)!==0)return!1;var oe=R.redMul(this.z),Ee=B.redMul(N.z);return this.y.redMul(Ee).redISub(N.y.redMul(oe)).cmpn(0)===0},S.prototype.eqXToP=function(N){var R=this.z.redSqr(),B=N.toRed(this.curve.red).redMul(R);if(this.x.cmp(B)===0)return!0;for(var oe=N.clone(),Ee=this.curve.redN.redMul(R);;){if(oe.iadd(this.curve.n),oe.cmp(this.curve.p)>=0)return!1;if(B.redIAdd(Ee),this.x.cmp(B)===0)return!0}},S.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)+">"},S.prototype.isInfinity=function(){return this.z.cmpn(0)===0},sh}var fh,lp;function Bw(){if(lp)return fh;lp=1;var f=Oa(),o=Z1(),c=ru(),h=Ei();function b(y){c.call(this,"mont",y),this.a=new f(y.a,16).toRed(this.red),this.b=new f(y.b,16).toRed(this.red),this.i4=new f(4).toRed(this.red).redInvm(),this.two=new f(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o(b,c),fh=b,b.prototype.validate=function(S){var k=S.normalize().x,N=k.redSqr(),R=N.redMul(k).redAdd(N.redMul(this.a)).redAdd(k),B=R.redSqrt();return B.redSqr().cmp(R)===0};function I(y,S,k){c.BasePoint.call(this,y,"projective"),S===null&&k===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new f(S,16),this.z=new f(k,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return o(I,c.BasePoint),b.prototype.decodePoint=function(S,k){return this.point(h.toArray(S,k),1)},b.prototype.point=function(S,k){return new I(this,S,k)},b.prototype.pointFromJSON=function(S){return I.fromJSON(this,S)},I.prototype.precompute=function(){},I.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},I.fromJSON=function(S,k){return new I(S,k[0],k[1]||S.one)},I.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)+">"},I.prototype.isInfinity=function(){return this.z.cmpn(0)===0},I.prototype.dbl=function(){var S=this.x.redAdd(this.z),k=S.redSqr(),N=this.x.redSub(this.z),R=N.redSqr(),B=k.redSub(R),oe=k.redMul(R),Ee=B.redMul(R.redAdd(this.curve.a24.redMul(B)));return this.curve.point(oe,Ee)},I.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},I.prototype.diffAdd=function(S,k){var N=this.x.redAdd(this.z),R=this.x.redSub(this.z),B=S.x.redAdd(S.z),oe=S.x.redSub(S.z),Ee=oe.redMul(N),pe=B.redMul(R),V=k.z.redMul(Ee.redAdd(pe).redSqr()),Ie=k.x.redMul(Ee.redISub(pe).redSqr());return this.curve.point(V,Ie)},I.prototype.mul=function(S){for(var k=S.clone(),N=this,R=this.curve.point(null,null),B=this,oe=[];k.cmpn(0)!==0;k.iushrn(1))oe.push(k.andln(1));for(var Ee=oe.length-1;Ee>=0;Ee--)oe[Ee]===0?(N=N.diffAdd(R,B),R=R.dbl()):(R=N.diffAdd(R,B),N=N.dbl());return R},I.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},I.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},I.prototype.eq=function(S){return this.getX().cmp(S.getX())===0},I.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},I.prototype.getX=function(){return this.normalize(),this.x.fromRed()},fh}var ch,hp;function ww(){if(hp)return ch;hp=1;var f=Ei(),o=Oa(),c=Z1(),h=ru(),b=f.assert;function I(S){this.twisted=(S.a|0)!==1,this.mOneA=this.twisted&&(S.a|0)===-1,this.extended=this.mOneA,h.call(this,"edwards",S),this.a=new o(S.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new o(S.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new o(S.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),b(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(S.c|0)===1}c(I,h),ch=I,I.prototype._mulA=function(k){return this.mOneA?k.redNeg():this.a.redMul(k)},I.prototype._mulC=function(k){return this.oneC?k:this.c.redMul(k)},I.prototype.jpoint=function(k,N,R,B){return this.point(k,N,R,B)},I.prototype.pointFromX=function(k,N){k=new o(k,16),k.red||(k=k.toRed(this.red));var R=k.redSqr(),B=this.c2.redSub(this.a.redMul(R)),oe=this.one.redSub(this.c2.redMul(this.d).redMul(R)),Ee=B.redMul(oe.redInvm()),pe=Ee.redSqrt();if(pe.redSqr().redSub(Ee).cmp(this.zero)!==0)throw new Error("invalid point");var V=pe.fromRed().isOdd();return(N&&!V||!N&&V)&&(pe=pe.redNeg()),this.point(k,pe)},I.prototype.pointFromY=function(k,N){k=new o(k,16),k.red||(k=k.toRed(this.red));var R=k.redSqr(),B=R.redSub(this.c2),oe=R.redMul(this.d).redMul(this.c2).redSub(this.a),Ee=B.redMul(oe.redInvm());if(Ee.cmp(this.zero)===0){if(N)throw new Error("invalid point");return this.point(this.zero,k)}var pe=Ee.redSqrt();if(pe.redSqr().redSub(Ee).cmp(this.zero)!==0)throw new Error("invalid point");return pe.fromRed().isOdd()!==N&&(pe=pe.redNeg()),this.point(pe,k)},I.prototype.validate=function(k){if(k.isInfinity())return!0;k.normalize();var N=k.x.redSqr(),R=k.y.redSqr(),B=N.redMul(this.a).redAdd(R),oe=this.c2.redMul(this.one.redAdd(this.d.redMul(N).redMul(R)));return B.cmp(oe)===0};function y(S,k,N,R,B){h.BasePoint.call(this,S,"projective"),k===null&&N===null&&R===null?(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 o(k,16),this.y=new o(N,16),this.z=R?new o(R,16):this.curve.one,this.t=B&&new o(B,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()))))}return c(y,h.BasePoint),I.prototype.pointFromJSON=function(k){return y.fromJSON(this,k)},I.prototype.point=function(k,N,R,B){return new y(this,k,N,R,B)},y.fromJSON=function(k,N){return new y(k,N[0],N[1],N[2])},y.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)+">"},y.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},y.prototype._extDbl=function(){var k=this.x.redSqr(),N=this.y.redSqr(),R=this.z.redSqr();R=R.redIAdd(R);var B=this.curve._mulA(k),oe=this.x.redAdd(this.y).redSqr().redISub(k).redISub(N),Ee=B.redAdd(N),pe=Ee.redSub(R),V=B.redSub(N),Ie=oe.redMul(pe),Ce=Ee.redMul(V),_e=oe.redMul(V),te=pe.redMul(Ee);return this.curve.point(Ie,Ce,te,_e)},y.prototype._projDbl=function(){var k=this.x.redAdd(this.y).redSqr(),N=this.x.redSqr(),R=this.y.redSqr(),B,oe,Ee,pe,V,Ie;if(this.curve.twisted){pe=this.curve._mulA(N);var Ce=pe.redAdd(R);this.zOne?(B=k.redSub(N).redSub(R).redMul(Ce.redSub(this.curve.two)),oe=Ce.redMul(pe.redSub(R)),Ee=Ce.redSqr().redSub(Ce).redSub(Ce)):(V=this.z.redSqr(),Ie=Ce.redSub(V).redISub(V),B=k.redSub(N).redISub(R).redMul(Ie),oe=Ce.redMul(pe.redSub(R)),Ee=Ce.redMul(Ie))}else pe=N.redAdd(R),V=this.curve._mulC(this.z).redSqr(),Ie=pe.redSub(V).redSub(V),B=this.curve._mulC(k.redISub(pe)).redMul(Ie),oe=this.curve._mulC(pe).redMul(N.redISub(R)),Ee=pe.redMul(Ie);return this.curve.point(B,oe,Ee)},y.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},y.prototype._extAdd=function(k){var N=this.y.redSub(this.x).redMul(k.y.redSub(k.x)),R=this.y.redAdd(this.x).redMul(k.y.redAdd(k.x)),B=this.t.redMul(this.curve.dd).redMul(k.t),oe=this.z.redMul(k.z.redAdd(k.z)),Ee=R.redSub(N),pe=oe.redSub(B),V=oe.redAdd(B),Ie=R.redAdd(N),Ce=Ee.redMul(pe),_e=V.redMul(Ie),te=Ee.redMul(Ie),r0=pe.redMul(V);return this.curve.point(Ce,_e,r0,te)},y.prototype._projAdd=function(k){var N=this.z.redMul(k.z),R=N.redSqr(),B=this.x.redMul(k.x),oe=this.y.redMul(k.y),Ee=this.curve.d.redMul(B).redMul(oe),pe=R.redSub(Ee),V=R.redAdd(Ee),Ie=this.x.redAdd(this.y).redMul(k.x.redAdd(k.y)).redISub(B).redISub(oe),Ce=N.redMul(pe).redMul(Ie),_e,te;return this.curve.twisted?(_e=N.redMul(V).redMul(oe.redSub(this.curve._mulA(B))),te=pe.redMul(V)):(_e=N.redMul(V).redMul(oe.redSub(B)),te=this.curve._mulC(pe).redMul(V)),this.curve.point(Ce,_e,te)},y.prototype.add=function(k){return this.isInfinity()?k:k.isInfinity()?this:this.curve.extended?this._extAdd(k):this._projAdd(k)},y.prototype.mul=function(k){return this._hasDoubles(k)?this.curve._fixedNafMul(this,k):this.curve._wnafMul(this,k)},y.prototype.mulAdd=function(k,N,R){return this.curve._wnafMulAdd(1,[this,N],[k,R],2,!1)},y.prototype.jmulAdd=function(k,N,R){return this.curve._wnafMulAdd(1,[this,N],[k,R],2,!0)},y.prototype.normalize=function(){if(this.zOne)return this;var k=this.z.redInvm();return this.x=this.x.redMul(k),this.y=this.y.redMul(k),this.t&&(this.t=this.t.redMul(k)),this.z=this.curve.one,this.zOne=!0,this},y.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},y.prototype.getX=function(){return this.normalize(),this.x.fromRed()},y.prototype.getY=function(){return this.normalize(),this.y.fromRed()},y.prototype.eq=function(k){return this===k||this.getX().cmp(k.getX())===0&&this.getY().cmp(k.getY())===0},y.prototype.eqXToP=function(k){var N=k.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(N)===0)return!0;for(var R=k.clone(),B=this.curve.redN.redMul(this.z);;){if(R.iadd(this.curve.n),R.cmp(this.curve.p)>=0)return!1;if(N.redIAdd(B),this.x.cmp(N)===0)return!0}},y.prototype.toP=y.prototype.normalize,y.prototype.mixedAdd=y.prototype.add,ch}var dp;function Jy(){return dp||(dp=1,function(f){var o=f;o.base=ru(),o.short=_w(),o.mont=Bw(),o.edwards=ww()}(ah)),ah}var uh={},lh,gp;function mw(){return gp||(gp=1,lh={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"]]}}),lh}var pp;function ug(){return pp||(pp=1,function(f){var o=f,c=$1(),h=Jy(),b=Ei(),I=b.assert;function y(N){N.type==="short"?this.curve=new h.short(N):N.type==="edwards"?this.curve=new h.edwards(N):this.curve=new h.mont(N),this.g=this.curve.g,this.n=this.curve.n,this.hash=N.hash,I(this.g.validate(),"Invalid curve"),I(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o.PresetCurve=y;function S(N,R){Object.defineProperty(o,N,{configurable:!0,enumerable:!0,get:function(){var B=new y(R);return Object.defineProperty(o,N,{configurable:!0,enumerable:!0,value:B}),B}})}S("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:c.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),S("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:c.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),S("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:c.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),S("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:c.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),S("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:c.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),S("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:c.sha256,gRed:!1,g:["9"]}),S("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:c.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var k;try{k=mw()}catch{k=void 0}S("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:c.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",k]})}(uh)),uh}var hh,yp;function Qw(){if(yp)return hh;yp=1;var f=$1(),o=Ly(),c=C2();function h(b){if(!(this instanceof h))return new h(b);this.hash=b.hash,this.predResist=!!b.predResist,this.outLen=this.hash.outSize,this.minEntropy=b.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var I=o.toArray(b.entropy,b.entropyEnc||"hex"),y=o.toArray(b.nonce,b.nonceEnc||"hex"),S=o.toArray(b.pers,b.persEnc||"hex");c(I.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(I,y,S)}return hh=h,h.prototype._init=function(I,y,S){var k=I.concat(y).concat(S);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var N=0;N<this.V.length;N++)this.K[N]=0,this.V[N]=1;this._update(k),this._reseed=1,this.reseedInterval=281474976710656},h.prototype._hmac=function(){return new f.hmac(this.hash,this.K)},h.prototype._update=function(I){var y=this._hmac().update(this.V).update([0]);I&&(y=y.update(I)),this.K=y.digest(),this.V=this._hmac().update(this.V).digest(),I&&(this.K=this._hmac().update(this.V).update([1]).update(I).digest(),this.V=this._hmac().update(this.V).digest())},h.prototype.reseed=function(I,y,S,k){typeof y!="string"&&(k=S,S=y,y=null),I=o.toArray(I,y),S=o.toArray(S,k),c(I.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(I.concat(S||[])),this._reseed=1},h.prototype.generate=function(I,y,S,k){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof y!="string"&&(k=S,S=y,y=null),S&&(S=o.toArray(S,k||"hex"),this._update(S));for(var N=[];N.length<I;)this.V=this._hmac().update(this.V).digest(),N=N.concat(this.V);var R=N.slice(0,I);return this._update(S),this._reseed++,o.encode(R,y)},hh}var dh,Cp;function Sw(){if(Cp)return dh;Cp=1;var f=Oa(),o=Ei(),c=o.assert;function h(b,I){this.ec=b,this.priv=null,this.pub=null,I.priv&&this._importPrivate(I.priv,I.privEnc),I.pub&&this._importPublic(I.pub,I.pubEnc)}return dh=h,h.fromPublic=function(I,y,S){return y instanceof h?y:new h(I,{pub:y,pubEnc:S})},h.fromPrivate=function(I,y,S){return y instanceof h?y:new h(I,{priv:y,privEnc:S})},h.prototype.validate=function(){var I=this.getPublic();return I.isInfinity()?{result:!1,reason:"Invalid public key"}:I.validate()?I.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"}},h.prototype.getPublic=function(I,y){return typeof I=="string"&&(y=I,I=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),y?this.pub.encode(y,I):this.pub},h.prototype.getPrivate=function(I){return I==="hex"?this.priv.toString(16,2):this.priv},h.prototype._importPrivate=function(I,y){this.priv=new f(I,y||16),this.priv=this.priv.umod(this.ec.curve.n)},h.prototype._importPublic=function(I,y){if(I.x||I.y){this.ec.curve.type==="mont"?c(I.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&c(I.x&&I.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(I.x,I.y);return}this.pub=this.ec.curve.decodePoint(I,y)},h.prototype.derive=function(I){return I.validate()||c(I.validate(),"public point not validated"),I.mul(this.priv).getX()},h.prototype.sign=function(I,y,S){return this.ec.sign(I,this,y,S)},h.prototype.verify=function(I,y,S){return this.ec.verify(I,y,this,void 0,S)},h.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},dh}var gh,Ip;function Dw(){if(Ip)return gh;Ip=1;var f=Oa(),o=Ei(),c=o.assert;function h(k,N){if(k instanceof h)return k;this._importDER(k,N)||(c(k.r&&k.s,"Signature without r or s"),this.r=new f(k.r,16),this.s=new f(k.s,16),k.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=k.recoveryParam)}gh=h;function b(){this.place=0}function I(k,N){var R=k[N.place++];if(!(R&128))return R;var B=R&15;if(B===0||B>4||k[N.place]===0)return!1;for(var oe=0,Ee=0,pe=N.place;Ee<B;Ee++,pe++)oe<<=8,oe|=k[pe],oe>>>=0;return oe<=127?!1:(N.place=pe,oe)}function y(k){for(var N=0,R=k.length-1;!k[N]&&!(k[N+1]&128)&&N<R;)N++;return N===0?k:k.slice(N)}h.prototype._importDER=function(N,R){N=o.toArray(N,R);var B=new b;if(N[B.place++]!==48)return!1;var oe=I(N,B);if(oe===!1||oe+B.place!==N.length||N[B.place++]!==2)return!1;var Ee=I(N,B);if(Ee===!1||(N[B.place]&128)!==0)return!1;var pe=N.slice(B.place,Ee+B.place);if(B.place+=Ee,N[B.place++]!==2)return!1;var V=I(N,B);if(V===!1||N.length!==V+B.place||(N[B.place]&128)!==0)return!1;var Ie=N.slice(B.place,V+B.place);if(pe[0]===0)if(pe[1]&128)pe=pe.slice(1);else return!1;if(Ie[0]===0)if(Ie[1]&128)Ie=Ie.slice(1);else return!1;return this.r=new f(pe),this.s=new f(Ie),this.recoveryParam=null,!0};function S(k,N){if(N<128){k.push(N);return}var R=1+(Math.log(N)/Math.LN2>>>3);for(k.push(R|128);--R;)k.push(N>>>(R<<3)&255);k.push(N)}return h.prototype.toDER=function(N){var R=this.r.toArray(),B=this.s.toArray();for(R[0]&128&&(R=[0].concat(R)),B[0]&128&&(B=[0].concat(B)),R=y(R),B=y(B);!B[0]&&!(B[1]&128);)B=B.slice(1);var oe=[2];S(oe,R.length),oe=oe.concat(R),oe.push(2),S(oe,B.length);var Ee=oe.concat(B),pe=[48];return S(pe,Ee.length),pe=pe.concat(Ee),o.encode(pe,N)},gh}var ph,bp;function kw(){if(bp)return ph;bp=1;var f=Oa(),o=Qw(),c=Ei(),h=ug(),b=Ty(),I=c.assert,y=Sw(),S=Dw();function k(N){if(!(this instanceof k))return new k(N);typeof N=="string"&&(I(Object.prototype.hasOwnProperty.call(h,N),"Unknown curve "+N),N=h[N]),N instanceof h.PresetCurve&&(N={curve:N}),this.curve=N.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=N.curve.g,this.g.precompute(N.curve.n.bitLength()+1),this.hash=N.hash||N.curve.hash}return ph=k,k.prototype.keyPair=function(R){return new y(this,R)},k.prototype.keyFromPrivate=function(R,B){return y.fromPrivate(this,R,B)},k.prototype.keyFromPublic=function(R,B){return y.fromPublic(this,R,B)},k.prototype.genKeyPair=function(R){R||(R={});for(var B=new o({hash:this.hash,pers:R.pers,persEnc:R.persEnc||"utf8",entropy:R.entropy||b(this.hash.hmacStrength),entropyEnc:R.entropy&&R.entropyEnc||"utf8",nonce:this.n.toArray()}),oe=this.n.byteLength(),Ee=this.n.sub(new f(2));;){var pe=new f(B.generate(oe));if(!(pe.cmp(Ee)>0))return pe.iaddn(1),this.keyFromPrivate(pe)}},k.prototype._truncateToN=function(R,B,oe){var Ee;if(f.isBN(R)||typeof R=="number")R=new f(R,16),Ee=R.byteLength();else if(typeof R=="object")Ee=R.length,R=new f(R,16);else{var pe=R.toString();Ee=pe.length+1>>>1,R=new f(pe,16)}typeof oe!="number"&&(oe=Ee*8);var V=oe-this.n.bitLength();return V>0&&(R=R.ushrn(V)),!B&&R.cmp(this.n)>=0?R.sub(this.n):R},k.prototype.sign=function(R,B,oe,Ee){if(typeof oe=="object"&&(Ee=oe,oe=null),Ee||(Ee={}),typeof R!="string"&&typeof R!="number"&&!f.isBN(R)){I(typeof R=="object"&&R&&typeof R.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),I(R.length>>>0===R.length);for(var pe=0;pe<R.length;pe++)I((R[pe]&255)===R[pe])}B=this.keyFromPrivate(B,oe),R=this._truncateToN(R,!1,Ee.msgBitLength),I(!R.isNeg(),"Can not sign a negative message");var V=this.n.byteLength(),Ie=B.getPrivate().toArray("be",V),Ce=R.toArray("be",V);I(new f(Ce).eq(R),"Can not sign message");for(var _e=new o({hash:this.hash,entropy:Ie,nonce:Ce,pers:Ee.pers,persEnc:Ee.persEnc||"utf8"}),te=this.n.sub(new f(1)),r0=0;;r0++){var ve=Ee.k?Ee.k(r0):new f(_e.generate(this.n.byteLength()));if(ve=this._truncateToN(ve,!0),!(ve.cmpn(1)<=0||ve.cmp(te)>=0)){var Ne=this.g.mul(ve);if(!Ne.isInfinity()){var ye=Ne.getX(),Xe=ye.umod(this.n);if(Xe.cmpn(0)!==0){var he=ve.invm(this.n).mul(Xe.mul(B.getPrivate()).iadd(R));if(he=he.umod(this.n),he.cmpn(0)!==0){var v0=(Ne.getY().isOdd()?1:0)|(ye.cmp(Xe)!==0?2:0);return Ee.canonical&&he.cmp(this.nh)>0&&(he=this.n.sub(he),v0^=1),new S({r:Xe,s:he,recoveryParam:v0})}}}}}},k.prototype.verify=function(R,B,oe,Ee,pe){pe||(pe={}),R=this._truncateToN(R,!1,pe.msgBitLength),oe=this.keyFromPublic(oe,Ee),B=new S(B,"hex");var V=B.r,Ie=B.s;if(V.cmpn(1)<0||V.cmp(this.n)>=0||Ie.cmpn(1)<0||Ie.cmp(this.n)>=0)return!1;var Ce=Ie.invm(this.n),_e=Ce.mul(R).umod(this.n),te=Ce.mul(V).umod(this.n),r0;return this.curve._maxwellTrick?(r0=this.g.jmulAdd(_e,oe.getPublic(),te),r0.isInfinity()?!1:r0.eqXToP(V)):(r0=this.g.mulAdd(_e,oe.getPublic(),te),r0.isInfinity()?!1:r0.getX().umod(this.n).cmp(V)===0)},k.prototype.recoverPubKey=function(N,R,B,oe){I((3&B)===B,"The recovery param is more than two bits"),R=new S(R,oe);var Ee=this.n,pe=new f(N),V=R.r,Ie=R.s,Ce=B&1,_e=B>>1;if(V.cmp(this.curve.p.umod(this.curve.n))>=0&&_e)throw new Error("Unable to find sencond key candinate");_e?V=this.curve.pointFromX(V.add(this.curve.n),Ce):V=this.curve.pointFromX(V,Ce);var te=R.r.invm(Ee),r0=Ee.sub(pe).mul(te).umod(Ee),ve=Ie.mul(te).umod(Ee);return this.g.mulAdd(r0,V,ve)},k.prototype.getKeyRecoveryParam=function(N,R,B,oe){if(R=new S(R,oe),R.recoveryParam!==null)return R.recoveryParam;for(var Ee=0;Ee<4;Ee++){var pe;try{pe=this.recoverPubKey(N,R,Ee)}catch{continue}if(pe.eq(B))return Ee}throw new Error("Unable to find valid recovery factor")},ph}var yh,vp;function Mw(){if(vp)return yh;vp=1;var f=Ei(),o=f.assert,c=f.parseBytes,h=f.cachedProperty;function b(I,y){this.eddsa=I,this._secret=c(y.secret),I.isPoint(y.pub)?this._pub=y.pub:this._pubBytes=c(y.pub)}return b.fromPublic=function(y,S){return S instanceof b?S:new b(y,{pub:S})},b.fromSecret=function(y,S){return S instanceof b?S:new b(y,{secret:S})},b.prototype.secret=function(){return this._secret},h(b,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),h(b,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),h(b,"privBytes",function(){var y=this.eddsa,S=this.hash(),k=y.encodingLength-1,N=S.slice(0,y.encodingLength);return N[0]&=248,N[k]&=127,N[k]|=64,N}),h(b,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),h(b,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),h(b,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),b.prototype.sign=function(y){return o(this._secret,"KeyPair can only verify"),this.eddsa.sign(y,this)},b.prototype.verify=function(y,S){return this.eddsa.verify(y,S,this)},b.prototype.getSecret=function(y){return o(this._secret,"KeyPair is public only"),f.encode(this.secret(),y)},b.prototype.getPublic=function(y){return f.encode(this.pubBytes(),y)},yh=b,yh}var Ch,xp;function Nw(){if(xp)return Ch;xp=1;var f=Oa(),o=Ei(),c=o.assert,h=o.cachedProperty,b=o.parseBytes;function I(y,S){this.eddsa=y,typeof S!="object"&&(S=b(S)),Array.isArray(S)&&(c(S.length===y.encodingLength*2,"Signature has invalid size"),S={R:S.slice(0,y.encodingLength),S:S.slice(y.encodingLength)}),c(S.R&&S.S,"Signature without R or S"),y.isPoint(S.R)&&(this._R=S.R),S.S instanceof f&&(this._S=S.S),this._Rencoded=Array.isArray(S.R)?S.R:S.Rencoded,this._Sencoded=Array.isArray(S.S)?S.S:S.Sencoded}return h(I,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),h(I,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),h(I,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),h(I,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),I.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},I.prototype.toHex=function(){return o.encode(this.toBytes(),"hex").toUpperCase()},Ch=I,Ch}var Ih,Ep;function Fw(){if(Ep)return Ih;Ep=1;var f=$1(),o=ug(),c=Ei(),h=c.assert,b=c.parseBytes,I=Mw(),y=Nw();function S(k){if(h(k==="ed25519","only tested with ed25519 so far"),!(this instanceof S))return new S(k);k=o[k].curve,this.curve=k,this.g=k.g,this.g.precompute(k.n.bitLength()+1),this.pointClass=k.point().constructor,this.encodingLength=Math.ceil(k.n.bitLength()/8),this.hash=f.sha512}return Ih=S,S.prototype.sign=function(N,R){N=b(N);var B=this.keyFromSecret(R),oe=this.hashInt(B.messagePrefix(),N),Ee=this.g.mul(oe),pe=this.encodePoint(Ee),V=this.hashInt(pe,B.pubBytes(),N).mul(B.priv()),Ie=oe.add(V).umod(this.curve.n);return this.makeSignature({R:Ee,S:Ie,Rencoded:pe})},S.prototype.verify=function(N,R,B){if(N=b(N),R=this.makeSignature(R),R.S().gte(R.eddsa.curve.n)||R.S().isNeg())return!1;var oe=this.keyFromPublic(B),Ee=this.hashInt(R.Rencoded(),oe.pubBytes(),N),pe=this.g.mul(R.S()),V=R.R().add(oe.pub().mul(Ee));return V.eq(pe)},S.prototype.hashInt=function(){for(var N=this.hash(),R=0;R<arguments.length;R++)N.update(arguments[R]);return c.intFromLE(N.digest()).umod(this.curve.n)},S.prototype.keyFromPublic=function(N){return I.fromPublic(this,N)},S.prototype.keyFromSecret=function(N){return I.fromSecret(this,N)},S.prototype.makeSignature=function(N){return N instanceof y?N:new y(this,N)},S.prototype.encodePoint=function(N){var R=N.getY().toArray("le",this.encodingLength);return R[this.encodingLength-1]|=N.getX().isOdd()?128:0,R},S.prototype.decodePoint=function(N){N=c.parseBytes(N);var R=N.length-1,B=N.slice(0,R).concat(N[R]&-129),oe=(N[R]&128)!==0,Ee=c.intFromLE(B);return this.curve.pointFromY(Ee,oe)},S.prototype.encodeInt=function(N){return N.toArray("le",this.encodingLength)},S.prototype.decodeInt=function(N){return c.intFromLE(N)},S.prototype.isPoint=function(N){return N instanceof this.pointClass},Ih}var _p;function Pw(){return _p||(_p=1,function(f){var o=f;o.version=xw.version,o.utils=Ei(),o.rand=Ty(),o.curve=Jy(),o.curves=ug(),o.ec=kw(),o.eddsa=Fw()}(nh)),nh}var Kw=Pw();const Uw=Ji(Kw);var b2=function(f,o,c,h){var b=arguments.length,I=b<3?o:h===null?h=Object.getOwnPropertyDescriptor(o,c):h,y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(f,o,c,h);else for(var S=f.length-1;S>=0;S--)(y=f[S])&&(I=(b<3?y(I):b>3?y(o,c,I):y(o,c))||I);return b>3&&I&&Object.defineProperty(o,c,I),I},v2=function(f,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(f,o)},cf,nd,n1,Hw=Uw.ec;let bh,Po=cf=class extends xs{publicKey;constructor(o){if(super(),o.publicKey.length!==33)throw new Error("Expecting key to have length 33");this.publicKey=o.publicKey}static async recover(o){const c=new Uint8Array([0]),h=await o.signMessage(c),b=Oy(await jf(c,La.ETH_KECCAK_256),h);return new cf({publicKey:b})}equals(o){return o instanceof cf?yA(this.publicKey,o.publicKey):!1}toString(){return"sepc256k1/"+Lf(this.publicKey)}toPeerId(){return X1(V1(this.publicKey))}static fromPeerId(o){if(!o.publicKey)throw new Error("Missing public key");if(o.type==="secp256k1")return new cf({publicKey:o.publicKey.raw});throw new Error("Unsupported key type: "+o.type)}};b2([LA({type:md("u8",33)}),v2("design:type",Uint8Array)],Po.prototype,"publicKey",void 0);Po=cf=b2([Uo(1),v2("design:paramtypes",[Object])],Po);let ms=nd=class extends U3{privateKey;constructor(o){if(super(),o.privateKey.length!==32)throw new Error("Expecting key to have length 32");this.privateKey=o.privateKey}equals(o){return o instanceof nd?yA(this.privateKey,o.privateKey):!1}toString(){return"secp256k1s/"+Lf(this.privateKey)}};b2([LA({type:Uint8Array}),v2("design:type",Uint8Array)],ms.prototype,"privateKey",void 0);ms=nd=b2([Uo(1),v2("design:paramtypes",[Object])],ms);let m1=n1=class extends K3{publicKey;privateKey;_wallet;constructor(o){super(),this.privateKey=o.privateKey,this.publicKey=o.publicKey}static async create(){const o=await v9();return new n1({publicKey:new Po({publicKey:o.publicKey.raw}),privateKey:new ms({privateKey:o.raw})})}async sign(o,c=La.ETH_KECCAK_256){const h=await jf(o,c),b=Wh((this._wallet||(this._wallet=new c2(this.privateKey.privateKey)))._signingKey().signDigest(h)),I=new Uint8Array(Do.length(b));return Do.write(b,I,0),new Ta({prehash:c,publicKey:this.publicKey,signature:I})}equals(o){return o instanceof n1?this.publicKey.equals(o.publicKey)&&this.privateKey.equals(o.privateKey):!1}toPeerId(){return X1(V1(this.publicKey.publicKey))}};b2([LA({type:Po}),v2("design:type",Po)],m1.prototype,"publicKey",void 0);b2([LA({type:ms}),v2("design:type",ms)],m1.prototype,"privateKey",void 0);m1=n1=b2([Uo(2),v2("design:paramtypes",[Object])],m1);const Rw=new TextDecoder;function Gw(){return bh||(bh=new Hw("secp256k1")),bh}const Oy=(f,o)=>{const c=Ns(o),h={r:Nt(c.r),s:Nt(c.s)};return new Uint8Array(Gw().recoverPubKey(Nt(f),h,c.recoveryParam).encodeCompressed())},Yw=async(f,o)=>{const c=await jf(o,f.prehash),h=Oy(Nt(c),Rw.decode(f.signature));return yA(h,f.publicKey.publicKey)};var x2=function(f,o,c,h){var b=arguments.length,I=b<3?o:h===null?h=Object.getOwnPropertyDescriptor(o,c):h,y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(f,o,c,h);else for(var S=f.length-1;S>=0;S--)(y=f[S])&&(I=(b<3?y(I):b>3?y(o,c,I):y(o,c))||I);return b>3&&I&&Object.defineProperty(o,c,I),I},E2=function(f,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(f,o)};let Ta=class{signature;publicKey;prehash=La.NONE;constructor(o){this.signature=o.signature,this.publicKey=o.publicKey,this.prehash=o.prehash}equals(o){return yA(this.signature,o.signature)?B3(vs(this.publicKey),vs(o.publicKey))===0&&this.prehash===o.prehash:!1}};x2([LA({type:Uint8Array}),E2("design:type",Uint8Array)],Ta.prototype,"signature",void 0);x2([LA({type:xs}),E2("design:type",xs)],Ta.prototype,"publicKey",void 0);x2([LA({type:"u8"}),E2("design:type",Number)],Ta.prototype,"prehash",void 0);Ta=x2([Uo(0),E2("design:paramtypes",[Object])],Ta);let Q1=class{data;signature;constructor(o){this.data=o.data,this.signature=o.signature,this._value=o.value}_value;getValue(o){return lx(this.data,o)}async verify(){return this.signature?Lw(this.signature,this.data):!0}equals(o){return!yA(this.data,o.data)||!this.signature!=!o.signature?!1:this.signature&&o.signature?this.signature.equals(o.signature):!0}async sign(o){const c=await o(this.data);return this.signature=c,this}};x2([LA({type:Uint8Array}),E2("design:type",Uint8Array)],Q1.prototype,"data",void 0);x2([LA({type:Zv(Ta)}),E2("design:type",Ta)],Q1.prototype,"signature",void 0);Q1=x2([Uo(0),E2("design:paramtypes",[Object])],Q1);const Lw=async(f,o)=>f.publicKey instanceof Ko?Jw(f,o):f.publicKey instanceof Po?Yw(f,o):!1,Tw=async(f,o,c)=>{const h=await jf(f,c);return new Ta({prehash:c,publicKey:o.publicKey,signature:p2.crypto_sign_detached(h,o.privateKeyPublicKey)})},Jw=async(f,o)=>{let c=!1;try{const h=await jf(o,f.prehash);c=p2.crypto_sign_verify_detached(f.signature,h,f.publicKey.publicKey)}catch{return!1}return c};var _2=function(f,o,c,h){var b=arguments.length,I=b<3?o:h===null?h=Object.getOwnPropertyDescriptor(o,c):h,y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(f,o,c,h);else for(var S=f.length-1;S>=0;S--)(y=f[S])&&(I=(b<3?y(I):b>3?y(o,c,I):y(o,c))||I);return b>3&&I&&Object.defineProperty(o,c,I),I},B2=function(f,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(f,o)},A1,Ad,i1;let Ko=A1=class extends xs{publicKey;constructor(o){if(super(),this.publicKey=o.publicKey,o.publicKey.length!==32)throw new Error("Expecting key to have length 32")}equals(o){return o instanceof A1?yA(this.publicKey,o.publicKey):!1}toString(){return"ed25119p/"+Lf(this.publicKey)}toPeerId(){return X1(V1(this.publicKey))}static fromPeerId(o){if(!o.publicKey)throw new Error("Missing public key");if(o.type==="Ed25519")return new A1({publicKey:m9(o.publicKey.raw)});throw new Error("Unsupported key type: "+o.type)}};_2([LA({type:md("u8",32)}),B2("design:type",Uint8Array)],Ko.prototype,"publicKey",void 0);Ko=A1=_2([Uo(0),B2("design:paramtypes",[Object])],Ko);let Qs=Ad=class extends U3{privateKey;constructor(o){if(super(),o.privateKey.length!==32)throw new Error("Expecting key to have length 32");this.privateKey=o.privateKey}equals(o){return o instanceof Ad?yA(this.privateKey,o.privateKey):!1}toString(){return"ed25119s/"+Lf(this.privateKey)}keyObject};_2([LA({type:md("u8",32)}),B2("design:type",Uint8Array)],Qs.prototype,"privateKey",void 0);Qs=Ad=_2([Uo(0),B2("design:paramtypes",[Object])],Qs);let Sf=i1=class extends K3{publicKey;privateKey;constructor(o){super(),this.privateKey=o.privateKey,this.publicKey=o.publicKey}static async create(){await p2.ready;const o=p2.crypto_sign_keypair();return new i1({publicKey:new Ko({publicKey:o.publicKey}),privateKey:new Qs({privateKey:o.privateKey.slice(0,32)})})}sign(o,c=La.NONE){return Tw(o,this,c)}signer(o){return async c=>this.sign(c,o)}equals(o){return o instanceof i1?this.publicKey.equals(o.publicKey)&&this.privateKey.equals(o.privateKey):!1}_privateKeyPublicKey;get privateKeyPublicKey(){return this._privateKeyPublicKey||(this._privateKeyPublicKey=Li([this.privateKey.privateKey,this.publicKey.publicKey]))}toPeerId(){return X1(V1(this.publicKey.publicKey))}};_2([LA({type:Ko}),B2("design:type",Ko)],Sf.prototype,"publicKey",void 0);_2([LA({type:Qs}),B2("design:type",Qs)],Sf.prototype,"privateKey",void 0);Sf=i1=_2([Uo(0),B2("design:paramtypes",[Object])],Sf);const Bp=f=>{if(f.type==="Ed25519")return Ko.fromPeerId(f);if(f.type==="secp256k1")return Po.fromPeerId(f);throw new Error("Unsupported key type")},Ow=f=>{if(f==="https:")return zy;if(f==="http:")return id;throw new Error("Unsupported protocol: "+f)},zy=9002,id=8082,wp="/trust",zw="/peer/id",qw="/peer/address",zc="/program",vh="/programs",jw="/program/variants",Vw="/install",Xw="/network/bootstrap",Ww="/restart",Zw="/path",$w="/log",em="/versions",tm="modulepreload",rm=function(f){return"/"+f},mp={},Qp=function(o,c,h){let b=Promise.resolve();if(c&&c.length>0){let y=function(N){return Promise.all(N.map(R=>Promise.resolve(R).then(B=>({status:"fulfilled",value:B}),B=>({status:"rejected",reason:B}))))};document.getElementsByTagName("link");const S=document.querySelector("meta[property=csp-nonce]"),k=S?.nonce||S?.getAttribute("nonce");b=y(c.map(N=>{if(N=rm(N),N in mp)return;mp[N]=!0;const R=N.endsWith(".css"),B=R?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${N}"]${B}`))return;const oe=document.createElement("link");if(oe.rel=R?"stylesheet":tm,R||(oe.as="script"),oe.crossOrigin="",oe.href=N,k&&oe.setAttribute("nonce",k),document.head.appendChild(oe),R)return new Promise((Ee,pe)=>{oe.addEventListener("load",Ee),oe.addEventListener("error",()=>pe(new Error(`Unable to preload CSS for ${N}`)))})}))}function I(y){const S=new Event("vite:preloadError",{cancelable:!0});if(S.payload=y,window.dispatchEvent(S),!S.defaultPrevented)throw y}return b.then(y=>{for(const S of y||[])S.status==="rejected"&&I(S.reason);return o().catch(I)})};class nm{index=0;input="";new(o){return this.index=0,this.input=o,this}readAtomically(o){const c=this.index,h=o();return h===void 0&&(this.index=c),h}parseWith(o){const c=o();if(this.index===this.input.length)return c}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(o){return this.readAtomically(()=>{const c=this.readChar();if(c===o)return c})}readSeparator(o,c,h){return this.readAtomically(()=>{if(!(c>0&&this.readGivenChar(o)===void 0))return h()})}readNumber(o,c,h,b){return this.readAtomically(()=>{let I=0,y=0;const S=this.peekChar();if(S===void 0)return;const k=S==="0",N=2**(8*b)-1;for(;;){const R=this.readAtomically(()=>{const B=this.readChar();if(B===void 0)return;const oe=Number.parseInt(B,o);if(!Number.isNaN(oe))return oe});if(R===void 0)break;if(I*=o,I+=R,I>N||(y+=1,c!==void 0&&y>c))return}if(y!==0)return!h&&k&&y>1?void 0:I})}readIPv4Addr(){return this.readAtomically(()=>{const o=new Uint8Array(4);for(let c=0;c<o.length;c++){const h=this.readSeparator(".",c,()=>this.readNumber(10,3,!1,1));if(h===void 0)return;o[c]=h}return o})}readIPv6Addr(){const o=c=>{for(let h=0;h<c.length/2;h++){const b=h*2;if(h<c.length-3){const y=this.readSeparator(":",h,()=>this.readIPv4Addr());if(y!==void 0)return c[b]=y[0],c[b+1]=y[1],c[b+2]=y[2],c[b+3]=y[3],[b+4,!0]}const I=this.readSeparator(":",h,()=>this.readNumber(16,4,!0,2));if(I===void 0)return[b,!1];c[b]=I>>8,c[b+1]=I&255}return[c.length,!1]};return this.readAtomically(()=>{const c=new Uint8Array(16),[h,b]=o(c);if(h===16)return c;if(b||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;const I=new Uint8Array(14),y=16-(h+2),[S]=o(I.subarray(0,y));return c.set(I.subarray(0,S),16-S),c})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}}const qy=45,Am=15,Ss=new nm;function im(f){if(!(f.length>Am))return Ss.new(f).parseWith(()=>Ss.readIPv4Addr())}function am(f){if(f.includes("%")&&(f=f.split("%")[0]),!(f.length>qy))return Ss.new(f).parseWith(()=>Ss.readIPv6Addr())}function om(f,o=!1){if(f.includes("%")&&(f=f.split("%")[0]),f.length>qy)return;const c=Ss.new(f).parseWith(()=>Ss.readIPAddr());if(c)return o&&c.length===4?Uint8Array.from([0,0,0,0,0,0,0,0,0,0,255,255,c[0],c[1],c[2],c[3]]):c}function sm(f){return!!im(f)}function fm(f){return!!am(f)}function jy(f){return!!om(f)}const Sp=sm,cm=fm,Vy=function(f){let o=0;if(f=f.toString().trim(),Sp(f)){const c=new Uint8Array(o+4);return f.split(/\./g).forEach(h=>{c[o++]=parseInt(h,10)&255}),c}if(cm(f)){const c=f.split(":",8);let h;for(h=0;h<c.length;h++){const I=Sp(c[h]);let y;I&&(y=Vy(c[h]),c[h]=Kn(y.slice(0,2),"base16")),y!=null&&++h<8&&c.splice(h,0,Kn(y.slice(2,4),"base16"))}if(c[0]==="")for(;c.length<8;)c.unshift("0");else if(c[c.length-1]==="")for(;c.length<8;)c.push("0");else if(c.length<8){for(h=0;h<c.length&&c[h]!=="";h++);const I=[h,1];for(h=9-c.length;h>0;h--)I.push("0");c.splice.apply(c,I)}const b=new Uint8Array(o+16);for(h=0;h<c.length;h++){const I=parseInt(c[h],16);b[o++]=I>>8&255,b[o++]=I&255}return b}throw new Error("invalid ip address")},um=function(f,o=0,c){o=~~o,c=c??f.length-o;const h=new DataView(f.buffer);if(c===4){const b=[];for(let I=0;I<c;I++)b.push(f[o+I]);return b.join(".")}if(c===16){const b=[];for(let I=0;I<c;I+=2)b.push(h.getUint16(o+I).toString(16));return b.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""},XA=-1,Df={},ad={},lm=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,XA,"ip6zone"],[43,8,"ipcidr"],[53,XA,"dns",!0],[54,XA,"dns4",!0],[55,XA,"dns6",!0],[56,XA,"dnsaddr",!0],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[280,0,"webrtc-direct"],[281,0,"webrtc"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,XA,"unix",!1,!0],[421,XA,"ipfs"],[421,XA,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,XA,"garlic64"],[448,0,"tls"],[449,XA,"sni"],[460,0,"quic"],[461,0,"quic-v1"],[465,0,"webtransport"],[466,XA,"certhash"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[481,XA,"http-path"],[777,XA,"memory"]];lm.forEach(f=>{const o=hm(...f);ad[o.code]=o,Df[o.name]=o});function hm(f,o,c,h,b){return{code:f,size:o,name:c,resolvable:!!h,path:!!b}}function hn(f){if(typeof f=="number"){if(ad[f]!=null)return ad[f];throw new Error(`no protocol with code: ${f}`)}else if(typeof f=="string"){if(Df[f]!=null)return Df[f];throw new Error(`no protocol with name: ${f}`)}throw new Error(`invalid protocol id type: ${typeof f}`)}hn("ip4");hn("ip6");hn("ipcidr");function Xy(f,o){switch(hn(f).code){case 4:case 41:return gm(o);case 42:return _h(o);case 43:return Kn(o,"base10");case 6:case 273:case 33:case 132:return Wy(o).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return _h(o);case 421:return Im(o);case 444:return Mp(o);case 445:return Mp(o);case 466:return Cm(o);case 481:return globalThis.encodeURIComponent(_h(o));default:return Kn(o,"base16")}}function Dp(f,o){switch(hn(f).code){case 4:return kp(o);case 41:return kp(o);case 42:return Eh(o);case 43:return Mo(o,"base10");case 6:case 273:case 33:case 132:return lg(parseInt(o,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Eh(o);case 421:return pm(o);case 444:return bm(o);case 445:return vm(o);case 466:return ym(o);case 481:return Eh(globalThis.decodeURIComponent(o));default:return Mo(o,"base16")}}const xh=Object.values(Hh).map(f=>f.decoder),dm=function(){let f=xh[0].or(xh[1]);return xh.slice(2).forEach(o=>f=f.or(o)),f}();function kp(f){if(!jy(f))throw new Error("invalid ip address");return Vy(f)}function gm(f){const o=um(f,0,f.length);if(o==null)throw new Error("ipBuff is required");if(!jy(o))throw new Error("invalid ip address");return o}function lg(f){const o=new ArrayBuffer(2);return new DataView(o).setUint16(0,f),new Uint8Array(o)}function Wy(f){return new DataView(f.buffer).getUint16(f.byteOffset)}function Eh(f){const o=Mo(f),c=Uint8Array.from(j1(o.length));return Li([c,o],c.length+o.length)}function _h(f){const o=qf(f);if(f=f.slice(pa(o)),f.length!==o)throw new Error("inconsistent lengths");return Kn(f)}function pm(f){let o;f[0]==="Q"||f[0]==="1"?o=S3(dA.decode(`z${f}`)).bytes:o=un.parse(f).multihash.bytes;const c=Uint8Array.from(j1(o.length));return Li([c,o],c.length+o.length)}function ym(f){const o=dm.decode(f),c=Uint8Array.from(j1(o.length));return Li([c,o],c.length+o.length)}function Cm(f){const o=qf(f),c=f.slice(pa(o));if(c.length!==o)throw new Error("inconsistent lengths");return"u"+Kn(c,"base64url")}function Im(f){const o=qf(f),c=f.slice(pa(o));if(c.length!==o)throw new Error("inconsistent lengths");return Kn(c,"base58btc")}function bm(f){const o=f.split(":");if(o.length!==2)throw new Error(`failed to parse onion addr: ["'${o.join('", "')}'"]' does not contain a port number`);if(o[0].length!==16)throw new Error(`failed to parse onion addr: ${o[0]} not a Tor onion address.`);const c=l2.decode("b"+o[0]),h=parseInt(o[1],10);if(h<1||h>65536)throw new Error("Port number is not in range(1, 65536)");const b=lg(h);return Li([c,b],c.length+b.length)}function vm(f){const o=f.split(":");if(o.length!==2)throw new Error(`failed to parse onion addr: ["'${o.join('", "')}'"]' does not contain a port number`);if(o[0].length!==56)throw new Error(`failed to parse onion addr: ${o[0]} not a Tor onion3 address.`);const c=l2.decode(`b${o[0]}`),h=parseInt(o[1],10);if(h<1||h>65536)throw new Error("Port number is not in range(1, 65536)");const b=lg(h);return Li([c,b],c.length+b.length)}function Mp(f){const o=f.slice(0,f.length-2),c=f.slice(f.length-2),h=Kn(o,"base32"),b=Wy(c);return`${h}:${b}`}function xm(f){f=od(f);const o=[],c=[];let h=null;const b=f.split("/").slice(1);if(b.length===1&&b[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let I=0;I<b.length;I++){const y=b[I],S=hn(y);if(S.size===0){o.push([S.code]),c.push([S.code]);continue}if(I++,I>=b.length)throw new eC("invalid address: "+f);if(S.path===!0){h=od(b.slice(I).join("/")),o.push([S.code,Dp(S.code,h)]),c.push([S.code,h]);break}const k=Dp(S.code,b[I]);o.push([S.code,k]),c.push([S.code,Xy(S.code,k)])}return{string:Zy(c),bytes:$y(o),tuples:o,stringTuples:c,path:h}}function Np(f){const o=[],c=[];let h=null,b=0;for(;b<f.length;){const I=qf(f,b),y=pa(I),S=hn(I),k=Em(S,f.slice(b+y));if(k===0){o.push([I]),c.push([I]),b+=y;continue}const N=f.slice(b+y,b+y+k);if(b+=k+y,b>f.length)throw new eC("Invalid address Uint8Array: "+Kn(f,"base16"));o.push([I,N]);const R=Xy(I,N);if(c.push([I,R]),S.path===!0){h=R;break}}return{bytes:Uint8Array.from(f),string:Zy(c),tuples:o,stringTuples:c,path:h}}function Zy(f){const o=[];return f.map(c=>{const h=hn(c[0]);return o.push(h.name),c.length>1&&c[1]!=null&&o.push(c[1]),null}),od(o.join("/"))}function $y(f){return Li(f.map(o=>{const c=hn(o[0]);let h=Uint8Array.from(j1(c.code));return o.length>1&&o[1]!=null&&(h=Li([h,o[1]])),h}))}function Em(f,o){if(f.size>0)return f.size/8;if(f.size===0)return 0;{const c=qf(o instanceof Uint8Array?o:Uint8Array.from(o));return c+pa(c)}}function od(f){return"/"+f.trim().split("/").filter(o=>o).join("/")}class eC extends Error{static name="ParseError";name="ParseError";constructor(o){super(`Error parsing address: ${o}`)}}const _m=Symbol.for("nodejs.util.inspect.custom"),tC=Symbol.for("@multiformats/js-multiaddr/multiaddr"),Bm=[hn("dns").code,hn("dns4").code,hn("dns6").code,hn("dnsaddr").code];class wm extends Error{constructor(o="No available resolver"){super(o),this.name="NoAvailableResolverError"}}class os{bytes;#t;#e;#r;#n;[tC]=!0;constructor(o){o==null&&(o="");let c;if(o instanceof Uint8Array)c=Np(o);else if(typeof o=="string"){if(o.length>0&&o.charAt(0)!=="/")throw new Error(`multiaddr "${o}" must start with a "/"`);c=xm(o)}else if(Qm(o))c=Np(o.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=c.bytes,this.#t=c.string,this.#e=c.tuples,this.#r=c.stringTuples,this.#n=c.path}toString(){return this.#t}toJSON(){return this.toString()}toOptions(){let o,c,h,b,I="";const y=hn("tcp"),S=hn("udp"),k=hn("ip4"),N=hn("ip6"),R=hn("dns6"),B=hn("ip6zone");for(const[Ee,pe]of this.stringTuples())Ee===B.code&&(I=`%${pe??""}`),Bm.includes(Ee)&&(c=y.name==="tcp"?"tcp":"udp",b=443,h=`${pe??""}${I}`,o=Ee===R.code?6:4),(Ee===y.code||Ee===S.code)&&(c=hn(Ee).name==="tcp"?"tcp":"udp",b=parseInt(pe??"")),(Ee===k.code||Ee===N.code)&&(c=hn(Ee).name==="tcp"?"tcp":"udp",h=`${pe??""}${I}`,o=Ee===N.code?6:4);if(o==null||c==null||h==null||b==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:o,host:h,transport:c,port:b}}protos(){return this.#e.map(([o])=>Object.assign({},hn(o)))}protoCodes(){return this.#e.map(([o])=>o)}protoNames(){return this.#e.map(([o])=>hn(o).name)}tuples(){return this.#e.map(([o,c])=>c==null?[o]:[o,c])}stringTuples(){return this.#r.map(([o,c])=>c==null?[o]:[o,c])}encapsulate(o){return o=new os(o),new os(this.toString()+o.toString())}decapsulate(o){const c=o.toString(),h=this.toString(),b=h.lastIndexOf(c);if(b<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${o.toString()}`);return new os(h.slice(0,b))}decapsulateCode(o){const c=this.tuples();for(let h=c.length-1;h>=0;h--)if(c[h][0]===o)return new os($y(c.slice(0,h)));return this}getPeerId(){try{let o=[];this.stringTuples().forEach(([h,b])=>{h===Df.p2p.code&&o.push([h,b]),h===Df["p2p-circuit"].code&&(o=[])});const c=o.pop();if(c?.[1]!=null){const h=c[1];return h[0]==="Q"||h[0]==="1"?Kn(dA.decode(`z${h}`),"base58btc"):Kn(un.parse(h).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return this.#n}equals(o){return yA(this.bytes,o.bytes)}async resolve(o){const c=this.protos().find(I=>I.resolvable);if(c==null)return[this];const h=mm.get(c.name);if(h==null)throw new wm(`no available resolver for ${c.name}`);return(await h(this,o)).map(I=>rC(I))}nodeAddress(){const o=this.toOptions();if(o.transport!=="tcp"&&o.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${o.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:o.family,address:o.host,port:o.port}}isThinWaistAddress(o){const c=(o??this).protos();return!(c.length!==2||c[0].code!==4&&c[0].code!==41||c[1].code!==6&&c[1].code!==273)}[_m](){return`Multiaddr(${this.#t})`}}const mm=new Map;function Qm(f){return!!f?.[tC]}function rC(f){return new os(f)}const Sm="X-Peerbit-Signature",Dm="X-Peerbit-Signature-Time",km=async(f,o,c,h,b)=>{const I=Math.round(new Date().getTime()/1e3).toString(),y=new mr;if(!o)throw new Error("Expecting method");if(!c)throw new Error("Expecting path");y.string(o.toLowerCase()+c.toLowerCase()+I+(h||""));const S=await b.sign(y.finalize());f[Dm]=I,f[Sm]=P3(vs(S))},Mm=async(f,o={address:"http://localhost:"+id})=>{let c=o.address;!c.startsWith("http://")&&!c.startsWith("https://")&&(c.endsWith("localhost:")||c.endsWith("localhost")?c="http://"+c:c="https://"+c);const h=c.startsWith("http://localhost");new URL(c).port===""&&!c.endsWith(":80")&&(h?c=c+":"+id:c=c+":"+zy);const{default:b}=await Qp(async()=>{const{default:B}=await import("./index-BLePxC6A.js");return{default:B}},[]),I=b.create();I.interceptors.request.use(async B=>{const oe=new URL(B.url);return await km(B.headers,B.method,oe.pathname+oe.search,B.data,f),B});const y=B=>B>=200&&B<300||B===404,S=B=>{if(B.status!==200)throw new Error(B.data);return B},k=async()=>S(await I.get(c+zw,{validateStatus:y,timeout:5e3})).data,N=async B=>S(await I.delete(c+zc+"/"+encodeURIComponent(B.toString()),{validateStatus:y})),R=async B=>S(await I.delete(c+zc+"/"+encodeURIComponent(B.toString())+"?delete=true",{validateStatus:y}));return{peer:{id:{get:k},addresses:{get:async()=>S(await I.get(c+qw,{validateStatus:y})).data.map(B=>rC(B))}},access:{allow:async B=>{const oe=await I.put(c+wp+"/"+encodeURIComponent(typeof B=="string"?B:B instanceof xs?B.hashcode():Bp(B).hashcode()),void 0,{validateStatus:y});if(oe.status!==200&&oe.status!==404)throw new Error(oe.data);return oe.status===200},deny:async B=>{const oe=await I.delete(c+wp+"/"+encodeURIComponent(B instanceof xs?B.hashcode():Bp(B).hashcode()),{validateStatus:y});if(oe.status!==200&&oe.status!==404)throw new Error(oe.data);return oe.status===200}},program:{has:async B=>{const oe=await I.head(c+zc+"/"+encodeURIComponent(B.toString()),{validateStatus:y});if(oe.status!==200&&oe.status!==404)throw new Error(oe.data);return oe.status===200},open:async B=>S(await I.put(c+zc,JSON.stringify(B),{validateStatus:y})).data,close:async B=>{await N(B)},closeAll:async()=>{const B=S(await I.get(c+vh,{validateStatus:y}));await Promise.all(B.data.map(oe=>N(oe)))},drop:async B=>{await R(B)},dropAll:async()=>{const B=S(await I.get(c+vh,{validateStatus:y}));await Promise.all(B.data.map(oe=>R(oe)))},list:async()=>S(await I.get(c+vh,{validateStatus:y})).data,variants:async()=>S(await I.get(c+jw,{validateStatus:y})).data},dependency:{install:async B=>{const oe=await I.put(c+Vw,JSON.stringify(B),{validateStatus:y});if(oe.status!==200)throw new Error(typeof oe.data=="string"?oe.data:oe.data.toString());return oe.data},versions:async()=>S(await I.get(c+em,{validateStatus:y})).data},network:{bootstrap:async()=>{S(await I.post(c+Xw,void 0,{validateStatus:y}))}},restart:async()=>{S(await I.post(c+Ww,void 0,{validateStatus:y}))},stop:async()=>{S(await I.post(c+Zw,void 0,{validateStatus:y}))},log:{fetch:async B=>{const oe=c+$w+(B!==void 0?`?n=${B}`:"");return S(await I.get(oe,{validateStatus:y})).data}},terminate:async()=>{const{terminateNode:B}=await Qp(async()=>{const{terminateNode:oe}=await Promise.resolve().then(()=>Pm);return{terminateNode:oe}},void 0);o.origin?.type==="aws"&&await B({instanceId:o.origin.instanceId,region:o.origin.region})}}};let sd=_d({palette:{mode:"dark"},typography:{fontFamily:["-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'].join(",")}});sd=Zb(sd);const Nm=()=>{const[f,o]=sr.useState(),[c,h]=sr.useState(),[b,I]=sr.useState(),[y,S]=sr.useState(),[k,N]=sr.useState([]);return sr.useEffect(()=>{Sf.create().then(R=>Mm(R,{address:window.location.protocol+"//"+window.location.hostname+":"+Ow(window.location.protocol)}).then(B=>{o(B),B.peer.id.get().then(oe=>{h(oe)}).catch(oe=>{window.location.hostname!=="localhost"?alert(oe):console.error(oe)}),B.peer.addresses.get().then(oe=>{const Ee=oe.find(Ie=>Ie.protoNames().includes("tcp")&&!Ie.protoNames().includes("ws")&&!Ie.protoNames().includes("wss"));Ee&&I(Ee.toString());const pe=oe.find(Ie=>Ie.protoNames().includes("ws")||Ie.protoNames().includes("wss"));pe&&S(pe.toString());let V=oe.filter(Ie=>(!Ee||!Ie.equals(Ee))&&(!pe||!Ie.equals(pe)));N(V.map(Ie=>Ie.toString()))}).catch(oe=>{window.location.hostname!=="localhost"?alert(oe):console.error(oe)})}))},[]),nr.jsxs(dv,{theme:sd,children:[nr.jsx(Mv,{}),nr.jsx(Qv,{children:nr.jsx(ia,{container:!0,sx:{p:4,height:"100vh"},children:nr.jsxs(ia,{item:!0,container:!0,direction:"column",spacing:2,maxWidth:"400px",children:[nr.jsxs(ia,{item:!0,container:!0,direction:"row",alignItems:"center",mb:2,children:[nr.jsx(ia,{mr:2,display:"flex",justifyContent:"center",item:!0,children:nr.jsx("img",{width:"60px",height:"auto",src:"./android-chrome-192x192.png"})}),nr.jsx(ia,{item:!0,children:nr.jsx(Aa,{variant:"h5",children:"Peerbit"})})]}),nr.jsxs(ia,{item:!0,children:[nr.jsx(Aa,{variant:"overline",children:"Id"}),nr.jsx(Aa,{children:c})]}),nr.jsx(ia,{item:!0,children:nr.jsx(Aa,{variant:"overline",children:"Address"})}),b&&nr.jsxs(ia,{item:!0,children:[nr.jsx(Aa,{variant:"caption",children:" TCP (non-browser)"}),nr.jsx(gl,{elevation:10,children:nr.jsx(Aa,{m:2,sx:{verticalAlign:"middle"},variant:"caption",children:b})})]}),y&&nr.jsxs(ia,{item:!0,children:[nr.jsxs(Aa,{variant:"caption",children:[" ","Websockets (browser and non-browser)"," "]}),nr.jsx(gl,{elevation:10,children:nr.jsx(Aa,{m:2,sx:{verticalAlign:"middle"},variant:"caption",children:y})})]}),k.length>0&&nr.jsxs(ia,{item:!0,children:[nr.jsx(Aa,{variant:"caption",children:" Other addresses"}),k.map(R=>nr.jsx(gl,{elevation:10,children:nr.jsx(Aa,{m:2,sx:{verticalAlign:"middle"},variant:"caption",children:R})}))]})]})})})]})},Fm=qC.createRoot(document.getElementById("root"));Fm.render(nr.jsx(Fp.StrictMode,{children:nr.jsx(Nm,{})}));const Pm=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));
66
+ `)}static register(o,c){c||(c=o.locale)}}const qB="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo";let gf=null;function Z8(f){if(gf==null&&(gf=qB.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),Xf.check(f)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw gf=null,new Error("BIP39 Wordlist for en (English) FAILED")}class jB extends Xf{constructor(){super("en")}getWord(o){return Z8(this),gf[o]}getWordIndex(o){return Z8(this),gf.indexOf(o)}}const My=new jB;Xf.register(My);const $8={en:My},VB="hdnode/5.8.0",w1=new zt(VB),XB=Zr.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),WB=Yi("Bitcoin seed"),Tc=2147483648;function Ny(f){return(1<<f)-1<<8-f}function ZB(f){return(1<<f)-1}function Jc(f){return yi(or(f),32)}function ep(f){return _y.encode(No([f,_f(mf(mf(f)),0,4)]))}function og(f){if(f==null)return $8.en;if(typeof f=="string"){const o=$8[f];return o==null&&w1.throwArgumentError("unknown locale","wordlist",f),o}return f}const ns={},Qf="m/44'/60'/0'/0/0";class gi{constructor(o,c,h,b,I,y,S,k){if(o!==ns)throw new Error("HDNode constructor cannot be called directly");if(c){const N=new ps(c);lr(this,"privateKey",N.privateKey),lr(this,"publicKey",N.compressedPublicKey)}else lr(this,"privateKey",null),lr(this,"publicKey",or(h));lr(this,"parentFingerprint",b),lr(this,"fingerprint",_f(wB(mf(this.publicKey)),0,4)),lr(this,"address",ys(this.publicKey)),lr(this,"chainCode",I),lr(this,"index",y),lr(this,"depth",S),k==null?(lr(this,"mnemonic",null),lr(this,"path",null)):typeof k=="string"?(lr(this,"mnemonic",null),lr(this,"path",k)):(lr(this,"mnemonic",k),lr(this,"path",k.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return ep(No([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",or(this.depth),this.parentFingerprint,yi(or(this.index),4),this.chainCode,this.privateKey!=null?No(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new gi(ns,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(o){if(o>4294967295)throw new Error("invalid index - "+String(o));let c=this.path;c&&(c+="/"+(o&2147483647));const h=new Uint8Array(37);if(o&Tc){if(!this.privateKey)throw new Error("cannot derive child of neutered node");h.set(Nt(this.privateKey),1),c&&(c+="'")}else h.set(Nt(this.publicKey));for(let B=24;B>=0;B-=8)h[33+(B>>3)]=o>>24-B&255;const b=Nt(E1(wf.sha512,this.chainCode,h)),I=b.slice(0,32),y=b.slice(32);let S=null,k=null;this.privateKey?S=Jc(Zr.from(I).add(this.privateKey).mod(XB)):k=new ps(or(I))._addPoint(this.publicKey);let N=c;const R=this.mnemonic;return R&&(N=Object.freeze({phrase:R.phrase,path:c,locale:R.locale||"en"})),new gi(ns,S,k,this.fingerprint,Jc(y),o,this.depth+1,N)}derivePath(o){const c=o.split("/");if(c.length===0||c[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+o);c[0]==="m"&&c.shift();let h=this;for(let b=0;b<c.length;b++){const I=c[b];if(I.match(/^[0-9]+'$/)){const y=parseInt(I.substring(0,I.length-1));if(y>=Tc)throw new Error("invalid path index - "+I);h=h._derive(Tc+y)}else if(I.match(/^[0-9]+$/)){const y=parseInt(I);if(y>=Tc)throw new Error("invalid path index - "+I);h=h._derive(y)}else throw new Error("invalid path component - "+I)}return h}static _fromSeed(o,c){const h=Nt(o);if(h.length<16||h.length>64)throw new Error("invalid seed");const b=Nt(E1(wf.sha512,WB,h));return new gi(ns,Jc(b.slice(0,32)),null,"0x00000000",Jc(b.slice(32)),0,0,c)}static fromMnemonic(o,c,h){return h=og(h),o=sg(Fy(o,h),h),gi._fromSeed($B(o,c),{phrase:o,path:"m",locale:h.locale})}static fromSeed(o){return gi._fromSeed(o,null)}static fromExtendedKey(o){const c=_y.decode(o);(c.length!==82||ep(c.slice(0,78))!==o)&&w1.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const h=c[4],b=or(c.slice(5,9)),I=parseInt(or(c.slice(9,13)).substring(2),16),y=or(c.slice(13,45)),S=c.slice(45,78);switch(or(c.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new gi(ns,null,or(S),b,y,I,h,null);case"0x0488ade4":case"0x04358394 ":if(S[0]!==0)break;return new gi(ns,or(S.slice(1)),null,b,y,I,h,null)}return w1.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function $B(f,o){o||(o="");const c=Yi("mnemonic"+o,y2.NFKD);return ng(Yi(f,y2.NFKD),c,2048,64,"sha512")}function Fy(f,o){o=og(o),w1.checkNormalize();const c=o.split(f);if(c.length%3!==0)throw new Error("invalid mnemonic");const h=Nt(new Uint8Array(Math.ceil(11*c.length/8)));let b=0;for(let N=0;N<c.length;N++){let R=o.getWordIndex(c[N].normalize("NFKD"));if(R===-1)throw new Error("invalid mnemonic");for(let B=0;B<11;B++)R&1<<10-B&&(h[b>>3]|=1<<7-b%8),b++}const I=32*c.length/3,y=c.length/3,S=Ny(y);if((Nt(mf(h.slice(0,I/8)))[0]&S)!==(h[h.length-1]&S))throw new Error("invalid checksum");return or(h.slice(0,I/8))}function sg(f,o){if(o=og(o),f=Nt(f),f.length%4!==0||f.length<16||f.length>32)throw new Error("invalid entropy");const c=[0];let h=11;for(let y=0;y<f.length;y++)h>8?(c[c.length-1]<<=8,c[c.length-1]|=f[y],h-=8):(c[c.length-1]<<=h,c[c.length-1]|=f[y]>>8-h,c.push(f[y]&ZB(8-h)),h+=3);const b=f.length/4,I=Nt(mf(f))[0]&Ny(b);return c[c.length-1]<<=b,c[c.length-1]|=I>>8-b,o.join(c.map(y=>o.getWord(y)))}const ew="random/5.8.0",td=new zt(ew);function tw(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const tp=tw();let t1=tp.crypto||tp.msCrypto;(!t1||!t1.getRandomValues)&&(td.warn("WARNING: Missing strong random number source"),t1={getRandomValues:function(f){return td.throwError("no secure random source avaialble",zt.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function ff(f){(f<=0||f>1024||f%1||f!=f)&&td.throwArgumentError("invalid length","length",f);const o=new Uint8Array(f);return t1.getRandomValues(o),Nt(o)}var th={exports:{}},rp;function rw(){return rp||(rp=1,function(f,o){(function(c){function h(G){return parseInt(G)===G}function b(G){if(!h(G.length))return!1;for(var T=0;T<G.length;T++)if(!h(G[T])||G[T]<0||G[T]>255)return!1;return!0}function I(G,T){if(G.buffer&&ArrayBuffer.isView(G)&&G.name==="Uint8Array")return T&&(G.slice?G=G.slice():G=Array.prototype.slice.call(G)),G;if(Array.isArray(G)){if(!b(G))throw new Error("Array contains invalid value: "+G);return new Uint8Array(G)}if(h(G.length)&&b(G))return new Uint8Array(G);throw new Error("unsupported array-like object")}function y(G){return new Uint8Array(G)}function S(G,T,Be,Te,se){(Te!=null||se!=null)&&(G.slice?G=G.slice(Te,se):G=Array.prototype.slice.call(G,Te,se)),T.set(G,Be)}var k=function(){function G(Be){var Te=[],se=0;for(Be=encodeURI(Be);se<Be.length;){var ze=Be.charCodeAt(se++);ze===37?(Te.push(parseInt(Be.substr(se,2),16)),se+=2):Te.push(ze)}return I(Te)}function T(Be){for(var Te=[],se=0;se<Be.length;){var ze=Be[se];ze<128?(Te.push(String.fromCharCode(ze)),se++):ze>191&&ze<224?(Te.push(String.fromCharCode((ze&31)<<6|Be[se+1]&63)),se+=2):(Te.push(String.fromCharCode((ze&15)<<12|(Be[se+1]&63)<<6|Be[se+2]&63)),se+=3)}return Te.join("")}return{toBytes:G,fromBytes:T}}(),N=function(){function G(Te){for(var se=[],ze=0;ze<Te.length;ze+=2)se.push(parseInt(Te.substr(ze,2),16));return se}var T="0123456789abcdef";function Be(Te){for(var se=[],ze=0;ze<Te.length;ze++){var s0=Te[ze];se.push(T[(s0&240)>>4]+T[s0&15])}return se.join("")}return{toBytes:G,fromBytes:Be}}(),R={16:10,24:12,32:14},B=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],oe=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],Ee=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],pe=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],V=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],Ie=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],Ce=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],_e=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],te=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],r0=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],ve=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],Ne=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],ye=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],Xe=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],he=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function v0(G){for(var T=[],Be=0;Be<G.length;Be+=4)T.push(G[Be]<<24|G[Be+1]<<16|G[Be+2]<<8|G[Be+3]);return T}var He=function(G){if(!(this instanceof He))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:I(G,!0)}),this._prepare()};He.prototype._prepare=function(){var G=R[this.key.length];if(G==null)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var T=0;T<=G;T++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(var Be=(G+1)*4,Te=this.key.length/4,se=v0(this.key),ze,T=0;T<Te;T++)ze=T>>2,this._Ke[ze][T%4]=se[T],this._Kd[G-ze][T%4]=se[T];for(var s0=0,l0=Te,p0;l0<Be;){if(p0=se[Te-1],se[0]^=oe[p0>>16&255]<<24^oe[p0>>8&255]<<16^oe[p0&255]<<8^oe[p0>>24&255]^B[s0]<<24,s0+=1,Te!=8)for(var T=1;T<Te;T++)se[T]^=se[T-1];else{for(var T=1;T<Te/2;T++)se[T]^=se[T-1];p0=se[Te/2-1],se[Te/2]^=oe[p0&255]^oe[p0>>8&255]<<8^oe[p0>>16&255]<<16^oe[p0>>24&255]<<24;for(var T=Te/2+1;T<Te;T++)se[T]^=se[T-1]}for(var T=0,G0,X0;T<Te&&l0<Be;)G0=l0>>2,X0=l0%4,this._Ke[G0][X0]=se[T],this._Kd[G-G0][X0]=se[T++],l0++}for(var G0=1;G0<G;G0++)for(var X0=0;X0<4;X0++)p0=this._Kd[G0][X0],this._Kd[G0][X0]=Ne[p0>>24&255]^ye[p0>>16&255]^Xe[p0>>8&255]^he[p0&255]},He.prototype.encrypt=function(G){if(G.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");for(var T=this._Ke.length-1,Be=[0,0,0,0],Te=v0(G),se=0;se<4;se++)Te[se]^=this._Ke[0][se];for(var ze=1;ze<T;ze++){for(var se=0;se<4;se++)Be[se]=pe[Te[se]>>24&255]^V[Te[(se+1)%4]>>16&255]^Ie[Te[(se+2)%4]>>8&255]^Ce[Te[(se+3)%4]&255]^this._Ke[ze][se];Te=Be.slice()}for(var s0=y(16),l0,se=0;se<4;se++)l0=this._Ke[T][se],s0[4*se]=(oe[Te[se]>>24&255]^l0>>24)&255,s0[4*se+1]=(oe[Te[(se+1)%4]>>16&255]^l0>>16)&255,s0[4*se+2]=(oe[Te[(se+2)%4]>>8&255]^l0>>8)&255,s0[4*se+3]=(oe[Te[(se+3)%4]&255]^l0)&255;return s0},He.prototype.decrypt=function(G){if(G.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var T=this._Kd.length-1,Be=[0,0,0,0],Te=v0(G),se=0;se<4;se++)Te[se]^=this._Kd[0][se];for(var ze=1;ze<T;ze++){for(var se=0;se<4;se++)Be[se]=_e[Te[se]>>24&255]^te[Te[(se+3)%4]>>16&255]^r0[Te[(se+2)%4]>>8&255]^ve[Te[(se+1)%4]&255]^this._Kd[ze][se];Te=Be.slice()}for(var s0=y(16),l0,se=0;se<4;se++)l0=this._Kd[T][se],s0[4*se]=(Ee[Te[se]>>24&255]^l0>>24)&255,s0[4*se+1]=(Ee[Te[(se+3)%4]>>16&255]^l0>>16)&255,s0[4*se+2]=(Ee[Te[(se+2)%4]>>8&255]^l0>>8)&255,s0[4*se+3]=(Ee[Te[(se+1)%4]&255]^l0)&255;return s0};var q=function(G){if(!(this instanceof q))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new He(G)};q.prototype.encrypt=function(G){if(G=I(G),G.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var T=y(G.length),Be=y(16),Te=0;Te<G.length;Te+=16)S(G,Be,0,Te,Te+16),Be=this._aes.encrypt(Be),S(Be,T,Te);return T},q.prototype.decrypt=function(G){if(G=I(G),G.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var T=y(G.length),Be=y(16),Te=0;Te<G.length;Te+=16)S(G,Be,0,Te,Te+16),Be=this._aes.decrypt(Be),S(Be,T,Te);return T};var J=function(G,T){if(!(this instanceof J))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",!T)T=y(16);else if(T.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastCipherblock=I(T,!0),this._aes=new He(G)};J.prototype.encrypt=function(G){if(G=I(G),G.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var T=y(G.length),Be=y(16),Te=0;Te<G.length;Te+=16){S(G,Be,0,Te,Te+16);for(var se=0;se<16;se++)Be[se]^=this._lastCipherblock[se];this._lastCipherblock=this._aes.encrypt(Be),S(this._lastCipherblock,T,Te)}return T},J.prototype.decrypt=function(G){if(G=I(G),G.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var T=y(G.length),Be=y(16),Te=0;Te<G.length;Te+=16){S(G,Be,0,Te,Te+16),Be=this._aes.decrypt(Be);for(var se=0;se<16;se++)T[Te+se]=Be[se]^this._lastCipherblock[se];S(G,this._lastCipherblock,0,Te,Te+16)}return T};var Q=function(G,T,Be){if(!(this instanceof Q))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",!T)T=y(16);else if(T.length!=16)throw new Error("invalid initialation vector size (must be 16 size)");Be||(Be=1),this.segmentSize=Be,this._shiftRegister=I(T,!0),this._aes=new He(G)};Q.prototype.encrypt=function(G){if(G.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var T=I(G,!0),Be,Te=0;Te<T.length;Te+=this.segmentSize){Be=this._aes.encrypt(this._shiftRegister);for(var se=0;se<this.segmentSize;se++)T[Te+se]^=Be[se];S(this._shiftRegister,this._shiftRegister,0,this.segmentSize),S(T,this._shiftRegister,16-this.segmentSize,Te,Te+this.segmentSize)}return T},Q.prototype.decrypt=function(G){if(G.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var T=I(G,!0),Be,Te=0;Te<T.length;Te+=this.segmentSize){Be=this._aes.encrypt(this._shiftRegister);for(var se=0;se<this.segmentSize;se++)T[Te+se]^=Be[se];S(this._shiftRegister,this._shiftRegister,0,this.segmentSize),S(G,this._shiftRegister,16-this.segmentSize,Te,Te+this.segmentSize)}return T};var L=function(G,T){if(!(this instanceof L))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",!T)T=y(16);else if(T.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastPrecipher=I(T,!0),this._lastPrecipherIndex=16,this._aes=new He(G)};L.prototype.encrypt=function(G){for(var T=I(G,!0),Be=0;Be<T.length;Be++)this._lastPrecipherIndex===16&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),T[Be]^=this._lastPrecipher[this._lastPrecipherIndex++];return T},L.prototype.decrypt=L.prototype.encrypt;var W=function(G){if(!(this instanceof W))throw Error("Counter must be instanitated with `new`");G!==0&&!G&&(G=1),typeof G=="number"?(this._counter=y(16),this.setValue(G)):this.setBytes(G)};W.prototype.setValue=function(G){if(typeof G!="number"||parseInt(G)!=G)throw new Error("invalid counter value (must be an integer)");for(var T=15;T>=0;--T)this._counter[T]=G%256,G=G>>8},W.prototype.setBytes=function(G){if(G=I(G,!0),G.length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=G},W.prototype.increment=function(){for(var G=15;G>=0;G--)if(this._counter[G]===255)this._counter[G]=0;else{this._counter[G]++;break}};var Ae=function(G,T){if(!(this instanceof Ae))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",T instanceof W||(T=new W(T)),this._counter=T,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new He(G)};Ae.prototype.encrypt=function(G){for(var T=I(G,!0),Be=0;Be<T.length;Be++)this._remainingCounterIndex===16&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),T[Be]^=this._remainingCounter[this._remainingCounterIndex++];return T},Ae.prototype.decrypt=Ae.prototype.encrypt;function ie(G){G=I(G,!0);var T=16-G.length%16,Be=y(G.length+T);S(G,Be);for(var Te=G.length;Te<Be.length;Te++)Be[Te]=T;return Be}function fe(G){if(G=I(G,!0),G.length<16)throw new Error("PKCS#7 invalid length");var T=G[G.length-1];if(T>16)throw new Error("PKCS#7 padding byte out of range");for(var Be=G.length-T,Te=0;Te<T;Te++)if(G[Be+Te]!==T)throw new Error("PKCS#7 invalid padding byte");var se=y(Be);return S(G,se,0,0,Be),se}var z={AES:He,Counter:W,ModeOfOperation:{ecb:q,cbc:J,cfb:Q,ofb:L,ctr:Ae},utils:{hex:N,utf8:k},padding:{pkcs7:{pad:ie,strip:fe}},_arrayTest:{coerceArray:I,createArray:y,copyArray:S}};f.exports=z})()}(th)),th.exports}var nw=rw();const ua=Ji(nw),Py="json-wallets/5.8.0";function g2(f){return typeof f=="string"&&f.substring(0,2)!=="0x"&&(f="0x"+f),Nt(f)}function Af(f,o){for(f=String(f);f.length<o;)f="0"+f;return f}function fg(f){return typeof f=="string"?Yi(f,y2.NFKC):Nt(f)}function Bn(f,o){let c=f;const h=o.toLowerCase().split("/");for(let b=0;b<h.length;b++){let I=null;for(const y in c)if(y.toLowerCase()===h[b]){I=c[y];break}if(I===null)return null;c=I}return c}function Aw(f){const o=Nt(f);o[6]=o[6]&15|64,o[8]=o[8]&63|128;const c=or(o);return[c.substring(2,10),c.substring(10,14),c.substring(14,18),c.substring(18,22),c.substring(22,34)].join("-")}const iw=new zt(Py);class aw extends Iy{isCrowdsaleAccount(o){return!!(o&&o._isCrowdsaleAccount)}}function Ky(f,o){const c=JSON.parse(f);o=fg(o);const h=Ti(Bn(c,"ethaddr")),b=g2(Bn(c,"encseed"));(!b||b.length%16!==0)&&iw.throwArgumentError("invalid encseed","json",f);const I=Nt(ng(o,o,2e3,32,"sha256")).slice(0,16),y=b.slice(0,16),S=b.slice(16),k=new ua.ModeOfOperation.cbc(I,y),N=ua.padding.pkcs7.strip(Nt(k.decrypt(S)));let R="";for(let Ee=0;Ee<N.length;Ee++)R+=String.fromCharCode(N[Ee]);const B=Yi(R),oe=mA(B);return new aw({_isCrowdsaleAccount:!0,address:h,privateKey:oe})}function Uy(f){let o=null;try{o=JSON.parse(f)}catch{return!1}return o.encseed&&o.ethaddr}function Hy(f){let o=null;try{o=JSON.parse(f)}catch{return!1}return!(!o.version||parseInt(o.version)!==o.version||parseInt(o.version)!==3)}var rh={exports:{}},np;function ow(){return np||(np=1,function(f,o){(function(c){function b(V){const Ie=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]);let Ce=1779033703,_e=3144134277,te=1013904242,r0=2773480762,ve=1359893119,Ne=2600822924,ye=528734635,Xe=1541459225;const he=new Uint32Array(64);function v0(Ae){let ie=0,fe=Ae.length;for(;fe>=64;){let z=Ce,G=_e,T=te,Be=r0,Te=ve,se=Ne,ze=ye,s0=Xe,l0,p0,G0,X0,Y0;for(p0=0;p0<16;p0++)G0=ie+p0*4,he[p0]=(Ae[G0]&255)<<24|(Ae[G0+1]&255)<<16|(Ae[G0+2]&255)<<8|Ae[G0+3]&255;for(p0=16;p0<64;p0++)l0=he[p0-2],X0=(l0>>>17|l0<<15)^(l0>>>19|l0<<13)^l0>>>10,l0=he[p0-15],Y0=(l0>>>7|l0<<25)^(l0>>>18|l0<<14)^l0>>>3,he[p0]=(X0+he[p0-7]|0)+(Y0+he[p0-16]|0)|0;for(p0=0;p0<64;p0++)X0=(((Te>>>6|Te<<26)^(Te>>>11|Te<<21)^(Te>>>25|Te<<7))+(Te&se^~Te&ze)|0)+(s0+(Ie[p0]+he[p0]|0)|0)|0,Y0=((z>>>2|z<<30)^(z>>>13|z<<19)^(z>>>22|z<<10))+(z&G^z&T^G&T)|0,s0=ze,ze=se,se=Te,Te=Be+X0|0,Be=T,T=G,G=z,z=X0+Y0|0;Ce=Ce+z|0,_e=_e+G|0,te=te+T|0,r0=r0+Be|0,ve=ve+Te|0,Ne=Ne+se|0,ye=ye+ze|0,Xe=Xe+s0|0,ie+=64,fe-=64}}v0(V);let He,q=V.length%64,J=V.length/536870912|0,Q=V.length<<3,L=q<56?56:120,W=V.slice(V.length-q,V.length);for(W.push(128),He=q+1;He<L;He++)W.push(0);return W.push(J>>>24&255),W.push(J>>>16&255),W.push(J>>>8&255),W.push(J>>>0&255),W.push(Q>>>24&255),W.push(Q>>>16&255),W.push(Q>>>8&255),W.push(Q>>>0&255),v0(W),[Ce>>>24&255,Ce>>>16&255,Ce>>>8&255,Ce>>>0&255,_e>>>24&255,_e>>>16&255,_e>>>8&255,_e>>>0&255,te>>>24&255,te>>>16&255,te>>>8&255,te>>>0&255,r0>>>24&255,r0>>>16&255,r0>>>8&255,r0>>>0&255,ve>>>24&255,ve>>>16&255,ve>>>8&255,ve>>>0&255,Ne>>>24&255,Ne>>>16&255,Ne>>>8&255,Ne>>>0&255,ye>>>24&255,ye>>>16&255,ye>>>8&255,ye>>>0&255,Xe>>>24&255,Xe>>>16&255,Xe>>>8&255,Xe>>>0&255]}function I(V,Ie,Ce){V=V.length<=64?V:b(V);const _e=64+Ie.length+4,te=new Array(_e),r0=new Array(64);let ve,Ne=[];for(ve=0;ve<64;ve++)te[ve]=54;for(ve=0;ve<V.length;ve++)te[ve]^=V[ve];for(ve=0;ve<Ie.length;ve++)te[64+ve]=Ie[ve];for(ve=_e-4;ve<_e;ve++)te[ve]=0;for(ve=0;ve<64;ve++)r0[ve]=92;for(ve=0;ve<V.length;ve++)r0[ve]^=V[ve];function ye(){for(let Xe=_e-1;Xe>=_e-4;Xe--){if(te[Xe]++,te[Xe]<=255)return;te[Xe]=0}}for(;Ce>=32;)ye(),Ne=Ne.concat(b(r0.concat(b(te)))),Ce-=32;return Ce>0&&(ye(),Ne=Ne.concat(b(r0.concat(b(te))).slice(0,Ce))),Ne}function y(V,Ie,Ce,_e,te){let r0;for(R(V,(2*Ce-1)*16,te,0,16),r0=0;r0<2*Ce;r0++)N(V,r0*16,te,16),k(te,_e),R(te,0,V,Ie+r0*16,16);for(r0=0;r0<Ce;r0++)R(V,Ie+r0*2*16,V,r0*16,16);for(r0=0;r0<Ce;r0++)R(V,Ie+(r0*2+1)*16,V,(r0+Ce)*16,16)}function S(V,Ie){return V<<Ie|V>>>32-Ie}function k(V,Ie){R(V,0,Ie,0,16);for(let Ce=8;Ce>0;Ce-=2)Ie[4]^=S(Ie[0]+Ie[12],7),Ie[8]^=S(Ie[4]+Ie[0],9),Ie[12]^=S(Ie[8]+Ie[4],13),Ie[0]^=S(Ie[12]+Ie[8],18),Ie[9]^=S(Ie[5]+Ie[1],7),Ie[13]^=S(Ie[9]+Ie[5],9),Ie[1]^=S(Ie[13]+Ie[9],13),Ie[5]^=S(Ie[1]+Ie[13],18),Ie[14]^=S(Ie[10]+Ie[6],7),Ie[2]^=S(Ie[14]+Ie[10],9),Ie[6]^=S(Ie[2]+Ie[14],13),Ie[10]^=S(Ie[6]+Ie[2],18),Ie[3]^=S(Ie[15]+Ie[11],7),Ie[7]^=S(Ie[3]+Ie[15],9),Ie[11]^=S(Ie[7]+Ie[3],13),Ie[15]^=S(Ie[11]+Ie[7],18),Ie[1]^=S(Ie[0]+Ie[3],7),Ie[2]^=S(Ie[1]+Ie[0],9),Ie[3]^=S(Ie[2]+Ie[1],13),Ie[0]^=S(Ie[3]+Ie[2],18),Ie[6]^=S(Ie[5]+Ie[4],7),Ie[7]^=S(Ie[6]+Ie[5],9),Ie[4]^=S(Ie[7]+Ie[6],13),Ie[5]^=S(Ie[4]+Ie[7],18),Ie[11]^=S(Ie[10]+Ie[9],7),Ie[8]^=S(Ie[11]+Ie[10],9),Ie[9]^=S(Ie[8]+Ie[11],13),Ie[10]^=S(Ie[9]+Ie[8],18),Ie[12]^=S(Ie[15]+Ie[14],7),Ie[13]^=S(Ie[12]+Ie[15],9),Ie[14]^=S(Ie[13]+Ie[12],13),Ie[15]^=S(Ie[14]+Ie[13],18);for(let Ce=0;Ce<16;++Ce)V[Ce]+=Ie[Ce]}function N(V,Ie,Ce,_e){for(let te=0;te<_e;te++)Ce[te]^=V[Ie+te]}function R(V,Ie,Ce,_e,te){for(;te--;)Ce[_e++]=V[Ie++]}function B(V){if(!V||typeof V.length!="number")return!1;for(let Ie=0;Ie<V.length;Ie++){const Ce=V[Ie];if(typeof Ce!="number"||Ce%1||Ce<0||Ce>=256)return!1}return!0}function oe(V,Ie){if(typeof V!="number"||V%1)throw new Error("invalid "+Ie);return V}function Ee(V,Ie,Ce,_e,te,r0,ve){if(Ce=oe(Ce,"N"),_e=oe(_e,"r"),te=oe(te,"p"),r0=oe(r0,"dkLen"),Ce===0||(Ce&Ce-1)!==0)throw new Error("N must be power of 2");if(Ce>2147483647/128/_e)throw new Error("N too large");if(_e>2147483647/128/te)throw new Error("r too large");if(!B(V))throw new Error("password must be an array or buffer");if(V=Array.prototype.slice.call(V),!B(Ie))throw new Error("salt must be an array or buffer");Ie=Array.prototype.slice.call(Ie);let Ne=I(V,Ie,te*128*_e);const ye=new Uint32Array(te*32*_e);for(let Te=0;Te<ye.length;Te++){const se=Te*4;ye[Te]=(Ne[se+3]&255)<<24|(Ne[se+2]&255)<<16|(Ne[se+1]&255)<<8|(Ne[se+0]&255)<<0}const Xe=new Uint32Array(64*_e),he=new Uint32Array(32*_e*Ce),v0=32*_e,He=new Uint32Array(16),q=new Uint32Array(16),J=te*Ce*2;let Q=0,L=null,W=!1,Ae=0,ie=0,fe,z;const G=ve?parseInt(1e3/_e):4294967295,T=typeof setImmediate<"u"?setImmediate:setTimeout,Be=function(){if(W)return ve(new Error("cancelled"),Q/J);let Te;switch(Ae){case 0:z=ie*32*_e,R(ye,z,Xe,0,v0),Ae=1,fe=0;case 1:Te=Ce-fe,Te>G&&(Te=G);for(let ze=0;ze<Te;ze++)R(Xe,0,he,(fe+ze)*v0,v0),y(Xe,v0,_e,He,q);if(fe+=Te,Q+=Te,ve){const ze=parseInt(1e3*Q/J);if(ze!==L){if(W=ve(null,Q/J),W)break;L=ze}}if(fe<Ce)break;fe=0,Ae=2;case 2:Te=Ce-fe,Te>G&&(Te=G);for(let ze=0;ze<Te;ze++){const s0=(2*_e-1)*16,l0=Xe[s0]&Ce-1;N(he,l0*v0,Xe,v0),y(Xe,v0,_e,He,q)}if(fe+=Te,Q+=Te,ve){const ze=parseInt(1e3*Q/J);if(ze!==L){if(W=ve(null,Q/J),W)break;L=ze}}if(fe<Ce)break;if(R(Xe,0,ye,z,v0),ie++,ie<te){Ae=0;break}Ne=[];for(let ze=0;ze<ye.length;ze++)Ne.push(ye[ze]>>0&255),Ne.push(ye[ze]>>8&255),Ne.push(ye[ze]>>16&255),Ne.push(ye[ze]>>24&255);const se=I(V,Ne,r0);return ve&&ve(null,1,se),se}ve&&T(Be)};if(!ve)for(;;){const Te=Be();if(Te!=null)return Te}Be()}const pe={scrypt:function(V,Ie,Ce,_e,te,r0,ve){return new Promise(function(Ne,ye){let Xe=0;ve&&ve(0),Ee(V,Ie,Ce,_e,te,r0,function(he,v0,He){if(he)ye(he);else if(He)ve&&Xe!==1&&ve(1),Ne(new Uint8Array(He));else if(ve&&v0!==Xe)return Xe=v0,ve(v0)})})},syncScrypt:function(V,Ie,Ce,_e,te,r0){return new Uint8Array(Ee(V,Ie,Ce,_e,te,r0))}};f.exports=pe})()}(rh)),rh.exports}var sw=ow();const cg=Ji(sw);var fw=function(f,o,c,h){function b(I){return I instanceof c?I:new c(function(y){y(I)})}return new(c||(c=Promise))(function(I,y){function S(R){try{N(h.next(R))}catch(B){y(B)}}function k(R){try{N(h.throw(R))}catch(B){y(B)}}function N(R){R.done?I(R.value):b(R.value).then(S,k)}N((h=h.apply(f,o||[])).next())})};const rd=new zt(Py);function Ap(f){return f!=null&&f.mnemonic&&f.mnemonic.phrase}class cw extends Iy{isKeystoreAccount(o){return!!(o&&o._isKeystoreAccount)}}function uw(f,o,c){if(Bn(f,"crypto/cipher")==="aes-128-ctr"){const b=g2(Bn(f,"crypto/cipherparams/iv")),I=new ua.Counter(b),y=new ua.ModeOfOperation.ctr(o,I);return Nt(y.decrypt(c))}return null}function Ry(f,o){const c=g2(Bn(f,"crypto/ciphertext"));if(or(mA(No([o.slice(16,32),c]))).substring(2)!==Bn(f,"crypto/mac").toLowerCase())throw new Error("invalid password");const b=uw(f,o.slice(0,16),c);b||rd.throwError("unsupported cipher",zt.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const I=o.slice(32,64),y=ys(b);if(f.address){let k=f.address.toLowerCase();if(k.substring(0,2)!=="0x"&&(k="0x"+k),Ti(k)!==y)throw new Error("address mismatch")}const S={_isKeystoreAccount:!0,address:y,privateKey:or(b)};if(Bn(f,"x-ethers/version")==="0.1"){const k=g2(Bn(f,"x-ethers/mnemonicCiphertext")),N=g2(Bn(f,"x-ethers/mnemonicCounter")),R=new ua.Counter(N),B=new ua.ModeOfOperation.ctr(I,R),oe=Bn(f,"x-ethers/path")||Qf,Ee=Bn(f,"x-ethers/locale")||"en",pe=Nt(B.decrypt(k));try{const V=sg(pe,Ee),Ie=gi.fromMnemonic(V,null,Ee).derivePath(oe);if(Ie.privateKey!=S.privateKey)throw new Error("mnemonic mismatch");S.mnemonic=Ie.mnemonic}catch(V){if(V.code!==zt.errors.INVALID_ARGUMENT||V.argument!=="wordlist")throw V}}return new cw(S)}function Gy(f,o,c,h,b){return Nt(ng(f,o,c,h,b))}function lw(f,o,c,h,b){return Promise.resolve(Gy(f,o,c,h,b))}function Yy(f,o,c,h,b){const I=fg(o),y=Bn(f,"crypto/kdf");if(y&&typeof y=="string"){const S=function(k,N){return rd.throwArgumentError("invalid key-derivation function parameters",k,N)};if(y.toLowerCase()==="scrypt"){const k=g2(Bn(f,"crypto/kdfparams/salt")),N=parseInt(Bn(f,"crypto/kdfparams/n")),R=parseInt(Bn(f,"crypto/kdfparams/r")),B=parseInt(Bn(f,"crypto/kdfparams/p"));(!N||!R||!B)&&S("kdf",y),(N&N-1)!==0&&S("N",N);const oe=parseInt(Bn(f,"crypto/kdfparams/dklen"));return oe!==32&&S("dklen",oe),h(I,k,N,R,B,64,b)}else if(y.toLowerCase()==="pbkdf2"){const k=g2(Bn(f,"crypto/kdfparams/salt"));let N=null;const R=Bn(f,"crypto/kdfparams/prf");R==="hmac-sha256"?N="sha256":R==="hmac-sha512"?N="sha512":S("prf",R);const B=parseInt(Bn(f,"crypto/kdfparams/c")),oe=parseInt(Bn(f,"crypto/kdfparams/dklen"));return oe!==32&&S("dklen",oe),c(I,k,B,oe,N)}}return rd.throwArgumentError("unsupported key-derivation function","kdf",y)}function hw(f,o){const c=JSON.parse(f),h=Yy(c,o,Gy,cg.syncScrypt);return Ry(c,h)}function dw(f,o,c){return fw(this,void 0,void 0,function*(){const h=JSON.parse(f),b=yield Yy(h,o,lw,cg.scrypt,c);return Ry(h,b)})}function gw(f,o,c,h){try{if(Ti(f.address)!==ys(f.privateKey))throw new Error("address/privateKey mismatch");if(Ap(f)){const Ie=f.mnemonic;if(gi.fromMnemonic(Ie.phrase,null,Ie.locale).derivePath(Ie.path||Qf).privateKey!=f.privateKey)throw new Error("mnemonic mismatch")}}catch(Ie){return Promise.reject(Ie)}typeof c=="function"&&!h&&(h=c,c={}),c||(c={});const b=Nt(f.privateKey),I=fg(o);let y=null,S=null,k=null;if(Ap(f)){const Ie=f.mnemonic;y=Nt(Fy(Ie.phrase,Ie.locale||"en")),S=Ie.path||Qf,k=Ie.locale||"en"}let N=c.client;N||(N="ethers.js");let R=null;c.salt?R=Nt(c.salt):R=ff(32);let B=null;if(c.iv){if(B=Nt(c.iv),B.length!==16)throw new Error("invalid iv")}else B=ff(16);let oe=null;if(c.uuid){if(oe=Nt(c.uuid),oe.length!==16)throw new Error("invalid uuid")}else oe=ff(16);let Ee=1<<17,pe=8,V=1;return c.scrypt&&(c.scrypt.N&&(Ee=c.scrypt.N),c.scrypt.r&&(pe=c.scrypt.r),c.scrypt.p&&(V=c.scrypt.p)),cg.scrypt(I,R,Ee,pe,V,64,h).then(Ie=>{Ie=Nt(Ie);const Ce=Ie.slice(0,16),_e=Ie.slice(16,32),te=Ie.slice(32,64),r0=new ua.Counter(B),ve=new ua.ModeOfOperation.ctr(Ce,r0),Ne=Nt(ve.encrypt(b)),ye=mA(No([_e,Ne])),Xe={address:f.address.substring(2).toLowerCase(),id:Aw(oe),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:or(B).substring(2)},ciphertext:or(Ne).substring(2),kdf:"scrypt",kdfparams:{salt:or(R).substring(2),n:Ee,dklen:32,p:V,r:pe},mac:ye.substring(2)}};if(y){const he=ff(16),v0=new ua.Counter(he),He=new ua.ModeOfOperation.ctr(te,v0),q=Nt(He.encrypt(y)),J=new Date,Q=J.getUTCFullYear()+"-"+Af(J.getUTCMonth()+1,2)+"-"+Af(J.getUTCDate(),2)+"T"+Af(J.getUTCHours(),2)+"-"+Af(J.getUTCMinutes(),2)+"-"+Af(J.getUTCSeconds(),2)+".0Z";Xe["x-ethers"]={client:N,gethFilename:"UTC--"+Q+"--"+Xe.address,mnemonicCounter:or(he).substring(2),mnemonicCiphertext:or(q).substring(2),path:S,locale:k,version:"0.1"}}return JSON.stringify(Xe)})}function pw(f,o,c){if(Uy(f)){c&&c(0);const h=Ky(f,o);return c&&c(1),Promise.resolve(h)}return Hy(f)?dw(f,o,c):Promise.reject(new Error("invalid JSON wallet"))}function yw(f,o){if(Uy(f))return Ky(f,o);if(Hy(f))return hw(f,o);throw new Error("invalid JSON wallet")}const Cw="wallet/5.8.0";var ip=function(f,o,c,h){function b(I){return I instanceof c?I:new c(function(y){y(I)})}return new(c||(c=Promise))(function(I,y){function S(R){try{N(h.next(R))}catch(B){y(B)}}function k(R){try{N(h.throw(R))}catch(B){y(B)}}function N(R){R.done?I(R.value):b(R.value).then(S,k)}N((h=h.apply(f,o||[])).next())})};const As=new zt(Cw);function Iw(f){return f!=null&&QA(f.privateKey,32)&&f.address!=null}function bw(f){const o=f.mnemonic;return o&&o.phrase}class c2 extends tg{constructor(o,c){if(super(),Iw(o)){const h=new ps(o.privateKey);if(lr(this,"_signingKey",()=>h),lr(this,"address",ys(this.publicKey)),this.address!==Ti(o.address)&&As.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),bw(o)){const b=o.mnemonic;lr(this,"_mnemonic",()=>({phrase:b.phrase,path:b.path||Qf,locale:b.locale||"en"}));const I=this.mnemonic,y=gi.fromMnemonic(I.phrase,null,I.locale).derivePath(I.path);ys(y.privateKey)!==this.address&&As.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else lr(this,"_mnemonic",()=>null)}else{if(ps.isSigningKey(o))o.curve!=="secp256k1"&&As.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),lr(this,"_signingKey",()=>o);else{typeof o=="string"&&o.match(/^[0-9a-f]*$/i)&&o.length===64&&(o="0x"+o);const h=new ps(o);lr(this,"_signingKey",()=>h)}lr(this,"_mnemonic",()=>null),lr(this,"address",ys(this.publicKey))}c&&!eg.isProvider(c)&&As.throwArgumentError("invalid provider","provider",c),lr(this,"provider",c||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(o){return new c2(this,o)}signTransaction(o){return as(o).then(c=>{c.from!=null&&(Ti(c.from)!==this.address&&As.throwArgumentError("transaction from address mismatch","transaction.from",o.from),delete c.from);const h=this._signingKey().signDigest(mA(W8(c)));return W8(c,h)})}signMessage(o){return ip(this,void 0,void 0,function*(){return Wh(this._signingKey().signDigest(fB(o)))})}_signTypedData(o,c,h){return ip(this,void 0,void 0,function*(){const b=yield WA.resolveNames(o,c,h,I=>(this.provider==null&&As.throwError("cannot resolve ENS names without a provider",zt.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:I}),this.provider.resolveName(I)));return Wh(this._signingKey().signDigest(WA.hash(b.domain,c,b.value)))})}encrypt(o,c,h){if(typeof c=="function"&&!h&&(h=c,c={}),h&&typeof h!="function")throw new Error("invalid callback");return c||(c={}),gw(this,o,c,h)}static createRandom(o){let c=ff(16);o||(o={}),o.extraEntropy&&(c=Nt(_f(mA(No([c,o.extraEntropy])),0,16)));const h=sg(c,o.locale);return c2.fromMnemonic(h,o.path,o.locale)}static fromEncryptedJson(o,c,h){return pw(o,c,h).then(b=>new c2(b))}static fromEncryptedJsonSync(o,c){return new c2(yw(o,c))}static fromMnemonic(o,c,h){return c||(c=Qf),new c2(gi.fromMnemonic(o,null,h).derivePath(c))}}var nh={};const vw="6.6.1",xw={version:vw};var Ah={},r1={exports:{}},Ew=r1.exports,ap;function Oa(){return ap||(ap=1,function(f){(function(o,c){function h(He,q){if(!He)throw new Error(q||"Assertion failed")}function b(He,q){He.super_=q;var J=function(){};J.prototype=q.prototype,He.prototype=new J,He.prototype.constructor=He}function I(He,q,J){if(I.isBN(He))return He;this.negative=0,this.words=null,this.length=0,this.red=null,He!==null&&((q==="le"||q==="be")&&(J=q,q=10),this._init(He||0,q||10,J||"be"))}typeof o=="object"?o.exports=I:c.BN=I,I.BN=I,I.wordSize=26;var y;try{typeof window<"u"&&typeof window.Buffer<"u"?y=window.Buffer:y=Ra.Buffer}catch{}I.isBN=function(q){return q instanceof I?!0:q!==null&&typeof q=="object"&&q.constructor.wordSize===I.wordSize&&Array.isArray(q.words)},I.max=function(q,J){return q.cmp(J)>0?q:J},I.min=function(q,J){return q.cmp(J)<0?q:J},I.prototype._init=function(q,J,Q){if(typeof q=="number")return this._initNumber(q,J,Q);if(typeof q=="object")return this._initArray(q,J,Q);J==="hex"&&(J=16),h(J===(J|0)&&J>=2&&J<=36),q=q.toString().replace(/\s+/g,"");var L=0;q[0]==="-"&&(L++,this.negative=1),L<q.length&&(J===16?this._parseHex(q,L,Q):(this._parseBase(q,J,L),Q==="le"&&this._initArray(this.toArray(),J,Q)))},I.prototype._initNumber=function(q,J,Q){q<0&&(this.negative=1,q=-q),q<67108864?(this.words=[q&67108863],this.length=1):q<4503599627370496?(this.words=[q&67108863,q/67108864&67108863],this.length=2):(h(q<9007199254740992),this.words=[q&67108863,q/67108864&67108863,1],this.length=3),Q==="le"&&this._initArray(this.toArray(),J,Q)},I.prototype._initArray=function(q,J,Q){if(h(typeof q.length=="number"),q.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(q.length/3),this.words=new Array(this.length);for(var L=0;L<this.length;L++)this.words[L]=0;var W,Ae,ie=0;if(Q==="be")for(L=q.length-1,W=0;L>=0;L-=3)Ae=q[L]|q[L-1]<<8|q[L-2]<<16,this.words[W]|=Ae<<ie&67108863,this.words[W+1]=Ae>>>26-ie&67108863,ie+=24,ie>=26&&(ie-=26,W++);else if(Q==="le")for(L=0,W=0;L<q.length;L+=3)Ae=q[L]|q[L+1]<<8|q[L+2]<<16,this.words[W]|=Ae<<ie&67108863,this.words[W+1]=Ae>>>26-ie&67108863,ie+=24,ie>=26&&(ie-=26,W++);return this.strip()};function S(He,q){var J=He.charCodeAt(q);return J>=65&&J<=70?J-55:J>=97&&J<=102?J-87:J-48&15}function k(He,q,J){var Q=S(He,J);return J-1>=q&&(Q|=S(He,J-1)<<4),Q}I.prototype._parseHex=function(q,J,Q){this.length=Math.ceil((q.length-J)/6),this.words=new Array(this.length);for(var L=0;L<this.length;L++)this.words[L]=0;var W=0,Ae=0,ie;if(Q==="be")for(L=q.length-1;L>=J;L-=2)ie=k(q,J,L)<<W,this.words[Ae]|=ie&67108863,W>=18?(W-=18,Ae+=1,this.words[Ae]|=ie>>>26):W+=8;else{var fe=q.length-J;for(L=fe%2===0?J+1:J;L<q.length;L+=2)ie=k(q,J,L)<<W,this.words[Ae]|=ie&67108863,W>=18?(W-=18,Ae+=1,this.words[Ae]|=ie>>>26):W+=8}this.strip()};function N(He,q,J,Q){for(var L=0,W=Math.min(He.length,J),Ae=q;Ae<W;Ae++){var ie=He.charCodeAt(Ae)-48;L*=Q,ie>=49?L+=ie-49+10:ie>=17?L+=ie-17+10:L+=ie}return L}I.prototype._parseBase=function(q,J,Q){this.words=[0],this.length=1;for(var L=0,W=1;W<=67108863;W*=J)L++;L--,W=W/J|0;for(var Ae=q.length-Q,ie=Ae%L,fe=Math.min(Ae,Ae-ie)+Q,z=0,G=Q;G<fe;G+=L)z=N(q,G,G+L,J),this.imuln(W),this.words[0]+z<67108864?this.words[0]+=z:this._iaddn(z);if(ie!==0){var T=1;for(z=N(q,G,q.length,J),G=0;G<ie;G++)T*=J;this.imuln(T),this.words[0]+z<67108864?this.words[0]+=z:this._iaddn(z)}this.strip()},I.prototype.copy=function(q){q.words=new Array(this.length);for(var J=0;J<this.length;J++)q.words[J]=this.words[J];q.length=this.length,q.negative=this.negative,q.red=this.red},I.prototype.clone=function(){var q=new I(null);return this.copy(q),q},I.prototype._expand=function(q){for(;this.length<q;)this.words[this.length++]=0;return this},I.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},I.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},I.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var R=["","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"],B=[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],oe=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];I.prototype.toString=function(q,J){q=q||10,J=J|0||1;var Q;if(q===16||q==="hex"){Q="";for(var L=0,W=0,Ae=0;Ae<this.length;Ae++){var ie=this.words[Ae],fe=((ie<<L|W)&16777215).toString(16);W=ie>>>24-L&16777215,L+=2,L>=26&&(L-=26,Ae--),W!==0||Ae!==this.length-1?Q=R[6-fe.length]+fe+Q:Q=fe+Q}for(W!==0&&(Q=W.toString(16)+Q);Q.length%J!==0;)Q="0"+Q;return this.negative!==0&&(Q="-"+Q),Q}if(q===(q|0)&&q>=2&&q<=36){var z=B[q],G=oe[q];Q="";var T=this.clone();for(T.negative=0;!T.isZero();){var Be=T.modn(G).toString(q);T=T.idivn(G),T.isZero()?Q=Be+Q:Q=R[z-Be.length]+Be+Q}for(this.isZero()&&(Q="0"+Q);Q.length%J!==0;)Q="0"+Q;return this.negative!==0&&(Q="-"+Q),Q}h(!1,"Base should be between 2 and 36")},I.prototype.toNumber=function(){var q=this.words[0];return this.length===2?q+=this.words[1]*67108864:this.length===3&&this.words[2]===1?q+=4503599627370496+this.words[1]*67108864:this.length>2&&h(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-q:q},I.prototype.toJSON=function(){return this.toString(16)},I.prototype.toBuffer=function(q,J){return h(typeof y<"u"),this.toArrayLike(y,q,J)},I.prototype.toArray=function(q,J){return this.toArrayLike(Array,q,J)},I.prototype.toArrayLike=function(q,J,Q){var L=this.byteLength(),W=Q||Math.max(1,L);h(L<=W,"byte array longer than desired length"),h(W>0,"Requested array length <= 0"),this.strip();var Ae=J==="le",ie=new q(W),fe,z,G=this.clone();if(Ae){for(z=0;!G.isZero();z++)fe=G.andln(255),G.iushrn(8),ie[z]=fe;for(;z<W;z++)ie[z]=0}else{for(z=0;z<W-L;z++)ie[z]=0;for(z=0;!G.isZero();z++)fe=G.andln(255),G.iushrn(8),ie[W-z-1]=fe}return ie},Math.clz32?I.prototype._countBits=function(q){return 32-Math.clz32(q)}:I.prototype._countBits=function(q){var J=q,Q=0;return J>=4096&&(Q+=13,J>>>=13),J>=64&&(Q+=7,J>>>=7),J>=8&&(Q+=4,J>>>=4),J>=2&&(Q+=2,J>>>=2),Q+J},I.prototype._zeroBits=function(q){if(q===0)return 26;var J=q,Q=0;return(J&8191)===0&&(Q+=13,J>>>=13),(J&127)===0&&(Q+=7,J>>>=7),(J&15)===0&&(Q+=4,J>>>=4),(J&3)===0&&(Q+=2,J>>>=2),(J&1)===0&&Q++,Q},I.prototype.bitLength=function(){var q=this.words[this.length-1],J=this._countBits(q);return(this.length-1)*26+J};function Ee(He){for(var q=new Array(He.bitLength()),J=0;J<q.length;J++){var Q=J/26|0,L=J%26;q[J]=(He.words[Q]&1<<L)>>>L}return q}I.prototype.zeroBits=function(){if(this.isZero())return 0;for(var q=0,J=0;J<this.length;J++){var Q=this._zeroBits(this.words[J]);if(q+=Q,Q!==26)break}return q},I.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},I.prototype.toTwos=function(q){return this.negative!==0?this.abs().inotn(q).iaddn(1):this.clone()},I.prototype.fromTwos=function(q){return this.testn(q-1)?this.notn(q).iaddn(1).ineg():this.clone()},I.prototype.isNeg=function(){return this.negative!==0},I.prototype.neg=function(){return this.clone().ineg()},I.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},I.prototype.iuor=function(q){for(;this.length<q.length;)this.words[this.length++]=0;for(var J=0;J<q.length;J++)this.words[J]=this.words[J]|q.words[J];return this.strip()},I.prototype.ior=function(q){return h((this.negative|q.negative)===0),this.iuor(q)},I.prototype.or=function(q){return this.length>q.length?this.clone().ior(q):q.clone().ior(this)},I.prototype.uor=function(q){return this.length>q.length?this.clone().iuor(q):q.clone().iuor(this)},I.prototype.iuand=function(q){var J;this.length>q.length?J=q:J=this;for(var Q=0;Q<J.length;Q++)this.words[Q]=this.words[Q]&q.words[Q];return this.length=J.length,this.strip()},I.prototype.iand=function(q){return h((this.negative|q.negative)===0),this.iuand(q)},I.prototype.and=function(q){return this.length>q.length?this.clone().iand(q):q.clone().iand(this)},I.prototype.uand=function(q){return this.length>q.length?this.clone().iuand(q):q.clone().iuand(this)},I.prototype.iuxor=function(q){var J,Q;this.length>q.length?(J=this,Q=q):(J=q,Q=this);for(var L=0;L<Q.length;L++)this.words[L]=J.words[L]^Q.words[L];if(this!==J)for(;L<J.length;L++)this.words[L]=J.words[L];return this.length=J.length,this.strip()},I.prototype.ixor=function(q){return h((this.negative|q.negative)===0),this.iuxor(q)},I.prototype.xor=function(q){return this.length>q.length?this.clone().ixor(q):q.clone().ixor(this)},I.prototype.uxor=function(q){return this.length>q.length?this.clone().iuxor(q):q.clone().iuxor(this)},I.prototype.inotn=function(q){h(typeof q=="number"&&q>=0);var J=Math.ceil(q/26)|0,Q=q%26;this._expand(J),Q>0&&J--;for(var L=0;L<J;L++)this.words[L]=~this.words[L]&67108863;return Q>0&&(this.words[L]=~this.words[L]&67108863>>26-Q),this.strip()},I.prototype.notn=function(q){return this.clone().inotn(q)},I.prototype.setn=function(q,J){h(typeof q=="number"&&q>=0);var Q=q/26|0,L=q%26;return this._expand(Q+1),J?this.words[Q]=this.words[Q]|1<<L:this.words[Q]=this.words[Q]&~(1<<L),this.strip()},I.prototype.iadd=function(q){var J;if(this.negative!==0&&q.negative===0)return this.negative=0,J=this.isub(q),this.negative^=1,this._normSign();if(this.negative===0&&q.negative!==0)return q.negative=0,J=this.isub(q),q.negative=1,J._normSign();var Q,L;this.length>q.length?(Q=this,L=q):(Q=q,L=this);for(var W=0,Ae=0;Ae<L.length;Ae++)J=(Q.words[Ae]|0)+(L.words[Ae]|0)+W,this.words[Ae]=J&67108863,W=J>>>26;for(;W!==0&&Ae<Q.length;Ae++)J=(Q.words[Ae]|0)+W,this.words[Ae]=J&67108863,W=J>>>26;if(this.length=Q.length,W!==0)this.words[this.length]=W,this.length++;else if(Q!==this)for(;Ae<Q.length;Ae++)this.words[Ae]=Q.words[Ae];return this},I.prototype.add=function(q){var J;return q.negative!==0&&this.negative===0?(q.negative=0,J=this.sub(q),q.negative^=1,J):q.negative===0&&this.negative!==0?(this.negative=0,J=q.sub(this),this.negative=1,J):this.length>q.length?this.clone().iadd(q):q.clone().iadd(this)},I.prototype.isub=function(q){if(q.negative!==0){q.negative=0;var J=this.iadd(q);return q.negative=1,J._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(q),this.negative=1,this._normSign();var Q=this.cmp(q);if(Q===0)return this.negative=0,this.length=1,this.words[0]=0,this;var L,W;Q>0?(L=this,W=q):(L=q,W=this);for(var Ae=0,ie=0;ie<W.length;ie++)J=(L.words[ie]|0)-(W.words[ie]|0)+Ae,Ae=J>>26,this.words[ie]=J&67108863;for(;Ae!==0&&ie<L.length;ie++)J=(L.words[ie]|0)+Ae,Ae=J>>26,this.words[ie]=J&67108863;if(Ae===0&&ie<L.length&&L!==this)for(;ie<L.length;ie++)this.words[ie]=L.words[ie];return this.length=Math.max(this.length,ie),L!==this&&(this.negative=1),this.strip()},I.prototype.sub=function(q){return this.clone().isub(q)};function pe(He,q,J){J.negative=q.negative^He.negative;var Q=He.length+q.length|0;J.length=Q,Q=Q-1|0;var L=He.words[0]|0,W=q.words[0]|0,Ae=L*W,ie=Ae&67108863,fe=Ae/67108864|0;J.words[0]=ie;for(var z=1;z<Q;z++){for(var G=fe>>>26,T=fe&67108863,Be=Math.min(z,q.length-1),Te=Math.max(0,z-He.length+1);Te<=Be;Te++){var se=z-Te|0;L=He.words[se]|0,W=q.words[Te]|0,Ae=L*W+T,G+=Ae/67108864|0,T=Ae&67108863}J.words[z]=T|0,fe=G|0}return fe!==0?J.words[z]=fe|0:J.length--,J.strip()}var V=function(q,J,Q){var L=q.words,W=J.words,Ae=Q.words,ie=0,fe,z,G,T=L[0]|0,Be=T&8191,Te=T>>>13,se=L[1]|0,ze=se&8191,s0=se>>>13,l0=L[2]|0,p0=l0&8191,G0=l0>>>13,X0=L[3]|0,Y0=X0&8191,Ze=X0>>>13,ot=L[4]|0,Pe=ot&8191,e0=ot>>>13,o0=L[5]|0,ne=o0&8191,B0=o0>>>13,K0=L[6]|0,N0=K0&8191,st=K0>>>13,Z0=L[7]|0,W0=Z0&8191,vt=Z0>>>13,er=L[8]|0,Yt=er&8191,yr=er>>>13,xr=L[9]|0,Lt=xr&8191,hr=xr>>>13,kr=W[0]|0,qt=kr&8191,Er=kr>>>13,Mr=W[1]|0,Jt=Mr&8191,Qr=Mr>>>13,Sr=W[2]|0,$t=Sr&8191,Dr=Sr>>>13,Cr=W[3]|0,Ut=Cr&8191,br=Cr>>>13,dr=W[4]|0,jt=dr&8191,Fr=dr>>>13,Pr=W[5]|0,Vt=Pr&8191,_r=Pr>>>13,vr=W[6]|0,Ot=vr&8191,Ir=vr>>>13,Kr=W[7]|0,Xt=Kr&8191,a0=Kr>>>13,Br=W[8]|0,Ye=Br&8191,n0=Br>>>13,u0=W[9]|0,d0=u0&8191,E0=u0>>>13;Q.negative=q.negative^J.negative,Q.length=19,fe=Math.imul(Be,qt),z=Math.imul(Be,Er),z=z+Math.imul(Te,qt)|0,G=Math.imul(Te,Er);var P0=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(P0>>>26)|0,P0&=67108863,fe=Math.imul(ze,qt),z=Math.imul(ze,Er),z=z+Math.imul(s0,qt)|0,G=Math.imul(s0,Er),fe=fe+Math.imul(Be,Jt)|0,z=z+Math.imul(Be,Qr)|0,z=z+Math.imul(Te,Jt)|0,G=G+Math.imul(Te,Qr)|0;var L0=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(L0>>>26)|0,L0&=67108863,fe=Math.imul(p0,qt),z=Math.imul(p0,Er),z=z+Math.imul(G0,qt)|0,G=Math.imul(G0,Er),fe=fe+Math.imul(ze,Jt)|0,z=z+Math.imul(ze,Qr)|0,z=z+Math.imul(s0,Jt)|0,G=G+Math.imul(s0,Qr)|0,fe=fe+Math.imul(Be,$t)|0,z=z+Math.imul(Be,Dr)|0,z=z+Math.imul(Te,$t)|0,G=G+Math.imul(Te,Dr)|0;var it=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(it>>>26)|0,it&=67108863,fe=Math.imul(Y0,qt),z=Math.imul(Y0,Er),z=z+Math.imul(Ze,qt)|0,G=Math.imul(Ze,Er),fe=fe+Math.imul(p0,Jt)|0,z=z+Math.imul(p0,Qr)|0,z=z+Math.imul(G0,Jt)|0,G=G+Math.imul(G0,Qr)|0,fe=fe+Math.imul(ze,$t)|0,z=z+Math.imul(ze,Dr)|0,z=z+Math.imul(s0,$t)|0,G=G+Math.imul(s0,Dr)|0,fe=fe+Math.imul(Be,Ut)|0,z=z+Math.imul(Be,br)|0,z=z+Math.imul(Te,Ut)|0,G=G+Math.imul(Te,br)|0;var Et=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(Et>>>26)|0,Et&=67108863,fe=Math.imul(Pe,qt),z=Math.imul(Pe,Er),z=z+Math.imul(e0,qt)|0,G=Math.imul(e0,Er),fe=fe+Math.imul(Y0,Jt)|0,z=z+Math.imul(Y0,Qr)|0,z=z+Math.imul(Ze,Jt)|0,G=G+Math.imul(Ze,Qr)|0,fe=fe+Math.imul(p0,$t)|0,z=z+Math.imul(p0,Dr)|0,z=z+Math.imul(G0,$t)|0,G=G+Math.imul(G0,Dr)|0,fe=fe+Math.imul(ze,Ut)|0,z=z+Math.imul(ze,br)|0,z=z+Math.imul(s0,Ut)|0,G=G+Math.imul(s0,br)|0,fe=fe+Math.imul(Be,jt)|0,z=z+Math.imul(Be,Fr)|0,z=z+Math.imul(Te,jt)|0,G=G+Math.imul(Te,Fr)|0;var Bt=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,fe=Math.imul(ne,qt),z=Math.imul(ne,Er),z=z+Math.imul(B0,qt)|0,G=Math.imul(B0,Er),fe=fe+Math.imul(Pe,Jt)|0,z=z+Math.imul(Pe,Qr)|0,z=z+Math.imul(e0,Jt)|0,G=G+Math.imul(e0,Qr)|0,fe=fe+Math.imul(Y0,$t)|0,z=z+Math.imul(Y0,Dr)|0,z=z+Math.imul(Ze,$t)|0,G=G+Math.imul(Ze,Dr)|0,fe=fe+Math.imul(p0,Ut)|0,z=z+Math.imul(p0,br)|0,z=z+Math.imul(G0,Ut)|0,G=G+Math.imul(G0,br)|0,fe=fe+Math.imul(ze,jt)|0,z=z+Math.imul(ze,Fr)|0,z=z+Math.imul(s0,jt)|0,G=G+Math.imul(s0,Fr)|0,fe=fe+Math.imul(Be,Vt)|0,z=z+Math.imul(Be,_r)|0,z=z+Math.imul(Te,Vt)|0,G=G+Math.imul(Te,_r)|0;var C=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(C>>>26)|0,C&=67108863,fe=Math.imul(N0,qt),z=Math.imul(N0,Er),z=z+Math.imul(st,qt)|0,G=Math.imul(st,Er),fe=fe+Math.imul(ne,Jt)|0,z=z+Math.imul(ne,Qr)|0,z=z+Math.imul(B0,Jt)|0,G=G+Math.imul(B0,Qr)|0,fe=fe+Math.imul(Pe,$t)|0,z=z+Math.imul(Pe,Dr)|0,z=z+Math.imul(e0,$t)|0,G=G+Math.imul(e0,Dr)|0,fe=fe+Math.imul(Y0,Ut)|0,z=z+Math.imul(Y0,br)|0,z=z+Math.imul(Ze,Ut)|0,G=G+Math.imul(Ze,br)|0,fe=fe+Math.imul(p0,jt)|0,z=z+Math.imul(p0,Fr)|0,z=z+Math.imul(G0,jt)|0,G=G+Math.imul(G0,Fr)|0,fe=fe+Math.imul(ze,Vt)|0,z=z+Math.imul(ze,_r)|0,z=z+Math.imul(s0,Vt)|0,G=G+Math.imul(s0,_r)|0,fe=fe+Math.imul(Be,Ot)|0,z=z+Math.imul(Be,Ir)|0,z=z+Math.imul(Te,Ot)|0,G=G+Math.imul(Te,Ir)|0;var e=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(e>>>26)|0,e&=67108863,fe=Math.imul(W0,qt),z=Math.imul(W0,Er),z=z+Math.imul(vt,qt)|0,G=Math.imul(vt,Er),fe=fe+Math.imul(N0,Jt)|0,z=z+Math.imul(N0,Qr)|0,z=z+Math.imul(st,Jt)|0,G=G+Math.imul(st,Qr)|0,fe=fe+Math.imul(ne,$t)|0,z=z+Math.imul(ne,Dr)|0,z=z+Math.imul(B0,$t)|0,G=G+Math.imul(B0,Dr)|0,fe=fe+Math.imul(Pe,Ut)|0,z=z+Math.imul(Pe,br)|0,z=z+Math.imul(e0,Ut)|0,G=G+Math.imul(e0,br)|0,fe=fe+Math.imul(Y0,jt)|0,z=z+Math.imul(Y0,Fr)|0,z=z+Math.imul(Ze,jt)|0,G=G+Math.imul(Ze,Fr)|0,fe=fe+Math.imul(p0,Vt)|0,z=z+Math.imul(p0,_r)|0,z=z+Math.imul(G0,Vt)|0,G=G+Math.imul(G0,_r)|0,fe=fe+Math.imul(ze,Ot)|0,z=z+Math.imul(ze,Ir)|0,z=z+Math.imul(s0,Ot)|0,G=G+Math.imul(s0,Ir)|0,fe=fe+Math.imul(Be,Xt)|0,z=z+Math.imul(Be,a0)|0,z=z+Math.imul(Te,Xt)|0,G=G+Math.imul(Te,a0)|0;var s=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(s>>>26)|0,s&=67108863,fe=Math.imul(Yt,qt),z=Math.imul(Yt,Er),z=z+Math.imul(yr,qt)|0,G=Math.imul(yr,Er),fe=fe+Math.imul(W0,Jt)|0,z=z+Math.imul(W0,Qr)|0,z=z+Math.imul(vt,Jt)|0,G=G+Math.imul(vt,Qr)|0,fe=fe+Math.imul(N0,$t)|0,z=z+Math.imul(N0,Dr)|0,z=z+Math.imul(st,$t)|0,G=G+Math.imul(st,Dr)|0,fe=fe+Math.imul(ne,Ut)|0,z=z+Math.imul(ne,br)|0,z=z+Math.imul(B0,Ut)|0,G=G+Math.imul(B0,br)|0,fe=fe+Math.imul(Pe,jt)|0,z=z+Math.imul(Pe,Fr)|0,z=z+Math.imul(e0,jt)|0,G=G+Math.imul(e0,Fr)|0,fe=fe+Math.imul(Y0,Vt)|0,z=z+Math.imul(Y0,_r)|0,z=z+Math.imul(Ze,Vt)|0,G=G+Math.imul(Ze,_r)|0,fe=fe+Math.imul(p0,Ot)|0,z=z+Math.imul(p0,Ir)|0,z=z+Math.imul(G0,Ot)|0,G=G+Math.imul(G0,Ir)|0,fe=fe+Math.imul(ze,Xt)|0,z=z+Math.imul(ze,a0)|0,z=z+Math.imul(s0,Xt)|0,G=G+Math.imul(s0,a0)|0,fe=fe+Math.imul(Be,Ye)|0,z=z+Math.imul(Be,n0)|0,z=z+Math.imul(Te,Ye)|0,G=G+Math.imul(Te,n0)|0;var an=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(an>>>26)|0,an&=67108863,fe=Math.imul(Lt,qt),z=Math.imul(Lt,Er),z=z+Math.imul(hr,qt)|0,G=Math.imul(hr,Er),fe=fe+Math.imul(Yt,Jt)|0,z=z+Math.imul(Yt,Qr)|0,z=z+Math.imul(yr,Jt)|0,G=G+Math.imul(yr,Qr)|0,fe=fe+Math.imul(W0,$t)|0,z=z+Math.imul(W0,Dr)|0,z=z+Math.imul(vt,$t)|0,G=G+Math.imul(vt,Dr)|0,fe=fe+Math.imul(N0,Ut)|0,z=z+Math.imul(N0,br)|0,z=z+Math.imul(st,Ut)|0,G=G+Math.imul(st,br)|0,fe=fe+Math.imul(ne,jt)|0,z=z+Math.imul(ne,Fr)|0,z=z+Math.imul(B0,jt)|0,G=G+Math.imul(B0,Fr)|0,fe=fe+Math.imul(Pe,Vt)|0,z=z+Math.imul(Pe,_r)|0,z=z+Math.imul(e0,Vt)|0,G=G+Math.imul(e0,_r)|0,fe=fe+Math.imul(Y0,Ot)|0,z=z+Math.imul(Y0,Ir)|0,z=z+Math.imul(Ze,Ot)|0,G=G+Math.imul(Ze,Ir)|0,fe=fe+Math.imul(p0,Xt)|0,z=z+Math.imul(p0,a0)|0,z=z+Math.imul(G0,Xt)|0,G=G+Math.imul(G0,a0)|0,fe=fe+Math.imul(ze,Ye)|0,z=z+Math.imul(ze,n0)|0,z=z+Math.imul(s0,Ye)|0,G=G+Math.imul(s0,n0)|0,fe=fe+Math.imul(Be,d0)|0,z=z+Math.imul(Be,E0)|0,z=z+Math.imul(Te,d0)|0,G=G+Math.imul(Te,E0)|0;var gt=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(gt>>>26)|0,gt&=67108863,fe=Math.imul(Lt,Jt),z=Math.imul(Lt,Qr),z=z+Math.imul(hr,Jt)|0,G=Math.imul(hr,Qr),fe=fe+Math.imul(Yt,$t)|0,z=z+Math.imul(Yt,Dr)|0,z=z+Math.imul(yr,$t)|0,G=G+Math.imul(yr,Dr)|0,fe=fe+Math.imul(W0,Ut)|0,z=z+Math.imul(W0,br)|0,z=z+Math.imul(vt,Ut)|0,G=G+Math.imul(vt,br)|0,fe=fe+Math.imul(N0,jt)|0,z=z+Math.imul(N0,Fr)|0,z=z+Math.imul(st,jt)|0,G=G+Math.imul(st,Fr)|0,fe=fe+Math.imul(ne,Vt)|0,z=z+Math.imul(ne,_r)|0,z=z+Math.imul(B0,Vt)|0,G=G+Math.imul(B0,_r)|0,fe=fe+Math.imul(Pe,Ot)|0,z=z+Math.imul(Pe,Ir)|0,z=z+Math.imul(e0,Ot)|0,G=G+Math.imul(e0,Ir)|0,fe=fe+Math.imul(Y0,Xt)|0,z=z+Math.imul(Y0,a0)|0,z=z+Math.imul(Ze,Xt)|0,G=G+Math.imul(Ze,a0)|0,fe=fe+Math.imul(p0,Ye)|0,z=z+Math.imul(p0,n0)|0,z=z+Math.imul(G0,Ye)|0,G=G+Math.imul(G0,n0)|0,fe=fe+Math.imul(ze,d0)|0,z=z+Math.imul(ze,E0)|0,z=z+Math.imul(s0,d0)|0,G=G+Math.imul(s0,E0)|0;var on=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(on>>>26)|0,on&=67108863,fe=Math.imul(Lt,$t),z=Math.imul(Lt,Dr),z=z+Math.imul(hr,$t)|0,G=Math.imul(hr,Dr),fe=fe+Math.imul(Yt,Ut)|0,z=z+Math.imul(Yt,br)|0,z=z+Math.imul(yr,Ut)|0,G=G+Math.imul(yr,br)|0,fe=fe+Math.imul(W0,jt)|0,z=z+Math.imul(W0,Fr)|0,z=z+Math.imul(vt,jt)|0,G=G+Math.imul(vt,Fr)|0,fe=fe+Math.imul(N0,Vt)|0,z=z+Math.imul(N0,_r)|0,z=z+Math.imul(st,Vt)|0,G=G+Math.imul(st,_r)|0,fe=fe+Math.imul(ne,Ot)|0,z=z+Math.imul(ne,Ir)|0,z=z+Math.imul(B0,Ot)|0,G=G+Math.imul(B0,Ir)|0,fe=fe+Math.imul(Pe,Xt)|0,z=z+Math.imul(Pe,a0)|0,z=z+Math.imul(e0,Xt)|0,G=G+Math.imul(e0,a0)|0,fe=fe+Math.imul(Y0,Ye)|0,z=z+Math.imul(Y0,n0)|0,z=z+Math.imul(Ze,Ye)|0,G=G+Math.imul(Ze,n0)|0,fe=fe+Math.imul(p0,d0)|0,z=z+Math.imul(p0,E0)|0,z=z+Math.imul(G0,d0)|0,G=G+Math.imul(G0,E0)|0;var vn=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(vn>>>26)|0,vn&=67108863,fe=Math.imul(Lt,Ut),z=Math.imul(Lt,br),z=z+Math.imul(hr,Ut)|0,G=Math.imul(hr,br),fe=fe+Math.imul(Yt,jt)|0,z=z+Math.imul(Yt,Fr)|0,z=z+Math.imul(yr,jt)|0,G=G+Math.imul(yr,Fr)|0,fe=fe+Math.imul(W0,Vt)|0,z=z+Math.imul(W0,_r)|0,z=z+Math.imul(vt,Vt)|0,G=G+Math.imul(vt,_r)|0,fe=fe+Math.imul(N0,Ot)|0,z=z+Math.imul(N0,Ir)|0,z=z+Math.imul(st,Ot)|0,G=G+Math.imul(st,Ir)|0,fe=fe+Math.imul(ne,Xt)|0,z=z+Math.imul(ne,a0)|0,z=z+Math.imul(B0,Xt)|0,G=G+Math.imul(B0,a0)|0,fe=fe+Math.imul(Pe,Ye)|0,z=z+Math.imul(Pe,n0)|0,z=z+Math.imul(e0,Ye)|0,G=G+Math.imul(e0,n0)|0,fe=fe+Math.imul(Y0,d0)|0,z=z+Math.imul(Y0,E0)|0,z=z+Math.imul(Ze,d0)|0,G=G+Math.imul(Ze,E0)|0;var Un=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(Un>>>26)|0,Un&=67108863,fe=Math.imul(Lt,jt),z=Math.imul(Lt,Fr),z=z+Math.imul(hr,jt)|0,G=Math.imul(hr,Fr),fe=fe+Math.imul(Yt,Vt)|0,z=z+Math.imul(Yt,_r)|0,z=z+Math.imul(yr,Vt)|0,G=G+Math.imul(yr,_r)|0,fe=fe+Math.imul(W0,Ot)|0,z=z+Math.imul(W0,Ir)|0,z=z+Math.imul(vt,Ot)|0,G=G+Math.imul(vt,Ir)|0,fe=fe+Math.imul(N0,Xt)|0,z=z+Math.imul(N0,a0)|0,z=z+Math.imul(st,Xt)|0,G=G+Math.imul(st,a0)|0,fe=fe+Math.imul(ne,Ye)|0,z=z+Math.imul(ne,n0)|0,z=z+Math.imul(B0,Ye)|0,G=G+Math.imul(B0,n0)|0,fe=fe+Math.imul(Pe,d0)|0,z=z+Math.imul(Pe,E0)|0,z=z+Math.imul(e0,d0)|0,G=G+Math.imul(e0,E0)|0;var Nn=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(Nn>>>26)|0,Nn&=67108863,fe=Math.imul(Lt,Vt),z=Math.imul(Lt,_r),z=z+Math.imul(hr,Vt)|0,G=Math.imul(hr,_r),fe=fe+Math.imul(Yt,Ot)|0,z=z+Math.imul(Yt,Ir)|0,z=z+Math.imul(yr,Ot)|0,G=G+Math.imul(yr,Ir)|0,fe=fe+Math.imul(W0,Xt)|0,z=z+Math.imul(W0,a0)|0,z=z+Math.imul(vt,Xt)|0,G=G+Math.imul(vt,a0)|0,fe=fe+Math.imul(N0,Ye)|0,z=z+Math.imul(N0,n0)|0,z=z+Math.imul(st,Ye)|0,G=G+Math.imul(st,n0)|0,fe=fe+Math.imul(ne,d0)|0,z=z+Math.imul(ne,E0)|0,z=z+Math.imul(B0,d0)|0,G=G+Math.imul(B0,E0)|0;var TA=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(TA>>>26)|0,TA&=67108863,fe=Math.imul(Lt,Ot),z=Math.imul(Lt,Ir),z=z+Math.imul(hr,Ot)|0,G=Math.imul(hr,Ir),fe=fe+Math.imul(Yt,Xt)|0,z=z+Math.imul(Yt,a0)|0,z=z+Math.imul(yr,Xt)|0,G=G+Math.imul(yr,a0)|0,fe=fe+Math.imul(W0,Ye)|0,z=z+Math.imul(W0,n0)|0,z=z+Math.imul(vt,Ye)|0,G=G+Math.imul(vt,n0)|0,fe=fe+Math.imul(N0,d0)|0,z=z+Math.imul(N0,E0)|0,z=z+Math.imul(st,d0)|0,G=G+Math.imul(st,E0)|0;var SA=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(SA>>>26)|0,SA&=67108863,fe=Math.imul(Lt,Xt),z=Math.imul(Lt,a0),z=z+Math.imul(hr,Xt)|0,G=Math.imul(hr,a0),fe=fe+Math.imul(Yt,Ye)|0,z=z+Math.imul(Yt,n0)|0,z=z+Math.imul(yr,Ye)|0,G=G+Math.imul(yr,n0)|0,fe=fe+Math.imul(W0,d0)|0,z=z+Math.imul(W0,E0)|0,z=z+Math.imul(vt,d0)|0,G=G+Math.imul(vt,E0)|0;var Ve=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(Ve>>>26)|0,Ve&=67108863,fe=Math.imul(Lt,Ye),z=Math.imul(Lt,n0),z=z+Math.imul(hr,Ye)|0,G=Math.imul(hr,n0),fe=fe+Math.imul(Yt,d0)|0,z=z+Math.imul(Yt,E0)|0,z=z+Math.imul(yr,d0)|0,G=G+Math.imul(yr,E0)|0;var w=(ie+fe|0)+((z&8191)<<13)|0;ie=(G+(z>>>13)|0)+(w>>>26)|0,w&=67108863,fe=Math.imul(Lt,d0),z=Math.imul(Lt,E0),z=z+Math.imul(hr,d0)|0,G=Math.imul(hr,E0);var rA=(ie+fe|0)+((z&8191)<<13)|0;return ie=(G+(z>>>13)|0)+(rA>>>26)|0,rA&=67108863,Ae[0]=P0,Ae[1]=L0,Ae[2]=it,Ae[3]=Et,Ae[4]=Bt,Ae[5]=C,Ae[6]=e,Ae[7]=s,Ae[8]=an,Ae[9]=gt,Ae[10]=on,Ae[11]=vn,Ae[12]=Un,Ae[13]=Nn,Ae[14]=TA,Ae[15]=SA,Ae[16]=Ve,Ae[17]=w,Ae[18]=rA,ie!==0&&(Ae[19]=ie,Q.length++),Q};Math.imul||(V=pe);function Ie(He,q,J){J.negative=q.negative^He.negative,J.length=He.length+q.length;for(var Q=0,L=0,W=0;W<J.length-1;W++){var Ae=L;L=0;for(var ie=Q&67108863,fe=Math.min(W,q.length-1),z=Math.max(0,W-He.length+1);z<=fe;z++){var G=W-z,T=He.words[G]|0,Be=q.words[z]|0,Te=T*Be,se=Te&67108863;Ae=Ae+(Te/67108864|0)|0,se=se+ie|0,ie=se&67108863,Ae=Ae+(se>>>26)|0,L+=Ae>>>26,Ae&=67108863}J.words[W]=ie,Q=Ae,Ae=L}return Q!==0?J.words[W]=Q:J.length--,J.strip()}function Ce(He,q,J){var Q=new _e;return Q.mulp(He,q,J)}I.prototype.mulTo=function(q,J){var Q,L=this.length+q.length;return this.length===10&&q.length===10?Q=V(this,q,J):L<63?Q=pe(this,q,J):L<1024?Q=Ie(this,q,J):Q=Ce(this,q,J),Q};function _e(He,q){this.x=He,this.y=q}_e.prototype.makeRBT=function(q){for(var J=new Array(q),Q=I.prototype._countBits(q)-1,L=0;L<q;L++)J[L]=this.revBin(L,Q,q);return J},_e.prototype.revBin=function(q,J,Q){if(q===0||q===Q-1)return q;for(var L=0,W=0;W<J;W++)L|=(q&1)<<J-W-1,q>>=1;return L},_e.prototype.permute=function(q,J,Q,L,W,Ae){for(var ie=0;ie<Ae;ie++)L[ie]=J[q[ie]],W[ie]=Q[q[ie]]},_e.prototype.transform=function(q,J,Q,L,W,Ae){this.permute(Ae,q,J,Q,L,W);for(var ie=1;ie<W;ie<<=1)for(var fe=ie<<1,z=Math.cos(2*Math.PI/fe),G=Math.sin(2*Math.PI/fe),T=0;T<W;T+=fe)for(var Be=z,Te=G,se=0;se<ie;se++){var ze=Q[T+se],s0=L[T+se],l0=Q[T+se+ie],p0=L[T+se+ie],G0=Be*l0-Te*p0;p0=Be*p0+Te*l0,l0=G0,Q[T+se]=ze+l0,L[T+se]=s0+p0,Q[T+se+ie]=ze-l0,L[T+se+ie]=s0-p0,se!==fe&&(G0=z*Be-G*Te,Te=z*Te+G*Be,Be=G0)}},_e.prototype.guessLen13b=function(q,J){var Q=Math.max(J,q)|1,L=Q&1,W=0;for(Q=Q/2|0;Q;Q=Q>>>1)W++;return 1<<W+1+L},_e.prototype.conjugate=function(q,J,Q){if(!(Q<=1))for(var L=0;L<Q/2;L++){var W=q[L];q[L]=q[Q-L-1],q[Q-L-1]=W,W=J[L],J[L]=-J[Q-L-1],J[Q-L-1]=-W}},_e.prototype.normalize13b=function(q,J){for(var Q=0,L=0;L<J/2;L++){var W=Math.round(q[2*L+1]/J)*8192+Math.round(q[2*L]/J)+Q;q[L]=W&67108863,W<67108864?Q=0:Q=W/67108864|0}return q},_e.prototype.convert13b=function(q,J,Q,L){for(var W=0,Ae=0;Ae<J;Ae++)W=W+(q[Ae]|0),Q[2*Ae]=W&8191,W=W>>>13,Q[2*Ae+1]=W&8191,W=W>>>13;for(Ae=2*J;Ae<L;++Ae)Q[Ae]=0;h(W===0),h((W&-8192)===0)},_e.prototype.stub=function(q){for(var J=new Array(q),Q=0;Q<q;Q++)J[Q]=0;return J},_e.prototype.mulp=function(q,J,Q){var L=2*this.guessLen13b(q.length,J.length),W=this.makeRBT(L),Ae=this.stub(L),ie=new Array(L),fe=new Array(L),z=new Array(L),G=new Array(L),T=new Array(L),Be=new Array(L),Te=Q.words;Te.length=L,this.convert13b(q.words,q.length,ie,L),this.convert13b(J.words,J.length,G,L),this.transform(ie,Ae,fe,z,L,W),this.transform(G,Ae,T,Be,L,W);for(var se=0;se<L;se++){var ze=fe[se]*T[se]-z[se]*Be[se];z[se]=fe[se]*Be[se]+z[se]*T[se],fe[se]=ze}return this.conjugate(fe,z,L),this.transform(fe,z,Te,Ae,L,W),this.conjugate(Te,Ae,L),this.normalize13b(Te,L),Q.negative=q.negative^J.negative,Q.length=q.length+J.length,Q.strip()},I.prototype.mul=function(q){var J=new I(null);return J.words=new Array(this.length+q.length),this.mulTo(q,J)},I.prototype.mulf=function(q){var J=new I(null);return J.words=new Array(this.length+q.length),Ce(this,q,J)},I.prototype.imul=function(q){return this.clone().mulTo(q,this)},I.prototype.imuln=function(q){h(typeof q=="number"),h(q<67108864);for(var J=0,Q=0;Q<this.length;Q++){var L=(this.words[Q]|0)*q,W=(L&67108863)+(J&67108863);J>>=26,J+=L/67108864|0,J+=W>>>26,this.words[Q]=W&67108863}return J!==0&&(this.words[Q]=J,this.length++),this.length=q===0?1:this.length,this},I.prototype.muln=function(q){return this.clone().imuln(q)},I.prototype.sqr=function(){return this.mul(this)},I.prototype.isqr=function(){return this.imul(this.clone())},I.prototype.pow=function(q){var J=Ee(q);if(J.length===0)return new I(1);for(var Q=this,L=0;L<J.length&&J[L]===0;L++,Q=Q.sqr());if(++L<J.length)for(var W=Q.sqr();L<J.length;L++,W=W.sqr())J[L]!==0&&(Q=Q.mul(W));return Q},I.prototype.iushln=function(q){h(typeof q=="number"&&q>=0);var J=q%26,Q=(q-J)/26,L=67108863>>>26-J<<26-J,W;if(J!==0){var Ae=0;for(W=0;W<this.length;W++){var ie=this.words[W]&L,fe=(this.words[W]|0)-ie<<J;this.words[W]=fe|Ae,Ae=ie>>>26-J}Ae&&(this.words[W]=Ae,this.length++)}if(Q!==0){for(W=this.length-1;W>=0;W--)this.words[W+Q]=this.words[W];for(W=0;W<Q;W++)this.words[W]=0;this.length+=Q}return this.strip()},I.prototype.ishln=function(q){return h(this.negative===0),this.iushln(q)},I.prototype.iushrn=function(q,J,Q){h(typeof q=="number"&&q>=0);var L;J?L=(J-J%26)/26:L=0;var W=q%26,Ae=Math.min((q-W)/26,this.length),ie=67108863^67108863>>>W<<W,fe=Q;if(L-=Ae,L=Math.max(0,L),fe){for(var z=0;z<Ae;z++)fe.words[z]=this.words[z];fe.length=Ae}if(Ae!==0)if(this.length>Ae)for(this.length-=Ae,z=0;z<this.length;z++)this.words[z]=this.words[z+Ae];else this.words[0]=0,this.length=1;var G=0;for(z=this.length-1;z>=0&&(G!==0||z>=L);z--){var T=this.words[z]|0;this.words[z]=G<<26-W|T>>>W,G=T&ie}return fe&&G!==0&&(fe.words[fe.length++]=G),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},I.prototype.ishrn=function(q,J,Q){return h(this.negative===0),this.iushrn(q,J,Q)},I.prototype.shln=function(q){return this.clone().ishln(q)},I.prototype.ushln=function(q){return this.clone().iushln(q)},I.prototype.shrn=function(q){return this.clone().ishrn(q)},I.prototype.ushrn=function(q){return this.clone().iushrn(q)},I.prototype.testn=function(q){h(typeof q=="number"&&q>=0);var J=q%26,Q=(q-J)/26,L=1<<J;if(this.length<=Q)return!1;var W=this.words[Q];return!!(W&L)},I.prototype.imaskn=function(q){h(typeof q=="number"&&q>=0);var J=q%26,Q=(q-J)/26;if(h(this.negative===0,"imaskn works only with positive numbers"),this.length<=Q)return this;if(J!==0&&Q++,this.length=Math.min(Q,this.length),J!==0){var L=67108863^67108863>>>J<<J;this.words[this.length-1]&=L}return this.strip()},I.prototype.maskn=function(q){return this.clone().imaskn(q)},I.prototype.iaddn=function(q){return h(typeof q=="number"),h(q<67108864),q<0?this.isubn(-q):this.negative!==0?this.length===1&&(this.words[0]|0)<q?(this.words[0]=q-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(q),this.negative=1,this):this._iaddn(q)},I.prototype._iaddn=function(q){this.words[0]+=q;for(var J=0;J<this.length&&this.words[J]>=67108864;J++)this.words[J]-=67108864,J===this.length-1?this.words[J+1]=1:this.words[J+1]++;return this.length=Math.max(this.length,J+1),this},I.prototype.isubn=function(q){if(h(typeof q=="number"),h(q<67108864),q<0)return this.iaddn(-q);if(this.negative!==0)return this.negative=0,this.iaddn(q),this.negative=1,this;if(this.words[0]-=q,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var J=0;J<this.length&&this.words[J]<0;J++)this.words[J]+=67108864,this.words[J+1]-=1;return this.strip()},I.prototype.addn=function(q){return this.clone().iaddn(q)},I.prototype.subn=function(q){return this.clone().isubn(q)},I.prototype.iabs=function(){return this.negative=0,this},I.prototype.abs=function(){return this.clone().iabs()},I.prototype._ishlnsubmul=function(q,J,Q){var L=q.length+Q,W;this._expand(L);var Ae,ie=0;for(W=0;W<q.length;W++){Ae=(this.words[W+Q]|0)+ie;var fe=(q.words[W]|0)*J;Ae-=fe&67108863,ie=(Ae>>26)-(fe/67108864|0),this.words[W+Q]=Ae&67108863}for(;W<this.length-Q;W++)Ae=(this.words[W+Q]|0)+ie,ie=Ae>>26,this.words[W+Q]=Ae&67108863;if(ie===0)return this.strip();for(h(ie===-1),ie=0,W=0;W<this.length;W++)Ae=-(this.words[W]|0)+ie,ie=Ae>>26,this.words[W]=Ae&67108863;return this.negative=1,this.strip()},I.prototype._wordDiv=function(q,J){var Q=this.length-q.length,L=this.clone(),W=q,Ae=W.words[W.length-1]|0,ie=this._countBits(Ae);Q=26-ie,Q!==0&&(W=W.ushln(Q),L.iushln(Q),Ae=W.words[W.length-1]|0);var fe=L.length-W.length,z;if(J!=="mod"){z=new I(null),z.length=fe+1,z.words=new Array(z.length);for(var G=0;G<z.length;G++)z.words[G]=0}var T=L.clone()._ishlnsubmul(W,1,fe);T.negative===0&&(L=T,z&&(z.words[fe]=1));for(var Be=fe-1;Be>=0;Be--){var Te=(L.words[W.length+Be]|0)*67108864+(L.words[W.length+Be-1]|0);for(Te=Math.min(Te/Ae|0,67108863),L._ishlnsubmul(W,Te,Be);L.negative!==0;)Te--,L.negative=0,L._ishlnsubmul(W,1,Be),L.isZero()||(L.negative^=1);z&&(z.words[Be]=Te)}return z&&z.strip(),L.strip(),J!=="div"&&Q!==0&&L.iushrn(Q),{div:z||null,mod:L}},I.prototype.divmod=function(q,J,Q){if(h(!q.isZero()),this.isZero())return{div:new I(0),mod:new I(0)};var L,W,Ae;return this.negative!==0&&q.negative===0?(Ae=this.neg().divmod(q,J),J!=="mod"&&(L=Ae.div.neg()),J!=="div"&&(W=Ae.mod.neg(),Q&&W.negative!==0&&W.iadd(q)),{div:L,mod:W}):this.negative===0&&q.negative!==0?(Ae=this.divmod(q.neg(),J),J!=="mod"&&(L=Ae.div.neg()),{div:L,mod:Ae.mod}):(this.negative&q.negative)!==0?(Ae=this.neg().divmod(q.neg(),J),J!=="div"&&(W=Ae.mod.neg(),Q&&W.negative!==0&&W.isub(q)),{div:Ae.div,mod:W}):q.length>this.length||this.cmp(q)<0?{div:new I(0),mod:this}:q.length===1?J==="div"?{div:this.divn(q.words[0]),mod:null}:J==="mod"?{div:null,mod:new I(this.modn(q.words[0]))}:{div:this.divn(q.words[0]),mod:new I(this.modn(q.words[0]))}:this._wordDiv(q,J)},I.prototype.div=function(q){return this.divmod(q,"div",!1).div},I.prototype.mod=function(q){return this.divmod(q,"mod",!1).mod},I.prototype.umod=function(q){return this.divmod(q,"mod",!0).mod},I.prototype.divRound=function(q){var J=this.divmod(q);if(J.mod.isZero())return J.div;var Q=J.div.negative!==0?J.mod.isub(q):J.mod,L=q.ushrn(1),W=q.andln(1),Ae=Q.cmp(L);return Ae<0||W===1&&Ae===0?J.div:J.div.negative!==0?J.div.isubn(1):J.div.iaddn(1)},I.prototype.modn=function(q){h(q<=67108863);for(var J=(1<<26)%q,Q=0,L=this.length-1;L>=0;L--)Q=(J*Q+(this.words[L]|0))%q;return Q},I.prototype.idivn=function(q){h(q<=67108863);for(var J=0,Q=this.length-1;Q>=0;Q--){var L=(this.words[Q]|0)+J*67108864;this.words[Q]=L/q|0,J=L%q}return this.strip()},I.prototype.divn=function(q){return this.clone().idivn(q)},I.prototype.egcd=function(q){h(q.negative===0),h(!q.isZero());var J=this,Q=q.clone();J.negative!==0?J=J.umod(q):J=J.clone();for(var L=new I(1),W=new I(0),Ae=new I(0),ie=new I(1),fe=0;J.isEven()&&Q.isEven();)J.iushrn(1),Q.iushrn(1),++fe;for(var z=Q.clone(),G=J.clone();!J.isZero();){for(var T=0,Be=1;(J.words[0]&Be)===0&&T<26;++T,Be<<=1);if(T>0)for(J.iushrn(T);T-- >0;)(L.isOdd()||W.isOdd())&&(L.iadd(z),W.isub(G)),L.iushrn(1),W.iushrn(1);for(var Te=0,se=1;(Q.words[0]&se)===0&&Te<26;++Te,se<<=1);if(Te>0)for(Q.iushrn(Te);Te-- >0;)(Ae.isOdd()||ie.isOdd())&&(Ae.iadd(z),ie.isub(G)),Ae.iushrn(1),ie.iushrn(1);J.cmp(Q)>=0?(J.isub(Q),L.isub(Ae),W.isub(ie)):(Q.isub(J),Ae.isub(L),ie.isub(W))}return{a:Ae,b:ie,gcd:Q.iushln(fe)}},I.prototype._invmp=function(q){h(q.negative===0),h(!q.isZero());var J=this,Q=q.clone();J.negative!==0?J=J.umod(q):J=J.clone();for(var L=new I(1),W=new I(0),Ae=Q.clone();J.cmpn(1)>0&&Q.cmpn(1)>0;){for(var ie=0,fe=1;(J.words[0]&fe)===0&&ie<26;++ie,fe<<=1);if(ie>0)for(J.iushrn(ie);ie-- >0;)L.isOdd()&&L.iadd(Ae),L.iushrn(1);for(var z=0,G=1;(Q.words[0]&G)===0&&z<26;++z,G<<=1);if(z>0)for(Q.iushrn(z);z-- >0;)W.isOdd()&&W.iadd(Ae),W.iushrn(1);J.cmp(Q)>=0?(J.isub(Q),L.isub(W)):(Q.isub(J),W.isub(L))}var T;return J.cmpn(1)===0?T=L:T=W,T.cmpn(0)<0&&T.iadd(q),T},I.prototype.gcd=function(q){if(this.isZero())return q.abs();if(q.isZero())return this.abs();var J=this.clone(),Q=q.clone();J.negative=0,Q.negative=0;for(var L=0;J.isEven()&&Q.isEven();L++)J.iushrn(1),Q.iushrn(1);do{for(;J.isEven();)J.iushrn(1);for(;Q.isEven();)Q.iushrn(1);var W=J.cmp(Q);if(W<0){var Ae=J;J=Q,Q=Ae}else if(W===0||Q.cmpn(1)===0)break;J.isub(Q)}while(!0);return Q.iushln(L)},I.prototype.invm=function(q){return this.egcd(q).a.umod(q)},I.prototype.isEven=function(){return(this.words[0]&1)===0},I.prototype.isOdd=function(){return(this.words[0]&1)===1},I.prototype.andln=function(q){return this.words[0]&q},I.prototype.bincn=function(q){h(typeof q=="number");var J=q%26,Q=(q-J)/26,L=1<<J;if(this.length<=Q)return this._expand(Q+1),this.words[Q]|=L,this;for(var W=L,Ae=Q;W!==0&&Ae<this.length;Ae++){var ie=this.words[Ae]|0;ie+=W,W=ie>>>26,ie&=67108863,this.words[Ae]=ie}return W!==0&&(this.words[Ae]=W,this.length++),this},I.prototype.isZero=function(){return this.length===1&&this.words[0]===0},I.prototype.cmpn=function(q){var J=q<0;if(this.negative!==0&&!J)return-1;if(this.negative===0&&J)return 1;this.strip();var Q;if(this.length>1)Q=1;else{J&&(q=-q),h(q<=67108863,"Number is too big");var L=this.words[0]|0;Q=L===q?0:L<q?-1:1}return this.negative!==0?-Q|0:Q},I.prototype.cmp=function(q){if(this.negative!==0&&q.negative===0)return-1;if(this.negative===0&&q.negative!==0)return 1;var J=this.ucmp(q);return this.negative!==0?-J|0:J},I.prototype.ucmp=function(q){if(this.length>q.length)return 1;if(this.length<q.length)return-1;for(var J=0,Q=this.length-1;Q>=0;Q--){var L=this.words[Q]|0,W=q.words[Q]|0;if(L!==W){L<W?J=-1:L>W&&(J=1);break}}return J},I.prototype.gtn=function(q){return this.cmpn(q)===1},I.prototype.gt=function(q){return this.cmp(q)===1},I.prototype.gten=function(q){return this.cmpn(q)>=0},I.prototype.gte=function(q){return this.cmp(q)>=0},I.prototype.ltn=function(q){return this.cmpn(q)===-1},I.prototype.lt=function(q){return this.cmp(q)===-1},I.prototype.lten=function(q){return this.cmpn(q)<=0},I.prototype.lte=function(q){return this.cmp(q)<=0},I.prototype.eqn=function(q){return this.cmpn(q)===0},I.prototype.eq=function(q){return this.cmp(q)===0},I.red=function(q){return new he(q)},I.prototype.toRed=function(q){return h(!this.red,"Already a number in reduction context"),h(this.negative===0,"red works only with positives"),q.convertTo(this)._forceRed(q)},I.prototype.fromRed=function(){return h(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},I.prototype._forceRed=function(q){return this.red=q,this},I.prototype.forceRed=function(q){return h(!this.red,"Already a number in reduction context"),this._forceRed(q)},I.prototype.redAdd=function(q){return h(this.red,"redAdd works only with red numbers"),this.red.add(this,q)},I.prototype.redIAdd=function(q){return h(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,q)},I.prototype.redSub=function(q){return h(this.red,"redSub works only with red numbers"),this.red.sub(this,q)},I.prototype.redISub=function(q){return h(this.red,"redISub works only with red numbers"),this.red.isub(this,q)},I.prototype.redShl=function(q){return h(this.red,"redShl works only with red numbers"),this.red.shl(this,q)},I.prototype.redMul=function(q){return h(this.red,"redMul works only with red numbers"),this.red._verify2(this,q),this.red.mul(this,q)},I.prototype.redIMul=function(q){return h(this.red,"redMul works only with red numbers"),this.red._verify2(this,q),this.red.imul(this,q)},I.prototype.redSqr=function(){return h(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},I.prototype.redISqr=function(){return h(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},I.prototype.redSqrt=function(){return h(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},I.prototype.redInvm=function(){return h(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},I.prototype.redNeg=function(){return h(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},I.prototype.redPow=function(q){return h(this.red&&!q.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,q)};var te={k256:null,p224:null,p192:null,p25519:null};function r0(He,q){this.name=He,this.p=new I(q,16),this.n=this.p.bitLength(),this.k=new I(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}r0.prototype._tmp=function(){var q=new I(null);return q.words=new Array(Math.ceil(this.n/13)),q},r0.prototype.ireduce=function(q){var J=q,Q;do this.split(J,this.tmp),J=this.imulK(J),J=J.iadd(this.tmp),Q=J.bitLength();while(Q>this.n);var L=Q<this.n?-1:J.ucmp(this.p);return L===0?(J.words[0]=0,J.length=1):L>0?J.isub(this.p):J.strip!==void 0?J.strip():J._strip(),J},r0.prototype.split=function(q,J){q.iushrn(this.n,0,J)},r0.prototype.imulK=function(q){return q.imul(this.k)};function ve(){r0.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}b(ve,r0),ve.prototype.split=function(q,J){for(var Q=4194303,L=Math.min(q.length,9),W=0;W<L;W++)J.words[W]=q.words[W];if(J.length=L,q.length<=9){q.words[0]=0,q.length=1;return}var Ae=q.words[9];for(J.words[J.length++]=Ae&Q,W=10;W<q.length;W++){var ie=q.words[W]|0;q.words[W-10]=(ie&Q)<<4|Ae>>>22,Ae=ie}Ae>>>=22,q.words[W-10]=Ae,Ae===0&&q.length>10?q.length-=10:q.length-=9},ve.prototype.imulK=function(q){q.words[q.length]=0,q.words[q.length+1]=0,q.length+=2;for(var J=0,Q=0;Q<q.length;Q++){var L=q.words[Q]|0;J+=L*977,q.words[Q]=J&67108863,J=L*64+(J/67108864|0)}return q.words[q.length-1]===0&&(q.length--,q.words[q.length-1]===0&&q.length--),q};function Ne(){r0.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}b(Ne,r0);function ye(){r0.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}b(ye,r0);function Xe(){r0.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}b(Xe,r0),Xe.prototype.imulK=function(q){for(var J=0,Q=0;Q<q.length;Q++){var L=(q.words[Q]|0)*19+J,W=L&67108863;L>>>=26,q.words[Q]=W,J=L}return J!==0&&(q.words[q.length++]=J),q},I._prime=function(q){if(te[q])return te[q];var J;if(q==="k256")J=new ve;else if(q==="p224")J=new Ne;else if(q==="p192")J=new ye;else if(q==="p25519")J=new Xe;else throw new Error("Unknown prime "+q);return te[q]=J,J};function he(He){if(typeof He=="string"){var q=I._prime(He);this.m=q.p,this.prime=q}else h(He.gtn(1),"modulus must be greater than 1"),this.m=He,this.prime=null}he.prototype._verify1=function(q){h(q.negative===0,"red works only with positives"),h(q.red,"red works only with red numbers")},he.prototype._verify2=function(q,J){h((q.negative|J.negative)===0,"red works only with positives"),h(q.red&&q.red===J.red,"red works only with red numbers")},he.prototype.imod=function(q){return this.prime?this.prime.ireduce(q)._forceRed(this):q.umod(this.m)._forceRed(this)},he.prototype.neg=function(q){return q.isZero()?q.clone():this.m.sub(q)._forceRed(this)},he.prototype.add=function(q,J){this._verify2(q,J);var Q=q.add(J);return Q.cmp(this.m)>=0&&Q.isub(this.m),Q._forceRed(this)},he.prototype.iadd=function(q,J){this._verify2(q,J);var Q=q.iadd(J);return Q.cmp(this.m)>=0&&Q.isub(this.m),Q},he.prototype.sub=function(q,J){this._verify2(q,J);var Q=q.sub(J);return Q.cmpn(0)<0&&Q.iadd(this.m),Q._forceRed(this)},he.prototype.isub=function(q,J){this._verify2(q,J);var Q=q.isub(J);return Q.cmpn(0)<0&&Q.iadd(this.m),Q},he.prototype.shl=function(q,J){return this._verify1(q),this.imod(q.ushln(J))},he.prototype.imul=function(q,J){return this._verify2(q,J),this.imod(q.imul(J))},he.prototype.mul=function(q,J){return this._verify2(q,J),this.imod(q.mul(J))},he.prototype.isqr=function(q){return this.imul(q,q.clone())},he.prototype.sqr=function(q){return this.mul(q,q)},he.prototype.sqrt=function(q){if(q.isZero())return q.clone();var J=this.m.andln(3);if(h(J%2===1),J===3){var Q=this.m.add(new I(1)).iushrn(2);return this.pow(q,Q)}for(var L=this.m.subn(1),W=0;!L.isZero()&&L.andln(1)===0;)W++,L.iushrn(1);h(!L.isZero());var Ae=new I(1).toRed(this),ie=Ae.redNeg(),fe=this.m.subn(1).iushrn(1),z=this.m.bitLength();for(z=new I(2*z*z).toRed(this);this.pow(z,fe).cmp(ie)!==0;)z.redIAdd(ie);for(var G=this.pow(z,L),T=this.pow(q,L.addn(1).iushrn(1)),Be=this.pow(q,L),Te=W;Be.cmp(Ae)!==0;){for(var se=Be,ze=0;se.cmp(Ae)!==0;ze++)se=se.redSqr();h(ze<Te);var s0=this.pow(G,new I(1).iushln(Te-ze-1));T=T.redMul(s0),G=s0.redSqr(),Be=Be.redMul(G),Te=ze}return T},he.prototype.invm=function(q){var J=q._invmp(this.m);return J.negative!==0?(J.negative=0,this.imod(J).redNeg()):this.imod(J)},he.prototype.pow=function(q,J){if(J.isZero())return new I(1).toRed(this);if(J.cmpn(1)===0)return q.clone();var Q=4,L=new Array(1<<Q);L[0]=new I(1).toRed(this),L[1]=q;for(var W=2;W<L.length;W++)L[W]=this.mul(L[W-1],q);var Ae=L[0],ie=0,fe=0,z=J.bitLength()%26;for(z===0&&(z=26),W=J.length-1;W>=0;W--){for(var G=J.words[W],T=z-1;T>=0;T--){var Be=G>>T&1;if(Ae!==L[0]&&(Ae=this.sqr(Ae)),Be===0&&ie===0){fe=0;continue}ie<<=1,ie|=Be,fe++,!(fe!==Q&&(W!==0||T!==0))&&(Ae=this.mul(Ae,L[ie]),fe=0,ie=0)}z=26}return Ae},he.prototype.convertTo=function(q){var J=q.umod(this.m);return J===q?J.clone():J},he.prototype.convertFrom=function(q){var J=q.clone();return J.red=null,J},I.mont=function(q){return new v0(q)};function v0(He){he.call(this,He),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new I(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b(v0,he),v0.prototype.convertTo=function(q){return this.imod(q.ushln(this.shift))},v0.prototype.convertFrom=function(q){var J=this.imod(q.mul(this.rinv));return J.red=null,J},v0.prototype.imul=function(q,J){if(q.isZero()||J.isZero())return q.words[0]=0,q.length=1,q;var Q=q.imul(J),L=Q.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),W=Q.isub(L).iushrn(this.shift),Ae=W;return W.cmp(this.m)>=0?Ae=W.isub(this.m):W.cmpn(0)<0&&(Ae=W.iadd(this.m)),Ae._forceRed(this)},v0.prototype.mul=function(q,J){if(q.isZero()||J.isZero())return new I(0)._forceRed(this);var Q=q.mul(J),L=Q.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),W=Q.isub(L).iushrn(this.shift),Ae=W;return W.cmp(this.m)>=0?Ae=W.isub(this.m):W.cmpn(0)<0&&(Ae=W.iadd(this.m)),Ae._forceRed(this)},v0.prototype.invm=function(q){var J=this.imod(q._invmp(this.m).mul(this.r2));return J._forceRed(this)}})(f,Ew)}(r1)),r1.exports}var ih={},op;function Ly(){return op||(op=1,function(f){var o=f;function c(I,y){if(Array.isArray(I))return I.slice();if(!I)return[];var S=[];if(typeof I!="string"){for(var k=0;k<I.length;k++)S[k]=I[k]|0;return S}if(y==="hex"){I=I.replace(/[^a-z0-9]+/ig,""),I.length%2!==0&&(I="0"+I);for(var k=0;k<I.length;k+=2)S.push(parseInt(I[k]+I[k+1],16))}else for(var k=0;k<I.length;k++){var N=I.charCodeAt(k),R=N>>8,B=N&255;R?S.push(R,B):S.push(B)}return S}o.toArray=c;function h(I){return I.length===1?"0"+I:I}o.zero2=h;function b(I){for(var y="",S=0;S<I.length;S++)y+=h(I[S].toString(16));return y}o.toHex=b,o.encode=function(y,S){return S==="hex"?b(y):y}}(ih)),ih}var sp;function Ei(){return sp||(sp=1,function(f){var o=f,c=Oa(),h=C2(),b=Ly();o.assert=h,o.toArray=b.toArray,o.zero2=b.zero2,o.toHex=b.toHex,o.encode=b.encode;function I(R,B,oe){var Ee=new Array(Math.max(R.bitLength(),oe)+1),pe;for(pe=0;pe<Ee.length;pe+=1)Ee[pe]=0;var V=1<<B+1,Ie=R.clone();for(pe=0;pe<Ee.length;pe++){var Ce,_e=Ie.andln(V-1);Ie.isOdd()?(_e>(V>>1)-1?Ce=(V>>1)-_e:Ce=_e,Ie.isubn(Ce)):Ce=0,Ee[pe]=Ce,Ie.iushrn(1)}return Ee}o.getNAF=I;function y(R,B){var oe=[[],[]];R=R.clone(),B=B.clone();for(var Ee=0,pe=0,V;R.cmpn(-Ee)>0||B.cmpn(-pe)>0;){var Ie=R.andln(3)+Ee&3,Ce=B.andln(3)+pe&3;Ie===3&&(Ie=-1),Ce===3&&(Ce=-1);var _e;(Ie&1)===0?_e=0:(V=R.andln(7)+Ee&7,(V===3||V===5)&&Ce===2?_e=-Ie:_e=Ie),oe[0].push(_e);var te;(Ce&1)===0?te=0:(V=B.andln(7)+pe&7,(V===3||V===5)&&Ie===2?te=-Ce:te=Ce),oe[1].push(te),2*Ee===_e+1&&(Ee=1-Ee),2*pe===te+1&&(pe=1-pe),R.iushrn(1),B.iushrn(1)}return oe}o.getJSF=y;function S(R,B,oe){var Ee="_"+B;R.prototype[B]=function(){return this[Ee]!==void 0?this[Ee]:this[Ee]=oe.call(this)}}o.cachedProperty=S;function k(R){return typeof R=="string"?o.toArray(R,"hex"):R}o.parseBytes=k;function N(R){return new c(R,"hex","le")}o.intFromLE=N}(Ah)),Ah}var Oc={exports:{}},fp;function Ty(){if(fp)return Oc.exports;fp=1;var f;Oc.exports=function(b){return f||(f=new o(null)),f.generate(b)};function o(h){this.rand=h}if(Oc.exports.Rand=o,o.prototype.generate=function(b){return this._rand(b)},o.prototype._rand=function(b){if(this.rand.getBytes)return this.rand.getBytes(b);for(var I=new Uint8Array(b),y=0;y<I.length;y++)I[y]=this.rand.getByte();return I},typeof self=="object")self.crypto&&self.crypto.getRandomValues?o.prototype._rand=function(b){var I=new Uint8Array(b);return self.crypto.getRandomValues(I),I}:self.msCrypto&&self.msCrypto.getRandomValues?o.prototype._rand=function(b){var I=new Uint8Array(b);return self.msCrypto.getRandomValues(I),I}:typeof window=="object"&&(o.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var c=Ra;if(typeof c.randomBytes!="function")throw new Error("Not supported");o.prototype._rand=function(b){return c.randomBytes(b)}}catch{}return Oc.exports}var ah={},oh,cp;function ru(){if(cp)return oh;cp=1;var f=Oa(),o=Ei(),c=o.getNAF,h=o.getJSF,b=o.assert;function I(S,k){this.type=S,this.p=new f(k.p,16),this.red=k.prime?f.red(k.prime):f.mont(this.p),this.zero=new f(0).toRed(this.red),this.one=new f(1).toRed(this.red),this.two=new f(2).toRed(this.red),this.n=k.n&&new f(k.n,16),this.g=k.g&&this.pointFromJSON(k.g,k.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var N=this.n&&this.p.div(this.n);!N||N.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}oh=I,I.prototype.point=function(){throw new Error("Not implemented")},I.prototype.validate=function(){throw new Error("Not implemented")},I.prototype._fixedNafMul=function(k,N){b(k.precomputed);var R=k._getDoubles(),B=c(N,1,this._bitLength),oe=(1<<R.step+1)-(R.step%2===0?2:1);oe/=3;var Ee=[],pe,V;for(pe=0;pe<B.length;pe+=R.step){V=0;for(var Ie=pe+R.step-1;Ie>=pe;Ie--)V=(V<<1)+B[Ie];Ee.push(V)}for(var Ce=this.jpoint(null,null,null),_e=this.jpoint(null,null,null),te=oe;te>0;te--){for(pe=0;pe<Ee.length;pe++)V=Ee[pe],V===te?_e=_e.mixedAdd(R.points[pe]):V===-te&&(_e=_e.mixedAdd(R.points[pe].neg()));Ce=Ce.add(_e)}return Ce.toP()},I.prototype._wnafMul=function(k,N){var R=4,B=k._getNAFPoints(R);R=B.wnd;for(var oe=B.points,Ee=c(N,R,this._bitLength),pe=this.jpoint(null,null,null),V=Ee.length-1;V>=0;V--){for(var Ie=0;V>=0&&Ee[V]===0;V--)Ie++;if(V>=0&&Ie++,pe=pe.dblp(Ie),V<0)break;var Ce=Ee[V];b(Ce!==0),k.type==="affine"?Ce>0?pe=pe.mixedAdd(oe[Ce-1>>1]):pe=pe.mixedAdd(oe[-Ce-1>>1].neg()):Ce>0?pe=pe.add(oe[Ce-1>>1]):pe=pe.add(oe[-Ce-1>>1].neg())}return k.type==="affine"?pe.toP():pe},I.prototype._wnafMulAdd=function(k,N,R,B,oe){var Ee=this._wnafT1,pe=this._wnafT2,V=this._wnafT3,Ie=0,Ce,_e,te;for(Ce=0;Ce<B;Ce++){te=N[Ce];var r0=te._getNAFPoints(k);Ee[Ce]=r0.wnd,pe[Ce]=r0.points}for(Ce=B-1;Ce>=1;Ce-=2){var ve=Ce-1,Ne=Ce;if(Ee[ve]!==1||Ee[Ne]!==1){V[ve]=c(R[ve],Ee[ve],this._bitLength),V[Ne]=c(R[Ne],Ee[Ne],this._bitLength),Ie=Math.max(V[ve].length,Ie),Ie=Math.max(V[Ne].length,Ie);continue}var ye=[N[ve],null,null,N[Ne]];N[ve].y.cmp(N[Ne].y)===0?(ye[1]=N[ve].add(N[Ne]),ye[2]=N[ve].toJ().mixedAdd(N[Ne].neg())):N[ve].y.cmp(N[Ne].y.redNeg())===0?(ye[1]=N[ve].toJ().mixedAdd(N[Ne]),ye[2]=N[ve].add(N[Ne].neg())):(ye[1]=N[ve].toJ().mixedAdd(N[Ne]),ye[2]=N[ve].toJ().mixedAdd(N[Ne].neg()));var Xe=[-3,-1,-5,-7,0,7,5,1,3],he=h(R[ve],R[Ne]);for(Ie=Math.max(he[0].length,Ie),V[ve]=new Array(Ie),V[Ne]=new Array(Ie),_e=0;_e<Ie;_e++){var v0=he[0][_e]|0,He=he[1][_e]|0;V[ve][_e]=Xe[(v0+1)*3+(He+1)],V[Ne][_e]=0,pe[ve]=ye}}var q=this.jpoint(null,null,null),J=this._wnafT4;for(Ce=Ie;Ce>=0;Ce--){for(var Q=0;Ce>=0;){var L=!0;for(_e=0;_e<B;_e++)J[_e]=V[_e][Ce]|0,J[_e]!==0&&(L=!1);if(!L)break;Q++,Ce--}if(Ce>=0&&Q++,q=q.dblp(Q),Ce<0)break;for(_e=0;_e<B;_e++){var W=J[_e];W!==0&&(W>0?te=pe[_e][W-1>>1]:W<0&&(te=pe[_e][-W-1>>1].neg()),te.type==="affine"?q=q.mixedAdd(te):q=q.add(te))}}for(Ce=0;Ce<B;Ce++)pe[Ce]=null;return oe?q:q.toP()};function y(S,k){this.curve=S,this.type=k,this.precomputed=null}return I.BasePoint=y,y.prototype.eq=function(){throw new Error("Not implemented")},y.prototype.validate=function(){return this.curve.validate(this)},I.prototype.decodePoint=function(k,N){k=o.toArray(k,N);var R=this.p.byteLength();if((k[0]===4||k[0]===6||k[0]===7)&&k.length-1===2*R){k[0]===6?b(k[k.length-1]%2===0):k[0]===7&&b(k[k.length-1]%2===1);var B=this.point(k.slice(1,1+R),k.slice(1+R,1+2*R));return B}else if((k[0]===2||k[0]===3)&&k.length-1===R)return this.pointFromX(k.slice(1,1+R),k[0]===3);throw new Error("Unknown point format")},y.prototype.encodeCompressed=function(k){return this.encode(k,!0)},y.prototype._encode=function(k){var N=this.curve.p.byteLength(),R=this.getX().toArray("be",N);return k?[this.getY().isEven()?2:3].concat(R):[4].concat(R,this.getY().toArray("be",N))},y.prototype.encode=function(k,N){return o.encode(this._encode(N),k)},y.prototype.precompute=function(k){if(this.precomputed)return this;var N={doubles:null,naf:null,beta:null};return N.naf=this._getNAFPoints(8),N.doubles=this._getDoubles(4,k),N.beta=this._getBeta(),this.precomputed=N,this},y.prototype._hasDoubles=function(k){if(!this.precomputed)return!1;var N=this.precomputed.doubles;return N?N.points.length>=Math.ceil((k.bitLength()+1)/N.step):!1},y.prototype._getDoubles=function(k,N){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var R=[this],B=this,oe=0;oe<N;oe+=k){for(var Ee=0;Ee<k;Ee++)B=B.dbl();R.push(B)}return{step:k,points:R}},y.prototype._getNAFPoints=function(k){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var N=[this],R=(1<<k)-1,B=R===1?null:this.dbl(),oe=1;oe<R;oe++)N[oe]=N[oe-1].add(B);return{wnd:k,points:N}},y.prototype._getBeta=function(){return null},y.prototype.dblp=function(k){for(var N=this,R=0;R<k;R++)N=N.dbl();return N},oh}var sh,up;function _w(){if(up)return sh;up=1;var f=Ei(),o=Oa(),c=Z1(),h=ru(),b=f.assert;function I(k){h.call(this,"short",k),this.a=new o(k.a,16).toRed(this.red),this.b=new o(k.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(k),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}c(I,h),sh=I,I.prototype._getEndomorphism=function(N){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var R,B;if(N.beta)R=new o(N.beta,16).toRed(this.red);else{var oe=this._getEndoRoots(this.p);R=oe[0].cmp(oe[1])<0?oe[0]:oe[1],R=R.toRed(this.red)}if(N.lambda)B=new o(N.lambda,16);else{var Ee=this._getEndoRoots(this.n);this.g.mul(Ee[0]).x.cmp(this.g.x.redMul(R))===0?B=Ee[0]:(B=Ee[1],b(this.g.mul(B).x.cmp(this.g.x.redMul(R))===0))}var pe;return N.basis?pe=N.basis.map(function(V){return{a:new o(V.a,16),b:new o(V.b,16)}}):pe=this._getEndoBasis(B),{beta:R,lambda:B,basis:pe}}},I.prototype._getEndoRoots=function(N){var R=N===this.p?this.red:o.mont(N),B=new o(2).toRed(R).redInvm(),oe=B.redNeg(),Ee=new o(3).toRed(R).redNeg().redSqrt().redMul(B),pe=oe.redAdd(Ee).fromRed(),V=oe.redSub(Ee).fromRed();return[pe,V]},I.prototype._getEndoBasis=function(N){for(var R=this.n.ushrn(Math.floor(this.n.bitLength()/2)),B=N,oe=this.n.clone(),Ee=new o(1),pe=new o(0),V=new o(0),Ie=new o(1),Ce,_e,te,r0,ve,Ne,ye,Xe=0,he,v0;B.cmpn(0)!==0;){var He=oe.div(B);he=oe.sub(He.mul(B)),v0=V.sub(He.mul(Ee));var q=Ie.sub(He.mul(pe));if(!te&&he.cmp(R)<0)Ce=ye.neg(),_e=Ee,te=he.neg(),r0=v0;else if(te&&++Xe===2)break;ye=he,oe=B,B=he,V=Ee,Ee=v0,Ie=pe,pe=q}ve=he.neg(),Ne=v0;var J=te.sqr().add(r0.sqr()),Q=ve.sqr().add(Ne.sqr());return Q.cmp(J)>=0&&(ve=Ce,Ne=_e),te.negative&&(te=te.neg(),r0=r0.neg()),ve.negative&&(ve=ve.neg(),Ne=Ne.neg()),[{a:te,b:r0},{a:ve,b:Ne}]},I.prototype._endoSplit=function(N){var R=this.endo.basis,B=R[0],oe=R[1],Ee=oe.b.mul(N).divRound(this.n),pe=B.b.neg().mul(N).divRound(this.n),V=Ee.mul(B.a),Ie=pe.mul(oe.a),Ce=Ee.mul(B.b),_e=pe.mul(oe.b),te=N.sub(V).sub(Ie),r0=Ce.add(_e).neg();return{k1:te,k2:r0}},I.prototype.pointFromX=function(N,R){N=new o(N,16),N.red||(N=N.toRed(this.red));var B=N.redSqr().redMul(N).redIAdd(N.redMul(this.a)).redIAdd(this.b),oe=B.redSqrt();if(oe.redSqr().redSub(B).cmp(this.zero)!==0)throw new Error("invalid point");var Ee=oe.fromRed().isOdd();return(R&&!Ee||!R&&Ee)&&(oe=oe.redNeg()),this.point(N,oe)},I.prototype.validate=function(N){if(N.inf)return!0;var R=N.x,B=N.y,oe=this.a.redMul(R),Ee=R.redSqr().redMul(R).redIAdd(oe).redIAdd(this.b);return B.redSqr().redISub(Ee).cmpn(0)===0},I.prototype._endoWnafMulAdd=function(N,R,B){for(var oe=this._endoWnafT1,Ee=this._endoWnafT2,pe=0;pe<N.length;pe++){var V=this._endoSplit(R[pe]),Ie=N[pe],Ce=Ie._getBeta();V.k1.negative&&(V.k1.ineg(),Ie=Ie.neg(!0)),V.k2.negative&&(V.k2.ineg(),Ce=Ce.neg(!0)),oe[pe*2]=Ie,oe[pe*2+1]=Ce,Ee[pe*2]=V.k1,Ee[pe*2+1]=V.k2}for(var _e=this._wnafMulAdd(1,oe,Ee,pe*2,B),te=0;te<pe*2;te++)oe[te]=null,Ee[te]=null;return _e};function y(k,N,R,B){h.BasePoint.call(this,k,"affine"),N===null&&R===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new o(N,16),this.y=new o(R,16),B&&(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)}c(y,h.BasePoint),I.prototype.point=function(N,R,B){return new y(this,N,R,B)},I.prototype.pointFromJSON=function(N,R){return y.fromJSON(this,N,R)},y.prototype._getBeta=function(){if(this.curve.endo){var N=this.precomputed;if(N&&N.beta)return N.beta;var R=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(N){var B=this.curve,oe=function(Ee){return B.point(Ee.x.redMul(B.endo.beta),Ee.y)};N.beta=R,R.precomputed={beta:null,naf:N.naf&&{wnd:N.naf.wnd,points:N.naf.points.map(oe)},doubles:N.doubles&&{step:N.doubles.step,points:N.doubles.points.map(oe)}}}return R}},y.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]},y.fromJSON=function(N,R,B){typeof R=="string"&&(R=JSON.parse(R));var oe=N.point(R[0],R[1],B);if(!R[2])return oe;function Ee(V){return N.point(V[0],V[1],B)}var pe=R[2];return oe.precomputed={beta:null,doubles:pe.doubles&&{step:pe.doubles.step,points:[oe].concat(pe.doubles.points.map(Ee))},naf:pe.naf&&{wnd:pe.naf.wnd,points:[oe].concat(pe.naf.points.map(Ee))}},oe},y.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)+">"},y.prototype.isInfinity=function(){return this.inf},y.prototype.add=function(N){if(this.inf)return N;if(N.inf)return this;if(this.eq(N))return this.dbl();if(this.neg().eq(N))return this.curve.point(null,null);if(this.x.cmp(N.x)===0)return this.curve.point(null,null);var R=this.y.redSub(N.y);R.cmpn(0)!==0&&(R=R.redMul(this.x.redSub(N.x).redInvm()));var B=R.redSqr().redISub(this.x).redISub(N.x),oe=R.redMul(this.x.redSub(B)).redISub(this.y);return this.curve.point(B,oe)},y.prototype.dbl=function(){if(this.inf)return this;var N=this.y.redAdd(this.y);if(N.cmpn(0)===0)return this.curve.point(null,null);var R=this.curve.a,B=this.x.redSqr(),oe=N.redInvm(),Ee=B.redAdd(B).redIAdd(B).redIAdd(R).redMul(oe),pe=Ee.redSqr().redISub(this.x.redAdd(this.x)),V=Ee.redMul(this.x.redSub(pe)).redISub(this.y);return this.curve.point(pe,V)},y.prototype.getX=function(){return this.x.fromRed()},y.prototype.getY=function(){return this.y.fromRed()},y.prototype.mul=function(N){return N=new o(N,16),this.isInfinity()?this:this._hasDoubles(N)?this.curve._fixedNafMul(this,N):this.curve.endo?this.curve._endoWnafMulAdd([this],[N]):this.curve._wnafMul(this,N)},y.prototype.mulAdd=function(N,R,B){var oe=[this,R],Ee=[N,B];return this.curve.endo?this.curve._endoWnafMulAdd(oe,Ee):this.curve._wnafMulAdd(1,oe,Ee,2)},y.prototype.jmulAdd=function(N,R,B){var oe=[this,R],Ee=[N,B];return this.curve.endo?this.curve._endoWnafMulAdd(oe,Ee,!0):this.curve._wnafMulAdd(1,oe,Ee,2,!0)},y.prototype.eq=function(N){return this===N||this.inf===N.inf&&(this.inf||this.x.cmp(N.x)===0&&this.y.cmp(N.y)===0)},y.prototype.neg=function(N){if(this.inf)return this;var R=this.curve.point(this.x,this.y.redNeg());if(N&&this.precomputed){var B=this.precomputed,oe=function(Ee){return Ee.neg()};R.precomputed={naf:B.naf&&{wnd:B.naf.wnd,points:B.naf.points.map(oe)},doubles:B.doubles&&{step:B.doubles.step,points:B.doubles.points.map(oe)}}}return R},y.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var N=this.curve.jpoint(this.x,this.y,this.curve.one);return N};function S(k,N,R,B){h.BasePoint.call(this,k,"jacobian"),N===null&&R===null&&B===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new o(0)):(this.x=new o(N,16),this.y=new o(R,16),this.z=new o(B,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}return c(S,h.BasePoint),I.prototype.jpoint=function(N,R,B){return new S(this,N,R,B)},S.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var N=this.z.redInvm(),R=N.redSqr(),B=this.x.redMul(R),oe=this.y.redMul(R).redMul(N);return this.curve.point(B,oe)},S.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},S.prototype.add=function(N){if(this.isInfinity())return N;if(N.isInfinity())return this;var R=N.z.redSqr(),B=this.z.redSqr(),oe=this.x.redMul(R),Ee=N.x.redMul(B),pe=this.y.redMul(R.redMul(N.z)),V=N.y.redMul(B.redMul(this.z)),Ie=oe.redSub(Ee),Ce=pe.redSub(V);if(Ie.cmpn(0)===0)return Ce.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var _e=Ie.redSqr(),te=_e.redMul(Ie),r0=oe.redMul(_e),ve=Ce.redSqr().redIAdd(te).redISub(r0).redISub(r0),Ne=Ce.redMul(r0.redISub(ve)).redISub(pe.redMul(te)),ye=this.z.redMul(N.z).redMul(Ie);return this.curve.jpoint(ve,Ne,ye)},S.prototype.mixedAdd=function(N){if(this.isInfinity())return N.toJ();if(N.isInfinity())return this;var R=this.z.redSqr(),B=this.x,oe=N.x.redMul(R),Ee=this.y,pe=N.y.redMul(R).redMul(this.z),V=B.redSub(oe),Ie=Ee.redSub(pe);if(V.cmpn(0)===0)return Ie.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var Ce=V.redSqr(),_e=Ce.redMul(V),te=B.redMul(Ce),r0=Ie.redSqr().redIAdd(_e).redISub(te).redISub(te),ve=Ie.redMul(te.redISub(r0)).redISub(Ee.redMul(_e)),Ne=this.z.redMul(V);return this.curve.jpoint(r0,ve,Ne)},S.prototype.dblp=function(N){if(N===0)return this;if(this.isInfinity())return this;if(!N)return this.dbl();var R;if(this.curve.zeroA||this.curve.threeA){var B=this;for(R=0;R<N;R++)B=B.dbl();return B}var oe=this.curve.a,Ee=this.curve.tinv,pe=this.x,V=this.y,Ie=this.z,Ce=Ie.redSqr().redSqr(),_e=V.redAdd(V);for(R=0;R<N;R++){var te=pe.redSqr(),r0=_e.redSqr(),ve=r0.redSqr(),Ne=te.redAdd(te).redIAdd(te).redIAdd(oe.redMul(Ce)),ye=pe.redMul(r0),Xe=Ne.redSqr().redISub(ye.redAdd(ye)),he=ye.redISub(Xe),v0=Ne.redMul(he);v0=v0.redIAdd(v0).redISub(ve);var He=_e.redMul(Ie);R+1<N&&(Ce=Ce.redMul(ve)),pe=Xe,Ie=He,_e=v0}return this.curve.jpoint(pe,_e.redMul(Ee),Ie)},S.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},S.prototype._zeroDbl=function(){var N,R,B;if(this.zOne){var oe=this.x.redSqr(),Ee=this.y.redSqr(),pe=Ee.redSqr(),V=this.x.redAdd(Ee).redSqr().redISub(oe).redISub(pe);V=V.redIAdd(V);var Ie=oe.redAdd(oe).redIAdd(oe),Ce=Ie.redSqr().redISub(V).redISub(V),_e=pe.redIAdd(pe);_e=_e.redIAdd(_e),_e=_e.redIAdd(_e),N=Ce,R=Ie.redMul(V.redISub(Ce)).redISub(_e),B=this.y.redAdd(this.y)}else{var te=this.x.redSqr(),r0=this.y.redSqr(),ve=r0.redSqr(),Ne=this.x.redAdd(r0).redSqr().redISub(te).redISub(ve);Ne=Ne.redIAdd(Ne);var ye=te.redAdd(te).redIAdd(te),Xe=ye.redSqr(),he=ve.redIAdd(ve);he=he.redIAdd(he),he=he.redIAdd(he),N=Xe.redISub(Ne).redISub(Ne),R=ye.redMul(Ne.redISub(N)).redISub(he),B=this.y.redMul(this.z),B=B.redIAdd(B)}return this.curve.jpoint(N,R,B)},S.prototype._threeDbl=function(){var N,R,B;if(this.zOne){var oe=this.x.redSqr(),Ee=this.y.redSqr(),pe=Ee.redSqr(),V=this.x.redAdd(Ee).redSqr().redISub(oe).redISub(pe);V=V.redIAdd(V);var Ie=oe.redAdd(oe).redIAdd(oe).redIAdd(this.curve.a),Ce=Ie.redSqr().redISub(V).redISub(V);N=Ce;var _e=pe.redIAdd(pe);_e=_e.redIAdd(_e),_e=_e.redIAdd(_e),R=Ie.redMul(V.redISub(Ce)).redISub(_e),B=this.y.redAdd(this.y)}else{var te=this.z.redSqr(),r0=this.y.redSqr(),ve=this.x.redMul(r0),Ne=this.x.redSub(te).redMul(this.x.redAdd(te));Ne=Ne.redAdd(Ne).redIAdd(Ne);var ye=ve.redIAdd(ve);ye=ye.redIAdd(ye);var Xe=ye.redAdd(ye);N=Ne.redSqr().redISub(Xe),B=this.y.redAdd(this.z).redSqr().redISub(r0).redISub(te);var he=r0.redSqr();he=he.redIAdd(he),he=he.redIAdd(he),he=he.redIAdd(he),R=Ne.redMul(ye.redISub(N)).redISub(he)}return this.curve.jpoint(N,R,B)},S.prototype._dbl=function(){var N=this.curve.a,R=this.x,B=this.y,oe=this.z,Ee=oe.redSqr().redSqr(),pe=R.redSqr(),V=B.redSqr(),Ie=pe.redAdd(pe).redIAdd(pe).redIAdd(N.redMul(Ee)),Ce=R.redAdd(R);Ce=Ce.redIAdd(Ce);var _e=Ce.redMul(V),te=Ie.redSqr().redISub(_e.redAdd(_e)),r0=_e.redISub(te),ve=V.redSqr();ve=ve.redIAdd(ve),ve=ve.redIAdd(ve),ve=ve.redIAdd(ve);var Ne=Ie.redMul(r0).redISub(ve),ye=B.redAdd(B).redMul(oe);return this.curve.jpoint(te,Ne,ye)},S.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var N=this.x.redSqr(),R=this.y.redSqr(),B=this.z.redSqr(),oe=R.redSqr(),Ee=N.redAdd(N).redIAdd(N),pe=Ee.redSqr(),V=this.x.redAdd(R).redSqr().redISub(N).redISub(oe);V=V.redIAdd(V),V=V.redAdd(V).redIAdd(V),V=V.redISub(pe);var Ie=V.redSqr(),Ce=oe.redIAdd(oe);Ce=Ce.redIAdd(Ce),Ce=Ce.redIAdd(Ce),Ce=Ce.redIAdd(Ce);var _e=Ee.redIAdd(V).redSqr().redISub(pe).redISub(Ie).redISub(Ce),te=R.redMul(_e);te=te.redIAdd(te),te=te.redIAdd(te);var r0=this.x.redMul(Ie).redISub(te);r0=r0.redIAdd(r0),r0=r0.redIAdd(r0);var ve=this.y.redMul(_e.redMul(Ce.redISub(_e)).redISub(V.redMul(Ie)));ve=ve.redIAdd(ve),ve=ve.redIAdd(ve),ve=ve.redIAdd(ve);var Ne=this.z.redAdd(V).redSqr().redISub(B).redISub(Ie);return this.curve.jpoint(r0,ve,Ne)},S.prototype.mul=function(N,R){return N=new o(N,R),this.curve._wnafMul(this,N)},S.prototype.eq=function(N){if(N.type==="affine")return this.eq(N.toJ());if(this===N)return!0;var R=this.z.redSqr(),B=N.z.redSqr();if(this.x.redMul(B).redISub(N.x.redMul(R)).cmpn(0)!==0)return!1;var oe=R.redMul(this.z),Ee=B.redMul(N.z);return this.y.redMul(Ee).redISub(N.y.redMul(oe)).cmpn(0)===0},S.prototype.eqXToP=function(N){var R=this.z.redSqr(),B=N.toRed(this.curve.red).redMul(R);if(this.x.cmp(B)===0)return!0;for(var oe=N.clone(),Ee=this.curve.redN.redMul(R);;){if(oe.iadd(this.curve.n),oe.cmp(this.curve.p)>=0)return!1;if(B.redIAdd(Ee),this.x.cmp(B)===0)return!0}},S.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)+">"},S.prototype.isInfinity=function(){return this.z.cmpn(0)===0},sh}var fh,lp;function Bw(){if(lp)return fh;lp=1;var f=Oa(),o=Z1(),c=ru(),h=Ei();function b(y){c.call(this,"mont",y),this.a=new f(y.a,16).toRed(this.red),this.b=new f(y.b,16).toRed(this.red),this.i4=new f(4).toRed(this.red).redInvm(),this.two=new f(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o(b,c),fh=b,b.prototype.validate=function(S){var k=S.normalize().x,N=k.redSqr(),R=N.redMul(k).redAdd(N.redMul(this.a)).redAdd(k),B=R.redSqrt();return B.redSqr().cmp(R)===0};function I(y,S,k){c.BasePoint.call(this,y,"projective"),S===null&&k===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new f(S,16),this.z=new f(k,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return o(I,c.BasePoint),b.prototype.decodePoint=function(S,k){return this.point(h.toArray(S,k),1)},b.prototype.point=function(S,k){return new I(this,S,k)},b.prototype.pointFromJSON=function(S){return I.fromJSON(this,S)},I.prototype.precompute=function(){},I.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},I.fromJSON=function(S,k){return new I(S,k[0],k[1]||S.one)},I.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)+">"},I.prototype.isInfinity=function(){return this.z.cmpn(0)===0},I.prototype.dbl=function(){var S=this.x.redAdd(this.z),k=S.redSqr(),N=this.x.redSub(this.z),R=N.redSqr(),B=k.redSub(R),oe=k.redMul(R),Ee=B.redMul(R.redAdd(this.curve.a24.redMul(B)));return this.curve.point(oe,Ee)},I.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},I.prototype.diffAdd=function(S,k){var N=this.x.redAdd(this.z),R=this.x.redSub(this.z),B=S.x.redAdd(S.z),oe=S.x.redSub(S.z),Ee=oe.redMul(N),pe=B.redMul(R),V=k.z.redMul(Ee.redAdd(pe).redSqr()),Ie=k.x.redMul(Ee.redISub(pe).redSqr());return this.curve.point(V,Ie)},I.prototype.mul=function(S){for(var k=S.clone(),N=this,R=this.curve.point(null,null),B=this,oe=[];k.cmpn(0)!==0;k.iushrn(1))oe.push(k.andln(1));for(var Ee=oe.length-1;Ee>=0;Ee--)oe[Ee]===0?(N=N.diffAdd(R,B),R=R.dbl()):(R=N.diffAdd(R,B),N=N.dbl());return R},I.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},I.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},I.prototype.eq=function(S){return this.getX().cmp(S.getX())===0},I.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},I.prototype.getX=function(){return this.normalize(),this.x.fromRed()},fh}var ch,hp;function ww(){if(hp)return ch;hp=1;var f=Ei(),o=Oa(),c=Z1(),h=ru(),b=f.assert;function I(S){this.twisted=(S.a|0)!==1,this.mOneA=this.twisted&&(S.a|0)===-1,this.extended=this.mOneA,h.call(this,"edwards",S),this.a=new o(S.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new o(S.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new o(S.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),b(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(S.c|0)===1}c(I,h),ch=I,I.prototype._mulA=function(k){return this.mOneA?k.redNeg():this.a.redMul(k)},I.prototype._mulC=function(k){return this.oneC?k:this.c.redMul(k)},I.prototype.jpoint=function(k,N,R,B){return this.point(k,N,R,B)},I.prototype.pointFromX=function(k,N){k=new o(k,16),k.red||(k=k.toRed(this.red));var R=k.redSqr(),B=this.c2.redSub(this.a.redMul(R)),oe=this.one.redSub(this.c2.redMul(this.d).redMul(R)),Ee=B.redMul(oe.redInvm()),pe=Ee.redSqrt();if(pe.redSqr().redSub(Ee).cmp(this.zero)!==0)throw new Error("invalid point");var V=pe.fromRed().isOdd();return(N&&!V||!N&&V)&&(pe=pe.redNeg()),this.point(k,pe)},I.prototype.pointFromY=function(k,N){k=new o(k,16),k.red||(k=k.toRed(this.red));var R=k.redSqr(),B=R.redSub(this.c2),oe=R.redMul(this.d).redMul(this.c2).redSub(this.a),Ee=B.redMul(oe.redInvm());if(Ee.cmp(this.zero)===0){if(N)throw new Error("invalid point");return this.point(this.zero,k)}var pe=Ee.redSqrt();if(pe.redSqr().redSub(Ee).cmp(this.zero)!==0)throw new Error("invalid point");return pe.fromRed().isOdd()!==N&&(pe=pe.redNeg()),this.point(pe,k)},I.prototype.validate=function(k){if(k.isInfinity())return!0;k.normalize();var N=k.x.redSqr(),R=k.y.redSqr(),B=N.redMul(this.a).redAdd(R),oe=this.c2.redMul(this.one.redAdd(this.d.redMul(N).redMul(R)));return B.cmp(oe)===0};function y(S,k,N,R,B){h.BasePoint.call(this,S,"projective"),k===null&&N===null&&R===null?(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 o(k,16),this.y=new o(N,16),this.z=R?new o(R,16):this.curve.one,this.t=B&&new o(B,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()))))}return c(y,h.BasePoint),I.prototype.pointFromJSON=function(k){return y.fromJSON(this,k)},I.prototype.point=function(k,N,R,B){return new y(this,k,N,R,B)},y.fromJSON=function(k,N){return new y(k,N[0],N[1],N[2])},y.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)+">"},y.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},y.prototype._extDbl=function(){var k=this.x.redSqr(),N=this.y.redSqr(),R=this.z.redSqr();R=R.redIAdd(R);var B=this.curve._mulA(k),oe=this.x.redAdd(this.y).redSqr().redISub(k).redISub(N),Ee=B.redAdd(N),pe=Ee.redSub(R),V=B.redSub(N),Ie=oe.redMul(pe),Ce=Ee.redMul(V),_e=oe.redMul(V),te=pe.redMul(Ee);return this.curve.point(Ie,Ce,te,_e)},y.prototype._projDbl=function(){var k=this.x.redAdd(this.y).redSqr(),N=this.x.redSqr(),R=this.y.redSqr(),B,oe,Ee,pe,V,Ie;if(this.curve.twisted){pe=this.curve._mulA(N);var Ce=pe.redAdd(R);this.zOne?(B=k.redSub(N).redSub(R).redMul(Ce.redSub(this.curve.two)),oe=Ce.redMul(pe.redSub(R)),Ee=Ce.redSqr().redSub(Ce).redSub(Ce)):(V=this.z.redSqr(),Ie=Ce.redSub(V).redISub(V),B=k.redSub(N).redISub(R).redMul(Ie),oe=Ce.redMul(pe.redSub(R)),Ee=Ce.redMul(Ie))}else pe=N.redAdd(R),V=this.curve._mulC(this.z).redSqr(),Ie=pe.redSub(V).redSub(V),B=this.curve._mulC(k.redISub(pe)).redMul(Ie),oe=this.curve._mulC(pe).redMul(N.redISub(R)),Ee=pe.redMul(Ie);return this.curve.point(B,oe,Ee)},y.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},y.prototype._extAdd=function(k){var N=this.y.redSub(this.x).redMul(k.y.redSub(k.x)),R=this.y.redAdd(this.x).redMul(k.y.redAdd(k.x)),B=this.t.redMul(this.curve.dd).redMul(k.t),oe=this.z.redMul(k.z.redAdd(k.z)),Ee=R.redSub(N),pe=oe.redSub(B),V=oe.redAdd(B),Ie=R.redAdd(N),Ce=Ee.redMul(pe),_e=V.redMul(Ie),te=Ee.redMul(Ie),r0=pe.redMul(V);return this.curve.point(Ce,_e,r0,te)},y.prototype._projAdd=function(k){var N=this.z.redMul(k.z),R=N.redSqr(),B=this.x.redMul(k.x),oe=this.y.redMul(k.y),Ee=this.curve.d.redMul(B).redMul(oe),pe=R.redSub(Ee),V=R.redAdd(Ee),Ie=this.x.redAdd(this.y).redMul(k.x.redAdd(k.y)).redISub(B).redISub(oe),Ce=N.redMul(pe).redMul(Ie),_e,te;return this.curve.twisted?(_e=N.redMul(V).redMul(oe.redSub(this.curve._mulA(B))),te=pe.redMul(V)):(_e=N.redMul(V).redMul(oe.redSub(B)),te=this.curve._mulC(pe).redMul(V)),this.curve.point(Ce,_e,te)},y.prototype.add=function(k){return this.isInfinity()?k:k.isInfinity()?this:this.curve.extended?this._extAdd(k):this._projAdd(k)},y.prototype.mul=function(k){return this._hasDoubles(k)?this.curve._fixedNafMul(this,k):this.curve._wnafMul(this,k)},y.prototype.mulAdd=function(k,N,R){return this.curve._wnafMulAdd(1,[this,N],[k,R],2,!1)},y.prototype.jmulAdd=function(k,N,R){return this.curve._wnafMulAdd(1,[this,N],[k,R],2,!0)},y.prototype.normalize=function(){if(this.zOne)return this;var k=this.z.redInvm();return this.x=this.x.redMul(k),this.y=this.y.redMul(k),this.t&&(this.t=this.t.redMul(k)),this.z=this.curve.one,this.zOne=!0,this},y.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},y.prototype.getX=function(){return this.normalize(),this.x.fromRed()},y.prototype.getY=function(){return this.normalize(),this.y.fromRed()},y.prototype.eq=function(k){return this===k||this.getX().cmp(k.getX())===0&&this.getY().cmp(k.getY())===0},y.prototype.eqXToP=function(k){var N=k.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(N)===0)return!0;for(var R=k.clone(),B=this.curve.redN.redMul(this.z);;){if(R.iadd(this.curve.n),R.cmp(this.curve.p)>=0)return!1;if(N.redIAdd(B),this.x.cmp(N)===0)return!0}},y.prototype.toP=y.prototype.normalize,y.prototype.mixedAdd=y.prototype.add,ch}var dp;function Jy(){return dp||(dp=1,function(f){var o=f;o.base=ru(),o.short=_w(),o.mont=Bw(),o.edwards=ww()}(ah)),ah}var uh={},lh,gp;function mw(){return gp||(gp=1,lh={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"]]}}),lh}var pp;function ug(){return pp||(pp=1,function(f){var o=f,c=$1(),h=Jy(),b=Ei(),I=b.assert;function y(N){N.type==="short"?this.curve=new h.short(N):N.type==="edwards"?this.curve=new h.edwards(N):this.curve=new h.mont(N),this.g=this.curve.g,this.n=this.curve.n,this.hash=N.hash,I(this.g.validate(),"Invalid curve"),I(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}o.PresetCurve=y;function S(N,R){Object.defineProperty(o,N,{configurable:!0,enumerable:!0,get:function(){var B=new y(R);return Object.defineProperty(o,N,{configurable:!0,enumerable:!0,value:B}),B}})}S("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:c.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),S("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:c.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),S("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:c.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),S("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:c.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),S("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:c.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),S("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:c.sha256,gRed:!1,g:["9"]}),S("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:c.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var k;try{k=mw()}catch{k=void 0}S("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:c.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",k]})}(uh)),uh}var hh,yp;function Qw(){if(yp)return hh;yp=1;var f=$1(),o=Ly(),c=C2();function h(b){if(!(this instanceof h))return new h(b);this.hash=b.hash,this.predResist=!!b.predResist,this.outLen=this.hash.outSize,this.minEntropy=b.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var I=o.toArray(b.entropy,b.entropyEnc||"hex"),y=o.toArray(b.nonce,b.nonceEnc||"hex"),S=o.toArray(b.pers,b.persEnc||"hex");c(I.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(I,y,S)}return hh=h,h.prototype._init=function(I,y,S){var k=I.concat(y).concat(S);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var N=0;N<this.V.length;N++)this.K[N]=0,this.V[N]=1;this._update(k),this._reseed=1,this.reseedInterval=281474976710656},h.prototype._hmac=function(){return new f.hmac(this.hash,this.K)},h.prototype._update=function(I){var y=this._hmac().update(this.V).update([0]);I&&(y=y.update(I)),this.K=y.digest(),this.V=this._hmac().update(this.V).digest(),I&&(this.K=this._hmac().update(this.V).update([1]).update(I).digest(),this.V=this._hmac().update(this.V).digest())},h.prototype.reseed=function(I,y,S,k){typeof y!="string"&&(k=S,S=y,y=null),I=o.toArray(I,y),S=o.toArray(S,k),c(I.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(I.concat(S||[])),this._reseed=1},h.prototype.generate=function(I,y,S,k){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof y!="string"&&(k=S,S=y,y=null),S&&(S=o.toArray(S,k||"hex"),this._update(S));for(var N=[];N.length<I;)this.V=this._hmac().update(this.V).digest(),N=N.concat(this.V);var R=N.slice(0,I);return this._update(S),this._reseed++,o.encode(R,y)},hh}var dh,Cp;function Sw(){if(Cp)return dh;Cp=1;var f=Oa(),o=Ei(),c=o.assert;function h(b,I){this.ec=b,this.priv=null,this.pub=null,I.priv&&this._importPrivate(I.priv,I.privEnc),I.pub&&this._importPublic(I.pub,I.pubEnc)}return dh=h,h.fromPublic=function(I,y,S){return y instanceof h?y:new h(I,{pub:y,pubEnc:S})},h.fromPrivate=function(I,y,S){return y instanceof h?y:new h(I,{priv:y,privEnc:S})},h.prototype.validate=function(){var I=this.getPublic();return I.isInfinity()?{result:!1,reason:"Invalid public key"}:I.validate()?I.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"}},h.prototype.getPublic=function(I,y){return typeof I=="string"&&(y=I,I=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),y?this.pub.encode(y,I):this.pub},h.prototype.getPrivate=function(I){return I==="hex"?this.priv.toString(16,2):this.priv},h.prototype._importPrivate=function(I,y){this.priv=new f(I,y||16),this.priv=this.priv.umod(this.ec.curve.n)},h.prototype._importPublic=function(I,y){if(I.x||I.y){this.ec.curve.type==="mont"?c(I.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&c(I.x&&I.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(I.x,I.y);return}this.pub=this.ec.curve.decodePoint(I,y)},h.prototype.derive=function(I){return I.validate()||c(I.validate(),"public point not validated"),I.mul(this.priv).getX()},h.prototype.sign=function(I,y,S){return this.ec.sign(I,this,y,S)},h.prototype.verify=function(I,y,S){return this.ec.verify(I,y,this,void 0,S)},h.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},dh}var gh,Ip;function Dw(){if(Ip)return gh;Ip=1;var f=Oa(),o=Ei(),c=o.assert;function h(k,N){if(k instanceof h)return k;this._importDER(k,N)||(c(k.r&&k.s,"Signature without r or s"),this.r=new f(k.r,16),this.s=new f(k.s,16),k.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=k.recoveryParam)}gh=h;function b(){this.place=0}function I(k,N){var R=k[N.place++];if(!(R&128))return R;var B=R&15;if(B===0||B>4||k[N.place]===0)return!1;for(var oe=0,Ee=0,pe=N.place;Ee<B;Ee++,pe++)oe<<=8,oe|=k[pe],oe>>>=0;return oe<=127?!1:(N.place=pe,oe)}function y(k){for(var N=0,R=k.length-1;!k[N]&&!(k[N+1]&128)&&N<R;)N++;return N===0?k:k.slice(N)}h.prototype._importDER=function(N,R){N=o.toArray(N,R);var B=new b;if(N[B.place++]!==48)return!1;var oe=I(N,B);if(oe===!1||oe+B.place!==N.length||N[B.place++]!==2)return!1;var Ee=I(N,B);if(Ee===!1||(N[B.place]&128)!==0)return!1;var pe=N.slice(B.place,Ee+B.place);if(B.place+=Ee,N[B.place++]!==2)return!1;var V=I(N,B);if(V===!1||N.length!==V+B.place||(N[B.place]&128)!==0)return!1;var Ie=N.slice(B.place,V+B.place);if(pe[0]===0)if(pe[1]&128)pe=pe.slice(1);else return!1;if(Ie[0]===0)if(Ie[1]&128)Ie=Ie.slice(1);else return!1;return this.r=new f(pe),this.s=new f(Ie),this.recoveryParam=null,!0};function S(k,N){if(N<128){k.push(N);return}var R=1+(Math.log(N)/Math.LN2>>>3);for(k.push(R|128);--R;)k.push(N>>>(R<<3)&255);k.push(N)}return h.prototype.toDER=function(N){var R=this.r.toArray(),B=this.s.toArray();for(R[0]&128&&(R=[0].concat(R)),B[0]&128&&(B=[0].concat(B)),R=y(R),B=y(B);!B[0]&&!(B[1]&128);)B=B.slice(1);var oe=[2];S(oe,R.length),oe=oe.concat(R),oe.push(2),S(oe,B.length);var Ee=oe.concat(B),pe=[48];return S(pe,Ee.length),pe=pe.concat(Ee),o.encode(pe,N)},gh}var ph,bp;function kw(){if(bp)return ph;bp=1;var f=Oa(),o=Qw(),c=Ei(),h=ug(),b=Ty(),I=c.assert,y=Sw(),S=Dw();function k(N){if(!(this instanceof k))return new k(N);typeof N=="string"&&(I(Object.prototype.hasOwnProperty.call(h,N),"Unknown curve "+N),N=h[N]),N instanceof h.PresetCurve&&(N={curve:N}),this.curve=N.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=N.curve.g,this.g.precompute(N.curve.n.bitLength()+1),this.hash=N.hash||N.curve.hash}return ph=k,k.prototype.keyPair=function(R){return new y(this,R)},k.prototype.keyFromPrivate=function(R,B){return y.fromPrivate(this,R,B)},k.prototype.keyFromPublic=function(R,B){return y.fromPublic(this,R,B)},k.prototype.genKeyPair=function(R){R||(R={});for(var B=new o({hash:this.hash,pers:R.pers,persEnc:R.persEnc||"utf8",entropy:R.entropy||b(this.hash.hmacStrength),entropyEnc:R.entropy&&R.entropyEnc||"utf8",nonce:this.n.toArray()}),oe=this.n.byteLength(),Ee=this.n.sub(new f(2));;){var pe=new f(B.generate(oe));if(!(pe.cmp(Ee)>0))return pe.iaddn(1),this.keyFromPrivate(pe)}},k.prototype._truncateToN=function(R,B,oe){var Ee;if(f.isBN(R)||typeof R=="number")R=new f(R,16),Ee=R.byteLength();else if(typeof R=="object")Ee=R.length,R=new f(R,16);else{var pe=R.toString();Ee=pe.length+1>>>1,R=new f(pe,16)}typeof oe!="number"&&(oe=Ee*8);var V=oe-this.n.bitLength();return V>0&&(R=R.ushrn(V)),!B&&R.cmp(this.n)>=0?R.sub(this.n):R},k.prototype.sign=function(R,B,oe,Ee){if(typeof oe=="object"&&(Ee=oe,oe=null),Ee||(Ee={}),typeof R!="string"&&typeof R!="number"&&!f.isBN(R)){I(typeof R=="object"&&R&&typeof R.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),I(R.length>>>0===R.length);for(var pe=0;pe<R.length;pe++)I((R[pe]&255)===R[pe])}B=this.keyFromPrivate(B,oe),R=this._truncateToN(R,!1,Ee.msgBitLength),I(!R.isNeg(),"Can not sign a negative message");var V=this.n.byteLength(),Ie=B.getPrivate().toArray("be",V),Ce=R.toArray("be",V);I(new f(Ce).eq(R),"Can not sign message");for(var _e=new o({hash:this.hash,entropy:Ie,nonce:Ce,pers:Ee.pers,persEnc:Ee.persEnc||"utf8"}),te=this.n.sub(new f(1)),r0=0;;r0++){var ve=Ee.k?Ee.k(r0):new f(_e.generate(this.n.byteLength()));if(ve=this._truncateToN(ve,!0),!(ve.cmpn(1)<=0||ve.cmp(te)>=0)){var Ne=this.g.mul(ve);if(!Ne.isInfinity()){var ye=Ne.getX(),Xe=ye.umod(this.n);if(Xe.cmpn(0)!==0){var he=ve.invm(this.n).mul(Xe.mul(B.getPrivate()).iadd(R));if(he=he.umod(this.n),he.cmpn(0)!==0){var v0=(Ne.getY().isOdd()?1:0)|(ye.cmp(Xe)!==0?2:0);return Ee.canonical&&he.cmp(this.nh)>0&&(he=this.n.sub(he),v0^=1),new S({r:Xe,s:he,recoveryParam:v0})}}}}}},k.prototype.verify=function(R,B,oe,Ee,pe){pe||(pe={}),R=this._truncateToN(R,!1,pe.msgBitLength),oe=this.keyFromPublic(oe,Ee),B=new S(B,"hex");var V=B.r,Ie=B.s;if(V.cmpn(1)<0||V.cmp(this.n)>=0||Ie.cmpn(1)<0||Ie.cmp(this.n)>=0)return!1;var Ce=Ie.invm(this.n),_e=Ce.mul(R).umod(this.n),te=Ce.mul(V).umod(this.n),r0;return this.curve._maxwellTrick?(r0=this.g.jmulAdd(_e,oe.getPublic(),te),r0.isInfinity()?!1:r0.eqXToP(V)):(r0=this.g.mulAdd(_e,oe.getPublic(),te),r0.isInfinity()?!1:r0.getX().umod(this.n).cmp(V)===0)},k.prototype.recoverPubKey=function(N,R,B,oe){I((3&B)===B,"The recovery param is more than two bits"),R=new S(R,oe);var Ee=this.n,pe=new f(N),V=R.r,Ie=R.s,Ce=B&1,_e=B>>1;if(V.cmp(this.curve.p.umod(this.curve.n))>=0&&_e)throw new Error("Unable to find sencond key candinate");_e?V=this.curve.pointFromX(V.add(this.curve.n),Ce):V=this.curve.pointFromX(V,Ce);var te=R.r.invm(Ee),r0=Ee.sub(pe).mul(te).umod(Ee),ve=Ie.mul(te).umod(Ee);return this.g.mulAdd(r0,V,ve)},k.prototype.getKeyRecoveryParam=function(N,R,B,oe){if(R=new S(R,oe),R.recoveryParam!==null)return R.recoveryParam;for(var Ee=0;Ee<4;Ee++){var pe;try{pe=this.recoverPubKey(N,R,Ee)}catch{continue}if(pe.eq(B))return Ee}throw new Error("Unable to find valid recovery factor")},ph}var yh,vp;function Mw(){if(vp)return yh;vp=1;var f=Ei(),o=f.assert,c=f.parseBytes,h=f.cachedProperty;function b(I,y){this.eddsa=I,this._secret=c(y.secret),I.isPoint(y.pub)?this._pub=y.pub:this._pubBytes=c(y.pub)}return b.fromPublic=function(y,S){return S instanceof b?S:new b(y,{pub:S})},b.fromSecret=function(y,S){return S instanceof b?S:new b(y,{secret:S})},b.prototype.secret=function(){return this._secret},h(b,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),h(b,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),h(b,"privBytes",function(){var y=this.eddsa,S=this.hash(),k=y.encodingLength-1,N=S.slice(0,y.encodingLength);return N[0]&=248,N[k]&=127,N[k]|=64,N}),h(b,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),h(b,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),h(b,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),b.prototype.sign=function(y){return o(this._secret,"KeyPair can only verify"),this.eddsa.sign(y,this)},b.prototype.verify=function(y,S){return this.eddsa.verify(y,S,this)},b.prototype.getSecret=function(y){return o(this._secret,"KeyPair is public only"),f.encode(this.secret(),y)},b.prototype.getPublic=function(y){return f.encode(this.pubBytes(),y)},yh=b,yh}var Ch,xp;function Nw(){if(xp)return Ch;xp=1;var f=Oa(),o=Ei(),c=o.assert,h=o.cachedProperty,b=o.parseBytes;function I(y,S){this.eddsa=y,typeof S!="object"&&(S=b(S)),Array.isArray(S)&&(c(S.length===y.encodingLength*2,"Signature has invalid size"),S={R:S.slice(0,y.encodingLength),S:S.slice(y.encodingLength)}),c(S.R&&S.S,"Signature without R or S"),y.isPoint(S.R)&&(this._R=S.R),S.S instanceof f&&(this._S=S.S),this._Rencoded=Array.isArray(S.R)?S.R:S.Rencoded,this._Sencoded=Array.isArray(S.S)?S.S:S.Sencoded}return h(I,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),h(I,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),h(I,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),h(I,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),I.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},I.prototype.toHex=function(){return o.encode(this.toBytes(),"hex").toUpperCase()},Ch=I,Ch}var Ih,Ep;function Fw(){if(Ep)return Ih;Ep=1;var f=$1(),o=ug(),c=Ei(),h=c.assert,b=c.parseBytes,I=Mw(),y=Nw();function S(k){if(h(k==="ed25519","only tested with ed25519 so far"),!(this instanceof S))return new S(k);k=o[k].curve,this.curve=k,this.g=k.g,this.g.precompute(k.n.bitLength()+1),this.pointClass=k.point().constructor,this.encodingLength=Math.ceil(k.n.bitLength()/8),this.hash=f.sha512}return Ih=S,S.prototype.sign=function(N,R){N=b(N);var B=this.keyFromSecret(R),oe=this.hashInt(B.messagePrefix(),N),Ee=this.g.mul(oe),pe=this.encodePoint(Ee),V=this.hashInt(pe,B.pubBytes(),N).mul(B.priv()),Ie=oe.add(V).umod(this.curve.n);return this.makeSignature({R:Ee,S:Ie,Rencoded:pe})},S.prototype.verify=function(N,R,B){if(N=b(N),R=this.makeSignature(R),R.S().gte(R.eddsa.curve.n)||R.S().isNeg())return!1;var oe=this.keyFromPublic(B),Ee=this.hashInt(R.Rencoded(),oe.pubBytes(),N),pe=this.g.mul(R.S()),V=R.R().add(oe.pub().mul(Ee));return V.eq(pe)},S.prototype.hashInt=function(){for(var N=this.hash(),R=0;R<arguments.length;R++)N.update(arguments[R]);return c.intFromLE(N.digest()).umod(this.curve.n)},S.prototype.keyFromPublic=function(N){return I.fromPublic(this,N)},S.prototype.keyFromSecret=function(N){return I.fromSecret(this,N)},S.prototype.makeSignature=function(N){return N instanceof y?N:new y(this,N)},S.prototype.encodePoint=function(N){var R=N.getY().toArray("le",this.encodingLength);return R[this.encodingLength-1]|=N.getX().isOdd()?128:0,R},S.prototype.decodePoint=function(N){N=c.parseBytes(N);var R=N.length-1,B=N.slice(0,R).concat(N[R]&-129),oe=(N[R]&128)!==0,Ee=c.intFromLE(B);return this.curve.pointFromY(Ee,oe)},S.prototype.encodeInt=function(N){return N.toArray("le",this.encodingLength)},S.prototype.decodeInt=function(N){return c.intFromLE(N)},S.prototype.isPoint=function(N){return N instanceof this.pointClass},Ih}var _p;function Pw(){return _p||(_p=1,function(f){var o=f;o.version=xw.version,o.utils=Ei(),o.rand=Ty(),o.curve=Jy(),o.curves=ug(),o.ec=kw(),o.eddsa=Fw()}(nh)),nh}var Kw=Pw();const Uw=Ji(Kw);var b2=function(f,o,c,h){var b=arguments.length,I=b<3?o:h===null?h=Object.getOwnPropertyDescriptor(o,c):h,y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(f,o,c,h);else for(var S=f.length-1;S>=0;S--)(y=f[S])&&(I=(b<3?y(I):b>3?y(o,c,I):y(o,c))||I);return b>3&&I&&Object.defineProperty(o,c,I),I},v2=function(f,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(f,o)},cf,nd,n1,Hw=Uw.ec;let bh,Po=cf=class extends xs{publicKey;constructor(o){if(super(),o.publicKey.length!==33)throw new Error("Expecting key to have length 33");this.publicKey=o.publicKey}static async recover(o){const c=new Uint8Array([0]),h=await o.signMessage(c),b=Oy(await jf(c,La.ETH_KECCAK_256),h);return new cf({publicKey:b})}equals(o){return o instanceof cf?yA(this.publicKey,o.publicKey):!1}toString(){return"sepc256k1/"+Lf(this.publicKey)}toPeerId(){return X1(V1(this.publicKey))}static fromPeerId(o){if(!o.publicKey)throw new Error("Missing public key");if(o.type==="secp256k1")return new cf({publicKey:o.publicKey.raw});throw new Error("Unsupported key type: "+o.type)}};b2([LA({type:md("u8",33)}),v2("design:type",Uint8Array)],Po.prototype,"publicKey",void 0);Po=cf=b2([Uo(1),v2("design:paramtypes",[Object])],Po);let ms=nd=class extends U3{privateKey;constructor(o){if(super(),o.privateKey.length!==32)throw new Error("Expecting key to have length 32");this.privateKey=o.privateKey}equals(o){return o instanceof nd?yA(this.privateKey,o.privateKey):!1}toString(){return"secp256k1s/"+Lf(this.privateKey)}};b2([LA({type:Uint8Array}),v2("design:type",Uint8Array)],ms.prototype,"privateKey",void 0);ms=nd=b2([Uo(1),v2("design:paramtypes",[Object])],ms);let m1=n1=class extends K3{publicKey;privateKey;_wallet;constructor(o){super(),this.privateKey=o.privateKey,this.publicKey=o.publicKey}static async create(){const o=await v9();return new n1({publicKey:new Po({publicKey:o.publicKey.raw}),privateKey:new ms({privateKey:o.raw})})}async sign(o,c=La.ETH_KECCAK_256){const h=await jf(o,c),b=Wh((this._wallet||(this._wallet=new c2(this.privateKey.privateKey)))._signingKey().signDigest(h)),I=new Uint8Array(Do.length(b));return Do.write(b,I,0),new Ta({prehash:c,publicKey:this.publicKey,signature:I})}equals(o){return o instanceof n1?this.publicKey.equals(o.publicKey)&&this.privateKey.equals(o.privateKey):!1}toPeerId(){return X1(V1(this.publicKey.publicKey))}};b2([LA({type:Po}),v2("design:type",Po)],m1.prototype,"publicKey",void 0);b2([LA({type:ms}),v2("design:type",ms)],m1.prototype,"privateKey",void 0);m1=n1=b2([Uo(2),v2("design:paramtypes",[Object])],m1);const Rw=new TextDecoder;function Gw(){return bh||(bh=new Hw("secp256k1")),bh}const Oy=(f,o)=>{const c=Ns(o),h={r:Nt(c.r),s:Nt(c.s)};return new Uint8Array(Gw().recoverPubKey(Nt(f),h,c.recoveryParam).encodeCompressed())},Yw=async(f,o)=>{const c=await jf(o,f.prehash),h=Oy(Nt(c),Rw.decode(f.signature));return yA(h,f.publicKey.publicKey)};var x2=function(f,o,c,h){var b=arguments.length,I=b<3?o:h===null?h=Object.getOwnPropertyDescriptor(o,c):h,y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(f,o,c,h);else for(var S=f.length-1;S>=0;S--)(y=f[S])&&(I=(b<3?y(I):b>3?y(o,c,I):y(o,c))||I);return b>3&&I&&Object.defineProperty(o,c,I),I},E2=function(f,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(f,o)};let Ta=class{signature;publicKey;prehash=La.NONE;constructor(o){this.signature=o.signature,this.publicKey=o.publicKey,this.prehash=o.prehash}equals(o){return yA(this.signature,o.signature)?B3(vs(this.publicKey),vs(o.publicKey))===0&&this.prehash===o.prehash:!1}};x2([LA({type:Uint8Array}),E2("design:type",Uint8Array)],Ta.prototype,"signature",void 0);x2([LA({type:xs}),E2("design:type",xs)],Ta.prototype,"publicKey",void 0);x2([LA({type:"u8"}),E2("design:type",Number)],Ta.prototype,"prehash",void 0);Ta=x2([Uo(0),E2("design:paramtypes",[Object])],Ta);let Q1=class{data;signature;constructor(o){this.data=o.data,this.signature=o.signature,this._value=o.value}_value;getValue(o){return lx(this.data,o)}async verify(){return this.signature?Lw(this.signature,this.data):!0}equals(o){return!yA(this.data,o.data)||!this.signature!=!o.signature?!1:this.signature&&o.signature?this.signature.equals(o.signature):!0}async sign(o){const c=await o(this.data);return this.signature=c,this}};x2([LA({type:Uint8Array}),E2("design:type",Uint8Array)],Q1.prototype,"data",void 0);x2([LA({type:Zv(Ta)}),E2("design:type",Ta)],Q1.prototype,"signature",void 0);Q1=x2([Uo(0),E2("design:paramtypes",[Object])],Q1);const Lw=async(f,o)=>f.publicKey instanceof Ko?Jw(f,o):f.publicKey instanceof Po?Yw(f,o):!1,Tw=async(f,o,c)=>{const h=await jf(f,c);return new Ta({prehash:c,publicKey:o.publicKey,signature:p2.crypto_sign_detached(h,o.privateKeyPublicKey)})},Jw=async(f,o)=>{let c=!1;try{const h=await jf(o,f.prehash);c=p2.crypto_sign_verify_detached(f.signature,h,f.publicKey.publicKey)}catch{return!1}return c};var _2=function(f,o,c,h){var b=arguments.length,I=b<3?o:h===null?h=Object.getOwnPropertyDescriptor(o,c):h,y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(f,o,c,h);else for(var S=f.length-1;S>=0;S--)(y=f[S])&&(I=(b<3?y(I):b>3?y(o,c,I):y(o,c))||I);return b>3&&I&&Object.defineProperty(o,c,I),I},B2=function(f,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(f,o)},A1,Ad,i1;let Ko=A1=class extends xs{publicKey;constructor(o){if(super(),this.publicKey=o.publicKey,o.publicKey.length!==32)throw new Error("Expecting key to have length 32")}equals(o){return o instanceof A1?yA(this.publicKey,o.publicKey):!1}toString(){return"ed25119p/"+Lf(this.publicKey)}toPeerId(){return X1(V1(this.publicKey))}static fromPeerId(o){if(!o.publicKey)throw new Error("Missing public key");if(o.type==="Ed25519")return new A1({publicKey:m9(o.publicKey.raw)});throw new Error("Unsupported key type: "+o.type)}};_2([LA({type:md("u8",32)}),B2("design:type",Uint8Array)],Ko.prototype,"publicKey",void 0);Ko=A1=_2([Uo(0),B2("design:paramtypes",[Object])],Ko);let Qs=Ad=class extends U3{privateKey;constructor(o){if(super(),o.privateKey.length!==32)throw new Error("Expecting key to have length 32");this.privateKey=o.privateKey}equals(o){return o instanceof Ad?yA(this.privateKey,o.privateKey):!1}toString(){return"ed25119s/"+Lf(this.privateKey)}keyObject};_2([LA({type:md("u8",32)}),B2("design:type",Uint8Array)],Qs.prototype,"privateKey",void 0);Qs=Ad=_2([Uo(0),B2("design:paramtypes",[Object])],Qs);let Sf=i1=class extends K3{publicKey;privateKey;constructor(o){super(),this.privateKey=o.privateKey,this.publicKey=o.publicKey}static async create(){await p2.ready;const o=p2.crypto_sign_keypair();return new i1({publicKey:new Ko({publicKey:o.publicKey}),privateKey:new Qs({privateKey:o.privateKey.slice(0,32)})})}sign(o,c=La.NONE){return Tw(o,this,c)}signer(o){return async c=>this.sign(c,o)}equals(o){return o instanceof i1?this.publicKey.equals(o.publicKey)&&this.privateKey.equals(o.privateKey):!1}_privateKeyPublicKey;get privateKeyPublicKey(){return this._privateKeyPublicKey||(this._privateKeyPublicKey=Li([this.privateKey.privateKey,this.publicKey.publicKey]))}toPeerId(){return X1(V1(this.publicKey.publicKey))}};_2([LA({type:Ko}),B2("design:type",Ko)],Sf.prototype,"publicKey",void 0);_2([LA({type:Qs}),B2("design:type",Qs)],Sf.prototype,"privateKey",void 0);Sf=i1=_2([Uo(0),B2("design:paramtypes",[Object])],Sf);const Bp=f=>{if(f.type==="Ed25519")return Ko.fromPeerId(f);if(f.type==="secp256k1")return Po.fromPeerId(f);throw new Error("Unsupported key type")},Ow=f=>{if(f==="https:")return zy;if(f==="http:")return id;throw new Error("Unsupported protocol: "+f)},zy=9002,id=8082,wp="/trust",zw="/peer/id",qw="/peer/address",zc="/program",vh="/programs",jw="/program/variants",Vw="/install",Xw="/network/bootstrap",Ww="/restart",Zw="/path",$w="/log",em="/versions",tm="modulepreload",rm=function(f){return"/"+f},mp={},Qp=function(o,c,h){let b=Promise.resolve();if(c&&c.length>0){let y=function(N){return Promise.all(N.map(R=>Promise.resolve(R).then(B=>({status:"fulfilled",value:B}),B=>({status:"rejected",reason:B}))))};document.getElementsByTagName("link");const S=document.querySelector("meta[property=csp-nonce]"),k=S?.nonce||S?.getAttribute("nonce");b=y(c.map(N=>{if(N=rm(N),N in mp)return;mp[N]=!0;const R=N.endsWith(".css"),B=R?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${N}"]${B}`))return;const oe=document.createElement("link");if(oe.rel=R?"stylesheet":tm,R||(oe.as="script"),oe.crossOrigin="",oe.href=N,k&&oe.setAttribute("nonce",k),document.head.appendChild(oe),R)return new Promise((Ee,pe)=>{oe.addEventListener("load",Ee),oe.addEventListener("error",()=>pe(new Error(`Unable to preload CSS for ${N}`)))})}))}function I(y){const S=new Event("vite:preloadError",{cancelable:!0});if(S.payload=y,window.dispatchEvent(S),!S.defaultPrevented)throw y}return b.then(y=>{for(const S of y||[])S.status==="rejected"&&I(S.reason);return o().catch(I)})};class nm{index=0;input="";new(o){return this.index=0,this.input=o,this}readAtomically(o){const c=this.index,h=o();return h===void 0&&(this.index=c),h}parseWith(o){const c=o();if(this.index===this.input.length)return c}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(o){return this.readAtomically(()=>{const c=this.readChar();if(c===o)return c})}readSeparator(o,c,h){return this.readAtomically(()=>{if(!(c>0&&this.readGivenChar(o)===void 0))return h()})}readNumber(o,c,h,b){return this.readAtomically(()=>{let I=0,y=0;const S=this.peekChar();if(S===void 0)return;const k=S==="0",N=2**(8*b)-1;for(;;){const R=this.readAtomically(()=>{const B=this.readChar();if(B===void 0)return;const oe=Number.parseInt(B,o);if(!Number.isNaN(oe))return oe});if(R===void 0)break;if(I*=o,I+=R,I>N||(y+=1,c!==void 0&&y>c))return}if(y!==0)return!h&&k&&y>1?void 0:I})}readIPv4Addr(){return this.readAtomically(()=>{const o=new Uint8Array(4);for(let c=0;c<o.length;c++){const h=this.readSeparator(".",c,()=>this.readNumber(10,3,!1,1));if(h===void 0)return;o[c]=h}return o})}readIPv6Addr(){const o=c=>{for(let h=0;h<c.length/2;h++){const b=h*2;if(h<c.length-3){const y=this.readSeparator(":",h,()=>this.readIPv4Addr());if(y!==void 0)return c[b]=y[0],c[b+1]=y[1],c[b+2]=y[2],c[b+3]=y[3],[b+4,!0]}const I=this.readSeparator(":",h,()=>this.readNumber(16,4,!0,2));if(I===void 0)return[b,!1];c[b]=I>>8,c[b+1]=I&255}return[c.length,!1]};return this.readAtomically(()=>{const c=new Uint8Array(16),[h,b]=o(c);if(h===16)return c;if(b||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;const I=new Uint8Array(14),y=16-(h+2),[S]=o(I.subarray(0,y));return c.set(I.subarray(0,S),16-S),c})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}}const qy=45,Am=15,Ss=new nm;function im(f){if(!(f.length>Am))return Ss.new(f).parseWith(()=>Ss.readIPv4Addr())}function am(f){if(f.includes("%")&&(f=f.split("%")[0]),!(f.length>qy))return Ss.new(f).parseWith(()=>Ss.readIPv6Addr())}function om(f,o=!1){if(f.includes("%")&&(f=f.split("%")[0]),f.length>qy)return;const c=Ss.new(f).parseWith(()=>Ss.readIPAddr());if(c)return o&&c.length===4?Uint8Array.from([0,0,0,0,0,0,0,0,0,0,255,255,c[0],c[1],c[2],c[3]]):c}function sm(f){return!!im(f)}function fm(f){return!!am(f)}function jy(f){return!!om(f)}const Sp=sm,cm=fm,Vy=function(f){let o=0;if(f=f.toString().trim(),Sp(f)){const c=new Uint8Array(o+4);return f.split(/\./g).forEach(h=>{c[o++]=parseInt(h,10)&255}),c}if(cm(f)){const c=f.split(":",8);let h;for(h=0;h<c.length;h++){const I=Sp(c[h]);let y;I&&(y=Vy(c[h]),c[h]=Kn(y.slice(0,2),"base16")),y!=null&&++h<8&&c.splice(h,0,Kn(y.slice(2,4),"base16"))}if(c[0]==="")for(;c.length<8;)c.unshift("0");else if(c[c.length-1]==="")for(;c.length<8;)c.push("0");else if(c.length<8){for(h=0;h<c.length&&c[h]!=="";h++);const I=[h,1];for(h=9-c.length;h>0;h--)I.push("0");c.splice.apply(c,I)}const b=new Uint8Array(o+16);for(h=0;h<c.length;h++){const I=parseInt(c[h],16);b[o++]=I>>8&255,b[o++]=I&255}return b}throw new Error("invalid ip address")},um=function(f,o=0,c){o=~~o,c=c??f.length-o;const h=new DataView(f.buffer);if(c===4){const b=[];for(let I=0;I<c;I++)b.push(f[o+I]);return b.join(".")}if(c===16){const b=[];for(let I=0;I<c;I+=2)b.push(h.getUint16(o+I).toString(16));return b.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""},XA=-1,Df={},ad={},lm=[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,XA,"ip6zone"],[43,8,"ipcidr"],[53,XA,"dns",!0],[54,XA,"dns4",!0],[55,XA,"dns6",!0],[56,XA,"dnsaddr",!0],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[280,0,"webrtc-direct"],[281,0,"webrtc"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,XA,"unix",!1,!0],[421,XA,"ipfs"],[421,XA,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,XA,"garlic64"],[448,0,"tls"],[449,XA,"sni"],[460,0,"quic"],[461,0,"quic-v1"],[465,0,"webtransport"],[466,XA,"certhash"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[481,XA,"http-path"],[777,XA,"memory"]];lm.forEach(f=>{const o=hm(...f);ad[o.code]=o,Df[o.name]=o});function hm(f,o,c,h,b){return{code:f,size:o,name:c,resolvable:!!h,path:!!b}}function hn(f){if(typeof f=="number"){if(ad[f]!=null)return ad[f];throw new Error(`no protocol with code: ${f}`)}else if(typeof f=="string"){if(Df[f]!=null)return Df[f];throw new Error(`no protocol with name: ${f}`)}throw new Error(`invalid protocol id type: ${typeof f}`)}hn("ip4");hn("ip6");hn("ipcidr");function Xy(f,o){switch(hn(f).code){case 4:case 41:return gm(o);case 42:return _h(o);case 43:return Kn(o,"base10");case 6:case 273:case 33:case 132:return Wy(o).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return _h(o);case 421:return Im(o);case 444:return Mp(o);case 445:return Mp(o);case 466:return Cm(o);case 481:return globalThis.encodeURIComponent(_h(o));default:return Kn(o,"base16")}}function Dp(f,o){switch(hn(f).code){case 4:return kp(o);case 41:return kp(o);case 42:return Eh(o);case 43:return Mo(o,"base10");case 6:case 273:case 33:case 132:return lg(parseInt(o,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return Eh(o);case 421:return pm(o);case 444:return bm(o);case 445:return vm(o);case 466:return ym(o);case 481:return Eh(globalThis.decodeURIComponent(o));default:return Mo(o,"base16")}}const xh=Object.values(Hh).map(f=>f.decoder),dm=function(){let f=xh[0].or(xh[1]);return xh.slice(2).forEach(o=>f=f.or(o)),f}();function kp(f){if(!jy(f))throw new Error("invalid ip address");return Vy(f)}function gm(f){const o=um(f,0,f.length);if(o==null)throw new Error("ipBuff is required");if(!jy(o))throw new Error("invalid ip address");return o}function lg(f){const o=new ArrayBuffer(2);return new DataView(o).setUint16(0,f),new Uint8Array(o)}function Wy(f){return new DataView(f.buffer).getUint16(f.byteOffset)}function Eh(f){const o=Mo(f),c=Uint8Array.from(j1(o.length));return Li([c,o],c.length+o.length)}function _h(f){const o=qf(f);if(f=f.slice(pa(o)),f.length!==o)throw new Error("inconsistent lengths");return Kn(f)}function pm(f){let o;f[0]==="Q"||f[0]==="1"?o=S3(dA.decode(`z${f}`)).bytes:o=un.parse(f).multihash.bytes;const c=Uint8Array.from(j1(o.length));return Li([c,o],c.length+o.length)}function ym(f){const o=dm.decode(f),c=Uint8Array.from(j1(o.length));return Li([c,o],c.length+o.length)}function Cm(f){const o=qf(f),c=f.slice(pa(o));if(c.length!==o)throw new Error("inconsistent lengths");return"u"+Kn(c,"base64url")}function Im(f){const o=qf(f),c=f.slice(pa(o));if(c.length!==o)throw new Error("inconsistent lengths");return Kn(c,"base58btc")}function bm(f){const o=f.split(":");if(o.length!==2)throw new Error(`failed to parse onion addr: ["'${o.join('", "')}'"]' does not contain a port number`);if(o[0].length!==16)throw new Error(`failed to parse onion addr: ${o[0]} not a Tor onion address.`);const c=l2.decode("b"+o[0]),h=parseInt(o[1],10);if(h<1||h>65536)throw new Error("Port number is not in range(1, 65536)");const b=lg(h);return Li([c,b],c.length+b.length)}function vm(f){const o=f.split(":");if(o.length!==2)throw new Error(`failed to parse onion addr: ["'${o.join('", "')}'"]' does not contain a port number`);if(o[0].length!==56)throw new Error(`failed to parse onion addr: ${o[0]} not a Tor onion3 address.`);const c=l2.decode(`b${o[0]}`),h=parseInt(o[1],10);if(h<1||h>65536)throw new Error("Port number is not in range(1, 65536)");const b=lg(h);return Li([c,b],c.length+b.length)}function Mp(f){const o=f.slice(0,f.length-2),c=f.slice(f.length-2),h=Kn(o,"base32"),b=Wy(c);return`${h}:${b}`}function xm(f){f=od(f);const o=[],c=[];let h=null;const b=f.split("/").slice(1);if(b.length===1&&b[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let I=0;I<b.length;I++){const y=b[I],S=hn(y);if(S.size===0){o.push([S.code]),c.push([S.code]);continue}if(I++,I>=b.length)throw new eC("invalid address: "+f);if(S.path===!0){h=od(b.slice(I).join("/")),o.push([S.code,Dp(S.code,h)]),c.push([S.code,h]);break}const k=Dp(S.code,b[I]);o.push([S.code,k]),c.push([S.code,Xy(S.code,k)])}return{string:Zy(c),bytes:$y(o),tuples:o,stringTuples:c,path:h}}function Np(f){const o=[],c=[];let h=null,b=0;for(;b<f.length;){const I=qf(f,b),y=pa(I),S=hn(I),k=Em(S,f.slice(b+y));if(k===0){o.push([I]),c.push([I]),b+=y;continue}const N=f.slice(b+y,b+y+k);if(b+=k+y,b>f.length)throw new eC("Invalid address Uint8Array: "+Kn(f,"base16"));o.push([I,N]);const R=Xy(I,N);if(c.push([I,R]),S.path===!0){h=R;break}}return{bytes:Uint8Array.from(f),string:Zy(c),tuples:o,stringTuples:c,path:h}}function Zy(f){const o=[];return f.map(c=>{const h=hn(c[0]);return o.push(h.name),c.length>1&&c[1]!=null&&o.push(c[1]),null}),od(o.join("/"))}function $y(f){return Li(f.map(o=>{const c=hn(o[0]);let h=Uint8Array.from(j1(c.code));return o.length>1&&o[1]!=null&&(h=Li([h,o[1]])),h}))}function Em(f,o){if(f.size>0)return f.size/8;if(f.size===0)return 0;{const c=qf(o instanceof Uint8Array?o:Uint8Array.from(o));return c+pa(c)}}function od(f){return"/"+f.trim().split("/").filter(o=>o).join("/")}class eC extends Error{static name="ParseError";name="ParseError";constructor(o){super(`Error parsing address: ${o}`)}}const _m=Symbol.for("nodejs.util.inspect.custom"),tC=Symbol.for("@multiformats/js-multiaddr/multiaddr"),Bm=[hn("dns").code,hn("dns4").code,hn("dns6").code,hn("dnsaddr").code];class wm extends Error{constructor(o="No available resolver"){super(o),this.name="NoAvailableResolverError"}}class os{bytes;#t;#e;#r;#n;[tC]=!0;constructor(o){o==null&&(o="");let c;if(o instanceof Uint8Array)c=Np(o);else if(typeof o=="string"){if(o.length>0&&o.charAt(0)!=="/")throw new Error(`multiaddr "${o}" must start with a "/"`);c=xm(o)}else if(Qm(o))c=Np(o.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=c.bytes,this.#t=c.string,this.#e=c.tuples,this.#r=c.stringTuples,this.#n=c.path}toString(){return this.#t}toJSON(){return this.toString()}toOptions(){let o,c,h,b,I="";const y=hn("tcp"),S=hn("udp"),k=hn("ip4"),N=hn("ip6"),R=hn("dns6"),B=hn("ip6zone");for(const[Ee,pe]of this.stringTuples())Ee===B.code&&(I=`%${pe??""}`),Bm.includes(Ee)&&(c=y.name==="tcp"?"tcp":"udp",b=443,h=`${pe??""}${I}`,o=Ee===R.code?6:4),(Ee===y.code||Ee===S.code)&&(c=hn(Ee).name==="tcp"?"tcp":"udp",b=parseInt(pe??"")),(Ee===k.code||Ee===N.code)&&(c=hn(Ee).name==="tcp"?"tcp":"udp",h=`${pe??""}${I}`,o=Ee===N.code?6:4);if(o==null||c==null||h==null||b==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:o,host:h,transport:c,port:b}}protos(){return this.#e.map(([o])=>Object.assign({},hn(o)))}protoCodes(){return this.#e.map(([o])=>o)}protoNames(){return this.#e.map(([o])=>hn(o).name)}tuples(){return this.#e.map(([o,c])=>c==null?[o]:[o,c])}stringTuples(){return this.#r.map(([o,c])=>c==null?[o]:[o,c])}encapsulate(o){return o=new os(o),new os(this.toString()+o.toString())}decapsulate(o){const c=o.toString(),h=this.toString(),b=h.lastIndexOf(c);if(b<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${o.toString()}`);return new os(h.slice(0,b))}decapsulateCode(o){const c=this.tuples();for(let h=c.length-1;h>=0;h--)if(c[h][0]===o)return new os($y(c.slice(0,h)));return this}getPeerId(){try{let o=[];this.stringTuples().forEach(([h,b])=>{h===Df.p2p.code&&o.push([h,b]),h===Df["p2p-circuit"].code&&(o=[])});const c=o.pop();if(c?.[1]!=null){const h=c[1];return h[0]==="Q"||h[0]==="1"?Kn(dA.decode(`z${h}`),"base58btc"):Kn(un.parse(h).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return this.#n}equals(o){return yA(this.bytes,o.bytes)}async resolve(o){const c=this.protos().find(I=>I.resolvable);if(c==null)return[this];const h=mm.get(c.name);if(h==null)throw new wm(`no available resolver for ${c.name}`);return(await h(this,o)).map(I=>rC(I))}nodeAddress(){const o=this.toOptions();if(o.transport!=="tcp"&&o.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${o.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:o.family,address:o.host,port:o.port}}isThinWaistAddress(o){const c=(o??this).protos();return!(c.length!==2||c[0].code!==4&&c[0].code!==41||c[1].code!==6&&c[1].code!==273)}[_m](){return`Multiaddr(${this.#t})`}}const mm=new Map;function Qm(f){return!!f?.[tC]}function rC(f){return new os(f)}const Sm="X-Peerbit-Signature",Dm="X-Peerbit-Signature-Time",km=async(f,o,c,h,b)=>{const I=Math.round(new Date().getTime()/1e3).toString(),y=new mr;if(!o)throw new Error("Expecting method");if(!c)throw new Error("Expecting path");y.string(o.toLowerCase()+c.toLowerCase()+I+(h||""));const S=await b.sign(y.finalize());f[Dm]=I,f[Sm]=P3(vs(S))},Mm=async(f,o={address:"http://localhost:"+id})=>{let c=o.address;!c.startsWith("http://")&&!c.startsWith("https://")&&(c.endsWith("localhost:")||c.endsWith("localhost")?c="http://"+c:c="https://"+c);const h=c.startsWith("http://localhost");new URL(c).port===""&&!c.endsWith(":80")&&(h?c=c+":"+id:c=c+":"+zy);const{default:b}=await Qp(async()=>{const{default:B}=await import("./index-BLePxC6A.js");return{default:B}},[]),I=b.create();I.interceptors.request.use(async B=>{const oe=new URL(B.url);return await km(B.headers,B.method,oe.pathname+oe.search,B.data,f),B});const y=B=>B>=200&&B<300||B===404,S=B=>{if(B.status!==200)throw new Error(B.data);return B},k=async()=>S(await I.get(c+zw,{validateStatus:y,timeout:5e3})).data,N=async B=>S(await I.delete(c+zc+"/"+encodeURIComponent(B.toString()),{validateStatus:y})),R=async B=>S(await I.delete(c+zc+"/"+encodeURIComponent(B.toString())+"?delete=true",{validateStatus:y}));return{peer:{id:{get:k},addresses:{get:async()=>S(await I.get(c+qw,{validateStatus:y})).data.map(B=>rC(B))}},access:{allow:async B=>{const oe=await I.put(c+wp+"/"+encodeURIComponent(typeof B=="string"?B:B instanceof xs?B.hashcode():Bp(B).hashcode()),void 0,{validateStatus:y});if(oe.status!==200&&oe.status!==404)throw new Error(oe.data);return oe.status===200},deny:async B=>{const oe=await I.delete(c+wp+"/"+encodeURIComponent(B instanceof xs?B.hashcode():Bp(B).hashcode()),{validateStatus:y});if(oe.status!==200&&oe.status!==404)throw new Error(oe.data);return oe.status===200}},program:{has:async B=>{const oe=await I.head(c+zc+"/"+encodeURIComponent(B.toString()),{validateStatus:y});if(oe.status!==200&&oe.status!==404)throw new Error(oe.data);return oe.status===200},open:async B=>S(await I.put(c+zc,JSON.stringify(B),{validateStatus:y})).data,close:async B=>{await N(B)},closeAll:async()=>{const B=S(await I.get(c+vh,{validateStatus:y}));await Promise.all([...Object.keys(B.data)].map(oe=>N(oe)))},drop:async B=>{await R(B)},dropAll:async()=>{const B=S(await I.get(c+vh,{validateStatus:y}));await Promise.all([...Object.keys(B.data)].map(oe=>R(oe)))},list:async()=>S(await I.get(c+vh,{validateStatus:y})).data,variants:async()=>S(await I.get(c+jw,{validateStatus:y})).data},dependency:{install:async B=>{const oe=await I.put(c+Vw,JSON.stringify(B),{validateStatus:y});if(oe.status!==200)throw new Error(typeof oe.data=="string"?oe.data:oe.data.toString());return oe.data},versions:async()=>S(await I.get(c+em,{validateStatus:y})).data},network:{bootstrap:async()=>{S(await I.post(c+Xw,void 0,{validateStatus:y}))}},restart:async()=>{S(await I.post(c+Ww,void 0,{validateStatus:y}))},stop:async()=>{S(await I.post(c+Zw,void 0,{validateStatus:y}))},log:{fetch:async B=>{const oe=c+$w+(B!==void 0?`?n=${B}`:"");return S(await I.get(oe,{validateStatus:y})).data}},terminate:async()=>{const{terminateNode:B}=await Qp(async()=>{const{terminateNode:oe}=await Promise.resolve().then(()=>Pm);return{terminateNode:oe}},void 0);o.origin?.type==="aws"&&await B({instanceId:o.origin.instanceId,region:o.origin.region})}}};let sd=_d({palette:{mode:"dark"},typography:{fontFamily:["-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'].join(",")}});sd=Zb(sd);const Nm=()=>{const[f,o]=sr.useState(),[c,h]=sr.useState(),[b,I]=sr.useState(),[y,S]=sr.useState(),[k,N]=sr.useState([]);return sr.useEffect(()=>{Sf.create().then(R=>Mm(R,{address:window.location.protocol+"//"+window.location.hostname+":"+Ow(window.location.protocol)}).then(B=>{o(B),B.peer.id.get().then(oe=>{h(oe)}).catch(oe=>{window.location.hostname!=="localhost"?alert(oe):console.error(oe)}),B.peer.addresses.get().then(oe=>{const Ee=oe.find(Ie=>Ie.protoNames().includes("tcp")&&!Ie.protoNames().includes("ws")&&!Ie.protoNames().includes("wss"));Ee&&I(Ee.toString());const pe=oe.find(Ie=>Ie.protoNames().includes("ws")||Ie.protoNames().includes("wss"));pe&&S(pe.toString());let V=oe.filter(Ie=>(!Ee||!Ie.equals(Ee))&&(!pe||!Ie.equals(pe)));N(V.map(Ie=>Ie.toString()))}).catch(oe=>{window.location.hostname!=="localhost"?alert(oe):console.error(oe)})}))},[]),nr.jsxs(dv,{theme:sd,children:[nr.jsx(Mv,{}),nr.jsx(Qv,{children:nr.jsx(ia,{container:!0,sx:{p:4,height:"100vh"},children:nr.jsxs(ia,{item:!0,container:!0,direction:"column",spacing:2,maxWidth:"400px",children:[nr.jsxs(ia,{item:!0,container:!0,direction:"row",alignItems:"center",mb:2,children:[nr.jsx(ia,{mr:2,display:"flex",justifyContent:"center",item:!0,children:nr.jsx("img",{width:"60px",height:"auto",src:"./android-chrome-192x192.png"})}),nr.jsx(ia,{item:!0,children:nr.jsx(Aa,{variant:"h5",children:"Peerbit"})})]}),nr.jsxs(ia,{item:!0,children:[nr.jsx(Aa,{variant:"overline",children:"Id"}),nr.jsx(Aa,{children:c})]}),nr.jsx(ia,{item:!0,children:nr.jsx(Aa,{variant:"overline",children:"Address"})}),b&&nr.jsxs(ia,{item:!0,children:[nr.jsx(Aa,{variant:"caption",children:" TCP (non-browser)"}),nr.jsx(gl,{elevation:10,children:nr.jsx(Aa,{m:2,sx:{verticalAlign:"middle"},variant:"caption",children:b})})]}),y&&nr.jsxs(ia,{item:!0,children:[nr.jsxs(Aa,{variant:"caption",children:[" ","Websockets (browser and non-browser)"," "]}),nr.jsx(gl,{elevation:10,children:nr.jsx(Aa,{m:2,sx:{verticalAlign:"middle"},variant:"caption",children:y})})]}),k.length>0&&nr.jsxs(ia,{item:!0,children:[nr.jsx(Aa,{variant:"caption",children:" Other addresses"}),k.map(R=>nr.jsx(gl,{elevation:10,children:nr.jsx(Aa,{m:2,sx:{verticalAlign:"middle"},variant:"caption",children:R})}))]})]})})})]})},Fm=qC.createRoot(document.getElementById("root"));Fm.render(nr.jsx(Fp.StrictMode,{children:nr.jsx(Nm,{})}));const Pm=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));