PageSourceSearch

https://app.hotstuff.trade/_next/static/chunks/0hahcut9f.ybh.js?dpl=dpl_2UkkgYJtZRL8qYawe9FfkxiApWHv

js hotstuff.trade collected 2026-10-07 04:32:29 UTC 147,564 bytes, 5 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="38fc54d5-0731-6221-7703-fd061bb13fb6")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,218454,949595,e=>{"use strict";let t,r,i,n,o,s,f;e.i(467034);var a,l,c,u,h,d=e.i(219298);e.i(247167),e.i(180476),e.i(499276);var b={exports:{}};function p(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}let g=function(e,t,r){var i=r&&r.stringify||p;if("object"==typeof e&&null!==e){var n=t.length+1;if(1===n)return e;var o=Array(n);o[0]=i(e);for(var s=1;s<n;s++)o[s]=i(t[s]);return o.join(" ")}if("string"!=typeof e)return e;var f=t.length;if(0===f)return e;for(var a="",l=0,c=-1,u=e&&e.length||0,h=0;h<u;){if(37===e.charCodeAt(h)&&h+1<u){switch(c=c>-1?c:0,e.charCodeAt(h+1)){case 100:case 102:if(l>=f||null==t[l])break;c<h&&(a+=e.slice(c,h)),a+=Number(t[l]),c=h+2,h++;break;case 105:if(l>=f||null==t[l])break;c<h&&(a+=e.slice(c,h)),a+=Math.floor(Number(t[l])),c=h+2,h++;break;case 79:case 111:case 106:if(l>=f||void 0===t[l])break;c<h&&(a+=e.slice(c,h));var d=typeof t[l];if("string"===d){a+="'"+t[l]+"'",c=h+2,h++;break}if("function"===d){a+=t[l].name||"<anonymous>",c=h+2,h++;break}a+=i(t[l]),c=h+2,h++;break;case 115:if(l>=f)break;c<h&&(a+=e.slice(c,h)),a+=String(t[l]),c=h+2,h++;break;case 37:c<h&&(a+=e.slice(c,h)),a+="%",c=h+2,h++,l--}++l}++h}return -1===c?e:(c<u&&(a+=e.slice(c)),a)};b.exports=B;let y=function(){function e(e){return"u">typeof e&&e}try{return"u">typeof globalThis||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}().console||{};function x(e,t){return"silent"===e?1/0:t.levels.values[e]}let m=Symbol("pino.logFuncs"),w=Symbol("pino.hierarchy"),v={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function E(e,t){let r={logger:t,parent:e[w]};t[w]=r}function B(e){var t,r,i;let n,o,s;(e=e||{}).browser=e.browser||{};let f=e.browser.transmit;if(f&&"function"!=typeof f.send)throw Error("pino: transmit option must have a send function");let a=e.browser.write||y;e.browser.write&&(e.browser.asObject=!0);let l=e.serializers||{},c=(t=e.browser.serialize,Array.isArray(t)?t.filter(function(e){return"!stdSerializers.err"!==e}):!0===t&&Object.keys(l)),u=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(u=!1);let h=Object.keys(e.customLevels||{}),d=["error","fatal","warn","info","debug","trace"].concat(h);"function"==typeof a&&d.forEach(function(e){a[e]=a}),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");let b=e.level||"info",p=Object.create(a);p.log||(p.log=P),n={},d.forEach(e=>{n[e]=a[e]?a[e]:y[e]||y[v[e]||"log"]||P}),p[m]=n,E({},p),Object.defineProperty(p,"levelVal",{get:function(){return x(this.level,this)}}),Object.defineProperty(p,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,A(this,g,p,"error"),A(this,g,p,"fatal"),A(this,g,p,"warn"),A(this,g,p,"info"),A(this,g,p,"debug"),A(this,g,p,"trace"),h.forEach(e=>{A(this,g,p,e)})}});let g={transmit:f,serialize:c,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:d,timestamp:"function"==typeof(r=e).timestamp?r.timestamp:!1===r.timestamp?N:R,messageKey:e.messageKey||"msg",onChild:e.onChild||P};function w(t,r,i){if(!r)throw Error("missing bindings for child Pino");i=i||{},c&&r.serializers&&(i.serializers=r.serializers);let n=i.serializers;if(c&&n){var o=Object.assign({},l,n),s=!0===e.browser.serialize?Object.keys(o):c;delete r.serializers,I([r],s,o,this._stdErrSerialize)}function a(e){this._childLevel=(0|e._childLevel)+1,this.bindings=r,o&&(this.serializers=o,this._serialize=s),f&&(this._logEvent=O([].concat(e._logEvent.bindings,r)))}a.prototype=this;let u=new a(this);return E(this,u),u.child=function(...e){return w.call(this,t,...e)},u.level=i.level||this.level,t.onChild(u),u}return o=e.customLevels||{},p.levels={values:Object.assign({},B.levels.values,o),labels:Object.assign({},B.levels.labels,(s={}
2,Object.keys(i=o).forEach(function(e){s[i[e]]=e}),s))},p.level=b,p.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},p.setMaxListeners=p.getMaxListeners=p.emit=p.addListener=p.on=p.prependListener=p.once=p.prependOnceListener=p.removeListener=p.removeAllListeners=p.listeners=p.listenerCount=p.eventNames=p.write=p.flush=P,p.serializers=l,p._serialize=c,p._stdErrSerialize=u,p.child=function(...e){return w.call(this,g,...e)},f&&(p._logEvent=O()),p}function A(e,t,r,i){var n,o,s,f,a,l,c;if(Object.defineProperty(e,i,{value:x(e.level,r)>x(i,r)?P:r[m][i],writable:!0,enumerable:!0,configurable:!0}),e[i]===P){if(!t.transmit)return;let n=x(t.transmit.level||e.level,r);if(x(i,r)<n)return}e[i]=(n=e,o=t,s=r,f=i,a=n[m][f],function(){let e=o.timestamp(),t=Array(arguments.length),r=Object.getPrototypeOf&&Object.getPrototypeOf(this)===y?y:this;for(var i=0;i<t.length;i++)t[i]=arguments[i];var l=!1;if(o.serialize&&(I(t,this._serialize,this.serializers,this._stdErrSerialize),l=!0),o.asObject||o.formatters?a.call(r,...function(e,t,r,i,n){let{level:o,log:s=e=>e}=n.formatters||{},f=r.slice(),a=f[0],l={},c=(0|e._childLevel)+1;if((c<1&&(c=1),i&&(l.time=i),o)?Object.assign(l,o(t,e.levels.values[t])):l.level=e.levels.values[t],n.asObjectBindingsOnly){if(null!==a&&"object"==typeof a)for(;c--&&"object"==typeof f[0];)Object.assign(l,f.shift());return[s(l),...f]}if(null!==a&&"object"==typeof a){for(;c--&&"object"==typeof f[0];)Object.assign(l,f.shift());a=f.length?g(f.shift(),f):void 0}else"string"==typeof a&&(a=g(f.shift(),f));return void 0!==a&&(l[n.messageKey]=a),[s(l)]}(this,f,t,e,o)):a.apply(r,t),o.transmit){let r=o.transmit.level||n._level,i=x(r,s),a=x(f,s);if(a<i)return;!function(e,t,r,i=!1){let n=t.send,o=t.ts,s=t.methodLevel,f=t.methodValue,a=t.val,l=e._logEvent.bindings;i||I(r,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=o,e._logEvent.messages=r.filter(function(e){return -1===l.indexOf(e)}),e._logEvent.level.label=s,e._logEvent.level.value=f,n(s,e._logEvent,a),e._logEvent=O(l)}(this,{ts:e,methodLevel:f,methodValue:a,transmitLevel:r,transmitValue:s.levels.values[o.transmit.level||n._level],send:o.transmit.send,val:x(n._level,s)},t,l)}});let u=function(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[w];for(;r.parent;)(r=r.parent).logger.bindings&&t.push(r.logger.bindings);return t.reverse()}(e);0!==u.length&&(e[i]=(l=u,c=e[i],function(){return c.apply(this,[...l,...arguments])}))}function I(e,t,r,i){for(let n in e)if(i&&e[n]instanceof Error)e[n]=B.stdSerializers.err(e[n]);else if("object"==typeof e[n]&&!Array.isArray(e[n])&&t)for(let i in e[n])t.indexOf(i)>-1&&i in r&&(e[n][i]=r[i](e[n][i]))}function O(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function S(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)void 0===t[r]&&(t[r]=e[r]);return t}function C(){return{}}function U(e){return e}function P(){}function N(){return!1}function R(){return Date.now()}B.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},B.stdSerializers={mapHttpRequest:C,mapHttpResponse:C,wrapRequestSerializer:U,wrapResponseSerializer:U,wrapErrorSerializer:U,req:C,res:C,err:S,errWithCause:S},B.stdTimeFunctions=Object.assign({},{nullTime:N,epochTime:R,unixTime:function(){return Math.round(Date.now()/1e3)},isoTime:function(){return new Date(Date.now()).toISOString()}}),b.exports.default=B,b.exports.pino=B;Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var k=e.i(81775),j=Object.defineProperty;k.IEvents;k.IEvents,k.IEvents,k.IEvents,k.IEvents,k.IEvents,d.default,d.EventEmitter;var L=e.i(648512);e.i(31794),e.i(121609),e.i(277945),e.i(36610),e.i(275221);let _="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function z(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function H(e,...t){if(!(e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function T(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function F(e,t){H(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function q(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function D(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function V(e,t){return e<<32-t|e>>>t}let M=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0]?e=>e:function(e){for(let r=0;r<e.length;r++){var t;e[r]=(t=e[r])<<24&0xff000000|t<<8&0xff0000|t>>>8&65280|t>>>24&255}return e};function $(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}(e)),H(e),e}class Z{}function K(e){let t=t=>e().update($(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Y(e=32){if(_&&"function"==typeof _.getRandomValues)return _.getRandomValues(new Uint8Array(e));if(_&&"function"==typeof _.randomBytes)return Uint8Array.from(_.randomBytes(e));throw Error("crypto.getRandomValues must be defined")}
2class W extends Z{constructor(e,t,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(e),this.view=D(this.buffer)}update(e){T(this),H(e=$(e));let{view:t,buffer:r,blockLen:i}=this,n=e.length;for(let o=0;o<n;){let s=Math.min(i-this.pos,n-o);if(s===i){let t=D(e);for(;i<=n-o;o+=i)this.process(t,o);continue}r.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){T(this),F(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:i,isLE:n}=this,{pos:o}=this;t[o++]=128,q(this.buffer.subarray(o)),this.padOffset>i-o&&(this.process(r,0),o=0);for(let e=o;e<i;e++)t[e]=0;!function(e,t,r,i){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,i);let n=BigInt(32),o=BigInt(0xffffffff),s=Number(r>>n&o),f=Number(r&o),a=4*!!i,l=4*!i;e.setUint32(t+a,s,i),e.setUint32(t+l,f,i)}(r,i-8,BigInt(8*this.length),n),this.process(r,0);let s=D(e),f=this.outputLen;if(f%4)throw Error("_sha2: outputLen should be aligned to 32bit");let a=f/4,l=this.get();if(a>l.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<a;e++)s.setUint32(4*e,l[e],n)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:i,finished:n,destroyed:o,pos:s}=this;return e.destroyed=o,e.finished=n,e.length=i,e.pos=s,i%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}let X=Uint32Array.from([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),G=Uint32Array.from([0xc1059ed8,0x367cd507,0x3070dd17,0xf70e5939,0xffc00b31,0x68581511,0x64f98fa7,0xbefa4fa4]),J=Uint32Array.from([0xcbbb9d5d,0xc1059ed8,0x629a292a,0x367cd507,0x9159015a,0x3070dd17,0x152fecd8,0xf70e5939,0x67332667,0xffc00b31,0x8eb44a87,0x68581511,0xdb0c2e0d,0x64f98fa7,0x47b5481d,0xbefa4fa4]),Q=Uint32Array.from([0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179]),ee=BigInt(0x100000000-1),et=BigInt(32);function er(e,t=!1){let r=e.length,i=new Uint32Array(r),n=new Uint32Array(r);for(let o=0;o<r;o++){let{h:r,l:s}=function(e,t=!1){return t?{h:Number(e&ee),l:Number(e>>et&ee)}:{h:0|Number(e>>et&ee),l:0|Number(e&ee)}}(e[o],t);[i[o],n[o]]=[r,s]}return[i,n]}let ei=Uint32Array.from([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),en=new Uint32Array(64);class eo extends W{constructor(e=32){super(64,e,8,!1),this.A=0|X[0],this.B=0|X[1],this.C=0|X[2],this.D=0|X[3],this.E=0|X[4],this.F=0|X[5],this.G=0|X[6],this.H=0|X[7]}get(){let{A:e,B:t,C:r,D:i,E:n,F:o,G:s,H:f}=this;return[e,t,r,i,n,o,s,f]}set(e,t,r,i,n,o,s,f){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|i,this.E=0|n,this.F=0|o,this.G=0|s,this.H=0|f}process(e,t){for(let r=0;r<16;r++,t+=4)en[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=en[e-15],r=en[e-2],i=V(t,7)^V(t,18)^t>>>3,n=V(r,17)^V(r,19)^r>>>10;en[e]=n+en[e-7]+i+en[e-16]|0}let{A:r,B:i,C:n,D:o,E:s,F:f,G:a,H:l}=this;for(let e=0;e<64;e++){var c,u,h,d;let t=l+(V(s,6)^V(s,11)^V(s,25))+((c=s)&f^~c&a)+ei[e]+en[e]|0,b=(V(r,2)^V(r,13)^V(r,22))+((u=r)&(h=i)^u&(d=n)^h&d)|0;l=a,a=f,f=s,s=o+t|0,o=n,n=i,i=r,r=t+b|0}r=r+this.A|0,i=i+this.B|0,n=n+this.C|0,o=o+this.D|0,s=s+this.E|0,f=f+this.F|0,a=a+this.G|0,l=l+this.H|0,this.set(r,i,n,o,s,f,a,l)}roundClean(){q(en)}destroy(){this.set(0,0,0,0,0,0,0,0),q(this.buffer)}}let es=er(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b89
26f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),ef=es[0],ea=es[1],el=new Uint32Array(80),ec=new Uint32Array(80),eu=K(()=>new eo);class eh extends Z{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,function(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.createHasher");z(e.outputLen),z(e.blockLen)}(e);const r=$(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,n=new Uint8Array(i);n.set(r.length>i?e.create().update(r).digest():r);for(let e=0;e<n.length;e++)n[e]^=54;this.iHash.update(n),this.oHash=e.create();for(let e=0;e<n.length;e++)n[e]^=106;this.oHash.update(n),q(n)}update(e){return T(this),this.iHash.update(e),this}digestInto(e){T(this),H(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:r,finished:i,destroyed:n,blockLen:o,outputLen:s}=this;return e.finished=i,e.destroyed=n,e.blockLen=o,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let ed=(e,t,r)=>new eh(e,t).update(r).digest();ed.create=(e,t)=>new eh(e,t);let eb=BigInt(0),ep=BigInt(1);function eg(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function ey(e){if(!eg(e))throw Error("Uint8Array expected")}function ex(e,t){if("boolean"!=typeof t)throw Error(e+" boolean expected, got "+t)}function em(e){let t=e.toString(16);return 1&t.length?"0"+t:t}function ew(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?eb:BigInt("0x"+e)}let ev="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,eE=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function eB(e){if(ey(e),ev)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=eE[e[r]];return t}function eA(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function eI(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);if(ev)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let i=new Uint8Array(r);for(let t=0,n=0;t<r;t++,n+=2){let r=eA(e.charCodeAt(n)),o=eA(e.charCodeAt(n+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[n]+e[n+1])+'" at index '+n);i[t]=16*r+o}return i}function eO(e){return ew(eB(e))}function eS(e){return ey(e),ew(eB(Uint8Array.from(e).reverse()))}function eC(e,t){return eI(e.toString(16).padStart(2*t,"0"))}function eU(e,t){return eC(e,t).reverse()}function eP(e,t,r){let i;if("string"==typeof t)try{i=eI(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if(eg(t))i=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let n=i.length;if("number"==typeof r&&n!==r)throw Error(e+" of length "+r+" expected, got "+n);return i}function eN(...e){let t=0;for(let r=0;r<e.length;r++){let i=e[r];ey(i),t+=i.length}let r=new Uint8Array(t);for(let t=0,i=0;t<e.length;t++){let n=e[t];r.set(n,i),i+=n.length}return r}let eR=e=>"bigint"==typeof e&&eb<=e;function ek(e,t,r){return eR(e)&&eR(t)&&eR(r)&&t<=e&&e<r}function ej(e,t,r,i){if(!ek(t,r,i))throw Error("expected valid "+e+": "+r+" <= n < "+i+", got "+t)}let eL=e=>(ep<<BigInt(e))-ep,e_=e=>new Uint8Array(e),ez={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||eg(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)};function eH(e,t,r={}){let i=(t,r,i)=>{let n=ez[r];if("function"!=typeof n)throw Error("invalid validator function");let o=e[t];if((!i||void 0!==o)&&!n(o,e))throw Error("param "+String(t)+" is invali
2d. Expected "+r+", got "+o)};for(let[e,r]of Object.entries(t))i(e,r,!1);for(let[e,t]of Object.entries(r))i(e,t,!0);return e}function eT(e){let t=new WeakMap;return(r,...i)=>{let n=t.get(r);if(void 0!==n)return n;let o=e(r,...i);return t.set(r,o),o}}let eF=BigInt(0),eq=BigInt(1),eD=BigInt(2),eV=BigInt(3),eM=BigInt(4),e$=BigInt(5),eZ=BigInt(8);function eK(e,t){let r=e%t;return r>=eF?r:t+r}function eY(e,t,r){let i=e;for(;t-- >eF;)i*=i,i%=r;return i}function eW(e,t){if(e===eF)throw Error("invert: expected non-zero number");if(t<=eF)throw Error("invert: expected positive modulus, got "+t);let r=eK(e,t),i=t,n=eF,o=eq,s=eq,f=eF;for(;r!==eF;){let e=i/r,t=i%r,a=n-s*e,l=o-f*e;i=r,r=t,n=s,o=f,s=a,f=l}if(i!==eq)throw Error("invert: does not exist");return eK(n,t)}function eX(e,t){let r=(e.ORDER+eq)/eM,i=e.pow(t,r);if(!e.eql(e.sqr(i),t))throw Error("Cannot find square root");return i}function eG(e,t){let r=(e.ORDER-e$)/eZ,i=e.mul(t,eD),n=e.pow(i,r),o=e.mul(t,n),s=e.mul(e.mul(o,eD),n),f=e.mul(o,e.sub(s,e.ONE));if(!e.eql(e.sqr(f),t))throw Error("Cannot find square root");return f}let eJ=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function eQ(e){return eH(e,eJ.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"}))}function e0(e,t,r=!1){let i=Array(t.length).fill(r?e.ZERO:void 0),n=t.reduce((t,r,n)=>e.is0(r)?t:(i[n]=t,e.mul(t,r)),e.ONE),o=e.inv(n);return t.reduceRight((t,r,n)=>e.is0(r)?t:(i[n]=e.mul(t,i[n]),e.mul(t,r)),o),i}function e1(e,t){let r=(e.ORDER-eq)/eD,i=e.pow(t,r),n=e.eql(i,e.ONE),o=e.eql(i,e.ZERO),s=e.eql(i,e.neg(e.ONE));if(!n&&!o&&!s)throw Error("invalid Legendre symbol result");return n?1:o?0:-1}function e2(e,t){void 0!==t&&z(t);let r=void 0!==t?t:e.toString(2).length,i=Math.ceil(r/8);return{nBitLength:r,nByteLength:i}}function e8(e,t,r=!1,i={}){let n;if(e<=eF)throw Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:o,nByteLength:s}=e2(e,t);if(s>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let f=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:s,MASK:eL(o),ZERO:eF,ONE:eq,create:t=>eK(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("invalid field element: expected bigint, got "+typeof t);return eF<=t&&t<e},is0:e=>e===eF,isOdd:e=>(e&eq)===eq,neg:t=>eK(-t,e),eql:(e,t)=>e===t,sqr:t=>eK(t*t,e),add:(t,r)=>eK(t+r,e),sub:(t,r)=>eK(t-r,e),mul:(t,r)=>eK(t*r,e),pow:(e,t)=>(function(e,t,r){if(r<eF)throw Error("invalid exponent, negatives unsupported");if(r===eF)return e.ONE;if(r===eq)return t;let i=e.ONE,n=t;for(;r>eF;)r&eq&&(i=e.mul(i,n)),n=e.sqr(n),r>>=eq;return i})(f,e,t),div:(t,r)=>eK(t*eW(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>eW(t,e),sqrt:i.sqrt||(t=>(n||(n=e%eM===eV?eX:e%eZ===e$?eG:function(e){if(e<BigInt(3))throw Error("sqrt is not defined for small field");let t=e-eq,r=0;for(;t%eD===eF;)t/=eD,r++;let i=eD,n=e8(e);for(;1===e1(n,i);)if(i++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===r)return eX;let o=n.pow(i,t),s=(t+eq)/eD;return function(e,i){if(e.is0(i))return i;if(1!==e1(e,i))throw Error("Cannot find square root");let n=r,f=e.mul(e.ONE,o),a=e.pow(i,t),l=e.pow(i,s);for(;!e.eql(a,e.ONE);){if(e.is0(a))return e.ZERO;let t=1,r=e.sqr(a);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===n)throw Error("Cannot find square root");let i=eq<<BigInt(n-t-1),o=e.pow(f,i);n=t,f=e.sqr(o),a=e.mul(a,f),l=e.mul(l,o)}return l}}(e)),n(f,t))),toBytes:e=>r?eU(e,s):eC(e,s),fromBytes:e=>{if(e.length!==s)throw Error("Field.fromBytes: expected "+s+" bytes, got "+e.length);return r?eS(e):eO(e)},invertBatch:e=>e0(f,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(f)}function e3(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function e6(e){let t=e3(e);return t+Math.ceil(t/2)}let e5=BigInt(0),e4=BigInt(1);function e7(e,t){let r=t.negate();return e?r:t}function e9(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function te(e,t){e9(e,t);let r=Math.ceil(t/e)+1,i=2**(e-1),n=2**e;return{windows:r,windowSize:i,mask:eL(e),maxNumber:n,shiftBy:BigInt(e)}}function tt(e,t,r){let{windowSize:i,mask:n,maxNumber:o,shiftBy:s}=r,f=Number(e&n),a=e>>s;f>i&&(f-=o,a+=e4);let l=t*i,c=l+Math.abs(f)-1,u=0===f;return{nextN:a,offset:c,isZero:u,isNeg:f<0,isNegF:t%2!=0,offsetF:l}}let tr=new WeakMap,ti=new WeakMap;function tn(e){return ti.get(e)||1}function to(e){return eQ(e.Fp),eH(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...e2(e.n,e.nBitLength),...e,...{p:e.Fp.ORDER}})}function ts(e){void 0!==e.lowS&&ex("lowS",e.lowS),void 0!==e.prehash&&ex("prehash",e.prehash)}
vendor: 5,248 bytes, line 2
2let tf={Err:class extends Error{constructor(e=""){super(e)}},_tlv:{encode:(e,t)=>{let{Err:r}=tf;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");let i=t.length/2,n=em(i);if(n.length/2&128)throw new r("tlv.encode: long form length too big");let o=i>127?em(n.length/2|128):"";return em(e)+o+n+t},decode(e,t){let{Err:r}=tf,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");let n=t[i++],o=0;if(128&n){let e=127&n;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");let s=t.subarray(i,i+e);if(s.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(let e of s)o=o<<8|e;if(i+=e,o<128)throw new r("tlv.decode(long): not minimal encoding")}else o=n;let s=t.subarray(i,i+o);if(s.length!==o)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(i+o)}}},_int:{encode(e){let{Err:t}=tf;if(e<ta)throw new t("integer: negative integers are not allowed");let r=em(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){let{Err:t}=tf;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 eO(e)}},toSig(e){let{Err:t,_int:r,_tlv:i}=tf,n=eP("signature",e),{v:o,l:s}=i.decode(48,n);if(s.length)throw new t("invalid signature: left bytes after parsing");let{v:f,l:a}=i.decode(2,o),{v:l,l:c}=i.decode(2,a);if(c.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(f),s:r.decode(l)}},hexFromSig(e){let{_tlv:t,_int:r}=tf,i=t.encode(2,r.encode(e.r)),n=t.encode(2,r.encode(e.s));return t.encode(48,i+n)}},ta=BigInt(0),tl=BigInt(1),tc=BigInt(2),tu=BigInt(3),th=BigInt(4),td=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),tb=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),tp=BigInt(0),tg=BigInt(1),ty=BigInt(2),tx=(e,t)=>(e+t/ty)/t,tm=e8(td,void 0,void 0,{sqrt:function(e){let t=BigInt(3),r=BigInt(6),i=BigInt(11),n=BigInt(22),o=BigInt(23),s=BigInt(44),f=BigInt(88),a=e*e*e%td,l=a*a*e%td,c=eY(l,t,td)*l%td,u=eY(c,t,td)*l%td,h=eY(u,ty,td)*a%td,d=eY(h,i,td)*h%td,b=eY(d,n,td)*d%td,p=eY(b,s,td)*b%td,g=eY(p,f,td)*p%td,y=eY(g,s,td)*b%td,x=eY(y,t,td)*l%td,m=eY(x,o,td)*d%td,w=eY(m,r,td)*a%td,v=eY(w,ty,td);if(!tm.eql(tm.sqr(v),e))throw Error("Cannot find square root");return v}}),tw=(c={a:tp,b:BigInt(7),Fp:tm,n:tb,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-tg*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),n=BigInt("0x100000000000000000000000000000000"),o=tx(t*e,tb),s=tx(-r*e,tb),f=eK(e-o*t-s*i,tb),a=eK(-o*r-s*t,tb),l=f>n,c=a>n;if(l&&(f=tb-f),c&&(a=tb-a),f>n||a>n)throw Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:l,k1:f,k2neg:c,k2:a}}}},{...(t=e=>(function(e){let t,r=(eH(t=to(e),{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})),{Fp:i,n:n,nByteLength:o,nBitLength:s}=r,f=i.BYTES+1,a=2*i.BYTES+1;function l(e){return eK(e,n)}let{ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:h,isWithinCurveOrder:d}=function(e){var t;let r=function(e){let t=to(e);eH(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:r,Fp:i,a:n}=t;if(r){if(!i.eql(n,i.ZERO))throw Error("invalid endo: CURVE.a must be 0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}(e),{Fp:i}=r,n=e8(r.n,r.nBitLength),o=r.toBytes||((e,t,r)=>{let n=t.toAffine();return eN(Uint8Array.from([4]),i.toBytes(n.x),i.toBytes(n.y))}),s=r.fromBytes||(e=>{let t=e.subarray(1);return{x:i.fromBytes(t.subarray(0,i.BYTES)),y:i.fromBytes(t.subarray(i.BYTES,2*i.BYTES))}});function f(e){let{a:t,b:n}=r,o=i.sqr(e),s=i.mul(o,e);return i.add(i.add(s,i.mul(e,t)),n)}function a(e,t){let r=i.sqr(t),n=f(e);return i.eql(r,n)}if(!a(r.Gx,r.Gy))throw Error("bad curve params: generator point");let l=i.mul(i.pow(r.a,tu),th),c=i.mul(i.sqr(r.b),BigInt(27));if(i.is0(i.add(l,c)))throw Error("bad curve params: a or b");function u(e){let t,{allowedPrivateKeyLengths:i,nByteLength:n,wrapPrivateKey:o,n:s}=r;if(i&&"bigint"!=typeof e){if(eg(e)&&(e=eB(e)),"string"!=typeof e||!i.includes(e.length))throw Error("invalid private key");e=e.padStart(2*n,"0")}try{t="bigint"==typeof e?e:eO(eP("private key",e,n))}catch(t){throw Error("invalid private key, expected hex or "+n+" b
2ytes, got "+typeof e)}return o&&(t=eK(t,s)),ej("private key",t,tl,s),t}function h(e){if(!(e instanceof p))throw Error("ProjectivePoint expected")}let d=eT((e,t)=>{let{px:r,py:n,pz:o}=e;if(i.eql(o,i.ONE))return{x:r,y:n};let s=e.is0();null==t&&(t=s?i.ONE:i.inv(o));let f=i.mul(r,t),a=i.mul(n,t),l=i.mul(o,t);if(s)return{x:i.ZERO,y:i.ZERO};if(!i.eql(l,i.ONE))throw Error("invZ was invalid");return{x:f,y:a}}),b=eT(e=>{if(e.is0()){if(r.allowInfinityPoint&&!i.is0(e.py))return;throw Error("bad point: ZERO")}let{x:t,y:n}=e.toAffine();if(!i.isValid(t)||!i.isValid(n))throw Error("bad point: x or y not FE");if(!a(t,n))throw Error("bad point: equation left != right");if(!e.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class p{constructor(e,t,r){if(null==e||!i.isValid(e))throw Error("x required");if(null==t||!i.isValid(t)||i.is0(t))throw Error("y required");if(null==r||!i.isValid(r))throw Error("z required");this.px=e,this.py=t,this.pz=r,Object.freeze(this)}static fromAffine(e){let{x:t,y:r}=e||{};if(!e||!i.isValid(t)||!i.isValid(r))throw Error("invalid affine point");if(e instanceof p)throw Error("projective point not allowed");let n=e=>i.eql(e,i.ZERO);return n(t)&&n(r)?p.ZERO:new p(t,r,i.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=e0(i,e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(p.fromAffine)}static fromHex(e){let t=p.fromAffine(s(eP("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return p.BASE.multiply(u(e))}static msm(e,t){return function(e,t,r,i){if(!Array.isArray(r))throw Error("array expected");r.forEach((t,r)=>{if(!(t instanceof e))throw Error("invalid point at index "+r)});if(!Array.isArray(i))throw Error("array of scalars expected");i.forEach((e,r)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+r)});let n=r.length,o=i.length;if(n!==o)throw Error("arrays of points and scalars must have equal length");let s=e.ZERO,f=function(e){let t;for(t=0;e>eb;e>>=ep,t+=1);return t}(BigInt(n)),a=1;f>12?a=f-3:f>4?a=f-2:f>0&&(a=2);let l=eL(a),c=Array(Number(l)+1).fill(s),u=Math.floor((t.BITS-1)/a)*a,h=s;for(let e=u;e>=0;e-=a){c.fill(s);for(let t=0;t<o;t++){let n=Number(i[t]>>BigInt(e)&l);c[n]=c[n].add(r[t])}let t=s;for(let e=c.length-1,r=s;e>0;e--)r=r.add(c[e]),t=t.add(r);if(h=h.add(t),0!==e)for(let e=0;e<a;e++)h=h.double()}return h}(p,n,e,t)}_setWindowSize(e){x.setWindowSize(this,e)}assertValidity(){b(this)}hasEvenY(){let{y:e}=this.toAffine();if(i.isOdd)return!i.isOdd(e);throw Error("Field doesn't support isOdd")}equals(e){h(e);let{px:t,py:r,pz:n}=this,{px:o,py:s,pz:f}=e,a=i.eql(i.mul(t,f),i.mul(o,n)),l=i.eql(i.mul(r,f),i.mul(s,n));return a&&l}negate(){return new p(this.px,i.neg(this.py),this.pz)}double(){let{a:e,b:t}=r,n=i.mul(t,tu),{px:o,py:s,pz:f}=this,a=i.ZERO,l=i.ZERO,c=i.ZERO,u=i.mul(o,o),h=i.mul(s,s),d=i.mul(f,f),b=i.mul(o,s);return b=i.add(b,b),c=i.mul(o,f),c=i.add(c,c),a=i.mul(e,c),l=i.mul(n,d),l=i.add(a,l),a=i.sub(h,l),l=i.add(h,l),l=i.mul(a,l),a=i.mul(b,a),c=i.mul(n,c),d=i.mul(e,d),b=i.sub(u,d),b=i.mul(e,b),b=i.add(b,c),c=i.add(u,u),u=i.add(c,u),u=i.add(u,d),u=i.mul(u,b),l=i.add(l,u),d=i.mul(s,f),d=i.add(d,d),u=i.mul(d,b),a=i.sub(a,u),c=i.mul(d,h),c=i.add(c,c),new p(a,l,c=i.add(c,c))}add(e){h(e);let{px:t,py:n,pz:o}=this,{px:s,py:f,pz:a}=e,l=i.ZERO,c=i.ZERO,u=i.ZERO,d=r.a,b=i.mul(r.b,tu),g=i.mul(t,s),y=i.mul(n,f),x=i.mul(o,a),m=i.add(t,n),w=i.add(s,f);m=i.mul(m,w),w=i.add(g,y),m=i.sub(m,w),w=i.add(t,o);let v=i.add(s,a);return w=i.mul(w,v),v=i.add(g,x),w=i.sub(w,v),v=i.add(n,o),l=i.add(f,a),v=i.mul(v,l),l=i.add(y,x),v=i.sub(v,l),u=i.mul(d,w),l=i.mul(b,x),u=i.add(l,u),l=i.sub(y,u),u=i.add(y,u),c=i.mul(l,u),y=i.add(g,g),y=i.add(y,g),x=i.mul(d,x),w=i.mul(b,w),y=i.add(y,x),x=i.sub(g,x),x=i.mul(d,x),w=i.add(w,x),g=i.mul(y,w),c=i.add(c,g),g=i.mul(v,w),l=i.mul(m,l),l=i.sub(l,g),g=i.mul(m,y),u=i.mul(v,u),new p(l,c,u=i.add(u,g))}subtract(e){return this.add(e.negate())}is0(){return this.equals(p.ZERO)}wNAF(e){return x.wNAFCached(this,e,p.normalizeZ)}multiplyUnsafe(e){let{endo:t,n:n}=r;ej("scalar",e,ta,n);let o=p.ZERO;if(e===ta)return o;if(this.is0()||e===tl)return this;if(!t||x.hasPrecomputes(this))return x.wNAFCachedUnsafe(this,e,p.normalizeZ);
vendor: 4,610 bytes, line 2
2let{k1neg:s,k1:f,k2neg:a,k2:l}=t.splitScalar(e),c=o,u=o,h=this;for(;f>ta||l>ta;)f&tl&&(c=c.add(h)),l&tl&&(u=u.add(h)),h=h.double(),f>>=tl,l>>=tl;return s&&(c=c.negate()),a&&(u=u.negate()),u=new p(i.mul(u.px,t.beta),u.py,u.pz),c.add(u)}multiply(e){let t,n,{endo:o,n:s}=r;if(ej("scalar",e,tl,s),o){let{k1neg:r,k1:s,k2neg:f,k2:a}=o.splitScalar(e),{p:l,f:c}=this.wNAF(s),{p:u,f:h}=this.wNAF(a);l=x.constTimeNegate(r,l),u=x.constTimeNegate(f,u),u=new p(i.mul(u.px,o.beta),u.py,u.pz),t=l.add(u),n=c.add(h)}else{let{p:r,f:i}=this.wNAF(e);t=r,n=i}return p.normalizeZ([t,n])[0]}multiplyAndAddUnsafe(e,t,r){let i=p.BASE,n=(e,t)=>t!==ta&&t!==tl&&e.equals(i)?e.multiply(t):e.multiplyUnsafe(t),o=n(this,t).add(n(e,r));return o.is0()?void 0:o}toAffine(e){return d(this,e)}isTorsionFree(){let{h:e,isTorsionFree:t}=r;if(e===tl)return!0;if(t)return t(p,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:e,clearCofactor:t}=r;return e===tl?this:t?t(p,this):this.multiplyUnsafe(r.h)}toRawBytes(e=!0){return ex("isCompressed",e),this.assertValidity(),o(p,this,e)}toHex(e=!0){return ex("isCompressed",e),eB(this.toRawBytes(e))}}p.BASE=new p(r.Gx,r.Gy,i.ONE),p.ZERO=new p(i.ZERO,i.ONE,i.ZERO);let{endo:g,nBitLength:y}=r,x=(t=g?Math.ceil(y/2):y,{constTimeNegate:e7,hasPrecomputes:e=>1!==tn(e),unsafeLadder(e,t,r=p.ZERO){let i=e;for(;t>e5;)t&e4&&(r=r.add(i)),i=i.double(),t>>=e4;return r},precomputeWindow(e,r){let{windows:i,windowSize:n}=te(r,t),o=[],s=e,f=s;for(let e=0;e<i;e++){f=s,o.push(f);for(let e=1;e<n;e++)f=f.add(s),o.push(f);s=f.double()}return o},wNAF(e,r,i){let n=p.ZERO,o=p.BASE,s=te(e,t);for(let e=0;e<s.windows;e++){let{nextN:t,offset:f,isZero:a,isNeg:l,isNegF:c,offsetF:u}=tt(i,e,s);i=t,a?o=o.add(e7(c,r[u])):n=n.add(e7(l,r[f]))}return{p:n,f:o}},wNAFUnsafe(e,r,i,n=p.ZERO){let o=te(e,t);for(let e=0;e<o.windows&&i!==e5;e++){let{nextN:t,offset:s,isZero:f,isNeg:a}=tt(i,e,o);if(i=t,!f){let e=r[s];n=n.add(a?e.negate():e)}}return n},getPrecomputes(e,t,r){let i=tr.get(t);return i||(i=this.precomputeWindow(t,e),1!==e&&tr.set(t,r(i))),i},wNAFCached(e,t,r){let i=tn(e);return this.wNAF(i,this.getPrecomputes(i,e,r),t)},wNAFCachedUnsafe(e,t,r,i){let n=tn(e);return 1===n?this.unsafeLadder(e,t,i):this.wNAFUnsafe(n,this.getPrecomputes(n,e,r),t,i)},setWindowSize(e,r){e9(r,t),ti.set(e,r),tr.delete(e)}});return{CURVE:r,ProjectivePoint:p,normPrivateKeyToScalar:u,weierstrassEquation:f,isWithinCurveOrder:function(e){return ek(e,tl,r.n)}}}({...r,toBytes(e,t,r){let n=t.toAffine(),o=i.toBytes(n.x);return(ex("isCompressed",r),r)?eN(Uint8Array.from([t.hasEvenY()?2:3]),o):eN(Uint8Array.from([4]),o,i.toBytes(n.y))},fromBytes(e){let t=e.length,r=e[0],n=e.subarray(1);if(t===f&&(2===r||3===r)){let e,t=eO(n);if(!ek(t,tl,i.ORDER))throw Error("Point is not on curve");let o=h(t);try{e=i.sqrt(o)}catch(e){throw Error("Point is not on curve"+(e instanceof Error?": "+e.message:""))}return(1&r)==1!=((e&tl)===tl)&&(e=i.neg(e)),{x:t,y:e}}if(t===a&&4===r)return{x:i.fromBytes(n.subarray(0,i.BYTES)),y:i.fromBytes(n.subarray(i.BYTES,2*i.BYTES))};throw Error("invalid Point, expected length of "+f+", or uncompressed "+a+", got "+t)}}),b=(e,t,r)=>eO(e.slice(t,r));class p{constructor(e,t,r){ej("r",e,tl,n),ej("s",t,tl,n),this.r=e,this.s=t,null!=r&&(this.recovery=r),Object.freeze(this)}static fromCompact(e){return new p(b(e=eP("compactSignature",e,2*o),0,o),b(e,o,2*o))}static fromDER(e){let{r:t,s:r}=tf.toSig(eP("DER",e));return new p(t,r)}assertValidity(){}addRecoveryBit(e){return new p(this.r,this.s,e)}recoverPublicKey(e){let{r:t,s:o,recovery:s}=this,f=x(eP("msgHash",e));if(null==s||![0,1,2,3].includes(s))throw Error("recovery id invalid");let a=2===s||3===s?t+r.n:t;if(a>=i.ORDER)throw Error("recovery id 2 or 3 invalid");let u=(1&s)==0?"02":"03",h=c.fromHex(u+eB(eC(a,i.BYTES))),d=eW(a,n),b=l(-f*d),p=l(o*d),g=c.BASE.multiplyAndAddUnsafe(h,b,p);if(!g)throw Error("point at infinify");return g.assertValidity(),g}hasHighS(){return this.s>n>>tl}normalizeS(){return this.hasHighS()?new p(this.r,l(-this.s),this.recovery):this}toDERRawBytes(){return eI(this.toDERHex())}toDERHex(){return tf.hexFromSig(this)}toCompactRawBytes(){return eI(this.toCompactHex())}toCompactHex(){return eB(eC(this.r,o))+eB(eC(this.s,o))}}function g(e){if("bigint"==typeof e)return!1;if(e instanceof c)return!0;let t=eP("key",e).length,n=i.BYTES,s=n+1;if(!r.allowedPrivateKeyLengths&&o!==s)return t===s||t===2*n+1}let y=r.bits2int||function(e){if(e.length>8192)throw Error("input is too large");let t=eO(e),r=8*e.length-s;return r>0?t>>BigInt(r):t},x=r.bits2int_modN||function(e){return l(y(e))},m=eL(s);
2function w(e){return ej("num < 2^"+s,e,ta,m),eC(e,o)}let v={lowS:r.lowS,prehash:!1},E={lowS:r.lowS,prehash:!1};return c.BASE._setWindowSize(8),{CURVE:r,getPublicKey:function(e,t=!0){return c.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(!0===g(e))throw Error("first arg must be private key");if(!1===g(t))throw Error("second arg must be public key");return c.fromHex(t).multiply(u(e)).toRawBytes(r)},sign:function(e,t,o=v){let{seed:s,k2sig:f}=function(e,t,o=v){if(["recovered","canonical"].some(e=>e in o))throw Error("sign() legacy options not supported");let{hash:s,randomBytes:f}=r,{lowS:a,prehash:h,extraEntropy:b}=o;null==a&&(a=!0),e=eP("msgHash",e),ts(o),h&&(e=eP("prehashed msgHash",s(e)));let g=x(e),m=u(t),E=[w(m),w(g)];if(null!=b&&!1!==b){let e=!0===b?f(i.BYTES):b;E.push(eP("extraEntropy",e))}return{seed:eN(...E),k2sig:function(e){var t;let r=y(e);if(!d(r))return;let i=eW(r,n),o=c.BASE.multiply(r).toAffine(),s=l(o.x);if(s===ta)return;let f=l(i*l(g+s*m));if(f===ta)return;let u=2*(o.x!==s)|Number(o.y&tl),h=f;return a&&f>n>>tl&&(h=(t=f)>n>>tl?l(-t):t,u^=1),new p(s,h,u)}}}(e,t,o);return(function(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let i=e_(e),n=e_(e),o=0,s=()=>{i.fill(1),n.fill(0),o=0},f=(...e)=>r(n,i,...e),a=(e=e_(0))=>{let t;if(n=f((t=[0],Uint8Array.from(t)),e),i=f(),0!==e.length){let t;n=f((t=[1],Uint8Array.from(t)),e),i=f()}},l=()=>{if(o++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e<t;){let t=(i=f()).slice();r.push(t),e+=i.length}return eN(...r)};return(e,t)=>{let r;for(s(),a(e);!(r=t(l()));)a();return s(),r}})(r.hash.outputLen,r.nByteLength,r.hmac)(s,f)},verify:function(e,t,i,o=E){let s,f;t=eP("msgHash",t),i=eP("publicKey",i);let{lowS:a,prehash:u,format:h}=o;if(ts(o),"strict"in o)throw Error("options.strict was renamed to lowS");if(void 0!==h&&"compact"!==h&&"der"!==h)throw Error("format must be compact or der");let d="string"==typeof e||eg(e),b=!d&&!h&&"object"==typeof e&&null!==e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!d&&!b)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");try{if(b&&(f=new p(e.r,e.s)),d){try{"compact"!==h&&(f=p.fromDER(e))}catch(e){if(!(e instanceof tf.Err))throw e}f||"der"===h||(f=p.fromCompact(e))}s=c.fromHex(i)}catch(e){return!1}if(!f||a&&f.hasHighS())return!1;u&&(t=r.hash(t));let{r:g,s:y}=f,m=x(t),w=eW(y,n),v=l(m*w),B=l(g*w),A=c.BASE.multiplyAndAddUnsafe(s,v,B)?.toAffine();return!!A&&l(A.x)===g},ProjectivePoint:c,Signature:p,utils:{isValidPrivateKey(e){try{return u(e),!0}catch(e){return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{let e=e6(r.n);return function(e,t,r=!1){let i=e.length,n=e3(t),o=e6(t);if(i<16||i<o||i>1024)throw Error("expected "+o+"-1024 bytes of input, got "+i);let s=eK(r?eS(e):eO(e),t-eq)+eq;return r?eU(s,n):eC(s,n)}(r.randomBytes(e),r.n)},precompute:(e=8,t=c.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}})({...c,hash:e,hmac:(t,...r)=>ed(e,t,function(...e){let t=0;for(let r=0;r<e.length;r++){let i=e[r];H(i),t+=i.length}let r=new Uint8Array(t);for(let t=0,i=0;t<e.length;t++){let n=e[t];r.set(n,i),i+=n.length}return r}(...r)),randomBytes:Y}))(eu),create:t});tw.ProjectivePoint;let tv=(r=[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(e=>e.map(e=>BigInt(e))).map(e=>Array.from(e).reverse()),(e,t)=>{let[i,n,o,s]=r.map(t=>t.reduce((t,r)=>tm.add(tm.mul(t,e),r))),[f,a]=e0(tm,[n,s],!0);return e=tm.mul(i,f),t=tm.mul(t,tm.mul(o,a)),{x:e,y:t}}),tE=function(e,t){if(eQ(e),!e.isValid(t.A)||!e.isValid(t.B)||!e.isValid(t.Z))throw Error("mapToCurveSimpleSWU: invali
2d opts");let r=function(e,t){let r=e.ORDER,i=ta;for(let e=r-tl;e%tc===ta;e/=tc)i+=tl;let n=i,o=tc<<n-tl-tl,s=o*tc,f=(r-tl)/s,a=(f-tl)/tc,l=s-tl,c=e.pow(t,f),u=e.pow(t,(f+tl)/tc),h=(t,r)=>{let i=c,s=e.pow(r,l),f=e.sqr(s);f=e.mul(f,r);let h=e.mul(t,f);h=e.pow(h,a),h=e.mul(h,s),s=e.mul(h,r),f=e.mul(h,t);let d=e.mul(f,s);h=e.pow(d,o);let b=e.eql(h,e.ONE);s=e.mul(f,u),h=e.mul(d,i),f=e.cmov(s,f,b),d=e.cmov(h,d,b);for(let t=n;t>tl;t--){let r=t-tc;r=tc<<r-tl;let n=e.pow(d,r),o=e.eql(n,e.ONE);s=e.mul(f,i),i=e.mul(i,i),n=e.mul(d,i),f=e.cmov(s,f,o),d=e.cmov(n,d,o)}return{isValid:b,value:f}};if(e.ORDER%th===tu){let r=(e.ORDER-tu)/th,i=e.sqrt(e.neg(t));h=(t,n)=>{let o=e.sqr(n),s=e.mul(t,n);o=e.mul(o,s);let f=e.pow(o,r);f=e.mul(f,s);let a=e.mul(f,i),l=e.mul(e.sqr(f),n),c=e.eql(l,t),u=e.cmov(a,f,c);return{isValid:c,value:u}}}return h}(e,t.Z);if(!e.isOdd)throw Error("Fp.isOdd is not implemented!");return i=>{let n,o,s,f,a,l,c,u;n=e.sqr(i),n=e.mul(n,t.Z),o=e.sqr(n),o=e.add(o,n),s=e.add(o,e.ONE),s=e.mul(s,t.B),f=e.cmov(t.Z,e.neg(o),!e.eql(o,e.ZERO)),f=e.mul(f,t.A),o=e.sqr(s),l=e.sqr(f),a=e.mul(l,t.A),o=e.add(o,a),o=e.mul(o,s),l=e.mul(l,f),a=e.mul(l,t.B),o=e.add(o,a),c=e.mul(n,s);let{isValid:h,value:d}=r(o,l);u=e.mul(n,i),u=e.mul(u,d),c=e.cmov(c,s,h),u=e.cmov(u,d,h);let b=e.isOdd(i)===e.isOdd(u);u=e.cmov(e.neg(u),u,b);let p=e0(e,[f],!0)[0];return{x:c=e.mul(c,p),y:u}}}(tm,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:tm.create(BigInt("-11"))});!function(e,t,r){if("function"!=typeof t)throw Error("mapToCurve() must be defined")}(tw.ProjectivePoint,e=>{let{x:t,y:r}=tE(tm.create(e[0]));return tv(t,r)},tm.ORDER);class tB extends Error{constructor(e,t={}){const r=(()=>{if(t.cause instanceof tB){if(t.cause.details)return t.cause.details;if(t.cause.shortMessage)return t.cause.shortMessage}return t.cause&&"details"in t.cause&&"string"==typeof t.cause.details?t.cause.details:t.cause?.message?t.cause.message:t.details})(),i=t.cause instanceof tB&&t.cause.docsPath||t.docsPath,n=`https://oxlib.sh${i??""}`;super([e||"An error occurred.",...t.metaMessages?["",...t.metaMessages]:[],...r||i?["",r?`Details: ${r}`:void 0,i?`See: ${n}`:void 0]:[]].filter(e=>"string"==typeof e).join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"[email protected]"}),this.cause=t.cause,this.details=r,this.docs=n,this.docsPath=i,this.shortMessage=e}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t&&t.cause?e(t.cause,r):r?null:t}(this,e)}}function tA(e,t){if(tj(e)>t)throw new tT({givenSize:tj(e),maxSize:t})}function tI(e,t={}){let{dir:r,size:i=32}=t;if(0===i)return e;let n=e.replace("0x","");if(n.length>2*i)throw new tq({size:Math.ceil(n.length/2),targetSize:i,type:"Hex"});return`0x${n["right"===r?"padEnd":"padStart"](2*i,"0")}`}function tO(e,t,r){return JSON.stringify(e,(e,r)=>"function"==typeof t?t(e,r):"bigint"==typeof r?r.toString()+"#__bigint":r,r)}let tS=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function tC(...e){return`0x${e.reduce((e,t)=>e+t.replace("0x",""),"")}`}function tU(e){return e instanceof Uint8Array?tP(e):Array.isArray(e)?tP(new Uint8Array(e)):e}function tP(e,t={}){let r="";for(let t=0;t<e.length;t++)r+=tS[e[t]];let i=`0x${r}`;return"number"==typeof t.size?(tA(i,t.size),tR(i,t.size)):i}function tN(e,t={}){var r;let i,{signed:n,size:o}=t,s=BigInt(e);o?i=n?(1n<<8n*BigInt(o)-1n)-1n:2n**(8n*BigInt(o))-1n:"number"==typeof e&&(i=BigInt(Number.MAX_SAFE_INTEGER));let f="bigint"==typeof i&&n?-i-1n:0;if(i&&s>i||s<f){let t="bigint"==typeof e?"n":"";throw new t_({max:i?`${i}${t}`:void 0,min:`${f}${t}`,signed:n,size:o,value:`${e}${t}`})}let a=(n&&s<0?(1n<<BigInt(8*o))+BigInt(s):s).toString(16),l=`0x${a}`;return o?(r=l,tI(r,{dir:"left",size:o})):l}function tR(e,t){return tI(e,{dir:"right",size:t})}function tk(e,t,r,i={}){let{strict:n}=i;if("number"==typeof t&&t>0&&t>tj(e)-1)throw new tF({offset:t,position:"start",size:tj(e)});let o=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return n&&function(e,t,r){if("number"==typeof t&&"number"==typeof r&&tj(e)!==r-t)throw new tF({offset:r,position:"end",size:tj(e)})}(o,t,r),o}function tj(e){return Math.ceil((e.length-2)/2)}function tL(e){return function(e,t={}){let{dir:r="left"}=t,i=e.replace("0x",""),n=0;for(let e=0;e<i.length-1;e++)if("0"===i["left"===r?e:i.length-e-1].toString())n++;else break;return"0"===(i="left"===r?i.slice(n):i.slice(0,i.length-n))?"0x":"right"===r&&i.length%2==1?`0x${i}0`:`0x${i}`}(e,{dir:"left"})}class t_ extends tB{constructor({max:e,min:t,signed:r,size:i,value:n}){super(`Number \`${n}\` is not in safe${i?` ${8*i}-bit`:""}${r?" signed":" unsigned"} integer range ${e?`(\`${t}\` to \`${e}\`)`:`(above \`${t}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class tz extends tB{constructor(e){super(`Value \`${"object"==typeof e?tO(e):e}\` of type \`${typeof e}
2\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class tH extends tB{constructor(e){super(`Value \`${e}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class tT extends tB{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class tF extends tB{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class tq extends tB{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function tD(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}let tV=new TextEncoder;function tM(e){var t;return e instanceof Uint8Array?e:"string"==typeof e?t$(e):(t=e)instanceof Uint8Array?t:new Uint8Array(t)}function t$(e,t={}){let{size:r}=t,i=e;r&&(tA(e,r),i=tR(e,r));let n=i.slice(2);n.length%2&&(n=`0${n}`);let o=n.length/2,s=new Uint8Array(o);for(let e=0,t=0;e<o;e++){let r=tD(n.charCodeAt(t++)),i=tD(n.charCodeAt(t++));if(void 0===r||void 0===i)throw new tB(`Invalid byte sequence ("${n[t-2]}${n[t-1]}" in "${n}").`);s[e]=16*r+i}return s}class tZ extends tB{constructor(e){super(`Value \`${"object"==typeof e?tO(e):e}\` of type \`${typeof e}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}}class tK extends tB{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed \`${t}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}class tY extends tB{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}let tW=2n**256n-1n;function tX(e,t={}){let{recovered:r}=t;if(void 0===e.r||void 0===e.s||r&&void 0===e.yParity)throw new t4({signature:e});if(e.r<0n||e.r>tW)throw new t7({value:e.r});if(e.s<0n||e.s>tW)throw new t9({value:e.s});if("number"==typeof e.yParity&&0!==e.yParity&&1!==e.yParity)throw new re({value:e.yParity})}function tG(e){return tJ(tP(e))}function tJ(e){if(130!==e.length&&132!==e.length)throw new t5({signature:e});let t=BigInt(tk(e,0,32)),r=BigInt(tk(e,32,64)),i=(()=>{let t=Number(`0x${e.slice(130)}`);if(!Number.isNaN(t))try{return t3(t)}catch{throw new re({value:t})}})();return void 0===i?{r:t,s:r}:{r:t,s:r,yParity:i}}function tQ(e){let t="string"==typeof e?tJ(e):e instanceof Uint8Array?tG(e):"str
2ing"==typeof e.r?t2(e):e.v?t1(e):{r:e.r,s:e.s,...void 0!==e.yParity?{yParity:e.yParity}:{}};return tX(t),t}function t0(e){let{r:t,s:r}=tw.Signature.fromDER(tU(e).slice(2));return{r:t,s:r}}function t1(e){return{r:e.r,s:e.s,yParity:t3(e.v)}}function t2(e){let t=(()=>{let t=e.v?Number(e.v):void 0,r=e.yParity?Number(e.yParity):void 0;if("number"==typeof t&&"number"!=typeof r&&(r=t3(t)),"number"!=typeof r)throw new re({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function t8(e){tX(e);let t=e.r,r=e.s;return tC(tN(t,{size:32}),tN(r,{size:32}),"number"==typeof e.yParity?tN(t6(e.yParity),{size:1}):"0x")}function t3(e){if(0===e||27===e)return 0;if(1===e||28===e)return 1;if(e>=35)return+(e%2==0);throw new rt({value:e})}function t6(e){if(0===e)return 27;if(1===e)return 28;throw new re({value:e})}class t5 extends tB{constructor({signature:e}){super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${tj(tU(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class t4 extends tB{constructor({signature:e}){super(`Signature \`${tO(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class t7 extends tB{constructor({value:e}){super(`Value \`${e}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class t9 extends tB{constructor({value:e}){super(`Value \`${e}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class re extends tB{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class rt extends tB{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}e.s(["InvalidRError",0,t7,"InvalidSError",0,t9,"InvalidSerializedSizeError",0,t5,"InvalidVError",0,rt,"InvalidYParityError",0,re,"MissingPropertiesError",0,t4,"assert",0,tX,"extract",0,function(e){if(void 0!==e.r&&void 0!==e.s)return tQ(e)},"from",0,tQ,"fromBytes",0,tG,"fromDerBytes",0,function(e){return t0(tP(e))},"fromDerHex",0,t0,"fromHex",0,tJ,"fromLegacy",0,t1,"fromRpc",0,t2,"fromTuple",0,function(e){let[t,r,i]=e;return tQ({r:"0x"===r?0n:BigInt(r),s:"0x"===i?0n:BigInt(i),yParity:"0x"===t?0:Number(t)})},"toBytes",0,function(e){return t$(t8(e))},"toDerBytes",0,function(e){return new tw.Signature(e.r,e.s).toDERRawBytes()},"toDerHex",0,function(e){let t=new tw.Signature(e.r,e.s);return`0x${t.toDERHex()}`},"toHex",0,t8,"toLegacy",0,function(e){return{r:e.r,s:e.s,v:t6(e.yParity)}},"toRpc",0,function(e){let{r:t,s:r,yParity:i}=e;return{r:tN(t,{size:32}),s:tN(r,{size:32}),yParity:0===i?"0x0":"0x1"}},"toTuple",0,function(e){let{r:t,s:r,yParity:i}=e;return[i?"0x01":"0x",0n===t?"0x":tL(tN(t)),0n===r?"0x":tL(tN(r))]},"vToYParity",0,t3,"validate",0,function(e,t={}){try{return tX(e,t),!0}catch{return!1}},"yParityToV",0,t6],803805),e.i(803805);class rr extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=this.keys().next().value;e&&this.delete(e)}return this}}let ri={checksum:new rr(8192)}.checksum,rn=BigInt(0),ro=BigInt(1),rs=BigInt(2),rf=BigInt(7),ra=BigInt(256),rl=BigInt(113),rc=[],ru=[],rh=[];for(let e=0,t=ro,r=1,i=0;e<24;e++){[r,i]=[i,(2*r+3*i)%5],rc.push(2*(5*i+r)),ru.push((e+1)*(e+2)/2%64);let n=rn;for(let e=0;e<7;e++)(t=(t<<ro^(t>>rf)*rl)%ra)&rs&&(n^=ro<<(ro<<BigInt(e))-ro);rh.push(n)}let rd=er(rh,!0),rb=rd[0],rp=rd[1],rg=(e,t,r)=>r>32?t<<r-32|e>>>64-r:e<<r|t>>>32-r,ry=(e,t,r)=>r>32?e<<r-32|t>>>64-r:t<<r|e>>>32-r;class rx extends Z{constructor(e,t,r,i=!1,n=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=i,this.rounds=n,z(r),!(0<e&&e<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}(this.state)}clone(){return this._cloneInto()}keccak(){M(this.state32),function(e,t=24){let r=new Uint32Array(10);for(let i=24-t;i<24;i++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let i=(t+8)%10,n=(t+2)%10,o=r[n],s=r[n+1],f=rg(o,s,1)^r[i],a=ry(o,s,1)^r[i+1];for(let r=0;r<50;r+=10)e[t+r]^=f,e[t+r+1]^=a}let t=e[2],n=e[3];for(let r=0;r<24;r++){let i=ru[r],o=rg(t,n,i),s=ry(t,n,i),f=rc[r];t=e[f],n=e[f+1],e[f]=o,e[f+1]=s}for(let t=0;t<50;t+=10){for(let i=0;i<10;i++)r[i]=e[t+i];for(let i=0;i<10;i++)e[t+i]^=~r[(i+2)%10]&r[(i+4)%10]}e[0]^=rb[i],e[1]^=rp[i]}q(r)}(this.state32,this.rounds),M(this.state32),this.posOut=0,this.pos=0}update(e){T(this),H(e=$(e));let{blockLen:t,state:r}=this,i=e.length;for(let n=0;n<i;){let o=Math.min(t-this.pos,i-n);for(let t=0;t<o;t++)r[this.pos++]^=e[n++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:r,blockLen:i}=this;e[r]^=t,(128&t)!=0&&r===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){T(this,!1),H(e),this.finish();let t=this.state,{blockLen:r}=this;for(let i=0,n=e.length;i<n;){this.posOut>=r&&this.keccak();let o=Math.min(r-this.posOut,n-i);e.set(t.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return z(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(F(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,q(this.state)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:i,rounds:n,enableXOF:o}=this;return e||(e=new rx(t,r,i,o,n)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=n,e.suffix=r,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}let rm=K(()=>new rx(136,1,32));function rw(e,t={}){let{as:r="string"==typeof e?"Hex":"Bytes"}=t,i=rm(tM(e));return"Bytes"===r?i:tP(i)}function rv(e,t={}){let{compressed:r}=t,{prefix:i,x:n,y:o}=e;if(!1===r||"bigint"==typeof n&&"bigint"==typeof o){if(4!==i)throw new rO({prefix:i,cause:new rC});return}if(!0===r||"bigint"==typeof n&&void 0===o){if(3!==i&&2!==i)throw new rO({prefix:i,cause:new rS});return}throw new rI({publicKey:e})}function rE(e){let t=(()=>
vendor: 3,314 bytes, line 2
2{if(function(e,t={}){let{strict:r=!1}=t;try{return!function(e,t={}){let{strict:r=!1}=t;if(!e||"string"!=typeof e)throw new tz(e);if(r&&!/^0x[0-9a-fA-F]*$/.test(e)||!e.startsWith("0x"))throw new tH(e)}(e,{strict:r}),!0}catch{return!1}}(e))return rB(e);if(function(e){try{if(!(e instanceof Uint8Array)&&(!e||"object"!=typeof e||!("BYTES_PER_ELEMENT"in e)||1!==e.BYTES_PER_ELEMENT||"Uint8Array"!==e.constructor.name))throw new tZ(e);return!0}catch{return!1}}(e))return rB(tP(e));let{prefix:t,x:r,y:i}=e;return"bigint"==typeof r&&"bigint"==typeof i?{prefix:t??4,x:r,y:i}:{prefix:t,x:r}})();return rv(t),t}function rB(e){if(132!==e.length&&130!==e.length&&68!==e.length)throw new rU({publicKey:e});if(130===e.length)return{prefix:4,x:BigInt(tk(e,0,32)),y:BigInt(tk(e,32,64))};if(132===e.length){let t=Number(tk(e,0,1));return{prefix:t,x:BigInt(tk(e,1,33)),y:BigInt(tk(e,33,65))}}return{prefix:Number(tk(e,0,1)),x:BigInt(tk(e,1,33))}}function rA(e,t={}){rv(e);let{prefix:r,x:i,y:n}=e,{includePrefix:o=!0}=t;return tC(o?tN(r,{size:1}):"0x",tN(i,{size:32}),"bigint"==typeof n?tN(n,{size:32}):"0x")}class rI extends tB{constructor({publicKey:e}){super(`Value \`${tO(e)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class rO extends tB{constructor({prefix:e,cause:t}){super(`Prefix "${e}" is invalid.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class rS extends tB{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class rC extends tB{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}class rU extends tB{constructor({publicKey:e}){super(`Value \`${e}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${tj(tU(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}}let rP=/^0x[a-fA-F0-9]{40}$/;function rN(e,t={}){let{strict:r=!0}=t;if(!rP.test(e))throw new rk({address:e,cause:new rj});if(r){if(e.toLowerCase()===e)return;if(rR(e)!==e)throw new rk({address:e,cause:new rL})}}function rR(e){if(ri.has(e))return ri.get(e);rN(e,{strict:!1});let t=e.substring(2).toLowerCase(),r=rw(function(e,t={}){let{size:r}=t,i=tV.encode(e);if("number"==typeof r){var n;if(i.length>r)throw new tK({givenSize:i.length,maxSize:r});return n=i,function(e,t={}){let{dir:r,size:i=32}=t;if(0===i)return e;if(e.length>i)throw new tY({size:e.length,targetSize:i,type:"Bytes"});let n=new Uint8Array(i);for(let t=0;t<i;t++){let o="right"===r;n[o?t:i-t-1]=e[o?t:e.length-t-1]}return n}(n,{dir:"right",size:r})}return i}(t),{as:"Bytes"}),i=t.split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&i[e]&&(i[e]=i[e].toUpperCase()),(15&r[e>>1])>
2=8&&i[e+1]&&(i[e+1]=i[e+1].toUpperCase());let n=`0x${i.join("")}`;return ri.set(e,n),n}class rk extends tB{constructor({address:e,cause:t}){super(`Address "${e}" is invalid.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class rj extends tB{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class rL extends tB{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}function r_(e){let{privateKey:t}=e;return rE(tw.ProjectivePoint.fromPrivateKey(tU(t).slice(2)))}function rz(e={}){let{as:t="Hex"}=e,r=tw.utils.randomPrivateKey();return"Hex"===t?tP(r):r}function rH(e){return function(e,t={}){let r=rw(`0x${rA(e).slice(4)}`).substring(26);return function(e,t={}){let{checksum:r=!1}=t;return(rN(e),r)?rR(e):e}(`0x${r}`,t)}(rT(e))}function rT(e){let{payload:t,signature:r}=e,{r:i,s:n,yParity:o}=r;return rE(new tw.Signature(BigInt(i),BigInt(n)).addRecoveryBit(o).recoverPublicKey(tU(t).substring(2)))}e.s(["createKeyPair",0,function(e={}){let{as:t="Hex"}=e,r=rz({as:t}),i=r_({privateKey:r});return{privateKey:r,publicKey:i}},"getPublicKey",0,r_,"getSharedSecret",0,function(e){let{as:t="Hex",privateKey:r,publicKey:i}=e,n=tw.ProjectivePoint.fromHex(rA(i).slice(2)).multiply(tw.utils.normPrivateKeyToScalar(tU(r).slice(2))).toRawBytes(!0);return"Hex"===t?tP(n):n},"noble",0,tw,"randomPrivateKey",0,rz,"recoverAddress",0,rH,"recoverPublicKey",0,rT,"sign",0,function(e){let{extraEntropy:t=!1,hash:r,payload:i,privateKey:n}=e,{r:o,s,recovery:f}=tw.sign(tM(i),tM(n),{extraEntropy:"boolean"==typeof t?t:tU(t).slice(2),lowS:!0,...r?{prehash:!0}:{}});return{r:o,s,yParity:f}},"verify",0,function(e){let{address:t,hash:r,payload:i,publicKey:n,signature:o}=e;if(t){var s;return s=rH({payload:i,signature:o}),rN(t,{strict:!1}),rN(s,{strict:!1}),t.toLowerCase()===s.toLowerCase()}return tw.verify(o,tM(i),function(e,t={}){return t$(rA(e,t))}(n),...r?[{prehash:!0,lowS:!0}]:[])}],462269),e.i(462269),e.i(103476),e.i(626335),e.i(425748),e.i(166953),e.i(262265),e.i(773912),e.i(120483),e.i(310998),e.i(281223),e.i(5625),Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;let rF=BigInt(0x100000000-1),rq=BigInt(32);function rD(e,t=!1){return t?{h:Number(e&rF),l:Number(e>>rq&rF)}:{h:0|Number(e>>rq&rF),l:0|Number(e&rF)}}function rV(e,t=!1){let r=e.length,i=new Uint32Array(r),n=new Uint32Array(r);for(let o=0;o<r;o++){let{h:r,l:s}=rD(e[o],t);[i[o],n[o]]=[r,s]}return[i,n]}let rM=(e,t,r)=>e>>>r,r$=(e,t,r)=>e<<32-r|t>>>r,rZ=(e,t,r)=>e>>>r|t<<32-r,rK=(e,t,r)=>e<<32-r|t>>>r,rY=(e,t,r)=>e<<64-r|t>>>r-32,rW=(e,t,r)=>e>>>r-32|t<<64-r;function rX(e,t,r,i){let n=(t>>
2>0)+(i>>>0);return{h:e+r+(n/0x100000000|0)|0,l:0|n}}let rG=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),rJ=(e,t,r,i)=>t+r+i+(e/0x100000000|0)|0,rQ=(e,t,r,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0),r0=(e,t,r,i,n)=>t+r+i+n+(e/0x100000000|0)|0,r1=(e,t,r,i,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0)+(n>>>0),r2=(e,t,r,i,n,o)=>t+r+i+n+o+(e/0x100000000|0)|0,r8="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function r3(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function r6(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function r5(e,...t){if(!r3(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function r4(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.createHasher");r6(e.outputLen),r6(e.blockLen)}function r7(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function r9(e,t){r5(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function ie(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function it(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function ir(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function ii(e,t){return e<<32-t|e>>>t}let io=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0];function is(e){return e<<24&0xff000000|e<<8&0xff0000|e>>>8&65280|e>>>24&255}let ia=io?e=>e:e=>is(e),il=io?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=is(e[t]);return e},ic="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,iu=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function ih(e){if(r5(e),ic)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=iu[e[r]];return t}function id(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function ib(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);if(ic)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let i=new Uint8Array(r);for(let t=0,n=0;t<r;t++,n+=2){let r=id(e.charCodeAt(n)),o=id(e.charCodeAt(n+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[n]+e[n+1])+'" at index '+n);i[t]=16*r+o}return i}function ip(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function ig(e){return"string"==typeof e&&(e=ip(e)),r5(e),e}function iy(...e){let t=0;for(let r=0;r<e.length;r++){let i=e[r];r5(i),t+=i.length}let r=new Uint8Array(t);for(let t=0,i=0;t<e.length;t++){let n=e[t];r.set(n,i),i+=n.length}return r}class ix{}function im(e){let t=t=>e().update(ig(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function iw(e=32){if(r8&&"function"==typeof r8.getRandomValues)return r8.getRandomValues(new Uint8Array(e));if(r8&&"function"==typeof r8.randomBytes)return Uint8Array.from(r8.randomBytes(e));throw Error("crypto.getRandomValues must be defined")}let iv=BigInt(0),iE=BigInt(1),iB=BigInt(2),iA=BigInt(7),iI=BigInt(256),iO=BigInt(113),iS=[],iC=[],iU=[];for(let e=0,t=iE,r=1,i=0;e<24;e++){[r,i]=[i,(2*r+3*i)%5],iS.push(2*(5*i+r)),iC.push((e+1)*(e+2)/2%64);let n=iv;for(let e=0;e<7;e++)(t=(t<<iE^(t>>iA)*iO)%iI)&iB&&(n^=iE<<(iE<<BigInt(e))-iE);iU.push(n)}let iP=rV(iU,!0),iN=iP[0],iR=iP[1],ik=(e,t,r)=>r>32?t<<r-32|e>>>64-r:e<<r|t>>>32-r,ij=(e,t,r)=>r>32?e<<r-32|t>>>64-r:t<<r|e>>>32-r;class iL extends ix{constructor(e,t,r,i=!1,n=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=i,this.rounds=n,r6(r),!(0<e&&e<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=ie(this.state)}clone(){return this._cloneInto()}keccak(){il(this.state32),function(e,t=24){let r=new Uint32Array(10);for(let i=24-t;i<24;i++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let i=(t+8)%10,n=(t+2)%10,o=r[n],s=r[n+1],f=ik(o,s,1)^r[i],a=ij(o,s,1)^r[i+1];for(let r=0;r<50;r+=10)e[t+r]^=f,e[t+r+1]^=a}let t=e[2],n=e[3];for(let r=0;r<24;r++){let i=iC[r],o=ik(t,n,i),s=ij(t,n,i),f=iS[r];t=e[f],n=e[f+1],e[f]=o,e[f+1]=s}for(let t=0;t<50;t+=10){for(let i=0;i<10;i++)r[i]=e[t+i];for(let i=0;i<10;i++)e[t+i]^=~r[(i+2)%10]&r[(i+4)%10]}e[0]^=iN[i],e[1]^=iR[i]}it(r)}(this.state32,this.rounds),il(this.state32),this.posOut=0,this.pos=0}update(e){r7(this),r5(e=ig(e));let{blockLen:t,state:r}=this,i=e.length;for(let n=0;n<i;){let o=Math.min(t-this.pos,i-n);for(let t=0;t<o;t++)r[this.pos++]^=e[n++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:r,blockLen:i}=this;e[r]^=t,(128&t)!=0&&r===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){r7(this,!1),r5(e),this.finish();let t=this.state,{blockLen:r}=this;for(let i=0,n=e.length;i<n;){this.posOut>=r&&this.keccak();let o=Math.min(r-this.posOut,n-i);e.set(t.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return r6(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(r9(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,it(this.state)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:i,rounds:n,enableXOF:o}=this;return e||(e=new iL(t,r,i,o,n)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=n,e.suffix=r,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}im(()=>new iL(136,1,32));
2class i_ extends ix{constructor(e,t,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(e),this.view=ir(this.buffer)}update(e){r7(this),r5(e=ig(e));let{view:t,buffer:r,blockLen:i}=this,n=e.length;for(let o=0;o<n;){let s=Math.min(i-this.pos,n-o);if(s===i){let t=ir(e);for(;i<=n-o;o+=i)this.process(t,o);continue}r.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===i&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){r7(this),r9(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:i,isLE:n}=this,{pos:o}=this;t[o++]=128,it(this.buffer.subarray(o)),this.padOffset>i-o&&(this.process(r,0),o=0);for(let e=o;e<i;e++)t[e]=0;(function(e,t,r,i){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,i);let n=BigInt(32),o=BigInt(0xffffffff),s=Number(r>>n&o),f=Number(r&o),a=4*!!i,l=4*!i;e.setUint32(t+a,s,i),e.setUint32(t+l,f,i)})(r,i-8,BigInt(8*this.length),n),this.process(r,0);let s=ir(e),f=this.outputLen;if(f%4)throw Error("_sha2: outputLen should be aligned to 32bit");let a=f/4,l=this.get();if(a>l.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<a;e++)s.setUint32(4*e,l[e],n)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:i,finished:n,destroyed:o,pos:s}=this;return e.destroyed=o,e.finished=n,e.length=i,e.pos=s,i%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}let iz=Uint32Array.from([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),iH=Uint32Array.from([0xcbbb9d5d,0xc1059ed8,0x629a292a,0x367cd507,0x9159015a,0x3070dd17,0x152fecd8,0xf70e5939,0x67332667,0xffc00b31,0x8eb44a87,0x68581511,0xdb0c2e0d,0x64f98fa7,0x47b5481d,0xbefa4fa4]),iT=Uint32Array.from([0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179]),iF=Uint32Array.from([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),iq=new Uint32Array(64);class iD extends i_{constructor(e=32){super(64,e,8,!1),this.A=0|iz[0],this.B=0|iz[1],this.C=0|iz[2],this.D=0|iz[3],this.E=0|iz[4],this.F=0|iz[5],this.G=0|iz[6],this.H=0|iz[7]}get(){let{A:e,B:t,C:r,D:i,E:n,F:o,G:s,H:f}=this;return[e,t,r,i,n,o,s,f]}set(e,t,r,i,n,o,s,f){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|i,this.E=0|n,this.F=0|o,this.G=0|s,this.H=0|f}process(e,t){for(let r=0;r<16;r++,t+=4)iq[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=iq[e-15],r=iq[e-2],i=ii(t,7)^ii(t,18)^t>>>3,n=ii(r,17)^ii(r,19)^r>>>10;iq[e]=n+iq[e-7]+i+iq[e-16]|0}let{A:r,B:i,C:n,D:o,E:s,F:f,G:a,H:l}=this;for(let e=0;e<64;e++){var c,u,h,d;let t=l+(ii(s,6)^ii(s,11)^ii(s,25))+((c=s)&f^~c&a)+iF[e]+iq[e]|0,b=(ii(r,2)^ii(r,13)^ii(r,22))+((u=r)&(h=i)^u&(d=n)^h&d)|0;l=a,a=f,f=s,s=o+t|0,o=n,n=i,i=r,r=t+b|0}r=r+this.A|0,i=i+this.B|0,n=n+this.C|0,o=o+this.D|0,s=s+this.E|0,f=f+this.F|0,a=a+this.G|0,l=l+this.H|0,this.set(r,i,n,o,s,f,a,l)}roundClean(){it(iq)}destroy(){this.set(0,0,0,0,0,0,0,0),it(this.buffer)}}let iV=rV(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b89
26f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),iM=iV[0],i$=iV[1],iZ=new Uint32Array(80),iK=new Uint32Array(80);class iY extends i_{constructor(e=64){super(128,e,16,!1),this.Ah=0|iT[0],this.Al=0|iT[1],this.Bh=0|iT[2],this.Bl=0|iT[3],this.Ch=0|iT[4],this.Cl=0|iT[5],this.Dh=0|iT[6],this.Dl=0|iT[7],this.Eh=0|iT[8],this.El=0|iT[9],this.Fh=0|iT[10],this.Fl=0|iT[11],this.Gh=0|iT[12],this.Gl=0|iT[13],this.Hh=0|iT[14],this.Hl=0|iT[15]}get(){let{Ah:e,Al:t,Bh:r,Bl:i,Ch:n,Cl:o,Dh:s,Dl:f,Eh:a,El:l,Fh:c,Fl:u,Gh:h,Gl:d,Hh:b,Hl:p}=this;return[e,t,r,i,n,o,s,f,a,l,c,u,h,d,b,p]}set(e,t,r,i,n,o,s,f,a,l,c,u,h,d,b,p){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|i,this.Ch=0|n,this.Cl=0|o,this.Dh=0|s,this.Dl=0|f,this.Eh=0|a,this.El=0|l,this.Fh=0|c,this.Fl=0|u,this.Gh=0|h,this.Gl=0|d,this.Hh=0|b,this.Hl=0|p}process(e,t){for(let r=0;r<16;r++,t+=4)iZ[r]=e.getUint32(t),iK[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|iZ[e-15],r=0|iK[e-15],i=rZ(t,r,1)^rZ(t,r,8)^rM(t,r,7),n=rK(t,r,1)^rK(t,r,8)^r$(t,r,7),o=0|iZ[e-2],s=0|iK[e-2],f=rZ(o,s,19)^rY(o,s,61)^rM(o,s,6),a=rQ(n,rK(o,s,19)^rW(o,s,61)^r$(o,s,6),iK[e-7],iK[e-16]),l=r0(a,i,f,iZ[e-7],iZ[e-16]);iZ[e]=0|l,iK[e]=0|a}let{Ah:r,Al:i,Bh:n,Bl:o,Ch:s,Cl:f,Dh:a,Dl:l,Eh:c,El:u,Fh:h,Fl:d,Gh:b,Gl:p,Hh:g,Hl:y}=this;for(let e=0;e<80;e++){let t=rZ(c,u,14)^rZ(c,u,18)^rY(c,u,41),x=rK(c,u,14)^rK(c,u,18)^rW(c,u,41),m=c&h^~c&b,w=r1(y,x,u&d^~u&p,i$[e],iK[e]),v=r2(w,g,t,m,iM[e],iZ[e]),E=0|w,B=rZ(r,i,28)^rY(r,i,34)^rY(r,i,39),A=rK(r,i,28)^rW(r,i,34)^rW(r,i,39),I=r&n^r&s^n&s,O=i&o^i&f^o&f;g=0|b,y=0|p,b=0|h,p=0|d,h=0|c,d=0|u,({h:c,l:u}=rX(0|a,0|l,0|v,0|E)),a=0|s,l=0|f,s=0|n,f=0|o,n=0|r,o=0|i;let S=rG(E,A,O);r=rJ(S,v,B,I),i=0|S}({h:r,l:i}=rX(0|this.Ah,0|this.Al,0|r,0|i)),({h:n,l:o}=rX(0|this.Bh,0|this.Bl,0|n,0|o)),({h:s,l:f}=rX(0|this.Ch,0|this.Cl,0|s,0|f)),({h:a,l:l}=rX(0|this.Dh,0|this.Dl,0|a,0|l)),({h:c,l:u}=rX(0|this.Eh,0|this.El,0|c,0|u)),({h,l:d}=rX(0|this.Fh,0|this.Fl,0|h,0|d)),({h:b,l:p}=rX(0|this.Gh,0|this.Gl,0|b,0|p)),({h:g,l:y}=rX(0|this.Hh,0|this.Hl,0|g,0|y)),this.set(r,i,n,o,s,f,a,l,c,u,h,d,b,p,g,y)}roundClean(){it(iZ,iK)}destroy(){it(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class iW extends iY{constructor(){super(48),this.Ah=0|iH[0],this.Al=0|iH[1],this.Bh=0|iH[2],this.Bl=0|iH[3],this.Ch=0|iH[4],this.Cl=0|iH[5],this.Dh=0|iH[6],this.Dl=0|iH[7],this.Eh=0|iH[8],this.El=0|iH[9],this.Fh=0|iH[10],this.Fl=0|iH[11],this.Gh=0|iH[12],this.Gl=0|iH[13],this.Hh=0|iH[14],this.Hl=0|iH[15]}}let iX=Uint32Array.from([0x22312194,0xfc2bf72c,0x9f555fa3,0xc84c64c2,0x2393b86b,0x6f53b151,0x96387719,0x5940eabd,0x96283ee2,0xa88effe3,0xbe5e1e25,0x53863992,0x2b0199fc,0x2c85b8aa,0xeb72ddc,0x81c52ca2]);class iG extends iY{constructor(){super(32),this.Ah=0|iX[0],this.Al=0|iX[1],this.Bh=0|iX[2],this.Bl=0|iX[3],this.Ch=0|iX[4],this.Cl=0|iX[5
2],this.Dh=0|iX[6],this.Dl=0|iX[7],this.Eh=0|iX[8],this.El=0|iX[9],this.Fh=0|iX[10],this.Fl=0|iX[11],this.Gh=0|iX[12],this.Gl=0|iX[13],this.Hh=0|iX[14],this.Hl=0|iX[15]}}let iJ=im(()=>new iD),iQ=im(()=>new iY),i0=im(()=>new iW),i1=(im(()=>new iG),Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9])),i2=Uint32Array.from([0xf3bcc908,0x6a09e667,0x84caa73b,0xbb67ae85,0xfe94f82b,0x3c6ef372,0x5f1d36f1,0xa54ff53a,0xade682d1,0x510e527f,0x2b3e6c1f,0x9b05688c,0xfb41bd6b,0x1f83d9ab,0x137e2179,0x5be0cd19]),i8=new Uint32Array(32);function i3(e,t,r,i,n,o){let s=n[o],f=n[o+1],a=i8[2*e],l=i8[2*e+1],c=i8[2*t],u=i8[2*t+1],h=i8[2*r],d=i8[2*r+1],b=i8[2*i],p=i8[2*i+1],g=rG(a,c,s);l=rJ(g,l,u,f),a=0|g,({Dh:p,Dl:b}={Dh:p^l,Dl:b^a}),({Dh:p,Dl:b}={Dh:b,Dl:p}),({h:d,l:h}=rX(d,h,p,b)),({Bh:u,Bl:c}={Bh:u^d,Bl:c^h}),({Bh:u,Bl:c}={Bh:rZ(u,c,24),Bl:rK(u,c,24)}),i8[2*e]=a,i8[2*e+1]=l,i8[2*t]=c,i8[2*t+1]=u,i8[2*r]=h,i8[2*r+1]=d,i8[2*i]=b,i8[2*i+1]=p}function i6(e,t,r,i,n,o){let s=n[o],f=n[o+1],a=i8[2*e],l=i8[2*e+1],c=i8[2*t],u=i8[2*t+1],h=i8[2*r],d=i8[2*r+1],b=i8[2*i],p=i8[2*i+1],g=rG(a,c,s);l=rJ(g,l,u,f),a=0|g,({Dh:p,Dl:b}={Dh:p^l,Dl:b^a}),({Dh:p,Dl:b}={Dh:rZ(p,b,16),Dl:rK(p,b,16)}),({h:d,l:h}=rX(d,h,p,b)),({Bh:u,Bl:c}={Bh:u^d,Bl:c^h}),({Bh:u,Bl:c}={Bh:rY(u,c,63),Bl:rW(u,c,63)}),i8[2*e]=a,i8[2*e+1]=l,i8[2*t]=c,i8[2*t+1]=u,i8[2*r]=h,i8[2*r+1]=d,i8[2*i]=b,i8[2*i+1]=p}class i5 extends ix{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,r6(e),r6(t),this.blockLen=e,this.outputLen=t,this.buffer=new Uint8Array(e),this.buffer32=ie(this.buffer)}update(e){r7(this),r5(e=ig(e));let{blockLen:t,buffer:r,buffer32:i}=this,n=e.length,o=e.byteOffset,s=e.buffer;for(let f=0;f<n;){this.pos===t&&(il(i),this.compress(i,0,!1),il(i),this.pos=0);let a=Math.min(t-this.pos,n-f),l=o+f;if(a===t&&!(l%4)&&f+a<n){let e=new Uint32Array(s,l,Math.floor((n-f)/4));il(e);for(let r=0;f+t<n;r+=i.length,f+=t)this.length+=t,this.compress(e,r,!1);il(e);continue}r.set(e.subarray(f,f+a),this.pos),this.pos+=a,this.length+=a,f+=a}return this}digestInto(e){r7(this),r9(e,this);let{pos:t,buffer32:r}=this;this.finished=!0,it(this.buffer.subarray(t)),il(r),this.compress(r,0,!0),il(r);let i=ie(e);this.get().forEach((e,t)=>i[t]=ia(e))}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){let{buffer:t,length:r,finished:i,destroyed:n,outputLen:o,pos:s}=this;return e||(e=new this.constructor({dkLen:o})),e.set(...this.get()),e.buffer.set(t),e.destroyed=n,e.finished=i,e.length=r,e.pos=s,e.outputLen=o,e}clone(){return this._cloneInto()}}class i4 extends i5{constructor(e={}){const t=void 0===e.dkLen?64:e.dkLen;super(128,t),this.v0l=0|i2[0],this.v0h=0|i2[1],this.v1l=0|i2[2],this.v1h=0|i2[3],this.v2l=0|i2[4],this.v2h=0|i2[5],this.v3l=0|i2[6],this.v3h=0|i2[7],this.v4l=0|i2[8],this.v4h=0|i2[9],this.v5l=0|i2[10],this.v5h=0|i2[11],this.v6l=0|i2[12],this.v6h=0|i2[13],this.v7l=0|i2[14],this.v7h=0|i2[15],function(e,t={}){if(r6(64),e<0||e>64)throw Error("outputLen bigger than keyLen");let{key:r,salt:i,personalization:n}=t;if(void 0!==r&&(r.length<1||r.length>64))throw Error("key length must be undefined or 1..64");if(void 0!==i&&16!==i.length)throw Error("salt must be undefined or 16");if(void 0!==n&&16!==n.length)throw Error("personalization must be undefined or 16")}(t,e);let{key:r,personalization:i,salt:n}=e,o=0;if(void 0!==r&&(o=(r=ig(r)).length),this.v0l^=this.outputLen|o<<8|0x1010000,void 0!==n){const e=ie(n=ig(n));this.v4l^=ia(e[0]),this.v4h^=ia(e[1]),this.v5l^=ia(e[2]),this.v5h^=ia(e[3])}if(void 0!==i){const e=ie(i=ig(i));this.v6l^=ia(e[0]),this.v6h^=ia(e[1]),this.v7l^=ia(e[2]),this.v7h^=ia(e[3])}if(void 0!==r){const e=new Uint8Array(this.blockLen);e.set(r),this.update(e)}}
2get(){let{v0l:e,v0h:t,v1l:r,v1h:i,v2l:n,v2h:o,v3l:s,v3h:f,v4l:a,v4h:l,v5l:c,v5h:u,v6l:h,v6h:d,v7l:b,v7h:p}=this;return[e,t,r,i,n,o,s,f,a,l,c,u,h,d,b,p]}set(e,t,r,i,n,o,s,f,a,l,c,u,h,d,b,p){this.v0l=0|e,this.v0h=0|t,this.v1l=0|r,this.v1h=0|i,this.v2l=0|n,this.v2h=0|o,this.v3l=0|s,this.v3h=0|f,this.v4l=0|a,this.v4h=0|l,this.v5l=0|c,this.v5h=0|u,this.v6l=0|h,this.v6h=0|d,this.v7l=0|b,this.v7h=0|p}compress(e,t,r){this.get().forEach((e,t)=>i8[t]=e),i8.set(i2,16);let{h:i,l:n}=rD(BigInt(this.length));i8[24]=i2[8]^n,i8[25]=i2[9]^i,r&&(i8[28]=~i8[28],i8[29]=~i8[29]);let o=0;for(let r=0;r<12;r++)i3(0,4,8,12,e,t+2*i1[o++]),i6(0,4,8,12,e,t+2*i1[o++]),i3(1,5,9,13,e,t+2*i1[o++]),i6(1,5,9,13,e,t+2*i1[o++]),i3(2,6,10,14,e,t+2*i1[o++]),i6(2,6,10,14,e,t+2*i1[o++]),i3(3,7,11,15,e,t+2*i1[o++]),i6(3,7,11,15,e,t+2*i1[o++]),i3(0,5,10,15,e,t+2*i1[o++]),i6(0,5,10,15,e,t+2*i1[o++]),i3(1,6,11,12,e,t+2*i1[o++]),i6(1,6,11,12,e,t+2*i1[o++]),i3(2,7,8,13,e,t+2*i1[o++]),i6(2,7,8,13,e,t+2*i1[o++]),i3(3,4,9,14,e,t+2*i1[o++]),i6(3,4,9,14,e,t+2*i1[o++]);this.v0l^=i8[0]^i8[16],this.v0h^=i8[1]^i8[17],this.v1l^=i8[2]^i8[18],this.v1h^=i8[3]^i8[19],this.v2l^=i8[4]^i8[20],this.v2h^=i8[5]^i8[21],this.v3l^=i8[6]^i8[22],this.v3h^=i8[7]^i8[23],this.v4l^=i8[8]^i8[24],this.v4h^=i8[9]^i8[25],this.v5l^=i8[10]^i8[26],this.v5h^=i8[11]^i8[27],this.v6l^=i8[12]^i8[28],this.v6h^=i8[13]^i8[29],this.v7l^=i8[14]^i8[30],this.v7h^=i8[15]^i8[31],it(i8)}destroy(){this.destroyed=!0,it(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}function i7(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function i9(e){if("boolean"!=typeof e)throw Error(`boolean expected, not ${e}`)}function ne(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function nt(e,...t){if(!i7(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function nr(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function ni(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function nn(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}u=e=>new i4(e),(i=(e,t)=>u(t).update(ig(e)).digest()).outputLen=(n=u({})).outputLen,i.blockLen=n.blockLen,i.create=e=>u(e),Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;let no=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0];function ns(e){if("string"==typeof e)e=function(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}(e);else if(i7(e))e=nl(e);else throw Error("Uint8Array expected, got "+typeof e);return e}function nf(e,t,r=!0){if(void 0===t)return new Uint8Array(e);if(t.length!==e)throw Error("invalid output length, expected "+e+", got: "+t.length);if(r&&t.byteOffset%4!=0)throw Error("invalid output, must be aligned");return t}function na(e,t,r,i){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,i);let n=BigInt(32),o=BigInt(0xffffffff),s=Number(r>>n&o),f=Number(r&o),a=4*!!i,l=4*!i;e.setUint32(t+a,s,i),e.setUint32(t+l,f,i)}function nl(e){return Uint8Array.from(e)}let nc=e=>Uint8Array.from(e.split("").map(e=>e.charCodeAt(0))),nu=nc("expand 16-byte k"),nh=nc("expand 32-byte k"),nd=ni(nu),nb=ni(nh);function np(e,t){return e<<t|e>>>32-t}function ng(e){return e.byteOffset%4==0}let ny=0x100000000-1,nx=new Uint32Array,nm=(e,t)=>255&e[t++]|(255&e[t++])<<8;class nw{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,nt(e=ns(e),32);const t=nm(e,0),r=nm(e,2),i=nm(e,4),n=nm(e,6),o=nm(e,8),s=nm(e,10),f=nm(e,12),a=nm(e,14);this.r[0]=8191&t,this.r[1]=(t>>>13|r<<3)&8191,this.r[2]=(r>>>10|i<<6)&7939,this.r[3]=(i>>>7|n<<9)&8191,this.r[4]=(n>>>4|o<<12)&255,this.r[5]=o>>>1&8190,this.r[6]=(o>>>14|s<<2)&8191,this.r[7]=(s>>>11|f<<5)&8065,this.r[8]=(f>>>8|a<<8)&8191,this.r[9]=a>>>5&127;for(let t=0;t<8;t++)this.pad[t]=nm(e,16+2*t)}process(e,t,r=!1){let{h:i,r:n}
2=this,o=n[0],s=n[1],f=n[2],a=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],b=n[9],p=nm(e,t+0),g=nm(e,t+2),y=nm(e,t+4),x=nm(e,t+6),m=nm(e,t+8),w=nm(e,t+10),v=nm(e,t+12),E=nm(e,t+14),B=i[0]+(8191&p),A=i[1]+((p>>>13|g<<3)&8191),I=i[2]+((g>>>10|y<<6)&8191),O=i[3]+((y>>>7|x<<9)&8191),S=i[4]+((x>>>4|m<<12)&8191),C=i[5]+(m>>>1&8191),U=i[6]+((m>>>14|w<<2)&8191),P=i[7]+((w>>>11|v<<5)&8191),N=i[8]+((v>>>8|E<<8)&8191),R=i[9]+(E>>>5|2048*!r),k=0,j=0+B*o+5*b*A+5*d*I+5*h*O+5*u*S;k=j>>>13,j&=8191,j+=5*c*C+5*l*U+5*a*P+5*f*N+5*s*R,k+=j>>>13,j&=8191;let L=k+B*s+A*o+5*b*I+5*d*O+5*h*S;k=L>>>13,L&=8191,L+=5*u*C+5*c*U+5*l*P+5*a*N+5*f*R,k+=L>>>13,L&=8191;let _=k+B*f+A*s+I*o+5*b*O+5*d*S;k=_>>>13,_&=8191,_+=5*h*C+5*u*U+5*c*P+5*l*N+5*a*R,k+=_>>>13,_&=8191;let z=k+B*a+A*f+I*s+O*o+5*b*S;k=z>>>13,z&=8191,z+=5*d*C+5*h*U+5*u*P+5*c*N+5*l*R,k+=z>>>13,z&=8191;let H=k+B*l+A*a+I*f+O*s+S*o;k=H>>>13,H&=8191,H+=5*b*C+5*d*U+5*h*P+5*u*N+5*c*R,k+=H>>>13,H&=8191;let T=k+B*c+A*l+I*a+O*f+S*s;k=T>>>13,T&=8191,T+=C*o+5*b*U+5*d*P+5*h*N+5*u*R,k+=T>>>13,T&=8191;let F=k+B*u+A*c+I*l+O*a+S*f;k=F>>>13,F&=8191,F+=C*s+U*o+5*b*P+5*d*N+5*h*R,k+=F>>>13,F&=8191;let q=k+B*h+A*u+I*c+O*l+S*a;k=q>>>13,q&=8191,q+=C*f+U*s+P*o+5*b*N+5*d*R,k+=q>>>13,q&=8191;let D=k+B*d+A*h+I*u+O*c+S*l;k=D>>>13,D&=8191,D+=C*a+U*f+P*s+N*o+5*b*R,k+=D>>>13,D&=8191;let V=k+B*b+A*d+I*h+O*u+S*c;k=V>>>13,V&=8191,V+=C*l+U*a+P*f+N*s+R*o,k+=V>>>13,V&=8191,j=8191&(k=(k=(k<<2)+k|0)+j|0),k>>>=13,L+=k,i[0]=j,i[1]=L,i[2]=_,i[3]=z,i[4]=H,i[5]=T,i[6]=F,i[7]=q,i[8]=D,i[9]=V}finalize(){let{h:e,pad:t}=this,r=new Uint16Array(10),i=e[1]>>>13;e[1]&=8191;for(let t=2;t<10;t++)e[t]+=i,i=e[t]>>>13,e[t]&=8191;e[0]+=5*i,i=e[0]>>>13,e[0]&=8191,e[1]+=i,i=e[1]>>>13,e[1]&=8191,e[2]+=i,r[0]=e[0]+5,i=r[0]>>>13,r[0]&=8191;for(let t=1;t<10;t++)r[t]=e[t]+i,i=r[t]>>>13,r[t]&=8191;r[9]-=8192;let n=(1^i)-1;for(let e=0;e<10;e++)r[e]&=n;n=~n;for(let t=0;t<10;t++)e[t]=e[t]&n|r[t];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let o=e[0]+t[0];e[0]=65535&o;for(let r=1;r<8;r++)o=(e[r]+t[r]|0)+(o>>>16)|0,e[r]=65535&o;nn(r)}update(e){nr(this),nt(e=ns(e));let{buffer:t,blockLen:r}=this,i=e.length;for(let n=0;n<i;){let o=Math.min(r-this.pos,i-n);if(o===r){for(;r<=i-n;n+=r)this.process(e,n);continue}t.set(e.subarray(n,n+o),this.pos),this.pos+=o,n+=o,this.pos===r&&(this.process(t,0,!1),this.pos=0)}return this}destroy(){nn(this.h,this.r,this.buffer,this.pad)}digestInto(e){nr(this),function(e,t){nt(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}(e,this),this.finished=!0;let{buffer:t,h:r}=this,{pos:i}=this;if(i){for(t[i++]=1;i<16;i++)t[i]=0;this.process(t,0,!0)}this.finalize();let n=0;for(let t=0;t<8;t++)e[n++]=r[t]>>>0,e[n++]=r[t]>>>8;return e}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}}let nv=(h=e=>new nw(e),(o=(e,t)=>h(t).update(ns(e)).digest()).outputLen=(s=h(new Uint8Array(32))).outputLen,o.blockLen=s.blockLen,o.create=e=>h(e),o),nE=function(e,t){let{allowShortKeys:r,extendNonceFn:i,counterLength:n,counterRight:o,rounds:s}=function(e,t){if(null==t||"object"!=typeof t)throw Error("options must be defined");return Object.assign(e,t)}({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if("function"!=typeof e)throw Error("core must be a function");return ne(n),ne(s),i9(o),i9(r),(t,f,a,l,c=0)=>{nt(t),nt(f),nt(a);let u=a.length;if(void 0===l&&(l=new Uint8Array(u)),nt(l),ne(c),c<0||c>=ny)throw Error("arx: counter overflow");if(l.length<u)throw Error(`arx: output (${l.length}) is shorter than data (${u})`);let h=[],d=t.length,b,p;if(32===d)h.push(b=nl(t)),p=nb;else if(16===d&&r)(b=new Uint8Array(32)).set(t),b.set(t,16),p=nd,h.push(b);else throw Error(`arx: invalid 32-byte key, got length=${d}`);ng(f)||h.push(f=nl(f));let g=ni(b);if(i){if(24!==f.length)throw Error("arx: extended nonce must be 24 bytes");i(p,g,ni(f.subarray(0,16)),g),f=f.subarray(16)}let y=16-n;if(y!==f.length)throw Error(`arx: nonce must be ${y} or 16 bytes`);if(12!==y){let e=new Uint8Array(12);e.set(f,o?0:12-f.length),f=e,h.push(f)}return function(e,t,r,i,n,o,s,f){let a=n.length,l=new Uint8Array(64),c=ni(l),u=ng(n)&&ng(o),h=u?ni(n):nx,d=u?ni(o):nx;for(let b=0;b<a;s++){if(e(t,r,i,c,s,f),s>=ny)throw Error("arx: counter overflow");let p=Math.min(64,a-b);
2if(u&&64===p){let e=b/4;if(b%4!=0)throw Error("arx: invalid block position");for(let t=0,r;t<16;t++)d[r=e+t]=h[r]^c[t];b+=64;continue}for(let e=0,t;e<p;e++)o[t=b+e]=n[t]^l[e];b+=p}}(e,p,g,ni(f),a,l,c,s),nn(...h),l}}(function(e,t,r,i,n,o=20){let s=e[0],f=e[1],a=e[2],l=e[3],c=t[0],u=t[1],h=t[2],d=t[3],b=t[4],p=t[5],g=t[6],y=t[7],x=r[0],m=r[1],w=r[2],v=s,E=f,B=a,A=l,I=c,O=u,S=h,C=d,U=b,P=p,N=g,R=y,k=n,j=x,L=m,_=w;for(let e=0;e<o;e+=2)U=U+(k=np(k^(v=v+I|0),16))|0,v=v+(I=np(I^U,12))|0,U=U+(k=np(k^v,8))|0,I=np(I^U,7),P=P+(j=np(j^(E=E+O|0),16))|0,E=E+(O=np(O^P,12))|0,P=P+(j=np(j^E,8))|0,O=np(O^P,7),N=N+(L=np(L^(B=B+S|0),16))|0,B=B+(S=np(S^N,12))|0,N=N+(L=np(L^B,8))|0,S=np(S^N,7),R=R+(_=np(_^(A=A+C|0),16))|0,A=A+(C=np(C^R,12))|0,R=R+(_=np(_^A,8))|0,C=np(C^R,7),N=N+(_=np(_^(v=v+O|0),16))|0,v=v+(O=np(O^N,12))|0,N=N+(_=np(_^v,8))|0,O=np(O^N,7),R=R+(k=np(k^(E=E+S|0),16))|0,E=E+(S=np(S^R,12))|0,R=R+(k=np(k^E,8))|0,S=np(S^R,7),U=U+(j=np(j^(B=B+C|0),16))|0,B=B+(C=np(C^U,12))|0,U=U+(j=np(j^B,8))|0,C=np(C^U,7),P=P+(L=np(L^(A=A+I|0),16))|0,A=A+(I=np(I^P,12))|0,P=P+(L=np(L^A,8))|0,I=np(I^P,7);let z=0;i[z++]=s+v|0,i[z++]=f+E|0,i[z++]=a+B|0,i[z++]=l+A|0,i[z++]=c+I|0,i[z++]=u+O|0,i[z++]=h+S|0,i[z++]=d+C|0,i[z++]=b+U|0,i[z++]=p+P|0,i[z++]=g+N|0,i[z++]=y+R|0,i[z++]=n+k|0,i[z++]=x+j|0,i[z++]=m+L|0,i[z++]=w+_|0},{counterRight:!1,counterLength:4,allowShortKeys:!1}),nB=new Uint8Array(16),nA=(e,t)=>{e.update(t);let r=t.length%16;r&&e.update(nB.subarray(r))},nI=new Uint8Array(32);function nO(e,t,r,i,n){var o,s;let f,a,l=e(t,r,nI),c=nv.create(l);n&&nA(c,n),nA(c,i);let u=(o=i.length,s=n?n.length:0,i9(!0),na(a=new DataView((f=new Uint8Array(16)).buffer,f.byteOffset,f.byteLength),0,BigInt(s),!0),na(a,8,BigInt(o),!0),f);c.update(u);let h=c.digest();return nn(l,u),h}a={blockSize:64,nonceLength:12,tagLength:16},l=(e,t,r)=>({encrypt(i,n){let o=i.length;(n=nf(o+16,n,!1)).set(i);let s=n.subarray(0,-16);nE(e,t,s,s,1);let f=nO(nE,e,t,s,r);return n.set(f,o),nn(f),n},decrypt(i,n){n=nf(i.length-16,n,!1);let o=i.subarray(0,-16),s=i.subarray(-16),f=nO(nE,e,t,o,r);if(!function(e,t){if(e.length!==t.length)return!1;let r=0;for(let i=0;i<e.length;i++)r|=e[i]^t[i];return 0===r}(s,f))throw Error("invalid tag");return n.set(i.subarray(0,-16)),nE(e,t,n,n,1),nn(f),n}}),Object.assign(function(e,...t){if(nt(e),!no)throw Error("Non little-endian hardware is not yet supported");if(void 0!==a.nonceLength){let e=t[0];if(!e)throw Error("nonce / iv required");a.varSizeNonce?nt(e):nt(e,a.nonceLength)}let r=a.tagLength;r&&void 0!==t[1]&&nt(t[1]);let i=l(e,...t),n=(e,t)=>{if(void 0!==t){if(2!==e)throw Error("cipher output not supported");nt(t)}},o=!1;return{encrypt(e,t){if(o)throw Error("cannot encrypt() twice with same key + nonce");return o=!0,nt(e),n(i.encrypt.length,t),i.encrypt(e,t)},decrypt(e,t){if(nt(e),r&&e.length<r)throw Error("invalid ciphertext length: smaller than tagLength="+r);return n(i.decrypt.length,t),i.decrypt(e,t)}}},a);class nS extends ix{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,r4(e);const r=ig(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,n=new Uint8Array(i);n.set(r.length>i?e.create().update(r).digest():r);for(let e=0;e<n.length;e++)n[e]^=54;this.iHash.update(n),this.oHash=e.create();for(let e=0;e<n.length;e++)n[e]^=106;this.oHash.update(n),it(n)}update(e){return r7(this),this.iHash.update(e),this}digestInto(e){r7(this),r5(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:r,finished:i,destroyed:n,blockLen:o,outputLen:s}=this;return e.finished=i,e.destroyed=n,e.blockLen=o,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let nC=(e,t,r)=>new nS(e,t).update(r).digest();nC.create=(e,t)=>
vendor: 7,857 bytes, line 2
2new nS(e,t),Uint8Array.from([0]),Uint8Array.of();let nU=BigInt(0),nP=BigInt(1);function nN(e,t=""){if("boolean"!=typeof e)throw Error((t&&`"${t}"`)+"expected boolean, got type="+typeof e);return e}function nR(e,t,r=""){let i=r3(e),n=e?.length,o=void 0!==t;if(!i||o&&n!==t)throw Error((r&&`"${r}" `)+"expected Uint8Array"+(o?` of length ${t}`:"")+", got "+(i?`length=${n}`:`type=${typeof e}`));return e}function nk(e){let t=e.toString(16);return 1&t.length?"0"+t:t}function nj(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?nU:BigInt("0x"+e)}function nL(e){return r5(e),nj(ih(Uint8Array.from(e).reverse()))}function n_(e,t){return ib(e.toString(16).padStart(2*t,"0"))}function nz(e,t){return n_(e,t).reverse()}function nH(e,t,r){let i;if("string"==typeof t)try{i=ib(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if(r3(t))i=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let n=i.length;if("number"==typeof r&&n!==r)throw Error(e+" of length "+r+" expected, got "+n);return i}let nT=e=>"bigint"==typeof e&&nU<=e;function nF(e,t,r,i){if(!(nT(t)&&nT(r)&&nT(i))||!(r<=t)||!(t<i))throw Error("expected valid "+e+": "+r+" <= n < "+i+", got "+t)}function nq(e){let t;for(t=0;e>nU;e>>=nP,t+=1);return t}let nD=e=>(nP<<BigInt(e))-nP;function nV(e,t,r={}){if(!e||"object"!=typeof e)throw Error("expected valid options object");function i(t,r,i){let n=e[t];if(i&&void 0===n)return;let o=typeof n;if(o!==r||null===n)throw Error(`param "${t}" is invalid: expected ${r}, got ${o}`)}Object.entries(t).forEach(([e,t])=>i(e,t,!1)),Object.entries(r).forEach(([e,t])=>i(e,t,!0))}function nM(e){let t=new WeakMap;return(r,...i)=>{let n=t.get(r);if(void 0!==n)return n;let o=e(r,...i);return t.set(r,o),o}}let n$=BigInt(0),nZ=BigInt(1),nK=BigInt(2),nY=BigInt(3),nW=BigInt(4),nX=BigInt(5),nG=BigInt(7),nJ=BigInt(8),nQ=BigInt(9),n0=BigInt(16);function n1(e,t){let r=e%t;return r>=n$?r:t+r}function n2(e,t,r){let i=e;for(;t-- >n$;)i*=i,i%=r;return i}function n8(e,t){if(e===n$)throw Error("invert: expected non-zero number");if(t<=n$)throw Error("invert: expected positive modulus, got "+t);let r=n1(e,t),i=t,n=n$,o=nZ;for(;r!==n$;){let e=i/r,t=i%r,s=n-o*e;i=r,r=t,n=o,o=s}if(i!==nZ)throw Error("invert: does not exist");return n1(n,t)}function n3(e,t,r){if(!e.eql(e.sqr(t),r))throw Error("Cannot find square root")}function n6(e,t){let r=(e.ORDER+nZ)/nW,i=e.pow(t,r);return n3(e,i,t),i}function n5(e,t){let r=(e.ORDER-nX)/nJ,i=e.mul(t,nK),n=e.pow(i,r),o=e.mul(t,n),s=e.mul(e.mul(o,nK),n),f=e.mul(o,e.sub(s,e.ONE));return n3(e,f,t),f}function n4(e){if(e<nY)throw Error("sqrt is not defined for small field");let t=e-nZ,r=0;for(;t%nK===n$;)t/=nK,r++;let i=nK,n=or(e);for(;1===oe(n,i);)if(i++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===r)return n6;let o=n.pow(i,t),s=(t+nZ)/nK;return function(e,i){if(e.is0(i))return i;if(1!==oe(e,i))throw Error("Cannot find square root");let n=r,f=e.mul(e.ONE,o),a=e.pow(i,t),l=e.pow(i,s);for(;!e.eql(a,e.ONE);){if(e.is0(a))return e.ZERO;let t=1,r=e.sqr(a);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===n)throw Error("Cannot find square root");let i=nZ<<BigInt(n-t-1),o=e.pow(f,i);n=t,f=e.sqr(o),a=e.mul(a,f),l=e.mul(l,o)}return l}}let n7=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function n9(e,t,r=!1){let i=Array(t.length).fill(r?e.ZERO:void 0),n=t.reduce((t,r,n)=>e.is0(r)?t:(i[n]=t,e.mul(t,r)),e.ONE),o=e.inv(n);return t.reduceRight((t,r,n)=>e.is0(r)?t:(i[n]=e.mul(t,i[n]),e.mul(t,r)),o),i}function oe(e,t){let r=(e.ORDER-nZ)/nK,i=e.pow(t,r),n=e.eql(i,e.ONE),o=e.eql(i,e.ZERO),s=e.eql(i,e.neg(e.ONE));if(!n&&!o&&!s)throw Error("invalid Legendre symbol result");return n?1:o?0:-1}function ot(e,t){void 0!==t&&r6(t);let r=void 0!==t?t:e.toString(2).length,i=Math.ceil(r/8);return{nBitLength:r,nByteLength:i}}function or(e,t,r=!1,i={}){let n;if(e<=n$)throw Error("invalid field: expected ORDER > 0, got "+e);let o,s,f=!1,a;if("object"==typeof t&&null!=t){if(i.sqrt||r)throw Error("cannot specify opts in two arguments");t.BITS&&(o=t.BITS),t.sqrt&&(s=t.sqrt),"boolean"==typeof t.isLE&&(r=t.isLE),"boolean"==typeof t.modFromBytes&&(f=t.modFromBytes),a=t.allowedLengths}else"number"==typeof t&&(o=t),i.sqrt&&(s=i.sqrt);let{nBitLength:l,nByteLength:c}=ot(e,o);if(c>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let u=Object.freeze({ORDER:e,isLE:r,BITS:l,BYTES:c,MASK:nD(l),ZERO:n$,ONE:nZ,allowedLengths:a,create:t=>n1(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("invalid field element: expected bigint, got "+typeof t);return n$<=t&&t<e},is0:e=>e===n$,isValidNot0:e=>!u.is0(e)&&u.isValid(e),isOdd:e=>(e&nZ)===nZ,neg:t=>n1(-t,e),eql:(e,t)=>e===t,sqr:t=>n1(t*t,e),add:(t,r)=>n1(t+r,e),sub:(t,r)=>n1(t-r,e),mul:(t,r)=>n1(t*r,e),pow:(e,t)=>(function(e,t,r){if(r<n$)throw Error("invalid exponent, negatives unsupported");if(r===n$)return e.ONE;if(r===nZ)return t;let i=e.ONE,n=t;for(;r>n$;)r&nZ&&(i=e.mul(i,n)),n=e.sqr(n),r>>=nZ;return i})(u,e,t),div:(t,r)=>n1(t*n8(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>n8(t,e),sqrt:s||(t=>{let r,i,o,s,f,a;return n||(n=e%nW===nY?n6:e%nJ===nX?n5:e%n0===nQ?(r=or(e),o=(i=n4(e))(r,r.neg(r.ONE)),s=i(r,o),f=i(r,r.neg(o)),a=(e+nG)/n0,(e,t)=>{let r=e.pow(t,a),i=e.mul(r,o),n=e.mul(r,s),l=e.mul(r,f),c=e.eql(e.sqr(i),t),u=e.eql(e.sqr(n),t);r=e.cmov(r,i,c),i=e.cmov(l,n,u);let h=e.eql(e.sqr(i),t),d=e.cmov(r,i,h);return n3(e,d,t),d}):n4(e)),n(u,t)}),toBytes:e=>r?nz(e,c):n_(e,c),fromBytes:(t,i=!0)=>{if(a){if(!a.includes(t.length)||t.length>c)throw Error("Field.fromBytes: expected "+a+" bytes, got "+t.length);let e=new Uint8Array(c);e.set(t,r?0:e.length-t.length),t=e}if(t.length!==c)throw Error("Field.fromBytes: expected "+c+" bytes, got "+t.length);let n=r?nL(t):nj(ih(t));if(f&&(n=n1(n,e)),!i&&!u.isValid(n))throw Error("invalid field element: outside of range 0..ORDER");return n},invertBatch:e=>n9(u,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(u)}function oi(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function on(e){let t=oi(e);return t+Math.ceil(t/2)}let oo=BigInt(0),os=BigInt(1);function of(e,t){let r=t.negate();return e?r:t}function oa(e,t){let r=n9(e.Fp,t.map(e=>e.Z));return t.map((t,i)=>e.fromAffine(t.toAffine(r[i])))}function ol(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function oc(e,t){ol(e,t);let r=Math.ceil(t/e)+1,i=2**(e-1),n=2**e;return{windows:r,windowSize:i,mask:nD(e),maxNumber:n,shiftBy:BigInt(e)}}function ou(e,t,r){let{windowSize:i,mask:n,maxNumber:o,shiftBy:s}=r,f=Number(e&n),a=e>>s;f>i&&(f-=o,a+=os);let l=t*i;return{nextN:a,offset:l+Math.abs(f)-1,isZero:0===f,isNeg:f<0,isNegF:t%2!=0,offsetF:l}}let oh=new WeakMap,od=new WeakMap;function ob(e){return od.get(e)||1}function op(e){if(e!==oo)throw Error("invalid wNAF")}class og{constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,r=this.ZERO){let i=e;for(;t>oo;)t&os&&(r=r.add(i)),i=i.double(),t>>=os;return r}precomputeWindow(e,t){let{windows:r,windowSize:i}=oc(t,this.bits),n=[],o=e,s=o;for(let e=0;e<r;e++){s=o,n.push(s);for(let e=1;e<i;e++)s=s.add(o),n.push(s);o=s.double()}return n}wNAF(e,t,r){if(!this.Fn.isValid(r))throw Error("invalid scalar");let i=this.ZERO,n=this.BASE,o=oc(e,this.bits);for(let e=0;e<o.windows;e++){let{nextN:s,offset:f,isZero:a,isNeg:l,isNegF:c,offsetF:u}=ou(r,e,o);r=s,a?n=n.add(of(c,t[u])):i=i.add(of(l,t[f]))}return op(r),{p:i,f:n}}wNAFUnsafe(e,t,r,i=this.ZERO){let n=oc(e,this.bits);for(let e=0;e<n.windows&&r!==oo;e++){let{nextN:o,offset:s,isZero:f,isNeg:a}=ou(r,e,n);if(r=o,!f){let e=t[s];i=i.add(a?e.negate():e)}}return op(r),i}getPrecomputes(e,t,r){let i=oh.get(t);
2return i||(i=this.precomputeWindow(t,e),1!==e&&("function"==typeof r&&(i=r(i)),oh.set(t,i))),i}cached(e,t,r){let i=ob(e);return this.wNAF(i,this.getPrecomputes(i,e,r),t)}unsafe(e,t,r,i){let n=ob(e);return 1===n?this._unsafeLadder(e,t,i):this.wNAFUnsafe(n,this.getPrecomputes(n,e,r),t,i)}createCache(e,t){ol(t,this.bits),od.set(e,t),oh.delete(e)}hasCache(e){return 1!==ob(e)}}function oy(e,t,r){if(!t)return or(e,{isLE:r});if(t.ORDER!==e)throw Error("Field.ORDER must match order: Fp == p, Fn == n");return nV(t,n7.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"})),t}BigInt(0),BigInt(1),BigInt(2),BigInt(8),ip("HashToScalar-");let ox=BigInt(0),om=BigInt(1),ow=BigInt(2),ov=BigInt(1),oE=BigInt(2),oB=BigInt(3),oA=BigInt(5),oI=BigInt(8),oO=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),oS={p:oO,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:oI,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")},oC=(function(e){let{P:t,type:r,adjustScalarBytes:i,powPminus2:n,randomBytes:o}=(nV(e,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...e})),s="x25519"===r;if(!s&&"x448"!==r)throw Error("invalid type");let f=s?32:56,a=BigInt(s?9:5),l=BigInt(s?121665:39081),c=s?ow**BigInt(254):ow**BigInt(447),u=c+(s?BigInt(8)*ow**BigInt(251)-om:BigInt(4)*ow**BigInt(445)-om)+om,h=e=>n1(e,t),d=nz(h(a),f);d.slice()}({P:f=or(oS.p,{isLE:!0}).ORDER,type:"x25519",powPminus2:e=>{let t,r,i,n,o,s,a,l,c,u,h,d,b,p,{pow_p_5_8:g,b2:y}=(t=BigInt(10),r=BigInt(20),i=BigInt(40),n=BigInt(80),s=n2(o=e*e%oO*e%oO,oE,oO)*o%oO,a=n2(s,ov,oO)*e%oO,l=n2(a,oA,oO)*a%oO,c=n2(l,t,oO)*l%oO,u=n2(c,r,oO)*c%oO,h=n2(u,i,oO)*u%oO,d=n2(h,n,oO)*h%oO,b=n2(d,n,oO)*h%oO,p=n2(b,t,oO)*l%oO,{pow_p_5_8:n2(p,oE,oO)*e%oO,b2:o});return n1(n2(g,oB,f)*y,f)},adjustScalarBytes:function(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}}),(e,t)=>(e+(e>=0?t:-t)/oj)/t);function oU(e){if(!["compact","recovered","der"].includes(e))throw Error('Signature format must be "compact", "recovered", or "der"');return e}function oP(e,t){let r={};for(let i of Object.keys(t))r[i]=void 0===e[i]?t[i]:e[i];return nN(r.lowS,"lowS"),nN(r.prehash,"prehash"),void 0!==r.format&&oU(r.format),r}let oN={Err:class extends Error{constructor(e=""){super(e)}},_tlv:{encode:(e,t)=>{let{Err:r}=oN;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");let i=t.length/2,n=nk(i);if(n.length/2&128)throw new r("tlv.encode: long form length too big");let o=i>127?nk(n.length/2|128):"";return nk(e)+o+n+t},decode(e,t){let{Err:r}=oN,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");let n=t[i++],o=0;if(128&n){let e=127&n;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");let s=t.subarray(i,i+e);if(s.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(let e of s)o=o<<8|e;if(i+=e,o<128)throw new r("tlv.decode(long): not minimal encoding")}else o=n;let s=t.subarray(i,i+o);if(s.length!==o)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(i+o)}}},_int:{encode(e){let{Err:t}=oN;if(e<oR)throw new t("integer: negative integers are not allowed");let r=nk(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){let{Err:t}=oN;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 nj(ih(e))}},toSig(e){let{Err:t,_int:r,_tlv:i}=oN,n=nH("signature",e),{v:o,l:s}=i.decode(48,n);if(s.length)throw new t("invalid signature: left bytes after parsing");let{v:f,l:a}=i.decode(2,o),{v:l,l:c}=i.decode(2,a);if(c.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(f),s:r.decode(l)}},hexFromSig(e){let{_tlv:t,_int:r}=oN,i=t.encode(2,r.encode(e.r)),n=t.encode(2,r.encode(e.s));return t.encode(48,i+n)}},oR=BigInt(0),ok=BigInt(1),oj=BigInt(2),oL=BigInt(3),o_=BigInt(4);function oz(e,t){let r,{BYTES:i}=e;if("bigint"==typeof t)r=t;else{let n=nH("private key",t);try{r=e.fromBytes(n)}catch{throw Error(`invalid private key: expected ui8a of size ${i}, got ${typeof t}`)}}if(!e.isValidNot0(r))throw Error("invalid private key: out of range [1..N-1]");return r}function oH(e){return Uint8Array.of(e?2:3)}function oT(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function oF(e,t){let r=t=>(function(e){let t,{CURVE:r,curveOpts:i,hash:n,ecdsaOpts:o}=function(e){let t,r,i,n,{CURVE:o,curveOpts:s}=(t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},r=e.Fp,i=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(e=>Math.ceil(e/2)))):void 0,n={Fp:r,Fn:or(t.n,{BITS:e.nBitLength,allowedLengths:i,modFromBytes:e.wrapPrivateKey}),allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes},{CURVE:t,curveOpts:n}),f={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:o,curveOpts:s,hash:e.hash,ecdsaOpts:f}}(e),s=function(e,t,r={}){r4(t),nV(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});let i=r.randomBytes||iw,n=r.hmac||((e,...r)=>nC(t,e,iy(...r))),{Fp:o,Fn:s}=e,{ORDER:f,BITS:a}=s,{keygen:l,getPublicKey:c,getSharedSecret:u,utils:h,lengths:d}=function(e,t={}){let{Fn:r}=e,i=t.randomBytes||iw,n=Object.assign(oT(e.Fp,r),{seed:on(r.ORDER)});function o(e){try{return!!oz(r,e)}catch{return!1}}function s(e=i(n.seed)){return function(e,t,r=!1){let i=e.length,n=oi(t),o=on(t);if(i<16||i<o||i>1024)throw Error("expected "+o+"-1024 bytes of input, got "+i);let s=n1(r?nL(e):nj(ih(e)),t-nZ)+nZ;return r?nz(s,n):n_(s,n)}(nR(e,n.seed,"seed"),r.ORDER)}function f(t,i=!0){return e.BASE.multiply(oz(r,t)).toBytes(i)}function a(t){if("bigint"==typeof t)return!1;if(t instanceof e)return!0;let{secretKey:i,publicKey:o,publicKeyUncompressed:s}=n;if(r.allowedLengths||i===o)return;let f=nH("key",t).length;return f===o||f===s}return Object.freeze({getPublicKey:f,getSharedSecret:function(t,i,n=!0){if(!0===a(t))throw Error("first arg must be private key");if(!1===a(i))throw Error("second arg must be public key");let o=oz(r,t);return e.fromHex(i).multiply(o).toBytes(n)},keygen:function(e){let t=s(e);return{secretKey:t,publicKey:f(t)}},Point:e,utils:{isValidSecretKey:o,isValidPublicKey:function(t,r){let{publicKey:i,publicKeyUncompressed:o}=n;try{let n=t.length;return(!0!==r||n===i)&&(!1!==r||n===o)&&!!e.fromBytes(t)}catch{return!1}},randomSecretKey:s,isValidPrivateKey:o,randomPrivateKey:s,normPrivateKeyToScalar:e=>
vendor: 9,650 bytes, line 2
2oz(r,e),precompute:(t=8,r=e.BASE)=>r.precompute(t,!1)},lengths:n})}(e,r),b={prehash:!1,lowS:"boolean"==typeof r.lowS&&r.lowS,format:void 0,extraEntropy:!1},p="compact";function g(e,t){if(!s.isValidNot0(t))throw Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}class y{constructor(e,t,r){this.r=g("r",e),this.s=g("s",t),null!=r&&(this.recovery=r),Object.freeze(this)}static fromBytes(e,t=p){var r,i;let n,o;if(r=e,oU(i=t),o=d.signature,nR(r,"compact"===i?o:"recovered"===i?o+1:void 0,`${i} signature`),"der"===t){let{r:t,s:r}=oN.toSig(nR(e));return new y(t,r)}"recovered"===t&&(n=e[0],t="compact",e=e.subarray(1));let f=s.BYTES,a=e.subarray(0,f),l=e.subarray(f,2*f);return new y(s.fromBytes(a),s.fromBytes(l),n)}static fromHex(e,t){return this.fromBytes(ib(e),t)}addRecoveryBit(e){return new y(this.r,this.s,e)}recoverPublicKey(t){let r=o.ORDER,{r:i,s:n,recovery:a}=this;if(null==a||![0,1,2,3].includes(a))throw Error("recovery id invalid");if(f*oj<r&&a>1)throw Error("recovery id is ambiguous for h>1 curve");let l=2===a||3===a?i+f:i;if(!o.isValid(l))throw Error("recovery id 2 or 3 invalid");let c=o.toBytes(l),u=e.fromBytes(iy(oH((1&a)==0),c)),h=s.inv(l),d=m(nH("msgHash",t)),b=s.create(-d*h),p=s.create(n*h),g=e.BASE.multiplyUnsafe(b).add(u.multiplyUnsafe(p));if(g.is0())throw Error("point at infinify");return g.assertValidity(),g}hasHighS(){return this.s>f>>ok}toBytes(e=p){if(oU(e),"der"===e)return ib(oN.hexFromSig(this));let t=s.toBytes(this.r),r=s.toBytes(this.s);if("recovered"===e){if(null==this.recovery)throw Error("recovery bit must be present");return iy(Uint8Array.of(this.recovery),t,r)}return iy(t,r)}toHex(e){return ih(this.toBytes(e))}assertValidity(){}static fromCompact(e){return y.fromBytes(nH("sig",e),"compact")}static fromDER(e){return y.fromBytes(nH("sig",e),"der")}normalizeS(){return this.hasHighS()?new y(this.r,s.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return ih(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return ih(this.toBytes("compact"))}}let x=r.bits2int||function(e){if(e.length>8192)throw Error("input is too large");let t=nj(ih(e)),r=8*e.length-a;return r>0?t>>BigInt(r):t},m=r.bits2int_modN||function(e){return s.create(x(e))},w=nD(a);function v(e){return nF("num < 2^"+a,e,oR,w),s.toBytes(e)}function E(e,r){return nR(e,void 0,"message"),r?nR(t(e),void 0,"prehashed message"):e}return Object.freeze({keygen:l,getPublicKey:c,getSharedSecret:u,utils:h,lengths:d,Point:e,sign:function(r,o,a={}){let{seed:l,k2sig:c}=function(t,r,n){if(["recovered","canonical"].some(e=>e in n))throw Error("sign() legacy options not supported");let{lowS:o,prehash:a,extraEntropy:l}=oP(n,b),c=m(t=E(t,a)),u=oz(s,r),h=[v(u),v(c)];if(null!=l&&!1!==l){let e=!0===l?i(d.secretKey):l;h.push(nH("extraEntropy",e))}return{seed:iy(...h),k2sig:function(t){let r=x(t);if(!s.isValidNot0(r))return;let i=s.inv(r),n=e.BASE.multiply(r).toAffine(),a=s.create(n.x);if(a===oR)return;let l=s.create(i*s.create(c+a*u));if(l===oR)return;let h=2*(n.x!==a)|Number(n.y&ok),d=l;return o&&l>f>>ok&&(d=s.neg(l),h^=1),new y(a,d,h)}}}(r=nH("message",r),o,a);return(function(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let i=e=>new Uint8Array(e),n=i(e),o=i(e),s=0,f=()=>{n.fill(1),o.fill(0),s=0},a=(...e)=>r(o,n,...e),l=(e=i(0))=>{o=a(Uint8Array.of(0),e),n=a(),0!==e.length&&(o=a(Uint8Array.of(1),e),n=a())},c=()=>{if(s++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e<t;){let t=(n=a()).slice();r.push(t),e+=n.length}return iy(...r)};return(e,t)=>{let r;for(f(),l(e);!(r=t(c()));)l();return f(),r}})(t.outputLen,s.BYTES,n)(l,c)},verify:function(t,r,i,n={}){let{lowS:o,prehash:f,format:a}=oP(n,b);if(i=nH("publicKey",i),r=E(nH("message",r),f),"strict"in n)throw Error("options.strict was renamed to lowS");let l=void 0===a?function(e){let t,r="string"==typeof e||r3(e),i=!r&&null!==e&&"object"==typeof e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!r&&!i)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(i)t=new y(e.r,e.s);else if(r){try{t=y.fromBytes(nH("sig",e),"der")}catch(e){if(!(e instanceof oN.Err))throw e}if(!t)try{t=y.fromBytes(nH("sig",e),"compact")}catch{return!1}}return t||!1}(t):y.fromBytes(nH("sig",t),a);if(!1===l)return!1;try{let t=e.fromBytes(i);if(o&&l.hasHighS())return!1;let{r:n,s:f}=l,a=m(r),c=s.inv(f),u=s.create(a*c),h=s.create(n*c),d=e.BASE.multiplyUnsafe(u).add(t.multiplyUnsafe(h));return!d.is0()&&s.create(d.x)===n}catch{return!1}},recoverPublicKey:function(e,t,r={}){let{prehash:i}=oP(r,b);return t=E(t,i),y.fromBytes(e,"recovered").recoverPublicKey(t).toBytes()},Signature:y,hash:t})}(function(e,t={}){let r=function(e,t,r={},i){if(void 0===i&&(i="edwards"===e),!t||"object"!=typeof t)throw Error(`expected valid ${e} CURVE object`);for(let e of["p","n","h"]){let r=t[e];if(!("bigint"==typeof r&&r>oo))throw Error(`CURVE.${e} must be positive bigint`)}let n=oy(t.p,r.Fp,i),o=oy(t.n,r.Fn,i);for(let r of["Gx","Gy","a","weierstrass"===e?"b":"d"])if(!n.isValid(t[r]))throw Error(`CURVE.${r} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:n,Fn:o}}("weierstrass",e,t),{Fp:i,Fn:n}=r,o=r.CURVE,{h:s,n:f}=o;nV(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});let{endo:a}=t;if(a&&(!i.is0(o.a)||"bigint"!=typeof a.beta||!Array.isArray(a.basises)))throw Error('invalid endo: expected "beta": bigint and "basises": array');let l=oT(i,n);function c(){if(!i.isOdd)throw Error("compression is not supported: Field does not have .isOdd()")}let u=t.toBytes||function(e,t,r){let{x:n,y:o}=t.toAffine(),s=i.toBytes(n);return(nN(r,"isCompressed"),r)?(c(),iy(oH(!i.isOdd(o)),s)):iy(Uint8Array.of(4),s,i.toBytes(o))},h=t.fromBytes||function(e){nR(e,void 0,"Point");let{publicKey:t,publicKeyUncompressed:r}=l,n=e.length,o=e[0],s=e.subarray(1);if(n===t&&(2===o||3===o)){let e,t=i.fromBytes(s);if(!i.isValid(t))throw Error("bad point: is not on curve, wrong x");let r=d(t);try{e=i.sqrt(r)}catch(e){throw Error("bad point: is not on curve, sqrt error"+(e instanceof Error?": "+e.message:""))}return c(),(1&o)==1!==i.isOdd(e)&&(e=i.neg(e)),{x:t,y:e}}if(n===r&&4===o){let e=i.BYTES,t=i.fromBytes(s.subarray(0,e)),r=i.fromBytes(s.subarray(e,2*e));if(!b(t,r))throw Error("bad point: is not on curve");return{x:t,y:r}}throw Error(`bad point: got length ${n}, expected compressed=${t} or uncompressed=${r}`)};function d(e){let t=i.sqr(e),r=i.mul(t,e);return i.add(i.add(r,i.mul(e,o.a)),o.b)}function b(e,t){let r=i.sqr(t),n=d(e);return i.eql(r,n)}if(!b(o.Gx,o.Gy))throw Error("bad curve params: generator point");let p=i.mul(i.pow(o.a,oL),o_),g=i.mul(i.sqr(o.b),BigInt(27));if(i.is0(i.add(p,g)))throw Error("bad curve params: a or b");function y(e,t,r=!1){if(!i.isValid(t)||r&&i.is0(t))throw Error(`bad point coordinate ${e}`);return t}function x(e){if(!(e instanceof B))throw Error("ProjectivePoint expected")}function m(e){if(!a||!a.basises)throw Error("no endo");return function(e,t,r){let[[i,n],[o,s]]=t,f=oC(s*e,r),a=oC(-n*e,r),l=e-f*i-a*o,c=-f*n-a*s,u=l<oR,h=c<oR;u&&(l=-l),h&&(c=-c);let d=nD(Math.ceil(nq(r)/2))+ok;if(l<oR||l>=d||c<oR||c>=d)throw Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:u,k1:l,k2neg:h,k2:c}}(e,a.basises,n.ORDER)}let w=nM((e,t)=>{let{X:r,Y:n,Z:o}=e;if(i.eql(o,i.ONE))return{x:r,y:n};let s=e.is0();null==t&&(t=s?i.ONE:i.inv(o));let f=i.mul(r,t),a=i.mul(n,t),l=i.mul(o,t);if(s)return{x:i.ZERO,y:i.ZERO};if(!i.eql(l,i.ONE))throw Error("invZ was invalid");return{x:f,y:a}}),v=nM(e=>{if(e.is0()){if(t.allowInfinityPoint&&!i.is0(e.Y))return;throw Error("bad point: ZERO")}let{x:r,y:n}=e.toAffine();if(!i.isValid(r)||!i.isValid(n))throw Error("bad point: x or y not field elements");if(!b(r,n))throw Error("bad point: equation left != right");if(!e.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});function E(e,t,r,n,o){return r=new B(i.mul(r.X,e),r.Y,r.Z),t=of(n,t),r=of(o,r),t.add(r)}class B{constructor(e,t,r){this.X=y("x",e),this.Y=y("y",t,!0),this.Z=y("z",r),Object.freeze(this)}static CURVE(){return o}static fromAffine(e){let{x:t,y:r}=e||{};if(!e||!i.isValid(t)||!i.isValid(r))throw Error("invalid affine point");if(e instanceof B)throw Error("projective point not allowed");return i.is0(t)&&i.is0(r)?B.ZERO:new B(t,r,i.ONE)}static fromBytes(e){let t=B.fromAffine(h(nR(e,void 0,"point")));return t.assertValidity(),t}static fromHex(e){return B.fromBytes(nH("pointHex",e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return I.createCache(this,e),t||this.multiply(oL),this}assertValidity(){v(this)}hasEvenY(){let{y:e}=this.toAffine();if(!i.isOdd)throw Error("Field doesn't support isOdd");return!i.isOdd(e)}equals(e){x(e);let{X:t,Y:r,Z:n}=this,{X:o,Y:s,Z:f}=e,a=i.eql(i.mul(t,f),i.mul(o,n)),l=i.eql(i.mul(r,f),i.mul(s,n));return a&&l}negate(){return new B(this.X,i.neg(this.Y),this.Z)}double(){let{a:e,b:t}=o,r=i.mul(t,oL),{X:n,Y:s,Z:f}=this,a=i.ZERO,l=i.ZERO,c=i.ZERO,u=i.mul(n,n),h=i.mul(s,s),d=i.mul(f,f),b=i.mul(n,s);return b=i.add(b,b),c=i.mul(n,f),c=i.add(c,c),a=i.mul(e,c),l=i.mul(r,d),l=i.add(a,l),a=i.sub(h,l),l=i.add(h,l),l=i.mul(a,l),a=i.mul(b,a),c=i.mul(r,c),d=i.mul(e,d),b=i.sub(u,d),b=i.mul(e,b),b=i.add(b,c),c=i.add(u,u),u=i.add(c,u),u=i.add(u,d),u=i.mul(u,b),l=i.add(l,u),d=i.mul(s,f),d=i.add(d,d),u=i.mul(d,b),a=i.sub(a,u),
vendor: 6,123 bytes, line 2
2c=i.mul(d,h),c=i.add(c,c),new B(a,l,c=i.add(c,c))}add(e){x(e);let{X:t,Y:r,Z:n}=this,{X:s,Y:f,Z:a}=e,l=i.ZERO,c=i.ZERO,u=i.ZERO,h=o.a,d=i.mul(o.b,oL),b=i.mul(t,s),p=i.mul(r,f),g=i.mul(n,a),y=i.add(t,r),m=i.add(s,f);y=i.mul(y,m),m=i.add(b,p),y=i.sub(y,m),m=i.add(t,n);let w=i.add(s,a);return m=i.mul(m,w),w=i.add(b,g),m=i.sub(m,w),w=i.add(r,n),l=i.add(f,a),w=i.mul(w,l),l=i.add(p,g),w=i.sub(w,l),u=i.mul(h,m),l=i.mul(d,g),u=i.add(l,u),l=i.sub(p,u),u=i.add(p,u),c=i.mul(l,u),p=i.add(b,b),p=i.add(p,b),g=i.mul(h,g),m=i.mul(d,m),p=i.add(p,g),g=i.sub(b,g),g=i.mul(h,g),m=i.add(m,g),b=i.mul(p,m),c=i.add(c,b),b=i.mul(w,m),l=i.mul(y,l),l=i.sub(l,b),b=i.mul(y,p),u=i.mul(w,u),new B(l,c,u=i.add(u,b))}subtract(e){return this.add(e.negate())}is0(){return this.equals(B.ZERO)}multiply(e){let r,i,{endo:o}=t;if(!n.isValidNot0(e))throw Error("invalid scalar: out of range");let s=e=>I.cached(this,e,e=>oa(B,e));if(o){let{k1neg:t,k1:n,k2neg:f,k2:a}=m(e),{p:l,f:c}=s(n),{p:u,f:h}=s(a);i=c.add(h),r=E(o.beta,l,u,t,f)}else{let{p:t,f:n}=s(e);r=t,i=n}return oa(B,[r,i])[0]}multiplyUnsafe(e){let{endo:r}=t;if(!n.isValid(e))throw Error("invalid scalar: out of range");if(e===oR||this.is0())return B.ZERO;if(e===ok)return this;if(I.hasCache(this))return this.multiply(e);if(!r)return I.unsafe(this,e);{let{k1neg:t,k1:i,k2neg:n,k2:o}=m(e),{p1:s,p2:f}=function(e,t,r,i){let n=t,o=e.ZERO,s=e.ZERO;for(;r>oo||i>oo;)r&os&&(o=o.add(n)),i&os&&(s=s.add(n)),n=n.double(),r>>=os,i>>=os;return{p1:o,p2:s}}(B,this,i,o);return E(r.beta,s,f,t,n)}}multiplyAndAddUnsafe(e,t,r){let i=this.multiplyUnsafe(t).add(e.multiplyUnsafe(r));return i.is0()?void 0:i}toAffine(e){return w(this,e)}isTorsionFree(){let{isTorsionFree:e}=t;return s===ok||(e?e(B,this):I.unsafe(this,f).is0())}clearCofactor(){let{clearCofactor:e}=t;return s===ok?this:e?e(B,this):this.multiplyUnsafe(s)}isSmallOrder(){return this.multiplyUnsafe(s).is0()}toBytes(e=!0){return nN(e,"isCompressed"),this.assertValidity(),u(B,this,e)}toHex(e=!0){return ih(this.toBytes(e))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(e=!0){return this.toBytes(e)}_setWindowSize(e){this.precompute(e)}static normalizeZ(e){return oa(B,e)}static msm(e,t){return function(e,t,r,i){(function(e,t){if(!Array.isArray(e))throw Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw Error("invalid point at index "+r)})})(r,e),function(e,t){if(!Array.isArray(e))throw Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+r)})}(i,t);let n=r.length,o=i.length;if(n!==o)throw Error("arrays of points and scalars must have equal length");let s=e.ZERO,f=nq(BigInt(n)),a=1;f>12?a=f-3:f>4?a=f-2:f>0&&(a=2);let l=nD(a),c=Array(Number(l)+1).fill(s),u=Math.floor((t.BITS-1)/a)*a,h=s;for(let e=u;e>=0;e-=a){c.fill(s);for(let t=0;t<o;t++){let n=Number(i[t]>>BigInt(e)&l);c[n]=c[n].add(r[t])}let t=s;for(let e=c.length-1,r=s;e>0;e--)r=r.add(c[e]),t=t.add(r);if(h=h.add(t),0!==e)for(let e=0;e<a;e++)h=h.double()}return h}(B,n,e,t)}static fromPrivateKey(e){return B.BASE.multiply(oz(n,e))}}B.BASE=new B(o.Gx,o.Gy,i.ONE),B.ZERO=new B(i.ZERO,i.ONE,i.ZERO),B.Fp=i,B.Fn=n;let A=n.BITS,I=new og(B,t.endo?Math.ceil(A/2):A);return B.BASE.precompute(8),B}(r,i),n,o);return t=s.Point,Object.assign({},s,{ProjectivePoint:t,CURVE:Object.assign({},e,ot(t.Fn.ORDER,t.Fn.BITS))})})({...e,hash:t});return{...r(t),create:r}}let oq={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},oD={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},oV={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")},oM=or(oq.p),o$=or(oD.p),oZ=or(oV.p);oF({...oq,Fp:oM,lowS:!1},iJ),oF({...oD,Fp:o$,lowS:!1},i0),oF({...oV,Fp:oZ,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},iQ),Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,e.i(501365),e.i(424047),e.i(329193),e.i(850967),e.i(112324),L.ONE_DAY,L.SIX_HOURS,L.THIRTY_DAYS,L.FIVE_SECONDS,L.THIRTY_DAYS,L.ONE_DAY,L.ONE_DAY,L.THIRTY_SECONDS,L.THIRTY_SECONDS,L.ONE_DAY,L.ONE_DAY,L.ONE_DAY;var oK=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");
2for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var n=0;n<e.length;n++){var o=e.charAt(n),s=o.charCodeAt(0);if(255!==r[s])throw TypeError(o+" is ambiguous");r[s]=n}var f=e.length,a=e.charAt(0),l=Math.log(f)/Math.log(256),c=Math.log(256)/Math.log(f);function u(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var i=0,n=0;e[t]===a;)i++,t++;for(var o=(e.length-t)*l+1>>>0,s=new Uint8Array(o);e[t];){var c=r[e.charCodeAt(t)];if(255===c)return;for(var u=0,h=o-1;(0!==c||u<n)&&-1!==h;h--,u++)c+=f*s[h]>>>0,s[h]=c%256>>>0,c=c/256>>>0;if(0!==c)throw Error("Non-zero carry");n=u,t++}if(" "!==e[t]){for(var d=o-n;d!==o&&0===s[d];)d++;for(var b=new Uint8Array(i+(o-d)),p=i;d!==o;)b[p++]=s[d++];return b}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,i=0,n=0,o=t.length;n!==o&&0===t[n];)n++,r++;for(var s=(o-n)*c+1>>>0,l=new Uint8Array(s);n!==o;){for(var u=t[n],h=0,d=s-1;(0!==u||h<i)&&-1!==d;d--,h++)u+=256*l[d]>>>0,l[d]=u%f>>>0,u=u/f>>>0;if(0!==u)throw Error("Non-zero carry");i=h,n++}for(var b=s-i;b!==s&&0===l[b];)b++;for(var p=a.repeat(r);b<s;++b)p+=e.charAt(l[b]);return p},decodeUnsafe:u,decode:function(e){var r=u(e);if(r)return r;throw Error(`Non-${t} character`)}}};let oY=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")};class oW{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class oX{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return oJ(this,e)}}class oG{constructor(e){this.decoders=e}or(e){return oJ(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let oJ=(e,t)=>new oG({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});
2class oQ{constructor(e,t,r,i){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=i,this.encoder=new oW(e,t,r),this.decoder=new oX(e,t,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let o0=({name:e,prefix:t,encode:r,decode:i})=>new oQ(e,t,r,i),o1=({prefix:e,name:t,alphabet:r})=>{let{encode:i,decode:n}=oK(r,t);return o0({prefix:e,name:t,encode:i,decode:e=>oY(n(e))})},o2=({name:e,prefix:t,bitsPerChar:r,alphabet:i})=>o0({prefix:t,name:e,encode:e=>((e,t,r)=>{let i="="===t[t.length-1],n=(1<<r)-1,o="",s=0,f=0;for(let i=0;i<e.length;++i)for(f=f<<8|e[i],s+=8;s>r;)s-=r,o+=t[n&f>>s];if(s&&(o+=t[n&f<<r-s]),i)for(;o.length*r&7;)o+="=";return o})(e,i,r),decode:t=>((e,t,r,i)=>{let n={};for(let e=0;e<t.length;++e)n[t[e]]=e;let o=e.length;for(;"="===e[o-1];)--o;let s=new Uint8Array(o*r/8|0),f=0,a=0,l=0;for(let t=0;t<o;++t){let o=n[e[t]];if(void 0===o)throw SyntaxError(`Non-${i} character`);a=a<<r|o,(f+=r)>=8&&(f-=8,s[l++]=255&a>>f)}if(f>=r||255&a<<8-f)throw SyntaxError("Unexpected end of data");return s})(t,i,r,e)});var o8=Object.freeze({__proto__:null,identity:o0({prefix:"\0",name:"identity",encode:e=>new TextDecoder().decode(e),decode:e=>new TextEncoder().encode(e)})}),o3=Object.freeze({__proto__:null,base2:o2({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}),o6=Object.freeze({__proto__:null,base8:o2({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}),o5=Object.freeze({__proto__:null,base10:o1({prefix:"9",name:"base10",alphabet:"0123456789"})}),o4=Object.freeze({__proto__:null,base16:o2({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper:o2({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})}),o7=Object.freeze({__proto__:null,base32:o2({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper:o2({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad:o2({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper:o2({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex:o2({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper:o2({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad:o2({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper:o2({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z:o2({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}),o9=Object.freeze({__proto__:null,base36:o1({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper:o1({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})}),se=Object.freeze({__proto__:null,base58btc:o1({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr:o1({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})}),st=Object.freeze({__proto__:null,base64:o2({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad:o2({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url:o2({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad:o2({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});let sr=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈ðŸ‘
2‡ðŸŽ¶ðŸ˜’🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),si=sr.reduce((e,t,r)=>(e[r]=t,e),[]),sn=sr.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);var so=Object.freeze({__proto__:null,base256emoji:o0({prefix:"🚀",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=si[t],"")},decode:function(e){let t=[];for(let r of e){let e=sn[r.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}})});function ss(e,t,r){t=t||[],r=r||0;for(var i=r;e>=0x80000000;)t[r++]=255&e|128,e/=128;for(;-128&e;)t[r++]=255&e|128,e>>>=7;return t[r]=0|e,ss.bytes=r-i+1,t}var sf=function(e){return e<128?1:e<16384?2:e<2097152?3:e<0x10000000?4:e<0x800000000?5:e<0x40000000000?6:e<0x2000000000000?7:e<0x100000000000000?8:e<0x8000000000000000?9:10};let sa=(e,t,r=0)=>(ss(e,t,r),t),sl=(e,t)=>{let r=t.byteLength,i=sf(e),n=i+sf(r),o=new Uint8Array(n+r);return sa(e,o,0),sa(r,o,i),o.set(t,n),new sc(e,r,t,o)};
2class sc{constructor(e,t,r,i){this.code=e,this.size=t,this.digest=r,this.bytes=i}}let su=({name:e,code:t,encode:r})=>new sh(e,t,r);class sh{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?sl(this.code,t):t.then(e=>sl(this.code,e))}throw Error("Unknown type, must be binary type")}}let sd=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t));var sb=Object.freeze({__proto__:null,sha256:su({name:"sha2-256",code:18,encode:sd("SHA-256")}),sha512:su({name:"sha2-512",code:19,encode:sd("SHA-512")})}),sp=Object.freeze({__proto__:null,identity:{code:0,name:"identity",encode:oY,digest:e=>sl(0,oY(e))}});new TextEncoder,new TextDecoder;let sg={...o8,...o3,...o6,...o5,...o4,...o7,...o9,...se,...st,...so};function sy(e,t,r,i){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:i}}}({...sb,...sp}),sy("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),sy("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{let t=function(e=0){var t;return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?(t=globalThis.Buffer.allocUnsafe(e),null!=globalThis.Buffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t):new Uint8Array(e)}((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),sg.base16,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,L.THIRTY_DAYS,L.SEVEN_DAYS,L.FIVE_MINUTES,L.FIVE_MINUTES,L.FIVE_MINUTES,L.FIVE_MINUTES,L.FIVE_MINUTES,L.FIVE_MINUTES,L.ONE_DAY,L.ONE_DAY,L.ONE_DAY,L.ONE_DAY,L.FIVE_MINUTES,L.FIVE_MINUTES,L.FIVE_MINUTES,L.FIVE_MINUTES,L.ONE_DAY,L.ONE_DAY,L.ONE_DAY,L.ONE_DAY,L.ONE_HOUR,L.ONE_HOUR,L.FIVE_MINUTES,L.FIVE_MINUTES,L.FIVE_MINUTES,L.SEVEN_DAYS,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,e.i(98418),Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,e.s([],949595);var sx=e.i(401564),sm=e.i(150576),sw=e.i(979484),sv=e.i(960398),sE=e.i(971080),sB=e.i(149454),sA=e.i(653157),sI=e.i(803468),sO=e.i(82283),sS=e.i(221728),sC=e.i(811424),sU=e.i(564126),sP=e.i(227302);let sN=null,sR={getSIWX:()=>sO.OptionsController.state.siwx,async initializeIfEnabled(e=sv.ChainController.getActiveCaipAddress()){let t=sO.OptionsController.state.siwx;if(!(t&&e))return;let[r,i,n]=e.split(":");if(sv.ChainController.checkIfSupportedNetwork(r,`${r}:${i}`))try{if(sO.OptionsController.state.remoteFeatures?.emailCapture){let e=sv.ChainController.getAccountData(r)?.user;await sI.ModalController.open({view:"DataCapture",data:{email:e?.email??void 0}});return}if(sN&&await sN,(await t.getSessions(`${r}:${i}`,n)).length)return;await sI.ModalController.open({view:"SIWXSignMessage"})}catch(e){console.error("SIWXUtil:initializeIfEnabled",e),sA.EventsController.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:this.getSIWXEventProperties(e)}),await sE.ConnectionController._getClient()?.disconnect().catch(console.error),sS.RouterController.reset("Connect"),sC.SnackController.showError("A problem occurred while trying initialize authentication")}},async isAuthenticated(e=sv.ChainController.getActiveCaipAddress()){if(!sO.OptionsController.state.siwx||!e)return!0;let{chainNamespace:t,chainId:r,address:i}=sm.ParseUtil.parseCaipAddress(e),n=`${t}:${r}`;return(await sR.getSessions({address:i,caipNetworkId:n})).length>0},async requestSignMessage(){let e=sO.OptionsController.state.siwx,t=sP.CoreHelperUtil.getPlainAddress(sv.ChainController.getActiveCaipAddress()),r
2=(0,sU.getActiveCaipNetwork)();if(!e)throw Error("SIWX is not enabled");if(!t)throw Error("No ActiveCaipAddress found");if(!r)throw Error("No ActiveCaipNetwork or client found");try{let i=await e.createMessage({chainId:r.caipNetworkId,accountAddress:t}),n=i.toString(),o="";e.signMessage?o=await e.signMessage({message:n,chainId:r.caipNetworkId,accountAddress:t}):(sB.ConnectorController.getConnectorId(r.chainNamespace)===sx.ConstantsUtil.CONNECTOR_ID.AUTH&&sS.RouterController.pushTransactionStack({}),o=await sE.ConnectionController.signMessage(n)||""),await e.addSession({data:i,message:n,signature:o}),sv.ChainController.setLastConnectedSIWECaipNetwork(r),sI.ModalController.close(),sA.EventsController.sendEvent({type:"track",event:"SIWX_AUTH_SUCCESS",properties:this.getSIWXEventProperties()})}catch(e){sI.ModalController.state.open&&"ApproveTransaction"!==sS.RouterController.state.view||await sI.ModalController.open({view:"SIWXSignMessage"}),sC.SnackController.showError("Error signing message"),sA.EventsController.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:this.getSIWXEventProperties(e)}),console.error("SWIXUtil:requestSignMessage",e)}},async cancelSignMessage(){try{let e=this.getSIWX();if(e?.getRequired?.()){let t=sv.ChainController.getLastConnectedSIWECaipNetwork();if(t){let r=await e?.getSessions(t?.caipNetworkId,sP.CoreHelperUtil.getPlainAddress(sv.ChainController.getActiveCaipAddress())||"");r&&r.length>0?await sv.ChainController.switchActiveNetwork(t):await sE.ConnectionController.disconnect()}else await sE.ConnectionController.disconnect()}else sI.ModalController.close();sI.ModalController.close(),sA.EventsController.sendEvent({event:"CLICK_CANCEL_SIWX",type:"track",properties:this.getSIWXEventProperties()})}catch(e){console.error("SIWXUtil:cancelSignMessage",e)}},async getAllSessions(){let e=this.getSIWX(),t=sv.ChainController.getAllRequestedCaipNetworks(),r=[];return await Promise.all(t.map(async t=>{let i=await e?.getSessions(t.caipNetworkId,sP.CoreHelperUtil.getPlainAddress(sv.ChainController.getActiveCaipAddress())||"");i&&r.push(...i)})),r},async getSessions(e){let t=sO.OptionsController.state.siwx,r=e?.address;if(!r){let e=sv.ChainController.getActiveCaipAddress();r=sP.CoreHelperUtil.getPlainAddress(e)}let i=e?.caipNetworkId;if(!i){let e=sv.ChainController.getActiveCaipNetwork();i=e?.caipNetworkId}return t&&r&&i?t.getSessions(i,r):[]},async isSIWXCloseDisabled(){let e=this.getSIWX();if(e){let t="ApproveTransaction"===sS.RouterController.state.view,r="SIWXSignMessage"===sS.RouterController.state.view;
2if(t||r)return e.getRequired?.()&&0===(await this.getSessions()).length}return!1},async authConnectorAuthenticate({authConnector:e,chainId:t,socialUri:r,preferredAccountType:i,chainNamespace:n}){let o=sR.getSIWX(),s=(0,sU.getActiveCaipNetwork)();if(!o||!n.includes(sx.ConstantsUtil.CHAIN.EVM)||sO.OptionsController.state.remoteFeatures?.emailCapture){let n=await e.connect({chainId:t,socialUri:r,preferredAccountType:i});return{address:n.address,chainId:n.chainId,accounts:n.accounts}}let f=`${n}:${t}`,a=await o.createMessage({chainId:f,accountAddress:"<<AccountAddress>>"}),l={accountAddress:a.accountAddress,chainId:a.chainId,domain:a.domain,uri:a.uri,version:a.version,nonce:a.nonce,notBefore:a.notBefore,statement:a.statement,resources:a.resources,requestId:a.requestId,issuedAt:a.issuedAt,expirationTime:a.expirationTime,serializedMessage:a.toString()},c=await e.connect({chainId:t,socialUri:r,siwxMessage:l,preferredAccountType:i});if(l.accountAddress=c.address,l.serializedMessage=c.message||"",c.signature&&c.message){let e=sR.addEmbeddedWalletSession(l,c.message,c.signature);await e}return sv.ChainController.setLastConnectedSIWECaipNetwork(s),{address:c.address,chainId:c.chainId,accounts:c.accounts}},async addEmbeddedWalletSession(e,t,r){if(sN)return sN;let i=sR.getSIWX();return i?sN=i.addSession({data:e,message:t,signature:r}).finally(()=>{sN=null}):Promise.resolve()},async universalProviderAuthenticate({universalProvider:e,chains:t,methods:r}){let i=sR.getSIWX(),n=(0,sU.getActiveCaipNetwork)(),o=new Set(t.map(e=>e.split(":")[0]));if(!i||1!==o.size||!o.has("eip155"))return!1;let s=await i.createMessage({chainId:(0,sU.getActiveCaipNetwork)()?.caipNetworkId||"",accountAddress:""}),f=await e.authenticate({nonce:s.nonce,domain:s.domain,uri:s.uri,exp:s.expirationTime,iat:s.issuedAt,nbf:s.notBefore,requestId:s.requestId,version:s.version,resources:s.resources,statement:s.statement,chainId:s.chainId,methods:r,chains:[s.chainId,...t.filter(e=>e!==s.chainId)]});sC.SnackController.showLoading("Authenticating...",{autoClose:!1});let a={...f.session.peer.metadata,name:f.session.peer.metadata.name,icon:f.session.peer.metadata.icons?.[0],type:"WALLET_CONNECT"};if(sv.ChainController.setAccountProp("connectedWalletInfo",a,Array.from(o)[0]),f?.auths?.length){let t=f.auths.map(t=>{let r=e.client.formatAuthMessage({request:t.p,iss:t.p.iss});return{data:{...t.p,accountAddress:t.p.iss.split(":").slice(-1).join(""),chainId:t.p.iss.split(":").slice(2,4).join(":"),uri:t.p.aud??"",version:t.p.version||s.version,expirationTime:t.p.exp,issuedAt:t.p.iat,notBefore:t.p.nbf},message:r,signature:t.s.s,cacao:t}});try{await i.setSessions(t),n&&sv.ChainController.setLastConnectedSIWECaipNetwork(n),sA.EventsController.sendEvent({type:"track",event:"SIWX_AUTH_SUCCESS",properties:sR.getSIWXEventProperties()})}catch(t){throw console.error("SIWX:universalProviderAuth - failed to set sessions",t),sA.EventsController.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:sR.getSIWXEventProperties(t)}),await e.disconnect().catch(console.error),t}finally{sC.SnackController.hide()}}return!0},getSIWXEventProperties(e){let t=sv.ChainController.state.activeChain;if(!t)throw Error("SIWXUtil:getSIWXEventProperties - namespace is required");return{network:sv.ChainController.state.activeCaipNetwork?.caipNetworkId||"",isSmartAccount:(0,sU.getPreferredAccountType)(t)===sw.W3mFrameRpcConstants.ACCOUNT_TYPES.SMART_ACCOUNT,message:e?sP.CoreHelperUtil.parseError(e):void 0}},async clearSessions(){let e=this.getSIWX();e&&await e.setSessions([])}};e.s(["SIWXUtil",0,sR],218454)}]);
3
4//# debugId=38fc54d5-0731-6221-7703-fd061bb13fb6
5//# sourceMappingURL=0qxdq5rv3mopq.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.