@prosopo/account 2.8.97 → 2.8.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build$colon$cjs.log +5 -5
- package/.turbo/turbo-build$colon$tsc.log +8 -8
- package/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +13 -0
- package/dist/cjs/workers/cryptoWorker.cjs +1 -1
- package/dist/workers/cryptoWorker.js +1 -1
- package/package.json +7 -7
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/workers/cryptoWorker.ts?worker&inline
|
|
2
|
-
var jsContent = "(function(){function e(e){return e(`return this`)}let t=typeof globalThis<`u`?globalThis:typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:e(Function);function n(e,n){return t[e]===void 0?n:t[e]}let r=n(`TextEncoder`,class{encode(e){let t=e.length,n=new Uint8Array(t);for(let r=0;r<t;r++)n[r]=e.charCodeAt(r);return n}});function i(e){return typeof e==`function`}function a(){return NaN}let o=n(`BigInt`,a),s=`0123456789abcdef`,c=new Uint8Array(256),l=new Uint8Array(256*256);for(let e=0;e<16;e++)c[s[e].charCodeAt(0)|0]=e|0,e>9&&(c[s[e].toUpperCase().charCodeAt(0)|0]=e|0);for(let e=0;e<256;e++){let t=e<<8;for(let n=0;n<256;n++)l[t|n]=c[e]<<4|c[n]}function u(e,t=-1){if(!e)return new Uint8Array;let n=e.startsWith(`0x`)?2:0,r=Math.ceil((e.length-n)/2),i=Math.ceil(t===-1?r:t/8),a=new Uint8Array(i),o=i>r?i-r:0;for(let t=o;t<i;t++,n+=2)a[t]=l[e.charCodeAt(n)<<8|e.charCodeAt(n+1)];return a}let d=/^0x[\\da-fA-F]+$/;function f(e,t=-1,n){return typeof e==`string`&&(e===`0x`||d.test(e))&&(t===-1?n||e.length%2==0:e.length===2+Math.ceil(t/4))}typeof o==`function`&&o.asIntN;let p=typeof t.Buffer==`function`&&typeof t.Buffer.isBuffer==`function`;t.process;function m(e){return p&&!!e&&i(e.readDoubleLE)&&t.Buffer.isBuffer(e)}function h(e){return(e&&e.constructor)===Uint8Array||e instanceof Uint8Array}let g=new r;function _(e){return e?g.encode(e.toString()):new Uint8Array}function v(e,t=!1){if(t&&e==null)throw Error(`u8aToU8a: Expected non-null, non-undefined value`);return h(e)?m(e)?new Uint8Array(e):e:f(e)?u(e):Array.isArray(e)?new Uint8Array(e):_(e)}\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nfunction y(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function b(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, got `+e)}function x(e,...t){if(!y(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function S(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash should be wrapped by utils.createHasher`);b(e.outputLen),b(e.blockLen)}function C(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function ee(e,t){x(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}function w(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function T(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function E(e,t){return e<<32-t|e>>>t}function D(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function te(e){return typeof e==`string`&&(e=D(e)),x(e),e}function ne(e){return typeof e==`string`&&(e=D(e)),x(e),e}function re(e,t){if(t!==void 0&&{}.toString.call(t)!==`[object Object]`)throw Error(`options should be object or undefined`);return Object.assign(e,t)}var ie=class{};function ae(e){let t=t=>e().update(te(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function oe(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}function se(e,t,n){return e&t^~e&n}function ce(e,t,n){return e&t^e&n^t&n}var le=class extends ie{constructor(e,t,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=T(this.buffer)}update(e){C(this),e=te(e),x(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=T(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){C(this),ee(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,w(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;oe(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=T(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}};let O=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),k=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),ue=BigInt(2**32-1),de=BigInt(32);function fe(e,t=!1){return t?{h:Number(e&ue),l:Number(e>>de&ue)}:{h:Number(e>>de&ue)|0,l:Number(e&ue)|0}}function pe(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=fe(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}let me=(e,t,n)=>e>>>n,he=(e,t,n)=>e<<32-n|t>>>n,A=(e,t,n)=>e>>>n|t<<32-n,j=(e,t,n)=>e<<32-n|t>>>n,ge=(e,t,n)=>e<<64-n|t>>>n-32,_e=(e,t,n)=>e>>>n-32|t<<64-n;function M(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}let ve=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),ye=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,be=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),xe=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,Se=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),Ce=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0;function we(e){return e(`return this`)}let Te=(typeof globalThis<`u`?globalThis:typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:we(Function)).crypto;function Ee(e){return Te.getRandomValues(e)}function De(e=32){return Ee(new Uint8Array(e))}var Oe=class extends ie{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,S(e);let n=te(t);if(this.iHash=e.create(),typeof this.iHash.update!=`function`)throw Error(`Expected instance of class which extends utils.Hash`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),w(i)}update(e){return C(this),this.iHash.update(e),this}digestInto(e){C(this),x(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};let ke=(e,t,n)=>new Oe(e,t).update(n).digest();ke.create=(e,t)=>new Oe(e,t);function Ae(e,t,n,r){S(e);let{c:i,dkLen:a,asyncTick:o}=re({dkLen:32,asyncTick:10},r);if(b(i),b(a),b(o),i<1)throw Error(`iterations (c) should be >= 1`);let s=ne(t),c=ne(n),l=new Uint8Array(a),u=ke.create(e,s);return{c:i,dkLen:a,asyncTick:o,DK:l,PRF:u,PRFSalt:u._cloneInto().update(c)}}function je(e,t,n,r,i){return e.destroy(),t.destroy(),r&&r.destroy(),w(i),n}function Me(e,t,n,r){let{c:i,dkLen:a,DK:o,PRF:s,PRFSalt:c}=Ae(e,t,n,r),l,u=new Uint8Array(4),d=T(u),f=new Uint8Array(s.outputLen);for(let e=1,t=0;t<a;e++,t+=s.outputLen){let n=o.subarray(t,t+s.outputLen);d.setInt32(0,e,!1),(l=c._cloneInto(l)).update(u).digestInto(f),n.set(f.subarray(0,n.length));for(let e=1;e<i;e++){s._cloneInto(l).update(f).digestInto(f);for(let e=0;e<n.length;e++)n[e]^=f[e]}}return je(s,c,o,l,f)}let Ne=Uint32Array.from([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]),N=new Uint32Array(64);var Pe=class extends le{constructor(e=32){super(64,e,8,!1),this.A=O[0]|0,this.B=O[1]|0,this.C=O[2]|0,this.D=O[3]|0,this.E=O[4]|0,this.F=O[5]|0,this.G=O[6]|0,this.H=O[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)N[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=N[e-15],n=N[e-2],r=E(t,7)^E(t,18)^t>>>3,i=E(n,17)^E(n,19)^n>>>10;N[e]=i+N[e-7]+r+N[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=E(o,6)^E(o,11)^E(o,25),u=l+t+se(o,s,c)+Ne[e]+N[e]|0,d=(E(n,2)^E(n,13)^E(n,22))+ce(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){w(N)}destroy(){this.set(0,0,0,0,0,0,0,0),w(this.buffer)}};let Fe=pe(`0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`).map(e=>BigInt(e))),Ie=Fe[0],Le=Fe[1],P=new Uint32Array(80),F=new Uint32Array(80);var Re=class extends le{constructor(e=64){super(128,e,16,!1),this.Ah=k[0]|0,this.Al=k[1]|0,this.Bh=k[2]|0,this.Bl=k[3]|0,this.Ch=k[4]|0,this.Cl=k[5]|0,this.Dh=k[6]|0,this.Dl=k[7]|0,this.Eh=k[8]|0,this.El=k[9]|0,this.Fh=k[10]|0,this.Fl=k[11]|0,this.Gh=k[12]|0,this.Gl=k[13]|0,this.Hh=k[14]|0,this.Hl=k[15]|0}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}process(e,t){for(let n=0;n<16;n++,t+=4)P[n]=e.getUint32(t),F[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=P[e-15]|0,n=F[e-15]|0,r=A(t,n,1)^A(t,n,8)^me(t,n,7),i=j(t,n,1)^j(t,n,8)^he(t,n,7),a=P[e-2]|0,o=F[e-2]|0,s=A(a,o,19)^ge(a,o,61)^me(a,o,6),c=j(a,o,19)^_e(a,o,61)^he(a,o,6),l=be(i,c,F[e-7],F[e-16]),u=xe(l,r,s,P[e-7],P[e-16]);P[e]=u|0,F[e]=l|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=A(u,d,14)^A(u,d,18)^ge(u,d,41),v=j(u,d,14)^j(u,d,18)^_e(u,d,41),y=u&f^~u&m,b=d&p^~d&h,x=Se(_,v,b,Le[e],F[e]),S=Ce(x,g,t,y,Ie[e],P[e]),C=x|0,ee=A(n,r,28)^ge(n,r,34)^ge(n,r,39),w=j(n,r,28)^_e(n,r,34)^_e(n,r,39),T=n&i^n&o^i&o,E=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=M(c|0,l|0,S|0,C|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let D=ve(C,w,E);n=ye(D,S,ee,T),r=D|0}({h:n,l:r}=M(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=M(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=M(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=M(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=M(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=M(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=M(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=M(this.Hh|0,this.Hl|0,g|0,_|0),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){w(P,F)}destroy(){w(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};let ze=ae(()=>new Pe),Be=ae(()=>new Re);function Ve(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1}let He=e=>e?`\"${e}\" `:``;function Ue(e,t=``){if(typeof e!=`number`)throw TypeError(He(t)+`expected number, got `+typeof e);if(!Number.isSafeInteger(e)||e<0)throw RangeError(He(t)+`expected integer >= 0, got `+e);return e}function We(e,t,n=``){if(Ve(e)&&(t===void 0||e.length===t))return e;t!==void 0&&Ue(t,`length`);let r=Ve(e),i=t===void 0?``:` of length ${t}`,a=r?`length=${e.length}`:`type=${typeof e}`,o=He(n)+`expected Uint8Array`+i+`, got `+a;throw r?RangeError(o):TypeError(o)}let Ge=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,Ke=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function qe(e){if(We(e),Ge)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=Ke[e[n]];return t}function Je(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function Ye(e){if(typeof e!=`string`)throw TypeError(`hex string expected, got `+typeof e);if(Ge)try{return Uint8Array.fromHex(e)}catch(e){throw e instanceof SyntaxError?RangeError(e.message):e}let t=e.length,n=t/2;if(t%2)throw RangeError(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=Je(e.charCodeAt(i)),a=Je(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw RangeError(`hex string expected, got non-hex character \"`+t+`\" at index `+i)}r[t]=n*16+a}return r}function Xe(e=32){Ue(e,`bytesLength`);let t=typeof globalThis==`object`?globalThis.crypto:null;if(typeof t?.getRandomValues!=`function`)throw Error(`crypto.getRandomValues must be defined`);if(e>65536)throw RangeError(`\"bytesLength\" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nfunction Ze(e,t,n=()=>{}){if(!Array.isArray(e))throw TypeError(`\"${t}\" expected array, got type=${typeof e}`);for(let r=0;r<e.length;r++)n(e[r],`${t}[${r}]`);return e}let I=(e,t,n)=>We(e,t,n),Qe=Ue;function L(e,t=`object`){if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(t===`object`?`expected valid options object`:`\"${t}\" expected object, got type=${typeof e}`);return e}function $e(e,t){if(typeof e!=`function`)throw TypeError(`\"${t}\" is invalid: expected function, got ${typeof e}`);return e}let et=qe,tt=e=>Ye(e),nt=Ve,rt=e=>Xe(e),it=BigInt(0),at=BigInt(1),ot=e=>e?`\"${e}\" `:``;function st(e,t=``){if(typeof e!=`boolean`)throw TypeError(ot(t)+`expected boolean, got type=`+typeof e);return e}function ct(e){if(typeof e==`bigint`){if(!R(e))throw RangeError(`positive bigint expected, got `+e)}else Qe(e);return e}function lt(e,t=``){if(typeof e!=`number`){let n=t&&`\"${t}\" `;throw TypeError(n+`expected number, got type=`+typeof e)}if(!Number.isSafeInteger(e)){let n=t&&`\"${t}\" `;throw RangeError(n+`expected safe integer, got `+e)}}function ut(e){if(typeof e!=`string`)throw TypeError(`hex string expected, got `+typeof e);return e===``?it:BigInt(`0x`+e)}function dt(e){return ut(qe(e))}function ft(e){return ut(qe(gt(We(e)).reverse()))}function pt(e,t){if(Ue(t),t===0)throw Error(`zero output length is invalid`);e=ct(e);let n=t*2,r=e.toString(16);if(r.length>n)throw RangeError(`number is too large`);return Ye(r.padStart(n,`0`))}function mt(e,t){return pt(e,t).reverse()}function ht(e,t){if(e=I(e),t=I(t),e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}function gt(e){return Uint8Array.from(I(e))}function R(e){return typeof e==`bigint`&&it<=e}function _t(e,t,n){return R(e)&&R(t)&&R(n)&&t<=e&&e<n}function vt(e,t,n,r){if(!_t(t,n,r))throw RangeError(`expected valid `+e+`: `+n+` <= n < `+r+`, got `+t)}function yt(e){if(e<it)throw Error(`expected non-negative bigint, got `+e);return e===it?0:e.toString(2).length}let bt=e=>(lt(e,`n`),(at<<BigInt(e))-at);function xt(e,t={},n={},r=`object`){L(e,r),L(t,`fields`),L(n,`optFields`);function i(t,n,i){let a=r===`object`?`param \"${String(t)}\"`:`\"${r}.${String(t)}\"`,o=e[t];if(!Object.hasOwn(e,t)&&(i?o!==void 0:n!==`function`))throw TypeError(`${a} is invalid: expected own property`);if(i&&o===void 0)return;let s=typeof o;if(s!==n||o===null)throw TypeError(`${a} is invalid: expected ${n}, got ${s}`)}let a=(e,t)=>Object.entries(e).forEach(([e,n])=>i(e,n,t));a(t,!1),a(n,!0)}let St=()=>{throw Error(`not implemented`)},z=BigInt(0),B=BigInt(1),V=BigInt(2),Ct=BigInt(3),wt=BigInt(4),Tt=BigInt(5),Et=BigInt(7),Dt=BigInt(8),Ot=BigInt(9),kt=BigInt(15),At=BigInt(16),jt=BigInt(`0x10000000000000000`)\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n;function H(e,t){if(t<=z)throw Error(`mod: expected positive modulus, got `+t);let n=e%t;return n>=z?n:t+n}function Mt(e,t,n){if(n<=B)throw Error(`pow: expected modulus > 1, got `+n);if(typeof t!=`bigint`)throw TypeError(`invalid exponent: expected bigint, got `+typeof t);if(t<z)throw Error(`invalid exponent, negatives unsupported`);if(t===z)return B;if(t===B)return e;let r=e%n;if(r<z&&(r+=n),t<jt){let e=B;for(;t>z;)t&B&&(e=e*r%n),r=r*r%n,t>>=B;return e}let i=[];for(;t>z;)i.push(Number(t&kt)),t>>=wt;let a=Array(16);a[0]=B,a[1]=r;for(let e=2;e<16;e++)a[e]=a[e-1]*r%n;let o=a[i[i.length-1]];for(let e=i.length-2;e>=0;e--){o=o*o%n,o=o*o%n,o=o*o%n,o=o*o%n;let t=i[e];t!==0&&(o=o*a[t]%n)}return o}function U(e,t,n){if(n<=B)throw Error(`pow2: expected modulus > 1, got `+n);if(t<z)throw Error(`pow2: expected non-negative exponent, got `+t);let r=e;for(;t-->z;)r*=r,r%=n;return r}function Nt(e,t){if(e===z)throw Error(`invert: expected non-zero number`);if(t<=B)throw Error(`invert: expected modulus > 1, got `+t);let n=H(e,t),r=t,i=z,a=B;for(;n!==z;){let e=r/n,t=r-n*e,o=i-a*e;r=n,n=t,i=a,a=o}if(r!==B)throw Error(`invert: does not exist`);return H(i,t)}function Pt(e,t,n){let r=e;if(!r.eql(r.sqr(t),n))throw Error(`Cannot find square root`)}function Ft(e,t){if((e&B)===z)throw Error(t+`: expected odd modulus, got `+e)}function It(e,t){let n=e,r=(n.ORDER+B)/wt,i=n.pow(t,r);return Pt(n,i,t),i}function Lt(e,t){let n=e,r=(n.ORDER-Tt)/Dt,i=n.mul(t,V),a=n.pow(i,r),o=n.mul(t,a),s=n.mul(n.mul(o,V),a),c=n.mul(o,n.sub(s,n.ONE));return Pt(n,c,t),c}function Rt(e){let t=Jt(e),n=zt(e),r=n(t,t.neg(t.ONE)),i=n(t,r),a=n(t,t.neg(r)),o=(e+Et)/At;return((e,t)=>{let n=e,s=n.pow(t,o),c=n.mul(s,r),l=n.mul(s,i),u=n.mul(s,a),d=n.eql(n.sqr(c),t),f=n.eql(n.sqr(l),t);s=n.cmov(s,c,d),c=n.cmov(u,l,f);let p=n.eql(n.sqr(c),t),m=n.cmov(s,c,p);return Pt(n,m,t),m})}function zt(e){if(e<Ct)throw Error(`sqrt is not defined for small field`);Ft(e,`tonelliShanks`);let t=e-B,n=0;for(;t%V===z;)t/=V,n++;let r=V,i=Jt(e);for(;Wt(i,r)===1;)if(r++>1e3)throw Error(`Cannot find square root: probably non-prime P`);if(n===1)return It;let a=i.pow(r,t),o=(t+B)/V;return function(e,r){let i=e;if(i.is0(r))return r;if(Wt(i,r)!==1)throw Error(`Cannot find square root`);let s=n,c=i.mul(i.ONE,a),l=i.pow(r,t),u=i.pow(r,o);for(;!i.eql(l,i.ONE);){if(i.is0(l))throw Error(`Cannot find square root: probably non-prime P`);let e=1,t=i.sqr(l);for(;!i.eql(t,i.ONE);)if(e++,t=i.sqr(t),e===s)throw Error(`Cannot find square root`);let n=B<<BigInt(s-e-1),r=i.pow(c,n);s=e,c=i.sqr(r),l=i.mul(l,c),u=i.mul(u,r)}return u}}function Bt(e){return Ft(e,`Fp.sqrt`),e%wt===Ct?It:e%Dt===Tt?Lt:e%At===Ot?Rt(e):zt(e)}let Vt=(e,t)=>(H(e,t)&B)===B,Ht=[`create`,`isValid`,`is0`,`neg`,`inv`,`sqrt`,`sqr`,`eql`,`add`,`sub`,`mul`,`pow`,`div`,`addN`,`subN`,`mulN`,`sqrN`];function W(e){if(L(e,`field`),typeof e.ORDER!=`bigint`)throw TypeError(`param \"ORDER\" is invalid: expected bigint, got `+typeof e.ORDER);lt(e.BYTES,`BYTES`),lt(e.BITS,`BITS`);for(let t of Ht)$e(e[t],`field.`+t);if(e.BYTES<1||e.BITS<1)throw Error(`invalid field: expected BYTES/BITS > 0`);if(e.ORDER<=B)throw Error(`invalid field: expected ORDER > 1, got `+e.ORDER);return e}function Ut(e,t,n=!1){W(e),Ze(t,`nums`),st(n,`passZero`);let r=e,i=Array(t.length).fill(n?r.ZERO:void 0),a=t.reduce((e,t,n)=>r.is0(t)?e:(i[n]=e,r.mul(e,t)),r.ONE),o=r.inv(a);return t.reduceRight((e,t,n)=>r.is0(t)?e:(i[n]=r.mul(e,i[n]),r.mul(e,t)),o),i}function Wt(e,t){W(e);let n=e;Ft(n.ORDER,`FpLegendre`);let r=(n.ORDER-B)/V,i=n.pow(t,r),a=n.eql(i,n.ONE),o=n.eql(i,n.ZERO),s=n.eql(i,n.neg(n.ONE));if(!a&&!o&&!s)throw Error(`invalid Legendre symbol result`);return a?1:o?0:-1}function Gt(e,t){if(t!==void 0&&Qe(t),e<=z)throw Error(`invalid n length: expected positive n, got `+e);if(t!==void 0&&t<1)throw Error(`invalid n length: expected positive bit length, got `+t);let n=yt(e);if(t!==void 0&&t<n)throw Error(`invalid n length: expected nBitLength (${t}) >= bitLen(n) (${n})`);let r=t===void 0?n:t;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}let Kt=new WeakMap;var qt=class{ORDER;BITS;BYTES;isLE;ZERO=z;ONE=B;_lengths;_mod;constructor(e,t={}){if(e<=B)throw Error(`invalid field: expected ORDER > 1, got `+e);let n;this.isLE=!1,typeof t==`object`&&t&&(typeof t.BITS==`number`&&(n=t.BITS),typeof t.sqrt==`function`&&Object.defineProperty(this,\"sqrt\",{value:t.sqrt,enumerable:!0}),typeof t.isLE==`boolean`&&(this.isLE=t.isLE),t.allowedLengths&&(this._lengths=Object.freeze(t.allowedLengths.slice())),typeof t.modFromBytes==`boolean`&&(this._mod=t.modFromBytes));let{nBitLength:r,nByteLength:i}=Gt(e,n);if(i>2048)throw Error(`invalid field: expected ORDER of <= 2048 bytes`);this.ORDER=e,this.BITS=r,this.BYTES=i,Object.freeze(this)}create(e){return H(e,this.ORDER)}isValid(e){if(typeof e!=`bigint`)throw TypeError(`invalid field element: expected bigint, got `+typeof e);return z<=e&&e<this.ORDER}is0(e){return e===z}isValidNot0(e){return!this.is0(e)&&this.isValid(e)}isOdd(e){return(e&B)===B}neg(e){return H(-e,this.ORDER)}eql(e,t){return e===t}sqr(e){return H(e*e,this.ORDER)}add(e,t){return H(e+t,this.ORDER)}sub(e,t){return H(e-t,this.ORDER)}mul(e,t){return H(e*t,this.ORDER)}pow(e,t){return Mt(e,t,this.ORDER)}div(e,t){return H(e*Nt(t,this.ORDER),this.ORDER)}sqrN(e){return e*e}addN(e,t){return e+t}subN(e,t){return e-t}mulN(e,t){return e*t}inv(e){return Nt(e,this.ORDER)}sqrt(e){let t=Kt.get(this);return t||Kt.set(this,t=Bt(this.ORDER)),t(this,e)}toBytes(e){return this.isLE?mt(e,this.BYTES):pt(e,this.BYTES)}fromBytes(e,t=!1){I(e);let{_lengths:n,BYTES:r,isLE:i,ORDER:a,_mod:o}=this;if(n){if(e.length<1||!n.includes(e.length)||e.length>r)throw Error(`Field.fromBytes: expected `+n+` bytes, got `+e.length);let t=new Uint8Array(r);t.set(e,i?0:t.length-e.length),e=t}if(e.length!==r)throw Error(`Field.fromBytes: expected `+r+` bytes, got `+e.length);let s=i?ft(e):dt(e);if(o&&(s=H(s,a)),!t&&!this.isValid(s))throw Error(`invalid field element: outside of range 0..ORDER`);return s}invertBatch(e){return Ut(this,e,!0)}cmov(e,t,n){return st(n,`condition`),n?t:e}};function Jt(e,t={}){return Object.freeze(qt.prototype),new qt(e,t)}\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nlet Yt=BigInt(0),G=BigInt(1),Xt=BigInt(4),Zt=2**31;function Qt(e){let t=e;if(typeof t!=`function`)throw TypeError(`\"Point\" expected constructor, got type=`+typeof e);$e(t.fromAffine,`Point.fromAffine`),$e(t.fromBytes,`Point.fromBytes`),$e(t.fromHex,`Point.fromHex`),L(t.BASE,`Point.BASE`),L(t.ZERO,`Point.ZERO`),W(t.Fp),W(t.Fn)}function $t(e,t){Qt(e),rn(t,e);let n=Ut(e.Fp,t.map(e=>e.Z));return t.map((t,r)=>e.fromAffine(t.toAffine(n[r])))}function en(e,t,n=1){if(!Number.isSafeInteger(e)||e<n||e>t)throw Error(`invalid window size, expected [`+n+`..`+t+`], got W=`+e)}function tn(e,t){let n=e*(4*t+128);if(n>Zt)throw Error(`invalid window size: table would need ~`+Math.ceil(n/2**20)+` MiB, max `+Zt/2**20+` MiB`)}function nn(e,t){if(e!==void 0){$e(e,`randomBytes`);try{let n=e(t);if(!nt(n)||n.length!==t)return}catch{return}return e}}function rn(e,t){Ze(e,`points`),e.forEach((e,n)=>{if(!(e instanceof t))throw Error(`invalid point at index `+n)})}function an(e,t,n){if(!Array.isArray(e))throw Error(`array of scalars expected`);e.forEach((e,r)=>{if(!(n===void 0?t.isValid(e):R(e)&&e<n))throw Error(`invalid scalar at index `+r)})}let on=new WeakMap;function sn(e){return on.get(e)||1}function cn(e,t){let n=e.double(),r=[e];for(let e=1;e<t;e++)r.push(r[e-1].add(n));return r}function ln(e,t){let n=2**t,r=n/2,i=BigInt(n-1),a=[];for(;e>Yt;){let t=0;e&G&&(t=Number(e&i),t>=r&&(t-=n),e-=BigInt(t)),a.push(t),e>>=G}return a}function un(e,t,n){let r=2**t,i=r/2,a=BigInt(r-1),o=BigInt(t),s=[];for(let t=0;t<n;t++){let t=Number(e&a);e>>=o,t>i&&(t-=r,e+=G),s.push(t)}if(e!==Yt)throw Error(`invalid wnaf`);return s}function dn(e,t,n){let r=0;for(let e of n)r=Math.max(r,e.length);let i=e;for(let e=r-1;e>=0;e--){e!==r-1&&(i=i.double());for(let r=0;r<n.length;r++){let a=n[r][e];if(a){let e=t[r][Math.abs(a)-1>>1];i=i.add(a<0?e.negate():e)}}}return i}var fn=class{Point;BASE;ZERO;randomBytes;wnafPrecomputes=new WeakMap;baseCanBeBlinded;bits;constructor(e,t){Qt(e),this.randomBytes=nn(t,16),this.Point=e,this.BASE=e.BASE,this.ZERO=e.ZERO,this.bits=e.Fn.BITS}buildWnafTable(e,t,n){let r=Math.ceil(n/t)+1,i=2**(t-1),a=[],o=e;for(let e=0;e<r;e++){let e=o;for(let t=0;t<i;t++)a.push(e),e=e.add(o);o=a[a.length-1].double()}return{W:t,bits:n,windows:r,comp:a}}wnafCachedCT(e,t){let{W:n,windows:r,comp:i}=e,a=2**(n-1),o=un(t,n,r),s=this.ZERO,c=this.BASE;for(let e=0;e<r;e++){let t=o[e],n=e*a,r=Math.abs(t)-1,l=i[n];for(let e=1;e<a;e++)l=e===r?i[n+e]:l;let u=l.negate();t===0?c=c.add(i[n]):s=s.add(t<0?u:l)}return{p:s,f:c}}getWnafPrecomputes(e,t,n,r){let i=this.wnafPrecomputes.get(t),a=i?.find(t=>t.W===e&&t.bits===n);return a||(a=this.buildWnafTable(t,e,n),typeof r==`function`&&(a={...a,comp:r(a.comp)}),i||(i=[],this.wnafPrecomputes.set(t,i)),i.push(a)),a}assertPoint(e){if(!(e instanceof this.Point))throw TypeError(`\"point\" expected Point instance, got type=`+typeof e)}validateMulInput(e,t){if(this.assertPoint(e),!_t(t,G,this.Point.Fn.ORDER))throw Error(`invalid scalar`)}runCT(e,t,n,r){let i=sn(e);return i===1?this.fixedWindowCT(e,t,n):this.wnafCachedCT(this.getWnafPrecomputes(i,e,n,r),t)}mulCT(e,t,n){return this.validateMulInput(e,t),this.runCT(e,t,this.bits,n)}mulCTBlinded(e,t,n){if(this.validateMulInput(e,t),this.randomBytes===void 0)throw Error(`randomBytes is required for scalar blinding`);let r=this.Point.Fn.BITS+128,i=this.randomBytes(16);if(!nt(i)||i.length!==16)throw Error(`randomBytes returned invalid byte array`);i[0]=i[0]&63|128;let a=t+dt(i)*this.Point.Fn.ORDER;return this.runCT(e,a,r,n)}fixedWindowCT(e,t,n){let r=bt(5),i=Array(32);i[0]=this.ZERO;for(let t=1;t<32;t++)i[t]=i[t-1].add(e);let a=Math.ceil(n/5),o=this.ZERO;for(let e=a-1;e>=0;e--){if(e!==a-1)for(let e=0;e<5;e++)o=o.double();let n=Number(t>>BigInt(e*5)&r),s=i[0];for(let e=1;e<32;e++)s=e===n?i[e]:s;o=o.add(s)}return{p:o,f:o}}shouldBlind(e,t){return this.randomBytes===void 0?!1:t===G?!0:e===this.BASE?(this.baseCanBeBlinded===void 0&&(this.baseCanBeBlinded=this.mulUnsafe(this.BASE,this.Point.Fn.ORDER).is0()),this.baseCanBeBlinded):!1}mulSecret(e,t,n,r){return this.shouldBlind(e,n)?this.mulCTBlinded(e,t,r):this.mulCT(e,t,r)}mulUnsafe(e,t,n){if(this.assertPoint(e),!R(t))throw Error(`invalid scalar`);let r=sn(e);if(r===1||t>=this.Point.Fn.ORDER)return pn(this.Point,[e],[t],!0);let i=this.getWnafPrecomputes(r,e,this.bits,n);return this.wnafCachedCT(i,t).p}setWindowSize(e,t){this.assertPoint(e),en(t,this.bits),tn((Math.ceil((this.bits+128)/t)+1)*2**(t-1),this.Point.Fp.BYTES),on.set(e,t),this.wnafPrecomputes.delete(e)}hasWindowSize(e){return sn(e)!==1}};function pn(e,t,n,r=!1){if(Qt(e),rn(t,e),st(r,`allowOversized`),an(n,e.Fn,r?e.Fn.ORDER**Xt:void 0),t.length!==n.length)throw Error(`arrays of points and scalars must have equal length`);let i=t.map(e=>cn(e,4)),a=n.map(e=>ln(e,4));return dn(e.ZERO,i,a)}function mn(e,t,n){if(t){if(t.ORDER!==e)throw Error(`Field.ORDER must match order: Fp == p, Fn == n`);return W(t),t}else return Jt(e,{isLE:n})}function hn(e,t,n={},r){if(e!==`weierstrass`&&e!==`edwards`)throw Error(`expected curve type \"weierstrass\" or \"edwards\"`);if(r===void 0&&(r=e===`edwards`),!t||typeof t!=`object`)throw Error(`expected valid ${e} CURVE object`);xt(n);for(let e of[`p`,`n`,`h`]){let n=t[e];if(!(R(n)&&n!==Yt))throw Error(`CURVE.${e} must be positive bigint`)}let i=mn(t.p,n.Fp,r),a=mn(t.n,n.Fn,r),o=[`Gx`,`Gy`,`a`,e===`weierstrass`?`b`:`d`];for(let e of o)if(!i.isValid(t[e]))throw Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:i,Fn:a}}\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nlet gn=BigInt(0),_n=BigInt(1),vn=BigInt(2),yn=BigInt(4),bn=BigInt(8);function xn(e,t,n,r){let i=e.sqr(n),a=e.sqr(r),o=e.add(e.mul(t.a,i),a),s=e.add(e.ONE,e.mul(t.d,e.mul(i,a)));return e.eql(o,s)}function Sn(e,t={}){xt(t,{},{},`extraOpts`);let n=t,r=hn(`edwards`,e,n,n.FpFnLE),{Fp:i,Fn:a}=r,o=r.CURVE,{h:s}=o;if(Wt(i,o.a)!==1)throw Error(`edwards: CURVE.a must be a square in Fp for complete addition formulas`);if(Wt(i,o.d)!==-1)throw Error(`edwards: CURVE.d must be a non-square in Fp for complete addition formulas`);xt(n,{},{uvRatio:`function`,randomBytes:`function`});let c=n.randomBytes===void 0?rt:n.randomBytes,l=vn<<BigInt(i.BYTES*8)-_n;function u(e){if(!i.isOdd)throw Error(`Field does not have .isOdd()`);return i.isOdd(e)}let d=n.uvRatio===void 0?(e,t)=>{try{return{isValid:!0,value:i.sqrt(i.div(e,t))}}catch{return{isValid:!1,value:gn}}}:n.uvRatio;if(!xn(i,o,o.Gx,o.Gy))throw Error(`bad curve params: generator point`);let f=i.eql(o.a,i.neg(i.ONE))?e=>i.neg(e):i.eql(o.a,i.ONE)?e=>e:e=>i.mul(o.a,e);function p(e,t,n=!1){let r=n?_n:gn;return vt(`coordinate `+e,t,r,l),t}function m(e){if(!(e instanceof h))throw Error(`EdwardsPoint expected`)}class h{static BASE=new h(o.Gx,o.Gy,i.ONE,i.mul(o.Gx,o.Gy));static ZERO=new h(i.ZERO,i.ONE,i.ONE,i.ZERO);static Fp=i;static Fn=a;X;Y;Z;T;constructor(e,t,n,r){this.X=p(`x`,e),this.Y=p(`y`,t),this.Z=p(`z`,n,!0),this.T=p(`t`,r),Object.freeze(this)}static CURVE(){return o}static fromAffine(e){if(e instanceof h)throw Error(`extended point not allowed`);let{x:t,y:n}=e||{};return p(`x`,t),p(`y`,n),new h(t,n,i.ONE,i.mul(t,n))}static fromBytes(e,t=!1){let n=i.BYTES,{a:r,d:a}=o;e=gt(I(e,n,`point`)),st(t,`zip215`);let s=gt(e),c=e[n-1];s[n-1]=c&-129;let f=ft(s),p=t?l:i.ORDER;vt(`point.y`,f,gn,p);let m=i.sqr(f),g=i.sub(m,i.ONE),_=i.sub(i.mulN(a,m),r),{isValid:v,value:y}=d(g,_);if(!v)throw Error(`bad point: invalid y coordinate`);let b=u(y),x=(c&128)!=0;if(!t&&i.is0(y)&&x)throw Error(`bad point: x=0 and x_0=1`);return x!==b&&(y=i.neg(y)),h.fromAffine({x:y,y:f})}static fromHex(e,t=!1){return h.fromBytes(tt(e),t)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=6,t=!0){return _.setWindowSize(this,e),t||this.multiply(vn),this}assertValidity(){let e=this,{a:t,d:n}=o;if(e.is0())throw Error(`bad point: ZERO`);let{X:r,Y:a,Z:s,T:c}=e,l=i.sqr(r),u=i.sqr(a),d=i.sqr(s),f=i.sqr(d),p=i.mul(l,t),m=i.mul(i.add(p,u),d),h=i.add(f,i.mul(n,i.mul(l,u)));if(!i.eql(m,h))throw Error(`bad point: equation left != right (1)`);let g=i.mul(r,a),_=i.mul(s,c);if(!i.eql(g,_))throw Error(`bad point: equation left != right (2)`)}equals(e){m(e);let{X:t,Y:n,Z:r}=this,{X:a,Y:o,Z:s}=e,c=i.mul(t,s),l=i.mul(a,r),u=i.mul(n,s),d=i.mul(o,r);return i.eql(c,l)&&i.eql(u,d)}is0(){return this.equals(h.ZERO)}negate(){return new h(i.neg(this.X),this.Y,this.Z,i.neg(this.T))}double(){let{X:e,Y:t,Z:n}=this,r=i.sqr(e),a=i.sqr(t),o=i.mul(i.sqr(n),vn),s=f(r),c=i.addN(e,t),l=i.sub(i.subN(i.sqr(c),r),a),u=i.addN(s,a),d=i.subN(u,o),p=i.subN(s,a),m=i.mul(l,d),g=i.mul(u,p),_=i.mul(l,p),v=i.mul(d,u);return new h(m,g,v,_)}add(e){m(e);let{d:t}=o,{X:n,Y:r,Z:a,T:s}=this,{X:c,Y:l,Z:u,T:d}=e,p=i.mul(n,c),g=i.mul(r,l),_=i.mul(i.mulN(s,t),d),v=i.mul(a,u),y=i.sub(i.subN(i.mulN(i.addN(n,r),i.addN(c,l)),p),g),b=i.subN(v,_),x=i.addN(v,_),S=i.sub(g,f(p)),C=i.mul(y,b),ee=i.mul(x,S),w=i.mul(y,S),T=i.mul(b,x);return new h(C,ee,T,w)}subtract(e){return m(e),this.add(e.negate())}multiply(e){if(!a.isValidNot0(e))throw RangeError(`invalid scalar: expected 1 <= sc < curve.n`);let{p:t,f:n}=_.mulSecret(this,e,s,g);return g([t,n])[0]}multiplyUnsafe(e){if(!a.isValid(e))throw RangeError(`invalid scalar: expected 0 <= sc < curve.n`);return e===gn?h.ZERO:this.is0()||e===_n?this:_.mulUnsafe(this,e,g)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return _.mulUnsafe(this,o.n).is0()}toAffine(e){let t=this,n=e;if(n!=null&&typeof n!=`bigint`)throw TypeError(`\"invertedZ\" expected bigint, got type=`+typeof n);let{X:r,Y:a,Z:o}=t,s=t.is0();n??=s?i.create(bn):i.inv(o);let c=i.mul(r,n),l=i.mul(a,n),u=i.mul(o,n);if(s)return{x:i.ZERO,y:i.ONE};if(!i.eql(u,i.ONE))throw Error(`invZ was invalid`);return{x:c,y:l}}clearCofactor(){return s===_n?this:s===vn?this.double():s===yn?this.double().double():s===bn?this.double().double().double():this.multiplyUnsafe(s)}toBytes(){let{x:e,y:t}=this.toAffine(),n=i.toBytes(t);return n[n.length-1]|=u(e)?128:0,n}toHex(){return et(this.toBytes())}toString(){return`<Point ${this.is0()?`ZERO`:this.toHex()}>`}}let g=e=>$t(h,e),_=new fn(h,c);return _.bits>=6&&h.BASE.precompute(6),Object.freeze(h.prototype),Object.freeze(h),h}var Cn=class{static BASE;static ZERO;static Fp;static Fn;ep;constructor(e){this.ep=e}static fromBytes(e){St()}static fromHex(e){St()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(e){return this.ep.toAffine(e)}toHex(){return et(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(e){return this.assertSame(e),this.init(this.ep.add(e.ep))}subtract(e){return this.assertSame(e),this.init(this.ep.subtract(e.ep))}multiply(e){return this.init(this.ep.multiply(e))}multiplyUnsafe(e){return this.init(this.ep.multiplyUnsafe(e))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(e,t){return this.ep.precompute(e,t),this}};let wn=BigInt(1),Tn=BigInt(2),En=BigInt(5),Dn=BigInt(8),On=BigInt(`0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed`),kn={p:On,n:BigInt(`0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed`),h:Dn,a:BigInt(`0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec`),d:BigInt(`0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3`),Gx:BigInt(`0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a`),Gy:BigInt(`0x6666666666666666666666666666666666666666666666666666666666666658`)}\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n;function An(e){let t=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),a=On,o=e*e%a*e%a,s=U(U(o,Tn,a)*o%a,wn,a)*e%a,c=U(s,En,a)*s%a,l=U(c,t,a)*c%a,u=U(l,n,a)*l%a,d=U(u,r,a)*u%a;return{pow_p_5_8:U(U(U(U(d,i,a)*d%a,i,a)*d%a,t,a)*c%a,Tn,a)*e%a,b2:o}}let jn=BigInt(`19681161376707505956807079304988542015446066515923890162744021073123829784752`);function Mn(e,t){let n=On,r=H(t*t*t,n),i=An(e*H(r*r*t,n)).pow_p_5_8,a=H(e*r*i,n),o=H(t*a*a,n),s=a,c=H(a*jn,n),l=o===e,u=o===H(-e,n),d=o===H(-e*jn,n);return l&&(a=s),(u||d)&&(a=c),Vt(a,n)&&(a=H(-a,n)),{isValid:l||u,value:a}}let K=Sn(kn,{uvRatio:Mn}),q=K.Fp,Nn=K.Fn,Pn=jn,Fn=BigInt(`54469307008909316920995813868745141605393597292927456921205312896311721017578`),In=e=>Mn(wn,e),Ln=BigInt(`0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`),Rn=e=>q.create(ft(e)&Ln);var J=class e extends Cn{static BASE=new e(K.BASE);static ZERO=new e(K.ZERO);static Fp=q;static Fn=Nn;constructor(e){super(e)}static fromAffine(t){return new e(K.fromAffine(t))}assertSame(t){if(!(t instanceof e))throw Error(`RistrettoPoint expected`)}init(t){return new e(t)}static fromBytes(t){We(t,32);let{a:n,d:r}=kn,i=Rn(t);if(!ht(q.toBytes(i),t)||q.isOdd(i))throw Error(`invalid ristretto255 encoding 1`);let a=q.sqr(i),o=q.add(wn,q.mulN(n,a)),s=q.sub(wn,q.mulN(n,a)),c=q.sqr(o),l=q.sqr(s),u=q.sub(q.mulN(q.mulN(n,r),c),l),{isValid:d,value:f}=In(q.mul(u,l)),p=q.mul(f,s),m=q.mul(q.mulN(f,p),u),h=q.mul(q.addN(i,i),p);q.isOdd(h)&&(h=q.neg(h));let g=q.mul(o,m),_=q.mul(h,g);if(!d||q.isOdd(_)||q.is0(g))throw Error(`invalid ristretto255 encoding 2`);return new e(new K(h,g,q.ONE,_))}static fromHex(t){return e.fromBytes(Ye(t))}toBytes(){let{X:e,Y:t,Z:n,T:r}=this.ep,i=q.mul(q.add(n,t),q.sub(n,t)),a=q.mul(e,t),o=q.sqr(a),{value:s}=In(q.mul(i,o)),c=q.mul(s,i),l=q.mul(s,a),u=q.mul(q.mulN(c,l),r),d;if(q.isOdd(q.mul(r,u))){let n=q.mul(t,Pn),r=q.mul(e,Pn);e=n,t=r,d=q.mul(c,Fn)}else d=l;q.isOdd(q.mul(e,u))&&(t=q.neg(t));let f=q.mul(q.subN(n,t),d);return q.isOdd(f)&&(f=q.neg(f)),q.toBytes(f)}equals(e){this.assertSame(e);let{X:t,Y:n}=this.ep,{X:r,Y:i}=e.ep,a=q.eql(q.mul(t,i),q.mul(n,r)),o=q.eql(q.mul(n,i),q.mul(t,r));return a||o}is0(){return this.equals(e.ZERO)}};let zn=(Object.freeze(J.BASE),Object.freeze(J.ZERO),Object.freeze(J.prototype),Object.freeze(J),Object.freeze({Point:J})),Bn=BigInt(2**32-1),Vn=BigInt(32);function Hn(e,t=!1){return t?{h:Number(e&Bn),l:Number(e>>Vn&Bn)}:{h:Number(e>>Vn&Bn)|0,l:Number(e&Bn)|0}}function Un(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=Hn(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}let Wn=e=>e/2**32|0,Gn=e=>e>>>0;function Kn(e,t,n,r){let i=Wn(n),a=Gn(n);e.setUint32(t,r?a:i,r),e.setUint32(t+4,r?i:a,r)}let qn=(e,t,n)=>e>>>n,Jn=(e,t,n)=>e<<32-n|t>>>n,Y=(e,t,n)=>e>>>n|t<<32-n,X=(e,t,n)=>e<<32-n|t>>>n,Yn=(e,t,n)=>e<<64-n|t>>>n-32,Xn=(e,t,n)=>e>>>n-32|t<<64-n;function Z(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}let Zn=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),Qn=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,$n=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),er=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,tr=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),nr=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0;function rr(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1}let ir=e=>e?`\"${e}\" `:``;function ar(e,t=``){if(typeof e!=`number`)throw TypeError(ir(t)+`expected number, got `+typeof e);if(!Number.isSafeInteger(e)||e<0)throw RangeError(ir(t)+`expected integer >= 0, got `+e);return e}function or(e,t,n=``){if(rr(e)&&(t===void 0||e.length===t))return e;t!==void 0&&ar(t,`length`);let r=rr(e),i=t===void 0?``:` of length ${t}`,a=r?`length=${e.length}`:`type=${typeof e}`,o=ir(n)+`expected Uint8Array`+i+`, got `+a;throw r?RangeError(o):TypeError(o)}let sr=(e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError((t===`object`?``:`\"${t}\" `)+`expected object, got type=`+typeof e)},cr=(e,t)=>{sr(e,t);let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)throw TypeError(`\"${t}\" expected plain object`);if(Object.hasOwn(e,`__proto__`))throw TypeError(`\"${t}.__proto__\" is not allowed`)};function lr(e,t=!0){if(e.destroyed)throw Error(`hash was destroyed`);if(t&&e.finished)throw Error(`digest() was already called`)}function ur(e,t){or(e,void 0,`output`);let n=t.outputLen;if(!(e.length>=n))throw RangeError(`\"output\" expected length >= `+n)}function dr(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function fr(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function pr(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];or(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}function mr(e,t,n=`opts`){return cr(e,`defaults`),t!==void 0&&cr(t,n),Object.assign(Object.create(null),e,t)}function hr(e,t={}){if(typeof e!=`function`)throw TypeError(`\"hashCons\" expected function, got type=`+typeof e);t=mr({},t,`info`);let n=(t,n)=>e(n).update(t).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=t=>e(t),Object.assign(n,t),Object.freeze(n)}let gr=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});var _r=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,n,r){this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=fr(this.buffer)}update(e){lr(this),or(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length,a=!1;for(let o=0;o<i;){let s=Math.min(r-this.pos,i-o);if(s===r){let t=fr(e);for(;r<=i-o;o+=r)this.process(t,o);a=!0;continue}n.set(o===0&&s===i?e:e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===r&&(this.process(t,0),this.pos=0,a=!0)}return this.length+=e.length,a&&this.roundClean(),this}digestInto(e){lr(this),ur(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,t.fill(0,a),this.padOffset>r-a&&(this.process(n,0),t.fill(0)),Kn(n,r-8,this.length*8,i),this.process(n,0),this.roundClean();let o=e===t?n:fr(e),s=this.outputLen,c=s/4,l=this.get();if(s%4||c>l.length)throw Error(`invalid outputLen`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneIntoMeta(e){let{buffer:t,length:n,finished:r,destroyed:i,pos:a}=this;return e.destroyed=i,e.finished=r,e.length=n,e.pos=a,a&&e.buffer.set(t),e}clone(){return this._cloneInto()}};let vr=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),yr=Un(`0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`).map(e=>BigInt(e))),br=yr[0],xr=yr[1],Q=new Uint32Array(80),$=new Uint32Array(80);var Sr=class extends _r{Ah=0;Al=0;Bh=0;Bl=0;Ch=0;Cl=0;Dh=0;Dl=0;Eh=0;El=0;Fh=0;Fl=0;Gh=0;Gl=0;Hh=0;Hl=0;constructor(e,t){super(128,e,16,!1),this.Ah=t[0]|0,this.Al=t[1]|0,this.Bh=t[2]|0,this.Bl=t[3]|0,this.Ch=t[4]|0,this.Cl=t[5]|0,this.Dh=t[6]|0,this.Dl=t[7]|0,this.Eh=t[8]|0,this.El=t[9]|0,this.Fh=t[10]|0,this.Fl=t[11]|0,this.Gh=t[12]|0,this.Gl=t[13]|0,this.Hh=t[14]|0,this.Hl=t[15]|0}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,t){for(let n=0;n<16;n++,t+=4)Q[n]=e.getUint32(t),$[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=Q[e-15]|0,n=$[e-15]|0,r=Y(t,n,1)^Y(t,n,8)^qn(t,n,7),i=X(t,n,1)^X(t,n,8)^Jn(t,n,7),a=Q[e-2]|0,o=$[e-2]|0,s=Y(a,o,19)^Yn(a,o,61)^qn(a,o,6),c=X(a,o,19)^Xn(a,o,61)^Jn(a,o,6),l=$n(i,c,$[e-7],$[e-16]),u=er(l,r,s,Q[e-7],Q[e-16]);Q[e]=u|0,$[e]=l|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=Y(u,d,14)^Y(u,d,18)^Yn(u,d,41),v=X(u,d,14)^X(u,d,18)^Xn(u,d,41),y=u&f^~u&m,b=d&p^~d&h,x=tr(_,v,b,xr[e],$[e]),S=nr(x,g,t,y,br[e],Q[e]),C=x|0,ee=Y(n,r,28)^Yn(n,r,34)^Yn(n,r,39),w=X(n,r,28)^Xn(n,r,34)^Xn(n,r,39),T=n&i^n&o^i&o,E=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=Z(c|0,l|0,S|0,C|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let D=Zn(C,w,E);n=Qn(D,S,ee,T),r=D|0}({h:n,l:r}=Z(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=Z(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=Z(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=Z(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=Z(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=Z(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=Z(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=Z(this.Hh|0,this.Hl|0,g|0,_|0),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){dr(Q,$)}destroy(){this.destroyed=!0,dr(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Cr=class extends Sr{constructor(){super(64,vr)}};let wr=hr(()=>new Cr,gr(3)),Tr=BigInt(3);function Er(e,t,...n){if(!nt(t))throw TypeError(`${e}: Uint8Array expected`);if(n.length&&!n.includes(t.length))throw RangeError(`${e}: Uint8Array expected of length ${n}, not of length=${t.length}`)}function Dr(...e){for(let t of e)t.fill(0)}let Or=bt(256),kr=e=>mt(e<<Tr&Or,32),Ar=e=>ft(e)>>Tr;function jr(e){Er(`seed`,e,32);let t=wr(e);t[0]&=248,t[31]&=63,t[31]|=64;let n=kr(Ar(t.subarray(0,32))),r=t.subarray(32,64),i=pr(n,r);return Dr(n,r,t),i}let Mr=Be;function Nr(e,t=De(),n=2048,r){return{password:Me(Mr,v(e),v(t),{c:n,dkLen:64}),rounds:n,salt:t}}var Pr={256:ze,512:Mr},Fr=Pr[256];Pr[512];var Ir=`abandon|ability|able|about|above|absent|absorb|abstract|absurd|abuse|access|accident|account|accuse|achieve|acid|acoustic|acquire|across|act|action|actor|actress|actual|adapt|add|addict|address|adjust|admit|adult|advance|advice|aerobic|affair|afford|afraid|again|age|agent|agree|ahead|aim|air|airport|aisle|alarm|album|alcohol|alert|alien|all|alley|allow|almost|alone|alpha|already|also|alter|always|amateur|amazing|among|amount|amused|analyst|anchor|ancient|anger|angle|angry|animal|ankle|announce|annual|another|answer|antenna|antique|anxiety|any|apart|apology|appear|apple|approve|april|arch|arctic|area|arena|argue|arm|armed|armor|army|around|arrange|arrest|arrive|arrow|art|artefact|artist|artwork|ask|aspect|assault|asset|assist|assume|asthma|athlete|atom|attack|attend|attitude|attract|auction|audit|august|aunt|author|auto|autumn|average|avocado|avoid|awake|aware|away|awesome|awful|awkward|axis|baby|bachelor|bacon|badge|bag|balance|balcony|ball|bamboo|banana|banner|bar|barely|bargain|barrel|base|basic|basket|battle|beach|bean|beauty|because|become|beef|before|begin|behave|behind|believe|below|belt|bench|benefit|best|betray|better|between|beyond|bicycle|bid|bike|bind|biology|bird|birth|bitter|black|blade|blame|blanket|blast|bleak|bless|blind|blood|blossom|blouse|blue|blur|blush|board|boat|body|boil|bomb|bone|bonus|book|boost|border|boring|borrow|boss|bottom|bounce|box|boy|bracket|brain|brand|brass|brave|bread|breeze|brick|bridge|brief|bright|bring|brisk|broccoli|broken|bronze|broom|brother|brown|brush|bubble|buddy|budget|buffalo|build|bulb|bulk|bullet|bundle|bunker|burden|burger|burst|bus|business|busy|butter|buyer|buzz|cabbage|cabin|cable|cactus|cage|cake|call|calm|camera|camp|can|canal|cancel|candy|cannon|canoe|canvas|canyon|capable|capital|captain|car|carbon|card|cargo|carpet|carry|cart|case|cash|casino|castle|casual|cat|catalog|catch|category|cattle|caught|cause|caution|cave|ceiling|celery|cement|census|century|cereal|certain|chair|chalk|champion|change|chaos|chapter|charge|chase|chat|cheap|check|cheese|chef|cherry|chest|chicken|chief|child|chimney|choice|choose|chronic|chuckle|chunk|churn|cigar|cinnamon|circle|citizen|city|civil|claim|clap|clarify|claw|clay|clean|clerk|clever|click|client|cliff|climb|clinic|clip|clock|clog|close|cloth|cloud|clown|club|clump|cluster|clutch|coach|coast|coconut|code|coffee|coil|coin|collect|color|column|combine|come|comfort|comic|common|company|concert|conduct|confirm|congress|connect|consider|control|convince|cook|cool|copper|copy|coral|core|corn|correct|cost|cotton|couch|country|couple|course|cousin|cover|coyote|crack|cradle|craft|cram|crane|crash|crater|crawl|crazy|cream|credit|creek|crew|cricket|crime|crisp|critic|crop|cross|crouch|crowd|crucial|cruel|cruise|crumble|crunch|crush|cry|crystal|cube|culture|cup|cupboard|curious|current|curtain|curve|cushion|custom|cute|cycle|dad|damage|damp|dance|danger|daring|dash|daughter|dawn|day|deal|debate|debris|decade|december|decide|decline|decorate|decrease|deer|defense|define|defy|degree|delay|deliver|demand|demise|denial|dentist|deny|depart|depend|deposit|depth|deputy|derive|describe|desert|design|desk|despair|destroy|detail|detect|develop|device|devote|diagram|dial|diamond|diary|dice|diesel|diet|differ|digital|dignity|dilemma|dinner|dinosaur|direct|dirt|disagree|discover|disease|dish|dismiss|disorder|display|distance|divert|divide|divorce|dizzy|doctor|document|dog|doll|dolphin|domain|donate|donkey|donor|door|dose|double|dove|draft|dragon|drama|drastic|draw|dream|dress|drift|drill|drink|drip|drive|drop|drum|dry|duck|dumb|dune|during|dust|dutch|duty|dwarf|dynamic|eager|eagle|early|earn|earth|easily|east|easy|echo|ecology|economy|edge|edit|educate|effort|egg|eight|either|elbow|elder|electric|elegant|element|elephant|elevator|elite|else|embark|embody|embrace|emerge|emotion|employ|empower|empty|enable|enact|end|endless|endorse|enemy|energy|enforce|engage|engine|enhance|enjoy|enlist|enough|enrich|enroll|ensure|enter|entire|entry|envelope|episode|equal|equip|era|erase|erode|erosion|error|erupt|escape|essay|essence|estate|eternal|ethics|evidence|evil|evoke|evolve|exact|example|excess|exchange|excite|exclude|excuse|execute|exercise|exhaust|exhibit|exile|exist|exit|exotic|expand|expect|expire|explain|expose|express|extend|extra|eye|eyebrow|fabric|face|faculty|fade|faint|faith|fall|false|fame|family|famous|fan|fancy|fantasy|farm|fashion|fat|fatal|father|fatigue|fault|favorite|feature|february|federal|fee|feed|feel|female|fence|festival|fetch|fever|few|fiber|fiction|field|figure|file|film|filter|final|find|fine|finger|finish|fire|firm|first|fiscal|fish|fit|fitness|fix|flag|flame|flash|flat|flavor|flee|flight|flip|float|flock|floor|flower|fluid|flush|fly|foam|focus|fog|foil|fold|follow|food|foot|force|forest|forget|fork|fortune|forum|forward|fossil|foster|found|fox|fragile|frame|frequent|fresh|friend|fringe|frog|front|frost|frown|frozen|fruit|fuel|fun|funny|furnace|fury|future|gadget|gain|galaxy|gallery|game|gap|garage|garbage|garden|garlic|garment|gas|gasp|gate|gather|gauge|gaze|general|genius|genre|gentle|genuine|gesture|ghost|giant|gift|giggle|ginger|giraffe|girl|give|glad|glance|glare|glass|glide|glimpse|globe|gloom|glory|glove|glow|glue|goat|goddess|gold|good|goose|gorilla|gospel|gossip|govern|gown|grab|grace|grain|grant|grape|grass|gravity|great|green|grid|grief|grit|grocery|group|grow|grunt|guard|guess|guide|guilt|guitar|gun|gym|habit|hair|half|hammer|hamster|hand|happy|harbor|hard|harsh|harvest|hat|have|hawk|hazard|head|health|heart|heavy|hedgehog|height|hello|helmet|help|hen|hero|hidden|high|hill|hint|hip|hire|history|hobby|hockey|hold|hole|holiday|hollow|home|honey|hood|hope|horn|horror|horse|hospital|host|hotel|hour|hover|hub|huge|human|humble|humor|hundred|hungry|hunt|hurdle|hurry|hurt|husband|hybrid|ice|icon|idea|identify|idle|ignore|ill|illegal|illness|image|imitate|immense|immune|impact|impose|improve|impulse|inch|include|income|increase|index|indicate|indoor|industry|infant|inflict|inform|inhale|inherit|initial|inject|injury|inmate|inner|innocent|input|inquiry|insane|insect|inside|inspire|install|intact|interest|into|invest|invite|involve|iron|island|isolate|issue|item|ivory|jacket|jaguar|jar|jazz|jealous|jeans|jelly|jewel|job|join|joke|journey|joy|judge|juice|jump|jungle|junior|junk|just|kangaroo|keen|keep|ketchup|key|kick|kid|kidney|kind|kingdom|kiss|kit|kitchen|kite|kitten|kiwi|knee|knife|knock|know|lab|label|labor|ladder|lady|lake|lamp|language|laptop|large|later|latin|laugh|laundry|lava|law|lawn|lawsuit|layer|lazy|leader|leaf|learn|leave|lecture|left|leg|legal|legend|leisure|lemon|lend|length|lens|leopard|lesson|letter|level|liar|liberty|library|license|life|lift|light|like|limb|limit|link|lion|liquid|list|little|live|lizard|load|loan|lobster|local|lock|logic|lonely|long|loop|lottery|loud|lounge|love|loyal|lucky|luggage|lumber|lunar|lunch|luxury|lyrics|machine|mad|magic|magnet|maid|mail|main|major|make|mammal|man|manage|mandate|mango|mansion|manual|maple|marble|march|margin|marine|market|marriage|mask|mass|master|match|material|math|matrix|matter|maximum|maze|meadow|mean|measure|meat|mechanic|medal|media|melody|melt|member|memory|mention|menu|mercy|merge|merit|merry|mesh|message|metal|method|middle|midnight|milk|million|mimic|mind|minimum|minor|minute|miracle|mirror|misery|miss|mistake|mix|mixed|mixture|mobile|model|modify|mom|moment|monitor|monkey|monster|month|moon|moral|more|morning|mosquito|mother|motion|motor|mountain|mouse|move|movie|much|muffin|mule|multiply|muscle|museum|mushroom|music|must|mutual|myself|mystery|myth|naive|name|napkin|narrow|nasty|nation|nature|near|neck|need|negative|neglect|neither|nephew|nerve|nest|net|network|neutral|never|news|next|nice|night|noble|noise|nominee|noodle|normal|north|nose|notable|note|nothing|notice|novel|now|nuclear|number|nurse|nut|oak|obey|object|oblige|obscure|observe|obtain|obvious|occur|ocean|october|odor|off|offer|office|often|oil|okay|old|olive|olympic|omit|once|one|onion|online|only|open|opera|opinion|oppose|option|orange|orbit|orchard|order|ordinary|organ|orient|original|orphan|ostrich|other|outdoor|outer|output|outside|oval|oven|over|own|owner|oxygen|oyster|ozone|pact|paddle|page|pair|palace|palm|panda|panel|panic|panther|paper|parade|parent|park|parrot|party|pass|patch|path|patient|patrol|pattern|pause|pave|payment|peace|peanut|pear|peasant|pelican|pen|penalty|pencil|people|pepper|perfect|permit|person|pet|phone|photo|phrase|physical|piano|picnic|picture|piece|pig|pigeon|pill|pilot|pink|pioneer|pipe|pistol|pitch|pizza|place|planet|plastic|plate|play|please|pledge|pluck|plug|plunge|poem|poet|point|polar|pole|police|pond|pony|pool|popular|portion|position|possible|post|potato|pottery|poverty|powder|power|practice|praise|predict|prefer|prepare|present|pretty|prevent|price|pride|primary|print|priority|prison|private|prize|problem|process|produce|profit|program|project|promote|proof|property|prosper|protect|proud|provide|public|pudding|pull|pulp|pulse|pumpkin|punch|pupil|puppy|purchase|purity|purpose|purse|push|put|puzzle|pyramid|quality|quantum|quarter|question|quick|quit|quiz|quote|rabbit|raccoon|race|rack|radar|radio|rail|rain|raise|rally|ramp|ranch|random|range|rapid|rare|rate|rather|raven|raw|razor|ready|real|reason|rebel|rebuild|recall|receive|recipe|record|recycle|reduce|reflect|reform|refuse|region|regret|regular|reject|relax|release|relief|rely|remain|remember|remind|remove|render|renew|rent|reopen|repair|repeat|replace|report|require|rescue|resemble|resist|resource|response|result|retire|retreat|return|reunion|reveal|review|reward|rhythm|rib|ribbon|rice|rich|ride|ridge|rifle|right|rigid|ring|riot|ripple|risk|ritual|rival|river|road|roast|robot|robust|rocket|romance|roof|rookie|room|rose|rotate|rough|round|route|royal|rubber|rude|rug|rule|run|runway|rural|sad|saddle|sadness|safe|sail|salad|salmon|salon|salt|salute|same|sample|sand|satisfy|satoshi|sauce|sausage|save|say|scale|scan|scare|scatter|scene|scheme|school|science|scissors|scorpion|scout|scrap|screen|script|scrub|sea|search|season|seat|second|secret|section|security|seed|seek|segment|select|sell|seminar|senior|sense|sentence|series|service|session|settle|setup|seven|shadow|shaft|shallow|share|shed|shell|sheriff|shield|shift|shine|ship|shiver|shock|shoe|shoot|shop|short|shoulder|shove|shrimp|shrug|shuffle|shy|sibling|sick|side|siege|sight|sign|silent|silk|silly|silver|similar|simple|since|sing|siren|sister|situate|six|size|skate|sketch|ski|skill|skin|skirt|skull|slab|slam|sleep|slender|slice|slide|slight|slim|slogan|slot|slow|slush|small|smart|smile|smoke|smooth|snack|snake|snap|sniff|snow|soap|soccer|social|sock|soda|soft|solar|soldier|solid|solution|solve|someone|song|soon|sorry|sort|soul|sound|soup|source|south|space|spare|spatial|spawn|speak|special|speed|spell|spend|sphere|spice|spider|spike|spin|spirit|split|spoil|sponsor|spoon|sport|spot|spray|spread|spring|spy|square|squeeze|squirrel|stable|stadium|staff|stage|stairs|stamp|stand|start|state|stay|steak|steel|stem|step|stereo|stick|still|sting|stock|stomach|stone|stool|story|stove|strategy|street|strike|strong|struggle|student|stuff|stumble|style|subject|submit|subway|success|such|sudden|suffer|sugar|suggest|suit|summer|sun|sunny|sunset|super|supply|supreme|sure|surface|surge|surprise|surround|survey|suspect|sustain|swallow|swamp|swap|swarm|swear|sweet|swift|swim|swing|switch|sword|symbol|symptom|syrup|system|table|tackle|tag|tail|talent|talk|tank|tape|target|task|taste|tattoo|taxi|teach|team|tell|ten|tenant|tennis|tent|term|test|text|thank|that|theme|then|theory|there|they|thing|this|thought|three|thrive|throw|thumb|thunder|ticket|tide|tiger|tilt|timber|time|tiny|tip|tired|tissue|title|toast|tobacco|today|toddler|toe|together|toilet|token|tomato|tomorrow|tone|tongue|tonight|tool|tooth|top|topic|topple|torch|tornado|tortoise|toss|total|tourist|toward|tower|town|toy|track|trade|traffic|tragic|train|transfer|trap|trash|travel|tray|treat|tree|trend|trial|tribe|trick|trigger|trim|trip|trophy|trouble|truck|true|truly|trumpet|trust|truth|try|tube|tuition|tumble|tuna|tunnel|turkey|turn|turtle|twelve|twenty|twice|twin|twist|two|type|typical|ugly|umbrella|unable|unaware|uncle|uncover|under|undo|unfair|unfold|unhappy|uniform|unique|unit|universe|unknown|unlock|until|unusual|unveil|update|upgrade|uphold|upon|upper|upset|urban|urge|usage|use|used|useful|useless|usual|utility|vacant|vacuum|vague|valid|valley|valve|van|vanish|vapor|various|vast|vault|vehicle|velvet|vendor|venture|venue|verb|verify|version|very|vessel|veteran|viable|vibrant|vicious|victory|video|view|village|vintage|violin|virtual|virus|visa|visit|visual|vital|vivid|vocal|voice|void|volcano|volume|vote|voyage|wage|wagon|wait|walk|wall|walnut|want|warfare|warm|warrior|wash|wasp|waste|water|wave|way|wealth|weapon|wear|weasel|weather|web|wedding|weekend|weird|welcome|west|wet|whale|what|wheat|wheel|when|where|whip|whisper|wide|width|wife|wild|will|win|window|wine|wing|wink|winner|winter|wire|wisdom|wise|wish|witness|wolf|woman|wonder|wood|wool|word|work|world|worry|worth|wrap|wreck|wrestle|wrist|write|wrong|yard|year|yellow|you|young|youth|zebra|zero|zone|zoo`.split(`|`),Lr=`Invalid mnemonic`,Rr=`Invalid entropy`,zr=`Invalid mnemonic checksum`;function Br(e){return(e||``).normalize(`NFKD`)}function Vr(e){return Number.parseInt(e,2)}function Hr(e){return e.map(e=>e.toString(2).padStart(8,`0`)).join(``)}function Ur(e){return Hr(Array.from(Fr(e))).slice(0,e.length*8/32)}function Wr(e,t=Ir){let n=Br(e).split(` `);if(n.length%3!=0)throw Error(Lr);let r=n.map(e=>{let n=t.indexOf(e);if(n===-1)throw Error(Lr);return n.toString(2).padStart(11,`0`)}).join(``),i=Math.floor(r.length/33)*32,a=r.slice(0,i),o=r.slice(i),s=a.match(/(.{1,8})/g)?.map(Vr);if(!s||s.length%4!=0||s.length<16||s.length>32)throw Error(Rr);let c=v(s);if(Ur(c)!==o)throw Error(zr);return c}function Gr(e,t=Ir){if(e.length%4!=0||e.length<16||e.length>32)throw Error(Rr);let n=`${Hr(Array.from(e))}${Ur(e)}`.match(/(.{1,11})/g)?.map(e=>t[Vr(e)]);if(!n||n.length<12)throw Error(`Unable to map entropy to mnemonic`);return n.join(` `)}function Kr(e,t){try{Wr(e,t)}catch{return!1}return!0}function qr(e,t,n){return Wr(e,t)}function Jr(e,t){return Kr(e,t)}function Yr(e,t=``,n,r){if(!Jr(e,n))throw Error(`Invalid bip39 mnemonic specified`);return Nr(qr(e,n),_(`mnemonic${t}`)).password.slice(0,32)}function Xr(e){let t=v(e);if(t.length!==32)throw Error(`Expected a seed of 32 bytes, found ${t.length}`);let n=jr(t),r=ft(n.subarray(0,32))>>3n,i=zn.Point.BASE.multiply(r).toBytes();return{publicKey:new Uint8Array(i),secretKey:new Uint8Array(n)}}self.addEventListener(`message`,async e=>{let{taskId:t,task:n,data:r}=e.data;try{let e;switch(n){case`test`:e=`ready`;break;case`entropyToMnemonic`:if(!r.entropy)throw Error(`Entropy data is required`);e=Gr(r.entropy);break;case`entropyToKeypair`:if(!r.entropy)throw Error(`Entropy data is required`);e=Zr(r.entropy);break;default:throw Error(`Unknown task: ${n}`)}let i={taskId:t,result:e};self.postMessage(i)}catch(e){let n={taskId:t,error:e instanceof Error?e.message:`Unknown error`};self.postMessage(n)}});function Zr(e){let t=Gr(e),{publicKey:n,secretKey:r}=Xr(Yr(t));return{mnemonic:t,publicKey:n,secretKey:r}}})();";
|
|
2
|
+
var jsContent = "(function(){function e(e){return e(`return this`)}let t=typeof globalThis<`u`?globalThis:typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:e(Function);function n(e,n){return t[e]===void 0?n:t[e]}let r=n(`TextEncoder`,class{encode(e){let t=e.length,n=new Uint8Array(t);for(let r=0;r<t;r++)n[r]=e.charCodeAt(r);return n}});function i(e){return typeof e==`function`}function a(){return NaN}let o=n(`BigInt`,a),s=`0123456789abcdef`,c=new Uint8Array(256),l=new Uint8Array(256*256);for(let e=0;e<16;e++)c[s[e].charCodeAt(0)|0]=e|0,e>9&&(c[s[e].toUpperCase().charCodeAt(0)|0]=e|0);for(let e=0;e<256;e++){let t=e<<8;for(let n=0;n<256;n++)l[t|n]=c[e]<<4|c[n]}function u(e,t=-1){if(!e)return new Uint8Array;let n=e.startsWith(`0x`)?2:0,r=Math.ceil((e.length-n)/2),i=Math.ceil(t===-1?r:t/8),a=new Uint8Array(i),o=i>r?i-r:0;for(let t=o;t<i;t++,n+=2)a[t]=l[e.charCodeAt(n)<<8|e.charCodeAt(n+1)];return a}let d=/^0x[\\da-fA-F]+$/;function f(e,t=-1,n){return typeof e==`string`&&(e===`0x`||d.test(e))&&(t===-1?n||e.length%2==0:e.length===2+Math.ceil(t/4))}typeof o==`function`&&o.asIntN;let p=typeof t.Buffer==`function`&&typeof t.Buffer.isBuffer==`function`;t.process;function m(e){return p&&!!e&&i(e.readDoubleLE)&&t.Buffer.isBuffer(e)}function h(e){return(e&&e.constructor)===Uint8Array||e instanceof Uint8Array}let g=new r;function _(e){return e?g.encode(e.toString()):new Uint8Array}function v(e,t=!1){if(t&&e==null)throw Error(`u8aToU8a: Expected non-null, non-undefined value`);return h(e)?m(e)?new Uint8Array(e):e:f(e)?u(e):Array.isArray(e)?new Uint8Array(e):_(e)}function y(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1}let b=e=>e?`\"${e}\" `:``;function x(e,t=``){if(typeof e!=`number`)throw TypeError(b(t)+`expected number, got `+typeof e);if(!Number.isSafeInteger(e)||e<0)throw RangeError(b(t)+`expected integer >= 0, got `+e);return e}function S(e,t,n=``){if(y(e)&&(t===void 0||e.length===t))return e;t!==void 0&&x(t,`length`);let r=y(e),i=t===void 0?``:` of length ${t}`,a=r?`length=${e.length}`:`type=${typeof e}`,o=b(n)+`expected Uint8Array`+i+`, got `+a;throw r?RangeError(o):TypeError(o)}function C(e){if(typeof e!=`function`||typeof e.create!=`function`)throw TypeError(`expected hash wrapped by utils.createHasher`);if(x(e.outputLen),x(e.blockLen),e.outputLen<1||e.blockLen<1)throw Error(`hash blockLen / outputLen must be >= 1`)}let ee=(e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError((t===`object`?``:`\"${t}\" `)+`expected object, got type=`+typeof e)},w=(e,t)=>{ee(e,t);let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)throw TypeError(`\"${t}\" expected plain object`);if(Object.hasOwn(e,`__proto__`))throw TypeError(`\"${t}.__proto__\" is not allowed`)};function T(e,t=!0){if(e.destroyed)throw Error(`hash was destroyed`);if(t&&e.finished)throw Error(`digest() was already called`)}function te(e,t){S(e,void 0,`output`);let n=t.outputLen;if(!(e.length>=n))throw RangeError(`\"output\" expected length >= `+n)}function E(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function D(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function O(e,t){return e<<32-t|e>>>t}let ne=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,re=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function ie(e){if(S(e),ne)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=re[e[n]];return t}function ae(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function oe(e){if(typeof e!=`string`)throw TypeError(`hex string expected, got `+typeof e);if(ne)try{return Uint8Array.fromHex(e)}catch(e){throw e instanceof SyntaxError?RangeError(e.message):e}let t=e.length,n=t/2;if(t%2)throw RangeError(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=ae(e.charCodeAt(i)),a=ae(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw RangeError(`hex string expected, got non-hex character \"`+t+`\" at index `+i)}r[t]=n*16+a}return r}function se(e){if(typeof e!=`string`)throw TypeError(`string expected`);let t=new TextEncoder().encode(e);try{return new Uint8Array(t)}finally{E(t)}}function ce(e,t=``){return typeof e==`string`?se(e):S(e,void 0,t)}function le(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];S(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}function ue(e,t,n=`opts`){return w(e,`defaults`),t!==void 0&&w(t,n),Object.assign(Object.create(null),e,t)}function de(e,t={}){if(typeof e!=`function`)throw TypeError(`\"hashCons\" expected function, got type=`+typeof e);t=ue({},t,`info`);let n=(t,n)=>e(n).update(t).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=t=>e(t),Object.assign(n,t),Object.freeze(n)}function fe(e=32){x(e,`bytesLength`);let t=typeof globalThis==`object`?globalThis.crypto:null;if(typeof t?.getRandomValues!=`function`)throw Error(`crypto.getRandomValues must be defined`);if(e>65536)throw RangeError(`\"bytesLength\" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}let pe=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])}),k=BigInt(2**32-1),me=BigInt(32);function he(e,t=!1){return t?{h:Number(e&k),l:Number(e>>me&k)}:{h:Number(e>>me&k)|0,l:Number(e&k)|0}}function ge(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=he(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}let _e=e=>e/2**32|0,ve=e=>e>>>0;function ye(e,t,n,r){let i=_e(n),a=ve(n);e.setUint32(t,r?a:i,r),e.setUint32(t+4,r?i:a,r)}let be=(e,t,n)=>e>>>n,xe=(e,t,n)=>e<<32-n|t>>>n,A=(e,t,n)=>e>>>n|t<<32-n,j=(e,t,n)=>e<<32-n|t>>>n,Se=(e,t,n)=>e<<64-n|t>>>n-32,Ce=(e,t,n)=>e>>>n-32|t<<64-n;function M(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}let we=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),Te=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,Ee=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),De=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,Oe=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),ke=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0;function Ae(e,t,n){return e&t^~e&n}function je(e,t,n){return e&t^e&n^t&n}var Me=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,n,r){this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=D(this.buffer)}update(e){T(this),S(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length,a=!1;for(let o=0;o<i;){let s=Math.min(r-this.pos,i-o);if(s===r){let t=D(e);for(;r<=i-o;o+=r)this.process(t,o);a=!0;continue}n.set(o===0&&s===i?e:e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===r&&(this.process(t,0),this.pos=0,a=!0)}return this.length+=e.length,a&&this.roundClean(),this}digestInto(e){T(this),te(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,t.fill(0,a),this.padOffset>r-a&&(this.process(n,0),t.fill(0)),ye(n,r-8,this.length*8,i),this.process(n,0),this.roundClean();let o=e===t?n:D(e),s=this.outputLen,c=s/4,l=this.get();if(s%4||c>l.length)throw Error(`invalid outputLen`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneIntoMeta(e){let{buffer:t,length:n,finished:r,destroyed:i,pos:a}=this;return e.destroyed=i,e.finished=r,e.length=n,e.pos=a,a&&e.buffer.set(t),e}clone(){return this._cloneInto()}};let Ne=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Pe=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),Fe=t.crypto;function Ie(e){return Fe.getRandomValues(e)}function Le(e=32){return Ie(new Uint8Array(e))}var Re=class{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(e,t){if(C(e),S(t,void 0,`key`),this.iHash=e.create(),typeof this.iHash.update!=`function`)throw Error(`expected Hash instance`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let n=this.blockLen,r=new Uint8Array(n);r.set(t.length>n?e.create().update(t).digest():t);for(let e=0;e<r.length;e++)r[e]^=54;this.iHash.update(r),this.oHash=e.create();for(let e=0;e<r.length;e++)r[e]^=106;this.oHash.update(r),E(r)}update(e){return T(this),this.iHash.update(e),this}digestInto(e){T(this),te(e,this),this.finished=!0;let t=e.subarray(0,this.outputLen);this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o,canXOF:s}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.canXOF=s,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};let ze=(()=>{let e=((e,t,n)=>new Re(e,t).update(n).digest());return e.create=(e,t)=>new Re(e,t),e})();function Be(e,t,n,r){C(e);let{c:i,dkLen:a,asyncTick:o}=ue({dkLen:32,asyncTick:10},r);if(x(i,`c`),x(a,`dkLen`),x(o,`asyncTick`),i<1)throw Error(`\"c\" (iterations) must be >= 1`);if(a<1)throw Error(`\"dkLen\" must be >= 1`);if(a>(2**32-1)*e.outputLen)throw Error(`derived key too long`);let s=ce(t,`password`);try{let t=ce(n,`salt`);try{let n=new Uint8Array(a),{iHash:r,oHash:c,outputLen:l}=ze.create(e,s);return{c:i,dkLen:a,asyncTick:o,DK:n,outputLen:l,eng:Ve(r,c,t,new Uint8Array(l))}}finally{typeof n==`string`&&E(t)}}finally{typeof t==`string`&&E(s)}}function Ve(e,t,n,r){let i=new Uint8Array(4),a=D(i),o=e._cloneInto().update(n),s=t._cloneInto(),c=e._cloneInto,l=t._cloneInto;return{u1:(e,n)=>{a.setInt32(0,e,!1),o._cloneInto(s).update(i).digestInto(r),t._cloneInto(s).update(r).digestInto(r),n.set(r.subarray(0,n.length))},rounds:(n,i)=>{for(let a=1;a<n;a++){c.call(e,s).update(r).digestInto(r),l.call(t,s).update(r).digestInto(r);for(let e=0;e<i.length;e++)i[e]^=r[e]}},output:n=>(e.destroy(),t.destroy(),o.destroy(),s.destroy(),E(r),n)}}function He(e,t,n,r){let{c:i,dkLen:a,DK:o,outputLen:s,eng:c}=Be(e,t,n,r);for(let e=1,t=0;t<a;e++,t+=s){let n=o.subarray(t,t+s);c.u1(e,n),c.rounds(i,n)}return c.output(o)}let Ue=Uint32Array.from([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]),N=new Uint32Array(64);var We=class extends Me{A=0;B=0;C=0;D=0;E=0;F=0;G=0;H=0;constructor(e,t){super(64,e,8,!1),this.A=t[0]|0,this.B=t[1]|0,this.C=t[2]|0,this.D=t[3]|0,this.E=t[4]|0,this.F=t[5]|0,this.G=t[6]|0,this.H=t[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,t){for(let n=0;n<16;n++,t+=4)N[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=N[e-15],n=N[e-2],r=O(t,7)^O(t,18)^t>>>3,i=O(n,17)^O(n,19)^n>>>10;N[e]=i+N[e-7]+r+N[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=O(o,6)^O(o,11)^O(o,25),u=l+t+Ae(o,s,c)+Ue[e]+N[e]|0,d=(O(n,2)^O(n,13)^O(n,22))+je(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){E(N)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),E(this.buffer)}},Ge=class extends We{constructor(){super(32,Ne)}};let Ke=ge(`0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`).map(e=>BigInt(e))),qe=Ke[0],Je=Ke[1],P=new Uint32Array(80),F=new Uint32Array(80);var Ye=class extends Me{Ah=0;Al=0;Bh=0;Bl=0;Ch=0;Cl=0;Dh=0;Dl=0;Eh=0;El=0;Fh=0;Fl=0;Gh=0;Gl=0;Hh=0;Hl=0;constructor(e,t){super(128,e,16,!1),this.Ah=t[0]|0,this.Al=t[1]|0,this.Bh=t[2]|0,this.Bl=t[3]|0,this.Ch=t[4]|0,this.Cl=t[5]|0,this.Dh=t[6]|0,this.Dl=t[7]|0,this.Eh=t[8]|0,this.El=t[9]|0,this.Fh=t[10]|0,this.Fl=t[11]|0,this.Gh=t[12]|0,this.Gl=t[13]|0,this.Hh=t[14]|0,this.Hl=t[15]|0}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,t){for(let n=0;n<16;n++,t+=4)P[n]=e.getUint32(t),F[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=P[e-15]|0,n=F[e-15]|0,r=A(t,n,1)^A(t,n,8)^be(t,n,7),i=j(t,n,1)^j(t,n,8)^xe(t,n,7),a=P[e-2]|0,o=F[e-2]|0,s=A(a,o,19)^Se(a,o,61)^be(a,o,6),c=j(a,o,19)^Ce(a,o,61)^xe(a,o,6),l=Ee(i,c,F[e-7],F[e-16]),u=De(l,r,s,P[e-7],P[e-16]);P[e]=u|0,F[e]=l|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=A(u,d,14)^A(u,d,18)^Se(u,d,41),v=j(u,d,14)^j(u,d,18)^Ce(u,d,41),y=u&f^~u&m,b=d&p^~d&h,x=Oe(_,v,b,Je[e],F[e]),S=ke(x,g,t,y,qe[e],P[e]),C=x|0,ee=A(n,r,28)^Se(n,r,34)^Se(n,r,39),w=j(n,r,28)^Ce(n,r,34)^Ce(n,r,39),T=n&i^n&o^i&o,te=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=M(c|0,l|0,S|0,C|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let E=we(C,w,te);n=Te(E,S,ee,T),r=E|0}({h:n,l:r}=M(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=M(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=M(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=M(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=M(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=M(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=M(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=M(this.Hh|0,this.Hl|0,g|0,_|0),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){E(P,F)}destroy(){this.destroyed=!0,E(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Xe=class extends Ye{constructor(){super(64,Pe)}};let Ze=de(()=>new Ge,pe(1)),Qe=de(()=>new Xe,pe(3));\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nfunction $e(e,t,n=()=>{}){if(!Array.isArray(e))throw TypeError(`\"${t}\" expected array, got type=${typeof e}`);for(let r=0;r<e.length;r++)n(e[r],`${t}[${r}]`);return e}let I=(e,t,n)=>S(e,t,n),et=x;function L(e,t=`object`){if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(t===`object`?`expected valid options object`:`\"${t}\" expected object, got type=${typeof e}`);return e}function R(e,t){if(typeof e!=`function`)throw TypeError(`\"${t}\" is invalid: expected function, got ${typeof e}`);return e}let tt=ie,nt=e=>oe(e),rt=y,it=e=>fe(e),z=BigInt(0),at=BigInt(1),ot=e=>e?`\"${e}\" `:``;function st(e,t=``){if(typeof e!=`boolean`)throw TypeError(ot(t)+`expected boolean, got type=`+typeof e);return e}function ct(e){if(typeof e==`bigint`){if(!V(e))throw RangeError(`positive bigint expected, got `+e)}else et(e);return e}function lt(e,t=``){if(typeof e!=`number`){let n=t&&`\"${t}\" `;throw TypeError(n+`expected number, got type=`+typeof e)}if(!Number.isSafeInteger(e)){let n=t&&`\"${t}\" `;throw RangeError(n+`expected safe integer, got `+e)}}function ut(e){if(typeof e!=`string`)throw TypeError(`hex string expected, got `+typeof e);return e===``?z:BigInt(`0x`+e)}function dt(e){return ut(ie(e))}function B(e){return ut(ie(ht(S(e)).reverse()))}function ft(e,t){if(x(t),t===0)throw Error(`zero output length is invalid`);e=ct(e);let n=t*2,r=e.toString(16);if(r.length>n)throw RangeError(`number is too large`);return oe(r.padStart(n,`0`))}function pt(e,t){return ft(e,t).reverse()}function mt(e,t){if(e=I(e),t=I(t),e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}function ht(e){return Uint8Array.from(I(e))}function V(e){return typeof e==`bigint`&&z<=e}function gt(e,t,n){return V(e)&&V(t)&&V(n)&&t<=e&&e<n}function _t(e,t,n,r){if(!gt(t,n,r))throw RangeError(`expected valid `+e+`: `+n+` <= n < `+r+`, got `+t)}function vt(e){if(e<z)throw Error(`expected non-negative bigint, got `+e);return e===z?0:e.toString(2).length}let yt=e=>(lt(e,`n`),(at<<BigInt(e))-at);function bt(e,t={},n={},r=`object`){L(e,r),L(t,`fields`),L(n,`optFields`);function i(t,n,i){let a=r===`object`?`param \"${String(t)}\"`:`\"${r}.${String(t)}\"`,o=e[t];if(!Object.hasOwn(e,t)&&(i?o!==void 0:n!==`function`))throw TypeError(`${a} is invalid: expected own property`);if(i&&o===void 0)return;let s=typeof o;if(s!==n||o===null)throw TypeError(`${a} is invalid: expected ${n}, got ${s}`)}let a=(e,t)=>Object.entries(e).forEach(([e,n])=>i(e,n,t));a(t,!1),a(n,!0)}let xt=()=>{throw Error(`not implemented`)},H=BigInt(0),U=BigInt(1),W=BigInt(2),St=BigInt(3),Ct=BigInt(4),wt=BigInt(5),Tt=BigInt(7),Et=BigInt(8),Dt=BigInt(9),Ot=BigInt(15),kt=BigInt(16),At=BigInt(`0x10000000000000000`)\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n;function G(e,t){if(t<=H)throw Error(`mod: expected positive modulus, got `+t);let n=e%t;return n>=H?n:t+n}function jt(e,t,n){if(n<=U)throw Error(`pow: expected modulus > 1, got `+n);if(typeof t!=`bigint`)throw TypeError(`invalid exponent: expected bigint, got `+typeof t);if(t<H)throw Error(`invalid exponent, negatives unsupported`);if(t===H)return U;if(t===U)return e;let r=e%n;if(r<H&&(r+=n),t<At){let e=U;for(;t>H;)t&U&&(e=e*r%n),r=r*r%n,t>>=U;return e}let i=[];for(;t>H;)i.push(Number(t&Ot)),t>>=Ct;let a=Array(16);a[0]=U,a[1]=r;for(let e=2;e<16;e++)a[e]=a[e-1]*r%n;let o=a[i[i.length-1]];for(let e=i.length-2;e>=0;e--){o=o*o%n,o=o*o%n,o=o*o%n,o=o*o%n;let t=i[e];t!==0&&(o=o*a[t]%n)}return o}function K(e,t,n){if(n<=U)throw Error(`pow2: expected modulus > 1, got `+n);if(t<H)throw Error(`pow2: expected non-negative exponent, got `+t);let r=e;for(;t-->H;)r*=r,r%=n;return r}function Mt(e,t){if(e===H)throw Error(`invert: expected non-zero number`);if(t<=U)throw Error(`invert: expected modulus > 1, got `+t);let n=G(e,t),r=t,i=H,a=U;for(;n!==H;){let e=r/n,t=r-n*e,o=i-a*e;r=n,n=t,i=a,a=o}if(r!==U)throw Error(`invert: does not exist`);return G(i,t)}function Nt(e,t,n){let r=e;if(!r.eql(r.sqr(t),n))throw Error(`Cannot find square root`)}function Pt(e,t){if((e&U)===H)throw Error(t+`: expected odd modulus, got `+e)}function Ft(e,t){let n=e,r=(n.ORDER+U)/Ct,i=n.pow(t,r);return Nt(n,i,t),i}function It(e,t){let n=e,r=(n.ORDER-wt)/Et,i=n.mul(t,W),a=n.pow(i,r),o=n.mul(t,a),s=n.mul(n.mul(o,W),a),c=n.mul(o,n.sub(s,n.ONE));return Nt(n,c,t),c}function Lt(e){let t=Kt(e),n=Rt(e),r=n(t,t.neg(t.ONE)),i=n(t,r),a=n(t,t.neg(r)),o=(e+Tt)/kt;return((e,t)=>{let n=e,s=n.pow(t,o),c=n.mul(s,r),l=n.mul(s,i),u=n.mul(s,a),d=n.eql(n.sqr(c),t),f=n.eql(n.sqr(l),t);s=n.cmov(s,c,d),c=n.cmov(u,l,f);let p=n.eql(n.sqr(c),t),m=n.cmov(s,c,p);return Nt(n,m,t),m})}function Rt(e){if(e<St)throw Error(`sqrt is not defined for small field`);Pt(e,`tonelliShanks`);let t=e-U,n=0;for(;t%W===H;)t/=W,n++;let r=W,i=Kt(e);for(;J(i,r)===1;)if(r++>1e3)throw Error(`Cannot find square root: probably non-prime P`);if(n===1)return Ft;let a=i.pow(r,t),o=(t+U)/W;return function(e,r){let i=e;if(i.is0(r))return r;if(J(i,r)!==1)throw Error(`Cannot find square root`);let s=n,c=i.mul(i.ONE,a),l=i.pow(r,t),u=i.pow(r,o);for(;!i.eql(l,i.ONE);){if(i.is0(l))throw Error(`Cannot find square root: probably non-prime P`);let e=1,t=i.sqr(l);for(;!i.eql(t,i.ONE);)if(e++,t=i.sqr(t),e===s)throw Error(`Cannot find square root`);let n=U<<BigInt(s-e-1),r=i.pow(c,n);s=e,c=i.sqr(r),l=i.mul(l,c),u=i.mul(u,r)}return u}}function zt(e){return Pt(e,`Fp.sqrt`),e%Ct===St?Ft:e%Et===wt?It:e%kt===Dt?Lt(e):Rt(e)}let Bt=(e,t)=>(G(e,t)&U)===U,Vt=[`create`,`isValid`,`is0`,`neg`,`inv`,`sqrt`,`sqr`,`eql`,`add`,`sub`,`mul`,`pow`,`div`,`addN`,`subN`,`mulN`,`sqrN`];function q(e){if(L(e,`field`),typeof e.ORDER!=`bigint`)throw TypeError(`param \"ORDER\" is invalid: expected bigint, got `+typeof e.ORDER);lt(e.BYTES,`BYTES`),lt(e.BITS,`BITS`);for(let t of Vt)R(e[t],`field.`+t);if(e.BYTES<1||e.BITS<1)throw Error(`invalid field: expected BYTES/BITS > 0`);if(e.ORDER<=U)throw Error(`invalid field: expected ORDER > 1, got `+e.ORDER);return e}function Ht(e,t,n=!1){q(e),$e(t,`nums`),st(n,`passZero`);let r=e,i=Array(t.length).fill(n?r.ZERO:void 0),a=t.reduce((e,t,n)=>r.is0(t)?e:(i[n]=e,r.mul(e,t)),r.ONE),o=r.inv(a);return t.reduceRight((e,t,n)=>r.is0(t)?e:(i[n]=r.mul(e,i[n]),r.mul(e,t)),o),i}function J(e,t){q(e);let n=e;Pt(n.ORDER,`FpLegendre`);let r=(n.ORDER-U)/W,i=n.pow(t,r),a=n.eql(i,n.ONE),o=n.eql(i,n.ZERO),s=n.eql(i,n.neg(n.ONE));if(!a&&!o&&!s)throw Error(`invalid Legendre symbol result`);return a?1:o?0:-1}function Ut(e,t){if(t!==void 0&&et(t),e<=H)throw Error(`invalid n length: expected positive n, got `+e);if(t!==void 0&&t<1)throw Error(`invalid n length: expected positive bit length, got `+t);let n=vt(e);if(t!==void 0&&t<n)throw Error(`invalid n length: expected nBitLength (${t}) >= bitLen(n) (${n})`);let r=t===void 0?n:t;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}let Wt=new WeakMap;var Gt=class{ORDER;BITS;BYTES;isLE;ZERO=H;ONE=U;_lengths;_mod;constructor(e,t={}){if(e<=U)throw Error(`invalid field: expected ORDER > 1, got `+e);let n;this.isLE=!1,typeof t==`object`&&t&&(typeof t.BITS==`number`&&(n=t.BITS),typeof t.sqrt==`function`&&Object.defineProperty(this,\"sqrt\",{value:t.sqrt,enumerable:!0}),typeof t.isLE==`boolean`&&(this.isLE=t.isLE),t.allowedLengths&&(this._lengths=Object.freeze(t.allowedLengths.slice())),typeof t.modFromBytes==`boolean`&&(this._mod=t.modFromBytes));let{nBitLength:r,nByteLength:i}=Ut(e,n);if(i>2048)throw Error(`invalid field: expected ORDER of <= 2048 bytes`);this.ORDER=e,this.BITS=r,this.BYTES=i,Object.freeze(this)}create(e){return G(e,this.ORDER)}isValid(e){if(typeof e!=`bigint`)throw TypeError(`invalid field element: expected bigint, got `+typeof e);return H<=e&&e<this.ORDER}is0(e){return e===H}isValidNot0(e){return!this.is0(e)&&this.isValid(e)}isOdd(e){return(e&U)===U}neg(e){return G(-e,this.ORDER)}eql(e,t){return e===t}sqr(e){return G(e*e,this.ORDER)}add(e,t){return G(e+t,this.ORDER)}sub(e,t){return G(e-t,this.ORDER)}mul(e,t){return G(e*t,this.ORDER)}pow(e,t){return jt(e,t,this.ORDER)}div(e,t){return G(e*Mt(t,this.ORDER),this.ORDER)}sqrN(e){return e*e}addN(e,t){return e+t}subN(e,t){return e-t}mulN(e,t){return e*t}inv(e){return Mt(e,this.ORDER)}sqrt(e){let t=Wt.get(this);return t||Wt.set(this,t=zt(this.ORDER)),t(this,e)}toBytes(e){return this.isLE?pt(e,this.BYTES):ft(e,this.BYTES)}fromBytes(e,t=!1){I(e);let{_lengths:n,BYTES:r,isLE:i,ORDER:a,_mod:o}=this;if(n){if(e.length<1||!n.includes(e.length)||e.length>r)throw Error(`Field.fromBytes: expected `+n+` bytes, got `+e.length);let t=new Uint8Array(r);t.set(e,i?0:t.length-e.length),e=t}if(e.length!==r)throw Error(`Field.fromBytes: expected `+r+` bytes, got `+e.length);let s=i?B(e):dt(e);if(o&&(s=G(s,a)),!t&&!this.isValid(s))throw Error(`invalid field element: outside of range 0..ORDER`);return s}invertBatch(e){return Ht(this,e,!0)}cmov(e,t,n){return st(n,`condition`),n?t:e}};function Kt(e,t={}){return Object.freeze(Gt.prototype),new Gt(e,t)}\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nlet qt=BigInt(0),Y=BigInt(1),Jt=BigInt(4),Yt=2**31;function Xt(e){let t=e;if(typeof t!=`function`)throw TypeError(`\"Point\" expected constructor, got type=`+typeof e);R(t.fromAffine,`Point.fromAffine`),R(t.fromBytes,`Point.fromBytes`),R(t.fromHex,`Point.fromHex`),L(t.BASE,`Point.BASE`),L(t.ZERO,`Point.ZERO`),q(t.Fp),q(t.Fn)}function Zt(e,t){Xt(e),tn(t,e);let n=Ht(e.Fp,t.map(e=>e.Z));return t.map((t,r)=>e.fromAffine(t.toAffine(n[r])))}function Qt(e,t,n=1){if(!Number.isSafeInteger(e)||e<n||e>t)throw Error(`invalid window size, expected [`+n+`..`+t+`], got W=`+e)}function $t(e,t){let n=e*(4*t+128);if(n>Yt)throw Error(`invalid window size: table would need ~`+Math.ceil(n/2**20)+` MiB, max `+Yt/2**20+` MiB`)}function en(e,t){if(e!==void 0){R(e,`randomBytes`);try{let n=e(t);if(!rt(n)||n.length!==t)return}catch{return}return e}}function tn(e,t){$e(e,`points`),e.forEach((e,n)=>{if(!(e instanceof t))throw Error(`invalid point at index `+n)})}function nn(e,t,n){if(!Array.isArray(e))throw Error(`array of scalars expected`);e.forEach((e,r)=>{if(!(n===void 0?t.isValid(e):V(e)&&e<n))throw Error(`invalid scalar at index `+r)})}let rn=new WeakMap;function an(e){return rn.get(e)||1}function on(e,t){let n=e.double(),r=[e];for(let e=1;e<t;e++)r.push(r[e-1].add(n));return r}function sn(e,t){let n=2**t,r=n/2,i=BigInt(n-1),a=[];for(;e>qt;){let t=0;e&Y&&(t=Number(e&i),t>=r&&(t-=n),e-=BigInt(t)),a.push(t),e>>=Y}return a}function cn(e,t,n){let r=2**t,i=r/2,a=BigInt(r-1),o=BigInt(t),s=[];for(let t=0;t<n;t++){let t=Number(e&a);e>>=o,t>i&&(t-=r,e+=Y),s.push(t)}if(e!==qt)throw Error(`invalid wnaf`);return s}function ln(e,t,n){let r=0;for(let e of n)r=Math.max(r,e.length);let i=e;for(let e=r-1;e>=0;e--){e!==r-1&&(i=i.double());for(let r=0;r<n.length;r++){let a=n[r][e];if(a){let e=t[r][Math.abs(a)-1>>1];i=i.add(a<0?e.negate():e)}}}return i}var un=class{Point;BASE;ZERO;randomBytes;wnafPrecomputes=new WeakMap;baseCanBeBlinded;bits;constructor(e,t){Xt(e),this.randomBytes=en(t,16),this.Point=e,this.BASE=e.BASE,this.ZERO=e.ZERO,this.bits=e.Fn.BITS}buildWnafTable(e,t,n){let r=Math.ceil(n/t)+1,i=2**(t-1),a=[],o=e;for(let e=0;e<r;e++){let e=o;for(let t=0;t<i;t++)a.push(e),e=e.add(o);o=a[a.length-1].double()}return{W:t,bits:n,windows:r,comp:a}}wnafCachedCT(e,t){let{W:n,windows:r,comp:i}=e,a=2**(n-1),o=cn(t,n,r),s=this.ZERO,c=this.BASE;for(let e=0;e<r;e++){let t=o[e],n=e*a,r=Math.abs(t)-1,l=i[n];for(let e=1;e<a;e++)l=e===r?i[n+e]:l;let u=l.negate();t===0?c=c.add(i[n]):s=s.add(t<0?u:l)}return{p:s,f:c}}getWnafPrecomputes(e,t,n,r){let i=this.wnafPrecomputes.get(t),a=i?.find(t=>t.W===e&&t.bits===n);return a||(a=this.buildWnafTable(t,e,n),typeof r==`function`&&(a={...a,comp:r(a.comp)}),i||(i=[],this.wnafPrecomputes.set(t,i)),i.push(a)),a}assertPoint(e){if(!(e instanceof this.Point))throw TypeError(`\"point\" expected Point instance, got type=`+typeof e)}validateMulInput(e,t){if(this.assertPoint(e),!gt(t,Y,this.Point.Fn.ORDER))throw Error(`invalid scalar`)}runCT(e,t,n,r){let i=an(e);return i===1?this.fixedWindowCT(e,t,n):this.wnafCachedCT(this.getWnafPrecomputes(i,e,n,r),t)}mulCT(e,t,n){return this.validateMulInput(e,t),this.runCT(e,t,this.bits,n)}mulCTBlinded(e,t,n){if(this.validateMulInput(e,t),this.randomBytes===void 0)throw Error(`randomBytes is required for scalar blinding`);let r=this.Point.Fn.BITS+128,i=this.randomBytes(16);if(!rt(i)||i.length!==16)throw Error(`randomBytes returned invalid byte array`);i[0]=i[0]&63|128;let a=t+dt(i)*this.Point.Fn.ORDER;return this.runCT(e,a,r,n)}fixedWindowCT(e,t,n){let r=yt(5),i=Array(32);i[0]=this.ZERO;for(let t=1;t<32;t++)i[t]=i[t-1].add(e);let a=Math.ceil(n/5),o=this.ZERO;for(let e=a-1;e>=0;e--){if(e!==a-1)for(let e=0;e<5;e++)o=o.double();let n=Number(t>>BigInt(e*5)&r),s=i[0];for(let e=1;e<32;e++)s=e===n?i[e]:s;o=o.add(s)}return{p:o,f:o}}shouldBlind(e,t){return this.randomBytes===void 0?!1:t===Y?!0:e===this.BASE?(this.baseCanBeBlinded===void 0&&(this.baseCanBeBlinded=this.mulUnsafe(this.BASE,this.Point.Fn.ORDER).is0()),this.baseCanBeBlinded):!1}mulSecret(e,t,n,r){return this.shouldBlind(e,n)?this.mulCTBlinded(e,t,r):this.mulCT(e,t,r)}mulUnsafe(e,t,n){if(this.assertPoint(e),!V(t))throw Error(`invalid scalar`);let r=an(e);if(r===1||t>=this.Point.Fn.ORDER)return dn(this.Point,[e],[t],!0);let i=this.getWnafPrecomputes(r,e,this.bits,n);return this.wnafCachedCT(i,t).p}setWindowSize(e,t){this.assertPoint(e),Qt(t,this.bits),$t((Math.ceil((this.bits+128)/t)+1)*2**(t-1),this.Point.Fp.BYTES),rn.set(e,t),this.wnafPrecomputes.delete(e)}hasWindowSize(e){return an(e)!==1}};function dn(e,t,n,r=!1){if(Xt(e),tn(t,e),st(r,`allowOversized`),nn(n,e.Fn,r?e.Fn.ORDER**Jt:void 0),t.length!==n.length)throw Error(`arrays of points and scalars must have equal length`);let i=t.map(e=>on(e,4)),a=n.map(e=>sn(e,4));return ln(e.ZERO,i,a)}function fn(e,t,n){if(t){if(t.ORDER!==e)throw Error(`Field.ORDER must match order: Fp == p, Fn == n`);return q(t),t}else return Kt(e,{isLE:n})}function pn(e,t,n={},r){if(e!==`weierstrass`&&e!==`edwards`)throw Error(`expected curve type \"weierstrass\" or \"edwards\"`);if(r===void 0&&(r=e===`edwards`),!t||typeof t!=`object`)throw Error(`expected valid ${e} CURVE object`);bt(n);for(let e of[`p`,`n`,`h`]){let n=t[e];if(!(V(n)&&n!==qt))throw Error(`CURVE.${e} must be positive bigint`)}let i=fn(t.p,n.Fp,r),a=fn(t.n,n.Fn,r),o=[`Gx`,`Gy`,`a`,e===`weierstrass`?`b`:`d`];for(let e of o)if(!i.isValid(t[e]))throw Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:i,Fn:a}}\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nlet X=BigInt(0),mn=BigInt(1),hn=BigInt(2),gn=BigInt(4),_n=BigInt(8);function vn(e,t,n,r){let i=e.sqr(n),a=e.sqr(r),o=e.add(e.mul(t.a,i),a),s=e.add(e.ONE,e.mul(t.d,e.mul(i,a)));return e.eql(o,s)}function yn(e,t={}){bt(t,{},{},`extraOpts`);let n=t,r=pn(`edwards`,e,n,n.FpFnLE),{Fp:i,Fn:a}=r,o=r.CURVE,{h:s}=o;if(J(i,o.a)!==1)throw Error(`edwards: CURVE.a must be a square in Fp for complete addition formulas`);if(J(i,o.d)!==-1)throw Error(`edwards: CURVE.d must be a non-square in Fp for complete addition formulas`);bt(n,{},{uvRatio:`function`,randomBytes:`function`});let c=n.randomBytes===void 0?it:n.randomBytes,l=hn<<BigInt(i.BYTES*8)-mn;function u(e){if(!i.isOdd)throw Error(`Field does not have .isOdd()`);return i.isOdd(e)}let d=n.uvRatio===void 0?(e,t)=>{try{return{isValid:!0,value:i.sqrt(i.div(e,t))}}catch{return{isValid:!1,value:X}}}:n.uvRatio;if(!vn(i,o,o.Gx,o.Gy))throw Error(`bad curve params: generator point`);let f=i.eql(o.a,i.neg(i.ONE))?e=>i.neg(e):i.eql(o.a,i.ONE)?e=>e:e=>i.mul(o.a,e);function p(e,t,n=!1){let r=n?mn:X;return _t(`coordinate `+e,t,r,l),t}function m(e){if(!(e instanceof h))throw Error(`EdwardsPoint expected`)}class h{static BASE=new h(o.Gx,o.Gy,i.ONE,i.mul(o.Gx,o.Gy));static ZERO=new h(i.ZERO,i.ONE,i.ONE,i.ZERO);static Fp=i;static Fn=a;X;Y;Z;T;constructor(e,t,n,r){this.X=p(`x`,e),this.Y=p(`y`,t),this.Z=p(`z`,n,!0),this.T=p(`t`,r),Object.freeze(this)}static CURVE(){return o}static fromAffine(e){if(e instanceof h)throw Error(`extended point not allowed`);let{x:t,y:n}=e||{};return p(`x`,t),p(`y`,n),new h(t,n,i.ONE,i.mul(t,n))}static fromBytes(e,t=!1){let n=i.BYTES,{a:r,d:a}=o;e=ht(I(e,n,`point`)),st(t,`zip215`);let s=ht(e),c=e[n-1];s[n-1]=c&-129;let f=B(s),p=t?l:i.ORDER;_t(`point.y`,f,X,p);let m=i.sqr(f),g=i.sub(m,i.ONE),_=i.sub(i.mulN(a,m),r),{isValid:v,value:y}=d(g,_);if(!v)throw Error(`bad point: invalid y coordinate`);let b=u(y),x=(c&128)!=0;if(!t&&i.is0(y)&&x)throw Error(`bad point: x=0 and x_0=1`);return x!==b&&(y=i.neg(y)),h.fromAffine({x:y,y:f})}static fromHex(e,t=!1){return h.fromBytes(nt(e),t)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=6,t=!0){return _.setWindowSize(this,e),t||this.multiply(hn),this}assertValidity(){let e=this,{a:t,d:n}=o;if(e.is0())throw Error(`bad point: ZERO`);let{X:r,Y:a,Z:s,T:c}=e,l=i.sqr(r),u=i.sqr(a),d=i.sqr(s),f=i.sqr(d),p=i.mul(l,t),m=i.mul(i.add(p,u),d),h=i.add(f,i.mul(n,i.mul(l,u)));if(!i.eql(m,h))throw Error(`bad point: equation left != right (1)`);let g=i.mul(r,a),_=i.mul(s,c);if(!i.eql(g,_))throw Error(`bad point: equation left != right (2)`)}equals(e){m(e);let{X:t,Y:n,Z:r}=this,{X:a,Y:o,Z:s}=e,c=i.mul(t,s),l=i.mul(a,r),u=i.mul(n,s),d=i.mul(o,r);return i.eql(c,l)&&i.eql(u,d)}is0(){return this.equals(h.ZERO)}negate(){return new h(i.neg(this.X),this.Y,this.Z,i.neg(this.T))}double(){let{X:e,Y:t,Z:n}=this,r=i.sqr(e),a=i.sqr(t),o=i.mul(i.sqr(n),hn),s=f(r),c=i.addN(e,t),l=i.sub(i.subN(i.sqr(c),r),a),u=i.addN(s,a),d=i.subN(u,o),p=i.subN(s,a),m=i.mul(l,d),g=i.mul(u,p),_=i.mul(l,p),v=i.mul(d,u);return new h(m,g,v,_)}add(e){m(e);let{d:t}=o,{X:n,Y:r,Z:a,T:s}=this,{X:c,Y:l,Z:u,T:d}=e,p=i.mul(n,c),g=i.mul(r,l),_=i.mul(i.mulN(s,t),d),v=i.mul(a,u),y=i.sub(i.subN(i.mulN(i.addN(n,r),i.addN(c,l)),p),g),b=i.subN(v,_),x=i.addN(v,_),S=i.sub(g,f(p)),C=i.mul(y,b),ee=i.mul(x,S),w=i.mul(y,S),T=i.mul(b,x);return new h(C,ee,T,w)}subtract(e){return m(e),this.add(e.negate())}multiply(e){if(!a.isValidNot0(e))throw RangeError(`invalid scalar: expected 1 <= sc < curve.n`);let{p:t,f:n}=_.mulSecret(this,e,s,g);return g([t,n])[0]}multiplyUnsafe(e){if(!a.isValid(e))throw RangeError(`invalid scalar: expected 0 <= sc < curve.n`);return e===X?h.ZERO:this.is0()||e===mn?this:_.mulUnsafe(this,e,g)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return _.mulUnsafe(this,o.n).is0()}toAffine(e){let t=this,n=e;if(n!=null&&typeof n!=`bigint`)throw TypeError(`\"invertedZ\" expected bigint, got type=`+typeof n);let{X:r,Y:a,Z:o}=t,s=t.is0();n??=s?i.create(_n):i.inv(o);let c=i.mul(r,n),l=i.mul(a,n),u=i.mul(o,n);if(s)return{x:i.ZERO,y:i.ONE};if(!i.eql(u,i.ONE))throw Error(`invZ was invalid`);return{x:c,y:l}}clearCofactor(){return s===mn?this:s===hn?this.double():s===gn?this.double().double():s===_n?this.double().double().double():this.multiplyUnsafe(s)}toBytes(){let{x:e,y:t}=this.toAffine(),n=i.toBytes(t);return n[n.length-1]|=u(e)?128:0,n}toHex(){return tt(this.toBytes())}toString(){return`<Point ${this.is0()?`ZERO`:this.toHex()}>`}}let g=e=>Zt(h,e),_=new un(h,c);return _.bits>=6&&h.BASE.precompute(6),Object.freeze(h.prototype),Object.freeze(h),h}var bn=class{static BASE;static ZERO;static Fp;static Fn;ep;constructor(e){this.ep=e}static fromBytes(e){xt()}static fromHex(e){xt()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(e){return this.ep.toAffine(e)}toHex(){return tt(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(e){return this.assertSame(e),this.init(this.ep.add(e.ep))}subtract(e){return this.assertSame(e),this.init(this.ep.subtract(e.ep))}multiply(e){return this.init(this.ep.multiply(e))}multiplyUnsafe(e){return this.init(this.ep.multiplyUnsafe(e))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(e,t){return this.ep.precompute(e,t),this}};let xn=BigInt(1),Sn=BigInt(2),Cn=BigInt(5),wn=BigInt(8),Tn=BigInt(`0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed`),En={p:Tn,n:BigInt(`0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed`),h:wn,a:BigInt(`0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec`),d:BigInt(`0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3`),Gx:BigInt(`0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a`),Gy:BigInt(`0x6666666666666666666666666666666666666666666666666666666666666658`)}\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n;function Dn(e){let t=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),a=Tn,o=e*e%a*e%a,s=K(K(o,Sn,a)*o%a,xn,a)*e%a,c=K(s,Cn,a)*s%a,l=K(c,t,a)*c%a,u=K(l,n,a)*l%a,d=K(u,r,a)*u%a;return{pow_p_5_8:K(K(K(K(d,i,a)*d%a,i,a)*d%a,t,a)*c%a,Sn,a)*e%a,b2:o}}let On=BigInt(`19681161376707505956807079304988542015446066515923890162744021073123829784752`);function kn(e,t){let n=Tn,r=G(t*t*t,n),i=Dn(e*G(r*r*t,n)).pow_p_5_8,a=G(e*r*i,n),o=G(t*a*a,n),s=a,c=G(a*On,n),l=o===e,u=o===G(-e,n),d=o===G(-e*On,n);return l&&(a=s),(u||d)&&(a=c),Bt(a,n)&&(a=G(-a,n)),{isValid:l||u,value:a}}let Z=yn(En,{uvRatio:kn}),Q=Z.Fp,An=Z.Fn,jn=On,Mn=BigInt(`54469307008909316920995813868745141605393597292927456921205312896311721017578`),Nn=e=>kn(xn,e),Pn=BigInt(`0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`),Fn=e=>Q.create(B(e)&Pn);var $=class e extends bn{static BASE=new e(Z.BASE);static ZERO=new e(Z.ZERO);static Fp=Q;static Fn=An;constructor(e){super(e)}static fromAffine(t){return new e(Z.fromAffine(t))}assertSame(t){if(!(t instanceof e))throw Error(`RistrettoPoint expected`)}init(t){return new e(t)}static fromBytes(t){S(t,32);let{a:n,d:r}=En,i=Fn(t);if(!mt(Q.toBytes(i),t)||Q.isOdd(i))throw Error(`invalid ristretto255 encoding 1`);let a=Q.sqr(i),o=Q.add(xn,Q.mulN(n,a)),s=Q.sub(xn,Q.mulN(n,a)),c=Q.sqr(o),l=Q.sqr(s),u=Q.sub(Q.mulN(Q.mulN(n,r),c),l),{isValid:d,value:f}=Nn(Q.mul(u,l)),p=Q.mul(f,s),m=Q.mul(Q.mulN(f,p),u),h=Q.mul(Q.addN(i,i),p);Q.isOdd(h)&&(h=Q.neg(h));let g=Q.mul(o,m),_=Q.mul(h,g);if(!d||Q.isOdd(_)||Q.is0(g))throw Error(`invalid ristretto255 encoding 2`);return new e(new Z(h,g,Q.ONE,_))}static fromHex(t){return e.fromBytes(oe(t))}toBytes(){let{X:e,Y:t,Z:n,T:r}=this.ep,i=Q.mul(Q.add(n,t),Q.sub(n,t)),a=Q.mul(e,t),o=Q.sqr(a),{value:s}=Nn(Q.mul(i,o)),c=Q.mul(s,i),l=Q.mul(s,a),u=Q.mul(Q.mulN(c,l),r),d;if(Q.isOdd(Q.mul(r,u))){let n=Q.mul(t,jn),r=Q.mul(e,jn);e=n,t=r,d=Q.mul(c,Mn)}else d=l;Q.isOdd(Q.mul(e,u))&&(t=Q.neg(t));let f=Q.mul(Q.subN(n,t),d);return Q.isOdd(f)&&(f=Q.neg(f)),Q.toBytes(f)}equals(e){this.assertSame(e);let{X:t,Y:n}=this.ep,{X:r,Y:i}=e.ep,a=Q.eql(Q.mul(t,i),Q.mul(n,r)),o=Q.eql(Q.mul(n,i),Q.mul(t,r));return a||o}is0(){return this.equals(e.ZERO)}};let In=(Object.freeze($.BASE),Object.freeze($.ZERO),Object.freeze($.prototype),Object.freeze($),Object.freeze({Point:$})),Ln=BigInt(3);function Rn(e,t,...n){if(!rt(t))throw TypeError(`${e}: Uint8Array expected`);if(n.length&&!n.includes(t.length))throw RangeError(`${e}: Uint8Array expected of length ${n}, not of length=${t.length}`)}function zn(...e){for(let t of e)t.fill(0)}let Bn=yt(256),Vn=e=>pt(e<<Ln&Bn,32),Hn=e=>B(e)>>Ln;function Un(e){Rn(`seed`,e,32);let t=Qe(e);t[0]&=248,t[31]&=63,t[31]|=64;let n=Vn(Hn(t.subarray(0,32))),r=t.subarray(32,64),i=le(n,r);return zn(n,r,t),i}function Wn(e,t=Le(),n=2048,r){return{password:He(Qe,v(e),v(t),{c:n,dkLen:64}),rounds:n,salt:t}}var Gn={256:Ze,512:Qe},Kn=Gn[256];Gn[512];var qn=`abandon|ability|able|about|above|absent|absorb|abstract|absurd|abuse|access|accident|account|accuse|achieve|acid|acoustic|acquire|across|act|action|actor|actress|actual|adapt|add|addict|address|adjust|admit|adult|advance|advice|aerobic|affair|afford|afraid|again|age|agent|agree|ahead|aim|air|airport|aisle|alarm|album|alcohol|alert|alien|all|alley|allow|almost|alone|alpha|already|also|alter|always|amateur|amazing|among|amount|amused|analyst|anchor|ancient|anger|angle|angry|animal|ankle|announce|annual|another|answer|antenna|antique|anxiety|any|apart|apology|appear|apple|approve|april|arch|arctic|area|arena|argue|arm|armed|armor|army|around|arrange|arrest|arrive|arrow|art|artefact|artist|artwork|ask|aspect|assault|asset|assist|assume|asthma|athlete|atom|attack|attend|attitude|attract|auction|audit|august|aunt|author|auto|autumn|average|avocado|avoid|awake|aware|away|awesome|awful|awkward|axis|baby|bachelor|bacon|badge|bag|balance|balcony|ball|bamboo|banana|banner|bar|barely|bargain|barrel|base|basic|basket|battle|beach|bean|beauty|because|become|beef|before|begin|behave|behind|believe|below|belt|bench|benefit|best|betray|better|between|beyond|bicycle|bid|bike|bind|biology|bird|birth|bitter|black|blade|blame|blanket|blast|bleak|bless|blind|blood|blossom|blouse|blue|blur|blush|board|boat|body|boil|bomb|bone|bonus|book|boost|border|boring|borrow|boss|bottom|bounce|box|boy|bracket|brain|brand|brass|brave|bread|breeze|brick|bridge|brief|bright|bring|brisk|broccoli|broken|bronze|broom|brother|brown|brush|bubble|buddy|budget|buffalo|build|bulb|bulk|bullet|bundle|bunker|burden|burger|burst|bus|business|busy|butter|buyer|buzz|cabbage|cabin|cable|cactus|cage|cake|call|calm|camera|camp|can|canal|cancel|candy|cannon|canoe|canvas|canyon|capable|capital|captain|car|carbon|card|cargo|carpet|carry|cart|case|cash|casino|castle|casual|cat|catalog|catch|category|cattle|caught|cause|caution|cave|ceiling|celery|cement|census|century|cereal|certain|chair|chalk|champion|change|chaos|chapter|charge|chase|chat|cheap|check|cheese|chef|cherry|chest|chicken|chief|child|chimney|choice|choose|chronic|chuckle|chunk|churn|cigar|cinnamon|circle|citizen|city|civil|claim|clap|clarify|claw|clay|clean|clerk|clever|click|client|cliff|climb|clinic|clip|clock|clog|close|cloth|cloud|clown|club|clump|cluster|clutch|coach|coast|coconut|code|coffee|coil|coin|collect|color|column|combine|come|comfort|comic|common|company|concert|conduct|confirm|congress|connect|consider|control|convince|cook|cool|copper|copy|coral|core|corn|correct|cost|cotton|couch|country|couple|course|cousin|cover|coyote|crack|cradle|craft|cram|crane|crash|crater|crawl|crazy|cream|credit|creek|crew|cricket|crime|crisp|critic|crop|cross|crouch|crowd|crucial|cruel|cruise|crumble|crunch|crush|cry|crystal|cube|culture|cup|cupboard|curious|current|curtain|curve|cushion|custom|cute|cycle|dad|damage|damp|dance|danger|daring|dash|daughter|dawn|day|deal|debate|debris|decade|december|decide|decline|decorate|decrease|deer|defense|define|defy|degree|delay|deliver|demand|demise|denial|dentist|deny|depart|depend|deposit|depth|deputy|derive|describe|desert|design|desk|despair|destroy|detail|detect|develop|device|devote|diagram|dial|diamond|diary|dice|diesel|diet|differ|digital|dignity|dilemma|dinner|dinosaur|direct|dirt|disagree|discover|disease|dish|dismiss|disorder|display|distance|divert|divide|divorce|dizzy|doctor|document|dog|doll|dolphin|domain|donate|donkey|donor|door|dose|double|dove|draft|dragon|drama|drastic|draw|dream|dress|drift|drill|drink|drip|drive|drop|drum|dry|duck|dumb|dune|during|dust|dutch|duty|dwarf|dynamic|eager|eagle|early|earn|earth|easily|east|easy|echo|ecology|economy|edge|edit|educate|effort|egg|eight|either|elbow|elder|electric|elegant|element|elephant|elevator|elite|else|embark|embody|embrace|emerge|emotion|employ|empower|empty|enable|enact|end|endless|endorse|enemy|energy|enforce|engage|engine|enhance|enjoy|enlist|enough|enrich|enroll|ensure|enter|entire|entry|envelope|episode|equal|equip|era|erase|erode|erosion|error|erupt|escape|essay|essence|estate|eternal|ethics|evidence|evil|evoke|evolve|exact|example|excess|exchange|excite|exclude|excuse|execute|exercise|exhaust|exhibit|exile|exist|exit|exotic|expand|expect|expire|explain|expose|express|extend|extra|eye|eyebrow|fabric|face|faculty|fade|faint|faith|fall|false|fame|family|famous|fan|fancy|fantasy|farm|fashion|fat|fatal|father|fatigue|fault|favorite|feature|february|federal|fee|feed|feel|female|fence|festival|fetch|fever|few|fiber|fiction|field|figure|file|film|filter|final|find|fine|finger|finish|fire|firm|first|fiscal|fish|fit|fitness|fix|flag|flame|flash|flat|flavor|flee|flight|flip|float|flock|floor|flower|fluid|flush|fly|foam|focus|fog|foil|fold|follow|food|foot|force|forest|forget|fork|fortune|forum|forward|fossil|foster|found|fox|fragile|frame|frequent|fresh|friend|fringe|frog|front|frost|frown|frozen|fruit|fuel|fun|funny|furnace|fury|future|gadget|gain|galaxy|gallery|game|gap|garage|garbage|garden|garlic|garment|gas|gasp|gate|gather|gauge|gaze|general|genius|genre|gentle|genuine|gesture|ghost|giant|gift|giggle|ginger|giraffe|girl|give|glad|glance|glare|glass|glide|glimpse|globe|gloom|glory|glove|glow|glue|goat|goddess|gold|good|goose|gorilla|gospel|gossip|govern|gown|grab|grace|grain|grant|grape|grass|gravity|great|green|grid|grief|grit|grocery|group|grow|grunt|guard|guess|guide|guilt|guitar|gun|gym|habit|hair|half|hammer|hamster|hand|happy|harbor|hard|harsh|harvest|hat|have|hawk|hazard|head|health|heart|heavy|hedgehog|height|hello|helmet|help|hen|hero|hidden|high|hill|hint|hip|hire|history|hobby|hockey|hold|hole|holiday|hollow|home|honey|hood|hope|horn|horror|horse|hospital|host|hotel|hour|hover|hub|huge|human|humble|humor|hundred|hungry|hunt|hurdle|hurry|hurt|husband|hybrid|ice|icon|idea|identify|idle|ignore|ill|illegal|illness|image|imitate|immense|immune|impact|impose|improve|impulse|inch|include|income|increase|index|indicate|indoor|industry|infant|inflict|inform|inhale|inherit|initial|inject|injury|inmate|inner|innocent|input|inquiry|insane|insect|inside|inspire|install|intact|interest|into|invest|invite|involve|iron|island|isolate|issue|item|ivory|jacket|jaguar|jar|jazz|jealous|jeans|jelly|jewel|job|join|joke|journey|joy|judge|juice|jump|jungle|junior|junk|just|kangaroo|keen|keep|ketchup|key|kick|kid|kidney|kind|kingdom|kiss|kit|kitchen|kite|kitten|kiwi|knee|knife|knock|know|lab|label|labor|ladder|lady|lake|lamp|language|laptop|large|later|latin|laugh|laundry|lava|law|lawn|lawsuit|layer|lazy|leader|leaf|learn|leave|lecture|left|leg|legal|legend|leisure|lemon|lend|length|lens|leopard|lesson|letter|level|liar|liberty|library|license|life|lift|light|like|limb|limit|link|lion|liquid|list|little|live|lizard|load|loan|lobster|local|lock|logic|lonely|long|loop|lottery|loud|lounge|love|loyal|lucky|luggage|lumber|lunar|lunch|luxury|lyrics|machine|mad|magic|magnet|maid|mail|main|major|make|mammal|man|manage|mandate|mango|mansion|manual|maple|marble|march|margin|marine|market|marriage|mask|mass|master|match|material|math|matrix|matter|maximum|maze|meadow|mean|measure|meat|mechanic|medal|media|melody|melt|member|memory|mention|menu|mercy|merge|merit|merry|mesh|message|metal|method|middle|midnight|milk|million|mimic|mind|minimum|minor|minute|miracle|mirror|misery|miss|mistake|mix|mixed|mixture|mobile|model|modify|mom|moment|monitor|monkey|monster|month|moon|moral|more|morning|mosquito|mother|motion|motor|mountain|mouse|move|movie|much|muffin|mule|multiply|muscle|museum|mushroom|music|must|mutual|myself|mystery|myth|naive|name|napkin|narrow|nasty|nation|nature|near|neck|need|negative|neglect|neither|nephew|nerve|nest|net|network|neutral|never|news|next|nice|night|noble|noise|nominee|noodle|normal|north|nose|notable|note|nothing|notice|novel|now|nuclear|number|nurse|nut|oak|obey|object|oblige|obscure|observe|obtain|obvious|occur|ocean|october|odor|off|offer|office|often|oil|okay|old|olive|olympic|omit|once|one|onion|online|only|open|opera|opinion|oppose|option|orange|orbit|orchard|order|ordinary|organ|orient|original|orphan|ostrich|other|outdoor|outer|output|outside|oval|oven|over|own|owner|oxygen|oyster|ozone|pact|paddle|page|pair|palace|palm|panda|panel|panic|panther|paper|parade|parent|park|parrot|party|pass|patch|path|patient|patrol|pattern|pause|pave|payment|peace|peanut|pear|peasant|pelican|pen|penalty|pencil|people|pepper|perfect|permit|person|pet|phone|photo|phrase|physical|piano|picnic|picture|piece|pig|pigeon|pill|pilot|pink|pioneer|pipe|pistol|pitch|pizza|place|planet|plastic|plate|play|please|pledge|pluck|plug|plunge|poem|poet|point|polar|pole|police|pond|pony|pool|popular|portion|position|possible|post|potato|pottery|poverty|powder|power|practice|praise|predict|prefer|prepare|present|pretty|prevent|price|pride|primary|print|priority|prison|private|prize|problem|process|produce|profit|program|project|promote|proof|property|prosper|protect|proud|provide|public|pudding|pull|pulp|pulse|pumpkin|punch|pupil|puppy|purchase|purity|purpose|purse|push|put|puzzle|pyramid|quality|quantum|quarter|question|quick|quit|quiz|quote|rabbit|raccoon|race|rack|radar|radio|rail|rain|raise|rally|ramp|ranch|random|range|rapid|rare|rate|rather|raven|raw|razor|ready|real|reason|rebel|rebuild|recall|receive|recipe|record|recycle|reduce|reflect|reform|refuse|region|regret|regular|reject|relax|release|relief|rely|remain|remember|remind|remove|render|renew|rent|reopen|repair|repeat|replace|report|require|rescue|resemble|resist|resource|response|result|retire|retreat|return|reunion|reveal|review|reward|rhythm|rib|ribbon|rice|rich|ride|ridge|rifle|right|rigid|ring|riot|ripple|risk|ritual|rival|river|road|roast|robot|robust|rocket|romance|roof|rookie|room|rose|rotate|rough|round|route|royal|rubber|rude|rug|rule|run|runway|rural|sad|saddle|sadness|safe|sail|salad|salmon|salon|salt|salute|same|sample|sand|satisfy|satoshi|sauce|sausage|save|say|scale|scan|scare|scatter|scene|scheme|school|science|scissors|scorpion|scout|scrap|screen|script|scrub|sea|search|season|seat|second|secret|section|security|seed|seek|segment|select|sell|seminar|senior|sense|sentence|series|service|session|settle|setup|seven|shadow|shaft|shallow|share|shed|shell|sheriff|shield|shift|shine|ship|shiver|shock|shoe|shoot|shop|short|shoulder|shove|shrimp|shrug|shuffle|shy|sibling|sick|side|siege|sight|sign|silent|silk|silly|silver|similar|simple|since|sing|siren|sister|situate|six|size|skate|sketch|ski|skill|skin|skirt|skull|slab|slam|sleep|slender|slice|slide|slight|slim|slogan|slot|slow|slush|small|smart|smile|smoke|smooth|snack|snake|snap|sniff|snow|soap|soccer|social|sock|soda|soft|solar|soldier|solid|solution|solve|someone|song|soon|sorry|sort|soul|sound|soup|source|south|space|spare|spatial|spawn|speak|special|speed|spell|spend|sphere|spice|spider|spike|spin|spirit|split|spoil|sponsor|spoon|sport|spot|spray|spread|spring|spy|square|squeeze|squirrel|stable|stadium|staff|stage|stairs|stamp|stand|start|state|stay|steak|steel|stem|step|stereo|stick|still|sting|stock|stomach|stone|stool|story|stove|strategy|street|strike|strong|struggle|student|stuff|stumble|style|subject|submit|subway|success|such|sudden|suffer|sugar|suggest|suit|summer|sun|sunny|sunset|super|supply|supreme|sure|surface|surge|surprise|surround|survey|suspect|sustain|swallow|swamp|swap|swarm|swear|sweet|swift|swim|swing|switch|sword|symbol|symptom|syrup|system|table|tackle|tag|tail|talent|talk|tank|tape|target|task|taste|tattoo|taxi|teach|team|tell|ten|tenant|tennis|tent|term|test|text|thank|that|theme|then|theory|there|they|thing|this|thought|three|thrive|throw|thumb|thunder|ticket|tide|tiger|tilt|timber|time|tiny|tip|tired|tissue|title|toast|tobacco|today|toddler|toe|together|toilet|token|tomato|tomorrow|tone|tongue|tonight|tool|tooth|top|topic|topple|torch|tornado|tortoise|toss|total|tourist|toward|tower|town|toy|track|trade|traffic|tragic|train|transfer|trap|trash|travel|tray|treat|tree|trend|trial|tribe|trick|trigger|trim|trip|trophy|trouble|truck|true|truly|trumpet|trust|truth|try|tube|tuition|tumble|tuna|tunnel|turkey|turn|turtle|twelve|twenty|twice|twin|twist|two|type|typical|ugly|umbrella|unable|unaware|uncle|uncover|under|undo|unfair|unfold|unhappy|uniform|unique|unit|universe|unknown|unlock|until|unusual|unveil|update|upgrade|uphold|upon|upper|upset|urban|urge|usage|use|used|useful|useless|usual|utility|vacant|vacuum|vague|valid|valley|valve|van|vanish|vapor|various|vast|vault|vehicle|velvet|vendor|venture|venue|verb|verify|version|very|vessel|veteran|viable|vibrant|vicious|victory|video|view|village|vintage|violin|virtual|virus|visa|visit|visual|vital|vivid|vocal|voice|void|volcano|volume|vote|voyage|wage|wagon|wait|walk|wall|walnut|want|warfare|warm|warrior|wash|wasp|waste|water|wave|way|wealth|weapon|wear|weasel|weather|web|wedding|weekend|weird|welcome|west|wet|whale|what|wheat|wheel|when|where|whip|whisper|wide|width|wife|wild|will|win|window|wine|wing|wink|winner|winter|wire|wisdom|wise|wish|witness|wolf|woman|wonder|wood|wool|word|work|world|worry|worth|wrap|wreck|wrestle|wrist|write|wrong|yard|year|yellow|you|young|youth|zebra|zero|zone|zoo`.split(`|`),Jn=`Invalid mnemonic`,Yn=`Invalid entropy`,Xn=`Invalid mnemonic checksum`;function Zn(e){return(e||``).normalize(`NFKD`)}function Qn(e){return Number.parseInt(e,2)}function $n(e){return e.map(e=>e.toString(2).padStart(8,`0`)).join(``)}function er(e){return $n(Array.from(Kn(e))).slice(0,e.length*8/32)}function tr(e,t=qn){let n=Zn(e).split(` `);if(n.length%3!=0)throw Error(Jn);let r=n.map(e=>{let n=t.indexOf(e);if(n===-1)throw Error(Jn);return n.toString(2).padStart(11,`0`)}).join(``),i=Math.floor(r.length/33)*32,a=r.slice(0,i),o=r.slice(i),s=a.match(/(.{1,8})/g)?.map(Qn);if(!s||s.length%4!=0||s.length<16||s.length>32)throw Error(Yn);let c=v(s);if(er(c)!==o)throw Error(Xn);return c}function nr(e,t=qn){if(e.length%4!=0||e.length<16||e.length>32)throw Error(Yn);let n=`${$n(Array.from(e))}${er(e)}`.match(/(.{1,11})/g)?.map(e=>t[Qn(e)]);if(!n||n.length<12)throw Error(`Unable to map entropy to mnemonic`);return n.join(` `)}function rr(e,t){try{tr(e,t)}catch{return!1}return!0}function ir(e,t,n){return tr(e,t)}function ar(e,t){return rr(e,t)}function or(e,t=``,n,r){if(!ar(e,n))throw Error(`Invalid bip39 mnemonic specified`);return Wn(ir(e,n),_(`mnemonic${t}`)).password.slice(0,32)}function sr(e){let t=v(e);if(t.length!==32)throw Error(`Expected a seed of 32 bytes, found ${t.length}`);let n=Un(t),r=B(n.subarray(0,32))>>3n,i=In.Point.BASE.multiply(r).toBytes();return{publicKey:new Uint8Array(i),secretKey:new Uint8Array(n)}}self.addEventListener(`message`,async e=>{let{taskId:t,task:n,data:r}=e.data;try{let e;switch(n){case`test`:e=`ready`;break;case`entropyToMnemonic`:if(!r.entropy)throw Error(`Entropy data is required`);e=nr(r.entropy);break;case`entropyToKeypair`:if(!r.entropy)throw Error(`Entropy data is required`);e=cr(r.entropy);break;default:throw Error(`Unknown task: ${n}`)}let i={taskId:t,result:e};self.postMessage(i)}catch(e){let n={taskId:t,error:e instanceof Error?e.message:`Unknown error`};self.postMessage(n)}});function cr(e){let t=nr(e),{publicKey:n,secretKey:r}=sr(or(t));return{mnemonic:t,publicKey:n,secretKey:r}}})();";
|
|
3
3
|
var blob = typeof self !== "undefined" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", jsContent], { type: "text/javascript;charset=utf-8" });
|
|
4
4
|
function WorkerWrapper(options) {
|
|
5
5
|
let objURL;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/account",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.98",
|
|
4
4
|
"description": "Services and Utils for Prosopo account gen and management",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
"@polkadot/extension-inject": "0.63.1",
|
|
53
53
|
"@polkadot/util": "14.0.3",
|
|
54
54
|
"@polkadot/util-crypto": "14.0.3",
|
|
55
|
-
"@prosopo/common": "3.1.
|
|
56
|
-
"@prosopo/fingerprint": "2.7.
|
|
57
|
-
"@prosopo/keyring": "2.9.
|
|
58
|
-
"@prosopo/types": "5.
|
|
59
|
-
"@prosopo/util": "3.3.
|
|
60
|
-
"@prosopo/util-crypto": "13.5.
|
|
55
|
+
"@prosopo/common": "3.1.59",
|
|
56
|
+
"@prosopo/fingerprint": "2.7.52",
|
|
57
|
+
"@prosopo/keyring": "2.9.95",
|
|
58
|
+
"@prosopo/types": "5.10.0",
|
|
59
|
+
"@prosopo/util": "3.3.11",
|
|
60
|
+
"@prosopo/util-crypto": "13.5.33"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@prosopo/config": "3.4.0",
|