Files

56 lines
1.5 MiB
JavaScript
Raw Permalink Normal View History

2025-11-12 12:54:37 +08:00
!function e(t,n,r){function i(o,a){if(!n[o]){if(!t[o]){var c="function"==typeof require&&require;if(!a&&c)return c(o,!0);if(s)return s(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[o]={exports:{}};t[o][0].call(l.exports,(function(e){return i(t[o][1][e]||e)}),l,l.exports,e,t,n,r)}return n[o].exports}for(var s="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.COOKIE_ID_MARKETING_WHITELIST_ORIGINS=n.COOKIE_ID_MARKETING_WHITELIST=void 0;const r=n.COOKIE_ID_MARKETING_WHITELIST=["https://metamask.io","https://learn.metamask.io","https://mmi-support.zendesk.com","https://community.metamask.io","https://support.metamask.io"];n.COOKIE_ID_MARKETING_WHITELIST_ORIGINS=r.map((e=>new URL(e).origin))},{}],2:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.PHISHING_WARNING_PAGE=n.PHISHING_STREAM=n.PHISHING_SAFELIST=n.METAMASK_PROVIDER=n.METAMASK_INPAGE=n.METAMASK_COOKIE_HANDLER=n.LEGACY_PUBLIC_CONFIG=n.LEGACY_PROVIDER=n.LEGACY_INPAGE=n.LEGACY_CONTENT_SCRIPT=n.CONTENT_SCRIPT=void 0;n.CONTENT_SCRIPT="metamask-contentscript",n.METAMASK_INPAGE="metamask-inpage",n.PHISHING_WARNING_PAGE="metamask-phishing-warning-page",n.METAMASK_COOKIE_HANDLER="metamask-cookie-handler",n.METAMASK_PROVIDER="metamask-provider",n.PHISHING_SAFELIST="metamask-phishing-safelist",n.PHISHING_STREAM="phishing",n.LEGACY_CONTENT_SCRIPT="contentscript",n.LEGACY_INPAGE="inpage",n.LEGACY_PROVIDER="provider",n.LEGACY_PUBLIC_CONFIG="publicConfig"},{}],3:[function(e,t,n){"use strict";var r,i=e("../../shared/modules/browser-runtime.utils"),s=(r=e("../../shared/modules/provider-injection"))&&r.__esModule?r:{default:r},o=e("./streams/provider-stream"),a=e("./streams/phishing-stream"),c=e("./streams/cookie-handler-stream");a.isDetectedPhishingSite?(0,a.initPhishingStreams)():(c.isDetectedCookieMarketingSite&&(0,c.initializeCookieHandlerSteam)(),(0,s.default)()&&((0,o.initStreams)(),document.prerendering&&(0,i.getIsBrowserPrerenderBroken)()&&document.addEventListener("prerenderingchange",(()=>{(0,o.onDisconnectDestroyStreams)(new Error("Prerendered page has become active."))})),window.addEventListener("pageshow",(e=>{e.persisted&&(console.warn("BFCached page has become active. Restoring the streams."),(0,o.setupExtensionStreams)())})),window.addEventListener("pagehide",(e=>{e.persisted&&(console.warn("Page may become BFCached. Destroying the streams."),(0,o.destroyStreams)())}))))},{"../../shared/modules/browser-runtime.utils":583,"../../shared/modules/provider-injection":584,"./streams/cookie-handler-stream":4,"./streams/phishing-stream":5,"./streams/provider-stream":6}],4:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.setupCookieHandlerExtStreams=n.isDetectedCookieMarketingSite=n.initializeCookieHandlerSteam=void 0;var r=p(e("webextension-polyfill")),i=e("@metamask/post-message-stream"),s=p(e("@metamask/object-multiplex")),o=e("readable-stream"),a=p(e("extension-port-stream")),c=e("../../../shared/constants/app"),u=e("../constants/marketing-site-whitelist"),l=e("../../../shared/modules/browser-runtime.utils"),d=e("../constants/stream"),h=e("./stream-utils");function p(e){return e&&e.__esModule?e:{default:e}}n.isDetectedCookieMarketingSite=u.COOKIE_ID_MARKETING_WHITELIST_ORIGINS.some((e=>e===window.location.origin));let f,m,y,g,b,v;const w=()=>{y=r.default.runtime.connect({name:d.CONTENT_SCRIPT}),g=new a.default(y),b=new s.default,b.setMaxListeners(25),(0,o.pipeline)(b,g,b,(e=>{(0,h.logStreamDisconnectWarning)("MetaMask Background Multiplex",e),window.postMessage({target:"CookieHandlerPage",data:{name:d.METAMASK_COOKIE_HANDLER,data:{jsonrpc:"2.0",method:"METAMASK_STREAM_FAILURE"}}},window.location.origin)})),v=b.createStream(d.METAMASK_COOKIE_HANDLER),b.ignoreStream(d.LEGACY_PUBLIC_CONFIG),b.ignoreStream(d.LEGACY_PROVIDER),b.ignoreStream(d.METAMASK_PROVIDER),b.ignoreStream(d.PHISHING_SAFELIST),b.ignoreStream(d.PHISHING_STREAM),(0,o.pipeline)(m,v,m,(e=>console.d
/*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */
const r=e("@noble/hashes/_assert"),i=e("@noble/hashes/pbkdf2"),s=e("@noble/hashes/sha256"),o=e("@noble/hashes/sha512"),a=e("@noble/hashes/utils"),c=e("@scure/base");function u(e){if("string"!=typeof e)throw new TypeError("Invalid mnemonic type: "+typeof e);return e.normalize("NFKD")}function l(e){const t=u(e),n=t.split(" ");if(![12,15,18,21,24].includes(n.length))throw new Error("Invalid mnemonic");return{nfkd:t,words:n}}function d(e){r.default.bytes(e,16,20,24,28,32)}n.generateMnemonic=function(e,t=128){if(r.default.number(t),t%32!=0||t>256)throw new TypeError("Invalid entropy");return m((0,a.randomBytes)(t/8),e)};const h=e=>{const t=8-e.length/4;return new Uint8Array([(0,s.sha256)(e)[0]>>t<<t])};function p(e){if(!Array.isArray(e)||2048!==e.length||"string"!=typeof e[0])throw new Error("Worlist: expected array of 2048 strings");return e.forEach((e=>{if("string"!=typeof e)throw new Error(`Wordlist: non-string element: ${e}`)})),c.utils.chain(c.utils.checksum(1,h),c.utils.radix2(11,!0),c.utils.alphabet(e))}function f(e,t){let n;if("string"==typeof e){const{words:r}=l(e);n=p(t).decode(r)}else n=p(t).decode(Array.from(new Uint16Array(e.buffer)).map((e=>t[e])));return d(n),n}function m(e,t){d(e);const n=p(t).encode(e).map((e=>t.indexOf(e)));return new Uint8Array(new Uint16Array(n).buffer)}n.mnemonicToEntropy=f,n.entropyToMnemonic=m,n.validateMnemonic=function(e,t){try{f(e,t)}catch(e){return!1}return!0};const y=e=>u(`mnemonic${e}`);function g(e,t){let n;return n="string"==typeof e?(new TextEncoder).encode(l(e).nfkd):(new TextEncoder).encode(Array.from(new Uint16Array(e.buffer)).map((e=>t[e])).join(" ")),n}n.mnemonicToSeed=function(e,t,n=""){const r=g(e,t);return(0,i.pbkdf2Async)(o.sha512,r,y(n),{c:2048,dkLen:64})},n.mnemonicToSeedSync=function(e,t,n=""){const r=g(e,t);return(0,i.pbkdf2)(o.sha512,r,y(n),{c:2048,dkLen:64})}},{"@noble/hashes/_assert":101,"@noble/hashes/pbkdf2":106,"@noble/hashes/sha256":107,"@noble/hashes/sha512":108,"@noble/hashes/utils":109,"@scure/base":351}],100:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.wordlist=void 0,n.wordlist="abandon\nability\nable\nabout\nabove\nabsent\nabsorb\nabstract\nabsurd\nabuse\naccess\naccident\naccount\naccuse\nachieve\nacid\nacoustic\nacquire\nacross\nact\naction\nactor\nactress\nactual\nadapt\nadd\naddict\naddress\nadjust\nadmit\nadult\nadvance\nadvice\naerobic\naffair\nafford\nafraid\nagain\nage\nagent\nagree\nahead\naim\nair\nairport\naisle\nalarm\nalbum\nalcohol\nalert\nalien\nall\nalley\nallow\nalmost\nalone\nalpha\nalready\nalso\nalter\nalways\namateur\namazing\namong\namount\namused\nanalyst\nanchor\nancient\nanger\nangle\nangry\nanimal\nankle\nannounce\nannual\nanother\nanswer\nantenna\nantique\nanxiety\nany\napart\napology\nappear\napple\napprove\napril\narch\narctic\narea\narena\nargue\narm\narmed\narmor\narmy\naround\narrange\narrest\narrive\narrow\nart\nartefact\nartist\nartwork\nask\naspect\nassault\nasset\nassist\nassume\nasthma\nathlete\natom\nattack\nattend\nattitude\nattract\nauction\naudit\naugust\naunt\nauthor\nauto\nautumn\naverage\navocado\navoid\nawake\naware\naway\nawesome\nawful\nawkward\naxis\nbaby\nbachelor\nbacon\nbadge\nbag\nbalance\nbalcony\nball\nbamboo\nbanana\nbanner\nbar\nbarely\nbargain\nbarrel\nbase\nbasic\nbasket\nbattle\nbeach\nbean\nbeauty\nbecause\nbecome\nbeef\nbefore\nbegin\nbehave\nbehind\nbelieve\nbelow\nbelt\nbench\nbenefit\nbest\nbetray\nbetter\nbetween\nbeyond\nbicycle\nbid\nbike\nbind\nbiology\nbird\nbirth\nbitter\nblack\nblade\nblame\nblanket\nblast\nbleak\nbless\nblind\nblood\nblossom\nblouse\nblue\nblur\nblush\nboard\nboat\nbody\nboil\nbomb\nbone\nbonus\nbook\nboost\nborder\nboring\nborrow\nboss\nbottom\nbounce\nbox\nboy\nbracket\nbrain\nbrand\nbrass\nbrave\nbread\nbreeze\nbrick\nbridge\nbrief\nbright\nbring\nbrisk\nbroccoli\nbroken\nbronze\nbroom\nbrother\nbrown\nbrush\nbubble\nbuddy\nbudget\nbuffalo\nbuild\nbulb\nbulk\nbullet\nbundle\nbunker\nburden\nburger\nburst\nbus\nbusiness\nbusy\nbutter\nbuyer\nbuzz\ncabbage\ncabin\ncable\ncactus\ncage\ncake\ncall\ncalm\ncamera\ncamp\ncan\ncanal\
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(n,"__esModule",{value:!0}),n.randomBytes=n.wrapXOFConstructorWithOpts=n.wrapConstructorWithOpts=n.wrapConstructor=n.checkOpts=n.Hash=n.concatBytes=n.toBytes=n.utf8ToBytes=n.asyncLoop=n.nextTick=n.hexToBytes=n.bytesToHex=n.isLE=n.rotr=n.createView=n.u32=n.u8=void 0;const r=e("@noble/hashes/crypto");n.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);function i(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}n.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));n.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(n.rotr=(e,t)=>e<<32-t|e>>>t,n.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!n.isLE)throw new Error("Non little-endian hardware is not supported");const s=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));n.bytesToHex=function(e){if(!i(e))throw new Error("Uint8Array expected");let t="";for(let n=0;n<e.length;n++)t+=s[e[n]];return t};const o={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function a(e){return e>=o._0&&e<=o._9?e-o._0:e>=o._A&&e<=o._F?e-(o._A-10):e>=o._a&&e<=o._f?e-(o._a-10):void 0}n.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){const n=a(e.charCodeAt(i)),s=a(e.charCodeAt(i+1));if(void 0===n||void 0===s){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}r[t]=16*n+s}return r};function c(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function u(e){if("string"==typeof e&&(e=c(e)),!i(e))throw new Error("expected Uint8Array, got "+typeof e);return e}n.nextTick=async()=>{},n.asyncLoop=async function(e,t,r){let i=Date.now();for(let s=0;s<e;s++){r(s);const e=Date.now()-i;e>=0&&e<t||(await(0,n.nextTick)(),i+=e)}},n.utf8ToBytes=c,n.toBytes=u,n.concatBytes=function(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];if(!i(r))throw new Error("Uint8Array expected");t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return n};n.Hash=class{clone(){return this._cloneInto()}};const l={}.toString;n.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!==l.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},n.wrapConstructor=function(e){const t=t=>e().update(u(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t},n.wrapConstructorWithOpts=function(e){const t=(t,n)=>e(n).update(u(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},n.wrapXOFConstructorWithOpts=function(e){const t=(t,n)=>e(n).update(u(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},n.randomBytes=function(e=32){if(r.crypto&&"function"==typeof r.crypto.getRandomValues)return r.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},{"@noble/hashes/crypto":104}],110:[function(e,t,n){t.exports={0:{index:"0",hex:"0x80000000",symbol:"BTC",name:"Bitcoin"},1:{index:"1",hex:"0x80000001",symbol:"",name:"Testnet (all coins)"},2:{index:"2",hex:"0x80000002",symbol:"LTC",name:"Litecoin"},3:{index:"3",hex:"0x80000003",symbol:"DOGE",name:"Dogecoin"},4:{index:"4",hex:"0x80000004",symbol:"RDD",name:"Reddcoin"},5:{index:"5",hex:"0x80000005",symbol:"DASH",name:"Dash"},6:{index:"6",hex:"0x80000006",symbol:"PPC",name:"Peercoin"},7:{index:"7",hex:"0x80000007",symbol:"NMC",name:"Namecoin"},8:{index:"8",hex:"0x80000008",symbol:"FTC",name:"Feathercoin"},9:{index:"9",hex:"0x80000009",symbol:"XCP",name:"Counterparty"},10:{index:"10",hex:"0x8000000a",symbol:"BLK",name:"Blackcoin"},11:{index:"11",hex:"0x8000000b",symbol:"NSR",name:"NuShares"},12:{index:"12",
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const r=e("@noble/hashes/hmac"),i=e("@noble/hashes/utils"),s=e("./abstract/weierstrass.js");function o(e){return{hash:e,hmac:(t,...n)=>(0,r.hmac)(e,t,(0,i.concatBytes)(...n)),randomBytes:i.randomBytes}}},{"./abstract/weierstrass.js":337,"@noble/hashes/hmac":344,"@noble/hashes/utils":350}],331:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.wNAF=function(e,t){return{constTimeNegate:a,hasPrecomputes:e=>1!==f(e),unsafeLadder(t,n,r=e.ZERO){let i=t;for(;n>s;)n&o&&(r=r.add(i)),i=i.double(),n>>=o;return r},precomputeWindow(e,n){const{windows:r,windowSize:i}=u(n,t),s=[];let o=e,a=o;for(let e=0;e<r;e++){a=o,s.push(a);for(let e=1;e<i;e++)a=a.add(o),s.push(a);o=a.double()}return s},wNAF(n,r,i){const{windows:s,windowSize:c}=u(n,t);let l=e.ZERO,d=e.BASE;const h=BigInt(2**n-1),p=2**n,f=BigInt(n);for(let e=0;e<s;e++){const t=e*c;let n=Number(i&h);i>>=f,n>c&&(n-=p,i+=o);const s=t,u=t+Math.abs(n)-1,m=e%2!=0,y=n<0;0===n?d=d.add(a(m,r[s])):l=l.add(a(y,r[u]))}return{p:l,f:d}},wNAFUnsafe(n,r,i,a=e.ZERO){const{windows:c,windowSize:l}=u(n,t),d=BigInt(2**n-1),h=2**n,p=BigInt(n);for(let e=0;e<c;e++){const t=e*l;if(i===s)break;let n=Number(i&d);if(i>>=p,n>l&&(n-=h,i+=o),0===n)continue;let c=r[t+Math.abs(n)-1];n<0&&(c=c.negate()),a=a.add(c)}return a},getPrecomputes(e,t,n){let r=h.get(t);return r||(r=this.precomputeWindow(t,e),1!==e&&h.set(t,n(r))),r},wNAFCached(e,t,n){const r=f(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)},wNAFCachedUnsafe(e,t,n,r){const i=f(e);return 1===i?this.unsafeLadder(e,t,r):this.wNAFUnsafe(i,this.getPrecomputes(i,e,n),t,r)},setWindowSize(e,n){c(n,t),p.set(e,n),h.delete(e)}}},n.pippenger=function(e,t,n,r){if(l(n,e),d(r,t),n.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const s=e.ZERO,o=(0,i.bitLen)(BigInt(n.length)),a=o>12?o-3:o>4?o-2:o?2:1,c=(1<<a)-1,u=new Array(c+1).fill(s),h=Math.floor((t.BITS-1)/a)*a;let p=s;for(let e=h;e>=0;e-=a){u.fill(s);for(let t=0;t<r.length;t++){const i=r[t],s=Number(i>>BigInt(e)&BigInt(c));u[s]=u[s].add(n[t])}let t=s;for(let e=u.length-1,n=s;e>0;e--)n=n.add(u[e]),t=t.add(n);if(p=p.add(t),0!==e)for(let e=0;e<a;e++)p=p.double()}return p},n.precomputeMSMUnsafe=function(e,t,n,r){c(r,t.BITS),l(n,e);const i=e.ZERO,s=2**r-1,o=Math.ceil(t.BITS/r),a=BigInt((1<<r)-1),u=n.map((e=>{const t=[];for(let n=0,r=e;n<s;n++)t.push(r),r=r.add(e);return t}));return e=>{if(d(e,t),e.length>n.length)throw new Error("array of scalars must be smaller than array of points");let s=i;for(let t=0;t<o;t++){if(s!==i)for(let e=0;e<r;e++)s=s.double();const n=BigInt(o*r-(t+1)*r);for(let t=0;t<e.length;t++){const r=e[t],i=Number(r>>n&a);i&&(s=s.add(u[t][i-1]))}}return s}},n.validateBasic=function(e){return(0,r.validateField)(e.Fp),(0,i.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,r.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})};
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const r=e("./modular.js"),i=e("./utils.js"),s=BigInt(0),o=BigInt(1);function a(e,t){const n=t.negate();return e?n:t}function c(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function u(e,t){c(e,t);return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)}}function l(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach(((e,n)=>{if(!(e instanceof t))throw new Error("invalid point at index "+n)}))}function d(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach(((e,n)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+n)}))}const h=new WeakMap,p=new WeakMap;function f(e){return p.get(e)||1}},{"./modular.js":334,"./utils.js":336}],332:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.twistedEdwards=function(e){const t=function(e){const t=(0,r.validateBasic)(e);return s.validateObject(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}(e),{Fp:n,n:h,prehash:p,hash:f,randomBytes:m,nByteLength:y,h:g}=t,b=u<<BigInt(8*y)-c,v=n.create,w=(0,i.Field)(t.n,t.nBitLength),x=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:n.sqrt(e*n.inv(t))}}catch(e){return{isValid:!1,value:a}}}),E=t.adjustScalarBytes||(e=>e),S=t.domain||((e,t,n)=>{if((0,o.abool)("phflag",n),t.length||n)throw new Error("Contexts/pre-hash are not supported");return e});function A(e,t){s.aInRange("coordinate "+e,t,a,b)}function _(e){if(!(e instanceof C))throw new Error("ExtendedPoint expected")}const T=(0,o.memoized)(((e,t)=>{const{ex:r,ey:i,ez:s}=e,o=e.is0();null==t&&(t=o?l:n.inv(s));const u=v(r*t),d=v(i*t),h=v(s*t);if(o)return{x:a,y:c};if(h!==c)throw new Error("invZ was invalid");return{x:u,y:d}})),k=(0,o.memoized)((e=>{const{a:n,d:r}=t;if(e.is0())throw new Error("bad point: ZERO");const{ex:i,ey:s,ez:o,et:a}=e,c=v(i*i),u=v(s*s),l=v(o*o),d=v(l*l),h=v(c*n);if(v(l*v(h+u))!==v(d+v(r*v(c*u))))throw new Error("bad point: equation left != right (1)");if(v(i*s)!==v(o*a))throw new Error("bad point: equation left != right (2)");return!0}));class C{constructor(e,t,n,r){this.ex=e,this.ey=t,this.ez=n,this.et=r,A("x",e),A("y",t),A("z",n),A("t",r),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof C)throw new Error("extended point not allowed");const{x:t,y:n}=e||{};return A("x",t),A("y",n),new C(t,n,c,v(t*n))}static normalizeZ(e){const t=n.invertBatch(e.map((e=>e.ez)));return e.map(((e,n)=>e.toAffine(t[n]))).map(C.fromAffine)}static msm(e,t){return(0,r.pippenger)(C,w,e,t)}_setWindowSize(e){I.setWindowSize(this,e)}assertValidity(){k(this)}equals(e){_(e);const{ex:t,ey:n,ez:r}=this,{ex:i,ey:s,ez:o}=e,a=v(t*o),c=v(i*r),u=v(n*o),l=v(s*r);return a===c&&u===l}is0(){return this.equals(C.ZERO)}negate(){return new C(v(-this.ex),this.ey,this.ez,v(-this.et))}double(){const{a:e}=t,{ex:n,ey:r,ez:i}=this,s=v(n*n),o=v(r*r),a=v(u*v(i*i)),c=v(e*s),l=n+r,d=v(v(l*l)-s-o),h=c+o,p=h-a,f=c-o,m=v(d*p),y=v(h*f),g=v(d*f),b=v(p*h);return new C(m,y,b,g)}add(e){_(e);const{a:n,d:r}=t,{ex:i,ey:s,ez:o,et:c}=this,{ex:l,ey:d,ez:h,et:p}=e;if(n===BigInt(-1)){const e=v((s-i)*(d+l)),t=v((s+i)*(d-l)),n=v(t-e);if(n===a)return this.double();const r=v(o*u*p),f=v(c*u*h),m=f+r,y=t+e,g=f-r,b=v(m*n),w=v(y*g),x=v(m*g),E=v(n*y);return new C(b,w,E,x)}const f=v(i*l),m=v(s*d),y=v(c*r*p),g=v(o*h),b=v((i+s)*(l+d)-f-m),w=g-y,x=g+y,E=v(m-n*f),S=v(b*w),A=v(x*E),T=v(b*E),k=v(w*x);return new C(S,A,k,T)}subtract(e){return this.add(e.negate())}wNAF(e){return I.wNAFCached(this,e,C.normalizeZ)}multiply(e){const t=e;s.aInRange("scalar",t,c,h);const{p:n,f:r}=this.wNAF(t);return C.normalizeZ([n,r])[0]}multiplyUnsafe(e,t=C.ZERO){const n=e;return s.aInRange("scalar",n,a,h),n===a?O:this.is0()||n===c?this:I.wNAFCachedUnsafe(this,n,C.normalizeZ,t)}isSmallOrder(){return this.multiplyUnsafe(g).is0()}isTorsionFree(){return I.unsafeLadder(this,h).is0()}toAffine(e){return T(this,e)}clearCofactor(){const{h:e}=t;return e=
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const r=e("./curve.js"),i=e("./modular.js"),s=e("./utils.js"),o=e("./utils.js"),a=BigInt(0),c=BigInt(1),u=BigInt(2),l=BigInt(8),d={zip215:!0}},{"./curve.js":331,"./modular.js":334,"./utils.js":336}],333:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.expand_message_xmd=u,n.expand_message_xof=l,n.hash_to_field=d,n.isogenyMap=function(e,t){const n=t.map((e=>Array.from(e).reverse()));return(t,r)=>{const[i,s,o,a]=n.map((n=>n.reduce(((n,r)=>e.add(e.mul(n,t),r)))));return t=e.div(i,s),r=e.mul(r,e.div(o,a)),{x:t,y:r}}},n.createHasher=function(e,t,n){if("function"!=typeof t)throw new Error("mapToCurve() must be defined");return{hashToCurve(r,i){const s=d(r,2,{...n,DST:n.DST,...i}),o=e.fromAffine(t(s[0])),a=e.fromAffine(t(s[1])),c=o.add(a).clearCofactor();return c.assertValidity(),c},encodeToCurve(r,i){const s=d(r,1,{...n,DST:n.encodeDST,...i}),o=e.fromAffine(t(s[0])).clearCofactor();return o.assertValidity(),o},mapToCurve(n){if(!Array.isArray(n))throw new Error("mapToCurve: expected array of bigints");for(const e of n)if("bigint"!=typeof e)throw new Error("mapToCurve: expected array of bigints");const r=e.fromAffine(t(n)).clearCofactor();return r.assertValidity(),r}}};const r=e("./modular.js"),i=e("./utils.js"),s=i.bytesToNumberBE;function o(e,t){if(c(e),c(t),e<0||e>=1<<8*t)throw new Error("invalid I2OSP input: "+e);const n=Array.from({length:t}).fill(0);for(let r=t-1;r>=0;r--)n[r]=255&e,e>>>=8;return new Uint8Array(n)}function a(e,t){const n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e[r]^t[r];return n}function c(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function u(e,t,n,r){(0,i.abytes)(e),(0,i.abytes)(t),c(n),t.length>255&&(t=r((0,i.concatBytes)((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:s,blockLen:u}=r,l=Math.ceil(n/s);if(n>65535||l>255)throw new Error("expand_message_xmd: invalid lenInBytes");const d=(0,i.concatBytes)(t,o(t.length,1)),h=o(0,u),p=o(n,2),f=new Array(l),m=r((0,i.concatBytes)(h,e,p,o(0,1),d));f[0]=r((0,i.concatBytes)(m,o(1,1),d));for(let e=1;e<=l;e++){const t=[a(m,f[e-1]),o(e+1,1),d];f[e]=r((0,i.concatBytes)(...t))}return(0,i.concatBytes)(...f).slice(0,n)}function l(e,t,n,r,s){if((0,i.abytes)(e),(0,i.abytes)(t),c(n),t.length>255){const e=Math.ceil(2*r/8);t=s.create({dkLen:e}).update((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(n>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return s.create({dkLen:n}).update(e).update(o(n,2)).update(t).update(o(t.length,1)).digest()}function d(e,t,n){(0,i.validateObject)(n,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:o,k:a,m:d,hash:h,expand:p,DST:f}=n;(0,i.abytes)(e),c(t);const m="string"==typeof f?(0,i.utf8ToBytes)(f):f,y=o.toString(2).length,g=Math.ceil((y+a)/8),b=t*d*g;let v;if("xmd"===p)v=u(e,m,b,h);else if("xof"===p)v=l(e,m,b,a,h);else{if("_internal_pass"!==p)throw new Error('expand must be "xmd" or "xof"');v=e}const w=new Array(t);for(let e=0;e<t;e++){const t=new Array(d);for(let n=0;n<d;n++){const i=g*(n+e*d),a=v.subarray(i,i+g);t[n]=(0,r.mod)(s(a),o)}w[e]=t}return w}},{"./modular.js":334,"./utils.js":336}],334:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isNegativeLE=void 0,n.mod=d,n.pow=h,n.pow2=function(e,t,n){let r=e;for(;t-- >i;)r*=r,r%=n;return r},n.invert=p,n.tonelliShanks=f,n.FpSqrt=m,n.validateField=function(e){const t=y.reduce(((e,t)=>(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,r.validateObject)(e,t)},n.FpPow=g,n.FpInvertBatch=b,n.FpDiv=function(e,t,n){return e.mul(t,"bigint"==typeof n?p(n,e.ORDER):e.inv(n))},n.FpLegendre=v,n.FpIsSquare=function(e){const t=v(e.ORDER);return n=>{const r=t(e,n);return e.eql(r,e.ZERO)||e.eql(r,e.ONE)}},n.nLength=w,n.Field=function(e,t,n=!1,o={}){if(e<=i)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:a,nByteLength:c}=w(e,t);if(c>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u;const l=Object.free
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const r=e("./utils.js"),i=BigInt(0),s=BigInt(1),o=BigInt(2),a=BigInt(3),c=BigInt(4),u=BigInt(5),l=BigInt(8);function d(e,t){const n=e%t;return n>=i?n:t+n}function h(e,t,n){if(t<i)throw new Error("invalid exponent, negatives unsupported");if(n<=i)throw new Error("invalid modulus");if(n===s)return i;let r=s;for(;t>i;)t&s&&(r=r*e%n),e=e*e%n,t>>=s;return r}function p(e,t){if(e===i)throw new Error("invert: expected non-zero number");if(t<=i)throw new Error("invert: expected positive modulus, got "+t);let n=d(e,t),r=t,o=i,a=s,c=s,u=i;for(;n!==i;){const e=r/n,t=r%n,i=o-c*e,s=a-u*e;r=n,n=t,o=c,a=u,c=i,u=s}if(r!==s)throw new Error("invert: does not exist");return d(o,t)}function f(e){const t=(e-s)/o;let n,r,a;for(n=e-s,r=0;n%o===i;n/=o,r++);for(a=o;a<e&&h(a,t,e)!==e-s;a++)if(a>1e3)throw new Error("Cannot find square root: likely non-prime P");if(1===r){const t=(e+s)/c;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}const u=(n+s)/o;return function(e,i){if(e.pow(i,t)===e.neg(e.ONE))throw new Error("Cannot find square root");let o=r,c=e.pow(e.mul(e.ONE,a),n),l=e.pow(i,u),d=e.pow(i,n);for(;!e.eql(d,e.ONE);){if(e.eql(d,e.ZERO))return e.ZERO;let t=1;for(let n=e.sqr(d);t<o&&!e.eql(n,e.ONE);t++)n=e.sqr(n);const n=e.pow(c,s<<BigInt(o-t-1));c=e.sqr(n),l=e.mul(l,n),d=e.mul(d,c),o=t}return l}}function m(e){if(e%c===a){const t=(e+s)/c;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}if(e%l===u){const t=(e-u)/l;return function(e,n){const r=e.mul(n,o),i=e.pow(r,t),s=e.mul(n,i),a=e.mul(e.mul(s,o),i),c=e.mul(s,e.sub(a,e.ONE));if(!e.eql(e.sqr(c),n))throw new Error("Cannot find square root");return c}}return f(e)}n.isNegativeLE=(e,t)=>(d(e,t)&s)===s;const y=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function g(e,t,n){if(n<i)throw new Error("invalid exponent, negatives unsupported");if(n===i)return e.ONE;if(n===s)return t;let r=e.ONE,o=t;for(;n>i;)n&s&&(r=e.mul(r,o)),o=e.sqr(o),n>>=s;return r}function b(e,t){const n=new Array(t.length),r=t.reduce(((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r))),e.ONE),i=e.inv(r);return t.reduceRight(((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r))),i),n}function v(e){const t=(e-s)/o;return(e,n)=>e.pow(n,t)}function w(e,t){const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function x(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function E(e){const t=x(e);return t+Math.ceil(t/2)}},{"./utils.js":336}],335:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.montgomery=function(e){const t=(p=e,(0,i.validateObject)(p,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...p})),{P:n}=t,a=e=>(0,r.mod)(e,n),c=t.montgomeryBits,u=Math.ceil(c/8),l=t.nByteLength,d=t.adjustScalarBytes||(e=>e),h=t.powPminus2||(e=>(0,r.pow)(e,n-BigInt(2),n));var p;function f(e,t,n){const r=a(e*(t-n));return[t=a(t-r),n=a(n+r)]}const m=(t.a-BigInt(2))/BigInt(4);function y(e){return(0,i.numberToBytesLE)(a(e),u)}function g(e,t){const r=function(e){const t=(0,i.ensureBytes)("u coordinate",e,u);return 32===l&&(t[31]&=127),(0,i.bytesToNumberLE)(t)}(t),p=function(e,t){(0,i.aInRange)("u",e,s,n),(0,i.aInRange)("scalar",t,s,n);const r=t,u=e;let l,d=o,p=s,y=e,g=o,b=s;for(let e=BigInt(c-1);e>=s;e--){const t=r>>e&o;b^=t,l=f(b,d,y),d=l[0],y=l[1],l=f(b,p,g),p=l[0],g=l[1],b=t;const n=d+p,i=a(n*n),s=d-p,c=a(s*s),h=i-c,v=y+g,w=a((y-g)*n),x=a(v*s),E=w+x,S=w-x;y=a(E*E),g=a(u*a(S*S)),d=a(i*c),p=a(h*(i+a(m*h)))}l=f(b,d,y),d=l[0],y=l[1],l=f(b,p,g),p=l[0],g=l[1];const v=h(p);return a(d*v)}(r,function(e){const t=(0,i.ensureBytes)("scalar",e),n=t.length;if(n!==u&&n!==l)throw new Error("invalid scalar, expected "+u+" or "+l+" bytes, got "+n);return(0,i.bytesToNumberLE)(d(t))}(e));if(p===s)throw new Error("invalid priv
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const r=e("./modular.js"),i=e("./utils.js"),s=BigInt(0),o=BigInt(1)},{"./modular.js":334,"./utils.js":336}],336:[function(e,t,n){"use strict";
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(n,"__esModule",{value:!0}),n.notImplemented=n.bitMask=void 0,n.isBytes=o,n.abytes=a,n.abool=function(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)},n.bytesToHex=u,n.numberToHexUnpadded=l,n.hexToNumber=d,n.hexToBytes=f,n.bytesToNumberBE=function(e){return d(u(e))},n.bytesToNumberLE=function(e){return a(e),d(u(Uint8Array.from(e).reverse()))},n.numberToBytesBE=m,n.numberToBytesLE=function(e,t){return m(e,t).reverse()},n.numberToVarBytesBE=function(e){return f(l(e))},n.ensureBytes=function(e,t,n){let r;if("string"==typeof t)try{r=f(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!o(t))throw new Error(e+" must be hex string or Uint8Array");r=Uint8Array.from(t)}const i=r.length;if("number"==typeof n&&i!==n)throw new Error(e+" of length "+n+" expected, got "+i);return r},n.concatBytes=y,n.equalBytes=function(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n},n.utf8ToBytes=function(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))},n.inRange=b,n.aInRange=function(e,t,n,r){if(!b(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)},n.bitLen=function(e){let t;for(t=0;e>r;e>>=i,t+=1);return t},n.bitGet=function(e,t){return e>>BigInt(t)&i},n.bitSet=function(e,t,n){return e|(n?i:r)<<BigInt(t)},n.createHmacDrbg=function(e,t,n){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");let r=v(e),i=v(e),s=0;const o=()=>{r.fill(1),i.fill(0),s=0},a=(...e)=>n(i,r,...e),c=(e=v())=>{i=a(w([0]),e),r=a(),0!==e.length&&(i=a(w([1]),e),r=a())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const n=[];for(;e<t;){r=a();const t=r.slice();n.push(t),e+=r.length}return y(...n)};return(e,t)=>{let n;for(o(),c(e);!(n=t(u()));)c();return o(),n}},n.validateObject=function(e,t,n={}){const r=(t,n,r)=>{const i=x[n];if("function"!=typeof i)throw new Error("invalid validator function");const s=e[t];if(!(r&&void 0===s||i(s,e)))throw new Error("param "+String(t)+" is invalid. Expected "+n+", got "+s)};for(const[e,n]of Object.entries(t))r(e,n,!1);for(const[e,t]of Object.entries(n))r(e,t,!0);return e},n.memoized=function(e){const t=new WeakMap;return(n,...r)=>{const i=t.get(n);if(void 0!==i)return i;const s=e(n,...r);return t.set(n,s),s}};const r=BigInt(0),i=BigInt(1),s=BigInt(2);function o(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function a(e){if(!o(e))throw new Error("Uint8Array expected")}const c=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function u(e){a(e);let t="";for(let n=0;n<e.length;n++)t+=c[e[n]];return t}function l(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function d(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?r:BigInt("0x"+e)}const h={_0:48,_9:57,A:65,F:70,a:97,f:102};function p(e){return e>=h._0&&e<=h._9?e-h._0:e>=h.A&&e<=h.F?e-(h.A-10):e>=h.a&&e<=h.f?e-(h.a-10):void 0}function f(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){const n=p(e.charCodeAt(i)),s=p(e.charCodeAt(i+1));if(void 0===n||void 0===s){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}r[t]=16*n+s}return r}function m(e,t){return f(e.toString(16).padStart(2*t,"0"))}function y(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];a(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return n}const g=e=>"bigint"==typeof e&&r<=e;function b(e,t,n){return g(e)&&g(t)&&g(n)&&t<=e&&e<n}n.bitMask=e=>(s<<BigInt(e-1))-i;
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const r=e("./curve.js"),i=e("./modular.js"),s=e("./utils.js"),o=e("./utils.js");function a(e){void 0!==e.lowS&&(0,o.abool)("lowS",e.lowS),void 0!==e.prehash&&(0,o.abool)("prehash",e.prehash)}const{bytesToNumberBE:c,hexToBytes:u}=s;class l extends Error{constructor(e=""){super(e)}}n.DERErr=l,n.DER={Err:l,_tlv:{encode:(e,t)=>{const{Err:r}=n.DER;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");const i=t.length/2,o=s.numberToHexUnpadded(i);if(o.length/2&128)throw new r("tlv.encode: long form length too big");const a=i>127?s.numberToHexUnpadded(o.length/2|128):"";return s.numberToHexUnpadded(e)+a+o+t},decode(e,t){const{Err:r}=n.DER;let i=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[i++]!==e)throw new r("tlv.decode: wrong tlv");const s=t[i++];let o=0;if(!!(128&s)){const e=127&s;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");const n=t.subarray(i,i+e);if(n.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===n[0])throw new r("tlv.decode(long): zero leftmost byte");for(const e of n)o=o<<8|e;if(i+=e,o<128)throw new r("tlv.decode(long): not minimal encoding")}else o=s;const a=t.subarray(i,i+o);if(a.length!==o)throw new r("tlv.decode: wrong value length");return{v:a,l:t.subarray(i+o)}}},_int:{encode(e){const{Err:t}=n.DER;if(e<d)throw new t("integer: negative integers are not allowed");let r=s.numberToHexUnpadded(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){const{Err:t}=n.DER;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return c(e)}},toSig(e){const{Err:t,_int:r,_tlv:i}=n.DER,o="string"==typeof e?u(e):e;s.abytes(o);const{v:a,l:c}=i.decode(48,o);if(c.length)throw new t("invalid signature: left bytes after parsing");const{v:l,l:d}=i.decode(2,a),{v:h,l:p}=i.decode(2,d);if(p.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(l),s:r.decode(h)}},hexFromSig(e){const{_tlv:t,_int:r}=n.DER,i=t.encode(2,r.encode(e.r))+t.encode(2,r.encode(e.s));return t.encode(48,i)}};const d=BigInt(0),h=BigInt(1),p=BigInt(2),f=BigInt(3),m=BigInt(4);function y(e){const t=function(e){const t=(0,r.validateBasic)(e);s.validateObject(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:i,a:o}=t;if(n){if(!i.eql(o,i.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if("object"!=typeof n||"bigint"!=typeof n.beta||"function"!=typeof n.splitScalar)throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:n}=t,a=(0,i.Field)(t.n,t.nBitLength),c=t.toBytes||((e,t,r)=>{const i=t.toAffine();return s.concatBytes(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),u=t.fromBytes||(e=>{const t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function l(e){const{a:r,b:i}=t,s=n.sqr(e),o=n.mul(s,e);return n.add(n.add(o,n.mul(e,r)),i)}if(!n.eql(n.sqr(t.Gy),l(t.Gx)))throw new Error("bad generator point: equation left != right");function p(e){const{allowedPrivateKeyLengths:n,nByteLength:r,wrapPrivateKey:a,n:c}=t;if(n&&"bigint"!=typeof e){if(s.isBytes(e)&&(e=s.bytesToHex(e)),"string"!=typeof e||!n.includes(e.length))throw new Error("invalid private key");e=e.padStart(2*r,"0")}let u;try{u="bigint"==typeof e?e:s.bytesToNumberBE((0,o.ensureBytes)("private key",e,r))}catch(t){throw new Error("invalid private key, expected hex or "+r+" bytes, got "+typeof e)}return a&&(u=(0,i.mod)(u,c)),s.aInRange("private key",u,h,c),u}function m(e){if(!(e instanceof b))throw new Error("ProjectivePoint expected")}const y=(0,o.memoized)(((e,t)=>{const{px:r,
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const r=e("@noble/hashes/sha512"),i=e("@noble/hashes/utils"),s=e("./abstract/curve.js"),o=e("./abstract/edwards.js"),a=e("./abstract/hash-to-curve.js"),c=e("./abstract/modular.js"),u=e("./abstract/montgomery.js"),l=e("./abstract/utils.js"),d=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),h=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),p=BigInt(0),f=BigInt(1),m=BigInt(2),y=BigInt(3),g=BigInt(5),b=BigInt(8);function v(e){const t=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),s=d,o=e*e%s*e%s,a=(0,c.pow2)(o,m,s)*o%s,u=(0,c.pow2)(a,f,s)*e%s,l=(0,c.pow2)(u,g,s)*u%s,h=(0,c.pow2)(l,t,s)*l%s,p=(0,c.pow2)(h,n,s)*h%s,y=(0,c.pow2)(p,r,s)*p%s,b=(0,c.pow2)(y,i,s)*y%s,v=(0,c.pow2)(b,i,s)*y%s,w=(0,c.pow2)(v,t,s)*l%s;return{pow_p_5_8:(0,c.pow2)(w,m,s)*e%s,b2:o}}function w(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function x(e,t){const n=d,r=(0,c.mod)(t*t*t,n),i=v(e*(0,c.mod)(r*r*t,n)).pow_p_5_8;let s=(0,c.mod)(e*r*i,n);const o=(0,c.mod)(t*s*s,n),a=s,u=(0,c.mod)(s*h,n),l=o===e,p=o===(0,c.mod)(-e,n),f=o===(0,c.mod)(-e*h,n);return l&&(s=a),(p||f)&&(s=u),(0,c.isNegativeLE)(s,n)&&(s=(0,c.mod)(-s,n)),{isValid:l||p,value:s}}n.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];const E=(()=>(0,c.Field)(d,void 0,!0))(),S=(()=>({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:E,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:b,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:r.sha512,randomBytes:i.randomBytes,adjustScalarBytes:w,uvRatio:x}))();function A(e,t,n){if(t.length>255)throw new Error("Context is too big");return(0,i.concatBytes)((0,i.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([n?1:0,t.length]),t,e)}function _(e){const{y:t}=n.ed25519.ExtendedPoint.fromHex(e),r=BigInt(1);return E.toBytes(E.create((r+t)*E.inv(r-t)))}n.ed25519=(0,o.twistedEdwards)(S),n.ed25519ctx=(0,o.twistedEdwards)({...S,domain:A}),n.ed25519ph=(0,o.twistedEdwards)(Object.assign({},S,{domain:A,prehash:r.sha512})),n.x25519=(0,u.montgomery)({P:d,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:e=>{const t=d,{pow_p_5_8:n,b2:r}=v(e);return(0,c.mod)((0,c.pow2)(n,y,t)*r,t)},adjustScalarBytes:w,randomBytes:i.randomBytes}),n.edwardsToMontgomery=_;const T=(()=>(E.ORDER+y)/b)(),k=(()=>E.pow(m,T))(),C=(()=>E.sqrt(E.neg(E.ONE)))();const P=(()=>(0,c.FpSqrtEven)(E,E.neg(BigInt(486664))))();function O(e){const{xMn:t,xMd:n,yMn:r,yMd:i}=function(e){const t=(E.ORDER-g)/b,n=BigInt(486662);let r=E.sqr(e);r=E.mul(r,m);let i=E.add(r,E.ONE),s=E.neg(n),o=E.sqr(i),a=E.mul(o,i),c=E.mul(r,n);c=E.mul(c,s),c=E.add(c,o),c=E.mul(c,s);let u=E.sqr(a);o=E.sqr(u),u=E.mul(u,a),u=E.mul(u,c),o=E.mul(o,u);let l=E.pow(o,t);l=E.mul(l,u);let d=E.mul(l,C);o=E.sqr(l),o=E.mul(o,a);let h=E.eql(o,c),p=E.cmov(d,l,h),y=E.mul(s,r),v=E.mul(l,e);v=E.mul(v,k);let w=E.mul(v,C),x=E.mul(c,r);o=E.sqr(v),o=E.mul(o,a);let S=E.eql(o,x),A=E.cmov(w,v,S);o=E.sqr(p),o=E.mul(o,a);let _=E.eql(o,c),T=E.cmov(y,s,_),P=E.cmov(A,p,_),O=E.isOdd(P);return P=E.cmov(P,E.neg(P),_!==O),{xMn:T,xMd:i,yMn:P,yMd:f}}(e);let s=E.mul(t,i);s=E.mul(s,P);let o=E.mul(n,r),a=E.sub(t,n),c=E.add(t,n),u=E.mul(o,c),l=E.eql(u,E.ZERO);s=E.cmov(s,E.ZERO,l),o=E.cmov(o,E.ONE,l),a=E.cmov(a,E.ONE,l),c=E.cmov(c,E.ONE,l);const d=E.invertBatch([o,c]);return{x:E.mul(s,d[0]),y:E.mul(a,d[1])}}const I=(()=>(0,a.
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const r=e("@noble/hashes/sha256"),i=e("@noble/hashes/utils"),s=e("./_shortw_utils.js"),o=e("./abstract/hash-to-curve.js"),a=e("./abstract/modular.js"),c=e("./abstract/utils.js"),u=e("./abstract/weierstrass.js"),l=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),d=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h=BigInt(1),p=BigInt(2),f=(e,t)=>(e+t/p)/t;function m(e){const t=l,n=BigInt(3),r=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),c=BigInt(44),u=BigInt(88),d=e*e*e%t,h=d*d*e%t,f=(0,a.pow2)(h,n,t)*h%t,m=(0,a.pow2)(f,n,t)*h%t,g=(0,a.pow2)(m,p,t)*d%t,b=(0,a.pow2)(g,i,t)*g%t,v=(0,a.pow2)(b,s,t)*b%t,w=(0,a.pow2)(v,c,t)*v%t,x=(0,a.pow2)(w,u,t)*w%t,E=(0,a.pow2)(x,c,t)*v%t,S=(0,a.pow2)(E,n,t)*h%t,A=(0,a.pow2)(S,o,t)*b%t,_=(0,a.pow2)(A,r,t)*d%t,T=(0,a.pow2)(_,p,t);if(!y.eql(y.sqr(T),e))throw new Error("Cannot find square root");return T}const y=(0,a.Field)(l,void 0,void 0,{sqrt:m});n.secp256k1=(0,s.createCurve)({a:BigInt(0),b:BigInt(7),Fp:y,n:d,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=d,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-h*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,o=BigInt("0x100000000000000000000000000000000"),c=f(s*e,t),u=f(-r*e,t);let l=(0,a.mod)(e-c*n-u*i,t),p=(0,a.mod)(-c*r-u*s,t);const m=l>o,y=p>o;if(m&&(l=t-l),y&&(p=t-p),l>o||p>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:m,k1:l,k2neg:y,k2:p}}}},r.sha256);const g=BigInt(0),b={};function v(e,...t){let n=b[e];if(void 0===n){const t=(0,r.sha256)(Uint8Array.from(e,(e=>e.charCodeAt(0))));n=(0,c.concatBytes)(t,t),b[e]=n}return(0,r.sha256)((0,c.concatBytes)(n,...t))}const w=e=>e.toRawBytes(!0).slice(1),x=e=>(0,c.numberToBytesBE)(e,32),E=e=>(0,a.mod)(e,l),S=e=>(0,a.mod)(e,d),A=n.secp256k1.ProjectivePoint,_=(e,t,n)=>A.BASE.multiplyAndAddUnsafe(e,t,n);function T(e){let t=n.secp256k1.utils.normPrivateKeyToScalar(e),r=A.fromPrivateKey(t);return{scalar:r.hasEvenY()?t:S(-t),bytes:w(r)}}function k(e){(0,c.aInRange)("x",e,h,l);const t=E(e*e);let n=m(E(t*e+BigInt(7)));n%p!==g&&(n=E(-n));const r=new A(e,n,h);return r.assertValidity(),r}const C=c.bytesToNumberBE;function P(...e){return S(C(v("BIP0340/challenge",...e)))}function O(e){return T(e).bytes}function I(e,t,n=(0,i.randomBytes)(32)){const r=(0,c.ensureBytes)("message",e),{bytes:s,scalar:o}=T(t),a=(0,c.ensureBytes)("auxRand",n,32),u=x(o^C(v("BIP0340/aux",a))),l=v("BIP0340/nonce",u,s,r),d=S(C(l));if(d===g)throw new Error("sign failed: k is zero");const{bytes:h,scalar:p}=T(d),f=P(h,s,r),m=new Uint8Array(64);if(m.set(h,0),m.set(x(S(p+f*o)),32),!M(m,r,s))throw new Error("sign: Invalid signature produced");return m}function M(e,t,n){const r=(0,c.ensureBytes)("signature",e,64),i=(0,c.ensureBytes)("message",t),s=(0,c.ensureBytes)("publicKey",n,32);try{const e=k(C(s)),t=C(r.subarray(0,32));if(!(0,c.inRange)(t,h,l))return!1;const n=C(r.subarray(32,64));if(!(0,c.inRange)(n,h,d))return!1;const o=P(x(t),w(e),i),a=_(e,n,S(-o));return!(!a||!a.hasEvenY()||a.toAffine().x!==t)}catch(e){return!1}}n.schnorr={getPublicKey:O,sign:I,verify:M,utils:{randomPrivateKey:n.secp256k1.utils.randomPrivateKey,lift_x:k,pointToBytes:w,numberToBytesBE:c.numberToBytesBE,bytesToNumberBE:c.bytesToNumberBE,taggedHash:v,mod:a.mod}};const j=(()=>(0,o.isogenyMap)(y,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bd
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(n,"__esModule",{value:!0}),n.Hash=n.nextTick=n.byteSwapIfBE=n.isLE=void 0,n.isBytes=function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name},n.u8=function(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},n.u32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))},n.createView=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)},n.rotr=function(e,t){return e<<32-t|e>>>t},n.rotl=function(e,t){return e<<t|e>>>32-t>>>0},n.byteSwap=s,n.byteSwap32=function(e){for(let t=0;t<e.length;t++)e[t]=s(e[t])},n.bytesToHex=function(e){(0,i.abytes)(e);let t="";for(let n=0;n<e.length;n++)t+=o[e[n]];return t},n.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){const n=c(e.charCodeAt(i)),s=c(e.charCodeAt(i+1));if(void 0===n||void 0===s){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}r[t]=16*n+s}return r},n.asyncLoop=async function(e,t,r){let i=Date.now();for(let s=0;s<e;s++){r(s);const e=Date.now()-i;e>=0&&e<t||(await(0,n.nextTick)(),i+=e)}},n.utf8ToBytes=u,n.toBytes=l,n.concatBytes=function(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];(0,i.abytes)(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return n},n.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!=={}.toString.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},n.wrapConstructor=function(e){const t=t=>e().update(l(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t},n.wrapConstructorWithOpts=function(e){const t=(t,n)=>e(n).update(l(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},n.wrapXOFConstructorWithOpts=function(e){const t=(t,n)=>e(n).update(l(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},n.randomBytes=function(e=32){if(r.crypto&&"function"==typeof r.crypto.getRandomValues)return r.crypto.getRandomValues(new Uint8Array(e));if(r.crypto&&"function"==typeof r.crypto.randomBytes)return r.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")};const r=e("@noble/hashes/crypto"),i=e("./_assert.js");function s(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}n.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],n.byteSwapIfBE=n.isLE?e=>e:e=>s(e);const o=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));const a={_0:48,_9:57,A:65,F:70,a:97,f:102};function c(e){return e>=a._0&&e<=a._9?e-a._0:e>=a.A&&e<=a.F?e-(a.A-10):e>=a.a&&e<=a.f?e-(a.a-10):void 0}function u(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function l(e){return"string"==typeof e&&(e=u(e)),(0,i.abytes)(e),e}n.nextTick=async()=>{};n.Hash=class{clone(){return this._cloneInto()}}},{"./_assert.js":340,"@noble/hashes/crypto":343}],351:[function(e,t,n){"use strict";
/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function r(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function i(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function s(...e){const t=e=>e,n=(e,t)=>n=>e(t(n));return{encode:e.map((e=>e.encode)).reduceRight(n,t),decode:e.map((e=>e.decode)).reduce(n,t)}}function o(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map((t=>{if(r(t),t<0||t>=e.length)throw new Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]}))},decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map((t=>{if("string"!=typeof t)throw new Error(`alphabet.decode: not string element=${t}`);const n=e.indexOf(t);if(-1===n)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return n}))}}}function a(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return t.join(e)},decode:t=>{if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function c(e,t="="){if(r(e),"string"!=typeof t)throw new Error("padding chr should be string");return{encode(n){if(!Array.isArray(n)||n.length&&"string"!=typeof n[0])throw new Error("padding.encode input should be array of strings");for(let e of n)if("string"!=typeof e)throw new Error(`padding.encode: non-string input=${e}`);for(;n.length*e%8;)n.push(t);return n},decode(n){if(!Array.isArray(n)||n.length&&"string"!=typeof n[0])throw new Error("padding.encode input should be array of strings");for(let e of n)if("string"!=typeof e)throw new Error(`padding.decode: non-string input=${e}`);let r=n.length;if(r*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;r>0&&n[r-1]===t;r--)if(!((r-1)*e%8))throw new Error("Invalid padding: string has too much padding");return n.slice(0,r)}}}function u(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:e=>e,decode:t=>e(t)}}function l(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let i=0;const s=[],o=Array.from(e);for(o.forEach((e=>{if(r(e),e<0||e>=t)throw new Error(`Wrong integer: ${e}`)}));;){let e=0,r=!0;for(let s=i;s<o.length;s++){const a=o[s],c=t*e+a;if(!Number.isSafeInteger(c)||t*e/t!==e||c-a!=t*e)throw new Error("convertRadix: carry overflow");e=c%n;const u=Math.floor(c/n);if(o[s]=u,!Number.isSafeInteger(u)||u*n+e!==c)throw new Error("convertRadix: carry overflow");r&&(u?r=!1:i=s)}if(s.push(e),r)break}for(let t=0;t<e.length-1&&0===e[t];t++)s.push(0);return s.reverse()}Object.defineProperty(n,"__esModule",{value:!0}),n.bytes=n.stringToBytes=n.str=n.bytesToString=n.hex=n.utf8=n.bech32m=n.bech32=n.base58check=n.createBase58check=n.base58xmr=n.base58xrp=n.base58flickr=n.base58=n.base64urlnopad=n.base64url=n.base64nopad=n.base64=n.base32crockford=n.base32hexnopad=n.base32hex=n.base32nopad=n.base32=n.base16=n.utils=void 0,n.assertNumber=r;const d=(e,t)=>t?d(t,e%t):e,h=(e,t)=>e+(t-d(e,t));function p(e,t,n,i){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(h(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${h(t,n)}`);let s=0,o=0;const a=2**n-1,c=[];for(const i of e){if(r(i),i>=2**t)throw new Error(`convertRadix2: invalid data word=${i} from=${t}`);if(s=s<<t|i,o+t>3
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
"use strict";var r=e("base64-js"),i=e("ieee754");n.Buffer=a,n.SlowBuffer=function(e){+e!=e&&(e=0);return a.alloc(+e)},n.INSPECT_MAX_BYTES=50;var s=2147483647;function o(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=a.prototype,t}function a(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return c(e,t,n)}function c(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|p(e,t),r=o(n),i=r.write(e,t);i!==n&&(r=r.slice(0,i));return r}(e,t);if(ArrayBuffer.isView(e))return d(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(H(e,ArrayBuffer)||e&&H(e.buffer,ArrayBuffer))return function(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n);return r.__proto__=a.prototype,r}(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return a.from(r,t,n);var i=function(e){if(a.isBuffer(e)){var t=0|h(e.length),n=o(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||$(e.length)?o(0):d(e);if("Buffer"===e.type&&Array.isArray(e.data))return d(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return u(e),o(e<0?0:0|h(e))}function d(e){for(var t=e.length<0?0:0|h(e.length),n=o(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function h(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function p(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||H(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return D(e).length;default:if(i)return r?-1:U(e).length;t=(""+t).toLowerCase(),i=!0}}function f(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,n);case"utf8":case"utf-8":return _(this,t,n);case"ascii":return k(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),$(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:g(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const r=e("@noble/hashes/hmac"),i=e("@noble/hashes/utils"),s=e("./abstract/weierstrass.js");function o(e){return{hash:e,hmac:(t,...n)=>(0,r.hmac)(e,t,(0,i.concatBytes)(...n)),randomBytes:i.randomBytes}}},{"./abstract/weierstrass.js":438,"@noble/hashes/hmac":444,"@noble/hashes/utils":447}],434:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.wNAF=function(e,t){const n=(e,t)=>{const n=t.negate();return e?n:t},r=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:n,unsafeLadder(t,n){let r=e.ZERO,i=t;for(;n>s;)n&o&&(r=r.add(i)),i=i.double(),n>>=o;return r},precomputeWindow(e,t){const{windows:n,windowSize:i}=r(t),s=[];let o=e,a=o;for(let e=0;e<n;e++){a=o,s.push(a);for(let e=1;e<i;e++)a=a.add(o),s.push(a);o=a.double()}return s},wNAF(t,i,s){const{windows:a,windowSize:c}=r(t);let u=e.ZERO,l=e.BASE;const d=BigInt(2**t-1),h=2**t,p=BigInt(t);for(let e=0;e<a;e++){const t=e*c;let r=Number(s&d);s>>=p,r>c&&(r-=h,s+=o);const a=t,f=t+Math.abs(r)-1,m=e%2!=0,y=r<0;0===r?l=l.add(n(m,i[a])):u=u.add(n(y,i[f]))}return{p:u,f:l}},wNAFCached(e,t,n,r){const i=e._WINDOW_SIZE||1;let s=t.get(e);return s||(s=this.precomputeWindow(e,i),1!==i&&t.set(e,r(s))),this.wNAF(i,s,n)}}},n.validateBasic=function(e){return(0,r.validateField)(e.Fp),(0,i.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,r.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})};
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const r=e("./modular.js"),i=e("./utils.js"),s=BigInt(0),o=BigInt(1)},{"./modular.js":436,"./utils.js":437}],435:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.expand_message_xmd=u,n.expand_message_xof=l,n.hash_to_field=d,n.isogenyMap=function(e,t){const n=t.map((e=>Array.from(e).reverse()));return(t,r)=>{const[i,s,o,a]=n.map((n=>n.reduce(((n,r)=>e.add(e.mul(n,t),r)))));return t=e.div(i,s),r=e.mul(r,e.div(o,a)),{x:t,y:r}}},n.createHasher=function(e,t,n){if("function"!=typeof t)throw new Error("mapToCurve() must be defined");return{hashToCurve(r,i){const s=d(r,2,{...n,DST:n.DST,...i}),o=e.fromAffine(t(s[0])),a=e.fromAffine(t(s[1])),c=o.add(a).clearCofactor();return c.assertValidity(),c},encodeToCurve(r,i){const s=d(r,1,{...n,DST:n.encodeDST,...i}),o=e.fromAffine(t(s[0])).clearCofactor();return o.assertValidity(),o},mapToCurve(n){if(!Array.isArray(n))throw new Error("mapToCurve: expected array of bigints");for(const e of n)if("bigint"!=typeof e)throw new Error(`mapToCurve: expected array of bigints, got ${e} in array`);const r=e.fromAffine(t(n)).clearCofactor();return r.assertValidity(),r}}};const r=e("./modular.js"),i=e("./utils.js"),s=i.bytesToNumberBE;function o(e,t){if(e<0||e>=1<<8*t)throw new Error(`bad I2OSP call: value=${e} length=${t}`);const n=Array.from({length:t}).fill(0);for(let r=t-1;r>=0;r--)n[r]=255&e,e>>>=8;return new Uint8Array(n)}function a(e,t){const n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e[r]^t[r];return n}function c(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function u(e,t,n,r){(0,i.abytes)(e),(0,i.abytes)(t),c(n),t.length>255&&(t=r((0,i.concatBytes)((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:s,blockLen:u}=r,l=Math.ceil(n/s);if(l>255)throw new Error("Invalid xmd length");const d=(0,i.concatBytes)(t,o(t.length,1)),h=o(0,u),p=o(n,2),f=new Array(l),m=r((0,i.concatBytes)(h,e,p,o(0,1),d));f[0]=r((0,i.concatBytes)(m,o(1,1),d));for(let e=1;e<=l;e++){const t=[a(m,f[e-1]),o(e+1,1),d];f[e]=r((0,i.concatBytes)(...t))}return(0,i.concatBytes)(...f).slice(0,n)}function l(e,t,n,r,s){if((0,i.abytes)(e),(0,i.abytes)(t),c(n),t.length>255){const e=Math.ceil(2*r/8);t=s.create({dkLen:e}).update((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(n>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return s.create({dkLen:n}).update(e).update(o(n,2)).update(t).update(o(t.length,1)).digest()}function d(e,t,n){(0,i.validateObject)(n,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:o,k:a,m:d,hash:h,expand:p,DST:f}=n;(0,i.abytes)(e),c(t);const m="string"==typeof f?(0,i.utf8ToBytes)(f):f,y=o.toString(2).length,g=Math.ceil((y+a)/8),b=t*d*g;let v;if("xmd"===p)v=u(e,m,b,h);else if("xof"===p)v=l(e,m,b,a,h);else{if("_internal_pass"!==p)throw new Error('expand must be "xmd" or "xof"');v=e}const w=new Array(t);for(let e=0;e<t;e++){const t=new Array(d);for(let n=0;n<d;n++){const i=g*(n+e*d),a=v.subarray(i,i+g);t[n]=(0,r.mod)(s(a),o)}w[e]=t}return w}},{"./modular.js":436,"./utils.js":437}],436:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isNegativeLE=void 0,n.mod=d,n.pow=h,n.pow2=function(e,t,n){let r=e;for(;t-- >i;)r*=r,r%=n;return r},n.invert=p,n.tonelliShanks=f,n.FpSqrt=m,n.validateField=function(e){const t=y.reduce(((e,t)=>(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,r.validateObject)(e,t)},n.FpPow=g,n.FpInvertBatch=b,n.FpDiv=function(e,t,n){return e.mul(t,"bigint"==typeof n?p(n,e.ORDER):e.inv(n))},n.FpIsSquare=function(e){const t=(e.ORDER-s)/o;return n=>{const r=e.pow(n,t);return e.eql(r,e.ZERO)||e.eql(r,e.ONE)}},n.nLength=v,n.Field=function(e,t,n=!1,o={}){if(e<=i)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:a,nByteLength:c}=v(e,t);if(c>2048)throw new Error("Field lengths over 2048 bytes are not supported");const u=m(e),l=Object.freeze({ORDER:e,BITS:a,BYTES:c,MASK:(0,r.bitMask)(a),ZERO:i,ONE:s,create:t=>d(t,e),isValid:t=>{if("bigint"!=typeo
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const r=e("./utils.js"),i=BigInt(0),s=BigInt(1),o=BigInt(2),a=BigInt(3),c=BigInt(4),u=BigInt(5),l=BigInt(8);BigInt(9),BigInt(16);function d(e,t){const n=e%t;return n>=i?n:t+n}function h(e,t,n){if(n<=i||t<i)throw new Error("Expected power/modulo > 0");if(n===s)return i;let r=s;for(;t>i;)t&s&&(r=r*e%n),e=e*e%n,t>>=s;return r}function p(e,t){if(e===i||t<=i)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=d(e,t),r=t,o=i,a=s,c=s,u=i;for(;n!==i;){const e=r/n,t=r%n,i=o-c*e,s=a-u*e;r=n,n=t,o=c,a=u,c=i,u=s}if(r!==s)throw new Error("invert: does not exist");return d(o,t)}function f(e){const t=(e-s)/o;let n,r,a;for(n=e-s,r=0;n%o===i;n/=o,r++);for(a=o;a<e&&h(a,t,e)!==e-s;a++);if(1===r){const t=(e+s)/c;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}const u=(n+s)/o;return function(e,i){if(e.pow(i,t)===e.neg(e.ONE))throw new Error("Cannot find square root");let o=r,c=e.pow(e.mul(e.ONE,a),n),l=e.pow(i,u),d=e.pow(i,n);for(;!e.eql(d,e.ONE);){if(e.eql(d,e.ZERO))return e.ZERO;let t=1;for(let n=e.sqr(d);t<o&&!e.eql(n,e.ONE);t++)n=e.sqr(n);const n=e.pow(c,s<<BigInt(o-t-1));c=e.sqr(n),l=e.mul(l,n),d=e.mul(d,c),o=t}return l}}function m(e){if(e%c===a){const t=(e+s)/c;return function(e,n){const r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw new Error("Cannot find square root");return r}}if(e%l===u){const t=(e-u)/l;return function(e,n){const r=e.mul(n,o),i=e.pow(r,t),s=e.mul(n,i),a=e.mul(e.mul(s,o),i),c=e.mul(s,e.sub(a,e.ONE));if(!e.eql(e.sqr(c),n))throw new Error("Cannot find square root");return c}}return f(e)}n.isNegativeLE=(e,t)=>(d(e,t)&s)===s;const y=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function g(e,t,n){if(n<i)throw new Error("Expected power > 0");if(n===i)return e.ONE;if(n===s)return t;let r=e.ONE,o=t;for(;n>i;)n&s&&(r=e.mul(r,o)),o=e.sqr(o),n>>=s;return r}function b(e,t){const n=new Array(t.length),r=t.reduce(((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r))),e.ONE),i=e.inv(r);return t.reduceRight(((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r))),i),n}function v(e,t){const n=void 0!==t?t:e.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function w(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function x(e){const t=w(e);return t+Math.ceil(t/2)}},{"./utils.js":437}],437:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.bitMask=void 0,n.isBytes=o,n.abytes=a,n.bytesToHex=u,n.numberToHexUnpadded=l,n.hexToNumber=d,n.hexToBytes=f,n.bytesToNumberBE=function(e){return d(u(e))},n.bytesToNumberLE=function(e){return a(e),d(u(Uint8Array.from(e).reverse()))},n.numberToBytesBE=m,n.numberToBytesLE=function(e,t){return m(e,t).reverse()},n.numberToVarBytesBE=function(e){return f(l(e))},n.ensureBytes=function(e,t,n){let r;if("string"==typeof t)try{r=f(t)}catch(n){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${n}`)}else{if(!o(t))throw new Error(`${e} must be hex string or Uint8Array`);r=Uint8Array.from(t)}const i=r.length;if("number"==typeof n&&i!==n)throw new Error(`${e} expected ${n} bytes, got ${i}`);return r},n.concatBytes=y,n.equalBytes=function(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return 0===n},n.utf8ToBytes=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))},n.bitLen=function(e){let t;for(t=0;e>r;e>>=i,t+=1);return t},n.bitGet=function(e,t){return e>>BigInt(t)&i},n.bitSet=function(e,t,n){return e|(n?i:r)<<BigInt(t)},n.createHmacDrbg=function(e,t,n){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");let r=g(e),i=g(e),s=0;const o=()=>{r.fill(1),i.fill(0),s=0},a=(...e)=>n(i,r,...e),c=(e=g())=>{i=a(b([0]),e),r=a(),0!==e.length&&(i=a(b([1]),e),r=
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const r=BigInt(0),i=BigInt(1),s=BigInt(2);function o(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function a(e){if(!o(e))throw new Error("Uint8Array expected")}const c=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function u(e){a(e);let t="";for(let n=0;n<e.length;n++)t+=c[e[n]];return t}function l(e){const t=e.toString(16);return 1&t.length?`0${t}`:t}function d(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":`0x${e}`)}const h={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function p(e){return e>=h._0&&e<=h._9?e-h._0:e>=h._A&&e<=h._F?e-(h._A-10):e>=h._a&&e<=h._f?e-(h._a-10):void 0}function f(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){const n=p(e.charCodeAt(i)),s=p(e.charCodeAt(i+1));if(void 0===n||void 0===s){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}r[t]=16*n+s}return r}function m(e,t){return f(e.toString(16).padStart(2*t,"0"))}function y(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];a(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return n}n.bitMask=e=>(s<<BigInt(e-1))-i;const g=e=>new Uint8Array(e),b=e=>Uint8Array.from(e);const v={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||o(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)}},{}],438:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DER=void 0,n.weierstrassPoints=f,n.weierstrass=function(e){const t=function(e){const t=(0,r.validateBasic)(e);return s.validateObject(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:a,n:c}=t,d=a.BYTES+1,h=2*a.BYTES+1;function p(e){return i.mod(e,c)}function m(e){return i.invert(e,c)}const{ProjectivePoint:y,normPrivateKeyToScalar:g,weierstrassEquation:b,isWithinCurveOrder:v}=f({...t,toBytes(e,t,n){const r=t.toAffine(),i=a.toBytes(r.x),o=s.concatBytes;return n?o(Uint8Array.from([t.hasEvenY()?2:3]),i):o(Uint8Array.from([4]),i,a.toBytes(r.y))},fromBytes(e){const t=e.length,n=e[0],r=e.subarray(1);if(t!==d||2!==n&&3!==n){if(t===h&&4===n){return{x:a.fromBytes(r.subarray(0,a.BYTES)),y:a.fromBytes(r.subarray(a.BYTES,2*a.BYTES))}}throw new Error(`Point of length ${t} was invalid. Expected ${d} compressed bytes or ${h} uncompressed bytes`)}{const e=s.bytesToNumberBE(r);if(!(u<(i=e)&&i<a.ORDER))throw new Error("Point is not on curve");const t=b(e);let o;try{o=a.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("Point is not on curve"+t)}return!(1&~n)!==((o&l)===l)&&(o=a.neg(o)),{x:e,y:o}}var i}}),w=e=>s.bytesToHex(s.numberToBytesBE(e,t.nByteLength));function x(e){return e>c>>l}const E=(e,t,n)=>s.bytesToNumberBE(e.slice(t,n));class S{constructor(e,t,n){this.r=e,this.s=t,this.recovery=n,this.assertValidity()}static fromCompact(e){const n=t.nByteLength;return e=(0,o.ensureBytes)("compactSignature",e,2*n),new S(E(e,0,n),E(e,n,2*n))}static fromDER(e){const{r:t,s:r}=n.DER.toSig((0,o.ensureBytes)("DER",e));return new S(t,r)}assertValidity(){if(!v(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!v(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new S(this.r,this.s,e)}recoverPublicKey(e){const{r:n,s:r,recovery:i}=this,s=k((0,o.ensureBytes)("msgHash",e));if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");const c=2===i||3===i?n+t.n:n;if(c>=a.ORDER)throw new Error("recovery id 2 or 3 invalid");const u=1&i?"03":"02",l=y.fromHex(u+w(c)),d=m(c),h=p(-s*d),f=p(r*d),g=y.BAS
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const r=e("./curve.js"),i=e("./modular.js"),s=e("./utils.js"),o=e("./utils.js");const{bytesToNumberBE:a,hexToBytes:c}=s;n.DER={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:t}=n.DER;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const r=e[1],i=e.subarray(2,r+2);if(!r||i.length!==r)throw new t("Invalid signature integer: wrong length");if(128&i[0])throw new t("Invalid signature integer: negative");if(0===i[0]&&!(128&i[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:a(i),l:e.subarray(r+2)}},toSig(e){const{Err:t}=n.DER,r="string"==typeof e?c(e):e;s.abytes(r);let i=r.length;if(i<2||48!=r[0])throw new t("Invalid signature tag");if(r[1]!==i-2)throw new t("Invalid signature: incorrect length");const{d:o,l:a}=n.DER._parseInt(r.subarray(2)),{d:u,l:l}=n.DER._parseInt(a);if(l.length)throw new t("Invalid signature: left bytes after parsing");return{r:o,s:u}},hexFromSig(e){const t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,n=e=>{const t=e.toString(16);return 1&t.length?`0${t}`:t},r=t(n(e.s)),i=t(n(e.r)),s=r.length/2,o=i.length/2,a=n(s),c=n(o);return`30${n(o+s+4)}02${c}${i}02${a}${r}`}};const u=BigInt(0),l=BigInt(1),d=BigInt(2),h=BigInt(3),p=BigInt(4);function f(e){const t=function(e){const t=(0,r.validateBasic)(e);s.validateObject(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:i,a:o}=t;if(n){if(!i.eql(o,i.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof n||"bigint"!=typeof n.beta||"function"!=typeof n.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:n}=t,a=t.toBytes||((e,t,r)=>{const i=t.toAffine();return s.concatBytes(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),c=t.fromBytes||(e=>{const t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function d(e){const{a:r,b:i}=t,s=n.sqr(e),o=n.mul(s,e);return n.add(n.add(o,n.mul(e,r)),i)}if(!n.eql(n.sqr(t.Gy),d(t.Gx)))throw new Error("bad generator point: equation left != right");function p(e){return"bigint"==typeof e&&u<e&&e<t.n}function f(e){if(!p(e))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function m(e){const{allowedPrivateKeyLengths:n,nByteLength:r,wrapPrivateKey:a,n:c}=t;if(n&&"bigint"!=typeof e){if(s.isBytes(e)&&(e=s.bytesToHex(e)),"string"!=typeof e||!n.includes(e.length))throw new Error("Invalid key");e=e.padStart(2*r,"0")}let u;try{u="bigint"==typeof e?e:s.bytesToNumberBE((0,o.ensureBytes)("private key",e,r))}catch(t){throw new Error(`private key must be ${r} bytes, hex or bigint, not ${typeof e}`)}return a&&(u=i.mod(u,c)),f(u),u}const y=new Map;function g(e){if(!(e instanceof b))throw new Error("ProjectivePoint expected")}class b{constructor(e,t,r){if(this.px=e,this.py=t,this.pz=r,null==e||!n.isValid(e))throw new Error("x required");if(null==t||!n.isValid(t))throw new Error("y required");if(null==r||!n.isValid(r))throw new Error("z required")}static fromAffine(e){const{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw new Error("invalid affine point");if(e instanceof b)throw new Error("projective point not allowed");const i=e=>n.eql(e,n.ZERO);return i(t)&&i(r)?b.ZERO:new b(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=n.invertBatch(e.map((e=>e.pz)));return e.map(((e,n)=>e.toAffine(t[n]))).map(b.fromAffine)}static fromHex(e){const t=b.fromAffine(c((0,o.ensureBytes)("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return b.BASE.multiply(m(e))}_setWindowSize(e){this._WINDOW_SIZE=e,y.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:r}=this.toAffine();if(!n.isValid(e)||!n.isValid(r))throw new Error("bad point: x or y not FE");const i=
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
const r=e("@noble/hashes/sha256"),i=e("@noble/hashes/utils"),s=e("./_shortw_utils.js"),o=e("./abstract/hash-to-curve.js"),a=e("./abstract/modular.js"),c=e("./abstract/utils.js"),u=e("./abstract/weierstrass.js"),l=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),d=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h=BigInt(1),p=BigInt(2),f=(e,t)=>(e+t/p)/t;function m(e){const t=l,n=BigInt(3),r=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),c=BigInt(44),u=BigInt(88),d=e*e*e%t,h=d*d*e%t,f=(0,a.pow2)(h,n,t)*h%t,m=(0,a.pow2)(f,n,t)*h%t,g=(0,a.pow2)(m,p,t)*d%t,b=(0,a.pow2)(g,i,t)*g%t,v=(0,a.pow2)(b,s,t)*b%t,w=(0,a.pow2)(v,c,t)*v%t,x=(0,a.pow2)(w,u,t)*w%t,E=(0,a.pow2)(x,c,t)*v%t,S=(0,a.pow2)(E,n,t)*h%t,A=(0,a.pow2)(S,o,t)*b%t,_=(0,a.pow2)(A,r,t)*d%t,T=(0,a.pow2)(_,p,t);if(!y.eql(y.sqr(T),e))throw new Error("Cannot find square root");return T}const y=(0,a.Field)(l,void 0,void 0,{sqrt:m});n.secp256k1=(0,s.createCurve)({a:BigInt(0),b:BigInt(7),Fp:y,n:d,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=d,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-h*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,o=BigInt("0x100000000000000000000000000000000"),c=f(s*e,t),u=f(-r*e,t);let l=(0,a.mod)(e-c*n-u*i,t),p=(0,a.mod)(-c*r-u*s,t);const m=l>o,y=p>o;if(m&&(l=t-l),y&&(p=t-p),l>o||p>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:m,k1:l,k2neg:y,k2:p}}}},r.sha256);const g=BigInt(0),b=e=>"bigint"==typeof e&&g<e&&e<l,v=e=>"bigint"==typeof e&&g<e&&e<d,w={};function x(e,...t){let n=w[e];if(void 0===n){const t=(0,r.sha256)(Uint8Array.from(e,(e=>e.charCodeAt(0))));n=(0,c.concatBytes)(t,t),w[e]=n}return(0,r.sha256)((0,c.concatBytes)(n,...t))}const E=e=>e.toRawBytes(!0).slice(1),S=e=>(0,c.numberToBytesBE)(e,32),A=e=>(0,a.mod)(e,l),_=e=>(0,a.mod)(e,d),T=n.secp256k1.ProjectivePoint,k=(e,t,n)=>T.BASE.multiplyAndAddUnsafe(e,t,n);function C(e){let t=n.secp256k1.utils.normPrivateKeyToScalar(e),r=T.fromPrivateKey(t);return{scalar:r.hasEvenY()?t:_(-t),bytes:E(r)}}function P(e){if(!b(e))throw new Error("bad x: need 0 < x < p");const t=A(e*e);let n=m(A(t*e+BigInt(7)));n%p!==g&&(n=A(-n));const r=new T(e,n,h);return r.assertValidity(),r}function O(...e){return _((0,c.bytesToNumberBE)(x("BIP0340/challenge",...e)))}function I(e){return C(e).bytes}function M(e,t,n=(0,i.randomBytes)(32)){const r=(0,c.ensureBytes)("message",e),{bytes:s,scalar:o}=C(t),a=(0,c.ensureBytes)("auxRand",n,32),u=S(o^(0,c.bytesToNumberBE)(x("BIP0340/aux",a))),l=x("BIP0340/nonce",u,s,r),d=_((0,c.bytesToNumberBE)(l));if(d===g)throw new Error("sign failed: k is zero");const{bytes:h,scalar:p}=C(d),f=O(h,s,r),m=new Uint8Array(64);if(m.set(h,0),m.set(S(_(p+f*o)),32),!j(m,r,s))throw new Error("sign: Invalid signature produced");return m}function j(e,t,n){const r=(0,c.ensureBytes)("signature",e,64),i=(0,c.ensureBytes)("message",t),s=(0,c.ensureBytes)("publicKey",n,32);try{const e=P((0,c.bytesToNumberBE)(s)),t=(0,c.bytesToNumberBE)(r.subarray(0,32));if(!b(t))return!1;const n=(0,c.bytesToNumberBE)(r.subarray(32,64));if(!v(n))return!1;const o=O(S(t),E(e),i),a=k(e,n,_(-o));return!(!a||!a.hasEvenY()||a.toAffine().x!==t)}catch(e){return!1}}n.schnorr={getPublicKey:I,sign:M,verify:j,utils:{randomPrivateKey:n.secp256k1.utils.randomPrivateKey,lift_x:P,pointToBytes:E,numberToBytesBE:c.numberToBytesBE,bytesToNumberBE:c.bytesToNumberBE,taggedHash:x,mod:a.mod}};const R=(()=>(0,o.isogenyMap)(y,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b74578
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(n,"__esModule",{value:!0}),n.randomBytes=n.wrapXOFConstructorWithOpts=n.wrapConstructorWithOpts=n.wrapConstructor=n.checkOpts=n.Hash=n.concatBytes=n.toBytes=n.utf8ToBytes=n.asyncLoop=n.nextTick=n.hexToBytes=n.bytesToHex=n.byteSwap32=n.byteSwapIfBE=n.byteSwap=n.isLE=n.rotl=n.rotr=n.createView=n.u32=n.u8=n.isBytes=void 0;const r=e("@noble/hashes/crypto"),i=e("./_assert.js");n.isBytes=function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name};n.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);n.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));n.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);n.rotr=(e,t)=>e<<32-t|e>>>t;n.rotl=(e,t)=>e<<t|e>>>32-t>>>0,n.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];n.byteSwap=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,n.byteSwapIfBE=n.isLE?e=>e:e=>(0,n.byteSwap)(e),n.byteSwap32=function(e){for(let t=0;t<e.length;t++)e[t]=(0,n.byteSwap)(e[t])};const s=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));n.bytesToHex=function(e){(0,i.bytes)(e);let t="";for(let n=0;n<e.length;n++)t+=s[e[n]];return t};const o={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function a(e){return e>=o._0&&e<=o._9?e-o._0:e>=o._A&&e<=o._F?e-(o._A-10):e>=o._a&&e<=o._f?e-(o._a-10):void 0}n.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,n=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){const n=a(e.charCodeAt(i)),s=a(e.charCodeAt(i+1));if(void 0===n||void 0===s){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}r[t]=16*n+s}return r};function c(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function u(e){return"string"==typeof e&&(e=c(e)),(0,i.bytes)(e),e}n.nextTick=async()=>{},n.asyncLoop=async function(e,t,r){let i=Date.now();for(let s=0;s<e;s++){r(s);const e=Date.now()-i;e>=0&&e<t||(await(0,n.nextTick)(),i+=e)}},n.utf8ToBytes=c,n.toBytes=u,n.concatBytes=function(...e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];(0,i.bytes)(r),t+=r.length}const n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return n};n.Hash=class{clone(){return this._cloneInto()}};const l={}.toString;n.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!==l.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},n.wrapConstructor=function(e){const t=t=>e().update(u(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t},n.wrapConstructorWithOpts=function(e){const t=(t,n)=>e(n).update(u(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},n.wrapXOFConstructorWithOpts=function(e){const t=(t,n)=>e(n).update(u(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},n.randomBytes=function(e=32){if(r.crypto&&"function"==typeof r.crypto.getRandomValues)return r.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},{"./_assert.js":440,"@noble/hashes/crypto":443}],448:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getRandomBytesSync=function(e){return(0,r.randomBytes)(e)},n.getRandomBytes=async function(e){return(0,r.randomBytes)(e)};const r=e("@noble/hashes/utils")},{"@noble/hashes/utils":447}],449:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.secp256k1=void 0;var r=e("@noble/curves/secp256k1");Object.defineProperty(n,"secp256k1",{enumerable:!0,get:function(){return r.secp256k1}})},{"@noble/curves/secp256k1":439}],450:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.sha256=void 0;const r=e("@no
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
n.read=function(e,t,n,r,i){var s,o,a=8*i-r-1,c=(1<<a)-1,u=c>>1,l=-7,d=n?i-1:0,h=n?-1:1,p=e[t+d];for(d+=h,s=p&(1<<-l)-1,p>>=-l,l+=a;l>0;s=256*s+e[t+d],d+=h,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=r;l>0;o=256*o+e[t+d],d+=h,l-=8);if(0===s)s=1-u;else{if(s===c)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),s-=u}return(p?-1:1)*o*Math.pow(2,s-r)},n.write=function(e,t,n,r,i,s){var o,a,c,u=8*s-i-1,l=(1<<u)-1,d=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+d>=1?h/c:h*Math.pow(2,1-d))*c>=2&&(o++,c/=2),o+d>=l?(a=0,o=l):o+d>=1?(a=(t*c-1)*Math.pow(2,i),o+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[n+p]=255&a,p+=f,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;e[n+p]=255&o,p+=f,o/=256,u-=8);e[n+p-f]|=128*m}},{}],495:[function(e,t,n){"use strict";var r;Object.defineProperty(n,"__esModule",{value:!0});var i="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),s="undefined"!=typeof Map,o="undefined"!=typeof Set,a="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,c=i?Symbol.for("immer-nothing"):((r={})["immer-nothing"]=!0,r),u=i?Symbol.for("immer-draftable"):"__$immer_draftable",l=i?Symbol.for("immer-state"):"__$immer_state",d="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",h={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(e){return"Cannot apply patch, path doesn't resolve: "+e},16:'Sets cannot have "replace" patches.',17:function(e){return"Unsupported patch operation: "+e},18:function(e){return"The plugin for '"+e+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+e+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+e+"'"},22:function(e){return"'current' expects a draft, got: "+e},23:function(e){return"'original' expects a draft, got: "+e},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"};function p(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=h[e],s=i?"function"==typeof i?i.apply(null,n):i:"unknown error nr: "+e;throw new Error("[Immer] "+s)}function f(e){return!!e&&!!e[l]}function m(e){var t;return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===y}(e)||Array.isArray(e)||!!e[u]||!!(null===(t=e.constructor)||void 0===t?void 0:t[u])||_(e)||T(e))}var y=Object.prototype.constructor.toString();var g="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,b=Object.getOwnPropertyD
/**
* [js-sha3]{@link https://github.com/emn178/js-sha3}
*
* @version 0.9.3
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2015-2023
* @license MIT
*/
!function(){"use strict";var r="input is invalid type",i="object"==typeof window,s=i?window:{};s.JS_SHA3_NO_WINDOW&&(i=!1);var o=!i&&"object"==typeof self;!s.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node?s=n:o&&(s=self);for(var a=!s.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,c="function"==typeof define&&define.amd,u=!s.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,l="0123456789abcdef".split(""),d=[4,1024,262144,67108864],h=[0,8,16,24],p=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],f=[224,256,384,512],m=[128,256],y=["hex","buffer","arrayBuffer","array","digest"],g={128:168,256:136},b=s.JS_SHA3_NO_NODE_JS||!Array.isArray?function(e){return"[object Array]"===Object.prototype.toString.call(e)}:Array.isArray,v=!u||!s.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView?ArrayBuffer.isView:function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer},w=function(e){var t=typeof e;if("string"===t)return[e,!0];if("object"!==t||null===e)throw new Error(r);if(u&&e.constructor===ArrayBuffer)return[new Uint8Array(e),!1];if(!b(e)&&!v(e))throw new Error(r);return[e,!1]},x=function(e){return 0===w(e)[0].length},E=function(e){for(var t=[],n=0;n<e.length;++n)t[n]=e[n];return t},S=function(e,t,n){return function(r){return new U(e,t,e).update(r)[n]()}},A=function(e,t,n){return function(r,i){return new U(e,t,i).update(r)[n]()}},_=function(e,t,n){return function(t,r,i,s){return O["cshake"+e].update(t,r,i,s)[n]()}},T=function(e,t,n){return function(t,r,i,s){return O["kmac"+e].update(t,r,i,s)[n]()}},k=function(e,t,n,r){for(var i=0;i<y.length;++i){var s=y[i];e[s]=t(n,r,s)}return e},C=function(e,t){var n=S(e,t,"hex");return n.create=function(){return new U(e,t,e)},n.update=function(e){return n.create().update(e)},k(n,S,e,t)},P=[{name:"keccak",padding:[1,256,65536,16777216],bits:f,createMethod:C},{name:"sha3",padding:[6,1536,393216,100663296],bits:f,createMethod:C},{name:"shake",padding:[31,7936,2031616,520093696],bits:m,createMethod:function(e,t){var n=A(e,t,"hex");return n.create=function(n){return new U(e,t,n)},n.update=function(e,t){return n.create(t).update(e)},k(n,A,e,t)}},{name:"cshake",padding:d,bits:m,createMethod:function(e,t){var n=g[e],r=_(e,0,"hex");return r.create=function(r,i,s){return x(i)&&x(s)?O["shake"+e].create(r):new U(e,t,r).bytepad([i,s],n)},r.update=function(e,t,n,i){return r.create(t,n,i).update(e)},k(r,_,e,t)}},{name:"kmac",padding:d,bits:m,createMethod:function(e,t){var n=g[e],r=T(e,0,"hex");return r.create=function(r,i,s){return new D(e,t,i).bytepad(["KMAC",s],n).bytepad([r],n)},r.update=function(e,t,n,i){return r.create(e,n,i).update(t)},k(r,T,e,t)}}],O={},I=[],M=0;M<P.length;++M)for(var j=P[M],R=j.bits,B=0;B<R.length;++B){var N=j.name+"_"+R[B];if(I.push(N),O[N]=j.createMethod(R[B],j.padding),"sha3"!==j.name){var L=j.name+R[B];I.push(L),O[L]=O[N]}}function U(e,t,n){this.blocks=[],this.s=[],this.padding=t,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function D(e,t,n){U.call(this,e,t,n)}U.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t=w(e);e=t[0];for(var n,r,i=t[1],s=this.blocks,o=this.byteCount,a=e.length,c=this.blockCount,u=0,l=this.s;u<a;){if(this.reset)for(this.reset=!1,s[0]=this.block,n=1;n<c+1;++n)s[n]=0;if(i)for(n=this.start;u<a&&n<o;++u)(r=e.charCodeAt(u))<128?s[n>>2]|=r<<h[3&n++]:r<2048?(s[n>>2]|=(192|r>>6)<<h[3&n++],s[n>>2]|=(128|63&r)<<h[3&n++]):r<55296||r>=57344?(s[n>>2]|=(224|r>>12)<<h[3&n++],s[n>>2]|=(128|r>>6&63)<<h[3&n++],s[n>>2]|=(128|63&r)<<h[3&n++]):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++u)),s[n>>2]|=(240|r>>18)<<h[
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var r=e("buffer"),i=r.Buffer;function s(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(s(r,n),n.Buffer=o),o.prototype=Object.create(i.prototype),s(i,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},{buffer:385}],528:[function(e,t,n){const r=Symbol("SemVer ANY");class i{static get ANY(){return r}constructor(e,t){if(t=s(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===r?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?o[a.COMPARATORLOOSE]:o[a.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new l(n[2],this.options.loose):this.semver=r}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===r||e===r)return!0;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}return c(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):(!(t=s(t)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(c(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(c(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}t.exports=i;const s=e("../internal/parse-options"),{safeRe:o,t:a}=e("../internal/re"),c=e("../functions/cmp"),u=e("../internal/debug"),l=e("./semver"),d=e("./range")},{"../functions/cmp":532,"../internal/debug":557,"../internal/parse-options":560,"../internal/re":561,"./range":529,"./semver":530}],529:[function(e,t,n){const r=/\s+/g;class i{constructor(e,t){if(t=o(t),e instanceof i)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new i(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(r," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!g(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&b(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&m)|(this.options.loose&&y))+":"+e,n=s.get(t);if(n)return n;const r=this.options.loose,i=r?l[d.HYPHENRANGELOOSE]:l[d.HYPHENRANGE];e=e.replace(i,O(this.options.includePrerelease)),c("hyp