File size: 24,336 Bytes
7c89823 |
1 2 |
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[207],{13414:function(t,e,n){var r=n(2381).Symbol;t.exports=r},12731:function(t,e,n){var r=n(13414),i=n(37363),o=n(68391),s=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?i(t):o(t)}},19334:function(t,e,n){var r=n(25788),i=/^\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(i,""):t}},93330:function(t,e,n){var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},37363:function(t,e,n){var r=n(13414),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,u=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,u),n=t[u];try{t[u]=void 0;var r=!0}catch(t){}var i=s.call(t);return r&&(e?t[u]=n:delete t[u]),i}},68391:function(t){var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},2381:function(t,e,n){var r=n(93330),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},25788:function(t){var e=/\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},22170:function(t,e,n){var r=n(63117),i=n(49423),o=n(49666),s=Math.max,u=Math.min;t.exports=function(t,e,n){var a,c,f,l,h,d,b=0,y=!1,p=!1,g=!0;if("function"!=typeof t)throw TypeError("Expected a function");function v(e){var n=a,r=c;return a=c=void 0,b=e,l=t.apply(r,n)}function w(t){var n=t-d,r=t-b;return void 0===d||n>=e||n<0||p&&r>=f}function x(){var t,n,r,o=i();if(w(o))return m(o);h=setTimeout(x,(t=o-d,n=o-b,r=e-t,p?u(r,f-n):r))}function m(t){return(h=void 0,g&&a)?v(t):(a=c=void 0,l)}function $(){var t,n=i(),r=w(n);if(a=arguments,c=this,d=n,r){if(void 0===h)return b=t=d,h=setTimeout(x,e),y?v(t):l;if(p)return clearTimeout(h),h=setTimeout(x,e),v(d)}return void 0===h&&(h=setTimeout(x,e)),l}return e=o(e)||0,r(n)&&(y=!!n.leading,f=(p="maxWait"in n)?s(o(n.maxWait)||0,e):f,g="trailing"in n?!!n.trailing:g),$.cancel=function(){void 0!==h&&clearTimeout(h),b=0,a=d=c=h=void 0},$.flush=function(){return void 0===h?l:m(i())},$}},63117:function(t){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},50561:function(t){t.exports=function(t){return null!=t&&"object"==typeof t}},41108:function(t,e,n){var r=n(12731),i=n(50561);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},49423:function(t,e,n){var r=n(2381);t.exports=function(){return r.Date.now()}},49666:function(t,e,n){var r=n(19334),i=n(63117),o=n(41108),s=0/0,u=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return s;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=a.test(t);return n||c.test(t)?f(t.slice(2),n?2:8):u.test(t)?s:+t}},69893:function(t,e,n){"use strict";let r,i;n.d(e,{$3:function(){return C},P6:function(){return q},T:function(){return G},UG:function(){return V},Xx:function(){return L}});/*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) */let o=2n**255n-19n,s=2n**252n+0x14def9dea2f79cd65812631a5cf5d3edn,u={a:-1n,d:0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3n,p:o,n:s,h:8,Gx:0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an,Gy:0x6666666666666666666666666666666666666666666666666666666666666658n},a=(t="")=>{throw Error(t)},c=t=>"string"==typeof t,f=t=>t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name,l=(t,e)=>!f(t)||"number"==typeof e&&e>0&&t.length!==e?a("Uint8Array of valid length expected"):t,h=t=>new Uint8Array(t),d=(t,e)=>l(c(t)?m(t):h(l(t)),e),b=(t,e=o)=>{let n=t%e;return n>=0n?n:e+n},y=t=>t instanceof p?t:a("Point expected");class p{constructor(t,e,n,r){this.ex=t,this.ey=e,this.ez=n,this.et=r}static fromAffine(t){return new p(t.x,t.y,1n,b(t.x*t.y))}static fromHex(t,e=!1){let{d:n}=u,r=(t=d(t,32)).slice(),i=t[31];r[31]=-129&i;let s=z(r);e&&!(0n<=s&&s<2n**256n)&&a("bad y coord 1"),e||0n<=s&&s<o||a("bad y coord 2");let c=b(s*s),{isValid:f,value:l}=S(b(c-1n),b(n*c+1n));f||a("bad y coordinate 3");let h=(1n&l)===1n,y=(128&i)!=0;return!e&&0n===l&&y&&a("bad y coord 3"),y!==h&&(l=b(-l)),new p(l,s,1n,b(l*s))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}equals(t){let{ex:e,ey:n,ez:r}=this,{ex:i,ey:o,ez:s}=y(t),u=b(e*s),a=b(i*r),c=b(n*s),f=b(o*r);return u===a&&c===f}is0(){return this.equals(v)}negate(){return new p(b(-this.ex),this.ey,this.ez,b(-this.et))}double(){let{ex:t,ey:e,ez:n}=this,{a:r}=u,i=b(t*t),o=b(e*e),s=b(2n*b(n*n)),a=b(r*i),c=t+e,f=b(b(c*c)-i-o),l=a+o,h=l-s,d=a-o,y=b(f*h),g=b(l*d),v=b(f*d);return new p(y,g,b(h*l),v)}add(t){let{ex:e,ey:n,ez:r,et:i}=this,{ex:o,ey:s,ez:a,et:c}=y(t),{a:f,d:l}=u,h=b(e*o),d=b(n*s),g=b(i*l*c),v=b(r*a),w=b((e+n)*(o+s)-h-d),x=b(v-g),m=b(v+g),$=b(d-f*h),z=b(w*x),A=b(m*$),O=b(w*$);return new p(z,A,b(x*m),O)}mul(t,e=!0){if(0n===t)return!0===e?a("cannot multiply by 0"):v;if("bigint"==typeof t&&0n<t&&t<s||a("invalid scalar, must be < L"),!e&&this.is0()||1n===t)return this;if(this.equals(g))return H(t).p;let n=v,r=g;for(let i=this;t>0n;i=i.double(),t>>=1n)1n&t?n=n.add(i):e&&(r=r.add(i));return n}multiply(t){return this.mul(t)}clearCofactor(){return this.mul(BigInt(u.h),!1)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){let t=this.mul(s/2n,!1).double();return s%2n&&(t=t.add(this)),t.is0()}toAffine(){let{ex:t,ey:e,ez:n}=this;if(this.equals(v))return{x:0n,y:1n};let r=O(n);return 1n!==b(n*r)&&a("invalid inverse"),{x:b(t*r),y:b(e*r)}}toRawBytes(){let{x:t,y:e}=this.toAffine(),n=$(e);return n[31]|=1n&t?128:0,n}toHex(){return x(this.toRawBytes())}}p.BASE=new p(0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an,0x6666666666666666666666666666666666666666666666666666666666666658n,1n,b(0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an*0x6666666666666666666666666666666666666666666666666666666666666658n)),p.ZERO=new p(0n,1n,1n,0n);let{BASE:g,ZERO:v}=p,w=(t,e)=>t.toString(16).padStart(e,"0"),x=t=>Array.from(t).map(t=>w(t,2)).join(""),m=t=>{let e=t.length;(!c(t)||e%2)&&a("hex invalid 1");let n=h(e/2);for(let e=0;e<n.length;e++){let r=2*e,i=Number.parseInt(t.slice(r,r+2),16);(Number.isNaN(i)||i<0)&&a("hex invalid 2"),n[e]=i}return n},$=t=>m(w(t,64)).reverse(),z=t=>BigInt("0x"+x(h(l(t)).reverse())),A=(...t)=>{let e=h(t.reduce((t,e)=>t+l(e).length,0)),n=0;return t.forEach(t=>{e.set(t,n),n+=t.length}),e},O=(t,e=o)=>{(0n===t||e<=0n)&&a("no inverse n="+t+" mod="+e);let n=b(t,e),r=e,i=0n,s=1n,u=1n,c=0n;for(;0n!==n;){let t=r/n,e=r%n,o=i-u*t,a=s-c*t;r=n,n=e,i=u,s=c,u=o,c=a}return 1n===r?b(i,e):a("no inverse")},E=(t,e)=>{let n=t;for(;e-- >0n;)n*=n,n%=o;return n},I=t=>{let e=t*t%o*t%o,n=E(e,2n)*e%o,r=E(n,1n)*t%o,i=E(r,5n)*r%o,s=E(i,10n)*i%o,u=E(s,20n)*s%o,a=E(u,40n)*u%o,c=E(a,80n)*a%o,f=E(c,80n)*a%o,l=E(f,10n)*i%o;return{pow_p_5_8:E(l,2n)*t%o,b2:e}},S=(t,e)=>{let n=b(e*e*e),r=I(t*b(n*n*e)).pow_p_5_8,i=b(t*n*r),o=b(e*i*i),s=i,u=b(0x2b8324804fc1df0b2b4d00993dfbd7a72f431806ad2fe478c4ee1b274a0ea0b0n*i),a=o===t,c=o===b(-t),f=o===b(-(0x2b8324804fc1df0b2b4d00993dfbd7a72f431806ad2fe478c4ee1b274a0ea0b0n*t));return a&&(i=s),(c||f)&&(i=u),(1n&b(i))===1n&&(i=b(-i)),{isValid:a||c,value:i}},k=t=>b(z(t),s),B=(...t)=>V.sha512Async(...t),U=(...t)=>"function"==typeof r?r(...t):a("etc.sha512Sync not set"),j=t=>{let e=t.slice(0,32);e[0]&=248,e[31]&=127,e[31]|=64;let n=t.slice(32,64),r=k(e),i=g.mul(r),o=i.toRawBytes();return{head:e,prefix:n,scalar:r,point:i,pointBytes:o}},N=t=>j(U(d(t,32))),C=t=>N(t).pointBytes;function P(t,e){return t?B(e.hashable).then(e.finish):e.finish(U(e.hashable))}let T=(t,e,n)=>{let{pointBytes:r,scalar:i}=t,o=k(e),u=g.mul(o).toRawBytes();return{hashable:A(u,r,n),finish:t=>l(A(u,$(b(o+k(t)*i,s))),64)}},L=(t,e)=>{let n=d(t),r=N(e),i=U(r.prefix,n);return P(!1,T(r,i,n))},M={zip215:!0},R=(t,e,n,r=M)=>{e=d(e),t=d(t,64);let{zip215:i}=r,o,s,u,a,c=new Uint8Array;try{o=p.fromHex(n,i),s=p.fromHex(t.slice(0,32),i),u=z(t.slice(32,64)),a=g.mul(u,!1),c=A(s.toRawBytes(),o.toRawBytes(),e)}catch(t){}return{hashable:c,finish:t=>{if(null==a||!i&&o.isSmallOrder())return!1;let e=k(t);return s.add(o.mul(e,!1)).add(a.negate()).clearCofactor().is0()}}},G=(t,e,n,r=M)=>P(!1,R(t,e,n,r)),_=()=>"object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,V={bytesToHex:x,hexToBytes:m,concatBytes:A,mod:b,invert:O,randomBytes:(t=32)=>{let e=_();return e&&e.getRandomValues||a("crypto.getRandomValues must be defined"),e.getRandomValues(h(t))},sha512Async:async(...t)=>{let e=_();e&&e.subtle||a("crypto.subtle or etc.sha512Async must be defined");let n=A(...t);return h(await e.subtle.digest("SHA-512",n.buffer))},sha512Sync:void 0};Object.defineProperties(V,{sha512Sync:{configurable:!1,get:()=>r,set(t){r||(r=t)}}});let q={getExtendedPublicKeyAsync:t=>B(d(t,32)).then(j),getExtendedPublicKey:N,randomPrivateKey:()=>V.randomBytes(32),precompute:(t=8,e=g)=>(e.multiply(3n),e)},F=()=>{let t=[],e=g,n=e;for(let r=0;r<33;r++){n=e,t.push(n);for(let r=1;r<128;r++)n=n.add(e),t.push(n);e=n.double()}return t},H=t=>{let e=i||(i=F()),n=(t,e)=>{let n=e.negate();return t?n:e},r=v,o=g,s=BigInt(255),u=BigInt(8);for(let i=0;i<33;i++){let a=128*i,c=Number(t&s);t>>=u,c>128&&(c-=256,t+=1n);let f=a+Math.abs(c)-1,l=i%2!=0,h=c<0;0===c?o=o.add(n(l,e[a])):r=r.add(n(h,e[f]))}return{p:r,f:o}}},51359:function(t,e,n){"use strict";n.d(e,{b:function(){return i}});var r=n(48926);class i extends r.G{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}},48926:function(t,e,n){"use strict";n.d(e,{G:function(){return i}});var r=n(94290);class i extends Error{constructor(t,e={}){super(),Object.defineProperty(this,"details",{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,"metaMessages",{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,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:(0,r.bo)()});let n=e.cause instanceof i?e.cause.details:e.cause?.message?e.cause.message:e.details,o=e.cause instanceof i&&e.cause.docsPath||e.docsPath;this.message=[t||"An error occurred.","",...e.metaMessages?[...e.metaMessages,""]:[],...o?[`Docs: https://viem.sh${o}${e.docsSlug?`#${e.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join("\n"),e.cause&&(this.cause=e.cause),this.details=n,this.docsPath=o,this.metaMessages=e.metaMessages,this.shortMessage=t}walk(t){return function t(e,n){return n?.(e)?e:e&&"object"==typeof e&&"cause"in e?t(e.cause,n):n?null:e}(this,t)}}},74188:function(t,e,n){"use strict";n.d(e,{J5:function(){return i},M6:function(){return o}});var r=n(48926);class i extends r.G{constructor({max:t,min:e,signed:n,size:r,value:i}){super(`Number "${i}" is not in safe ${r?`${8*r}-bit ${n?"signed":"unsigned"} `:""}integer range ${t?`(${e} to ${t})`:`(above ${e})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class o extends r.G{constructor({givenSize:t,maxSize:e}){super(`Size cannot exceed ${e} bytes. Given size: ${t} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}},94290:function(t,e,n){"use strict";n.d(e,{Gr:function(){return r},bo:function(){return i}});let r=t=>t,i=()=>"viem@2.13.8"},99112:function(t,e,n){"use strict";n.d(e,{K:function(){return f},x:function(){return c}});var r=n(51359),i=n(82361),o=n(45626),s=n(98992),u=n(64113);let a=new s.k(8192);function c(t,e){if(a.has(`${t}.${e}`))return a.get(`${t}.${e}`);let n=e?`${e}${t.toLowerCase()}`:t.substring(2).toLowerCase(),r=(0,o.w)((0,i.qX)(n),"bytes"),s=(e?n.substring(`${e}0x`.length):n).split("");for(let t=0;t<40;t+=2)r[t>>1]>>4>=8&&s[t]&&(s[t]=s[t].toUpperCase()),(15&r[t>>1])>=8&&s[t+1]&&(s[t+1]=s[t+1].toUpperCase());let u=`0x${s.join("")}`;return a.set(`${t}.${e}`,u),u}function f(t,e){if(!(0,u.U)(t,{strict:!1}))throw new r.b({address:t});return c(t,e)}},64113:function(t,e,n){"use strict";n.d(e,{U:function(){return u}});var r=n(98992),i=n(99112);let o=/^0x[a-fA-F0-9]{40}$/,s=new r.k(8192);function u(t,e){let{strict:n=!0}=e??{},r=`${t}.${n}`;if(s.has(r))return s.get(r);let u=!!o.test(t)&&(t.toLowerCase()===t||!n||(0,i.x)(t)===t);return s.set(r,u),u}},40369:function(t,e,n){"use strict";function r(t,{strict:e=!0}={}){return!!t&&"string"==typeof t&&(e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x"))}n.d(e,{v:function(){return r}})},685:function(t,e,n){"use strict";n.d(e,{vk:function(){return o}});var r=n(48926);class i extends r.G{constructor({size:t,targetSize:e,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}function o(t,{dir:e,size:n=32}={}){return"string"==typeof t?function(t,{dir:e,size:n=32}={}){if(null===n)return t;let r=t.replace("0x","");if(r.length>2*n)throw new i({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===e?"padEnd":"padStart"](2*n,"0")}`}(t,{dir:e,size:n}):function(t,{dir:e,size:n=32}={}){if(null===n)return t;if(t.length>n)throw new i({size:t.length,targetSize:n,type:"bytes"});let r=new Uint8Array(n);for(let i=0;i<n;i++){let o="right"===e;r[o?i:n-i-1]=t[o?i:t.length-i-1]}return r}(t,{dir:e,size:n})}},88294:function(t,e,n){"use strict";n.d(e,{Yf:function(){return s},y_:function(){return u},ly:function(){return a}});var r=n(74188),i=n(40369);function o(t){return(0,i.v)(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}function s(t,{size:e}){if(o(t)>e)throw new r.M6({givenSize:o(t),maxSize:e})}function u(t,e={}){let{signed:n}=e;e.size&&s(t,{size:e.size});let r=BigInt(t);if(!n)return r;let i=(t.length-2)/2;return r<=(1n<<8n*BigInt(i)-1n)-1n?r:r-BigInt(`0x${"f".padStart(2*i,"f")}`)-1n}function a(t,e={}){return Number(u(t,e))}},82361:function(t,e,n){"use strict";n.d(e,{O0:function(){return c},qX:function(){return d}});var r=n(48926),i=n(40369),o=n(685),s=n(88294),u=n(95046);let a=new TextEncoder;function c(t,e={}){return"number"==typeof t||"bigint"==typeof t?h((0,u.eC)(t,e)):"boolean"==typeof t?function(t,e={}){let n=new Uint8Array(1);return(n[0]=Number(t),"number"==typeof e.size)?((0,s.Yf)(n,{size:e.size}),(0,o.vk)(n,{size:e.size})):n}(t,e):(0,i.v)(t)?h(t,e):d(t,e)}let f={zero:48,nine:57,A:65,F:70,a:97,f:102};function l(t){return t>=f.zero&&t<=f.nine?t-f.zero:t>=f.A&&t<=f.F?t-(f.A-10):t>=f.a&&t<=f.f?t-(f.a-10):void 0}function h(t,e={}){let n=t;e.size&&((0,s.Yf)(n,{size:e.size}),n=(0,o.vk)(n,{dir:"right",size:e.size}));let i=n.slice(2);i.length%2&&(i=`0${i}`);let u=i.length/2,a=new Uint8Array(u);for(let t=0,e=0;t<u;t++){let n=l(i.charCodeAt(e++)),o=l(i.charCodeAt(e++));if(void 0===n||void 0===o)throw new r.G(`Invalid byte sequence ("${i[e-2]}${i[e-1]}" in "${i}").`);a[t]=16*n+o}return a}function d(t,e={}){let n=a.encode(t);return"number"==typeof e.size?((0,s.Yf)(n,{size:e.size}),(0,o.vk)(n,{dir:"right",size:e.size})):n}},95046:function(t,e,n){"use strict";n.d(e,{$G:function(){return l},NC:function(){return u},eC:function(){return c}});var r=n(74188),i=n(685),o=n(88294);let s=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function u(t,e={}){return"number"==typeof t||"bigint"==typeof t?c(t,e):"string"==typeof t?l(t,e):"boolean"==typeof t?function(t,e={}){let n=`0x${Number(t)}`;return"number"==typeof e.size?((0,o.Yf)(n,{size:e.size}),(0,i.vk)(n,{size:e.size})):n}(t,e):a(t,e)}function a(t,e={}){let n="";for(let e=0;e<t.length;e++)n+=s[t[e]];let r=`0x${n}`;return"number"==typeof e.size?((0,o.Yf)(r,{size:e.size}),(0,i.vk)(r,{dir:"right",size:e.size})):r}function c(t,e={}){let n;let{signed:o,size:s}=e,u=BigInt(t);s?n=o?(1n<<8n*BigInt(s)-1n)-1n:2n**(8n*BigInt(s))-1n:"number"==typeof t&&(n=BigInt(Number.MAX_SAFE_INTEGER));let a="bigint"==typeof n&&o?-n-1n:0;if(n&&u>n||u<a){let e="bigint"==typeof t?"n":"";throw new r.J5({max:n?`${n}${e}`:void 0,min:`${a}${e}`,signed:o,size:s,value:`${t}${e}`})}let c=`0x${(o&&u<0?(1n<<BigInt(8*s))+BigInt(u):u).toString(16)}`;return s?(0,i.vk)(c,{size:s}):c}let f=new TextEncoder;function l(t,e={}){return a(f.encode(t),e)}},45626:function(t,e,n){"use strict";n.d(e,{w:function(){return k}});var r=n(95861);let i=BigInt(4294967296-1),o=BigInt(32),s=(t,e,n)=>t<<n|e>>>32-n,u=(t,e,n)=>e<<n|t>>>32-n,a=(t,e,n)=>e<<n-32|t>>>64-n,c=(t,e,n)=>t<<n-32|e>>>64-n;var f=n(12403);let[l,h,d]=[[],[],[]],b=BigInt(0),y=BigInt(1),p=BigInt(2),g=BigInt(7),v=BigInt(256),w=BigInt(113);for(let t=0,e=y,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],l.push(2*(5*r+n)),h.push((t+1)*(t+2)/2%64);let i=b;for(let t=0;t<7;t++)(e=(e<<y^(e>>g)*w)%v)&p&&(i^=y<<(y<<BigInt(t))-y);d.push(i)}let[x,m]=function(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let s=0;s<t.length;s++){let{h:u,l:a}=function(t,e=!1){return e?{h:Number(t&i),l:Number(t>>o&i)}:{h:0|Number(t>>o&i),l:0|Number(t&i)}}(t[s],e);[n[s],r[s]]=[u,a]}return[n,r]}(d,!0),$=(t,e,n)=>n>32?a(t,e,n):s(t,e,n),z=(t,e,n)=>n>32?c(t,e,n):u(t,e,n);class A extends f.kb{constructor(t,e,n,i=!1,o=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,r.Rx)(n),0>=this.blockLen||this.blockLen>=200)throw Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,f.Jq)(this.state)}keccak(){!function(t,e=24){let n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let e=0;e<10;e++)n[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){let r=(e+8)%10,i=(e+2)%10,o=n[i],s=n[i+1],u=$(o,s,1)^n[r],a=z(o,s,1)^n[r+1];for(let n=0;n<50;n+=10)t[e+n]^=u,t[e+n+1]^=a}let e=t[2],i=t[3];for(let n=0;n<24;n++){let r=h[n],o=$(e,i,r),s=z(e,i,r),u=l[n];e=t[u],i=t[u+1],t[u]=o,t[u+1]=s}for(let e=0;e<50;e+=10){for(let r=0;r<10;r++)n[r]=t[e+r];for(let r=0;r<10;r++)t[e+r]^=~n[(r+2)%10]&n[(r+4)%10]}t[0]^=x[r],t[1]^=m[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){(0,r.Gg)(this);let{blockLen:e,state:n}=this,i=(t=(0,f.O0)(t)).length;for(let r=0;r<i;){let o=Math.min(e-this.pos,i-r);for(let e=0;e<o;e++)n[this.pos++]^=t[r++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:e,pos:n,blockLen:r}=this;t[n]^=e,(128&e)!=0&&n===r-1&&this.keccak(),t[r-1]^=128,this.keccak()}writeInto(t){(0,r.Gg)(this,!1),(0,r.aI)(t),this.finish();let e=this.state,{blockLen:n}=this;for(let r=0,i=t.length;r<i;){this.posOut>=n&&this.keccak();let o=Math.min(n-this.posOut,i-r);t.set(e.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return t}xofInto(t){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,r.Rx)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,r.J8)(t,this),this.finished)throw Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:e,suffix:n,outputLen:r,rounds:i,enableXOF:o}=this;return t||(t=new A(e,n,r,o,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=n,t.outputLen=r,t.enableXOF=o,t.destroyed=this.destroyed,t}}let O=(0,f.hE)(()=>new A(136,1,32));var E=n(40369),I=n(82361),S=n(95046);function k(t,e){let n=O((0,E.v)(t,{strict:!1})?(0,I.O0)(t):t);return"bytes"===(e||"hex")?n:(0,S.NC)(n)}},98992:function(t,e,n){"use strict";n.d(e,{k:function(){return r}});class r extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}set(t,e){return super.set(t,e),this.maxSize&&this.size>this.maxSize&&this.delete(this.keys().next().value),this}}},2342:function(t,e,n){"use strict";n.d(e,{k:function(){return h}});var r=n(82361),i=n(45626),o=n(99112),s=n(40369),u=n(88294),a=n(95046);async function c({hash:t,signature:e}){let r=(0,s.v)(t)?t:(0,a.NC)(t),{secp256k1:i}=await n.e(600).then(n.bind(n,35600)),o=(()=>{if("object"==typeof e&&"r"in e&&"s"in e){let{r:t,s:n,v:r,yParity:o}=e,s=f(Number(o??r));return new i.Signature((0,u.y_)(t),(0,u.y_)(n)).addRecoveryBit(s)}let t=(0,s.v)(e)?e:(0,a.NC)(e),n=f((0,u.ly)(`0x${t.slice(130)}`));return i.Signature.fromCompact(t.substring(2,130)).addRecoveryBit(n)})().recoverPublicKey(r.substring(2)).toHex(!1);return`0x${o}`}function f(t){if(0===t||1===t)return t;if(27===t)return 0;if(28===t)return 1;throw Error("Invalid yParityOrV value")}async function l({hash:t,signature:e}){return function(t){let e=(0,i.w)(`0x${t.substring(4)}`).substring(26);return(0,o.x)(`0x${e}`)}(await c({hash:t,signature:e}))}async function h({message:t,signature:e}){return l({hash:function(t,e){var n;let o="string"==typeof t?(0,r.qX)(t):t.raw instanceof Uint8Array?t.raw:(0,r.O0)(t.raw),s=(0,r.qX)(`\x19Ethereum Signed Message:
${o.length}`);return(0,i.w)("string"==typeof(n=[s,o])[0]?`0x${n.reduce((t,e)=>t+e.replace("0x",""),"")}`:function(t){let e=0;for(let n of t)e+=n.length;let n=new Uint8Array(e),r=0;for(let e of t)n.set(e,r),r+=e.length;return n}(n),void 0)}(t),signature:e})}},25645:function(t,e,n){"use strict";n.d(e,{n:function(){return u}});var r=n(99112),i=n(51359),o=n(64113),s=n(2342);async function u({address:t,message:e,signature:n}){return function(t,e){if(!(0,o.U)(t,{strict:!1}))throw new i.b({address:t});if(!(0,o.U)(e,{strict:!1}))throw new i.b({address:e});return t.toLowerCase()===e.toLowerCase()}((0,r.K)(t),await (0,s.k)({message:e,signature:n}))}},95861:function(t,e,n){"use strict";function r(t){if(!Number.isSafeInteger(t)||t<0)throw Error(`Wrong positive integer: ${t}`)}function i(t,...e){if(!(t instanceof Uint8Array))throw Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function o(t){if("function"!=typeof t||"function"!=typeof t.create)throw Error("Hash should be wrapped by utils.wrapConstructor");r(t.outputLen),r(t.blockLen)}function s(t,e=!0){if(t.destroyed)throw Error("Hash instance has been destroyed");if(e&&t.finished)throw Error("Hash#digest() has already been called")}function u(t,e){i(t);let n=e.outputLen;if(t.length<n)throw Error(`digestInto() expects output buffer of length at least ${n}`)}n.d(e,{Gg:function(){return s},J8:function(){return u},Rx:function(){return r},aI:function(){return i},vp:function(){return o}})},12403:function(t,e,n){"use strict";n.d(e,{kb:function(){return f},eV:function(){return c},GL:function(){return s},O6:function(){return h},np:function(){return u},O0:function(){return a},Jq:function(){return o},hE:function(){return l}});let r="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,i=t=>t instanceof Uint8Array,o=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),s=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),u=(t,e)=>t<<32-e|t>>>e;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw Error("Non little-endian hardware is not supported");function a(t){if("string"==typeof t&&(t=function(t){if("string"!=typeof t)throw Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}(t)),!i(t))throw Error(`expected Uint8Array, got ${typeof t}`);return t}function c(...t){let e=new Uint8Array(t.reduce((t,e)=>t+e.length,0)),n=0;return t.forEach(t=>{if(!i(t))throw Error("Uint8Array expected");e.set(t,n),n+=t.length}),e}class f{clone(){return this._cloneInto()}}function l(t){let e=e=>t().update(a(e)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function h(t=32){if(r&&"function"==typeof r.getRandomValues)return r.getRandomValues(new Uint8Array(t));throw Error("crypto.getRandomValues must be defined")}}}]); |