@magic-ext/farcaster 0.0.3 → 0.0.4-canary.63b6ce3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +3 -3
- package/dist/es/index.js +1 -1
- package/dist/es/index.js.map +3 -3
- package/dist/es/index.mjs +1 -1
- package/dist/es/index.mjs.map +3 -3
- package/dist/extension.js +39 -39
- package/package.json +2 -2
package/dist/extension.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";var MagicFarcasterExtension=(()=>{var k_=Object.create;var Jl=Object.defineProperty;var B_=Object.getOwnPropertyDescriptor;var S_=Object.getOwnPropertyNames,hA=Object.getOwnPropertySymbols,O_=Object.getPrototypeOf,mA=Object.prototype.hasOwnProperty,__=Object.prototype.propertyIsEnumerable;var px=(r,e,t)=>e in r?Jl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,bA=(r,e)=>{for(var t in e||(e={}))mA.call(e,t)&&px(r,t,e[t]);if(hA)for(var t of hA(e))__.call(e,t)&&px(r,t,e[t]);return r};var gA=(r=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(r,{get:(e,t)=>(typeof require!="undefined"?require:e)[t]}):r)(function(r){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var se=(r,e)=>()=>(r&&(e=r(r=0)),e);var M=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),hx=(r,e)=>{for(var t in e)Jl(r,t,{get:e[t],enumerable:!0})},xA=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of S_(e))!mA.call(r,s)&&s!==t&&Jl(r,s,{get:()=>e[s],enumerable:!(n=B_(e,s))||n.enumerable});return r};var l0=(r,e,t)=>(t=r!=null?k_(O_(r)):{},xA(e||!r||!r.__esModule?Jl(t,"default",{value:r,enumerable:!0}):t,r)),C_=r=>xA(Jl({},"__esModule",{value:!0}),r);var tn=(r,e,t)=>(px(r,typeof e!="symbol"?e+"":e,t),t),mx=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)};var fc=(r,e,t)=>(mx(r,e,"read from private field"),t?t.call(r):e.get(r)),vs=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},Wl=(r,e,t,n)=>(mx(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t);var ur=(r,e,t)=>(mx(r,e,"access private method"),t);var bx=(r,e,t)=>new Promise((n,s)=>{var i=c=>{try{a(t.next(c))}catch(u){s(u)}},o=c=>{try{a(t.throw(c))}catch(u){s(u)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(i,o);a((t=t.apply(r,e)).next())});var wA=M((Lz,yA)=>{yA.exports=Magic});var vA=M(f0=>{"use strict";f0.byteLength=I_;f0.toByteArray=M_;f0.fromByteArray=U_;var Ts=[],mn=[],N_=typeof Uint8Array<"u"?Uint8Array:Array,gx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ga=0,AA=gx.length;ga<AA;++ga)Ts[ga]=gx[ga],mn[gx.charCodeAt(ga)]=ga;var ga,AA;mn["-".charCodeAt(0)]=62;mn["_".charCodeAt(0)]=63;function EA(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function I_(r){var e=EA(r),t=e[0],n=e[1];return(t+n)*3/4-n}function R_(r,e,t){return(e+t)*3/4-t}function M_(r){var e,t=EA(r),n=t[0],s=t[1],i=new N_(R_(r,n,s)),o=0,a=s>0?n-4:n,c;for(c=0;c<a;c+=4)e=mn[r.charCodeAt(c)]<<18|mn[r.charCodeAt(c+1)]<<12|mn[r.charCodeAt(c+2)]<<6|mn[r.charCodeAt(c+3)],i[o++]=e>>16&255,i[o++]=e>>8&255,i[o++]=e&255;return s===2&&(e=mn[r.charCodeAt(c)]<<2|mn[r.charCodeAt(c+1)]>>4,i[o++]=e&255),s===1&&(e=mn[r.charCodeAt(c)]<<10|mn[r.charCodeAt(c+1)]<<4|mn[r.charCodeAt(c+2)]>>2,i[o++]=e>>8&255,i[o++]=e&255),i}function L_(r){return Ts[r>>18&63]+Ts[r>>12&63]+Ts[r>>6&63]+Ts[r&63]}function j_(r,e,t){for(var n,s=[],i=e;i<t;i+=3)n=(r[i]<<16&16711680)+(r[i+1]<<8&65280)+(r[i+2]&255),s.push(L_(n));return s.join("")}function U_(r){for(var e,t=r.length,n=t%3,s=[],i=16383,o=0,a=t-n;o<a;o+=i)s.push(j_(r,o,o+i>a?a:o+i));return n===1?(e=r[t-1],s.push(Ts[e>>2]+Ts[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],s.push(Ts[e>>10]+Ts[e>>4&63]+Ts[e<<2&63]+"=")),s.join("")}});var TA=M(xx=>{xx.read=function(r,e,t,n,s){var i,o,a=s*8-n-1,c=(1<<a)-1,u=c>>1,l=-7,f=t?s-1:0,d=t?-1:1,h=r[e+f];for(f+=d,i=h&(1<<-l)-1,h>>=-l,l+=a;l>0;i=i*256+r[e+f],f+=d,l-=8);for(o=i&(1<<-l)-1,i>>=-l,l+=n;l>0;o=o*256+r[e+f],f+=d,l-=8);if(i===0)i=1-u;else{if(i===c)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,n),i=i-u}return(h?-1:1)*o*Math.pow(2,i-n)};xx.write=function(r,e,t,n,s,i){var o,a,c,u=i*8-s-1,l=(1<<u)-1,f=l>>1,d=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,b=n?1:-1,p=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+f>=1?e+=d/c:e+=d*Math.pow(2,1-f),e*c>=2&&(o++,c/=2),o+f>=l?(a=0,o=l):o+f>=1?(a=(e*c-1)*Math.pow(2,s),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,s),o=0));s>=8;r[t+h]=a&255,h+=b,a/=256,s-=8);for(o=o<<s|a,u+=s;u>0;r[t+h]=o&255,h+=b,o/=256,u-=8);r[t+h-b]|=p*128}});var h0=M(pc=>{"use strict";var yx=vA(),dc=TA(),PA=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;pc.Buffer=X;pc.SlowBuffer=G_;pc.INSPECT_MAX_BYTES=50;var d0=2147483647;pc.kMaxLength=d0;X.TYPED_ARRAY_SUPPORT=F_();!X.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function F_(){try{var r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(X.prototype,"parent",{enumerable:!0,get:function(){if(!!X.isBuffer(this))return this.buffer}});Object.defineProperty(X.prototype,"offset",{enumerable:!0,get:function(){if(!!X.isBuffer(this))return this.byteOffset}});function ai(r){if(r>d0)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);return Object.setPrototypeOf(e,X.prototype),e}function X(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return vx(r)}return SA(r,e,t)}X.poolSize=8192;function SA(r,e,t){if(typeof r=="string")return H_(r,e);if(ArrayBuffer.isView(r))return $_(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(Ps(r,ArrayBuffer)||r&&Ps(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ps(r,SharedArrayBuffer)||r&&Ps(r.buffer,SharedArrayBuffer)))return Ax(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return X.from(n,e,t);var s=q_(r);if(s)return s;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return X.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}X.from=function(r,e,t){return SA(r,e,t)};Object.setPrototypeOf(X.prototype,Uint8Array.prototype);Object.setPrototypeOf(X,Uint8Array);function OA(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function D_(r,e,t){return OA(r),r<=0?ai(r):e!==void 0?typeof t=="string"?ai(r).fill(e,t):ai(r).fill(e):ai(r)}X.alloc=function(r,e,t){return D_(r,e,t)};function vx(r){return OA(r),ai(r<0?0:Tx(r)|0)}X.allocUnsafe=function(r){return vx(r)};X.allocUnsafeSlow=function(r){return vx(r)};function H_(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!X.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var t=_A(r,e)|0,n=ai(t),s=n.write(r,e);return s!==t&&(n=n.slice(0,s)),n}function wx(r){for(var e=r.length<0?0:Tx(r.length)|0,t=ai(e),n=0;n<e;n+=1)t[n]=r[n]&255;return t}function $_(r){if(Ps(r,Uint8Array)){var e=new Uint8Array(r);return Ax(e.buffer,e.byteOffset,e.byteLength)}return wx(r)}function Ax(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');var n;return e===void 0&&t===void 0?n=new Uint8Array(r):t===void 0?n=new Uint8Array(r,e):n=new Uint8Array(r,e,t),Object.setPrototypeOf(n,X.prototype),n}function q_(r){if(X.isBuffer(r)){var e=Tx(r.length)|0,t=ai(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||Px(r.length)?ai(0):wx(r);if(r.type==="Buffer"&&Array.isArray(r.data))return wx(r.data)}function Tx(r){if(r>=d0)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d0.toString(16)+" bytes");return r|0}function G_(r){return+r!=r&&(r=0),X.alloc(+r)}X.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==X.prototype};X.compare=function(e,t){if(Ps(e,Uint8Array)&&(e=X.from(e,e.offset,e.byteLength)),Ps(t,Uint8Array)&&(t=X.from(t,t.offset,t.byteLength)),!X.isBuffer(e)||!X.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,s=t.length,i=0,o=Math.min(n,s);i<o;++i)if(e[i]!==t[i]){n=e[i],s=t[i];break}return n<s?-1:s<n?1:0};X.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};X.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return X.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var s=X.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(Ps(o,Uint8Array))i+o.length>s.length?X.from(o).copy(s,i):Uint8Array.prototype.set.call(s,o,i);else if(X.isBuffer(o))o.copy(s,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return s};function _A(r,e){if(X.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||Ps(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);var t=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;for(var s=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Ex(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return LA(r).length;default:if(s)return n?-1:Ex(r).length;e=(""+e).toLowerCase(),s=!0}}X.byteLength=_A;function z_(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return t7(this,e,t);case"utf8":case"utf-8":return NA(this,e,t);case"ascii":return X_(this,e,t);case"latin1":case"binary":return e7(this,e,t);case"base64":return Y_(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r7(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}X.prototype._isBuffer=!0;function xa(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}X.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)xa(this,t,t+1);return this};X.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)xa(this,t,t+3),xa(this,t+1,t+2);return this};X.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)xa(this,t,t+7),xa(this,t+1,t+6),xa(this,t+2,t+5),xa(this,t+3,t+4);return this};X.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?NA(this,0,e):z_.apply(this,arguments)};X.prototype.toLocaleString=X.prototype.toString;X.prototype.equals=function(e){if(!X.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:X.compare(this,e)===0};X.prototype.inspect=function(){var e="",t=pc.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"};PA&&(X.prototype[PA]=X.prototype.inspect);X.prototype.compare=function(e,t,n,s,i){if(Ps(e,Uint8Array)&&(e=X.from(e,e.offset,e.byteLength)),!X.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),s===void 0&&(s=0),i===void 0&&(i=this.length),t<0||n>e.length||s<0||i>this.length)throw new RangeError("out of range index");if(s>=i&&t>=n)return 0;if(s>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,s>>>=0,i>>>=0,this===e)return 0;for(var o=i-s,a=n-t,c=Math.min(o,a),u=this.slice(s,i),l=e.slice(t,n),f=0;f<c;++f)if(u[f]!==l[f]){o=u[f],a=l[f];break}return o<a?-1:a<o?1:0};function CA(r,e,t,n,s){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Px(t)&&(t=s?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(s)return-1;t=r.length-1}else if(t<0)if(s)t=0;else return-1;if(typeof e=="string"&&(e=X.from(e,n)),X.isBuffer(e))return e.length===0?-1:kA(r,e,t,n,s);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?s?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):kA(r,[e],t,n,s);throw new TypeError("val must be string, number or Buffer")}function kA(r,e,t,n,s){var i=1,o=r.length,a=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;i=2,o/=2,a/=2,t/=2}function c(h,b){return i===1?h[b]:h.readUInt16BE(b*i)}var u;if(s){var l=-1;for(u=t;u<o;u++)if(c(r,u)===c(e,l===-1?0:u-l)){if(l===-1&&(l=u),u-l+1===a)return l*i}else l!==-1&&(u-=u-l),l=-1}else for(t+a>o&&(t=o-a),u=t;u>=0;u--){for(var f=!0,d=0;d<a;d++)if(c(r,u+d)!==c(e,d)){f=!1;break}if(f)return u}return-1}X.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1};X.prototype.indexOf=function(e,t,n){return CA(this,e,t,n,!0)};X.prototype.lastIndexOf=function(e,t,n){return CA(this,e,t,n,!1)};function V_(r,e,t,n){t=Number(t)||0;var s=r.length-t;n?(n=Number(n),n>s&&(n=s)):n=s;var i=e.length;n>i/2&&(n=i/2);for(var o=0;o<n;++o){var a=parseInt(e.substr(o*2,2),16);if(Px(a))return o;r[t+o]=a}return o}function K_(r,e,t,n){return p0(Ex(e,r.length-t),r,t,n)}function J_(r,e,t,n){return p0(i7(e),r,t,n)}function W_(r,e,t,n){return p0(LA(e),r,t,n)}function Q_(r,e,t,n){return p0(o7(e,r.length-t),r,t,n)}X.prototype.write=function(e,t,n,s){if(t===void 0)s="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")s=t,n=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(n)?(n=n>>>0,s===void 0&&(s="utf8")):(s=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");s||(s="utf8");for(var o=!1;;)switch(s){case"hex":return V_(this,e,t,n);case"utf8":case"utf-8":return K_(this,e,t,n);case"ascii":case"latin1":case"binary":return J_(this,e,t,n);case"base64":return W_(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q_(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+s);s=(""+s).toLowerCase(),o=!0}};X.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Y_(r,e,t){return e===0&&t===r.length?yx.fromByteArray(r):yx.fromByteArray(r.slice(e,t))}function NA(r,e,t){t=Math.min(r.length,t);for(var n=[],s=e;s<t;){var i=r[s],o=null,a=i>239?4:i>223?3:i>191?2:1;if(s+a<=t){var c,u,l,f;switch(a){case 1:i<128&&(o=i);break;case 2:c=r[s+1],(c&192)===128&&(f=(i&31)<<6|c&63,f>127&&(o=f));break;case 3:c=r[s+1],u=r[s+2],(c&192)===128&&(u&192)===128&&(f=(i&15)<<12|(c&63)<<6|u&63,f>2047&&(f<55296||f>57343)&&(o=f));break;case 4:c=r[s+1],u=r[s+2],l=r[s+3],(c&192)===128&&(u&192)===128&&(l&192)===128&&(f=(i&15)<<18|(c&63)<<12|(u&63)<<6|l&63,f>65535&&f<1114112&&(o=f))}}o===null?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),s+=a}return Z_(n)}var BA=4096;function Z_(r){var e=r.length;if(e<=BA)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=BA));return t}function X_(r,e,t){var n="";t=Math.min(r.length,t);for(var s=e;s<t;++s)n+=String.fromCharCode(r[s]&127);return n}function e7(r,e,t){var n="";t=Math.min(r.length,t);for(var s=e;s<t;++s)n+=String.fromCharCode(r[s]);return n}function t7(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var s="",i=e;i<t;++i)s+=a7[r[i]];return s}function r7(r,e,t){for(var n=r.slice(e,t),s="",i=0;i<n.length-1;i+=2)s+=String.fromCharCode(n[i]+n[i+1]*256);return s}X.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var s=this.subarray(e,t);return Object.setPrototypeOf(s,X.prototype),s};function Xt(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}X.prototype.readUintLE=X.prototype.readUIntLE=function(e,t,n){e=e>>>0,t=t>>>0,n||Xt(e,t,this.length);for(var s=this[e],i=1,o=0;++o<t&&(i*=256);)s+=this[e+o]*i;return s};X.prototype.readUintBE=X.prototype.readUIntBE=function(e,t,n){e=e>>>0,t=t>>>0,n||Xt(e,t,this.length);for(var s=this[e+--t],i=1;t>0&&(i*=256);)s+=this[e+--t]*i;return s};X.prototype.readUint8=X.prototype.readUInt8=function(e,t){return e=e>>>0,t||Xt(e,1,this.length),this[e]};X.prototype.readUint16LE=X.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||Xt(e,2,this.length),this[e]|this[e+1]<<8};X.prototype.readUint16BE=X.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||Xt(e,2,this.length),this[e]<<8|this[e+1]};X.prototype.readUint32LE=X.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||Xt(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};X.prototype.readUint32BE=X.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||Xt(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};X.prototype.readIntLE=function(e,t,n){e=e>>>0,t=t>>>0,n||Xt(e,t,this.length);for(var s=this[e],i=1,o=0;++o<t&&(i*=256);)s+=this[e+o]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s};X.prototype.readIntBE=function(e,t,n){e=e>>>0,t=t>>>0,n||Xt(e,t,this.length);for(var s=t,i=1,o=this[e+--s];s>0&&(i*=256);)o+=this[e+--s]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};X.prototype.readInt8=function(e,t){return e=e>>>0,t||Xt(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};X.prototype.readInt16LE=function(e,t){e=e>>>0,t||Xt(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};X.prototype.readInt16BE=function(e,t){e=e>>>0,t||Xt(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};X.prototype.readInt32LE=function(e,t){return e=e>>>0,t||Xt(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};X.prototype.readInt32BE=function(e,t){return e=e>>>0,t||Xt(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};X.prototype.readFloatLE=function(e,t){return e=e>>>0,t||Xt(e,4,this.length),dc.read(this,e,!0,23,4)};X.prototype.readFloatBE=function(e,t){return e=e>>>0,t||Xt(e,4,this.length),dc.read(this,e,!1,23,4)};X.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||Xt(e,8,this.length),dc.read(this,e,!0,52,8)};X.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||Xt(e,8,this.length),dc.read(this,e,!1,52,8)};function Fr(r,e,t,n,s,i){if(!X.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>s||e<i)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}X.prototype.writeUintLE=X.prototype.writeUIntLE=function(e,t,n,s){if(e=+e,t=t>>>0,n=n>>>0,!s){var i=Math.pow(2,8*n)-1;Fr(this,e,t,n,i,0)}var o=1,a=0;for(this[t]=e&255;++a<n&&(o*=256);)this[t+a]=e/o&255;return t+n};X.prototype.writeUintBE=X.prototype.writeUIntBE=function(e,t,n,s){if(e=+e,t=t>>>0,n=n>>>0,!s){var i=Math.pow(2,8*n)-1;Fr(this,e,t,n,i,0)}var o=n-1,a=1;for(this[t+o]=e&255;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+n};X.prototype.writeUint8=X.prototype.writeUInt8=function(e,t,n){return e=+e,t=t>>>0,n||Fr(this,e,t,1,255,0),this[t]=e&255,t+1};X.prototype.writeUint16LE=X.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t>>>0,n||Fr(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};X.prototype.writeUint16BE=X.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t>>>0,n||Fr(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};X.prototype.writeUint32LE=X.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t>>>0,n||Fr(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};X.prototype.writeUint32BE=X.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t>>>0,n||Fr(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};X.prototype.writeIntLE=function(e,t,n,s){if(e=+e,t=t>>>0,!s){var i=Math.pow(2,8*n-1);Fr(this,e,t,n,i-1,-i)}var o=0,a=1,c=0;for(this[t]=e&255;++o<n&&(a*=256);)e<0&&c===0&&this[t+o-1]!==0&&(c=1),this[t+o]=(e/a>>0)-c&255;return t+n};X.prototype.writeIntBE=function(e,t,n,s){if(e=+e,t=t>>>0,!s){var i=Math.pow(2,8*n-1);Fr(this,e,t,n,i-1,-i)}var o=n-1,a=1,c=0;for(this[t+o]=e&255;--o>=0&&(a*=256);)e<0&&c===0&&this[t+o+1]!==0&&(c=1),this[t+o]=(e/a>>0)-c&255;return t+n};X.prototype.writeInt8=function(e,t,n){return e=+e,t=t>>>0,n||Fr(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};X.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t>>>0,n||Fr(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};X.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t>>>0,n||Fr(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};X.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t>>>0,n||Fr(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};X.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t>>>0,n||Fr(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function IA(r,e,t,n,s,i){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function RA(r,e,t,n,s){return e=+e,t=t>>>0,s||IA(r,e,t,4,34028234663852886e22,-34028234663852886e22),dc.write(r,e,t,n,23,4),t+4}X.prototype.writeFloatLE=function(e,t,n){return RA(this,e,t,!0,n)};X.prototype.writeFloatBE=function(e,t,n){return RA(this,e,t,!1,n)};function MA(r,e,t,n,s){return e=+e,t=t>>>0,s||IA(r,e,t,8,17976931348623157e292,-17976931348623157e292),dc.write(r,e,t,n,52,8),t+8}X.prototype.writeDoubleLE=function(e,t,n){return MA(this,e,t,!0,n)};X.prototype.writeDoubleBE=function(e,t,n){return MA(this,e,t,!1,n)};X.prototype.copy=function(e,t,n,s){if(!X.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!s&&s!==0&&(s=this.length),t>=e.length&&(t=e.length),t||(t=0),s>0&&s<n&&(s=n),s===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(s<0)throw new RangeError("sourceEnd out of bounds");s>this.length&&(s=this.length),e.length-t<s-n&&(s=e.length-t+n);var i=s-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,s):Uint8Array.prototype.set.call(e,this.subarray(n,s),t),i};X.prototype.fill=function(e,t,n,s){if(typeof e=="string"){if(typeof t=="string"?(s=t,t=0,n=this.length):typeof n=="string"&&(s=n,n=this.length),s!==void 0&&typeof s!="string")throw new TypeError("encoding must be a string");if(typeof s=="string"&&!X.isEncoding(s))throw new TypeError("Unknown encoding: "+s);if(e.length===1){var i=e.charCodeAt(0);(s==="utf8"&&i<128||s==="latin1")&&(e=i)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var o;if(typeof e=="number")for(o=t;o<n;++o)this[o]=e;else{var a=X.isBuffer(e)?e:X.from(e,s),c=a.length;if(c===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=a[o%c]}return this};var n7=/[^+/0-9A-Za-z-_]/g;function s7(r){if(r=r.split("=")[0],r=r.trim().replace(n7,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function Ex(r,e){e=e||1/0;for(var t,n=r.length,s=null,i=[],o=0;o<n;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!s){if(t>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}s=t;continue}if(t<56320){(e-=3)>-1&&i.push(239,191,189),s=t;continue}t=(s-55296<<10|t-56320)+65536}else s&&(e-=3)>-1&&i.push(239,191,189);if(s=null,t<128){if((e-=1)<0)break;i.push(t)}else if(t<2048){if((e-=2)<0)break;i.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;i.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;i.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return i}function i7(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function o7(r,e){for(var t,n,s,i=[],o=0;o<r.length&&!((e-=2)<0);++o)t=r.charCodeAt(o),n=t>>8,s=t%256,i.push(s),i.push(n);return i}function LA(r){return yx.toByteArray(s7(r))}function p0(r,e,t,n){for(var s=0;s<n&&!(s+t>=e.length||s>=r.length);++s)e[s+t]=r[s];return s}function Ps(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function Px(r){return r!==r}var a7=function(){for(var r="0123456789abcdef",e=new Array(256),t=0;t<16;++t)for(var n=t*16,s=0;s<16;++s)e[n+s]=r[t]+r[s];return e}()});var Yn=M((Dz,jA)=>{jA.exports={ALT:1,CAT:2,REP:3,RNM:4,TRG:5,TBS:6,TLS:7,UDT:11,AND:12,NOT:13,BKR:14,BKA:15,BKN:16,ABG:17,AEN:18,ACTIVE:100,MATCH:101,EMPTY:102,NOMATCH:103,SEM_PRE:200,SEM_POST:201,SEM_OK:300,SEM_SKIP:301,ATTR_N:400,ATTR_R:401,ATTR_MR:402,LOOKAROUND_NONE:500,LOOKAROUND_AHEAD:501,LOOKAROUND_BEHIND:502,BKR_MODE_UM:601,BKR_MODE_PM:602,BKR_MODE_CS:603,BKR_MODE_CI:604}});var Ql=M((Hz,UA)=>{UA.exports={CLASS_MONOSPACE:"apg-mono",CLASS_ACTIVE:"apg-active",CLASS_EMPTY:"apg-empty",CLASS_MATCH:"apg-match",CLASS_NOMATCH:"apg-nomatch",CLASS_LOOKAHEAD:"apg-lh-match",CLASS_LOOKBEHIND:"apg-lb-match",CLASS_REMAINDER:"apg-remainder",CLASS_CTRLCHAR:"apg-ctrl-char",CLASS_LINEEND:"apg-line-end",CLASS_ERROR:"apg-error",CLASS_PHRASE:"apg-phrase",CLASS_EMPTYPHRASE:"apg-empty-phrase",CLASS_STATE:"apg-state",CLASS_STATS:"apg-stats",CLASS_TRACE:"apg-trace",CLASS_GRAMMAR:"apg-grammar",CLASS_RULES:"apg-rules",CLASS_RULESLINK:"apg-rules-link",CLASS_ATTRIBUTES:"apg-attrs"}});var DA=M(er=>{var{Buffer:Kt}=h0(),m0=4294967292,b0=4294967293,kx=4294967294,FA=4294967295,pe=[0,1,3,7,15,31,63,127,255,511,1023],Ki=["00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F","10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F","20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F","30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F","40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F","50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F","60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F","70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F","80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F","90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF","D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF","E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF","F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"],c7="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),rn=[];c7.forEach(r=>{rn.push(r.charCodeAt(0))});er.utf8={encode(r){let e=[];return r.forEach(t=>{if(t>=0&&t<=127)e.push(t);else if(t<=2047)e.push(192+(t>>6&pe[5])),e.push(128+(t&pe[6]));else if(t<55296||t>57343&&t<=65535)e.push(224+(t>>12&pe[4])),e.push(128+(t>>6&pe[6])),e.push(128+(t&pe[6]));else if(t>=65536&&t<=1114111){let n=t>>16&pe[5];e.push(240+(n>>2)),e.push(128+((n&pe[2])<<4)+(t>>12&pe[4])),e.push(128+(t>>6&pe[6])),e.push(128+(t&pe[6]))}else throw new RangeError(`utf8.encode: character out of range: char: ${t}`)}),Kt.from(e)},decode(r,e){function t(b,p){if((p&192)!==128)return b0;let g=((b&pe[5])<<6)+(p&pe[6]);return g<128?m0:g}function n(b,p,g){if((g&192)!==128||(p&192)!==128)return b0;let m=((b&pe[4])<<12)+((p&pe[6])<<6)+(g&pe[6]);return m<2048?m0:m>=55296&&m<=57343?kx:m}function s(b,p,g,m){if((m&192)!==128||(g&192)!==128||(p&192)!==128)return b0;let y=(((b&pe[3])<<2)+(p>>4&pe[2])<<16)+((p&pe[4])<<12)+((g&pe[6])<<6)+(m&pe[6]);return y<65536?m0:y>1114111?kx:y}let i,o,a,c,u,l,f=r.length,d=e?3:0,h=[];for(;d<f;){o=r[d],i=FA;let b=!0;for(;b;){if(o>=0&&o<=127){i=o,l=1;break}if(a=d+1,a<f&&o>=194&&o<=223){i=t(o,r[a]),l=2;break}if(c=d+2,c<f&&o>=224&&o<=239){i=n(o,r[a],r[c]),l=3;break}if(u=d+3,u<f&&o>=240&&o<=244){i=s(o,r[a],r[c],r[u]),l=4;break}break}if(i>1114111){let p=`byte[${d}]`;throw i===FA?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${p}`):i===b0?new RangeError(`utf8.decode: illegal trailing byte found at: ${p}`):i===kx?new RangeError(`utf8.decode: code point out of range found at: ${p}`):i===m0?new RangeError(`utf8.decode: non-shortest form found at: ${p}`):new RangeError(`utf8.decode: unrecognized error found at: ${p}`)}h.push(i),d+=l}return h}};er.utf16be={encode(r){let e=[],t,n,s;for(let i=0;i<r.length;i+=1)if(t=r[i],t>=0&&t<=55295||t>=57344&&t<=65535)e.push(t>>8&pe[8]),e.push(t&pe[8]);else if(t>=65536&&t<=1114111)s=t-65536,n=55296+(s>>10),s=56320+(s&pe[10]),e.push(n>>8&pe[8]),e.push(n&pe[8]),e.push(s>>8&pe[8]),e.push(s&pe[8]);else throw new RangeError(`utf16be.encode: UTF16BE value out of range: char[${i}]: ${t}`);return Kt.from(e)},decode(r,e){if(r.length%2>0)throw new RangeError(`utf16be.decode: data length must be even multiple of 2: length: ${r.length}`);let t=[],n=r.length,s=e?2:0,i=0,o,a,c,u,l,f;for(;s<n;){for(;;){if(c=s+1,c<n){if(l=(r[s]<<8)+r[c],l<55296||l>57343){o=l,a=2;break}if(u=s+3,u<n&&(f=(r[s+2]<<8)+r[u],l<=56319&&f>=56320&&f<=57343)){o=65536+(l-55296<<10)+(f-56320),a=4;break}}throw new RangeError(`utf16be.decode: ill-formed UTF16BE byte sequence found: byte[${s}]`)}t[i++]=o,s+=a}return t}};er.utf16le={encode(r){let e=[],t,n,s;for(let i=0;i<r.length;i+=1)if(t=r[i],t>=0&&t<=55295||t>=57344&&t<=65535)e.push(t&pe[8]),e.push(t>>8&pe[8]);else if(t>=65536&&t<=1114111)s=t-65536,n=55296+(s>>10),s=56320+(s&pe[10]),e.push(n&pe[8]),e.push(n>>8&pe[8]),e.push(s&pe[8]),e.push(s>>8&pe[8]);else throw new RangeError(`utf16le.encode: UTF16LE value out of range: char[${i}]: ${t}`);return Kt.from(e)},decode(r,e){if(r.length%2>0)throw new RangeError(`utf16le.decode: data length must be even multiple of 2: length: ${r.length}`);let t=[],n=r.length,s=e?2:0,i=0,o,a,c,u,l,f;for(;s<n;){for(;;){if(c=s+1,c<n){if(l=(r[c]<<8)+r[s],l<55296||l>57343){o=l,a=2;break}if(u=s+3,u<n&&(f=(r[u]<<8)+r[s+2],l<=56319&&f>=56320&&f<=57343)){o=65536+(l-55296<<10)+(f-56320),a=4;break}}throw new RangeError(`utf16le.decode: ill-formed UTF16LE byte sequence found: byte[${s}]`)}t[i++]=o,s+=a}return t}};er.utf32be={encode(r){let e=Kt.alloc(r.length*4),t=0;return r.forEach(n=>{if(n>=55296&&n<=57343||n>1114111)throw new RangeError(`utf32be.encode: UTF32BE character code out of range: char[${t/4}]: ${n}`);e[t++]=n>>24&pe[8],e[t++]=n>>16&pe[8],e[t++]=n>>8&pe[8],e[t++]=n&pe[8]}),e},decode(r,e){if(r.length%4>0)throw new RangeError(`utf32be.decode: UTF32BE byte length must be even multiple of 4: length: ${r.length}`);let t=[],n=e?4:0;for(;n<r.length;n+=4){let s=(r[n]<<24)+(r[n+1]<<16)+(r[n+2]<<8)+r[n+3];if(s>=55296&&s<=57343||s>1114111)throw new RangeError(`utf32be.decode: UTF32BE character code out of range: char[${n/4}]: ${s}`);t.push(s)}return t}};er.utf32le={encode(r){let e=Kt.alloc(r.length*4),t=0;return r.forEach(n=>{if(n>=55296&&n<=57343||n>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${t/4}]: ${n}`);e[t++]=n&pe[8],e[t++]=n>>8&pe[8],e[t++]=n>>16&pe[8],e[t++]=n>>24&pe[8]}),e},decode(r,e){if(r.length%4>0)throw new RangeError(`utf32be.decode: UTF32LE byte length must be even multiple of 4: length: ${r.length}`);let t=[],n=e?4:0;for(;n<r.length;n+=4){let s=(r[n+3]<<24)+(r[n+2]<<16)+(r[n+1]<<8)+r[n];if(s>=55296&&s<=57343||s>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${n/4}]: ${s}`);t.push(s)}return t}};er.uint7={encode(r){let e=Kt.alloc(r.length);for(let t=0;t<r.length;t+=1){if(r[t]>127)throw new RangeError(`uint7.encode: UINT7 character code out of range: char[${t}]: ${r[t]}`);e[t]=r[t]}return e},decode(r){let e=[];for(let t=0;t<r.length;t+=1){if(r[t]>127)throw new RangeError(`uint7.decode: UINT7 character code out of range: byte[${t}]: ${r[t]}`);e[t]=r[t]}return e}};er.uint8={encode(r){let e=Kt.alloc(r.length);for(let t=0;t<r.length;t+=1){if(r[t]>255)throw new RangeError(`uint8.encode: UINT8 character code out of range: char[${t}]: ${r[t]}`);e[t]=r[t]}return e},decode(r){let e=[];for(let t=0;t<r.length;t+=1)e[t]=r[t];return e}};er.uint16be={encode(r){let e=Kt.alloc(r.length*2),t=0;return r.forEach(n=>{if(n>65535)throw new RangeError(`uint16be.encode: UINT16BE character code out of range: char[${t/2}]: ${n}`);e[t++]=n>>8&pe[8],e[t++]=n&pe[8]}),e},decode(r){if(r.length%2>0)throw new RangeError(`uint16be.decode: UINT16BE byte length must be even multiple of 2: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=2)e.push((r[t]<<8)+r[t+1]);return e}};er.uint16le={encode(r){let e=Kt.alloc(r.length*2),t=0;return r.forEach(n=>{if(n>65535)throw new RangeError(`uint16le.encode: UINT16LE character code out of range: char[${t/2}]: ${n}`);e[t++]=n&pe[8],e[t++]=n>>8&pe[8]}),e},decode(r){if(r.length%2>0)throw new RangeError(`uint16le.decode: UINT16LE byte length must be even multiple of 2: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=2)e.push((r[t+1]<<8)+r[t]);return e}};er.uint32be={encode(r){let e=Kt.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n>>24&pe[8],e[t++]=n>>16&pe[8],e[t++]=n>>8&pe[8],e[t++]=n&pe[8]}),e},decode(r){if(r.length%4>0)throw new RangeError(`uint32be.decode: UINT32BE byte length must be even multiple of 4: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=4)e.push((r[t]<<24)+(r[t+1]<<16)+(r[t+2]<<8)+r[t+3]);return e}};er.uint32le={encode(r){let e=Kt.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n&pe[8],e[t++]=n>>8&pe[8],e[t++]=n>>16&pe[8],e[t++]=n>>24&pe[8]}),e},decode(r){if(r.length%4>0)throw new RangeError(`uint32le.decode: UINT32LE byte length must be even multiple of 4: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=4)e.push((r[t+3]<<24)+(r[t+2]<<16)+(r[t+1]<<8)+r[t]);return e}};er.string={encode(r){return er.utf16le.encode(r).toString("utf16le")},decode(r){return er.utf16le.decode(Kt.from(r,"utf16le"),0)}};er.escaped={encode(r){let e=[];for(let t=0;t<r.length;t+=1){let n=r[t];if(n===96)e.push(n),e.push(n);else if(n===10)e.push(n);else if(n>=32&&n<=126)e.push(n);else{let s="";if(n>=0&&n<=31)s+=`\`x${Ki[n]}`;else if(n>=127&&n<=255)s+=`\`x${Ki[n]}`;else if(n>=256&&n<=65535)s+=`\`u${Ki[n>>8&pe[8]]}${Ki[n&pe[8]]}`;else if(n>=65536&&n<=4294967295){s+="`u{";let o=n>>24&pe[8];o>0&&(s+=Ki[o]),s+=`${Ki[n>>16&pe[8]]+Ki[n>>8&pe[8]]+Ki[n&pe[8]]}}`}else throw new Error("escape.encode(char): char > 0xffffffff not allowed");Kt.from(s).forEach(o=>{e.push(o)})}}return Kt.from(e)},decode(r){function e(f){return f>=48&&f<=57||f>=65&&f<=70||f>=97&&f<=102}function t(f,d,h){let b={char:null,nexti:f+2,error:!0};if(f+1<d&&e(h[f])&&e(h[f+1])){let p=String.fromCodePoint(h[f],h[f+1]);b.char=parseInt(p,16),Number.isNaN(b.char)||(b.error=!1)}return b}function n(f,d,h){let b={char:null,nexti:f+4,error:!0};if(f+3<d&&e(h[f])&&e(h[f+1])&&e(h[f+2])&&e(h[f+3])){let p=String.fromCodePoint(h[f],h[f+1],h[f+2],h[f+3]);b.char=parseInt(p,16),Number.isNaN(b.char)||(b.error=!1)}return b}function s(f,d,h){let b={char:null,nexti:f+4,error:!0},p="";for(;f<d&&e(h[f]);)p+=String.fromCodePoint(h[f]),f+=1;return b.char=parseInt(p,16),h[f]===125&&!Number.isNaN(b.char)&&(b.error=!1),b.nexti=f+1,b}let i=[],o=r.length,a,c,u,l=0;for(;l<o;){for(;;){if(u=!0,r[l]!==96){i.push(r[l]),l+=1,u=!1;break}if(a=l+1,a>=o)break;if(r[a]===96){i.push(96),l+=2,u=!1;break}if(r[a]===120){if(c=t(a+1,o,r),c.error)break;i.push(c.char),l=c.nexti,u=!1;break}if(r[a]===117){if(r[a+1]===123){if(c=s(a+2,o,r),c.error)break;i.push(c.char),l=c.nexti,u=!1;break}if(c=n(a+1,o,r),c.error)break;i.push(c.char),l=c.nexti,u=!1;break}break}if(u)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${l}]`)}return i}};var Yl=13,bn=10;er.lineEnds={crlf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Yl:t+1<r.length&&r[t+1]===bn?t+=2:t+=1,e.push(Yl),e.push(bn);break;case bn:e.push(Yl),e.push(bn),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==bn&&(e.push(Yl),e.push(bn)),e},lf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Yl:t+1<r.length&&r[t+1]===bn?t+=2:t+=1,e.push(bn);break;case bn:e.push(bn),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==bn&&e.push(bn),e}};er.base64={encode(r){if(r.length===0)return Kt.alloc(0);let e,t,n,s=r.length%3;s=s>0?3-s:0;let i=(r.length+s)/3,o=Kt.alloc(i*4);s>0&&(i-=1),e=0,t=0;for(let a=0;a<i;a+=1)n=r[e++]<<16,n+=r[e++]<<8,n+=r[e++],o[t++]=rn[n>>18&pe[6]],o[t++]=rn[n>>12&pe[6]],o[t++]=rn[n>>6&pe[6]],o[t++]=rn[n&pe[6]];if(s===0)return o;if(s===1)return n=r[e++]<<16,n+=r[e]<<8,o[t++]=rn[n>>18&pe[6]],o[t++]=rn[n>>12&pe[6]],o[t++]=rn[n>>6&pe[6]],o[t]=rn[64],o;if(s===2)return n=r[e]<<16,o[t++]=rn[n>>18&pe[6]],o[t++]=rn[n>>12&pe[6]],o[t++]=rn[64],o[t]=rn[64],o},decode(r){function e(l){let f=[],d=0;for(let h=0;h<l.length;h+=1){let b=l[h],p=!0;for(;p&&!(b===32||b===9||b===10||b===13);){if(b>=65&&b<=90){f.push(b-65);break}if(b>=97&&b<=122){f.push(b-71);break}if(b>=48&&b<=57){f.push(b+4);break}if(b===43){f.push(62);break}if(b===47){f.push(63);break}if(b===61){f.push(64),d+=1;break}throw new RangeError(`base64.decode: invalid character buf[${h}]: ${b}`)}}if(f.length%4>0)throw new RangeError(`base64.decode: string length not integral multiple of 4: ${f.length}`);switch(d){case 0:break;case 1:if(f[f.length-1]!==64)throw new RangeError("base64.decode: one tail character found: not last character");break;case 2:if(f[f.length-1]!==64||f[f.length-2]!==64)throw new RangeError("base64.decode: two tail characters found: not last characters");break;default:throw new RangeError(`base64.decode: more than two tail characters found: ${d}`)}return{tail:d,buf:Kt.from(f)}}if(r.length===0)return Kt.alloc(0);let t=e(r),{tail:n}=t,s=t.buf,i,o,a,c=s.length/4,u=Kt.alloc(c*3-n);n>0&&(c-=1),o=0,i=0;for(let l=0;l<c;l+=1)a=s[i++]<<18,a+=s[i++]<<12,a+=s[i++]<<6,a+=s[i++],u[o++]=a>>16&pe[8],u[o++]=a>>8&pe[8],u[o++]=a&pe[8];return n===1&&(a=s[i++]<<18,a+=s[i++]<<12,a+=s[i]<<6,u[o++]=a>>16&pe[8],u[o]=a>>8&pe[8]),n===2&&(a=s[i++]<<18,a+=s[i++]<<12,u[o]=a>>16&pe[8]),u},toString(r){if(r.length%4>0)throw new RangeError(`base64.toString: input buffer length not multiple of 4: ${r.length}`);let e="",t=0;function n(i,o,a,c){switch(t){case 76:e+=`\r
|
|
1
|
+
"use strict";var MagicFarcasterExtension=(()=>{var k_=Object.create;var Wl=Object.defineProperty;var B_=Object.getOwnPropertyDescriptor;var S_=Object.getOwnPropertyNames,mA=Object.getOwnPropertySymbols,O_=Object.getPrototypeOf,bA=Object.prototype.hasOwnProperty,__=Object.prototype.propertyIsEnumerable;var px=(r,e,t)=>e in r?Wl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,gA=(r,e)=>{for(var t in e||(e={}))bA.call(e,t)&&px(r,t,e[t]);if(mA)for(var t of mA(e))__.call(e,t)&&px(r,t,e[t]);return r};var xA=(r=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(r,{get:(e,t)=>(typeof require!="undefined"?require:e)[t]}):r)(function(r){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var se=(r,e)=>()=>(r&&(e=r(r=0)),e);var M=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),hx=(r,e)=>{for(var t in e)Wl(r,t,{get:e[t],enumerable:!0})},yA=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of S_(e))!bA.call(r,s)&&s!==t&&Wl(r,s,{get:()=>e[s],enumerable:!(n=B_(e,s))||n.enumerable});return r};var l0=(r,e,t)=>(t=r!=null?k_(O_(r)):{},yA(e||!r||!r.__esModule?Wl(t,"default",{value:r,enumerable:!0}):t,r)),C_=r=>yA(Wl({},"__esModule",{value:!0}),r);var tn=(r,e,t)=>(px(r,typeof e!="symbol"?e+"":e,t),t),mx=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)};var fc=(r,e,t)=>(mx(r,e,"read from private field"),t?t.call(r):e.get(r)),vs=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},Jl=(r,e,t,n)=>(mx(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t);var ur=(r,e,t)=>(mx(r,e,"access private method"),t);var bx=(r,e,t)=>new Promise((n,s)=>{var i=c=>{try{a(t.next(c))}catch(u){s(u)}},o=c=>{try{a(t.throw(c))}catch(u){s(u)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(i,o);a((t=t.apply(r,e)).next())});var AA=M((Lz,wA)=>{wA.exports=Magic});var TA=M(f0=>{"use strict";f0.byteLength=I_;f0.toByteArray=M_;f0.fromByteArray=U_;var Ts=[],mn=[],N_=typeof Uint8Array<"u"?Uint8Array:Array,gx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ga=0,EA=gx.length;ga<EA;++ga)Ts[ga]=gx[ga],mn[gx.charCodeAt(ga)]=ga;var ga,EA;mn["-".charCodeAt(0)]=62;mn["_".charCodeAt(0)]=63;function vA(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function I_(r){var e=vA(r),t=e[0],n=e[1];return(t+n)*3/4-n}function R_(r,e,t){return(e+t)*3/4-t}function M_(r){var e,t=vA(r),n=t[0],s=t[1],i=new N_(R_(r,n,s)),o=0,a=s>0?n-4:n,c;for(c=0;c<a;c+=4)e=mn[r.charCodeAt(c)]<<18|mn[r.charCodeAt(c+1)]<<12|mn[r.charCodeAt(c+2)]<<6|mn[r.charCodeAt(c+3)],i[o++]=e>>16&255,i[o++]=e>>8&255,i[o++]=e&255;return s===2&&(e=mn[r.charCodeAt(c)]<<2|mn[r.charCodeAt(c+1)]>>4,i[o++]=e&255),s===1&&(e=mn[r.charCodeAt(c)]<<10|mn[r.charCodeAt(c+1)]<<4|mn[r.charCodeAt(c+2)]>>2,i[o++]=e>>8&255,i[o++]=e&255),i}function L_(r){return Ts[r>>18&63]+Ts[r>>12&63]+Ts[r>>6&63]+Ts[r&63]}function j_(r,e,t){for(var n,s=[],i=e;i<t;i+=3)n=(r[i]<<16&16711680)+(r[i+1]<<8&65280)+(r[i+2]&255),s.push(L_(n));return s.join("")}function U_(r){for(var e,t=r.length,n=t%3,s=[],i=16383,o=0,a=t-n;o<a;o+=i)s.push(j_(r,o,o+i>a?a:o+i));return n===1?(e=r[t-1],s.push(Ts[e>>2]+Ts[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],s.push(Ts[e>>10]+Ts[e>>4&63]+Ts[e<<2&63]+"=")),s.join("")}});var PA=M(xx=>{xx.read=function(r,e,t,n,s){var i,o,a=s*8-n-1,c=(1<<a)-1,u=c>>1,l=-7,f=t?s-1:0,d=t?-1:1,h=r[e+f];for(f+=d,i=h&(1<<-l)-1,h>>=-l,l+=a;l>0;i=i*256+r[e+f],f+=d,l-=8);for(o=i&(1<<-l)-1,i>>=-l,l+=n;l>0;o=o*256+r[e+f],f+=d,l-=8);if(i===0)i=1-u;else{if(i===c)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,n),i=i-u}return(h?-1:1)*o*Math.pow(2,i-n)};xx.write=function(r,e,t,n,s,i){var o,a,c,u=i*8-s-1,l=(1<<u)-1,f=l>>1,d=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,b=n?1:-1,p=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+f>=1?e+=d/c:e+=d*Math.pow(2,1-f),e*c>=2&&(o++,c/=2),o+f>=l?(a=0,o=l):o+f>=1?(a=(e*c-1)*Math.pow(2,s),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,s),o=0));s>=8;r[t+h]=a&255,h+=b,a/=256,s-=8);for(o=o<<s|a,u+=s;u>0;r[t+h]=o&255,h+=b,o/=256,u-=8);r[t+h-b]|=p*128}});var h0=M(pc=>{"use strict";var yx=TA(),dc=PA(),kA=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;pc.Buffer=X;pc.SlowBuffer=G_;pc.INSPECT_MAX_BYTES=50;var d0=2147483647;pc.kMaxLength=d0;X.TYPED_ARRAY_SUPPORT=F_();!X.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function F_(){try{var r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(X.prototype,"parent",{enumerable:!0,get:function(){if(!!X.isBuffer(this))return this.buffer}});Object.defineProperty(X.prototype,"offset",{enumerable:!0,get:function(){if(!!X.isBuffer(this))return this.byteOffset}});function ai(r){if(r>d0)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);return Object.setPrototypeOf(e,X.prototype),e}function X(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return vx(r)}return OA(r,e,t)}X.poolSize=8192;function OA(r,e,t){if(typeof r=="string")return H_(r,e);if(ArrayBuffer.isView(r))return $_(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(Ps(r,ArrayBuffer)||r&&Ps(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ps(r,SharedArrayBuffer)||r&&Ps(r.buffer,SharedArrayBuffer)))return Ax(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return X.from(n,e,t);var s=q_(r);if(s)return s;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return X.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}X.from=function(r,e,t){return OA(r,e,t)};Object.setPrototypeOf(X.prototype,Uint8Array.prototype);Object.setPrototypeOf(X,Uint8Array);function _A(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function D_(r,e,t){return _A(r),r<=0?ai(r):e!==void 0?typeof t=="string"?ai(r).fill(e,t):ai(r).fill(e):ai(r)}X.alloc=function(r,e,t){return D_(r,e,t)};function vx(r){return _A(r),ai(r<0?0:Tx(r)|0)}X.allocUnsafe=function(r){return vx(r)};X.allocUnsafeSlow=function(r){return vx(r)};function H_(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!X.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var t=CA(r,e)|0,n=ai(t),s=n.write(r,e);return s!==t&&(n=n.slice(0,s)),n}function wx(r){for(var e=r.length<0?0:Tx(r.length)|0,t=ai(e),n=0;n<e;n+=1)t[n]=r[n]&255;return t}function $_(r){if(Ps(r,Uint8Array)){var e=new Uint8Array(r);return Ax(e.buffer,e.byteOffset,e.byteLength)}return wx(r)}function Ax(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');var n;return e===void 0&&t===void 0?n=new Uint8Array(r):t===void 0?n=new Uint8Array(r,e):n=new Uint8Array(r,e,t),Object.setPrototypeOf(n,X.prototype),n}function q_(r){if(X.isBuffer(r)){var e=Tx(r.length)|0,t=ai(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||Px(r.length)?ai(0):wx(r);if(r.type==="Buffer"&&Array.isArray(r.data))return wx(r.data)}function Tx(r){if(r>=d0)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d0.toString(16)+" bytes");return r|0}function G_(r){return+r!=r&&(r=0),X.alloc(+r)}X.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==X.prototype};X.compare=function(e,t){if(Ps(e,Uint8Array)&&(e=X.from(e,e.offset,e.byteLength)),Ps(t,Uint8Array)&&(t=X.from(t,t.offset,t.byteLength)),!X.isBuffer(e)||!X.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,s=t.length,i=0,o=Math.min(n,s);i<o;++i)if(e[i]!==t[i]){n=e[i],s=t[i];break}return n<s?-1:s<n?1:0};X.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};X.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return X.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var s=X.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(Ps(o,Uint8Array))i+o.length>s.length?X.from(o).copy(s,i):Uint8Array.prototype.set.call(s,o,i);else if(X.isBuffer(o))o.copy(s,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return s};function CA(r,e){if(X.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||Ps(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);var t=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;for(var s=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Ex(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return jA(r).length;default:if(s)return n?-1:Ex(r).length;e=(""+e).toLowerCase(),s=!0}}X.byteLength=CA;function z_(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return t7(this,e,t);case"utf8":case"utf-8":return IA(this,e,t);case"ascii":return X_(this,e,t);case"latin1":case"binary":return e7(this,e,t);case"base64":return Y_(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r7(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}X.prototype._isBuffer=!0;function xa(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}X.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)xa(this,t,t+1);return this};X.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)xa(this,t,t+3),xa(this,t+1,t+2);return this};X.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)xa(this,t,t+7),xa(this,t+1,t+6),xa(this,t+2,t+5),xa(this,t+3,t+4);return this};X.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?IA(this,0,e):z_.apply(this,arguments)};X.prototype.toLocaleString=X.prototype.toString;X.prototype.equals=function(e){if(!X.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:X.compare(this,e)===0};X.prototype.inspect=function(){var e="",t=pc.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"};kA&&(X.prototype[kA]=X.prototype.inspect);X.prototype.compare=function(e,t,n,s,i){if(Ps(e,Uint8Array)&&(e=X.from(e,e.offset,e.byteLength)),!X.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),s===void 0&&(s=0),i===void 0&&(i=this.length),t<0||n>e.length||s<0||i>this.length)throw new RangeError("out of range index");if(s>=i&&t>=n)return 0;if(s>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,s>>>=0,i>>>=0,this===e)return 0;for(var o=i-s,a=n-t,c=Math.min(o,a),u=this.slice(s,i),l=e.slice(t,n),f=0;f<c;++f)if(u[f]!==l[f]){o=u[f],a=l[f];break}return o<a?-1:a<o?1:0};function NA(r,e,t,n,s){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Px(t)&&(t=s?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(s)return-1;t=r.length-1}else if(t<0)if(s)t=0;else return-1;if(typeof e=="string"&&(e=X.from(e,n)),X.isBuffer(e))return e.length===0?-1:BA(r,e,t,n,s);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?s?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):BA(r,[e],t,n,s);throw new TypeError("val must be string, number or Buffer")}function BA(r,e,t,n,s){var i=1,o=r.length,a=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;i=2,o/=2,a/=2,t/=2}function c(h,b){return i===1?h[b]:h.readUInt16BE(b*i)}var u;if(s){var l=-1;for(u=t;u<o;u++)if(c(r,u)===c(e,l===-1?0:u-l)){if(l===-1&&(l=u),u-l+1===a)return l*i}else l!==-1&&(u-=u-l),l=-1}else for(t+a>o&&(t=o-a),u=t;u>=0;u--){for(var f=!0,d=0;d<a;d++)if(c(r,u+d)!==c(e,d)){f=!1;break}if(f)return u}return-1}X.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1};X.prototype.indexOf=function(e,t,n){return NA(this,e,t,n,!0)};X.prototype.lastIndexOf=function(e,t,n){return NA(this,e,t,n,!1)};function V_(r,e,t,n){t=Number(t)||0;var s=r.length-t;n?(n=Number(n),n>s&&(n=s)):n=s;var i=e.length;n>i/2&&(n=i/2);for(var o=0;o<n;++o){var a=parseInt(e.substr(o*2,2),16);if(Px(a))return o;r[t+o]=a}return o}function K_(r,e,t,n){return p0(Ex(e,r.length-t),r,t,n)}function W_(r,e,t,n){return p0(i7(e),r,t,n)}function J_(r,e,t,n){return p0(jA(e),r,t,n)}function Q_(r,e,t,n){return p0(o7(e,r.length-t),r,t,n)}X.prototype.write=function(e,t,n,s){if(t===void 0)s="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")s=t,n=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(n)?(n=n>>>0,s===void 0&&(s="utf8")):(s=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");s||(s="utf8");for(var o=!1;;)switch(s){case"hex":return V_(this,e,t,n);case"utf8":case"utf-8":return K_(this,e,t,n);case"ascii":case"latin1":case"binary":return W_(this,e,t,n);case"base64":return J_(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q_(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+s);s=(""+s).toLowerCase(),o=!0}};X.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Y_(r,e,t){return e===0&&t===r.length?yx.fromByteArray(r):yx.fromByteArray(r.slice(e,t))}function IA(r,e,t){t=Math.min(r.length,t);for(var n=[],s=e;s<t;){var i=r[s],o=null,a=i>239?4:i>223?3:i>191?2:1;if(s+a<=t){var c,u,l,f;switch(a){case 1:i<128&&(o=i);break;case 2:c=r[s+1],(c&192)===128&&(f=(i&31)<<6|c&63,f>127&&(o=f));break;case 3:c=r[s+1],u=r[s+2],(c&192)===128&&(u&192)===128&&(f=(i&15)<<12|(c&63)<<6|u&63,f>2047&&(f<55296||f>57343)&&(o=f));break;case 4:c=r[s+1],u=r[s+2],l=r[s+3],(c&192)===128&&(u&192)===128&&(l&192)===128&&(f=(i&15)<<18|(c&63)<<12|(u&63)<<6|l&63,f>65535&&f<1114112&&(o=f))}}o===null?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),s+=a}return Z_(n)}var SA=4096;function Z_(r){var e=r.length;if(e<=SA)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=SA));return t}function X_(r,e,t){var n="";t=Math.min(r.length,t);for(var s=e;s<t;++s)n+=String.fromCharCode(r[s]&127);return n}function e7(r,e,t){var n="";t=Math.min(r.length,t);for(var s=e;s<t;++s)n+=String.fromCharCode(r[s]);return n}function t7(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var s="",i=e;i<t;++i)s+=a7[r[i]];return s}function r7(r,e,t){for(var n=r.slice(e,t),s="",i=0;i<n.length-1;i+=2)s+=String.fromCharCode(n[i]+n[i+1]*256);return s}X.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var s=this.subarray(e,t);return Object.setPrototypeOf(s,X.prototype),s};function Xt(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}X.prototype.readUintLE=X.prototype.readUIntLE=function(e,t,n){e=e>>>0,t=t>>>0,n||Xt(e,t,this.length);for(var s=this[e],i=1,o=0;++o<t&&(i*=256);)s+=this[e+o]*i;return s};X.prototype.readUintBE=X.prototype.readUIntBE=function(e,t,n){e=e>>>0,t=t>>>0,n||Xt(e,t,this.length);for(var s=this[e+--t],i=1;t>0&&(i*=256);)s+=this[e+--t]*i;return s};X.prototype.readUint8=X.prototype.readUInt8=function(e,t){return e=e>>>0,t||Xt(e,1,this.length),this[e]};X.prototype.readUint16LE=X.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||Xt(e,2,this.length),this[e]|this[e+1]<<8};X.prototype.readUint16BE=X.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||Xt(e,2,this.length),this[e]<<8|this[e+1]};X.prototype.readUint32LE=X.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||Xt(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};X.prototype.readUint32BE=X.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||Xt(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};X.prototype.readIntLE=function(e,t,n){e=e>>>0,t=t>>>0,n||Xt(e,t,this.length);for(var s=this[e],i=1,o=0;++o<t&&(i*=256);)s+=this[e+o]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s};X.prototype.readIntBE=function(e,t,n){e=e>>>0,t=t>>>0,n||Xt(e,t,this.length);for(var s=t,i=1,o=this[e+--s];s>0&&(i*=256);)o+=this[e+--s]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};X.prototype.readInt8=function(e,t){return e=e>>>0,t||Xt(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};X.prototype.readInt16LE=function(e,t){e=e>>>0,t||Xt(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};X.prototype.readInt16BE=function(e,t){e=e>>>0,t||Xt(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};X.prototype.readInt32LE=function(e,t){return e=e>>>0,t||Xt(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};X.prototype.readInt32BE=function(e,t){return e=e>>>0,t||Xt(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};X.prototype.readFloatLE=function(e,t){return e=e>>>0,t||Xt(e,4,this.length),dc.read(this,e,!0,23,4)};X.prototype.readFloatBE=function(e,t){return e=e>>>0,t||Xt(e,4,this.length),dc.read(this,e,!1,23,4)};X.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||Xt(e,8,this.length),dc.read(this,e,!0,52,8)};X.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||Xt(e,8,this.length),dc.read(this,e,!1,52,8)};function Fr(r,e,t,n,s,i){if(!X.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>s||e<i)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}X.prototype.writeUintLE=X.prototype.writeUIntLE=function(e,t,n,s){if(e=+e,t=t>>>0,n=n>>>0,!s){var i=Math.pow(2,8*n)-1;Fr(this,e,t,n,i,0)}var o=1,a=0;for(this[t]=e&255;++a<n&&(o*=256);)this[t+a]=e/o&255;return t+n};X.prototype.writeUintBE=X.prototype.writeUIntBE=function(e,t,n,s){if(e=+e,t=t>>>0,n=n>>>0,!s){var i=Math.pow(2,8*n)-1;Fr(this,e,t,n,i,0)}var o=n-1,a=1;for(this[t+o]=e&255;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+n};X.prototype.writeUint8=X.prototype.writeUInt8=function(e,t,n){return e=+e,t=t>>>0,n||Fr(this,e,t,1,255,0),this[t]=e&255,t+1};X.prototype.writeUint16LE=X.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t>>>0,n||Fr(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};X.prototype.writeUint16BE=X.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t>>>0,n||Fr(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};X.prototype.writeUint32LE=X.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t>>>0,n||Fr(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};X.prototype.writeUint32BE=X.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t>>>0,n||Fr(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};X.prototype.writeIntLE=function(e,t,n,s){if(e=+e,t=t>>>0,!s){var i=Math.pow(2,8*n-1);Fr(this,e,t,n,i-1,-i)}var o=0,a=1,c=0;for(this[t]=e&255;++o<n&&(a*=256);)e<0&&c===0&&this[t+o-1]!==0&&(c=1),this[t+o]=(e/a>>0)-c&255;return t+n};X.prototype.writeIntBE=function(e,t,n,s){if(e=+e,t=t>>>0,!s){var i=Math.pow(2,8*n-1);Fr(this,e,t,n,i-1,-i)}var o=n-1,a=1,c=0;for(this[t+o]=e&255;--o>=0&&(a*=256);)e<0&&c===0&&this[t+o+1]!==0&&(c=1),this[t+o]=(e/a>>0)-c&255;return t+n};X.prototype.writeInt8=function(e,t,n){return e=+e,t=t>>>0,n||Fr(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};X.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t>>>0,n||Fr(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};X.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t>>>0,n||Fr(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};X.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t>>>0,n||Fr(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};X.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t>>>0,n||Fr(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function RA(r,e,t,n,s,i){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function MA(r,e,t,n,s){return e=+e,t=t>>>0,s||RA(r,e,t,4,34028234663852886e22,-34028234663852886e22),dc.write(r,e,t,n,23,4),t+4}X.prototype.writeFloatLE=function(e,t,n){return MA(this,e,t,!0,n)};X.prototype.writeFloatBE=function(e,t,n){return MA(this,e,t,!1,n)};function LA(r,e,t,n,s){return e=+e,t=t>>>0,s||RA(r,e,t,8,17976931348623157e292,-17976931348623157e292),dc.write(r,e,t,n,52,8),t+8}X.prototype.writeDoubleLE=function(e,t,n){return LA(this,e,t,!0,n)};X.prototype.writeDoubleBE=function(e,t,n){return LA(this,e,t,!1,n)};X.prototype.copy=function(e,t,n,s){if(!X.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!s&&s!==0&&(s=this.length),t>=e.length&&(t=e.length),t||(t=0),s>0&&s<n&&(s=n),s===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(s<0)throw new RangeError("sourceEnd out of bounds");s>this.length&&(s=this.length),e.length-t<s-n&&(s=e.length-t+n);var i=s-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,s):Uint8Array.prototype.set.call(e,this.subarray(n,s),t),i};X.prototype.fill=function(e,t,n,s){if(typeof e=="string"){if(typeof t=="string"?(s=t,t=0,n=this.length):typeof n=="string"&&(s=n,n=this.length),s!==void 0&&typeof s!="string")throw new TypeError("encoding must be a string");if(typeof s=="string"&&!X.isEncoding(s))throw new TypeError("Unknown encoding: "+s);if(e.length===1){var i=e.charCodeAt(0);(s==="utf8"&&i<128||s==="latin1")&&(e=i)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var o;if(typeof e=="number")for(o=t;o<n;++o)this[o]=e;else{var a=X.isBuffer(e)?e:X.from(e,s),c=a.length;if(c===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=a[o%c]}return this};var n7=/[^+/0-9A-Za-z-_]/g;function s7(r){if(r=r.split("=")[0],r=r.trim().replace(n7,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function Ex(r,e){e=e||1/0;for(var t,n=r.length,s=null,i=[],o=0;o<n;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!s){if(t>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}s=t;continue}if(t<56320){(e-=3)>-1&&i.push(239,191,189),s=t;continue}t=(s-55296<<10|t-56320)+65536}else s&&(e-=3)>-1&&i.push(239,191,189);if(s=null,t<128){if((e-=1)<0)break;i.push(t)}else if(t<2048){if((e-=2)<0)break;i.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;i.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;i.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return i}function i7(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function o7(r,e){for(var t,n,s,i=[],o=0;o<r.length&&!((e-=2)<0);++o)t=r.charCodeAt(o),n=t>>8,s=t%256,i.push(s),i.push(n);return i}function jA(r){return yx.toByteArray(s7(r))}function p0(r,e,t,n){for(var s=0;s<n&&!(s+t>=e.length||s>=r.length);++s)e[s+t]=r[s];return s}function Ps(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function Px(r){return r!==r}var a7=function(){for(var r="0123456789abcdef",e=new Array(256),t=0;t<16;++t)for(var n=t*16,s=0;s<16;++s)e[n+s]=r[t]+r[s];return e}()});var Yn=M((Dz,UA)=>{UA.exports={ALT:1,CAT:2,REP:3,RNM:4,TRG:5,TBS:6,TLS:7,UDT:11,AND:12,NOT:13,BKR:14,BKA:15,BKN:16,ABG:17,AEN:18,ACTIVE:100,MATCH:101,EMPTY:102,NOMATCH:103,SEM_PRE:200,SEM_POST:201,SEM_OK:300,SEM_SKIP:301,ATTR_N:400,ATTR_R:401,ATTR_MR:402,LOOKAROUND_NONE:500,LOOKAROUND_AHEAD:501,LOOKAROUND_BEHIND:502,BKR_MODE_UM:601,BKR_MODE_PM:602,BKR_MODE_CS:603,BKR_MODE_CI:604}});var Ql=M((Hz,FA)=>{FA.exports={CLASS_MONOSPACE:"apg-mono",CLASS_ACTIVE:"apg-active",CLASS_EMPTY:"apg-empty",CLASS_MATCH:"apg-match",CLASS_NOMATCH:"apg-nomatch",CLASS_LOOKAHEAD:"apg-lh-match",CLASS_LOOKBEHIND:"apg-lb-match",CLASS_REMAINDER:"apg-remainder",CLASS_CTRLCHAR:"apg-ctrl-char",CLASS_LINEEND:"apg-line-end",CLASS_ERROR:"apg-error",CLASS_PHRASE:"apg-phrase",CLASS_EMPTYPHRASE:"apg-empty-phrase",CLASS_STATE:"apg-state",CLASS_STATS:"apg-stats",CLASS_TRACE:"apg-trace",CLASS_GRAMMAR:"apg-grammar",CLASS_RULES:"apg-rules",CLASS_RULESLINK:"apg-rules-link",CLASS_ATTRIBUTES:"apg-attrs"}});var HA=M(er=>{var{Buffer:Kt}=h0(),m0=4294967292,b0=4294967293,kx=4294967294,DA=4294967295,pe=[0,1,3,7,15,31,63,127,255,511,1023],Ki=["00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F","10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F","20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F","30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F","40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F","50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F","60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F","70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F","80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F","90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF","D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF","E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF","F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"],c7="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),rn=[];c7.forEach(r=>{rn.push(r.charCodeAt(0))});er.utf8={encode(r){let e=[];return r.forEach(t=>{if(t>=0&&t<=127)e.push(t);else if(t<=2047)e.push(192+(t>>6&pe[5])),e.push(128+(t&pe[6]));else if(t<55296||t>57343&&t<=65535)e.push(224+(t>>12&pe[4])),e.push(128+(t>>6&pe[6])),e.push(128+(t&pe[6]));else if(t>=65536&&t<=1114111){let n=t>>16&pe[5];e.push(240+(n>>2)),e.push(128+((n&pe[2])<<4)+(t>>12&pe[4])),e.push(128+(t>>6&pe[6])),e.push(128+(t&pe[6]))}else throw new RangeError(`utf8.encode: character out of range: char: ${t}`)}),Kt.from(e)},decode(r,e){function t(b,p){if((p&192)!==128)return b0;let g=((b&pe[5])<<6)+(p&pe[6]);return g<128?m0:g}function n(b,p,g){if((g&192)!==128||(p&192)!==128)return b0;let m=((b&pe[4])<<12)+((p&pe[6])<<6)+(g&pe[6]);return m<2048?m0:m>=55296&&m<=57343?kx:m}function s(b,p,g,m){if((m&192)!==128||(g&192)!==128||(p&192)!==128)return b0;let y=(((b&pe[3])<<2)+(p>>4&pe[2])<<16)+((p&pe[4])<<12)+((g&pe[6])<<6)+(m&pe[6]);return y<65536?m0:y>1114111?kx:y}let i,o,a,c,u,l,f=r.length,d=e?3:0,h=[];for(;d<f;){o=r[d],i=DA;let b=!0;for(;b;){if(o>=0&&o<=127){i=o,l=1;break}if(a=d+1,a<f&&o>=194&&o<=223){i=t(o,r[a]),l=2;break}if(c=d+2,c<f&&o>=224&&o<=239){i=n(o,r[a],r[c]),l=3;break}if(u=d+3,u<f&&o>=240&&o<=244){i=s(o,r[a],r[c],r[u]),l=4;break}break}if(i>1114111){let p=`byte[${d}]`;throw i===DA?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${p}`):i===b0?new RangeError(`utf8.decode: illegal trailing byte found at: ${p}`):i===kx?new RangeError(`utf8.decode: code point out of range found at: ${p}`):i===m0?new RangeError(`utf8.decode: non-shortest form found at: ${p}`):new RangeError(`utf8.decode: unrecognized error found at: ${p}`)}h.push(i),d+=l}return h}};er.utf16be={encode(r){let e=[],t,n,s;for(let i=0;i<r.length;i+=1)if(t=r[i],t>=0&&t<=55295||t>=57344&&t<=65535)e.push(t>>8&pe[8]),e.push(t&pe[8]);else if(t>=65536&&t<=1114111)s=t-65536,n=55296+(s>>10),s=56320+(s&pe[10]),e.push(n>>8&pe[8]),e.push(n&pe[8]),e.push(s>>8&pe[8]),e.push(s&pe[8]);else throw new RangeError(`utf16be.encode: UTF16BE value out of range: char[${i}]: ${t}`);return Kt.from(e)},decode(r,e){if(r.length%2>0)throw new RangeError(`utf16be.decode: data length must be even multiple of 2: length: ${r.length}`);let t=[],n=r.length,s=e?2:0,i=0,o,a,c,u,l,f;for(;s<n;){for(;;){if(c=s+1,c<n){if(l=(r[s]<<8)+r[c],l<55296||l>57343){o=l,a=2;break}if(u=s+3,u<n&&(f=(r[s+2]<<8)+r[u],l<=56319&&f>=56320&&f<=57343)){o=65536+(l-55296<<10)+(f-56320),a=4;break}}throw new RangeError(`utf16be.decode: ill-formed UTF16BE byte sequence found: byte[${s}]`)}t[i++]=o,s+=a}return t}};er.utf16le={encode(r){let e=[],t,n,s;for(let i=0;i<r.length;i+=1)if(t=r[i],t>=0&&t<=55295||t>=57344&&t<=65535)e.push(t&pe[8]),e.push(t>>8&pe[8]);else if(t>=65536&&t<=1114111)s=t-65536,n=55296+(s>>10),s=56320+(s&pe[10]),e.push(n&pe[8]),e.push(n>>8&pe[8]),e.push(s&pe[8]),e.push(s>>8&pe[8]);else throw new RangeError(`utf16le.encode: UTF16LE value out of range: char[${i}]: ${t}`);return Kt.from(e)},decode(r,e){if(r.length%2>0)throw new RangeError(`utf16le.decode: data length must be even multiple of 2: length: ${r.length}`);let t=[],n=r.length,s=e?2:0,i=0,o,a,c,u,l,f;for(;s<n;){for(;;){if(c=s+1,c<n){if(l=(r[c]<<8)+r[s],l<55296||l>57343){o=l,a=2;break}if(u=s+3,u<n&&(f=(r[u]<<8)+r[s+2],l<=56319&&f>=56320&&f<=57343)){o=65536+(l-55296<<10)+(f-56320),a=4;break}}throw new RangeError(`utf16le.decode: ill-formed UTF16LE byte sequence found: byte[${s}]`)}t[i++]=o,s+=a}return t}};er.utf32be={encode(r){let e=Kt.alloc(r.length*4),t=0;return r.forEach(n=>{if(n>=55296&&n<=57343||n>1114111)throw new RangeError(`utf32be.encode: UTF32BE character code out of range: char[${t/4}]: ${n}`);e[t++]=n>>24&pe[8],e[t++]=n>>16&pe[8],e[t++]=n>>8&pe[8],e[t++]=n&pe[8]}),e},decode(r,e){if(r.length%4>0)throw new RangeError(`utf32be.decode: UTF32BE byte length must be even multiple of 4: length: ${r.length}`);let t=[],n=e?4:0;for(;n<r.length;n+=4){let s=(r[n]<<24)+(r[n+1]<<16)+(r[n+2]<<8)+r[n+3];if(s>=55296&&s<=57343||s>1114111)throw new RangeError(`utf32be.decode: UTF32BE character code out of range: char[${n/4}]: ${s}`);t.push(s)}return t}};er.utf32le={encode(r){let e=Kt.alloc(r.length*4),t=0;return r.forEach(n=>{if(n>=55296&&n<=57343||n>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${t/4}]: ${n}`);e[t++]=n&pe[8],e[t++]=n>>8&pe[8],e[t++]=n>>16&pe[8],e[t++]=n>>24&pe[8]}),e},decode(r,e){if(r.length%4>0)throw new RangeError(`utf32be.decode: UTF32LE byte length must be even multiple of 4: length: ${r.length}`);let t=[],n=e?4:0;for(;n<r.length;n+=4){let s=(r[n+3]<<24)+(r[n+2]<<16)+(r[n+1]<<8)+r[n];if(s>=55296&&s<=57343||s>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${n/4}]: ${s}`);t.push(s)}return t}};er.uint7={encode(r){let e=Kt.alloc(r.length);for(let t=0;t<r.length;t+=1){if(r[t]>127)throw new RangeError(`uint7.encode: UINT7 character code out of range: char[${t}]: ${r[t]}`);e[t]=r[t]}return e},decode(r){let e=[];for(let t=0;t<r.length;t+=1){if(r[t]>127)throw new RangeError(`uint7.decode: UINT7 character code out of range: byte[${t}]: ${r[t]}`);e[t]=r[t]}return e}};er.uint8={encode(r){let e=Kt.alloc(r.length);for(let t=0;t<r.length;t+=1){if(r[t]>255)throw new RangeError(`uint8.encode: UINT8 character code out of range: char[${t}]: ${r[t]}`);e[t]=r[t]}return e},decode(r){let e=[];for(let t=0;t<r.length;t+=1)e[t]=r[t];return e}};er.uint16be={encode(r){let e=Kt.alloc(r.length*2),t=0;return r.forEach(n=>{if(n>65535)throw new RangeError(`uint16be.encode: UINT16BE character code out of range: char[${t/2}]: ${n}`);e[t++]=n>>8&pe[8],e[t++]=n&pe[8]}),e},decode(r){if(r.length%2>0)throw new RangeError(`uint16be.decode: UINT16BE byte length must be even multiple of 2: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=2)e.push((r[t]<<8)+r[t+1]);return e}};er.uint16le={encode(r){let e=Kt.alloc(r.length*2),t=0;return r.forEach(n=>{if(n>65535)throw new RangeError(`uint16le.encode: UINT16LE character code out of range: char[${t/2}]: ${n}`);e[t++]=n&pe[8],e[t++]=n>>8&pe[8]}),e},decode(r){if(r.length%2>0)throw new RangeError(`uint16le.decode: UINT16LE byte length must be even multiple of 2: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=2)e.push((r[t+1]<<8)+r[t]);return e}};er.uint32be={encode(r){let e=Kt.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n>>24&pe[8],e[t++]=n>>16&pe[8],e[t++]=n>>8&pe[8],e[t++]=n&pe[8]}),e},decode(r){if(r.length%4>0)throw new RangeError(`uint32be.decode: UINT32BE byte length must be even multiple of 4: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=4)e.push((r[t]<<24)+(r[t+1]<<16)+(r[t+2]<<8)+r[t+3]);return e}};er.uint32le={encode(r){let e=Kt.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n&pe[8],e[t++]=n>>8&pe[8],e[t++]=n>>16&pe[8],e[t++]=n>>24&pe[8]}),e},decode(r){if(r.length%4>0)throw new RangeError(`uint32le.decode: UINT32LE byte length must be even multiple of 4: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=4)e.push((r[t+3]<<24)+(r[t+2]<<16)+(r[t+1]<<8)+r[t]);return e}};er.string={encode(r){return er.utf16le.encode(r).toString("utf16le")},decode(r){return er.utf16le.decode(Kt.from(r,"utf16le"),0)}};er.escaped={encode(r){let e=[];for(let t=0;t<r.length;t+=1){let n=r[t];if(n===96)e.push(n),e.push(n);else if(n===10)e.push(n);else if(n>=32&&n<=126)e.push(n);else{let s="";if(n>=0&&n<=31)s+=`\`x${Ki[n]}`;else if(n>=127&&n<=255)s+=`\`x${Ki[n]}`;else if(n>=256&&n<=65535)s+=`\`u${Ki[n>>8&pe[8]]}${Ki[n&pe[8]]}`;else if(n>=65536&&n<=4294967295){s+="`u{";let o=n>>24&pe[8];o>0&&(s+=Ki[o]),s+=`${Ki[n>>16&pe[8]]+Ki[n>>8&pe[8]]+Ki[n&pe[8]]}}`}else throw new Error("escape.encode(char): char > 0xffffffff not allowed");Kt.from(s).forEach(o=>{e.push(o)})}}return Kt.from(e)},decode(r){function e(f){return f>=48&&f<=57||f>=65&&f<=70||f>=97&&f<=102}function t(f,d,h){let b={char:null,nexti:f+2,error:!0};if(f+1<d&&e(h[f])&&e(h[f+1])){let p=String.fromCodePoint(h[f],h[f+1]);b.char=parseInt(p,16),Number.isNaN(b.char)||(b.error=!1)}return b}function n(f,d,h){let b={char:null,nexti:f+4,error:!0};if(f+3<d&&e(h[f])&&e(h[f+1])&&e(h[f+2])&&e(h[f+3])){let p=String.fromCodePoint(h[f],h[f+1],h[f+2],h[f+3]);b.char=parseInt(p,16),Number.isNaN(b.char)||(b.error=!1)}return b}function s(f,d,h){let b={char:null,nexti:f+4,error:!0},p="";for(;f<d&&e(h[f]);)p+=String.fromCodePoint(h[f]),f+=1;return b.char=parseInt(p,16),h[f]===125&&!Number.isNaN(b.char)&&(b.error=!1),b.nexti=f+1,b}let i=[],o=r.length,a,c,u,l=0;for(;l<o;){for(;;){if(u=!0,r[l]!==96){i.push(r[l]),l+=1,u=!1;break}if(a=l+1,a>=o)break;if(r[a]===96){i.push(96),l+=2,u=!1;break}if(r[a]===120){if(c=t(a+1,o,r),c.error)break;i.push(c.char),l=c.nexti,u=!1;break}if(r[a]===117){if(r[a+1]===123){if(c=s(a+2,o,r),c.error)break;i.push(c.char),l=c.nexti,u=!1;break}if(c=n(a+1,o,r),c.error)break;i.push(c.char),l=c.nexti,u=!1;break}break}if(u)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${l}]`)}return i}};var Yl=13,bn=10;er.lineEnds={crlf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Yl:t+1<r.length&&r[t+1]===bn?t+=2:t+=1,e.push(Yl),e.push(bn);break;case bn:e.push(Yl),e.push(bn),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==bn&&(e.push(Yl),e.push(bn)),e},lf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Yl:t+1<r.length&&r[t+1]===bn?t+=2:t+=1,e.push(bn);break;case bn:e.push(bn),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==bn&&e.push(bn),e}};er.base64={encode(r){if(r.length===0)return Kt.alloc(0);let e,t,n,s=r.length%3;s=s>0?3-s:0;let i=(r.length+s)/3,o=Kt.alloc(i*4);s>0&&(i-=1),e=0,t=0;for(let a=0;a<i;a+=1)n=r[e++]<<16,n+=r[e++]<<8,n+=r[e++],o[t++]=rn[n>>18&pe[6]],o[t++]=rn[n>>12&pe[6]],o[t++]=rn[n>>6&pe[6]],o[t++]=rn[n&pe[6]];if(s===0)return o;if(s===1)return n=r[e++]<<16,n+=r[e]<<8,o[t++]=rn[n>>18&pe[6]],o[t++]=rn[n>>12&pe[6]],o[t++]=rn[n>>6&pe[6]],o[t]=rn[64],o;if(s===2)return n=r[e]<<16,o[t++]=rn[n>>18&pe[6]],o[t++]=rn[n>>12&pe[6]],o[t++]=rn[64],o[t]=rn[64],o},decode(r){function e(l){let f=[],d=0;for(let h=0;h<l.length;h+=1){let b=l[h],p=!0;for(;p&&!(b===32||b===9||b===10||b===13);){if(b>=65&&b<=90){f.push(b-65);break}if(b>=97&&b<=122){f.push(b-71);break}if(b>=48&&b<=57){f.push(b+4);break}if(b===43){f.push(62);break}if(b===47){f.push(63);break}if(b===61){f.push(64),d+=1;break}throw new RangeError(`base64.decode: invalid character buf[${h}]: ${b}`)}}if(f.length%4>0)throw new RangeError(`base64.decode: string length not integral multiple of 4: ${f.length}`);switch(d){case 0:break;case 1:if(f[f.length-1]!==64)throw new RangeError("base64.decode: one tail character found: not last character");break;case 2:if(f[f.length-1]!==64||f[f.length-2]!==64)throw new RangeError("base64.decode: two tail characters found: not last characters");break;default:throw new RangeError(`base64.decode: more than two tail characters found: ${d}`)}return{tail:d,buf:Kt.from(f)}}if(r.length===0)return Kt.alloc(0);let t=e(r),{tail:n}=t,s=t.buf,i,o,a,c=s.length/4,u=Kt.alloc(c*3-n);n>0&&(c-=1),o=0,i=0;for(let l=0;l<c;l+=1)a=s[i++]<<18,a+=s[i++]<<12,a+=s[i++]<<6,a+=s[i++],u[o++]=a>>16&pe[8],u[o++]=a>>8&pe[8],u[o++]=a&pe[8];return n===1&&(a=s[i++]<<18,a+=s[i++]<<12,a+=s[i]<<6,u[o++]=a>>16&pe[8],u[o]=a>>8&pe[8]),n===2&&(a=s[i++]<<18,a+=s[i++]<<12,u[o]=a>>16&pe[8]),u},toString(r){if(r.length%4>0)throw new RangeError(`base64.toString: input buffer length not multiple of 4: ${r.length}`);let e="",t=0;function n(i,o,a,c){switch(t){case 76:e+=`\r
|
|
2
2
|
${i}${o}${a}${c}`,t=4;break;case 75:e+=`${i}\r
|
|
3
3
|
${o}${a}${c}`,t=3;break;case 74:e+=`${i+o}\r
|
|
4
4
|
${a}${c}`,t=2;break;case 73:e+=`${i+o+a}\r
|
|
5
|
-
${c}`,t=1;break;default:e+=i+o+a+c,t+=4;break}}function s(i){return i>=65&&i<=90||i>=97&&i<=122||i>=48&&i<=57||i===43||i===47||i===61}for(let i=0;i<r.length;i+=4){for(let o=i;o<i+4;o+=1)if(!s(r[o]))throw new RangeError(`base64.toString: buf[${o}]: ${r[o]} : not valid base64 character code`);n(String.fromCharCode(r[i]),String.fromCharCode(r[i+1]),String.fromCharCode(r[i+2]),String.fromCharCode(r[i+3]))}return e}}});var Cx=M(xc=>{var{Buffer:Bx}=h0(),et=
|
|
5
|
+
${c}`,t=1;break;default:e+=i+o+a+c,t+=4;break}}function s(i){return i>=65&&i<=90||i>=97&&i<=122||i>=48&&i<=57||i===43||i===47||i===61}for(let i=0;i<r.length;i+=4){for(let o=i;o<i+4;o+=1)if(!s(r[o]))throw new RangeError(`base64.toString: buf[${o}]: ${r[o]} : not valid base64 character code`);n(String.fromCharCode(r[i]),String.fromCharCode(r[i+1]),String.fromCharCode(r[i+2]),String.fromCharCode(r[i+3]))}return e}}});var Cx=M(xc=>{var{Buffer:Bx}=h0(),et=HA(),Zl="UTF8",Ox="UTF16",ks="UTF16BE",ci="UTF16LE",_x="UTF32",Bs="UTF32BE",ui="UTF32LE",hc="UINT7",$A="ASCII",qA="BINARY",mc="UINT8",GA="UINT16",g0="UINT16LE",bc="UINT16BE",zA="UINT32",x0="UINT32LE",gc="UINT32BE",y0="ESCAPED",Wi="STRING",u7=function(e){e.type=Zl;let t=e.data;e.bom=0,t.length>=3&&t[0]===239&&t[1]===187&&t[2]===191&&(e.bom=3)},l7=function(e){let t=e.data;switch(e.bom=0,e.type){case Ox:e.type=ks,t.length>=2&&(t[0]===254&&t[1]===255?e.bom=2:t[0]===255&&t[1]===254&&(e.type=ci,e.bom=2));break;case ks:if(e.type=ks,t.length>=2){if(t[0]===254&&t[1]===255)e.bom=2;else if(t[0]===255&&t[1]===254)throw new TypeError(`src type: "${ks}" specified but BOM is for "${ci}"`)}break;case ci:if(e.type=ci,t.length>=0){if(t[0]===254&&t[1]===255)throw new TypeError(`src type: "${ci}" specified but BOM is for "${ks}"`);t[0]===255&&t[1]===254&&(e.bom=2)}break;default:throw new TypeError(`UTF16 BOM: src type "${e.type}" unrecognized`)}},f7=function(e){let t=e.data;switch(e.bom=0,e.type){case _x:e.type=Bs,t.length>=4&&(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255&&(e.bom=4),t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0&&(e.type=ui,e.bom=4));break;case Bs:if(e.type=Bs,t.length>=4&&(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255&&(e.bom=4),t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0))throw new TypeError(`src type: ${Bs} specified but BOM is for ${ui}"`);break;case ui:if(e.type=ui,t.length>=4){if(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255)throw new TypeError(`src type: "${ui}" specified but BOM is for "${Bs}"`);t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0&&(e.bom=4)}break;default:throw new TypeError(`UTF32 BOM: src type "${e.type}" unrecognized`)}},d7=function(e,t){function n(i){let o={type:"",base64:!1},c=/^(base64:)?([a-zA-Z0-9]+)$/i.exec(i);return c&&(c[2]&&(o.type=c[2].toUpperCase()),c[1]&&(o.base64=!0)),o}let s=n(e.toUpperCase());if(s.base64){if(s.type===Wi)throw new TypeError(`type: "${e} "BASE64:" prefix not allowed with type ${Wi}`);if(Bx.isBuffer(t))s.data=et.base64.decode(t);else if(typeof t=="string"){let i=Bx.from(t,"ascii");s.data=et.base64.decode(i)}else throw new TypeError(`type: "${e} unrecognized data type: typeof(data): ${typeof t}`)}else s.data=t;switch(s.type){case Zl:u7(s);break;case Ox:case ks:case ci:l7(s);break;case _x:case Bs:case ui:f7(s);break;case GA:s.type=bc;break;case zA:s.type=gc;break;case $A:s.type=hc;break;case qA:s.type=mc;break;case hc:case mc:case g0:case bc:case x0:case gc:case Wi:case y0:break;default:throw new TypeError(`type: "${e}" not recognized`)}if(s.type===Wi){if(typeof s.data!="string")throw new TypeError(`type: "${e}" but data is not a string`)}else if(!Bx.isBuffer(s.data))throw new TypeError(`type: "${e}" but data is not a Buffer`);return s},p7=function(e,t){function n(i){let o,a,c={crlf:!1,lf:!1,base64:!1,type:""},u=!0;for(;u;){if(a=i,o=i.slice(0,5),o==="CRLF:"){c.crlf=!0,a=i.slice(5);break}if(o=i.slice(0,3),o==="LF:"){c.lf=!0,a=i.slice(3);break}break}return o=a.split(":"),o.length===1?c.type=o[0]:o.length===2&&o[1]==="BASE64"&&(c.base64=!0,c.type=o[0]),c}if(!Array.isArray(t))throw new TypeError(`dst chars: not array: "${typeof t}`);if(typeof e!="string")throw new TypeError(`dst type: not string: "${typeof e}`);let s=n(e.toUpperCase());switch(s.type){case Zl:case ks:case ci:case Bs:case ui:case hc:case mc:case g0:case bc:case x0:case gc:case y0:break;case Wi:if(s.base64)throw new TypeError(`":BASE64" suffix not allowed with type ${Wi}`);break;case $A:s.type=hc;break;case qA:s.type=mc;break;case Ox:s.type=ks;break;case _x:s.type=Bs;break;case GA:s.type=bc;break;case zA:s.type=gc;break;default:throw new TypeError(`dst type unrecognized: "${e}" : must have form [crlf:|lf:]type[:base64]`)}return s},Sx=function(e,t){switch(e){case Zl:return et.utf8.encode(t);case ks:return et.utf16be.encode(t);case ci:return et.utf16le.encode(t);case Bs:return et.utf32be.encode(t);case ui:return et.utf32le.encode(t);case hc:return et.uint7.encode(t);case mc:return et.uint8.encode(t);case bc:return et.uint16be.encode(t);case g0:return et.uint16le.encode(t);case gc:return et.uint32be.encode(t);case x0:return et.uint32le.encode(t);case Wi:return et.string.encode(t);case y0:return et.escaped.encode(t);default:throw new TypeError(`encode type "${e}" not recognized`)}},h7=function(e){switch(e.type){case Zl:return et.utf8.decode(e.data,e.bom);case ci:return et.utf16le.decode(e.data,e.bom);case ks:return et.utf16be.decode(e.data,e.bom);case Bs:return et.utf32be.decode(e.data,e.bom);case ui:return et.utf32le.decode(e.data,e.bom);case hc:return et.uint7.decode(e.data);case mc:return et.uint8.decode(e.data);case bc:return et.uint16be.decode(e.data);case g0:return et.uint16le.decode(e.data);case gc:return et.uint32be.decode(e.data);case x0:return et.uint32le.decode(e.data);case Wi:return et.string.decode(e.data);case y0:return et.escaped.decode(e.data);default:throw new TypeError(`decode type "${e.type}" not recognized`)}};xc.decode=function(e,t){let n=d7(e,t);return h7(n)};xc.encode=function(e,t){let n,s,i=p7(e,t);return i.crlf?(n=et.lineEnds.crlf(t),s=Sx(i.type,n)):i.lf?(n=et.lineEnds.lf(t),s=Sx(i.type,n)):s=Sx(i.type,t),i.base64&&(s=et.base64.encode(s)),s};var m7=function(e,t,n){return xc.encode(n,xc.decode(e,t))};xc.convert=m7});var Nx=M((Gz,VA)=>{VA.exports=function(){return`/* This file automatically generated by jsonToless() and LESS. */
|
|
6
6
|
.apg-mono {
|
|
7
7
|
font-family: monospace;
|
|
8
8
|
}
|
|
@@ -216,7 +216,7 @@ table.apg-attrs a {
|
|
|
216
216
|
table.apg-attrs a:hover {
|
|
217
217
|
color: #8caae6 !important;
|
|
218
218
|
}
|
|
219
|
-
`}});var wa=M(lt=>{var Dr=Ql(),Ix=Cx(),b7=Nx(),_t=Yn(),
|
|
219
|
+
`}});var wa=M(lt=>{var Dr=Ql(),Ix=Cx(),b7=Nx(),_t=Yn(),Ji="utilities.js: ",ya=function(r,e,t){let n,s=e,i=!0;for(;i;){if(r<=0){s=0,n=0;break}if(typeof s!="number"){s=0,n=r;break}if(s>=r){s=r,n=r;break}if(typeof t!="number"){n=r;break}if(n=s+t,n>r){n=r;break}break}return{beg:s,end:n}};lt.htmlToPage=function(r,e){let t;if(typeof r!="string")throw new Error(`${Ji}htmlToPage: input HTML is not a string`);typeof e!="string"?t="htmlToPage":t=e;let n="";return n+=`<!DOCTYPE html>
|
|
220
220
|
`,n+=`<html lang="en">
|
|
221
221
|
`,n+=`<head>
|
|
222
222
|
`,n+=`<meta charset="utf-8">
|
|
@@ -247,7 +247,7 @@ table.apg-attrs a:hover {
|
|
|
247
247
|
`,i+=`<tr><td>sub-string end</td><td>${r.subEnd}</td><td>sub-string end-of-string index</td></tr>
|
|
248
248
|
`,i+=`<tr><td>sub-string length</td><td>${r.subLength}</td><td>sub-string length</td></tr>
|
|
249
249
|
`,i+=`</table>
|
|
250
|
-
`,i};lt.charsToString=function(r,e,t){let n,s;if(typeof e=="number"){if(e>=r.length)return"";n=e<0?0:e}else n=0;if(typeof t=="number"){if(t<=0)return"";s=t>r.length-n?r.length:n+t}else s=r.length;return n<s?Ix.encode("UTF16LE",r.slice(n,s)).toString("utf16le"):""};lt.stringToChars=function(r){return Ix.decode("STRING",r)};lt.opcodeToString=function(r){let e="unknown";switch(r){case _t.ALT:e="ALT";break;case _t.CAT:e="CAT";break;case _t.RNM:e="RNM";break;case _t.UDT:e="UDT";break;case _t.AND:e="AND";break;case _t.NOT:e="NOT";break;case _t.REP:e="REP";break;case _t.TRG:e="TRG";break;case _t.TBS:e="TBS";break;case _t.TLS:e="TLS";break;case _t.BKR:e="BKR";break;case _t.BKA:e="BKA";break;case _t.BKN:e="BKN";break;case _t.ABG:e="ABG";break;case _t.AEN:e="AEN";break;default:throw new Error("unrecognized opcode")}return e};lt.stateToString=function(r){let e="unknown";switch(r){case _t.ACTIVE:e="ACTIVE";break;case _t.MATCH:e="MATCH";break;case _t.EMPTY:e="EMPTY";break;case _t.NOMATCH:e="NOMATCH";break;default:throw new Error("unrecognized state")}return e};lt.asciiChars=["NUL","SOH","STX","ETX","EOT","ENQ","ACK","BEL","BS","TAB","LF","VT","FF","CR","SO","SI","DLE","DC1","DC2","DC3","DC4","NAK","SYN","ETB","CAN","EM","SUB","ESC","FS","GS","RS","US"," ","!",""","#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","DEL"];lt.charToHex=function(r){let e=r.toString(16).toUpperCase();switch(e.length){case 1:case 3:case 7:e=`0${e}`;break;case 2:case 6:e=`00${e}`;break;case 4:break;case 5:e=`000${e}`;break;default:throw new Error("unrecognized option")}return e};lt.charsToDec=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${
|
|
250
|
+
`,i};lt.charsToString=function(r,e,t){let n,s;if(typeof e=="number"){if(e>=r.length)return"";n=e<0?0:e}else n=0;if(typeof t=="number"){if(t<=0)return"";s=t>r.length-n?r.length:n+t}else s=r.length;return n<s?Ix.encode("UTF16LE",r.slice(n,s)).toString("utf16le"):""};lt.stringToChars=function(r){return Ix.decode("STRING",r)};lt.opcodeToString=function(r){let e="unknown";switch(r){case _t.ALT:e="ALT";break;case _t.CAT:e="CAT";break;case _t.RNM:e="RNM";break;case _t.UDT:e="UDT";break;case _t.AND:e="AND";break;case _t.NOT:e="NOT";break;case _t.REP:e="REP";break;case _t.TRG:e="TRG";break;case _t.TBS:e="TBS";break;case _t.TLS:e="TLS";break;case _t.BKR:e="BKR";break;case _t.BKA:e="BKA";break;case _t.BKN:e="BKN";break;case _t.ABG:e="ABG";break;case _t.AEN:e="AEN";break;default:throw new Error("unrecognized opcode")}return e};lt.stateToString=function(r){let e="unknown";switch(r){case _t.ACTIVE:e="ACTIVE";break;case _t.MATCH:e="MATCH";break;case _t.EMPTY:e="EMPTY";break;case _t.NOMATCH:e="NOMATCH";break;default:throw new Error("unrecognized state")}return e};lt.asciiChars=["NUL","SOH","STX","ETX","EOT","ENQ","ACK","BEL","BS","TAB","LF","VT","FF","CR","SO","SI","DLE","DC1","DC2","DC3","DC4","NAK","SYN","ETB","CAN","EM","SUB","ESC","FS","GS","RS","US"," ","!",""","#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","DEL"];lt.charToHex=function(r){let e=r.toString(16).toUpperCase();switch(e.length){case 1:case 3:case 7:e=`0${e}`;break;case 2:case 6:e=`00${e}`;break;case 4:break;case 5:e=`000${e}`;break;default:throw new Error("unrecognized option")}return e};lt.charsToDec=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Ji}charsToDec: input must be an array of integers`);let s=ya(r.length,e,t);if(s.end>s.beg){n+=r[s.beg];for(let i=s.beg+1;i<s.end;i+=1)n+=`,${r[i]}`}return n};lt.charsToHex=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Ji}charsToHex: input must be an array of integers`);let s=ya(r.length,e,t);if(s.end>s.beg){n+=`\\x${lt.charToHex(r[s.beg])}`;for(let i=s.beg+1;i<s.end;i+=1)n+=`,\\x${lt.charToHex(r[i])}`}return n};lt.charsToHtmlEntities=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Ji}charsToHex: input must be an array of integers`);let s=ya(r.length,e,t);if(s.end>s.beg)for(let i=s.beg;i<s.end;i+=1)n+=`&#x${r[i].toString(16)};`;return n};function g7(r){return!(r>=55296&&r<=57343||r>1114111)}lt.charsToUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Ji}charsToUnicode: input must be an array of integers`);let s=ya(r.length,e,t);if(s.end>s.beg)for(let i=s.beg;i<s.end;i+=1)g7(r[i])?n+=`&#${r[i]};`:n+=` U+${lt.charToHex(r[i])}`;return n};lt.charsToJsUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Ji}charsToJsUnicode: input must be an array of integers`);let s=ya(r.length,e,t);if(s.end>s.beg){n+=`\\u${lt.charToHex(r[s.beg])}`;for(let i=s.beg+1;i<s.end;i+=1)n+=`,\\u${lt.charToHex(r[i])}`}return n};lt.charsToAscii=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Ji}charsToAscii: input must be an array of integers`);let s=ya(r.length,e,t);for(let i=s.beg;i<s.end;i+=1){let o=r[i];o>=32&&o<=126?n+=String.fromCharCode(o):n+=`\\x${lt.charToHex(o)}`}return n};lt.charsToAsciiHtml=function(r,e,t){if(!Array.isArray(r))throw new Error(`${Ji}charsToAsciiHtml: input must be an array of integers`);let n="",s,i=ya(r.length,e,t);for(let o=i.beg;o<i.end;o+=1)s=r[o],s<32||s===127?n+=`<span class="${Dr.CLASS_CTRLCHAR}">${lt.asciiChars[s]}</span>`:s>127?n+=`<span class="${Dr.CLASS_CTRLCHAR}">U+${lt.charToHex(s)}</span>`:n+=lt.asciiChars[s];return n};lt.stringToAsciiHtml=function(r){let e=Ix.decode("STRING",r);return this.charsToAsciiHtml(e)}});var WA=M((Vz,KA)=>{KA.exports=function(){let e=Yn(),t=wa(),n="ast.js: ",s=this,i=null,o=null,a=null,c=0,u=[],l=[],f=[],d=[];this.callbacks=[],this.astObject="astObject",this.init=function(p,g,m){f.length=0,d.length=0,u.length=0,c=0,i=p,o=g,a=m;let y,E=[];for(y=0;y<i.length;y+=1)E.push(i[y].lower);for(y=0;y<o.length;y+=1)E.push(o[y].lower);for(c=i.length+o.length,y=0;y<c;y+=1)u[y]=!1,l[y]=null;for(let v in s.callbacks){let k=v.toLowerCase();if(y=E.indexOf(k),y<0)throw new Error(`${n}init: node '${v}' not a rule or udt name`);typeof s.callbacks[v]=="function"&&(u[y]=!0,l[y]=s.callbacks[v]),s.callbacks[v]===!0&&(u[y]=!0)}},this.ruleDefined=function(p){return u[p]!==!1},this.udtDefined=function(p){return u[i.length+p]!==!1},this.down=function(p,g){let m=d.length;return f.push(m),d.push({name:g,thisIndex:m,thatIndex:null,state:e.SEM_PRE,callbackIndex:p,phraseIndex:null,phraseLength:null,stack:f.length}),m},this.up=function(p,g,m,y){let E=d.length,v=f.pop();return d.push({name:g,thisIndex:E,thatIndex:v,state:e.SEM_POST,callbackIndex:p,phraseIndex:m,phraseLength:y,stack:f.length}),d[v].thatIndex=E,d[v].phraseIndex=m,d[v].phraseLength=y,E},this.translate=function(p){let g,m,y;for(let E=0;E<d.length;E+=1)y=d[E],m=l[y.callbackIndex],y.state===e.SEM_PRE?m!==null&&(g=m(e.SEM_PRE,a,y.phraseIndex,y.phraseLength,p),g===e.SEM_SKIP&&(E=y.thatIndex)):m!==null&&m(e.SEM_POST,a,y.phraseIndex,y.phraseLength,p)},this.setLength=function(p){d.length=p,p>0?f.length=d[p-1].stack:f.length=0},this.getLength=function(){return d.length};function h(b){let p="";for(let g=0;g<b;g+=1)p+=" ";return p}this.toXml=function(p){let g=t.charsToDec,m="decimal integer character codes";if(typeof p=="string"&&p.length>=3){let v=p.slice(0,3).toLowerCase();v==="asc"?(g=t.charsToAscii,m="ASCII for printing characters, hex for non-printing"):v==="hex"?(g=t.charsToHex,m="hexadecimal integer character codes"):v==="uni"&&(g=t.charsToUnicode,m="Unicode UTF-32 integer character codes")}let y="",E=0;return y+=`<?xml version="1.0" encoding="utf-8"?>
|
|
251
251
|
`,y+=`<root nodes="${d.length/2}" characters="${a.length}">
|
|
252
252
|
`,y+=`<!-- input string, ${m} -->
|
|
253
253
|
`,y+=h(E+2),y+=g(a),y+=`
|
|
@@ -255,7 +255,7 @@ table.apg-attrs a:hover {
|
|
|
255
255
|
`,y+=h(E+2),y+=g(a,v.phraseIndex,v.phraseLength),y+=`
|
|
256
256
|
`):(y+=h(E),y+=`</node><!-- name="${v.name}" -->
|
|
257
257
|
`,E-=1)}),y+=`</root>
|
|
258
|
-
`,y},this.phrases=function(){let p={},g,m;for(g=0;g<d.length;g+=1)m=d[g],m.state===e.SEM_PRE&&(Array.isArray(p[m.name])||(p[m.name]=[]),p[m.name].push({index:m.phraseIndex,length:m.phraseLength}));return p}}});var Rx=M((Kz,JA)=>{JA.exports=function(){let e="circular-buffer.js: ",t=-1,n=0;this.init=function(i){if(typeof i!="number"||i<=0)throw new Error(`${e}init: circular buffer size must an integer > 0`);n=Math.ceil(i),t=-1},this.increment=function(){return t+=1,(t+n)%n},this.maxSize=function(){return n},this.items=function(){return t+1},this.getListIndex=function(i){return t===-1||i<0||i>t||t-i>=n?-1:(i+n)%n},this.forEach=function(i){if(t!==-1){if(t<n){for(let o=0;o<=t;o+=1)i(o,o);return}for(let o=t-n+1;o<=t;o+=1){let a=(o+n)%n;i(a,o)}}}}});var QA=M((Jz,WA)=>{WA.exports=function(){let e=Yn(),t=wa(),n="parser.js: ",s=this,i;this.ast=null,this.stats=null,this.trace=null,this.callbacks=[];let o=null,a=null,c,u,l,f,d=0,h=0,b=0,p=null,g=null,m=null,y=null,E=null,v=0,k=1/0,w=1/0,P=function(U,A,C){let Q=`${n}evaluateRule(): `;if(U>=m.length)throw new Error(`${Q}rule index: ${U} out of range`);if(A>=l)throw new Error(`${Q}phrase index: ${A} out of range`);let{length:W}=o;o.push({type:e.RNM,index:U}),i(W,A,C),o.pop()},B=function($,U,A){let C=`${n}evaluateUdt(): `;if($>=y.length)throw new Error(`${C}udt index: ${$} out of range`);if(U>=l)throw new Error(`${C}phrase index: ${U} out of range`);let{length:Q}=o;o.push({type:e.UDT,empty:y[$].empty,index:$}),i(Q,U,A),o.pop()},Z=function(){d=0,h=0,b=0,v=0,f=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],m=null,y=null,a=null,c=0,u=0,l=0,p=null,g=null,E=null,o=null},_=function(){let $=[],U=function(){let C={};m.forEach(Q=>{Q.isBkr&&(C[Q.lower]=null)}),y.length>0&&y.forEach(Q=>{Q.isBkr&&(C[Q.lower]=null)}),$.push(C)},A=function(){let C=$[$.length-1],Q={};for(let W in C)Q[W]=C[W];return Q};this.push=function(){$.push(A())},this.pop=function(Q){let W=Q;if(W||(W=$.length-1),W<1||W>$.length)throw new Error(`${n}backRef.pop(): bad length: ${W}`);return $.length=W,$[$.length-1]},this.length=function(){return $.length},this.savePhrase=function(Q,W,le){$[$.length-1][Q]={phraseIndex:W,phraseLength:le}},this.getPhrase=function(C){return $[$.length-1][C]},U()},O=function(){let U=this;this.state=e.ACTIVE,this.phraseLength=0,this.ruleIndex=0,this.udtIndex=0,this.lookAround=f[f.length-1],this.uFrame=new _,this.pFrame=new _,this.evaluateRule=P,this.evaluateUdt=B,this.refresh=function(){U.state=e.ACTIVE,U.phraseLength=0,U.lookAround=f[f.length-1]}},S=function(){return f[f.length-1]},F=function(){return f.length>1},G=function(){return f[f.length-1].lookAround===e.LOOKAROUND_BEHIND},R=function(){let $=`${n}initializeAst(): `,U=!0;for(;U;){if(s.ast===void 0){s.ast=null;break}if(s.ast===null)break;if(s.ast.astObject!=="astObject")throw new Error(`${$}ast object not recognized`);break}s.ast!==null&&s.ast.init(m,y,a)},L=function(){let $=`${n}initializeTrace(): `,U=!0;for(;U;){if(s.trace===void 0){s.trace=null;break}if(s.trace===null)break;if(s.trace.traceObject!=="traceObject")throw new Error(`${$}trace object not recognized`);break}s.trace!==null&&s.trace.init(m,y,a)},Y=function(){let $=`${n}initializeStats(): `,U=!0;for(;U;){if(s.stats===void 0){s.stats=null;break}if(s.stats===null)break;if(s.stats.statsObject!=="statsObject")throw new Error(`${$}stats object not recognized`);break}s.stats!==null&&s.stats.init(m,y)},oe=function($){let U=`${n}initializeGrammar(): `;if(!$)throw new Error(`${U}grammar object undefined`);if($.grammarObject!=="grammarObject")throw new Error(`${U}bad grammar object`);m=$.rules,y=$.udts},fe=function($){let U=`${n}initializeStartRule(): `,A=null;if(typeof $=="number"){if($>=m.length)throw new Error(`${U}start rule index too large: max: ${m.length}: index: ${$}`);A=$}else if(typeof $=="string"){let C=$.toLowerCase();for(let Q=0;Q<m.length;Q+=1)if(C===m[Q].lower){A=m[Q].index;break}if(A===null)throw new Error(`${U}start rule name '${$}' not recognized`)}else throw new Error(`${U}type of start rule '${typeof $}' not recognized`);return A},K=function(U,A,C){let Q=`${n}initializeInputChars(): `,W=U,le=A,Te=C;if(W===void 0)throw new Error(`${Q}input string is undefined`);if(W===null)throw new Error(`${Q}input string is null`);if(typeof W=="string")W=t.stringToChars(W);else if(!Array.isArray(W))throw new Error(`${Q}input string is not a string or array`);if(W.length>0&&typeof W[0]!="number")throw new Error(`${Q}input string not an array of integers`);if(typeof le!="number")le=0;else if(le=Math.floor(le),le<0||le>W.length)throw new Error(`${Q}input beginning index out of range: ${le}`);if(typeof Te!="number")Te=W.length-le;else if(Te=Math.floor(Te),Te<0||Te>W.length-le)throw new Error(`${Q}input length out of range: ${Te}`);a=W,c=le,u=Te,l=c+u},ae=function(){let $=`${n}initializeCallbacks(): `,U;for(p=[],g=[],U=0;U<m.length;U+=1)p[U]=null;for(U=0;U<y.length;U+=1)g[U]=null;let A,C=[];for(U=0;U<m.length;U+=1)C.push(m[U].lower);for(U=0;U<y.length;U+=1)C.push(y[U].lower);for(let Q in s.callbacks){if(U=C.indexOf(Q.toLowerCase()),U<0)throw new Error(`${$}syntax callback '${Q}' not a rule or udt name`);if(A=s.callbacks[Q],A||(A=null),typeof A=="function"||A===null)U<m.length?p[U]=A:g[U-m.length]=A;else throw new Error(`${$}syntax callback[${Q}] must be function reference or 'false' (false/null/undefined/etc.)`)}for(U=0;U<y.length;U+=1)if(g[U]===null)throw new Error(`${$}all UDT callbacks must be defined. UDT callback[${y[U].lower}] not a function reference`)};this.setMaxTreeDepth=function($){if(typeof $!="number")throw new Error(`parser: max tree depth must be integer > 0: ${$}`);if(k=Math.floor($),k<=0)throw new Error(`parser: max tree depth must be integer > 0: ${$}`)},this.setMaxNodeHits=function($){if(typeof $!="number")throw new Error(`parser: max node hits must be integer > 0: ${$}`);if(w=Math.floor($),w<=0)throw new Error(`parser: max node hits must be integer > 0: ${$}`)};let q=function($,U,A){let C,Q=`${n}parse(): `;oe($);let W=fe(U);ae(),L(),Y(),R();let le=new O;switch(A!=null&&(E=A),o=[{type:e.RNM,index:W}],i(0,c,le),o=null,le.state){case e.ACTIVE:throw new Error(`${Q}final state should never be 'ACTIVE'`);case e.NOMATCH:C=!1;break;case e.EMPTY:case e.MATCH:le.phraseLength===u?C=!0:C=!1;break;default:throw new Error("unrecognized state")}return{success:C,state:le.state,length:u,matched:le.phraseLength,maxMatched:v,maxTreeDepth:h,nodeHits:b,inputLength:a.length,subBegin:c,subEnd:l,subLength:u}};this.parseSubstring=function(U,A,C,Q,W,le){return Z(),K(C,Q,W),q(U,A,le)},this.parse=function(U,A,C,Q){return Z(),K(C,0,C.length),q(U,A,Q)};let I=function($,U,A){let C=o[$];for(let Q=0;Q<C.children.length&&(i(C.children[Q],U,A),A.state===e.NOMATCH);Q+=1);},ye=function($,U,A){let C,Q,W,le,Te=o[$],Mt=A.uFrame.length(),Ot=A.pFrame.length();s.ast&&(Q=s.ast.getLength()),C=!0,W=U,le=0;for(let Ge=0;Ge<Te.children.length;Ge+=1)if(i(Te.children[Ge],W,A),A.state===e.NOMATCH){C=!1;break}else W+=A.phraseLength,le+=A.phraseLength;C?(A.state=le===0?e.EMPTY:e.MATCH,A.phraseLength=le):(A.state=e.NOMATCH,A.phraseLength=0,A.uFrame.pop(Mt),A.pFrame.pop(Ot),s.ast&&s.ast.setLength(Q))},st=function($,U,A){let C,Q,W,le,Te=o[$];if(Te.max===0){A.state=e.EMPTY,A.phraseLength=0;return}Q=U,W=0,le=0;let Mt=A.uFrame.length(),Ot=A.pFrame.length();s.ast&&(C=s.ast.getLength());let Ge=!0;for(;Ge&&!(Q>=l||(i($+1,Q,A),A.state===e.NOMATCH)||A.state===e.EMPTY||(le+=1,W+=A.phraseLength,Q+=A.phraseLength,le===Te.max)););A.state===e.EMPTY||le>=Te.min?(A.state=W===0?e.EMPTY:e.MATCH,A.phraseLength=W):(A.state=e.NOMATCH,A.phraseLength=0,A.uFrame.pop(Mt),A.pFrame.pop(Ot),s.ast&&s.ast.setLength(C))},Ke=function($,U,A,C){if(U.phraseLength>A){let Q=`${n}opRNM(${$.name}): callback function error: `;throw Q+=`sysData.phraseLength: ${U.phraseLength}`,Q+=` must be <= remaining chars: ${A}`,new Error(Q)}switch(U.state){case e.ACTIVE:if(C!==!0)throw new Error(`${n}opRNM(${$.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:U.phraseLength=0;break;case e.MATCH:U.phraseLength===0&&(U.state=e.EMPTY);break;case e.NOMATCH:U.phraseLength=0;break;default:throw new Error(`${n}opRNM(${$.name}): callback function return error. Unrecognized return state: ${U.state}`)}},Je=function($,U,A){let C,Q,W,le,Te,Mt,Ot=o[$],Ge=m[Ot.index],Dt=p[Ge.index],Vi=!F();if(Vi&&(Q=s.ast&&s.ast.ruleDefined(Ot.index),Q&&(C=s.ast.getLength(),s.ast.down(Ot.index,m[Ot.index].name)),le=A.uFrame.length(),Te=A.pFrame.length(),A.uFrame.push(),A.pFrame.push(),Mt=A.pFrame,A.pFrame=new _),Dt===null)W=o,o=Ge.opcodes,i(0,U,A),o=W;else{let pA=l-U;A.ruleIndex=Ge.index,Dt(A,a,U,E),Ke(Ge,A,pA,!0),A.state===e.ACTIVE&&(W=o,o=Ge.opcodes,i(0,U,A),o=W,A.ruleIndex=Ge.index,Dt(A,a,U,E),Ke(Ge,A,pA,!1))}Vi&&(Q&&(A.state===e.NOMATCH?s.ast.setLength(C):s.ast.up(Ot.index,Ge.name,U,A.phraseLength)),A.pFrame=Mt,A.state===e.NOMATCH?(A.uFrame.pop(le),A.pFrame.pop(Te)):Ge.isBkr&&(A.pFrame.savePhrase(Ge.lower,U,A.phraseLength),A.uFrame.savePhrase(Ge.lower,U,A.phraseLength)))},D=function($,U,A){if(U.phraseLength>A){let C=`${n}opUDT(${$.name}): callback function error: `;throw C+=`sysData.phraseLength: ${U.phraseLength}`,C+=` must be <= remaining chars: ${A}`,new Error(C)}switch(U.state){case e.ACTIVE:throw new Error(`${n}opUDT(${$.name}): callback function return error. ACTIVE state not allowed.`);case e.EMPTY:if($.empty===!1)throw new Error(`${n}opUDT(${$.name}): callback function return error. May not return EMPTY.`);U.phraseLength=0;break;case e.MATCH:if(U.phraseLength===0){if($.empty===!1)throw new Error(`${n}opUDT(${$.name}): callback function return error. May not return EMPTY.`);U.state=e.EMPTY}break;case e.NOMATCH:U.phraseLength=0;break;default:throw new Error(`${n}opUDT(${$.name}): callback function return error. Unrecognized return state: ${U.state}`)}},j=function($,U,A){let C,Q,W,le,Te,Mt,Ot=o[$],Ge=y[Ot.index];A.UdtIndex=Ge.index;let Dt=!F();Dt&&(W=s.ast&&s.ast.udtDefined(Ot.index),W&&(Q=m.length+Ot.index,C=s.ast.getLength(),s.ast.down(Q,Ge.name)),le=A.uFrame.length(),Te=A.pFrame.length(),A.uFrame.push(),A.pFrame.push(),Mt=A.pFrame,A.pFrame=new _);let Vi=l-U;g[Ot.index](A,a,U,E),D(Ge,A,Vi),Dt&&(W&&(A.state===e.NOMATCH?s.ast.setLength(C):s.ast.up(Q,Ge.name,U,A.phraseLength)),A.pFrame=Mt,A.state===e.NOMATCH?(A.uFrame.pop(le),A.pFrame.pop(Te)):Ge.isBkr&&(A.pFrame.savePhrase(Ge.lower,U,A.phraseLength),A.uFrame.savePhrase(Ge.lower,U,A.phraseLength)))},N=function($,U,A){f.push({lookAround:e.LOOKAROUND_AHEAD,anchor:U,charsEnd:l,charsLength:u}),l=a.length,u=a.length-c,i($+1,U,A);let C=f.pop();switch(l=C.charsEnd,u=C.charsLength,A.phraseLength=0,A.state){case e.EMPTY:A.state=e.EMPTY;break;case e.MATCH:A.state=e.EMPTY;break;case e.NOMATCH:A.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${A.state}`)}},ee=function($,U,A){f.push({lookAround:e.LOOKAROUND_AHEAD,anchor:U,charsEnd:l,charsLength:u}),l=a.length,u=a.length-c,i($+1,U,A);let C=f.pop();switch(l=C.charsEnd,u=C.charsLength,A.phraseLength=0,A.state){case e.EMPTY:case e.MATCH:A.state=e.NOMATCH;break;case e.NOMATCH:A.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${A.state}`)}},ce=function($,U,A){let C=o[$];A.state=e.NOMATCH,U<l&&C.min<=a[U]&&a[U]<=C.max&&(A.state=e.MATCH,A.phraseLength=1)},he=function($,U,A){let C,Q=o[$],W=Q.string.length;if(A.state=e.NOMATCH,U+W<=l){for(C=0;C<W;C+=1)if(a[U+C]!==Q.string[C])return;A.state=e.MATCH,A.phraseLength=W}},xe=function($,U,A){let C,Q,W=o[$];A.state=e.NOMATCH;let le=W.string.length;if(le===0){A.state=e.EMPTY;return}if(U+le<=l){for(C=0;C<le;C+=1)if(Q=a[U+C],Q>=65&&Q<=90&&(Q+=32),Q!==W.string[C])return;A.state=e.MATCH,A.phraseLength=le}},V=function($,U,A){A.state=e.NOMATCH,A.phraseLength=0,A.state=U===0?e.EMPTY:e.NOMATCH},te=function($,U,A){A.state=e.NOMATCH,A.phraseLength=0,A.state=U===a.length?e.EMPTY:e.NOMATCH},H=function($,U,A){let C,Q,W,le,Te=o[$];A.state=e.NOMATCH,Te.index<m.length?le=m[Te.index].lower:le=y[Te.index-m.length].lower;let Mt=Te.bkrMode===e.BKR_MODE_PM?A.pFrame.getPhrase(le):A.uFrame.getPhrase(le),Ot=Te.bkrCase===e.BKR_MODE_CI;if(Mt===null)return;let Ge=Mt.phraseIndex,Dt=Mt.phraseLength;if(Dt===0){A.state=e.EMPTY;return}if(U+Dt<=l){if(Ot){for(C=0;C<Dt;C+=1)if(Q=a[U+C],W=a[Ge+C],Q>=65&&Q<=90&&(Q+=32),W>=65&&W<=90&&(W+=32),Q!==W)return;A.state=e.MATCH,A.phraseLength=Dt}else for(C=0;C<Dt;C+=1)if(Q=a[U+C],W=a[Ge+C],Q!==W)return;A.state=e.MATCH,A.phraseLength=Dt}},re=function($,U,A){switch(f.push({lookAround:e.LOOKAROUND_BEHIND,anchor:U}),i($+1,U,A),f.pop(),A.phraseLength=0,A.state){case e.EMPTY:A.state=e.EMPTY;break;case e.MATCH:A.state=e.EMPTY;break;case e.NOMATCH:A.state=e.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${A.state}`)}},T=function($,U,A){switch(f.push({lookAround:e.LOOKAROUND_BEHIND,anchor:U}),i($+1,U,A),f.pop(),A.phraseLength=0,A.state){case e.EMPTY:case e.MATCH:A.state=e.NOMATCH;break;case e.NOMATCH:A.state=e.EMPTY;break;default:throw new Error(`opBKN: invalid state ${A.state}`)}},J=function($,U,A){let C,Q,W,le,Te=o[$],Mt=A.uFrame.length(),Ot=A.pFrame.length();s.ast&&(Q=s.ast.getLength()),C=!0,W=U,le=0;for(let Ge=Te.children.length-1;Ge>=0;Ge-=1)if(i(Te.children[Ge],W,A),W-=A.phraseLength,le+=A.phraseLength,A.state===e.NOMATCH){C=!1;break}C?(A.state=le===0?e.EMPTY:e.MATCH,A.phraseLength=le):(A.state=e.NOMATCH,A.phraseLength=0,A.uFrame.pop(Mt),A.pFrame.pop(Ot),s.ast&&s.ast.setLength(Q))},Ee=function($,U,A){let C,Q,W,le,Te=o[$];Q=U,W=0,le=0;let Mt=A.uFrame.length(),Ot=A.pFrame.length();s.ast&&(C=s.ast.getLength());let Ge=!0;for(;Ge&&!(Q<=0||(i($+1,Q,A),A.state===e.NOMATCH)||A.state===e.EMPTY||(le+=1,W+=A.phraseLength,Q-=A.phraseLength,le===Te.max)););A.state===e.EMPTY||le>=Te.min?(A.state=W===0?e.EMPTY:e.MATCH,A.phraseLength=W):(A.state=e.NOMATCH,A.phraseLength=0,A.uFrame.pop(Mt),A.pFrame.pop(Ot),s.ast&&s.ast.setLength(C))},Be=function($,U,A){let C=o[$];if(A.state=e.NOMATCH,A.phraseLength=0,U>0){let Q=a[U-1];C.min<=Q&&Q<=C.max&&(A.state=e.MATCH,A.phraseLength=1)}},ut=function($,U,A){let C,Q=o[$];A.state=e.NOMATCH;let W=Q.string.length,le=U-W;if(le>=0){for(C=0;C<W;C+=1)if(a[le+C]!==Q.string[C])return;A.state=e.MATCH,A.phraseLength=W}},lc=function($,U,A){let C,Q=o[$];A.state=e.NOMATCH;let W=Q.string.length;if(W===0){A.state=e.EMPTY;return}let le=U-W;if(le>=0){for(let Te=0;Te<W;Te+=1)if(C=a[le+Te],C>=65&&C<=90&&(C+=32),C!==Q.string[Te])return;A.state=e.MATCH,A.phraseLength=W}},u0=function($,U,A){let C,Q,W,le,Te=o[$];A.state=e.NOMATCH,A.phraseLength=0,Te.index<m.length?le=m[Te.index].lower:le=y[Te.index-m.length].lower;let Mt=Te.bkrMode===e.BKR_MODE_PM?A.pFrame.getPhrase(le):A.uFrame.getPhrase(le),Ot=Te.bkrCase===e.BKR_MODE_CI;if(Mt===null)return;let Ge=Mt.phraseIndex,Dt=Mt.phraseLength;if(Dt===0){A.state=e.EMPTY,A.phraseLength=0;return}let Vi=U-Dt;if(Vi>=0){if(Ot){for(C=0;C<Dt;C+=1)if(Q=a[Vi+C],W=a[Ge+C],Q>=65&&Q<=90&&(Q+=32),W>=65&&W<=90&&(W+=32),Q!==W)return;A.state=e.MATCH,A.phraseLength=Dt}else for(C=0;C<Dt;C+=1)if(Q=a[Vi+C],W=a[Ge+C],Q!==W)return;A.state=e.MATCH,A.phraseLength=Dt}};i=function(U,A,C){let Q=!0,W=o[U];if(b+=1,b>w)throw new Error(`parser: maximum number of node hits exceeded: ${w}`);if(d+=1,d>h&&(h=d,h>k))throw new Error(`parser: maximum parse tree depth exceeded: ${k}`);if(C.refresh(),s.trace!==null){let le=S();s.trace.down(W,C.state,A,C.phraseLength,le.anchor,le.lookAround)}if(G())switch(W.type){case e.ALT:I(U,A,C);break;case e.CAT:J(U,A,C);break;case e.REP:Ee(U,A,C);break;case e.RNM:Je(U,A,C);break;case e.UDT:j(U,A,C);break;case e.AND:N(U,A,C);break;case e.NOT:ee(U,A,C);break;case e.TRG:Be(U,A,C);break;case e.TBS:ut(U,A,C);break;case e.TLS:lc(U,A,C);break;case e.BKR:u0(U,A,C);break;case e.BKA:re(U,A,C);break;case e.BKN:T(U,A,C);break;case e.ABG:V(U,A,C);break;case e.AEN:te(U,A,C);break;default:Q=!1;break}else switch(W.type){case e.ALT:I(U,A,C);break;case e.CAT:ye(U,A,C);break;case e.REP:st(U,A,C);break;case e.RNM:Je(U,A,C);break;case e.UDT:j(U,A,C);break;case e.AND:N(U,A,C);break;case e.NOT:ee(U,A,C);break;case e.TRG:ce(U,A,C);break;case e.TBS:he(U,A,C);break;case e.TLS:xe(U,A,C);break;case e.BKR:H(U,A,C);break;case e.BKA:re(U,A,C);break;case e.BKN:T(U,A,C);break;case e.ABG:V(U,A,C);break;case e.AEN:te(U,A,C);break;default:Q=!1;break}if(!F()&&A+C.phraseLength>v&&(v=A+C.phraseLength),s.stats!==null&&s.stats.collect(W,C),s.trace!==null){let le=S();s.trace.up(W,C.state,A,C.phraseLength,le.anchor,le.lookAround)}return d-=1,Q}}});var ZA=M((Wz,YA)=>{YA.exports=function(){let e=Yn(),t=wa(),n=Ql(),s="stats.js: ",i=[],o=[],a=[],c,u=[],l=[];this.statsObject="statsObject";let f="stats",d=function(w,P){return w.lower<P.lower?-1:w.lower>P.lower?1:0},h=function(w,P){return w.total<P.total?1:w.total>P.total?-1:d(w,P)},b=function(w,P){return w.index<P.index?-1:w.index>P.index?1:0},p=function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},g=function(){a.length=0,c=new p,a[e.ALT]=new p,a[e.CAT]=new p,a[e.REP]=new p,a[e.RNM]=new p,a[e.TRG]=new p,a[e.TBS]=new p,a[e.TLS]=new p,a[e.UDT]=new p,a[e.AND]=new p,a[e.NOT]=new p,a[e.BKR]=new p,a[e.BKA]=new p,a[e.BKN]=new p,a[e.ABG]=new p,a[e.AEN]=new p,u.length=0;for(let w=0;w<i.length;w+=1)u.push({empty:0,match:0,nomatch:0,total:0,name:i[w].name,lower:i[w].lower,index:i[w].index});if(o.length>0){l.length=0;for(let w=0;w<o.length;w+=1)l.push({empty:0,match:0,nomatch:0,total:0,name:o[w].name,lower:o[w].lower,index:o[w].index})}},m=function(w,P){switch(w.total+=1,P){case e.EMPTY:w.empty+=1;break;case e.MATCH:w.match+=1;break;case e.NOMATCH:w.nomatch+=1;break;default:throw new Error(`${s}collect(): incStat(): unrecognized state: ${P}`)}},y=function(w,P){let B="";return B+="<tr>",B+=`<td class="${n.CLASS_ACTIVE}">${w}</td>`,B+=`<td class="${n.CLASS_EMPTY}">${P.empty}</td>`,B+=`<td class="${n.CLASS_MATCH}">${P.match}</td>`,B+=`<td class="${n.CLASS_NOMATCH}">${P.nomatch}</td>`,B+=`<td class="${n.CLASS_ACTIVE}">${P.total}</td>`,B+=`</tr>
|
|
258
|
+
`,y},this.phrases=function(){let p={},g,m;for(g=0;g<d.length;g+=1)m=d[g],m.state===e.SEM_PRE&&(Array.isArray(p[m.name])||(p[m.name]=[]),p[m.name].push({index:m.phraseIndex,length:m.phraseLength}));return p}}});var Rx=M((Kz,JA)=>{JA.exports=function(){let e="circular-buffer.js: ",t=-1,n=0;this.init=function(i){if(typeof i!="number"||i<=0)throw new Error(`${e}init: circular buffer size must an integer > 0`);n=Math.ceil(i),t=-1},this.increment=function(){return t+=1,(t+n)%n},this.maxSize=function(){return n},this.items=function(){return t+1},this.getListIndex=function(i){return t===-1||i<0||i>t||t-i>=n?-1:(i+n)%n},this.forEach=function(i){if(t!==-1){if(t<n){for(let o=0;o<=t;o+=1)i(o,o);return}for(let o=t-n+1;o<=t;o+=1){let a=(o+n)%n;i(a,o)}}}}});var YA=M((Wz,QA)=>{QA.exports=function(){let e=Yn(),t=wa(),n="parser.js: ",s=this,i;this.ast=null,this.stats=null,this.trace=null,this.callbacks=[];let o=null,a=null,c,u,l,f,d=0,h=0,b=0,p=null,g=null,m=null,y=null,E=null,v=0,k=1/0,w=1/0,P=function(U,A,C){let Q=`${n}evaluateRule(): `;if(U>=m.length)throw new Error(`${Q}rule index: ${U} out of range`);if(A>=l)throw new Error(`${Q}phrase index: ${A} out of range`);let{length:J}=o;o.push({type:e.RNM,index:U}),i(J,A,C),o.pop()},B=function($,U,A){let C=`${n}evaluateUdt(): `;if($>=y.length)throw new Error(`${C}udt index: ${$} out of range`);if(U>=l)throw new Error(`${C}phrase index: ${U} out of range`);let{length:Q}=o;o.push({type:e.UDT,empty:y[$].empty,index:$}),i(Q,U,A),o.pop()},Z=function(){d=0,h=0,b=0,v=0,f=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],m=null,y=null,a=null,c=0,u=0,l=0,p=null,g=null,E=null,o=null},_=function(){let $=[],U=function(){let C={};m.forEach(Q=>{Q.isBkr&&(C[Q.lower]=null)}),y.length>0&&y.forEach(Q=>{Q.isBkr&&(C[Q.lower]=null)}),$.push(C)},A=function(){let C=$[$.length-1],Q={};for(let J in C)Q[J]=C[J];return Q};this.push=function(){$.push(A())},this.pop=function(Q){let J=Q;if(J||(J=$.length-1),J<1||J>$.length)throw new Error(`${n}backRef.pop(): bad length: ${J}`);return $.length=J,$[$.length-1]},this.length=function(){return $.length},this.savePhrase=function(Q,J,le){$[$.length-1][Q]={phraseIndex:J,phraseLength:le}},this.getPhrase=function(C){return $[$.length-1][C]},U()},O=function(){let U=this;this.state=e.ACTIVE,this.phraseLength=0,this.ruleIndex=0,this.udtIndex=0,this.lookAround=f[f.length-1],this.uFrame=new _,this.pFrame=new _,this.evaluateRule=P,this.evaluateUdt=B,this.refresh=function(){U.state=e.ACTIVE,U.phraseLength=0,U.lookAround=f[f.length-1]}},S=function(){return f[f.length-1]},F=function(){return f.length>1},G=function(){return f[f.length-1].lookAround===e.LOOKAROUND_BEHIND},R=function(){let $=`${n}initializeAst(): `,U=!0;for(;U;){if(s.ast===void 0){s.ast=null;break}if(s.ast===null)break;if(s.ast.astObject!=="astObject")throw new Error(`${$}ast object not recognized`);break}s.ast!==null&&s.ast.init(m,y,a)},L=function(){let $=`${n}initializeTrace(): `,U=!0;for(;U;){if(s.trace===void 0){s.trace=null;break}if(s.trace===null)break;if(s.trace.traceObject!=="traceObject")throw new Error(`${$}trace object not recognized`);break}s.trace!==null&&s.trace.init(m,y,a)},Y=function(){let $=`${n}initializeStats(): `,U=!0;for(;U;){if(s.stats===void 0){s.stats=null;break}if(s.stats===null)break;if(s.stats.statsObject!=="statsObject")throw new Error(`${$}stats object not recognized`);break}s.stats!==null&&s.stats.init(m,y)},oe=function($){let U=`${n}initializeGrammar(): `;if(!$)throw new Error(`${U}grammar object undefined`);if($.grammarObject!=="grammarObject")throw new Error(`${U}bad grammar object`);m=$.rules,y=$.udts},fe=function($){let U=`${n}initializeStartRule(): `,A=null;if(typeof $=="number"){if($>=m.length)throw new Error(`${U}start rule index too large: max: ${m.length}: index: ${$}`);A=$}else if(typeof $=="string"){let C=$.toLowerCase();for(let Q=0;Q<m.length;Q+=1)if(C===m[Q].lower){A=m[Q].index;break}if(A===null)throw new Error(`${U}start rule name '${$}' not recognized`)}else throw new Error(`${U}type of start rule '${typeof $}' not recognized`);return A},K=function(U,A,C){let Q=`${n}initializeInputChars(): `,J=U,le=A,Te=C;if(J===void 0)throw new Error(`${Q}input string is undefined`);if(J===null)throw new Error(`${Q}input string is null`);if(typeof J=="string")J=t.stringToChars(J);else if(!Array.isArray(J))throw new Error(`${Q}input string is not a string or array`);if(J.length>0&&typeof J[0]!="number")throw new Error(`${Q}input string not an array of integers`);if(typeof le!="number")le=0;else if(le=Math.floor(le),le<0||le>J.length)throw new Error(`${Q}input beginning index out of range: ${le}`);if(typeof Te!="number")Te=J.length-le;else if(Te=Math.floor(Te),Te<0||Te>J.length-le)throw new Error(`${Q}input length out of range: ${Te}`);a=J,c=le,u=Te,l=c+u},ae=function(){let $=`${n}initializeCallbacks(): `,U;for(p=[],g=[],U=0;U<m.length;U+=1)p[U]=null;for(U=0;U<y.length;U+=1)g[U]=null;let A,C=[];for(U=0;U<m.length;U+=1)C.push(m[U].lower);for(U=0;U<y.length;U+=1)C.push(y[U].lower);for(let Q in s.callbacks){if(U=C.indexOf(Q.toLowerCase()),U<0)throw new Error(`${$}syntax callback '${Q}' not a rule or udt name`);if(A=s.callbacks[Q],A||(A=null),typeof A=="function"||A===null)U<m.length?p[U]=A:g[U-m.length]=A;else throw new Error(`${$}syntax callback[${Q}] must be function reference or 'false' (false/null/undefined/etc.)`)}for(U=0;U<y.length;U+=1)if(g[U]===null)throw new Error(`${$}all UDT callbacks must be defined. UDT callback[${y[U].lower}] not a function reference`)};this.setMaxTreeDepth=function($){if(typeof $!="number")throw new Error(`parser: max tree depth must be integer > 0: ${$}`);if(k=Math.floor($),k<=0)throw new Error(`parser: max tree depth must be integer > 0: ${$}`)},this.setMaxNodeHits=function($){if(typeof $!="number")throw new Error(`parser: max node hits must be integer > 0: ${$}`);if(w=Math.floor($),w<=0)throw new Error(`parser: max node hits must be integer > 0: ${$}`)};let q=function($,U,A){let C,Q=`${n}parse(): `;oe($);let J=fe(U);ae(),L(),Y(),R();let le=new O;switch(A!=null&&(E=A),o=[{type:e.RNM,index:J}],i(0,c,le),o=null,le.state){case e.ACTIVE:throw new Error(`${Q}final state should never be 'ACTIVE'`);case e.NOMATCH:C=!1;break;case e.EMPTY:case e.MATCH:le.phraseLength===u?C=!0:C=!1;break;default:throw new Error("unrecognized state")}return{success:C,state:le.state,length:u,matched:le.phraseLength,maxMatched:v,maxTreeDepth:h,nodeHits:b,inputLength:a.length,subBegin:c,subEnd:l,subLength:u}};this.parseSubstring=function(U,A,C,Q,J,le){return Z(),K(C,Q,J),q(U,A,le)},this.parse=function(U,A,C,Q){return Z(),K(C,0,C.length),q(U,A,Q)};let I=function($,U,A){let C=o[$];for(let Q=0;Q<C.children.length&&(i(C.children[Q],U,A),A.state===e.NOMATCH);Q+=1);},ye=function($,U,A){let C,Q,J,le,Te=o[$],Mt=A.uFrame.length(),Ot=A.pFrame.length();s.ast&&(Q=s.ast.getLength()),C=!0,J=U,le=0;for(let Ge=0;Ge<Te.children.length;Ge+=1)if(i(Te.children[Ge],J,A),A.state===e.NOMATCH){C=!1;break}else J+=A.phraseLength,le+=A.phraseLength;C?(A.state=le===0?e.EMPTY:e.MATCH,A.phraseLength=le):(A.state=e.NOMATCH,A.phraseLength=0,A.uFrame.pop(Mt),A.pFrame.pop(Ot),s.ast&&s.ast.setLength(Q))},st=function($,U,A){let C,Q,J,le,Te=o[$];if(Te.max===0){A.state=e.EMPTY,A.phraseLength=0;return}Q=U,J=0,le=0;let Mt=A.uFrame.length(),Ot=A.pFrame.length();s.ast&&(C=s.ast.getLength());let Ge=!0;for(;Ge&&!(Q>=l||(i($+1,Q,A),A.state===e.NOMATCH)||A.state===e.EMPTY||(le+=1,J+=A.phraseLength,Q+=A.phraseLength,le===Te.max)););A.state===e.EMPTY||le>=Te.min?(A.state=J===0?e.EMPTY:e.MATCH,A.phraseLength=J):(A.state=e.NOMATCH,A.phraseLength=0,A.uFrame.pop(Mt),A.pFrame.pop(Ot),s.ast&&s.ast.setLength(C))},Ke=function($,U,A,C){if(U.phraseLength>A){let Q=`${n}opRNM(${$.name}): callback function error: `;throw Q+=`sysData.phraseLength: ${U.phraseLength}`,Q+=` must be <= remaining chars: ${A}`,new Error(Q)}switch(U.state){case e.ACTIVE:if(C!==!0)throw new Error(`${n}opRNM(${$.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:U.phraseLength=0;break;case e.MATCH:U.phraseLength===0&&(U.state=e.EMPTY);break;case e.NOMATCH:U.phraseLength=0;break;default:throw new Error(`${n}opRNM(${$.name}): callback function return error. Unrecognized return state: ${U.state}`)}},We=function($,U,A){let C,Q,J,le,Te,Mt,Ot=o[$],Ge=m[Ot.index],Dt=p[Ge.index],Vi=!F();if(Vi&&(Q=s.ast&&s.ast.ruleDefined(Ot.index),Q&&(C=s.ast.getLength(),s.ast.down(Ot.index,m[Ot.index].name)),le=A.uFrame.length(),Te=A.pFrame.length(),A.uFrame.push(),A.pFrame.push(),Mt=A.pFrame,A.pFrame=new _),Dt===null)J=o,o=Ge.opcodes,i(0,U,A),o=J;else{let hA=l-U;A.ruleIndex=Ge.index,Dt(A,a,U,E),Ke(Ge,A,hA,!0),A.state===e.ACTIVE&&(J=o,o=Ge.opcodes,i(0,U,A),o=J,A.ruleIndex=Ge.index,Dt(A,a,U,E),Ke(Ge,A,hA,!1))}Vi&&(Q&&(A.state===e.NOMATCH?s.ast.setLength(C):s.ast.up(Ot.index,Ge.name,U,A.phraseLength)),A.pFrame=Mt,A.state===e.NOMATCH?(A.uFrame.pop(le),A.pFrame.pop(Te)):Ge.isBkr&&(A.pFrame.savePhrase(Ge.lower,U,A.phraseLength),A.uFrame.savePhrase(Ge.lower,U,A.phraseLength)))},D=function($,U,A){if(U.phraseLength>A){let C=`${n}opUDT(${$.name}): callback function error: `;throw C+=`sysData.phraseLength: ${U.phraseLength}`,C+=` must be <= remaining chars: ${A}`,new Error(C)}switch(U.state){case e.ACTIVE:throw new Error(`${n}opUDT(${$.name}): callback function return error. ACTIVE state not allowed.`);case e.EMPTY:if($.empty===!1)throw new Error(`${n}opUDT(${$.name}): callback function return error. May not return EMPTY.`);U.phraseLength=0;break;case e.MATCH:if(U.phraseLength===0){if($.empty===!1)throw new Error(`${n}opUDT(${$.name}): callback function return error. May not return EMPTY.`);U.state=e.EMPTY}break;case e.NOMATCH:U.phraseLength=0;break;default:throw new Error(`${n}opUDT(${$.name}): callback function return error. Unrecognized return state: ${U.state}`)}},j=function($,U,A){let C,Q,J,le,Te,Mt,Ot=o[$],Ge=y[Ot.index];A.UdtIndex=Ge.index;let Dt=!F();Dt&&(J=s.ast&&s.ast.udtDefined(Ot.index),J&&(Q=m.length+Ot.index,C=s.ast.getLength(),s.ast.down(Q,Ge.name)),le=A.uFrame.length(),Te=A.pFrame.length(),A.uFrame.push(),A.pFrame.push(),Mt=A.pFrame,A.pFrame=new _);let Vi=l-U;g[Ot.index](A,a,U,E),D(Ge,A,Vi),Dt&&(J&&(A.state===e.NOMATCH?s.ast.setLength(C):s.ast.up(Q,Ge.name,U,A.phraseLength)),A.pFrame=Mt,A.state===e.NOMATCH?(A.uFrame.pop(le),A.pFrame.pop(Te)):Ge.isBkr&&(A.pFrame.savePhrase(Ge.lower,U,A.phraseLength),A.uFrame.savePhrase(Ge.lower,U,A.phraseLength)))},N=function($,U,A){f.push({lookAround:e.LOOKAROUND_AHEAD,anchor:U,charsEnd:l,charsLength:u}),l=a.length,u=a.length-c,i($+1,U,A);let C=f.pop();switch(l=C.charsEnd,u=C.charsLength,A.phraseLength=0,A.state){case e.EMPTY:A.state=e.EMPTY;break;case e.MATCH:A.state=e.EMPTY;break;case e.NOMATCH:A.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${A.state}`)}},ee=function($,U,A){f.push({lookAround:e.LOOKAROUND_AHEAD,anchor:U,charsEnd:l,charsLength:u}),l=a.length,u=a.length-c,i($+1,U,A);let C=f.pop();switch(l=C.charsEnd,u=C.charsLength,A.phraseLength=0,A.state){case e.EMPTY:case e.MATCH:A.state=e.NOMATCH;break;case e.NOMATCH:A.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${A.state}`)}},ce=function($,U,A){let C=o[$];A.state=e.NOMATCH,U<l&&C.min<=a[U]&&a[U]<=C.max&&(A.state=e.MATCH,A.phraseLength=1)},he=function($,U,A){let C,Q=o[$],J=Q.string.length;if(A.state=e.NOMATCH,U+J<=l){for(C=0;C<J;C+=1)if(a[U+C]!==Q.string[C])return;A.state=e.MATCH,A.phraseLength=J}},xe=function($,U,A){let C,Q,J=o[$];A.state=e.NOMATCH;let le=J.string.length;if(le===0){A.state=e.EMPTY;return}if(U+le<=l){for(C=0;C<le;C+=1)if(Q=a[U+C],Q>=65&&Q<=90&&(Q+=32),Q!==J.string[C])return;A.state=e.MATCH,A.phraseLength=le}},V=function($,U,A){A.state=e.NOMATCH,A.phraseLength=0,A.state=U===0?e.EMPTY:e.NOMATCH},te=function($,U,A){A.state=e.NOMATCH,A.phraseLength=0,A.state=U===a.length?e.EMPTY:e.NOMATCH},H=function($,U,A){let C,Q,J,le,Te=o[$];A.state=e.NOMATCH,Te.index<m.length?le=m[Te.index].lower:le=y[Te.index-m.length].lower;let Mt=Te.bkrMode===e.BKR_MODE_PM?A.pFrame.getPhrase(le):A.uFrame.getPhrase(le),Ot=Te.bkrCase===e.BKR_MODE_CI;if(Mt===null)return;let Ge=Mt.phraseIndex,Dt=Mt.phraseLength;if(Dt===0){A.state=e.EMPTY;return}if(U+Dt<=l){if(Ot){for(C=0;C<Dt;C+=1)if(Q=a[U+C],J=a[Ge+C],Q>=65&&Q<=90&&(Q+=32),J>=65&&J<=90&&(J+=32),Q!==J)return;A.state=e.MATCH,A.phraseLength=Dt}else for(C=0;C<Dt;C+=1)if(Q=a[U+C],J=a[Ge+C],Q!==J)return;A.state=e.MATCH,A.phraseLength=Dt}},re=function($,U,A){switch(f.push({lookAround:e.LOOKAROUND_BEHIND,anchor:U}),i($+1,U,A),f.pop(),A.phraseLength=0,A.state){case e.EMPTY:A.state=e.EMPTY;break;case e.MATCH:A.state=e.EMPTY;break;case e.NOMATCH:A.state=e.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${A.state}`)}},T=function($,U,A){switch(f.push({lookAround:e.LOOKAROUND_BEHIND,anchor:U}),i($+1,U,A),f.pop(),A.phraseLength=0,A.state){case e.EMPTY:case e.MATCH:A.state=e.NOMATCH;break;case e.NOMATCH:A.state=e.EMPTY;break;default:throw new Error(`opBKN: invalid state ${A.state}`)}},W=function($,U,A){let C,Q,J,le,Te=o[$],Mt=A.uFrame.length(),Ot=A.pFrame.length();s.ast&&(Q=s.ast.getLength()),C=!0,J=U,le=0;for(let Ge=Te.children.length-1;Ge>=0;Ge-=1)if(i(Te.children[Ge],J,A),J-=A.phraseLength,le+=A.phraseLength,A.state===e.NOMATCH){C=!1;break}C?(A.state=le===0?e.EMPTY:e.MATCH,A.phraseLength=le):(A.state=e.NOMATCH,A.phraseLength=0,A.uFrame.pop(Mt),A.pFrame.pop(Ot),s.ast&&s.ast.setLength(Q))},Ee=function($,U,A){let C,Q,J,le,Te=o[$];Q=U,J=0,le=0;let Mt=A.uFrame.length(),Ot=A.pFrame.length();s.ast&&(C=s.ast.getLength());let Ge=!0;for(;Ge&&!(Q<=0||(i($+1,Q,A),A.state===e.NOMATCH)||A.state===e.EMPTY||(le+=1,J+=A.phraseLength,Q-=A.phraseLength,le===Te.max)););A.state===e.EMPTY||le>=Te.min?(A.state=J===0?e.EMPTY:e.MATCH,A.phraseLength=J):(A.state=e.NOMATCH,A.phraseLength=0,A.uFrame.pop(Mt),A.pFrame.pop(Ot),s.ast&&s.ast.setLength(C))},Be=function($,U,A){let C=o[$];if(A.state=e.NOMATCH,A.phraseLength=0,U>0){let Q=a[U-1];C.min<=Q&&Q<=C.max&&(A.state=e.MATCH,A.phraseLength=1)}},ut=function($,U,A){let C,Q=o[$];A.state=e.NOMATCH;let J=Q.string.length,le=U-J;if(le>=0){for(C=0;C<J;C+=1)if(a[le+C]!==Q.string[C])return;A.state=e.MATCH,A.phraseLength=J}},lc=function($,U,A){let C,Q=o[$];A.state=e.NOMATCH;let J=Q.string.length;if(J===0){A.state=e.EMPTY;return}let le=U-J;if(le>=0){for(let Te=0;Te<J;Te+=1)if(C=a[le+Te],C>=65&&C<=90&&(C+=32),C!==Q.string[Te])return;A.state=e.MATCH,A.phraseLength=J}},u0=function($,U,A){let C,Q,J,le,Te=o[$];A.state=e.NOMATCH,A.phraseLength=0,Te.index<m.length?le=m[Te.index].lower:le=y[Te.index-m.length].lower;let Mt=Te.bkrMode===e.BKR_MODE_PM?A.pFrame.getPhrase(le):A.uFrame.getPhrase(le),Ot=Te.bkrCase===e.BKR_MODE_CI;if(Mt===null)return;let Ge=Mt.phraseIndex,Dt=Mt.phraseLength;if(Dt===0){A.state=e.EMPTY,A.phraseLength=0;return}let Vi=U-Dt;if(Vi>=0){if(Ot){for(C=0;C<Dt;C+=1)if(Q=a[Vi+C],J=a[Ge+C],Q>=65&&Q<=90&&(Q+=32),J>=65&&J<=90&&(J+=32),Q!==J)return;A.state=e.MATCH,A.phraseLength=Dt}else for(C=0;C<Dt;C+=1)if(Q=a[Vi+C],J=a[Ge+C],Q!==J)return;A.state=e.MATCH,A.phraseLength=Dt}};i=function(U,A,C){let Q=!0,J=o[U];if(b+=1,b>w)throw new Error(`parser: maximum number of node hits exceeded: ${w}`);if(d+=1,d>h&&(h=d,h>k))throw new Error(`parser: maximum parse tree depth exceeded: ${k}`);if(C.refresh(),s.trace!==null){let le=S();s.trace.down(J,C.state,A,C.phraseLength,le.anchor,le.lookAround)}if(G())switch(J.type){case e.ALT:I(U,A,C);break;case e.CAT:W(U,A,C);break;case e.REP:Ee(U,A,C);break;case e.RNM:We(U,A,C);break;case e.UDT:j(U,A,C);break;case e.AND:N(U,A,C);break;case e.NOT:ee(U,A,C);break;case e.TRG:Be(U,A,C);break;case e.TBS:ut(U,A,C);break;case e.TLS:lc(U,A,C);break;case e.BKR:u0(U,A,C);break;case e.BKA:re(U,A,C);break;case e.BKN:T(U,A,C);break;case e.ABG:V(U,A,C);break;case e.AEN:te(U,A,C);break;default:Q=!1;break}else switch(J.type){case e.ALT:I(U,A,C);break;case e.CAT:ye(U,A,C);break;case e.REP:st(U,A,C);break;case e.RNM:We(U,A,C);break;case e.UDT:j(U,A,C);break;case e.AND:N(U,A,C);break;case e.NOT:ee(U,A,C);break;case e.TRG:ce(U,A,C);break;case e.TBS:he(U,A,C);break;case e.TLS:xe(U,A,C);break;case e.BKR:H(U,A,C);break;case e.BKA:re(U,A,C);break;case e.BKN:T(U,A,C);break;case e.ABG:V(U,A,C);break;case e.AEN:te(U,A,C);break;default:Q=!1;break}if(!F()&&A+C.phraseLength>v&&(v=A+C.phraseLength),s.stats!==null&&s.stats.collect(J,C),s.trace!==null){let le=S();s.trace.up(J,C.state,A,C.phraseLength,le.anchor,le.lookAround)}return d-=1,Q}}});var XA=M((Jz,ZA)=>{ZA.exports=function(){let e=Yn(),t=wa(),n=Ql(),s="stats.js: ",i=[],o=[],a=[],c,u=[],l=[];this.statsObject="statsObject";let f="stats",d=function(w,P){return w.lower<P.lower?-1:w.lower>P.lower?1:0},h=function(w,P){return w.total<P.total?1:w.total>P.total?-1:d(w,P)},b=function(w,P){return w.index<P.index?-1:w.index>P.index?1:0},p=function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},g=function(){a.length=0,c=new p,a[e.ALT]=new p,a[e.CAT]=new p,a[e.REP]=new p,a[e.RNM]=new p,a[e.TRG]=new p,a[e.TBS]=new p,a[e.TLS]=new p,a[e.UDT]=new p,a[e.AND]=new p,a[e.NOT]=new p,a[e.BKR]=new p,a[e.BKA]=new p,a[e.BKN]=new p,a[e.ABG]=new p,a[e.AEN]=new p,u.length=0;for(let w=0;w<i.length;w+=1)u.push({empty:0,match:0,nomatch:0,total:0,name:i[w].name,lower:i[w].lower,index:i[w].index});if(o.length>0){l.length=0;for(let w=0;w<o.length;w+=1)l.push({empty:0,match:0,nomatch:0,total:0,name:o[w].name,lower:o[w].lower,index:o[w].index})}},m=function(w,P){switch(w.total+=1,P){case e.EMPTY:w.empty+=1;break;case e.MATCH:w.match+=1;break;case e.NOMATCH:w.nomatch+=1;break;default:throw new Error(`${s}collect(): incStat(): unrecognized state: ${P}`)}},y=function(w,P){let B="";return B+="<tr>",B+=`<td class="${n.CLASS_ACTIVE}">${w}</td>`,B+=`<td class="${n.CLASS_EMPTY}">${P.empty}</td>`,B+=`<td class="${n.CLASS_MATCH}">${P.match}</td>`,B+=`<td class="${n.CLASS_NOMATCH}">${P.nomatch}</td>`,B+=`<td class="${n.CLASS_ACTIVE}">${P.total}</td>`,B+=`</tr>
|
|
259
259
|
`,B},E=function(){let w="";return w+=y("ALT",a[e.ALT]),w+=y("CAT",a[e.CAT]),w+=y("REP",a[e.REP]),w+=y("RNM",a[e.RNM]),w+=y("TRG",a[e.TRG]),w+=y("TBS",a[e.TBS]),w+=y("TLS",a[e.TLS]),w+=y("UDT",a[e.UDT]),w+=y("AND",a[e.AND]),w+=y("NOT",a[e.NOT]),w+=y("BKR",a[e.BKR]),w+=y("BKA",a[e.BKA]),w+=y("BKN",a[e.BKN]),w+=y("ABG",a[e.ABG]),w+=y("AEN",a[e.AEN]),w+=y("totals",c),w},v=function(){let w="";w+=`<tr><th></th><th></th><th></th><th></th><th></th></tr>
|
|
260
260
|
`,w+=`<tr><th>rules</th><th></th><th></th><th></th><th></th></tr>
|
|
261
261
|
`;for(let P=0;P<i.length;P+=1)u[P].total>0&&(w+="<tr>",w+=`<td class="${n.CLASS_ACTIVE}">${u[P].name}</td>`,w+=`<td class="${n.CLASS_EMPTY}">${u[P].empty}</td>`,w+=`<td class="${n.CLASS_MATCH}">${u[P].match}</td>`,w+=`<td class="${n.CLASS_NOMATCH}">${u[P].nomatch}</td>`,w+=`<td class="${n.CLASS_ACTIVE}">${u[P].total}</td>`,w+=`</tr>
|
|
@@ -270,7 +270,7 @@ table.apg-attrs a:hover {
|
|
|
270
270
|
`,B+=`<th class="${n.CLASS_NOMATCH}">NOMATCH</th>
|
|
271
271
|
`,B+=`<th class="${n.CLASS_ACTIVE}">totals</th></tr>
|
|
272
272
|
`;let Z=!0;for(;Z;){if(w===void 0){B+=E();break}if(w===null){B+=E();break}if(w==="ops"){B+=E();break}if(w==="index"){u.sort(b),l.length>0&&l.sort(b),B+=E(),B+=v();break}if(w==="hits"){u.sort(h),l.length>0&&l.sort(b),B+=E(),B+=v();break}if(w==="alpha"){u.sort(d),l.length>0&&l.sort(d),B+=E(),B+=v();break}break}return B+=`</table>
|
|
273
|
-
`,B},this.toHtmlPage=function(w,P,B){return t.htmlToPage(this.toHtml(w,P),B)}}});var
|
|
273
|
+
`,B},this.toHtmlPage=function(w,P,B){return t.htmlToPage(this.toHtml(w,P),B)}}});var tE=M((Qz,eE)=>{eE.exports=function(){let e=wa(),t=Ql(),n=new(Rx()),s=Yn(),i="trace.js: ",o=this,a=16,c=10,u=8,l=32,f=80,d=5,h=[],b=5e3,p=-1,g=0,m=0,y=[],E=null,v=null,k=null,w=[],P=[],B=`<span class="${t.CLASS_LINEEND}">•</span>`,Z=`<span class="${t.CLASS_LINEEND}">…</span>`,_=`<span class="${t.CLASS_EMPTY}">𝜺</span>`,O=function(){let D=function(N){w[s.ALT]=N,w[s.CAT]=N,w[s.REP]=N,w[s.TLS]=N,w[s.TBS]=N,w[s.TRG]=N,w[s.AND]=N,w[s.NOT]=N,w[s.BKR]=N,w[s.BKA]=N,w[s.BKN]=N,w[s.ABG]=N,w[s.AEN]=N},j=0;for(let N in o.filter.operators)j+=1;if(j===0){D(!1);return}for(let N in o.filter.operators){let ee=N.toUpperCase();if(ee==="<ALL>"){D(!0);return}if(ee==="<NONE>"){D(!1);return}}D(!1);for(let N in o.filter.operators){let ee=N.toUpperCase();if(ee==="ALT")w[s.ALT]=o.filter.operators[N]===!0;else if(ee==="CAT")w[s.CAT]=o.filter.operators[N]===!0;else if(ee==="REP")w[s.REP]=o.filter.operators[N]===!0;else if(ee==="AND")w[s.AND]=o.filter.operators[N]===!0;else if(ee==="NOT")w[s.NOT]=o.filter.operators[N]===!0;else if(ee==="TLS")w[s.TLS]=o.filter.operators[N]===!0;else if(ee==="TBS")w[s.TBS]=o.filter.operators[N]===!0;else if(ee==="TRG")w[s.TRG]=o.filter.operators[N]===!0;else if(ee==="BKR")w[s.BKR]=o.filter.operators[N]===!0;else if(ee==="BKA")w[s.BKA]=o.filter.operators[N]===!0;else if(ee==="BKN")w[s.BKN]=o.filter.operators[N]===!0;else if(ee==="ABG")w[s.ABG]=o.filter.operators[N]===!0;else if(ee==="AEN")w[s.AEN]=o.filter.operators[N]===!0;else throw new Error(`${i}initOpratorFilter: '${N}' not a valid operator name. Must be <all>, <none>, alt, cat, rep, tls, tbs, trg, and, not, bkr, bka or bkn`)}},S=function(){let D=function(ce){w[s.RNM]=ce,w[s.UDT]=ce;let he=v.length+k.length;P.length=0;for(let xe=0;xe<he;xe+=1)P.push(ce)},j,N,ee=[];for(N=0;N<v.length;N+=1)ee.push(v[N].lower);for(N=0;N<k.length;N+=1)ee.push(k[N].lower);P.length=0,j=0;for(let ce in o.filter.rules)j+=1;if(j===0){D(!0);return}for(let ce in o.filter.rules){let he=ce.toLowerCase();if(he==="<all>"){D(!0);return}if(he==="<none>"){D(!1);return}}D(!1),w[s.RNM]=!0,w[s.UDT]=!0;for(let ce in o.filter.rules){let he=ce.toLowerCase();if(N=ee.indexOf(he),N<0)throw new Error(`${i}initRuleFilter: '${ce}' not a valid rule or udt name`);P[N]=o.filter.rules[ce]===!0}};this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(D,j){if(p=-1,typeof D=="number"&&D>0)b=Math.ceil(D);else{b=0;return}typeof j=="number"&&(p=Math.floor(j),p<0&&(p=-1))},this.getMaxRecords=function(){return b},this.getLastRecord=function(){return p},this.init=function(D,j,N){h.length=0,y.length=0,g=0,m=0,E=N,v=D,k=j,O(),S(),n.init(b)};let F=function(D){let j=!1;return D.type===s.RNM?w[D.type]&&P[D.index]?j=!0:j=!1:D.type===s.UDT?w[D.type]&&P[v.length+D.index]?j=!0:j=!1:j=w[D.type],j},G=function(D){return p===-1||D<=p};this.down=function(D,j,N,ee,ce,he){G(g)&&F(D)&&(y.push(g),h[n.increment()]={dirUp:!1,depth:m,thisLine:g,thatLine:void 0,opcode:D,state:j,phraseIndex:N,phraseLength:ee,lookAnchor:ce,lookAround:he},g+=1,m+=1)},this.up=function(D,j,N,ee,ce,he){if(G(g)&&F(D)){let xe=g,V=y.pop(),te=n.getListIndex(V);te!==-1&&(h[te].thatLine=xe),m-=1,h[n.increment()]={dirUp:!0,depth:m,thisLine:xe,thatLine:V,opcode:D,state:j,phraseIndex:N,phraseLength:ee,lookAnchor:ce,lookAround:he},g+=1}};let R=function(){function D(A,C){let Q,J,le;if(C)switch(A.op={id:C.type,name:e.opcodeToString(C.type)},A.opData=void 0,C.type){case s.RNM:A.opData=v[C.index].name;break;case s.UDT:A.opData=k[C.index].name;break;case s.BKR:C.index<v.length?Q=v[C.index].name:Q=k[C.index-v.length].name,J=C.bkrCase===s.BKR_MODE_CI?"%i":"%s",le=C.bkrMode===s.BKR_MODE_UM?"%u":"%p",A.opData=`\\\\${J}${le}${Q}`;break;case s.TLS:A.opData=[];for(let Te=0;Te<C.string.length;Te+=1)A.opData.push(C.string[Te]);break;case s.TBS:A.opData=[];for(let Te=0;Te<C.string.length;Te+=1)A.opData.push(C.string[Te]);break;case s.TRG:A.opData=[C.min,C.max];break;case s.REP:A.opData=[C.min,C.max];break;default:throw new Error("unrecognized opcode")}else A.op={id:void 0,name:void 0},A.opData=void 0}function j(A,C,Q){return A===s.MATCH?{index:C,length:Q}:A===s.NOMATCH?{index:C,length:0}:A===s.EMPTY?{index:C,length:0}:null}let N=-1;function ee(A,C,Q){let J={id:N++,branch:-1,parent:A,up:!1,down:!1,depth:Q,children:[]};return C?(J.down=!0,J.state={id:C.state,name:e.stateToString(C.state)},J.phrase=null,D(J,C.opcode)):(J.state={id:void 0,name:void 0},J.phrase=j(),D(J,void 0)),J}function ce(A,C){C&&(A.up=!0,A.state={id:C.state,name:e.stateToString(C.state)},A.phrase=j(C.state,C.phraseIndex,C.phraseLength),A.down||D(A,C.opcode))}let he=0,xe=-1,V=1;function te(A){if(xe+=1,A.branch=V,xe>m&&(m=xe),A.children.length===0)he+=1;else for(let C=0;C<A.children.length;C+=1)C>0&&(V+=1),A.children[C].leftMost=!1,A.children[C].rightMost=!1,A.leftMost&&(A.children[C].leftMost=C===0),A.rightMost&&(A.children[C].rightMost=C===A.children.length-1),te(A.children[C]);xe-=1}function H(A,C){let Q,J={};if(J.id=A.id,J.branch=A.branch,J.leftMost=A.leftMost,J.rightMost=A.rightMost,Q=A.state.name?A.state.name:"ACTIVE",J.state={id:A.state.id,name:Q},Q=A.op.name?A.op.name:"?",J.op={id:A.op.id,name:Q},typeof A.opData=="string")J.opData=A.opData;else if(Array.isArray(A.opData)){J.opData=[];for(let le=0;le<A.opData.length;le+=1)J.opData[le]=A.opData[le]}else J.opData=void 0;A.phrase?J.phrase={index:A.phrase.index,length:A.phrase.length}:J.phrase=null,J.depth=A.depth,J.children=[];for(let le=0;le<A.children.length;le+=1){let Te=le!==A.children.length-1;J.children[le]=H(A.children[le],C,Te)}return J}let re=[],T,W,Ee,Be,ut=!0,lc=ee(null,null,-1);for(re.push(lc),W=lc,n.forEach(A=>{if(Be=h[A],ut&&(ut=!1,Be.depth>0)){let C=Be.dirUp?Be.depth+1:Be.depth;for(let Q=0;Q<C;Q+=1)Ee=W,W=ee(W,null,Q),re.push(W),Ee.children.push(W)}Be.dirUp?(W=re.pop(),ce(W,Be),W=re[re.length-1]):(Ee=W,W=ee(W,Be,Be.depth),re.push(W),Ee.children.push(W))});re.length>1;)W=re.pop(),ce(W,null);if(lc.children.length===0)throw new Error("trace.toTree(): parse tree has no nodes");if(re.length===0)throw new Error("trace.toTree(): integrity check: dummy root node disappeared?");T=lc.children[0];let u0=T;for(;T&&!T.down&&!T.up;)u0=T,T=T.children[0];T=u0,T.leftMost=!0,T.rightMost=!0,te(T),T.branch=0;let $={};$.string=[];for(let A=0;A<E.length;A+=1)$.string[A]=E[A];$.rules=[];for(let A=0;A<v.length;A+=1)$.rules[A]=v[A].name;$.udts=[];for(let A=0;A<k.length;A+=1)$.udts[A]=k[A].name;$.id={},$.id.ALT={id:s.ALT,name:"ALT"},$.id.CAT={id:s.CAT,name:"CAT"},$.id.REP={id:s.REP,name:"REP"},$.id.RNM={id:s.RNM,name:"RNM"},$.id.TLS={id:s.TLS,name:"TLS"},$.id.TBS={id:s.TBS,name:"TBS"},$.id.TRG={id:s.TRG,name:"TRG"},$.id.UDT={id:s.UDT,name:"UDT"},$.id.AND={id:s.AND,name:"AND"},$.id.NOT={id:s.NOT,name:"NOT"},$.id.BKR={id:s.BKR,name:"BKR"},$.id.BKA={id:s.BKA,name:"BKA"},$.id.BKN={id:s.BKN,name:"BKN"},$.id.ABG={id:s.ABG,name:"ABG"},$.id.AEN={id:s.AEN,name:"AEN"},$.id.ACTIVE={id:s.ACTIVE,name:"ACTIVE"},$.id.MATCH={id:s.MATCH,name:"MATCH"},$.id.EMPTY={id:s.EMPTY,name:"EMPTY"},$.id.NOMATCH={id:s.NOMATCH,name:"NOMATCH"},$.treeDepth=m,$.leafNodes=he;let U;return T.down?T.up?U="none":U="right":T.up?U="left":U="both",$.branchesIncomplete=U,$.tree=H(T,T.depth,!1),$};this.toTree=function(D){let j=R();return D?JSON.stringify(j):j},this.toHtmlPage=function(D,j,N){return e.htmlToPage(this.toHtml(D,j),N)};let L=function(D,j){let N;switch(D){case a:N="hexadecimal";break;case c:N="decimal";break;case u:N="ASCII";break;case l:N="UNICODE";break;default:throw new Error(`${i}htmlHeader: unrecognized mode: ${D}`)}let ee="";return ee+=`<p>display mode: ${N}</p>
|
|
274
274
|
`,ee+=`<table class="${t.CLASS_TRACE}">
|
|
275
275
|
`,typeof j=="string"&&(ee+=`<caption>${j}</caption>`),ee},Y=function(){let D="";return D+=`</table>
|
|
276
276
|
`,D+=`<p class="${t.CLASS_MONOSPACE}">legend:<br>
|
|
@@ -315,11 +315,11 @@ table.apg-attrs a:hover {
|
|
|
315
315
|
`,D+=`ABG - anchor - begin of input string<br>
|
|
316
316
|
`,D+=`AEN - anchor - end of input string<br>
|
|
317
317
|
`,D+=`</p>
|
|
318
|
-
`,D};this.indent=function(D){let j="";for(let N=0;N<D;N+=1)j+=".";return j};let oe=function(D,j){let N="";if(j.type===s.TRG)if(D===a||D===l){let ee=j.min.toString(16).toUpperCase();ee.length%2!==0&&(ee=`0${ee}`),N+=D===a?"%x":"U+",N+=ee,ee=j.max.toString(16).toUpperCase(),ee.length%2!==0&&(ee=`0${ee}`),N+=`–${ee}`}else N=`%d${j.min.toString(10)}–${j.max.toString(10)}`;return N},fe=function(D,j){let N="";if(j.type===s.REP)if(D===a){let ee=j.min.toString(16).toUpperCase();ee.length%2!==0&&(ee=`0${ee}`),N=`x${ee}`,j.max<1/0?(ee=j.max.toString(16).toUpperCase(),ee.length%2!==0&&(ee=`0${ee}`)):ee="inf",N+=`–${ee}`}else j.max<1/0?N=`${j.min.toString(10)}–${j.max.toString(10)}`:N=`${j.min.toString(10)}–inf`;return N},K=function(D,j){let N="";if(j.type===s.TBS){let ee=Math.min(j.string.length,d*2);if(D===a||D===l){N+=D===a?"%x":"U+";for(let ce=0;ce<ee;ce+=1){let he;ce>0&&(N+="."),he=j.string[ce].toString(16).toUpperCase(),he.length%2!==0&&(he=`0${he}`),N+=he}}else{N="%d";for(let ce=0;ce<ee;ce+=1)ce>0&&(N+="."),N+=j.string[ce].toString(10)}ee<j.string.length&&(N+=Z)}return N},ae=function(D,j){let N="";if(j.type===s.TLS){let ee=Math.min(j.string.length,d);if(D===a||D===c){let ce,he,xe;D===a?(N="%x",xe=16):(N="%d",xe=10);for(let V=0;V<ee;V+=1)V>0&&(N+="."),he=j.string[V],he>=97&&he<=122?(ce=he-32,N+=`${ce.toString(xe)}/${he.toString(xe)}`.toUpperCase()):he>=65&&he<=90?(ce=he,he+=32,N+=`${ce.toString(xe)}/${he.toString(xe)}`.toUpperCase()):N+=he.toString(xe).toUpperCase();ee<j.string.length&&(N+=Z)}else{N='"';for(let ce=0;ce<ee;ce+=1)N+=e.asciiChars[j.string[ce]];ee<j.string.length&&(N+=Z),N+='"'}}return N},q=function(D,j,N,ee,ce){if(ee===0)return"";let he="",xe=ce?",":"";switch(D){case a:he=xe+e.charsToHex(j,N,ee);break;case c:if(ce)return`,${e.charsToDec(j,N,ee)}`;he=xe+e.charsToDec(j,N,ee);break;case l:he=e.charsToUnicode(j,N,ee);break;case u:default:he=e.charsToAsciiHtml(j,N,ee);break}return he},I=function(D,j,N,ee,ce,he){let xe="",V,te,H,re,T=B,
|
|
318
|
+
`,D};this.indent=function(D){let j="";for(let N=0;N<D;N+=1)j+=".";return j};let oe=function(D,j){let N="";if(j.type===s.TRG)if(D===a||D===l){let ee=j.min.toString(16).toUpperCase();ee.length%2!==0&&(ee=`0${ee}`),N+=D===a?"%x":"U+",N+=ee,ee=j.max.toString(16).toUpperCase(),ee.length%2!==0&&(ee=`0${ee}`),N+=`–${ee}`}else N=`%d${j.min.toString(10)}–${j.max.toString(10)}`;return N},fe=function(D,j){let N="";if(j.type===s.REP)if(D===a){let ee=j.min.toString(16).toUpperCase();ee.length%2!==0&&(ee=`0${ee}`),N=`x${ee}`,j.max<1/0?(ee=j.max.toString(16).toUpperCase(),ee.length%2!==0&&(ee=`0${ee}`)):ee="inf",N+=`–${ee}`}else j.max<1/0?N=`${j.min.toString(10)}–${j.max.toString(10)}`:N=`${j.min.toString(10)}–inf`;return N},K=function(D,j){let N="";if(j.type===s.TBS){let ee=Math.min(j.string.length,d*2);if(D===a||D===l){N+=D===a?"%x":"U+";for(let ce=0;ce<ee;ce+=1){let he;ce>0&&(N+="."),he=j.string[ce].toString(16).toUpperCase(),he.length%2!==0&&(he=`0${he}`),N+=he}}else{N="%d";for(let ce=0;ce<ee;ce+=1)ce>0&&(N+="."),N+=j.string[ce].toString(10)}ee<j.string.length&&(N+=Z)}return N},ae=function(D,j){let N="";if(j.type===s.TLS){let ee=Math.min(j.string.length,d);if(D===a||D===c){let ce,he,xe;D===a?(N="%x",xe=16):(N="%d",xe=10);for(let V=0;V<ee;V+=1)V>0&&(N+="."),he=j.string[V],he>=97&&he<=122?(ce=he-32,N+=`${ce.toString(xe)}/${he.toString(xe)}`.toUpperCase()):he>=65&&he<=90?(ce=he,he+=32,N+=`${ce.toString(xe)}/${he.toString(xe)}`.toUpperCase()):N+=he.toString(xe).toUpperCase();ee<j.string.length&&(N+=Z)}else{N='"';for(let ce=0;ce<ee;ce+=1)N+=e.asciiChars[j.string[ce]];ee<j.string.length&&(N+=Z),N+='"'}}return N},q=function(D,j,N,ee,ce){if(ee===0)return"";let he="",xe=ce?",":"";switch(D){case a:he=xe+e.charsToHex(j,N,ee);break;case c:if(ce)return`,${e.charsToDec(j,N,ee)}`;he=xe+e.charsToDec(j,N,ee);break;case l:he=e.charsToUnicode(j,N,ee);break;case u:default:he=e.charsToAsciiHtml(j,N,ee);break}return he},I=function(D,j,N,ee,ce,he){let xe="",V,te,H,re,T=B,W=`<span class="${t.CLASS_LOOKBEHIND}">`,Ee=`<span class="${t.CLASS_REMAINDER}">`,Be="</span>",ut=!1;switch(N){case s.EMPTY:xe+=_;case s.NOMATCH:case s.MATCH:case s.ACTIVE:V=ee-ce,te=he-V,H=he,re=j.length-H;break;default:throw new Error("unrecognized state")}return T=B,te>f?(te=f,T=Z,re=0):te+re>f&&(T=Z,re=f-te),te>0&&(xe+=W,xe+=q(D,j,V,te,ut),xe+=Be,ut=!0),re>0&&(xe+=Ee,xe+=q(D,j,H,re,ut),xe+=Be),xe+T},ye=function(D,j,N,ee,ce,he){let xe="",V,te,H,re,T=B,W=`<span class="${t.CLASS_REMAINDER}">`,Ee="</span>",Be=!1;switch(N){case s.EMPTY:xe+=_;case s.NOMATCH:case s.ACTIVE:V=ee,te=0,H=ee,re=j.length-H;break;case s.MATCH:V=ee,te=ce,H=ee+te,re=j.length-H;break;default:throw new Error("unrecognized state")}return T=B,te>f?(te=f,T=Z,re=0):te+re>f&&(T=Z,re=f-te),te>0&&(xe+=he,xe+=q(D,j,V,te,Be),xe+=Ee,Be=!0),re>0&&(xe+=W,xe+=q(D,j,H,re,Be),xe+=Ee),xe+T},st=function(D,j,N,ee,ce){let he=`<span class="${t.CLASS_LOOKAHEAD}">`;return ye(D,j,N,ee,ce,he)},Ke=function(D,j,N,ee,ce){let he=`<span class="${t.CLASS_MATCH}">`;return ye(D,j,N,ee,ce,he)},We=function(D){if(v===null)return"";let j="",N,ee,ce,he,xe,V;return j+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",j+=`<th>operator</th><th>phrase</th></tr>
|
|
319
319
|
`,n.forEach(te=>{let H=h[te];switch(N=H.thisLine,ee=H.thatLine!==void 0?H.thatLine:"--",ce=!1,he=!1,xe=!1,H.lookAround===s.LOOKAROUND_AHEAD&&(ce=!0,xe=!0,V=H.lookAnchor),(H.opcode.type===s.AND||H.opcode.type===s.NOT)&&(ce=!0,xe=!0,V=H.phraseIndex),H.lookAround===s.LOOKAROUND_BEHIND&&(he=!0,xe=!0,V=H.lookAnchor),(H.opcode.type===s.BKA||H.opcode.type===s.BKN)&&(he=!0,xe=!0,V=H.phraseIndex),j+="<tr>",j+=`<td>${N}</td><td>${ee}</td>`,j+=`<td>${H.phraseIndex}</td>`,j+=`<td>${H.phraseLength}</td>`,j+=`<td>${H.depth}</td>`,j+="<td>",H.state){case s.ACTIVE:j+=`<span class="${t.CLASS_ACTIVE}">↓ </span>`;break;case s.MATCH:j+=`<span class="${t.CLASS_MATCH}">↑M</span>`;break;case s.NOMATCH:j+=`<span class="${t.CLASS_NOMATCH}">↑N</span>`;break;case s.EMPTY:j+=`<span class="${t.CLASS_EMPTY}">↑E</span>`;break;default:j+=`<span class="${t.CLASS_ACTIVE}">--</span>`;break}if(j+="</td>",j+="<td>",j+=o.indent(H.depth),ce?j+=`<span class="${t.CLASS_LOOKAHEAD}">`:he&&(j+=`<span class="${t.CLASS_LOOKBEHIND}">`),j+=e.opcodeToString(H.opcode.type),H.opcode.type===s.RNM&&(j+=`(${v[H.opcode.index].name}) `),H.opcode.type===s.BKR){let re=H.opcode.bkrCase===s.BKR_MODE_CI?"%i":"%s",T=H.opcode.bkrMode===s.BKR_MODE_UM?"%u":"%p";j+=`(\\${re}${T}${v[H.opcode.index].name}) `}H.opcode.type===s.UDT&&(j+=`(${k[H.opcode.index].name}) `),H.opcode.type===s.TRG&&(j+=`(${oe(D,H.opcode)}) `),H.opcode.type===s.TBS&&(j+=`(${K(D,H.opcode)}) `),H.opcode.type===s.TLS&&(j+=`(${ae(D,H.opcode)}) `),H.opcode.type===s.REP&&(j+=`(${fe(D,H.opcode)}) `),xe&&(j+="</span>"),j+="</td>",j+="<td>",he?j+=I(D,E,H.state,H.phraseIndex,H.phraseLength,V):ce?j+=st(D,E,H.state,H.phraseIndex,H.phraseLength):j+=Ke(D,E,H.state,H.phraseIndex,H.phraseLength),j+=`</td></tr>
|
|
320
320
|
`}),j+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",j+=`<th>operator</th><th>phrase</th></tr>
|
|
321
321
|
`,j+=`</table>
|
|
322
|
-
`,j};this.toHtml=function(D,j){let N=u;if(typeof D=="string"&&D.length>=3){let ce=D.toLowerCase().slice(0,3);ce==="hex"?N=a:ce==="dec"?N=c:ce==="uni"&&(N=l)}let ee="";return ee+=L(N,j),ee+=
|
|
322
|
+
`,j};this.toHtml=function(D,j){let N=u;if(typeof D=="string"&&D.length>=3){let ce=D.toLowerCase().slice(0,3);ce==="hex"?N=a:ce==="dec"?N=c:ce==="uni"&&(N=l)}let ee="";return ee+=L(N,j),ee+=We(N),ee+=Y(),ee}}});var Aa=M((Yz,rE)=>{rE.exports={ast:WA(),circular:Rx(),ids:Yn(),parser:YA(),stats:XA(),trace:tE(),utils:wa(),emitcss:Nx(),style:Ql()}});var sE=M((Zz,nE)=>{nE.exports=function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"file",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"line",lower:"line",index:1,isBkr:!1},this.rules[2]={name:"line-text",lower:"line-text",index:2,isBkr:!1},this.rules[3]={name:"last-line",lower:"last-line",index:3,isBkr:!1},this.rules[4]={name:"valid",lower:"valid",index:4,isBkr:!1},this.rules[5]={name:"invalid",lower:"invalid",index:5,isBkr:!1},this.rules[6]={name:"end",lower:"end",index:6,isBkr:!1},this.rules[7]={name:"CRLF",lower:"crlf",index:7,isBkr:!1},this.rules[8]={name:"LF",lower:"lf",index:8,isBkr:!1},this.rules[9]={name:"CR",lower:"cr",index:9,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:2,children:[1,3]},this.rules[0].opcodes[1]={type:3,min:0,max:1/0},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:3,min:0,max:1},this.rules[0].opcodes[4]={type:4,index:3},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,2]},this.rules[1].opcodes[1]={type:4,index:2},this.rules[1].opcodes[2]={type:4,index:6},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:3,min:0,max:1/0},this.rules[2].opcodes[1]={type:1,children:[2,3]},this.rules[2].opcodes[2]={type:4,index:4},this.rules[2].opcodes[3]={type:4,index:5},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:3,min:1,max:1/0},this.rules[3].opcodes[1]={type:1,children:[2,3]},this.rules[3].opcodes[2]={type:4,index:4},this.rules[3].opcodes[3]={type:4,index:5},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:5,min:32,max:126},this.rules[4].opcodes[2]={type:6,string:[9]},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[5].opcodes[1]={type:5,min:0,max:8},this.rules[5].opcodes[2]={type:5,min:11,max:12},this.rules[5].opcodes[3]={type:5,min:14,max:31},this.rules[5].opcodes[4]={type:5,min:127,max:4294967295},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:1,children:[1,2,3]},this.rules[6].opcodes[1]={type:4,index:7},this.rules[6].opcodes[2]={type:4,index:8},this.rules[6].opcodes[3]={type:4,index:9},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:6,string:[13,10]},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:6,string:[10]},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:6,string:[13]},this.toString=function(){let t="";return t+=`file = *line [last-line]
|
|
323
323
|
`,t+=`line = line-text end
|
|
324
324
|
`,t+=`line-text = *(valid/invalid)
|
|
325
325
|
`,t+=`last-line = 1*(valid/invalid)
|
|
@@ -329,7 +329,7 @@ table.apg-attrs a:hover {
|
|
|
329
329
|
`,t+=`CRLF = %d13.10
|
|
330
330
|
`,t+=`LF = %d10
|
|
331
331
|
`,t+=`CR = %d13
|
|
332
|
-
`,t}}});var iE=M(sE=>{var hr=Yn(),x7=wa();function y7(r,e,t,n,s){return r===hr.SEM_PRE?(s.endLength=0,s.textLength=0,s.invalidCount=0):s.lines.push({lineNo:s.lines.length,beginChar:t,length:n,textLength:s.textLength,endType:s.endType,invalidChars:s.invalidCount}),hr.SEM_OK}function w7(r,e,t,n,s){return r===hr.SEM_PRE&&(s.textLength=n),hr.SEM_OK}function A7(r,e,t,n,s){return r===hr.SEM_PRE?(s.endLength=0,s.textLength=0,s.invalidCount=0):s.strict?(s.lines.push({lineNo:s.lines.length,beginChar:t,length:n,textLength:n,endType:"none",invalidChars:s.invalidCount}),s.errors.push({line:s.lineNo,char:t+n,msg:"no line end on last line - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})):(e.push(10),s.lines.push({lineNo:s.lines.length,beginChar:t,length:n+1,textLength:n,endType:"LF",invalidChars:s.invalidCount})),hr.SEM_OK}function E7(r,e,t,n,s){return r===hr.SEM_PRE&&s.errors.push({line:s.lineNo,char:t,msg:`invalid character found '\\x${x7.charToHex(e[t])}'`}),hr.SEM_OK}function v7(r,e,t,n,s){return r===hr.SEM_POST&&(s.lineNo+=1),hr.SEM_OK}function T7(r,e,t,n,s){return r===hr.SEM_PRE&&(s.endType="LF",s.strict&&s.errors.push({line:s.lineNo,char:t,msg:"line end character LF(\\n, \\x0A) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),hr.SEM_OK}function P7(r,e,t,n,s){return r===hr.SEM_PRE&&(s.endType="CR",s.strict&&s.errors.push({line:s.lineNo,char:t,msg:"line end character CR(\\r, \\x0D) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),hr.SEM_OK}function k7(r,e,t,n,s){return r===hr.SEM_PRE&&(s.endType="CRLF"),hr.SEM_OK}var li=[];li.line=y7;li["line-text"]=w7;li["last-line"]=A7;li.invalid=E7;li.end=v7;li.lf=T7;li.cr=P7;li.crlf=k7;sE.callbacks=li});var aE=M((eV,oE)=>{oE.exports=function(e,t,n,s){let i="scanner.js: ",o=Aa(),a=new(nE()),{callbacks:c}=iE(),u=[],l=new o.parser;if(l.ast=new o.ast,l.ast.callbacks=c,s){if(s.traceObject!=="traceObject")throw new TypeError(`${i}trace argument is not a trace object`);l.trace=s}if(l.parse(a,"file",e).success!==!0){t.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});return}let d={lines:u,lineNo:0,errors:t,strict:!!n};return l.ast.translate(d),u}});var uE=M((tV,cE)=>{cE.exports=function(){let e="syntax-callbacks.js: ",t=Aa(),n=t.ids,s,i=function(ae,q,I,ye){switch(ae.state){case n.ACTIVE:ye.altStack=[],ye.repCount=0;break;case n.EMPTY:ye.errors.push({line:0,char:0,msg:"grammar file is empty"});break;case n.MATCH:ye.ruleCount===0&&ye.errors.push({line:0,char:0,msg:"no rules defined"});break;case n.NOMATCH:throw new Error(`${e}synFile: grammar file NOMATCH: design error: should never happen.`);default:throw new Error(`${e}synFile: unrecognized case.`)}},o=function(K,ae,q,I){switch(K.state){case n.ACTIVE:I.altStack.length=0,s={groupOpen:null,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},I.altStack.push(s);break;case n.EMPTY:throw new Error(`${e}synRule: EMPTY: rule cannot be empty`);case n.NOMATCH:break;case n.MATCH:I.ruleCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},a=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Unrecognized SABNF line. Invalid rule, comment or blank line."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},c=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Rule names must be alphanum and begin with alphabetic character."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},u=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Expected '=' or '=/'. Not found."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},l=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.strict&&I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"AND operator(&) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},f=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.strict&&I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"NOT operator(!) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},d=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.strict?I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Positive look-behind operator(&&) found - strict ABNF specified."}):I.lite&&I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Positive look-behind operator(&&) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},h=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.strict?I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Negative look-behind operator(!!) found - strict ABNF specified."}):I.lite&&I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Negative look-behind operator(!!) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},b=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.strict?I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Beginning of string anchor(%^) found - strict ABNF specified."}):I.lite&&I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Beginning of string anchor(%^) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},p=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.strict?I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"End of string anchor(%$) found - strict ABNF specified."}):I.lite&&I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"End of string anchor(%$) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},g=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(I.strict){let ye=t.utils.charsToString(ae,q,K.phraseLength);I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:`Back reference operator(${ye}) found - strict ABNF specified.`})}else if(I.lite){let ye=t.utils.charsToString(ae,q,K.phraseLength);I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:`Back reference operator(${ye}) found - apg-lite specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},m=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(I.strict){let ye=t.utils.charsToString(ae,q,K.phraseLength);I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:`UDT operator found(${ye}) - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},y=function(K,ae,q){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:s.tlsOpen=q;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},E=function(K,ae,q,I){switch(K.state){case n.ACTIVE:I.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.stringTabChar!==!1&&I.errors.push({line:I.findLine(I.lines,I.stringTabChar),char:I.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string (see 'quoted-string' definition, RFC 7405.)"});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},v=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.stringTabChar=q;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},k=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:I.errors.push({line:I.findLine(I.lines,s.tlsOpen),char:s.tlsOpen,msg:'Case-insensitive literal string("...") opened but not closed.'}),s.basicError=!0,s.tlsOpen=null;break;case n.MATCH:s.tlsOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},w=function(K,ae,q){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:s.clsOpen=q;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},P=function(K,ae,q,I){switch(K.state){case n.ACTIVE:I.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.stringTabChar!==!1&&I.errors.push({line:I.findLine(I.lines,I.stringTabChar),char:I.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},B=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:I.errors.push({line:I.findLine(I.lines,s.clsOpen),char:s.clsOpen,msg:"Case-sensitive literal string('...') opened but not closed."}),s.clsOpen=null,s.basicError=!0;break;case n.MATCH:I.strict&&I.errors.push({line:I.findLine(I.lines,s.clsOpen),char:s.clsOpen,msg:"Case-sensitive string operator('...') found - strict ABNF specified."}),s.clsOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},Z=function(K,ae,q){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:s.prosValOpen=q;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},_=function(K,ae,q,I){switch(K.state){case n.ACTIVE:I.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.stringTabChar!==!1&&I.errors.push({line:I.findLine(I.lines,I.stringTabChar),char:I.stringTabChar,msg:"Tab character (\\t, x09) not allowed in prose value string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},O=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:I.errors.push({line:I.findLine(I.lines,s.prosValOpen),char:s.prosValOpen,msg:"Prose value operator(<...>) opened but not closed."}),s.basicError=!0,s.prosValOpen=null;break;case n.MATCH:I.errors.push({line:I.findLine(I.lines,s.prosValOpen),char:s.prosValOpen,msg:"Prose value operator(<...>) found. The ABNF syntax is valid, but a parser cannot be generated from this grammar."}),s.prosValOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},S=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:s={groupOpen:q,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},I.altStack.push(s);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},F=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:I.errors.push({line:I.findLine(I.lines,s.groupOpen),char:s.groupOpen,msg:'Group "(...)" opened but not closed.'}),s=I.altStack.pop(),s.groupError=!0;break;case n.MATCH:s=I.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},G=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:s={groupOpen:null,groupError:!1,optionOpen:q,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},I.altStack.push(s);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},R=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:I.errors.push({line:I.findLine(I.lines,s.optionOpen),char:s.optionOpen,msg:'Option "[...]" opened but not closed.'}),s=I.altStack.pop(),s.optionError=!0;break;case n.MATCH:s=I.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},L=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:s.basicError===!1&&I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Unrecognized SABNF element."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},Y=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(K.phraseLength===1&&I.strict){let ye=ae[q]===13?"CR":"LF";I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:`Line end '${ye}' found - strict ABNF specified, only CRLF allowed.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},oe=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Unrecognized grammar element or characters."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},fe=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:I.repCount+=1;break;case n.MATCH:I.repCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}};this.callbacks=[],this.callbacks.andop=l,this.callbacks.basicelementerr=L,this.callbacks.clsclose=B,this.callbacks.clsopen=w,this.callbacks.clsstring=P,this.callbacks.definedaserror=u,this.callbacks.file=i,this.callbacks.groupclose=F,this.callbacks.groupopen=S,this.callbacks.lineenderror=oe,this.callbacks.lineend=Y,this.callbacks.notop=f,this.callbacks.optionclose=R,this.callbacks.optionopen=G,this.callbacks.prosvalclose=O,this.callbacks.prosvalopen=Z,this.callbacks.prosvalstring=_,this.callbacks.repetition=fe,this.callbacks.rule=o,this.callbacks.ruleerror=a,this.callbacks.rulenameerror=c,this.callbacks.stringtab=v,this.callbacks.tlsclose=k,this.callbacks.tlsopen=y,this.callbacks.tlsstring=E,this.callbacks.udtop=m,this.callbacks.bkaop=d,this.callbacks.bknop=h,this.callbacks.bkrop=g,this.callbacks.abgop=b,this.callbacks.aenop=p}});var fE=M((rV,lE)=>{lE.exports=function(){let e=Aa(),t=e.ids,n=function(){this.names=[],this.add=function(H){let re=-1;return this.get(H)===-1&&(re={name:H,lower:H.toLowerCase(),index:this.names.length},this.names.push(re)),re},this.get=function(H){let re=-1,T=H.toLowerCase();for(let J=0;J<this.names.length;J+=1)if(this.names[J].lower===T){re=this.names[J];break}return re}},s=function(te,H,re){let T=0;for(let J=H;J<H+re;J+=1)T=10*T+te[J]-48;return T},i=function(te,H,re){let T=0;for(let J=H;J<H+re;J+=1)T=2*T+te[J]-48;return T},o=function(te,H,re){let T=0;for(let J=H;J<H+re;J+=1){let Ee=te[J];if(Ee>=48&&Ee<=57)Ee-=48;else if(Ee>=65&&Ee<=70)Ee-=55;else if(Ee>=97&&Ee<=102)Ee-=87;else throw new Error("hexnum out of range");T=16*T+Ee}return T};function a(V,te,H,re,T){let J=t.SEM_OK;if(V===t.SEM_PRE)T.ruleNames=new n,T.udtNames=new n,T.rules=[],T.udts=[],T.rulesLineMap=[],T.opcodes=[],T.altStack=[],T.topStack=null,T.topRule=null;else if(V===t.SEM_POST){let Ee;T.rules.forEach(Be=>{Be.isBkr=!1,Be.opcodes.forEach(ut=>{ut.type===t.RNM&&(Ee=T.ruleNames.get(ut.index.name),Ee===-1?(T.errors.push({line:T.findLine(T.lines,ut.index.phraseIndex,T.charsLength),char:ut.index.phraseIndex,msg:`Rule name '${ut.index.name}' used but not defined.`}),ut.index=-1):ut.index=Ee.index)})}),T.udts.forEach(Be=>{Be.isBkr=!1}),T.rules.forEach(Be=>{Be.opcodes.forEach(ut=>{ut.type===t.BKR&&(Be.hasBkr=!0,Ee=T.ruleNames.get(ut.index.name),Ee!==-1?(T.rules[Ee.index].isBkr=!0,ut.index=Ee.index):(Ee=T.udtNames.get(ut.index.name),Ee!==-1?(T.udts[Ee.index].isBkr=!0,ut.index=T.rules.length+Ee.index):(T.errors.push({line:T.findLine(T.lines,ut.index.phraseIndex,T.charsLength),char:ut.index.phraseIndex,msg:`Back reference name '${ut.index.name}' refers to undefined rule or unamed UDT.`}),ut.index=-1)))})})}return J}function c(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_PRE&&(T.altStack.length=0,T.topStack=null,T.rulesLineMap.push({line:T.findLine(T.lines,H,T.charsLength),char:H})),J}function u(V,te,H,re,T){let J=t.SEM_OK;if(V===t.SEM_PRE)T.ruleName="",T.definedas="";else if(V===t.SEM_POST){let Ee;T.definedas==="="?(Ee=T.ruleNames.add(T.ruleName),Ee===-1?(T.definedas=null,T.errors.push({line:T.findLine(T.lines,H,T.charsLength),char:H,msg:`Rule name '${T.ruleName}' previously defined.`})):(T.topRule={name:Ee.name,lower:Ee.lower,opcodes:[],index:Ee.index},T.rules.push(T.topRule),T.opcodes=T.topRule.opcodes)):(Ee=T.ruleNames.get(T.ruleName),Ee===-1?(T.definedas=null,T.errors.push({line:T.findLine(T.lines,H,T.charsLength),char:H,msg:`Rule name '${T.ruleName}' for incremental alternate not previously defined.`})):(T.topRule=T.rules[Ee.index],T.opcodes=T.topRule.opcodes))}return J}function l(V,te,H,re,T){let J=t.SEM_OK;if(V===t.SEM_PRE)for(;;){if(T.definedas===null){J=t.SEM_SKIP;break}if(T.topStack===null){if(T.definedas==="="){T.topStack={alt:{type:t.ALT,children:[]},cat:null},T.altStack.push(T.topStack),T.opcodes.push(T.topStack.alt);break}T.topStack={alt:T.opcodes[0],cat:null},T.altStack.push(T.topStack);break}T.topStack={alt:{type:t.ALT,children:[]},cat:null},T.altStack.push(T.topStack),T.opcodes.push(T.topStack.alt);break}else V===t.SEM_POST&&(T.altStack.pop(),T.altStack.length>0?T.topStack=T.altStack[T.altStack.length-1]:T.topStack=null);return J}function f(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_PRE?(T.topStack.alt.children.push(T.opcodes.length),T.topStack.cat={type:t.CAT,children:[]},T.opcodes.push(T.topStack.cat)):V===t.SEM_POST&&(T.topStack.cat=null),J}function d(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_PRE&&T.topStack.cat.children.push(T.opcodes.length),J}function h(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&T.opcodes.push({type:t.REP,min:0,max:1,char:H}),J}function b(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_PRE&&(T.ruleName=e.utils.charsToString(te,H,re)),J}function p(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&(T.definedas="="),J}function g(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&(T.definedas="=/"),J}function m(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_PRE?(T.min=0,T.max=1/0,T.topRep={type:t.REP,min:0,max:1/0},T.opcodes.push(T.topRep)):V===t.SEM_POST&&(T.min>T.max&&T.errors.push({line:T.findLine(T.lines,H,T.charsLength),char:H,msg:`repetition min cannot be greater than max: min: ${T.min}: max: ${T.max}`}),T.topRep.min=T.min,T.topRep.max=T.max),J}function y(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&(T.min=s(te,H,re)),J}function E(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&(T.max=s(te,H,re)),J}function v(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&(T.max=s(te,H,re),T.min=T.max),J}function k(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&T.opcodes.push({type:t.AND}),J}function w(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&T.opcodes.push({type:t.NOT}),J}function P(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&T.opcodes.push({type:t.RNM,index:{phraseIndex:H,name:e.utils.charsToString(te,H,re)}}),J}function B(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&T.opcodes.push({type:t.ABG}),J}function Z(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&T.opcodes.push({type:t.AEN}),J}function _(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&T.opcodes.push({type:t.BKA}),J}function O(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&T.opcodes.push({type:t.BKN}),J}function S(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_PRE?(T.ci=!0,T.cs=!1,T.um=!0,T.pm=!1):V===t.SEM_POST&&T.opcodes.push({type:t.BKR,bkrCase:T.cs===!0?t.BKR_MODE_CS:t.BKR_MODE_CI,bkrMode:T.pm===!0?t.BKR_MODE_PM:t.BKR_MODE_UM,index:{phraseIndex:T.bkrname.phraseIndex,name:e.utils.charsToString(te,T.bkrname.phraseIndex,T.bkrname.phraseLength)}}),J}function F(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&(T.ci=!0),J}function G(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&(T.cs=!0),J}function R(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&(T.um=!0),J}function L(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&(T.pm=!0),J}function Y(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&(T.bkrname={phraseIndex:H,phraseLength:re}),J}function oe(V,te,H,re,T){let J=t.SEM_OK;if(V===t.SEM_POST){let Ee=e.utils.charsToString(te,H,re),Be=T.udtNames.add(Ee);if(Be===-1){if(Be=T.udtNames.get(Ee),Be===-1)throw new Error("semUdtEmpty: name look up error")}else T.udts.push({name:Be.name,lower:Be.lower,index:Be.index,empty:!0});T.opcodes.push({type:t.UDT,empty:!0,index:Be.index})}return J}function fe(V,te,H,re,T){let J=t.SEM_OK;if(V===t.SEM_POST){let Ee=e.utils.charsToString(te,H,re),Be=T.udtNames.add(Ee);if(Be===-1){if(Be=T.udtNames.get(Ee),Be===-1)throw new Error("semUdtNonEmpty: name look up error")}else T.udts.push({name:Be.name,lower:Be.lower,index:Be.index,empty:!1});T.opcodes.push({type:t.UDT,empty:!1,index:Be.index,syntax:null,semantic:null})}return J}function K(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_PRE&&(T.tlscase=!0),J}function ae(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&re>0&&(te[H+1]===83||te[H+1]===115)&&(T.tlscase=!1),J}function q(V,te,H,re,T){let J=t.SEM_OK;if(V===t.SEM_POST)if(T.tlscase){let Ee=te.slice(H,H+re);for(let Be=0;Be<Ee.length;Be+=1)Ee[Be]>=65&&Ee[Be]<=90&&(Ee[Be]+=32);T.opcodes.push({type:t.TLS,string:Ee})}else T.opcodes.push({type:t.TBS,string:te.slice(H,H+re)});return J}function I(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&(re<=2?T.opcodes.push({type:t.TLS,string:[]}):T.opcodes.push({type:t.TBS,string:te.slice(H+1,H+re-1)})),J}function ye(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_PRE?T.tbsstr=[]:V===t.SEM_POST&&T.opcodes.push({type:t.TBS,string:T.tbsstr}),J}function st(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_PRE?(T.min=0,T.max=0):V===t.SEM_POST&&(T.min>T.max&&T.errors.push({line:T.findLine(T.lines,H,T.charsLength),char:H,msg:`TRG, (%dmin-max), min cannot be greater than max: min: ${T.min}: max: ${T.max}`}),T.opcodes.push({type:t.TRG,min:T.min,max:T.max})),J}function Ke(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&(T.min=s(te,H,re)),J}function Je(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&(T.max=s(te,H,re)),J}function D(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&(T.min=i(te,H,re)),J}function j(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&(T.max=i(te,H,re)),J}function N(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&(T.min=o(te,H,re)),J}function ee(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&(T.max=o(te,H,re)),J}function ce(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&T.tbsstr.push(s(te,H,re)),J}function he(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&T.tbsstr.push(i(te,H,re)),J}function xe(V,te,H,re,T){let J=t.SEM_OK;return V===t.SEM_POST&&T.tbsstr.push(o(te,H,re)),J}this.callbacks=[],this.callbacks.abgop=B,this.callbacks.aenop=Z,this.callbacks.alternation=l,this.callbacks.andop=k,this.callbacks.bmax=j,this.callbacks.bmin=D,this.callbacks.bkaop=_,this.callbacks.bknop=O,this.callbacks.bkrop=S,this.callbacks["bkr-name"]=Y,this.callbacks.bstring=he,this.callbacks.clsop=I,this.callbacks.ci=F,this.callbacks.cs=G,this.callbacks.um=R,this.callbacks.pm=L,this.callbacks.concatenation=f,this.callbacks.defined=p,this.callbacks.dmax=Je,this.callbacks.dmin=Ke,this.callbacks.dstring=ce,this.callbacks.file=a,this.callbacks.incalt=g,this.callbacks.notop=w,this.callbacks.optionopen=h,this.callbacks["rep-max"]=E,this.callbacks["rep-min"]=y,this.callbacks["rep-min-max"]=v,this.callbacks.repetition=d,this.callbacks.repop=m,this.callbacks.rnmop=P,this.callbacks.rule=c,this.callbacks.rulelookup=u,this.callbacks.rulename=b,this.callbacks.tbsop=ye,this.callbacks.tlscase=ae,this.callbacks.tlsstring=q,this.callbacks.tlsop=K,this.callbacks.trgop=st,this.callbacks["udt-empty"]=oe,this.callbacks["udt-non-empty"]=fe,this.callbacks.xmax=ee,this.callbacks.xmin=N,this.callbacks.xstring=xe}});var pE=M((nV,dE)=>{dE.exports=function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"File",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"BlankLine",lower:"blankline",index:1,isBkr:!1},this.rules[2]={name:"Rule",lower:"rule",index:2,isBkr:!1},this.rules[3]={name:"RuleLookup",lower:"rulelookup",index:3,isBkr:!1},this.rules[4]={name:"RuleNameTest",lower:"rulenametest",index:4,isBkr:!1},this.rules[5]={name:"RuleName",lower:"rulename",index:5,isBkr:!1},this.rules[6]={name:"RuleNameError",lower:"rulenameerror",index:6,isBkr:!1},this.rules[7]={name:"DefinedAsTest",lower:"definedastest",index:7,isBkr:!1},this.rules[8]={name:"DefinedAsError",lower:"definedaserror",index:8,isBkr:!1},this.rules[9]={name:"DefinedAs",lower:"definedas",index:9,isBkr:!1},this.rules[10]={name:"Defined",lower:"defined",index:10,isBkr:!1},this.rules[11]={name:"IncAlt",lower:"incalt",index:11,isBkr:!1},this.rules[12]={name:"RuleError",lower:"ruleerror",index:12,isBkr:!1},this.rules[13]={name:"LineEndError",lower:"lineenderror",index:13,isBkr:!1},this.rules[14]={name:"Alternation",lower:"alternation",index:14,isBkr:!1},this.rules[15]={name:"Concatenation",lower:"concatenation",index:15,isBkr:!1},this.rules[16]={name:"Repetition",lower:"repetition",index:16,isBkr:!1},this.rules[17]={name:"Modifier",lower:"modifier",index:17,isBkr:!1},this.rules[18]={name:"Predicate",lower:"predicate",index:18,isBkr:!1},this.rules[19]={name:"BasicElement",lower:"basicelement",index:19,isBkr:!1},this.rules[20]={name:"BasicElementErr",lower:"basicelementerr",index:20,isBkr:!1},this.rules[21]={name:"Group",lower:"group",index:21,isBkr:!1},this.rules[22]={name:"GroupError",lower:"grouperror",index:22,isBkr:!1},this.rules[23]={name:"GroupOpen",lower:"groupopen",index:23,isBkr:!1},this.rules[24]={name:"GroupClose",lower:"groupclose",index:24,isBkr:!1},this.rules[25]={name:"Option",lower:"option",index:25,isBkr:!1},this.rules[26]={name:"OptionError",lower:"optionerror",index:26,isBkr:!1},this.rules[27]={name:"OptionOpen",lower:"optionopen",index:27,isBkr:!1},this.rules[28]={name:"OptionClose",lower:"optionclose",index:28,isBkr:!1},this.rules[29]={name:"RnmOp",lower:"rnmop",index:29,isBkr:!1},this.rules[30]={name:"BkrOp",lower:"bkrop",index:30,isBkr:!1},this.rules[31]={name:"bkrModifier",lower:"bkrmodifier",index:31,isBkr:!1},this.rules[32]={name:"cs",lower:"cs",index:32,isBkr:!1},this.rules[33]={name:"ci",lower:"ci",index:33,isBkr:!1},this.rules[34]={name:"um",lower:"um",index:34,isBkr:!1},this.rules[35]={name:"pm",lower:"pm",index:35,isBkr:!1},this.rules[36]={name:"bkr-name",lower:"bkr-name",index:36,isBkr:!1},this.rules[37]={name:"rname",lower:"rname",index:37,isBkr:!1},this.rules[38]={name:"uname",lower:"uname",index:38,isBkr:!1},this.rules[39]={name:"ename",lower:"ename",index:39,isBkr:!1},this.rules[40]={name:"UdtOp",lower:"udtop",index:40,isBkr:!1},this.rules[41]={name:"udt-non-empty",lower:"udt-non-empty",index:41,isBkr:!1},this.rules[42]={name:"udt-empty",lower:"udt-empty",index:42,isBkr:!1},this.rules[43]={name:"RepOp",lower:"repop",index:43,isBkr:!1},this.rules[44]={name:"AltOp",lower:"altop",index:44,isBkr:!1},this.rules[45]={name:"CatOp",lower:"catop",index:45,isBkr:!1},this.rules[46]={name:"StarOp",lower:"starop",index:46,isBkr:!1},this.rules[47]={name:"AndOp",lower:"andop",index:47,isBkr:!1},this.rules[48]={name:"NotOp",lower:"notop",index:48,isBkr:!1},this.rules[49]={name:"BkaOp",lower:"bkaop",index:49,isBkr:!1},this.rules[50]={name:"BknOp",lower:"bknop",index:50,isBkr:!1},this.rules[51]={name:"AbgOp",lower:"abgop",index:51,isBkr:!1},this.rules[52]={name:"AenOp",lower:"aenop",index:52,isBkr:!1},this.rules[53]={name:"TrgOp",lower:"trgop",index:53,isBkr:!1},this.rules[54]={name:"TbsOp",lower:"tbsop",index:54,isBkr:!1},this.rules[55]={name:"TlsOp",lower:"tlsop",index:55,isBkr:!1},this.rules[56]={name:"TlsCase",lower:"tlscase",index:56,isBkr:!1},this.rules[57]={name:"TlsOpen",lower:"tlsopen",index:57,isBkr:!1},this.rules[58]={name:"TlsClose",lower:"tlsclose",index:58,isBkr:!1},this.rules[59]={name:"TlsString",lower:"tlsstring",index:59,isBkr:!1},this.rules[60]={name:"StringTab",lower:"stringtab",index:60,isBkr:!1},this.rules[61]={name:"ClsOp",lower:"clsop",index:61,isBkr:!1},this.rules[62]={name:"ClsOpen",lower:"clsopen",index:62,isBkr:!1},this.rules[63]={name:"ClsClose",lower:"clsclose",index:63,isBkr:!1},this.rules[64]={name:"ClsString",lower:"clsstring",index:64,isBkr:!1},this.rules[65]={name:"ProsVal",lower:"prosval",index:65,isBkr:!1},this.rules[66]={name:"ProsValOpen",lower:"prosvalopen",index:66,isBkr:!1},this.rules[67]={name:"ProsValString",lower:"prosvalstring",index:67,isBkr:!1},this.rules[68]={name:"ProsValClose",lower:"prosvalclose",index:68,isBkr:!1},this.rules[69]={name:"rep-min",lower:"rep-min",index:69,isBkr:!1},this.rules[70]={name:"rep-min-max",lower:"rep-min-max",index:70,isBkr:!1},this.rules[71]={name:"rep-max",lower:"rep-max",index:71,isBkr:!1},this.rules[72]={name:"rep-num",lower:"rep-num",index:72,isBkr:!1},this.rules[73]={name:"dString",lower:"dstring",index:73,isBkr:!1},this.rules[74]={name:"xString",lower:"xstring",index:74,isBkr:!1},this.rules[75]={name:"bString",lower:"bstring",index:75,isBkr:!1},this.rules[76]={name:"Dec",lower:"dec",index:76,isBkr:!1},this.rules[77]={name:"Hex",lower:"hex",index:77,isBkr:!1},this.rules[78]={name:"Bin",lower:"bin",index:78,isBkr:!1},this.rules[79]={name:"dmin",lower:"dmin",index:79,isBkr:!1},this.rules[80]={name:"dmax",lower:"dmax",index:80,isBkr:!1},this.rules[81]={name:"bmin",lower:"bmin",index:81,isBkr:!1},this.rules[82]={name:"bmax",lower:"bmax",index:82,isBkr:!1},this.rules[83]={name:"xmin",lower:"xmin",index:83,isBkr:!1},this.rules[84]={name:"xmax",lower:"xmax",index:84,isBkr:!1},this.rules[85]={name:"dnum",lower:"dnum",index:85,isBkr:!1},this.rules[86]={name:"bnum",lower:"bnum",index:86,isBkr:!1},this.rules[87]={name:"xnum",lower:"xnum",index:87,isBkr:!1},this.rules[88]={name:"alphanum",lower:"alphanum",index:88,isBkr:!1},this.rules[89]={name:"owsp",lower:"owsp",index:89,isBkr:!1},this.rules[90]={name:"wsp",lower:"wsp",index:90,isBkr:!1},this.rules[91]={name:"space",lower:"space",index:91,isBkr:!1},this.rules[92]={name:"comment",lower:"comment",index:92,isBkr:!1},this.rules[93]={name:"LineEnd",lower:"lineend",index:93,isBkr:!1},this.rules[94]={name:"LineContinue",lower:"linecontinue",index:94,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:3,min:0,max:1/0},this.rules[0].opcodes[1]={type:1,children:[2,3,4]},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:4,index:2},this.rules[0].opcodes[4]={type:4,index:12},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,5,7]},this.rules[1].opcodes[1]={type:3,min:0,max:1/0},this.rules[1].opcodes[2]={type:1,children:[3,4]},this.rules[1].opcodes[3]={type:6,string:[32]},this.rules[1].opcodes[4]={type:6,string:[9]},this.rules[1].opcodes[5]={type:3,min:0,max:1},this.rules[1].opcodes[6]={type:4,index:92},this.rules[1].opcodes[7]={type:4,index:93},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[2].opcodes[1]={type:4,index:3},this.rules[2].opcodes[2]={type:4,index:89},this.rules[2].opcodes[3]={type:4,index:14},this.rules[2].opcodes[4]={type:1,children:[5,8]},this.rules[2].opcodes[5]={type:2,children:[6,7]},this.rules[2].opcodes[6]={type:4,index:89},this.rules[2].opcodes[7]={type:4,index:93},this.rules[2].opcodes[8]={type:2,children:[9,10]},this.rules[2].opcodes[9]={type:4,index:13},this.rules[2].opcodes[10]={type:4,index:93},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:2,children:[1,2,3]},this.rules[3].opcodes[1]={type:4,index:4},this.rules[3].opcodes[2]={type:4,index:89},this.rules[3].opcodes[3]={type:4,index:7},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:4,index:5},this.rules[4].opcodes[2]={type:4,index:6},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:4,index:88},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:3,min:1,max:1/0},this.rules[6].opcodes[1]={type:1,children:[2,3]},this.rules[6].opcodes[2]={type:5,min:33,max:60},this.rules[6].opcodes[3]={type:5,min:62,max:126},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:1,children:[1,2]},this.rules[7].opcodes[1]={type:4,index:9},this.rules[7].opcodes[2]={type:4,index:8},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:3,min:1,max:2},this.rules[8].opcodes[1]={type:5,min:33,max:126},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:1,children:[1,2]},this.rules[9].opcodes[1]={type:4,index:11},this.rules[9].opcodes[2]={type:4,index:10},this.rules[10].opcodes=[],this.rules[10].opcodes[0]={type:6,string:[61]},this.rules[11].opcodes=[],this.rules[11].opcodes[0]={type:6,string:[61,47]},this.rules[12].opcodes=[],this.rules[12].opcodes[0]={type:2,children:[1,6]},this.rules[12].opcodes[1]={type:3,min:1,max:1/0},this.rules[12].opcodes[2]={type:1,children:[3,4,5]},this.rules[12].opcodes[3]={type:5,min:32,max:126},this.rules[12].opcodes[4]={type:6,string:[9]},this.rules[12].opcodes[5]={type:4,index:94},this.rules[12].opcodes[6]={type:4,index:93},this.rules[13].opcodes=[],this.rules[13].opcodes[0]={type:3,min:1,max:1/0},this.rules[13].opcodes[1]={type:1,children:[2,3,4]},this.rules[13].opcodes[2]={type:5,min:32,max:126},this.rules[13].opcodes[3]={type:6,string:[9]},this.rules[13].opcodes[4]={type:4,index:94},this.rules[14].opcodes=[],this.rules[14].opcodes[0]={type:2,children:[1,2]},this.rules[14].opcodes[1]={type:4,index:15},this.rules[14].opcodes[2]={type:3,min:0,max:1/0},this.rules[14].opcodes[3]={type:2,children:[4,5,6]},this.rules[14].opcodes[4]={type:4,index:89},this.rules[14].opcodes[5]={type:4,index:44},this.rules[14].opcodes[6]={type:4,index:15},this.rules[15].opcodes=[],this.rules[15].opcodes[0]={type:2,children:[1,2]},this.rules[15].opcodes[1]={type:4,index:16},this.rules[15].opcodes[2]={type:3,min:0,max:1/0},this.rules[15].opcodes[3]={type:2,children:[4,5]},this.rules[15].opcodes[4]={type:4,index:45},this.rules[15].opcodes[5]={type:4,index:16},this.rules[16].opcodes=[],this.rules[16].opcodes[0]={type:2,children:[1,3]},this.rules[16].opcodes[1]={type:3,min:0,max:1},this.rules[16].opcodes[2]={type:4,index:17},this.rules[16].opcodes[3]={type:1,children:[4,5,6,7]},this.rules[16].opcodes[4]={type:4,index:21},this.rules[16].opcodes[5]={type:4,index:25},this.rules[16].opcodes[6]={type:4,index:19},this.rules[16].opcodes[7]={type:4,index:20},this.rules[17].opcodes=[],this.rules[17].opcodes[0]={type:1,children:[1,5]},this.rules[17].opcodes[1]={type:2,children:[2,3]},this.rules[17].opcodes[2]={type:4,index:18},this.rules[17].opcodes[3]={type:3,min:0,max:1},this.rules[17].opcodes[4]={type:4,index:43},this.rules[17].opcodes[5]={type:4,index:43},this.rules[18].opcodes=[],this.rules[18].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[18].opcodes[1]={type:4,index:49},this.rules[18].opcodes[2]={type:4,index:50},this.rules[18].opcodes[3]={type:4,index:47},this.rules[18].opcodes[4]={type:4,index:48},this.rules[19].opcodes=[],this.rules[19].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8,9,10]},this.rules[19].opcodes[1]={type:4,index:40},this.rules[19].opcodes[2]={type:4,index:29},this.rules[19].opcodes[3]={type:4,index:53},this.rules[19].opcodes[4]={type:4,index:54},this.rules[19].opcodes[5]={type:4,index:55},this.rules[19].opcodes[6]={type:4,index:61},this.rules[19].opcodes[7]={type:4,index:30},this.rules[19].opcodes[8]={type:4,index:51},this.rules[19].opcodes[9]={type:4,index:52},this.rules[19].opcodes[10]={type:4,index:65},this.rules[20].opcodes=[],this.rules[20].opcodes[0]={type:3,min:1,max:1/0},this.rules[20].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[20].opcodes[2]={type:5,min:33,max:40},this.rules[20].opcodes[3]={type:5,min:42,max:46},this.rules[20].opcodes[4]={type:5,min:48,max:92},this.rules[20].opcodes[5]={type:5,min:94,max:126},this.rules[21].opcodes=[],this.rules[21].opcodes[0]={type:2,children:[1,2,3]},this.rules[21].opcodes[1]={type:4,index:23},this.rules[21].opcodes[2]={type:4,index:14},this.rules[21].opcodes[3]={type:1,children:[4,5]},this.rules[21].opcodes[4]={type:4,index:24},this.rules[21].opcodes[5]={type:4,index:22},this.rules[22].opcodes=[],this.rules[22].opcodes[0]={type:3,min:1,max:1/0},this.rules[22].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[22].opcodes[2]={type:5,min:33,max:40},this.rules[22].opcodes[3]={type:5,min:42,max:46},this.rules[22].opcodes[4]={type:5,min:48,max:92},this.rules[22].opcodes[5]={type:5,min:94,max:126},this.rules[23].opcodes=[],this.rules[23].opcodes[0]={type:2,children:[1,2]},this.rules[23].opcodes[1]={type:6,string:[40]},this.rules[23].opcodes[2]={type:4,index:89},this.rules[24].opcodes=[],this.rules[24].opcodes[0]={type:2,children:[1,2]},this.rules[24].opcodes[1]={type:4,index:89},this.rules[24].opcodes[2]={type:6,string:[41]},this.rules[25].opcodes=[],this.rules[25].opcodes[0]={type:2,children:[1,2,3]},this.rules[25].opcodes[1]={type:4,index:27},this.rules[25].opcodes[2]={type:4,index:14},this.rules[25].opcodes[3]={type:1,children:[4,5]},this.rules[25].opcodes[4]={type:4,index:28},this.rules[25].opcodes[5]={type:4,index:26},this.rules[26].opcodes=[],this.rules[26].opcodes[0]={type:3,min:1,max:1/0},this.rules[26].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[26].opcodes[2]={type:5,min:33,max:40},this.rules[26].opcodes[3]={type:5,min:42,max:46},this.rules[26].opcodes[4]={type:5,min:48,max:92},this.rules[26].opcodes[5]={type:5,min:94,max:126},this.rules[27].opcodes=[],this.rules[27].opcodes[0]={type:2,children:[1,2]},this.rules[27].opcodes[1]={type:6,string:[91]},this.rules[27].opcodes[2]={type:4,index:89},this.rules[28].opcodes=[],this.rules[28].opcodes[0]={type:2,children:[1,2]},this.rules[28].opcodes[1]={type:4,index:89},this.rules[28].opcodes[2]={type:6,string:[93]},this.rules[29].opcodes=[],this.rules[29].opcodes[0]={type:4,index:88},this.rules[30].opcodes=[],this.rules[30].opcodes[0]={type:2,children:[1,2,4]},this.rules[30].opcodes[1]={type:6,string:[92]},this.rules[30].opcodes[2]={type:3,min:0,max:1},this.rules[30].opcodes[3]={type:4,index:31},this.rules[30].opcodes[4]={type:4,index:36},this.rules[31].opcodes=[],this.rules[31].opcodes[0]={type:1,children:[1,7,13,19]},this.rules[31].opcodes[1]={type:2,children:[2,3]},this.rules[31].opcodes[2]={type:4,index:32},this.rules[31].opcodes[3]={type:3,min:0,max:1},this.rules[31].opcodes[4]={type:1,children:[5,6]},this.rules[31].opcodes[5]={type:4,index:34},this.rules[31].opcodes[6]={type:4,index:35},this.rules[31].opcodes[7]={type:2,children:[8,9]},this.rules[31].opcodes[8]={type:4,index:33},this.rules[31].opcodes[9]={type:3,min:0,max:1},this.rules[31].opcodes[10]={type:1,children:[11,12]},this.rules[31].opcodes[11]={type:4,index:34},this.rules[31].opcodes[12]={type:4,index:35},this.rules[31].opcodes[13]={type:2,children:[14,15]},this.rules[31].opcodes[14]={type:4,index:34},this.rules[31].opcodes[15]={type:3,min:0,max:1},this.rules[31].opcodes[16]={type:1,children:[17,18]},this.rules[31].opcodes[17]={type:4,index:32},this.rules[31].opcodes[18]={type:4,index:33},this.rules[31].opcodes[19]={type:2,children:[20,21]},this.rules[31].opcodes[20]={type:4,index:35},this.rules[31].opcodes[21]={type:3,min:0,max:1},this.rules[31].opcodes[22]={type:1,children:[23,24]},this.rules[31].opcodes[23]={type:4,index:32},this.rules[31].opcodes[24]={type:4,index:33},this.rules[32].opcodes=[],this.rules[32].opcodes[0]={type:6,string:[37,115]},this.rules[33].opcodes=[],this.rules[33].opcodes[0]={type:6,string:[37,105]},this.rules[34].opcodes=[],this.rules[34].opcodes[0]={type:6,string:[37,117]},this.rules[35].opcodes=[],this.rules[35].opcodes[0]={type:6,string:[37,112]},this.rules[36].opcodes=[],this.rules[36].opcodes[0]={type:1,children:[1,2,3]},this.rules[36].opcodes[1]={type:4,index:38},this.rules[36].opcodes[2]={type:4,index:39},this.rules[36].opcodes[3]={type:4,index:37},this.rules[37].opcodes=[],this.rules[37].opcodes[0]={type:4,index:88},this.rules[38].opcodes=[],this.rules[38].opcodes[0]={type:2,children:[1,2]},this.rules[38].opcodes[1]={type:6,string:[117,95]},this.rules[38].opcodes[2]={type:4,index:88},this.rules[39].opcodes=[],this.rules[39].opcodes[0]={type:2,children:[1,2]},this.rules[39].opcodes[1]={type:6,string:[101,95]},this.rules[39].opcodes[2]={type:4,index:88},this.rules[40].opcodes=[],this.rules[40].opcodes[0]={type:1,children:[1,2]},this.rules[40].opcodes[1]={type:4,index:42},this.rules[40].opcodes[2]={type:4,index:41},this.rules[41].opcodes=[],this.rules[41].opcodes[0]={type:2,children:[1,2]},this.rules[41].opcodes[1]={type:6,string:[117,95]},this.rules[41].opcodes[2]={type:4,index:88},this.rules[42].opcodes=[],this.rules[42].opcodes[0]={type:2,children:[1,2]},this.rules[42].opcodes[1]={type:6,string:[101,95]},this.rules[42].opcodes[2]={type:4,index:88},this.rules[43].opcodes=[],this.rules[43].opcodes[0]={type:1,children:[1,5,8,11,12]},this.rules[43].opcodes[1]={type:2,children:[2,3,4]},this.rules[43].opcodes[2]={type:4,index:69},this.rules[43].opcodes[3]={type:4,index:46},this.rules[43].opcodes[4]={type:4,index:71},this.rules[43].opcodes[5]={type:2,children:[6,7]},this.rules[43].opcodes[6]={type:4,index:69},this.rules[43].opcodes[7]={type:4,index:46},this.rules[43].opcodes[8]={type:2,children:[9,10]},this.rules[43].opcodes[9]={type:4,index:46},this.rules[43].opcodes[10]={type:4,index:71},this.rules[43].opcodes[11]={type:4,index:46},this.rules[43].opcodes[12]={type:4,index:70},this.rules[44].opcodes=[],this.rules[44].opcodes[0]={type:2,children:[1,2]},this.rules[44].opcodes[1]={type:6,string:[47]},this.rules[44].opcodes[2]={type:4,index:89},this.rules[45].opcodes=[],this.rules[45].opcodes[0]={type:4,index:90},this.rules[46].opcodes=[],this.rules[46].opcodes[0]={type:6,string:[42]},this.rules[47].opcodes=[],this.rules[47].opcodes[0]={type:6,string:[38]},this.rules[48].opcodes=[],this.rules[48].opcodes[0]={type:6,string:[33]},this.rules[49].opcodes=[],this.rules[49].opcodes[0]={type:6,string:[38,38]},this.rules[50].opcodes=[],this.rules[50].opcodes[0]={type:6,string:[33,33]},this.rules[51].opcodes=[],this.rules[51].opcodes[0]={type:6,string:[37,94]},this.rules[52].opcodes=[],this.rules[52].opcodes[0]={type:6,string:[37,36]},this.rules[53].opcodes=[],this.rules[53].opcodes[0]={type:2,children:[1,2]},this.rules[53].opcodes[1]={type:6,string:[37]},this.rules[53].opcodes[2]={type:1,children:[3,8,13]},this.rules[53].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[53].opcodes[4]={type:4,index:76},this.rules[53].opcodes[5]={type:4,index:79},this.rules[53].opcodes[6]={type:6,string:[45]},this.rules[53].opcodes[7]={type:4,index:80},this.rules[53].opcodes[8]={type:2,children:[9,10,11,12]},this.rules[53].opcodes[9]={type:4,index:77},this.rules[53].opcodes[10]={type:4,index:83},this.rules[53].opcodes[11]={type:6,string:[45]},this.rules[53].opcodes[12]={type:4,index:84},this.rules[53].opcodes[13]={type:2,children:[14,15,16,17]},this.rules[53].opcodes[14]={type:4,index:78},this.rules[53].opcodes[15]={type:4,index:81},this.rules[53].opcodes[16]={type:6,string:[45]},this.rules[53].opcodes[17]={type:4,index:82},this.rules[54].opcodes=[],this.rules[54].opcodes[0]={type:2,children:[1,2]},this.rules[54].opcodes[1]={type:6,string:[37]},this.rules[54].opcodes[2]={type:1,children:[3,10,17]},this.rules[54].opcodes[3]={type:2,children:[4,5,6]},this.rules[54].opcodes[4]={type:4,index:76},this.rules[54].opcodes[5]={type:4,index:73},this.rules[54].opcodes[6]={type:3,min:0,max:1/0},this.rules[54].opcodes[7]={type:2,children:[8,9]},this.rules[54].opcodes[8]={type:6,string:[46]},this.rules[54].opcodes[9]={type:4,index:73},this.rules[54].opcodes[10]={type:2,children:[11,12,13]},this.rules[54].opcodes[11]={type:4,index:77},this.rules[54].opcodes[12]={type:4,index:74},this.rules[54].opcodes[13]={type:3,min:0,max:1/0},this.rules[54].opcodes[14]={type:2,children:[15,16]},this.rules[54].opcodes[15]={type:6,string:[46]},this.rules[54].opcodes[16]={type:4,index:74},this.rules[54].opcodes[17]={type:2,children:[18,19,20]},this.rules[54].opcodes[18]={type:4,index:78},this.rules[54].opcodes[19]={type:4,index:75},this.rules[54].opcodes[20]={type:3,min:0,max:1/0},this.rules[54].opcodes[21]={type:2,children:[22,23]},this.rules[54].opcodes[22]={type:6,string:[46]},this.rules[54].opcodes[23]={type:4,index:75},this.rules[55].opcodes=[],this.rules[55].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[55].opcodes[1]={type:4,index:56},this.rules[55].opcodes[2]={type:4,index:57},this.rules[55].opcodes[3]={type:4,index:59},this.rules[55].opcodes[4]={type:4,index:58},this.rules[56].opcodes=[],this.rules[56].opcodes[0]={type:3,min:0,max:1},this.rules[56].opcodes[1]={type:1,children:[2,3]},this.rules[56].opcodes[2]={type:7,string:[37,105]},this.rules[56].opcodes[3]={type:7,string:[37,115]},this.rules[57].opcodes=[],this.rules[57].opcodes[0]={type:6,string:[34]},this.rules[58].opcodes=[],this.rules[58].opcodes[0]={type:6,string:[34]},this.rules[59].opcodes=[],this.rules[59].opcodes[0]={type:3,min:0,max:1/0},this.rules[59].opcodes[1]={type:1,children:[2,3,4]},this.rules[59].opcodes[2]={type:5,min:32,max:33},this.rules[59].opcodes[3]={type:5,min:35,max:126},this.rules[59].opcodes[4]={type:4,index:60},this.rules[60].opcodes=[],this.rules[60].opcodes[0]={type:6,string:[9]},this.rules[61].opcodes=[],this.rules[61].opcodes[0]={type:2,children:[1,2,3]},this.rules[61].opcodes[1]={type:4,index:62},this.rules[61].opcodes[2]={type:4,index:64},this.rules[61].opcodes[3]={type:4,index:63},this.rules[62].opcodes=[],this.rules[62].opcodes[0]={type:6,string:[39]},this.rules[63].opcodes=[],this.rules[63].opcodes[0]={type:6,string:[39]},this.rules[64].opcodes=[],this.rules[64].opcodes[0]={type:3,min:0,max:1/0},this.rules[64].opcodes[1]={type:1,children:[2,3,4]},this.rules[64].opcodes[2]={type:5,min:32,max:38},this.rules[64].opcodes[3]={type:5,min:40,max:126},this.rules[64].opcodes[4]={type:4,index:60},this.rules[65].opcodes=[],this.rules[65].opcodes[0]={type:2,children:[1,2,3]},this.rules[65].opcodes[1]={type:4,index:66},this.rules[65].opcodes[2]={type:4,index:67},this.rules[65].opcodes[3]={type:4,index:68},this.rules[66].opcodes=[],this.rules[66].opcodes[0]={type:6,string:[60]},this.rules[67].opcodes=[],this.rules[67].opcodes[0]={type:3,min:0,max:1/0},this.rules[67].opcodes[1]={type:1,children:[2,3,4]},this.rules[67].opcodes[2]={type:5,min:32,max:61},this.rules[67].opcodes[3]={type:5,min:63,max:126},this.rules[67].opcodes[4]={type:4,index:60},this.rules[68].opcodes=[],this.rules[68].opcodes[0]={type:6,string:[62]},this.rules[69].opcodes=[],this.rules[69].opcodes[0]={type:4,index:72},this.rules[70].opcodes=[],this.rules[70].opcodes[0]={type:4,index:72},this.rules[71].opcodes=[],this.rules[71].opcodes[0]={type:4,index:72},this.rules[72].opcodes=[],this.rules[72].opcodes[0]={type:3,min:1,max:1/0},this.rules[72].opcodes[1]={type:5,min:48,max:57},this.rules[73].opcodes=[],this.rules[73].opcodes[0]={type:4,index:85},this.rules[74].opcodes=[],this.rules[74].opcodes[0]={type:4,index:87},this.rules[75].opcodes=[],this.rules[75].opcodes[0]={type:4,index:86},this.rules[76].opcodes=[],this.rules[76].opcodes[0]={type:1,children:[1,2]},this.rules[76].opcodes[1]={type:6,string:[68]},this.rules[76].opcodes[2]={type:6,string:[100]},this.rules[77].opcodes=[],this.rules[77].opcodes[0]={type:1,children:[1,2]},this.rules[77].opcodes[1]={type:6,string:[88]},this.rules[77].opcodes[2]={type:6,string:[120]},this.rules[78].opcodes=[],this.rules[78].opcodes[0]={type:1,children:[1,2]},this.rules[78].opcodes[1]={type:6,string:[66]},this.rules[78].opcodes[2]={type:6,string:[98]},this.rules[79].opcodes=[],this.rules[79].opcodes[0]={type:4,index:85},this.rules[80].opcodes=[],this.rules[80].opcodes[0]={type:4,index:85},this.rules[81].opcodes=[],this.rules[81].opcodes[0]={type:4,index:86},this.rules[82].opcodes=[],this.rules[82].opcodes[0]={type:4,index:86},this.rules[83].opcodes=[],this.rules[83].opcodes[0]={type:4,index:87},this.rules[84].opcodes=[],this.rules[84].opcodes[0]={type:4,index:87},this.rules[85].opcodes=[],this.rules[85].opcodes[0]={type:3,min:1,max:1/0},this.rules[85].opcodes[1]={type:5,min:48,max:57},this.rules[86].opcodes=[],this.rules[86].opcodes[0]={type:3,min:1,max:1/0},this.rules[86].opcodes[1]={type:5,min:48,max:49},this.rules[87].opcodes=[],this.rules[87].opcodes[0]={type:3,min:1,max:1/0},this.rules[87].opcodes[1]={type:1,children:[2,3,4]},this.rules[87].opcodes[2]={type:5,min:48,max:57},this.rules[87].opcodes[3]={type:5,min:65,max:70},this.rules[87].opcodes[4]={type:5,min:97,max:102},this.rules[88].opcodes=[],this.rules[88].opcodes[0]={type:2,children:[1,4]},this.rules[88].opcodes[1]={type:1,children:[2,3]},this.rules[88].opcodes[2]={type:5,min:97,max:122},this.rules[88].opcodes[3]={type:5,min:65,max:90},this.rules[88].opcodes[4]={type:3,min:0,max:1/0},this.rules[88].opcodes[5]={type:1,children:[6,7,8,9]},this.rules[88].opcodes[6]={type:5,min:97,max:122},this.rules[88].opcodes[7]={type:5,min:65,max:90},this.rules[88].opcodes[8]={type:5,min:48,max:57},this.rules[88].opcodes[9]={type:6,string:[45]},this.rules[89].opcodes=[],this.rules[89].opcodes[0]={type:3,min:0,max:1/0},this.rules[89].opcodes[1]={type:4,index:91},this.rules[90].opcodes=[],this.rules[90].opcodes[0]={type:3,min:1,max:1/0},this.rules[90].opcodes[1]={type:4,index:91},this.rules[91].opcodes=[],this.rules[91].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[91].opcodes[1]={type:6,string:[32]},this.rules[91].opcodes[2]={type:6,string:[9]},this.rules[91].opcodes[3]={type:4,index:92},this.rules[91].opcodes[4]={type:4,index:94},this.rules[92].opcodes=[],this.rules[92].opcodes[0]={type:2,children:[1,2]},this.rules[92].opcodes[1]={type:6,string:[59]},this.rules[92].opcodes[2]={type:3,min:0,max:1/0},this.rules[92].opcodes[3]={type:1,children:[4,5]},this.rules[92].opcodes[4]={type:5,min:32,max:126},this.rules[92].opcodes[5]={type:6,string:[9]},this.rules[93].opcodes=[],this.rules[93].opcodes[0]={type:1,children:[1,2,3]},this.rules[93].opcodes[1]={type:6,string:[13,10]},this.rules[93].opcodes[2]={type:6,string:[10]},this.rules[93].opcodes[3]={type:6,string:[13]},this.rules[94].opcodes=[],this.rules[94].opcodes[0]={type:2,children:[1,5]},this.rules[94].opcodes[1]={type:1,children:[2,3,4]},this.rules[94].opcodes[2]={type:6,string:[13,10]},this.rules[94].opcodes[3]={type:6,string:[10]},this.rules[94].opcodes[4]={type:6,string:[13]},this.rules[94].opcodes[5]={type:1,children:[6,7]},this.rules[94].opcodes[6]={type:6,string:[32]},this.rules[94].opcodes[7]={type:6,string:[9]},this.toString=function(){let t="";return t+=`;
|
|
332
|
+
`,t}}});var oE=M(iE=>{var hr=Yn(),x7=wa();function y7(r,e,t,n,s){return r===hr.SEM_PRE?(s.endLength=0,s.textLength=0,s.invalidCount=0):s.lines.push({lineNo:s.lines.length,beginChar:t,length:n,textLength:s.textLength,endType:s.endType,invalidChars:s.invalidCount}),hr.SEM_OK}function w7(r,e,t,n,s){return r===hr.SEM_PRE&&(s.textLength=n),hr.SEM_OK}function A7(r,e,t,n,s){return r===hr.SEM_PRE?(s.endLength=0,s.textLength=0,s.invalidCount=0):s.strict?(s.lines.push({lineNo:s.lines.length,beginChar:t,length:n,textLength:n,endType:"none",invalidChars:s.invalidCount}),s.errors.push({line:s.lineNo,char:t+n,msg:"no line end on last line - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})):(e.push(10),s.lines.push({lineNo:s.lines.length,beginChar:t,length:n+1,textLength:n,endType:"LF",invalidChars:s.invalidCount})),hr.SEM_OK}function E7(r,e,t,n,s){return r===hr.SEM_PRE&&s.errors.push({line:s.lineNo,char:t,msg:`invalid character found '\\x${x7.charToHex(e[t])}'`}),hr.SEM_OK}function v7(r,e,t,n,s){return r===hr.SEM_POST&&(s.lineNo+=1),hr.SEM_OK}function T7(r,e,t,n,s){return r===hr.SEM_PRE&&(s.endType="LF",s.strict&&s.errors.push({line:s.lineNo,char:t,msg:"line end character LF(\\n, \\x0A) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),hr.SEM_OK}function P7(r,e,t,n,s){return r===hr.SEM_PRE&&(s.endType="CR",s.strict&&s.errors.push({line:s.lineNo,char:t,msg:"line end character CR(\\r, \\x0D) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),hr.SEM_OK}function k7(r,e,t,n,s){return r===hr.SEM_PRE&&(s.endType="CRLF"),hr.SEM_OK}var li=[];li.line=y7;li["line-text"]=w7;li["last-line"]=A7;li.invalid=E7;li.end=v7;li.lf=T7;li.cr=P7;li.crlf=k7;iE.callbacks=li});var cE=M((eV,aE)=>{aE.exports=function(e,t,n,s){let i="scanner.js: ",o=Aa(),a=new(sE()),{callbacks:c}=oE(),u=[],l=new o.parser;if(l.ast=new o.ast,l.ast.callbacks=c,s){if(s.traceObject!=="traceObject")throw new TypeError(`${i}trace argument is not a trace object`);l.trace=s}if(l.parse(a,"file",e).success!==!0){t.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});return}let d={lines:u,lineNo:0,errors:t,strict:!!n};return l.ast.translate(d),u}});var lE=M((tV,uE)=>{uE.exports=function(){let e="syntax-callbacks.js: ",t=Aa(),n=t.ids,s,i=function(ae,q,I,ye){switch(ae.state){case n.ACTIVE:ye.altStack=[],ye.repCount=0;break;case n.EMPTY:ye.errors.push({line:0,char:0,msg:"grammar file is empty"});break;case n.MATCH:ye.ruleCount===0&&ye.errors.push({line:0,char:0,msg:"no rules defined"});break;case n.NOMATCH:throw new Error(`${e}synFile: grammar file NOMATCH: design error: should never happen.`);default:throw new Error(`${e}synFile: unrecognized case.`)}},o=function(K,ae,q,I){switch(K.state){case n.ACTIVE:I.altStack.length=0,s={groupOpen:null,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},I.altStack.push(s);break;case n.EMPTY:throw new Error(`${e}synRule: EMPTY: rule cannot be empty`);case n.NOMATCH:break;case n.MATCH:I.ruleCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},a=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Unrecognized SABNF line. Invalid rule, comment or blank line."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},c=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Rule names must be alphanum and begin with alphabetic character."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},u=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Expected '=' or '=/'. Not found."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},l=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.strict&&I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"AND operator(&) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},f=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.strict&&I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"NOT operator(!) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},d=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.strict?I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Positive look-behind operator(&&) found - strict ABNF specified."}):I.lite&&I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Positive look-behind operator(&&) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},h=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.strict?I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Negative look-behind operator(!!) found - strict ABNF specified."}):I.lite&&I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Negative look-behind operator(!!) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},b=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.strict?I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Beginning of string anchor(%^) found - strict ABNF specified."}):I.lite&&I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Beginning of string anchor(%^) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},p=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.strict?I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"End of string anchor(%$) found - strict ABNF specified."}):I.lite&&I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"End of string anchor(%$) found - apg-lite specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},g=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(I.strict){let ye=t.utils.charsToString(ae,q,K.phraseLength);I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:`Back reference operator(${ye}) found - strict ABNF specified.`})}else if(I.lite){let ye=t.utils.charsToString(ae,q,K.phraseLength);I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:`Back reference operator(${ye}) found - apg-lite specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},m=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(I.strict){let ye=t.utils.charsToString(ae,q,K.phraseLength);I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:`UDT operator found(${ye}) - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},y=function(K,ae,q){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:s.tlsOpen=q;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},E=function(K,ae,q,I){switch(K.state){case n.ACTIVE:I.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.stringTabChar!==!1&&I.errors.push({line:I.findLine(I.lines,I.stringTabChar),char:I.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string (see 'quoted-string' definition, RFC 7405.)"});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},v=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.stringTabChar=q;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},k=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:I.errors.push({line:I.findLine(I.lines,s.tlsOpen),char:s.tlsOpen,msg:'Case-insensitive literal string("...") opened but not closed.'}),s.basicError=!0,s.tlsOpen=null;break;case n.MATCH:s.tlsOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},w=function(K,ae,q){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:s.clsOpen=q;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},P=function(K,ae,q,I){switch(K.state){case n.ACTIVE:I.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.stringTabChar!==!1&&I.errors.push({line:I.findLine(I.lines,I.stringTabChar),char:I.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},B=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:I.errors.push({line:I.findLine(I.lines,s.clsOpen),char:s.clsOpen,msg:"Case-sensitive literal string('...') opened but not closed."}),s.clsOpen=null,s.basicError=!0;break;case n.MATCH:I.strict&&I.errors.push({line:I.findLine(I.lines,s.clsOpen),char:s.clsOpen,msg:"Case-sensitive string operator('...') found - strict ABNF specified."}),s.clsOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},Z=function(K,ae,q){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:s.prosValOpen=q;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},_=function(K,ae,q,I){switch(K.state){case n.ACTIVE:I.stringTabChar=!1;break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.stringTabChar!==!1&&I.errors.push({line:I.findLine(I.lines,I.stringTabChar),char:I.stringTabChar,msg:"Tab character (\\t, x09) not allowed in prose value string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},O=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:I.errors.push({line:I.findLine(I.lines,s.prosValOpen),char:s.prosValOpen,msg:"Prose value operator(<...>) opened but not closed."}),s.basicError=!0,s.prosValOpen=null;break;case n.MATCH:I.errors.push({line:I.findLine(I.lines,s.prosValOpen),char:s.prosValOpen,msg:"Prose value operator(<...>) found. The ABNF syntax is valid, but a parser cannot be generated from this grammar."}),s.prosValOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}},S=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:s={groupOpen:q,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},I.altStack.push(s);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},F=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:I.errors.push({line:I.findLine(I.lines,s.groupOpen),char:s.groupOpen,msg:'Group "(...)" opened but not closed.'}),s=I.altStack.pop(),s.groupError=!0;break;case n.MATCH:s=I.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},G=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:s={groupOpen:null,groupError:!1,optionOpen:q,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},I.altStack.push(s);break;default:throw new Error(`${e}synFile: unrecognized case.`)}},R=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:I.errors.push({line:I.findLine(I.lines,s.optionOpen),char:s.optionOpen,msg:'Option "[...]" opened but not closed.'}),s=I.altStack.pop(),s.optionError=!0;break;case n.MATCH:s=I.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}},L=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:s.basicError===!1&&I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Unrecognized SABNF element."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},Y=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:if(K.phraseLength===1&&I.strict){let ye=ae[q]===13?"CR":"LF";I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:`Line end '${ye}' found - strict ABNF specified, only CRLF allowed.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}},oe=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:break;case n.MATCH:I.errors.push({line:I.findLine(I.lines,q,I.charsLength),char:q,msg:"Unrecognized grammar element or characters."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}},fe=function(K,ae,q,I){switch(K.state){case n.ACTIVE:break;case n.EMPTY:break;case n.NOMATCH:I.repCount+=1;break;case n.MATCH:I.repCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}};this.callbacks=[],this.callbacks.andop=l,this.callbacks.basicelementerr=L,this.callbacks.clsclose=B,this.callbacks.clsopen=w,this.callbacks.clsstring=P,this.callbacks.definedaserror=u,this.callbacks.file=i,this.callbacks.groupclose=F,this.callbacks.groupopen=S,this.callbacks.lineenderror=oe,this.callbacks.lineend=Y,this.callbacks.notop=f,this.callbacks.optionclose=R,this.callbacks.optionopen=G,this.callbacks.prosvalclose=O,this.callbacks.prosvalopen=Z,this.callbacks.prosvalstring=_,this.callbacks.repetition=fe,this.callbacks.rule=o,this.callbacks.ruleerror=a,this.callbacks.rulenameerror=c,this.callbacks.stringtab=v,this.callbacks.tlsclose=k,this.callbacks.tlsopen=y,this.callbacks.tlsstring=E,this.callbacks.udtop=m,this.callbacks.bkaop=d,this.callbacks.bknop=h,this.callbacks.bkrop=g,this.callbacks.abgop=b,this.callbacks.aenop=p}});var dE=M((rV,fE)=>{fE.exports=function(){let e=Aa(),t=e.ids,n=function(){this.names=[],this.add=function(H){let re=-1;return this.get(H)===-1&&(re={name:H,lower:H.toLowerCase(),index:this.names.length},this.names.push(re)),re},this.get=function(H){let re=-1,T=H.toLowerCase();for(let W=0;W<this.names.length;W+=1)if(this.names[W].lower===T){re=this.names[W];break}return re}},s=function(te,H,re){let T=0;for(let W=H;W<H+re;W+=1)T=10*T+te[W]-48;return T},i=function(te,H,re){let T=0;for(let W=H;W<H+re;W+=1)T=2*T+te[W]-48;return T},o=function(te,H,re){let T=0;for(let W=H;W<H+re;W+=1){let Ee=te[W];if(Ee>=48&&Ee<=57)Ee-=48;else if(Ee>=65&&Ee<=70)Ee-=55;else if(Ee>=97&&Ee<=102)Ee-=87;else throw new Error("hexnum out of range");T=16*T+Ee}return T};function a(V,te,H,re,T){let W=t.SEM_OK;if(V===t.SEM_PRE)T.ruleNames=new n,T.udtNames=new n,T.rules=[],T.udts=[],T.rulesLineMap=[],T.opcodes=[],T.altStack=[],T.topStack=null,T.topRule=null;else if(V===t.SEM_POST){let Ee;T.rules.forEach(Be=>{Be.isBkr=!1,Be.opcodes.forEach(ut=>{ut.type===t.RNM&&(Ee=T.ruleNames.get(ut.index.name),Ee===-1?(T.errors.push({line:T.findLine(T.lines,ut.index.phraseIndex,T.charsLength),char:ut.index.phraseIndex,msg:`Rule name '${ut.index.name}' used but not defined.`}),ut.index=-1):ut.index=Ee.index)})}),T.udts.forEach(Be=>{Be.isBkr=!1}),T.rules.forEach(Be=>{Be.opcodes.forEach(ut=>{ut.type===t.BKR&&(Be.hasBkr=!0,Ee=T.ruleNames.get(ut.index.name),Ee!==-1?(T.rules[Ee.index].isBkr=!0,ut.index=Ee.index):(Ee=T.udtNames.get(ut.index.name),Ee!==-1?(T.udts[Ee.index].isBkr=!0,ut.index=T.rules.length+Ee.index):(T.errors.push({line:T.findLine(T.lines,ut.index.phraseIndex,T.charsLength),char:ut.index.phraseIndex,msg:`Back reference name '${ut.index.name}' refers to undefined rule or unamed UDT.`}),ut.index=-1)))})})}return W}function c(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_PRE&&(T.altStack.length=0,T.topStack=null,T.rulesLineMap.push({line:T.findLine(T.lines,H,T.charsLength),char:H})),W}function u(V,te,H,re,T){let W=t.SEM_OK;if(V===t.SEM_PRE)T.ruleName="",T.definedas="";else if(V===t.SEM_POST){let Ee;T.definedas==="="?(Ee=T.ruleNames.add(T.ruleName),Ee===-1?(T.definedas=null,T.errors.push({line:T.findLine(T.lines,H,T.charsLength),char:H,msg:`Rule name '${T.ruleName}' previously defined.`})):(T.topRule={name:Ee.name,lower:Ee.lower,opcodes:[],index:Ee.index},T.rules.push(T.topRule),T.opcodes=T.topRule.opcodes)):(Ee=T.ruleNames.get(T.ruleName),Ee===-1?(T.definedas=null,T.errors.push({line:T.findLine(T.lines,H,T.charsLength),char:H,msg:`Rule name '${T.ruleName}' for incremental alternate not previously defined.`})):(T.topRule=T.rules[Ee.index],T.opcodes=T.topRule.opcodes))}return W}function l(V,te,H,re,T){let W=t.SEM_OK;if(V===t.SEM_PRE)for(;;){if(T.definedas===null){W=t.SEM_SKIP;break}if(T.topStack===null){if(T.definedas==="="){T.topStack={alt:{type:t.ALT,children:[]},cat:null},T.altStack.push(T.topStack),T.opcodes.push(T.topStack.alt);break}T.topStack={alt:T.opcodes[0],cat:null},T.altStack.push(T.topStack);break}T.topStack={alt:{type:t.ALT,children:[]},cat:null},T.altStack.push(T.topStack),T.opcodes.push(T.topStack.alt);break}else V===t.SEM_POST&&(T.altStack.pop(),T.altStack.length>0?T.topStack=T.altStack[T.altStack.length-1]:T.topStack=null);return W}function f(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_PRE?(T.topStack.alt.children.push(T.opcodes.length),T.topStack.cat={type:t.CAT,children:[]},T.opcodes.push(T.topStack.cat)):V===t.SEM_POST&&(T.topStack.cat=null),W}function d(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_PRE&&T.topStack.cat.children.push(T.opcodes.length),W}function h(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&T.opcodes.push({type:t.REP,min:0,max:1,char:H}),W}function b(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_PRE&&(T.ruleName=e.utils.charsToString(te,H,re)),W}function p(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&(T.definedas="="),W}function g(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&(T.definedas="=/"),W}function m(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_PRE?(T.min=0,T.max=1/0,T.topRep={type:t.REP,min:0,max:1/0},T.opcodes.push(T.topRep)):V===t.SEM_POST&&(T.min>T.max&&T.errors.push({line:T.findLine(T.lines,H,T.charsLength),char:H,msg:`repetition min cannot be greater than max: min: ${T.min}: max: ${T.max}`}),T.topRep.min=T.min,T.topRep.max=T.max),W}function y(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&(T.min=s(te,H,re)),W}function E(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&(T.max=s(te,H,re)),W}function v(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&(T.max=s(te,H,re),T.min=T.max),W}function k(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&T.opcodes.push({type:t.AND}),W}function w(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&T.opcodes.push({type:t.NOT}),W}function P(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&T.opcodes.push({type:t.RNM,index:{phraseIndex:H,name:e.utils.charsToString(te,H,re)}}),W}function B(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&T.opcodes.push({type:t.ABG}),W}function Z(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&T.opcodes.push({type:t.AEN}),W}function _(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&T.opcodes.push({type:t.BKA}),W}function O(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&T.opcodes.push({type:t.BKN}),W}function S(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_PRE?(T.ci=!0,T.cs=!1,T.um=!0,T.pm=!1):V===t.SEM_POST&&T.opcodes.push({type:t.BKR,bkrCase:T.cs===!0?t.BKR_MODE_CS:t.BKR_MODE_CI,bkrMode:T.pm===!0?t.BKR_MODE_PM:t.BKR_MODE_UM,index:{phraseIndex:T.bkrname.phraseIndex,name:e.utils.charsToString(te,T.bkrname.phraseIndex,T.bkrname.phraseLength)}}),W}function F(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&(T.ci=!0),W}function G(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&(T.cs=!0),W}function R(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&(T.um=!0),W}function L(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&(T.pm=!0),W}function Y(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&(T.bkrname={phraseIndex:H,phraseLength:re}),W}function oe(V,te,H,re,T){let W=t.SEM_OK;if(V===t.SEM_POST){let Ee=e.utils.charsToString(te,H,re),Be=T.udtNames.add(Ee);if(Be===-1){if(Be=T.udtNames.get(Ee),Be===-1)throw new Error("semUdtEmpty: name look up error")}else T.udts.push({name:Be.name,lower:Be.lower,index:Be.index,empty:!0});T.opcodes.push({type:t.UDT,empty:!0,index:Be.index})}return W}function fe(V,te,H,re,T){let W=t.SEM_OK;if(V===t.SEM_POST){let Ee=e.utils.charsToString(te,H,re),Be=T.udtNames.add(Ee);if(Be===-1){if(Be=T.udtNames.get(Ee),Be===-1)throw new Error("semUdtNonEmpty: name look up error")}else T.udts.push({name:Be.name,lower:Be.lower,index:Be.index,empty:!1});T.opcodes.push({type:t.UDT,empty:!1,index:Be.index,syntax:null,semantic:null})}return W}function K(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_PRE&&(T.tlscase=!0),W}function ae(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&re>0&&(te[H+1]===83||te[H+1]===115)&&(T.tlscase=!1),W}function q(V,te,H,re,T){let W=t.SEM_OK;if(V===t.SEM_POST)if(T.tlscase){let Ee=te.slice(H,H+re);for(let Be=0;Be<Ee.length;Be+=1)Ee[Be]>=65&&Ee[Be]<=90&&(Ee[Be]+=32);T.opcodes.push({type:t.TLS,string:Ee})}else T.opcodes.push({type:t.TBS,string:te.slice(H,H+re)});return W}function I(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&(re<=2?T.opcodes.push({type:t.TLS,string:[]}):T.opcodes.push({type:t.TBS,string:te.slice(H+1,H+re-1)})),W}function ye(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_PRE?T.tbsstr=[]:V===t.SEM_POST&&T.opcodes.push({type:t.TBS,string:T.tbsstr}),W}function st(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_PRE?(T.min=0,T.max=0):V===t.SEM_POST&&(T.min>T.max&&T.errors.push({line:T.findLine(T.lines,H,T.charsLength),char:H,msg:`TRG, (%dmin-max), min cannot be greater than max: min: ${T.min}: max: ${T.max}`}),T.opcodes.push({type:t.TRG,min:T.min,max:T.max})),W}function Ke(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&(T.min=s(te,H,re)),W}function We(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&(T.max=s(te,H,re)),W}function D(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&(T.min=i(te,H,re)),W}function j(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&(T.max=i(te,H,re)),W}function N(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&(T.min=o(te,H,re)),W}function ee(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&(T.max=o(te,H,re)),W}function ce(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&T.tbsstr.push(s(te,H,re)),W}function he(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&T.tbsstr.push(i(te,H,re)),W}function xe(V,te,H,re,T){let W=t.SEM_OK;return V===t.SEM_POST&&T.tbsstr.push(o(te,H,re)),W}this.callbacks=[],this.callbacks.abgop=B,this.callbacks.aenop=Z,this.callbacks.alternation=l,this.callbacks.andop=k,this.callbacks.bmax=j,this.callbacks.bmin=D,this.callbacks.bkaop=_,this.callbacks.bknop=O,this.callbacks.bkrop=S,this.callbacks["bkr-name"]=Y,this.callbacks.bstring=he,this.callbacks.clsop=I,this.callbacks.ci=F,this.callbacks.cs=G,this.callbacks.um=R,this.callbacks.pm=L,this.callbacks.concatenation=f,this.callbacks.defined=p,this.callbacks.dmax=We,this.callbacks.dmin=Ke,this.callbacks.dstring=ce,this.callbacks.file=a,this.callbacks.incalt=g,this.callbacks.notop=w,this.callbacks.optionopen=h,this.callbacks["rep-max"]=E,this.callbacks["rep-min"]=y,this.callbacks["rep-min-max"]=v,this.callbacks.repetition=d,this.callbacks.repop=m,this.callbacks.rnmop=P,this.callbacks.rule=c,this.callbacks.rulelookup=u,this.callbacks.rulename=b,this.callbacks.tbsop=ye,this.callbacks.tlscase=ae,this.callbacks.tlsstring=q,this.callbacks.tlsop=K,this.callbacks.trgop=st,this.callbacks["udt-empty"]=oe,this.callbacks["udt-non-empty"]=fe,this.callbacks.xmax=ee,this.callbacks.xmin=N,this.callbacks.xstring=xe}});var hE=M((nV,pE)=>{pE.exports=function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"File",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"BlankLine",lower:"blankline",index:1,isBkr:!1},this.rules[2]={name:"Rule",lower:"rule",index:2,isBkr:!1},this.rules[3]={name:"RuleLookup",lower:"rulelookup",index:3,isBkr:!1},this.rules[4]={name:"RuleNameTest",lower:"rulenametest",index:4,isBkr:!1},this.rules[5]={name:"RuleName",lower:"rulename",index:5,isBkr:!1},this.rules[6]={name:"RuleNameError",lower:"rulenameerror",index:6,isBkr:!1},this.rules[7]={name:"DefinedAsTest",lower:"definedastest",index:7,isBkr:!1},this.rules[8]={name:"DefinedAsError",lower:"definedaserror",index:8,isBkr:!1},this.rules[9]={name:"DefinedAs",lower:"definedas",index:9,isBkr:!1},this.rules[10]={name:"Defined",lower:"defined",index:10,isBkr:!1},this.rules[11]={name:"IncAlt",lower:"incalt",index:11,isBkr:!1},this.rules[12]={name:"RuleError",lower:"ruleerror",index:12,isBkr:!1},this.rules[13]={name:"LineEndError",lower:"lineenderror",index:13,isBkr:!1},this.rules[14]={name:"Alternation",lower:"alternation",index:14,isBkr:!1},this.rules[15]={name:"Concatenation",lower:"concatenation",index:15,isBkr:!1},this.rules[16]={name:"Repetition",lower:"repetition",index:16,isBkr:!1},this.rules[17]={name:"Modifier",lower:"modifier",index:17,isBkr:!1},this.rules[18]={name:"Predicate",lower:"predicate",index:18,isBkr:!1},this.rules[19]={name:"BasicElement",lower:"basicelement",index:19,isBkr:!1},this.rules[20]={name:"BasicElementErr",lower:"basicelementerr",index:20,isBkr:!1},this.rules[21]={name:"Group",lower:"group",index:21,isBkr:!1},this.rules[22]={name:"GroupError",lower:"grouperror",index:22,isBkr:!1},this.rules[23]={name:"GroupOpen",lower:"groupopen",index:23,isBkr:!1},this.rules[24]={name:"GroupClose",lower:"groupclose",index:24,isBkr:!1},this.rules[25]={name:"Option",lower:"option",index:25,isBkr:!1},this.rules[26]={name:"OptionError",lower:"optionerror",index:26,isBkr:!1},this.rules[27]={name:"OptionOpen",lower:"optionopen",index:27,isBkr:!1},this.rules[28]={name:"OptionClose",lower:"optionclose",index:28,isBkr:!1},this.rules[29]={name:"RnmOp",lower:"rnmop",index:29,isBkr:!1},this.rules[30]={name:"BkrOp",lower:"bkrop",index:30,isBkr:!1},this.rules[31]={name:"bkrModifier",lower:"bkrmodifier",index:31,isBkr:!1},this.rules[32]={name:"cs",lower:"cs",index:32,isBkr:!1},this.rules[33]={name:"ci",lower:"ci",index:33,isBkr:!1},this.rules[34]={name:"um",lower:"um",index:34,isBkr:!1},this.rules[35]={name:"pm",lower:"pm",index:35,isBkr:!1},this.rules[36]={name:"bkr-name",lower:"bkr-name",index:36,isBkr:!1},this.rules[37]={name:"rname",lower:"rname",index:37,isBkr:!1},this.rules[38]={name:"uname",lower:"uname",index:38,isBkr:!1},this.rules[39]={name:"ename",lower:"ename",index:39,isBkr:!1},this.rules[40]={name:"UdtOp",lower:"udtop",index:40,isBkr:!1},this.rules[41]={name:"udt-non-empty",lower:"udt-non-empty",index:41,isBkr:!1},this.rules[42]={name:"udt-empty",lower:"udt-empty",index:42,isBkr:!1},this.rules[43]={name:"RepOp",lower:"repop",index:43,isBkr:!1},this.rules[44]={name:"AltOp",lower:"altop",index:44,isBkr:!1},this.rules[45]={name:"CatOp",lower:"catop",index:45,isBkr:!1},this.rules[46]={name:"StarOp",lower:"starop",index:46,isBkr:!1},this.rules[47]={name:"AndOp",lower:"andop",index:47,isBkr:!1},this.rules[48]={name:"NotOp",lower:"notop",index:48,isBkr:!1},this.rules[49]={name:"BkaOp",lower:"bkaop",index:49,isBkr:!1},this.rules[50]={name:"BknOp",lower:"bknop",index:50,isBkr:!1},this.rules[51]={name:"AbgOp",lower:"abgop",index:51,isBkr:!1},this.rules[52]={name:"AenOp",lower:"aenop",index:52,isBkr:!1},this.rules[53]={name:"TrgOp",lower:"trgop",index:53,isBkr:!1},this.rules[54]={name:"TbsOp",lower:"tbsop",index:54,isBkr:!1},this.rules[55]={name:"TlsOp",lower:"tlsop",index:55,isBkr:!1},this.rules[56]={name:"TlsCase",lower:"tlscase",index:56,isBkr:!1},this.rules[57]={name:"TlsOpen",lower:"tlsopen",index:57,isBkr:!1},this.rules[58]={name:"TlsClose",lower:"tlsclose",index:58,isBkr:!1},this.rules[59]={name:"TlsString",lower:"tlsstring",index:59,isBkr:!1},this.rules[60]={name:"StringTab",lower:"stringtab",index:60,isBkr:!1},this.rules[61]={name:"ClsOp",lower:"clsop",index:61,isBkr:!1},this.rules[62]={name:"ClsOpen",lower:"clsopen",index:62,isBkr:!1},this.rules[63]={name:"ClsClose",lower:"clsclose",index:63,isBkr:!1},this.rules[64]={name:"ClsString",lower:"clsstring",index:64,isBkr:!1},this.rules[65]={name:"ProsVal",lower:"prosval",index:65,isBkr:!1},this.rules[66]={name:"ProsValOpen",lower:"prosvalopen",index:66,isBkr:!1},this.rules[67]={name:"ProsValString",lower:"prosvalstring",index:67,isBkr:!1},this.rules[68]={name:"ProsValClose",lower:"prosvalclose",index:68,isBkr:!1},this.rules[69]={name:"rep-min",lower:"rep-min",index:69,isBkr:!1},this.rules[70]={name:"rep-min-max",lower:"rep-min-max",index:70,isBkr:!1},this.rules[71]={name:"rep-max",lower:"rep-max",index:71,isBkr:!1},this.rules[72]={name:"rep-num",lower:"rep-num",index:72,isBkr:!1},this.rules[73]={name:"dString",lower:"dstring",index:73,isBkr:!1},this.rules[74]={name:"xString",lower:"xstring",index:74,isBkr:!1},this.rules[75]={name:"bString",lower:"bstring",index:75,isBkr:!1},this.rules[76]={name:"Dec",lower:"dec",index:76,isBkr:!1},this.rules[77]={name:"Hex",lower:"hex",index:77,isBkr:!1},this.rules[78]={name:"Bin",lower:"bin",index:78,isBkr:!1},this.rules[79]={name:"dmin",lower:"dmin",index:79,isBkr:!1},this.rules[80]={name:"dmax",lower:"dmax",index:80,isBkr:!1},this.rules[81]={name:"bmin",lower:"bmin",index:81,isBkr:!1},this.rules[82]={name:"bmax",lower:"bmax",index:82,isBkr:!1},this.rules[83]={name:"xmin",lower:"xmin",index:83,isBkr:!1},this.rules[84]={name:"xmax",lower:"xmax",index:84,isBkr:!1},this.rules[85]={name:"dnum",lower:"dnum",index:85,isBkr:!1},this.rules[86]={name:"bnum",lower:"bnum",index:86,isBkr:!1},this.rules[87]={name:"xnum",lower:"xnum",index:87,isBkr:!1},this.rules[88]={name:"alphanum",lower:"alphanum",index:88,isBkr:!1},this.rules[89]={name:"owsp",lower:"owsp",index:89,isBkr:!1},this.rules[90]={name:"wsp",lower:"wsp",index:90,isBkr:!1},this.rules[91]={name:"space",lower:"space",index:91,isBkr:!1},this.rules[92]={name:"comment",lower:"comment",index:92,isBkr:!1},this.rules[93]={name:"LineEnd",lower:"lineend",index:93,isBkr:!1},this.rules[94]={name:"LineContinue",lower:"linecontinue",index:94,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:3,min:0,max:1/0},this.rules[0].opcodes[1]={type:1,children:[2,3,4]},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:4,index:2},this.rules[0].opcodes[4]={type:4,index:12},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,5,7]},this.rules[1].opcodes[1]={type:3,min:0,max:1/0},this.rules[1].opcodes[2]={type:1,children:[3,4]},this.rules[1].opcodes[3]={type:6,string:[32]},this.rules[1].opcodes[4]={type:6,string:[9]},this.rules[1].opcodes[5]={type:3,min:0,max:1},this.rules[1].opcodes[6]={type:4,index:92},this.rules[1].opcodes[7]={type:4,index:93},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[2].opcodes[1]={type:4,index:3},this.rules[2].opcodes[2]={type:4,index:89},this.rules[2].opcodes[3]={type:4,index:14},this.rules[2].opcodes[4]={type:1,children:[5,8]},this.rules[2].opcodes[5]={type:2,children:[6,7]},this.rules[2].opcodes[6]={type:4,index:89},this.rules[2].opcodes[7]={type:4,index:93},this.rules[2].opcodes[8]={type:2,children:[9,10]},this.rules[2].opcodes[9]={type:4,index:13},this.rules[2].opcodes[10]={type:4,index:93},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:2,children:[1,2,3]},this.rules[3].opcodes[1]={type:4,index:4},this.rules[3].opcodes[2]={type:4,index:89},this.rules[3].opcodes[3]={type:4,index:7},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:4,index:5},this.rules[4].opcodes[2]={type:4,index:6},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:4,index:88},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:3,min:1,max:1/0},this.rules[6].opcodes[1]={type:1,children:[2,3]},this.rules[6].opcodes[2]={type:5,min:33,max:60},this.rules[6].opcodes[3]={type:5,min:62,max:126},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:1,children:[1,2]},this.rules[7].opcodes[1]={type:4,index:9},this.rules[7].opcodes[2]={type:4,index:8},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:3,min:1,max:2},this.rules[8].opcodes[1]={type:5,min:33,max:126},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:1,children:[1,2]},this.rules[9].opcodes[1]={type:4,index:11},this.rules[9].opcodes[2]={type:4,index:10},this.rules[10].opcodes=[],this.rules[10].opcodes[0]={type:6,string:[61]},this.rules[11].opcodes=[],this.rules[11].opcodes[0]={type:6,string:[61,47]},this.rules[12].opcodes=[],this.rules[12].opcodes[0]={type:2,children:[1,6]},this.rules[12].opcodes[1]={type:3,min:1,max:1/0},this.rules[12].opcodes[2]={type:1,children:[3,4,5]},this.rules[12].opcodes[3]={type:5,min:32,max:126},this.rules[12].opcodes[4]={type:6,string:[9]},this.rules[12].opcodes[5]={type:4,index:94},this.rules[12].opcodes[6]={type:4,index:93},this.rules[13].opcodes=[],this.rules[13].opcodes[0]={type:3,min:1,max:1/0},this.rules[13].opcodes[1]={type:1,children:[2,3,4]},this.rules[13].opcodes[2]={type:5,min:32,max:126},this.rules[13].opcodes[3]={type:6,string:[9]},this.rules[13].opcodes[4]={type:4,index:94},this.rules[14].opcodes=[],this.rules[14].opcodes[0]={type:2,children:[1,2]},this.rules[14].opcodes[1]={type:4,index:15},this.rules[14].opcodes[2]={type:3,min:0,max:1/0},this.rules[14].opcodes[3]={type:2,children:[4,5,6]},this.rules[14].opcodes[4]={type:4,index:89},this.rules[14].opcodes[5]={type:4,index:44},this.rules[14].opcodes[6]={type:4,index:15},this.rules[15].opcodes=[],this.rules[15].opcodes[0]={type:2,children:[1,2]},this.rules[15].opcodes[1]={type:4,index:16},this.rules[15].opcodes[2]={type:3,min:0,max:1/0},this.rules[15].opcodes[3]={type:2,children:[4,5]},this.rules[15].opcodes[4]={type:4,index:45},this.rules[15].opcodes[5]={type:4,index:16},this.rules[16].opcodes=[],this.rules[16].opcodes[0]={type:2,children:[1,3]},this.rules[16].opcodes[1]={type:3,min:0,max:1},this.rules[16].opcodes[2]={type:4,index:17},this.rules[16].opcodes[3]={type:1,children:[4,5,6,7]},this.rules[16].opcodes[4]={type:4,index:21},this.rules[16].opcodes[5]={type:4,index:25},this.rules[16].opcodes[6]={type:4,index:19},this.rules[16].opcodes[7]={type:4,index:20},this.rules[17].opcodes=[],this.rules[17].opcodes[0]={type:1,children:[1,5]},this.rules[17].opcodes[1]={type:2,children:[2,3]},this.rules[17].opcodes[2]={type:4,index:18},this.rules[17].opcodes[3]={type:3,min:0,max:1},this.rules[17].opcodes[4]={type:4,index:43},this.rules[17].opcodes[5]={type:4,index:43},this.rules[18].opcodes=[],this.rules[18].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[18].opcodes[1]={type:4,index:49},this.rules[18].opcodes[2]={type:4,index:50},this.rules[18].opcodes[3]={type:4,index:47},this.rules[18].opcodes[4]={type:4,index:48},this.rules[19].opcodes=[],this.rules[19].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8,9,10]},this.rules[19].opcodes[1]={type:4,index:40},this.rules[19].opcodes[2]={type:4,index:29},this.rules[19].opcodes[3]={type:4,index:53},this.rules[19].opcodes[4]={type:4,index:54},this.rules[19].opcodes[5]={type:4,index:55},this.rules[19].opcodes[6]={type:4,index:61},this.rules[19].opcodes[7]={type:4,index:30},this.rules[19].opcodes[8]={type:4,index:51},this.rules[19].opcodes[9]={type:4,index:52},this.rules[19].opcodes[10]={type:4,index:65},this.rules[20].opcodes=[],this.rules[20].opcodes[0]={type:3,min:1,max:1/0},this.rules[20].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[20].opcodes[2]={type:5,min:33,max:40},this.rules[20].opcodes[3]={type:5,min:42,max:46},this.rules[20].opcodes[4]={type:5,min:48,max:92},this.rules[20].opcodes[5]={type:5,min:94,max:126},this.rules[21].opcodes=[],this.rules[21].opcodes[0]={type:2,children:[1,2,3]},this.rules[21].opcodes[1]={type:4,index:23},this.rules[21].opcodes[2]={type:4,index:14},this.rules[21].opcodes[3]={type:1,children:[4,5]},this.rules[21].opcodes[4]={type:4,index:24},this.rules[21].opcodes[5]={type:4,index:22},this.rules[22].opcodes=[],this.rules[22].opcodes[0]={type:3,min:1,max:1/0},this.rules[22].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[22].opcodes[2]={type:5,min:33,max:40},this.rules[22].opcodes[3]={type:5,min:42,max:46},this.rules[22].opcodes[4]={type:5,min:48,max:92},this.rules[22].opcodes[5]={type:5,min:94,max:126},this.rules[23].opcodes=[],this.rules[23].opcodes[0]={type:2,children:[1,2]},this.rules[23].opcodes[1]={type:6,string:[40]},this.rules[23].opcodes[2]={type:4,index:89},this.rules[24].opcodes=[],this.rules[24].opcodes[0]={type:2,children:[1,2]},this.rules[24].opcodes[1]={type:4,index:89},this.rules[24].opcodes[2]={type:6,string:[41]},this.rules[25].opcodes=[],this.rules[25].opcodes[0]={type:2,children:[1,2,3]},this.rules[25].opcodes[1]={type:4,index:27},this.rules[25].opcodes[2]={type:4,index:14},this.rules[25].opcodes[3]={type:1,children:[4,5]},this.rules[25].opcodes[4]={type:4,index:28},this.rules[25].opcodes[5]={type:4,index:26},this.rules[26].opcodes=[],this.rules[26].opcodes[0]={type:3,min:1,max:1/0},this.rules[26].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[26].opcodes[2]={type:5,min:33,max:40},this.rules[26].opcodes[3]={type:5,min:42,max:46},this.rules[26].opcodes[4]={type:5,min:48,max:92},this.rules[26].opcodes[5]={type:5,min:94,max:126},this.rules[27].opcodes=[],this.rules[27].opcodes[0]={type:2,children:[1,2]},this.rules[27].opcodes[1]={type:6,string:[91]},this.rules[27].opcodes[2]={type:4,index:89},this.rules[28].opcodes=[],this.rules[28].opcodes[0]={type:2,children:[1,2]},this.rules[28].opcodes[1]={type:4,index:89},this.rules[28].opcodes[2]={type:6,string:[93]},this.rules[29].opcodes=[],this.rules[29].opcodes[0]={type:4,index:88},this.rules[30].opcodes=[],this.rules[30].opcodes[0]={type:2,children:[1,2,4]},this.rules[30].opcodes[1]={type:6,string:[92]},this.rules[30].opcodes[2]={type:3,min:0,max:1},this.rules[30].opcodes[3]={type:4,index:31},this.rules[30].opcodes[4]={type:4,index:36},this.rules[31].opcodes=[],this.rules[31].opcodes[0]={type:1,children:[1,7,13,19]},this.rules[31].opcodes[1]={type:2,children:[2,3]},this.rules[31].opcodes[2]={type:4,index:32},this.rules[31].opcodes[3]={type:3,min:0,max:1},this.rules[31].opcodes[4]={type:1,children:[5,6]},this.rules[31].opcodes[5]={type:4,index:34},this.rules[31].opcodes[6]={type:4,index:35},this.rules[31].opcodes[7]={type:2,children:[8,9]},this.rules[31].opcodes[8]={type:4,index:33},this.rules[31].opcodes[9]={type:3,min:0,max:1},this.rules[31].opcodes[10]={type:1,children:[11,12]},this.rules[31].opcodes[11]={type:4,index:34},this.rules[31].opcodes[12]={type:4,index:35},this.rules[31].opcodes[13]={type:2,children:[14,15]},this.rules[31].opcodes[14]={type:4,index:34},this.rules[31].opcodes[15]={type:3,min:0,max:1},this.rules[31].opcodes[16]={type:1,children:[17,18]},this.rules[31].opcodes[17]={type:4,index:32},this.rules[31].opcodes[18]={type:4,index:33},this.rules[31].opcodes[19]={type:2,children:[20,21]},this.rules[31].opcodes[20]={type:4,index:35},this.rules[31].opcodes[21]={type:3,min:0,max:1},this.rules[31].opcodes[22]={type:1,children:[23,24]},this.rules[31].opcodes[23]={type:4,index:32},this.rules[31].opcodes[24]={type:4,index:33},this.rules[32].opcodes=[],this.rules[32].opcodes[0]={type:6,string:[37,115]},this.rules[33].opcodes=[],this.rules[33].opcodes[0]={type:6,string:[37,105]},this.rules[34].opcodes=[],this.rules[34].opcodes[0]={type:6,string:[37,117]},this.rules[35].opcodes=[],this.rules[35].opcodes[0]={type:6,string:[37,112]},this.rules[36].opcodes=[],this.rules[36].opcodes[0]={type:1,children:[1,2,3]},this.rules[36].opcodes[1]={type:4,index:38},this.rules[36].opcodes[2]={type:4,index:39},this.rules[36].opcodes[3]={type:4,index:37},this.rules[37].opcodes=[],this.rules[37].opcodes[0]={type:4,index:88},this.rules[38].opcodes=[],this.rules[38].opcodes[0]={type:2,children:[1,2]},this.rules[38].opcodes[1]={type:6,string:[117,95]},this.rules[38].opcodes[2]={type:4,index:88},this.rules[39].opcodes=[],this.rules[39].opcodes[0]={type:2,children:[1,2]},this.rules[39].opcodes[1]={type:6,string:[101,95]},this.rules[39].opcodes[2]={type:4,index:88},this.rules[40].opcodes=[],this.rules[40].opcodes[0]={type:1,children:[1,2]},this.rules[40].opcodes[1]={type:4,index:42},this.rules[40].opcodes[2]={type:4,index:41},this.rules[41].opcodes=[],this.rules[41].opcodes[0]={type:2,children:[1,2]},this.rules[41].opcodes[1]={type:6,string:[117,95]},this.rules[41].opcodes[2]={type:4,index:88},this.rules[42].opcodes=[],this.rules[42].opcodes[0]={type:2,children:[1,2]},this.rules[42].opcodes[1]={type:6,string:[101,95]},this.rules[42].opcodes[2]={type:4,index:88},this.rules[43].opcodes=[],this.rules[43].opcodes[0]={type:1,children:[1,5,8,11,12]},this.rules[43].opcodes[1]={type:2,children:[2,3,4]},this.rules[43].opcodes[2]={type:4,index:69},this.rules[43].opcodes[3]={type:4,index:46},this.rules[43].opcodes[4]={type:4,index:71},this.rules[43].opcodes[5]={type:2,children:[6,7]},this.rules[43].opcodes[6]={type:4,index:69},this.rules[43].opcodes[7]={type:4,index:46},this.rules[43].opcodes[8]={type:2,children:[9,10]},this.rules[43].opcodes[9]={type:4,index:46},this.rules[43].opcodes[10]={type:4,index:71},this.rules[43].opcodes[11]={type:4,index:46},this.rules[43].opcodes[12]={type:4,index:70},this.rules[44].opcodes=[],this.rules[44].opcodes[0]={type:2,children:[1,2]},this.rules[44].opcodes[1]={type:6,string:[47]},this.rules[44].opcodes[2]={type:4,index:89},this.rules[45].opcodes=[],this.rules[45].opcodes[0]={type:4,index:90},this.rules[46].opcodes=[],this.rules[46].opcodes[0]={type:6,string:[42]},this.rules[47].opcodes=[],this.rules[47].opcodes[0]={type:6,string:[38]},this.rules[48].opcodes=[],this.rules[48].opcodes[0]={type:6,string:[33]},this.rules[49].opcodes=[],this.rules[49].opcodes[0]={type:6,string:[38,38]},this.rules[50].opcodes=[],this.rules[50].opcodes[0]={type:6,string:[33,33]},this.rules[51].opcodes=[],this.rules[51].opcodes[0]={type:6,string:[37,94]},this.rules[52].opcodes=[],this.rules[52].opcodes[0]={type:6,string:[37,36]},this.rules[53].opcodes=[],this.rules[53].opcodes[0]={type:2,children:[1,2]},this.rules[53].opcodes[1]={type:6,string:[37]},this.rules[53].opcodes[2]={type:1,children:[3,8,13]},this.rules[53].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[53].opcodes[4]={type:4,index:76},this.rules[53].opcodes[5]={type:4,index:79},this.rules[53].opcodes[6]={type:6,string:[45]},this.rules[53].opcodes[7]={type:4,index:80},this.rules[53].opcodes[8]={type:2,children:[9,10,11,12]},this.rules[53].opcodes[9]={type:4,index:77},this.rules[53].opcodes[10]={type:4,index:83},this.rules[53].opcodes[11]={type:6,string:[45]},this.rules[53].opcodes[12]={type:4,index:84},this.rules[53].opcodes[13]={type:2,children:[14,15,16,17]},this.rules[53].opcodes[14]={type:4,index:78},this.rules[53].opcodes[15]={type:4,index:81},this.rules[53].opcodes[16]={type:6,string:[45]},this.rules[53].opcodes[17]={type:4,index:82},this.rules[54].opcodes=[],this.rules[54].opcodes[0]={type:2,children:[1,2]},this.rules[54].opcodes[1]={type:6,string:[37]},this.rules[54].opcodes[2]={type:1,children:[3,10,17]},this.rules[54].opcodes[3]={type:2,children:[4,5,6]},this.rules[54].opcodes[4]={type:4,index:76},this.rules[54].opcodes[5]={type:4,index:73},this.rules[54].opcodes[6]={type:3,min:0,max:1/0},this.rules[54].opcodes[7]={type:2,children:[8,9]},this.rules[54].opcodes[8]={type:6,string:[46]},this.rules[54].opcodes[9]={type:4,index:73},this.rules[54].opcodes[10]={type:2,children:[11,12,13]},this.rules[54].opcodes[11]={type:4,index:77},this.rules[54].opcodes[12]={type:4,index:74},this.rules[54].opcodes[13]={type:3,min:0,max:1/0},this.rules[54].opcodes[14]={type:2,children:[15,16]},this.rules[54].opcodes[15]={type:6,string:[46]},this.rules[54].opcodes[16]={type:4,index:74},this.rules[54].opcodes[17]={type:2,children:[18,19,20]},this.rules[54].opcodes[18]={type:4,index:78},this.rules[54].opcodes[19]={type:4,index:75},this.rules[54].opcodes[20]={type:3,min:0,max:1/0},this.rules[54].opcodes[21]={type:2,children:[22,23]},this.rules[54].opcodes[22]={type:6,string:[46]},this.rules[54].opcodes[23]={type:4,index:75},this.rules[55].opcodes=[],this.rules[55].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[55].opcodes[1]={type:4,index:56},this.rules[55].opcodes[2]={type:4,index:57},this.rules[55].opcodes[3]={type:4,index:59},this.rules[55].opcodes[4]={type:4,index:58},this.rules[56].opcodes=[],this.rules[56].opcodes[0]={type:3,min:0,max:1},this.rules[56].opcodes[1]={type:1,children:[2,3]},this.rules[56].opcodes[2]={type:7,string:[37,105]},this.rules[56].opcodes[3]={type:7,string:[37,115]},this.rules[57].opcodes=[],this.rules[57].opcodes[0]={type:6,string:[34]},this.rules[58].opcodes=[],this.rules[58].opcodes[0]={type:6,string:[34]},this.rules[59].opcodes=[],this.rules[59].opcodes[0]={type:3,min:0,max:1/0},this.rules[59].opcodes[1]={type:1,children:[2,3,4]},this.rules[59].opcodes[2]={type:5,min:32,max:33},this.rules[59].opcodes[3]={type:5,min:35,max:126},this.rules[59].opcodes[4]={type:4,index:60},this.rules[60].opcodes=[],this.rules[60].opcodes[0]={type:6,string:[9]},this.rules[61].opcodes=[],this.rules[61].opcodes[0]={type:2,children:[1,2,3]},this.rules[61].opcodes[1]={type:4,index:62},this.rules[61].opcodes[2]={type:4,index:64},this.rules[61].opcodes[3]={type:4,index:63},this.rules[62].opcodes=[],this.rules[62].opcodes[0]={type:6,string:[39]},this.rules[63].opcodes=[],this.rules[63].opcodes[0]={type:6,string:[39]},this.rules[64].opcodes=[],this.rules[64].opcodes[0]={type:3,min:0,max:1/0},this.rules[64].opcodes[1]={type:1,children:[2,3,4]},this.rules[64].opcodes[2]={type:5,min:32,max:38},this.rules[64].opcodes[3]={type:5,min:40,max:126},this.rules[64].opcodes[4]={type:4,index:60},this.rules[65].opcodes=[],this.rules[65].opcodes[0]={type:2,children:[1,2,3]},this.rules[65].opcodes[1]={type:4,index:66},this.rules[65].opcodes[2]={type:4,index:67},this.rules[65].opcodes[3]={type:4,index:68},this.rules[66].opcodes=[],this.rules[66].opcodes[0]={type:6,string:[60]},this.rules[67].opcodes=[],this.rules[67].opcodes[0]={type:3,min:0,max:1/0},this.rules[67].opcodes[1]={type:1,children:[2,3,4]},this.rules[67].opcodes[2]={type:5,min:32,max:61},this.rules[67].opcodes[3]={type:5,min:63,max:126},this.rules[67].opcodes[4]={type:4,index:60},this.rules[68].opcodes=[],this.rules[68].opcodes[0]={type:6,string:[62]},this.rules[69].opcodes=[],this.rules[69].opcodes[0]={type:4,index:72},this.rules[70].opcodes=[],this.rules[70].opcodes[0]={type:4,index:72},this.rules[71].opcodes=[],this.rules[71].opcodes[0]={type:4,index:72},this.rules[72].opcodes=[],this.rules[72].opcodes[0]={type:3,min:1,max:1/0},this.rules[72].opcodes[1]={type:5,min:48,max:57},this.rules[73].opcodes=[],this.rules[73].opcodes[0]={type:4,index:85},this.rules[74].opcodes=[],this.rules[74].opcodes[0]={type:4,index:87},this.rules[75].opcodes=[],this.rules[75].opcodes[0]={type:4,index:86},this.rules[76].opcodes=[],this.rules[76].opcodes[0]={type:1,children:[1,2]},this.rules[76].opcodes[1]={type:6,string:[68]},this.rules[76].opcodes[2]={type:6,string:[100]},this.rules[77].opcodes=[],this.rules[77].opcodes[0]={type:1,children:[1,2]},this.rules[77].opcodes[1]={type:6,string:[88]},this.rules[77].opcodes[2]={type:6,string:[120]},this.rules[78].opcodes=[],this.rules[78].opcodes[0]={type:1,children:[1,2]},this.rules[78].opcodes[1]={type:6,string:[66]},this.rules[78].opcodes[2]={type:6,string:[98]},this.rules[79].opcodes=[],this.rules[79].opcodes[0]={type:4,index:85},this.rules[80].opcodes=[],this.rules[80].opcodes[0]={type:4,index:85},this.rules[81].opcodes=[],this.rules[81].opcodes[0]={type:4,index:86},this.rules[82].opcodes=[],this.rules[82].opcodes[0]={type:4,index:86},this.rules[83].opcodes=[],this.rules[83].opcodes[0]={type:4,index:87},this.rules[84].opcodes=[],this.rules[84].opcodes[0]={type:4,index:87},this.rules[85].opcodes=[],this.rules[85].opcodes[0]={type:3,min:1,max:1/0},this.rules[85].opcodes[1]={type:5,min:48,max:57},this.rules[86].opcodes=[],this.rules[86].opcodes[0]={type:3,min:1,max:1/0},this.rules[86].opcodes[1]={type:5,min:48,max:49},this.rules[87].opcodes=[],this.rules[87].opcodes[0]={type:3,min:1,max:1/0},this.rules[87].opcodes[1]={type:1,children:[2,3,4]},this.rules[87].opcodes[2]={type:5,min:48,max:57},this.rules[87].opcodes[3]={type:5,min:65,max:70},this.rules[87].opcodes[4]={type:5,min:97,max:102},this.rules[88].opcodes=[],this.rules[88].opcodes[0]={type:2,children:[1,4]},this.rules[88].opcodes[1]={type:1,children:[2,3]},this.rules[88].opcodes[2]={type:5,min:97,max:122},this.rules[88].opcodes[3]={type:5,min:65,max:90},this.rules[88].opcodes[4]={type:3,min:0,max:1/0},this.rules[88].opcodes[5]={type:1,children:[6,7,8,9]},this.rules[88].opcodes[6]={type:5,min:97,max:122},this.rules[88].opcodes[7]={type:5,min:65,max:90},this.rules[88].opcodes[8]={type:5,min:48,max:57},this.rules[88].opcodes[9]={type:6,string:[45]},this.rules[89].opcodes=[],this.rules[89].opcodes[0]={type:3,min:0,max:1/0},this.rules[89].opcodes[1]={type:4,index:91},this.rules[90].opcodes=[],this.rules[90].opcodes[0]={type:3,min:1,max:1/0},this.rules[90].opcodes[1]={type:4,index:91},this.rules[91].opcodes=[],this.rules[91].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[91].opcodes[1]={type:6,string:[32]},this.rules[91].opcodes[2]={type:6,string:[9]},this.rules[91].opcodes[3]={type:4,index:92},this.rules[91].opcodes[4]={type:4,index:94},this.rules[92].opcodes=[],this.rules[92].opcodes[0]={type:2,children:[1,2]},this.rules[92].opcodes[1]={type:6,string:[59]},this.rules[92].opcodes[2]={type:3,min:0,max:1/0},this.rules[92].opcodes[3]={type:1,children:[4,5]},this.rules[92].opcodes[4]={type:5,min:32,max:126},this.rules[92].opcodes[5]={type:6,string:[9]},this.rules[93].opcodes=[],this.rules[93].opcodes[0]={type:1,children:[1,2,3]},this.rules[93].opcodes[1]={type:6,string:[13,10]},this.rules[93].opcodes[2]={type:6,string:[10]},this.rules[93].opcodes[3]={type:6,string:[13]},this.rules[94].opcodes=[],this.rules[94].opcodes[0]={type:2,children:[1,5]},this.rules[94].opcodes[1]={type:1,children:[2,3,4]},this.rules[94].opcodes[2]={type:6,string:[13,10]},this.rules[94].opcodes[3]={type:6,string:[10]},this.rules[94].opcodes[4]={type:6,string:[13]},this.rules[94].opcodes[5]={type:1,children:[6,7]},this.rules[94].opcodes[6]={type:6,string:[32]},this.rules[94].opcodes[7]={type:6,string:[9]},this.toString=function(){let t="";return t+=`;
|
|
333
333
|
`,t+=`; ABNF for JavaScript APG 2.0 SABNF
|
|
334
334
|
`,t+=`; RFC 5234 with some restrictions and additions.
|
|
335
335
|
`,t+=`; Updated 11/24/2015 for RFC 7405 case-sensitive literal string notation
|
|
@@ -500,7 +500,7 @@ table.apg-attrs a:hover {
|
|
|
500
500
|
`,t+=` / %d10
|
|
501
501
|
`,t+=` / %d13
|
|
502
502
|
`,t+=`LineContinue = (%d13.10 / %d10 / %d13) (%d32 / %d9)
|
|
503
|
-
`,t}}});var
|
|
503
|
+
`,t}}});var bE=M((sV,mE)=>{mE.exports=function(){let e="parser: ",t=Aa(),n=t.ids,s=new(lE()),i=new(dE()),o=new(hE()),a=new t.parser;a.ast=new t.ast,a.callbacks=s.callbacks,a.ast.callbacks=i.callbacks;let c=function(d,h,b){if(h<0||h>=b)return-1;for(let p=0;p<d.length;p+=1)if(h>=d[p].beginChar&&h<d[p].beginChar+d[p].length)return p;return-1},u=function(d,h){let b=-1;if(h<d.length){for(let p=h;p<d.length;p+=1)if(d[p]!==null){b=d[p];break}}return b},l=function(d){d.forEach(h=>{let b=[],p=[],g=0;h.opcodes.forEach(m=>{m.type===n.ALT&&m.children.length===1||m.type===n.CAT&&m.children.length===1||m.type===n.REP&&m.min===1&&m.max===1?p.push(null):(p.push(g),b.push(m),g+=1)}),p.push(g),b.forEach(m=>{if(m.type===n.ALT||m.type===n.CAT)for(let y=0;y<m.children.length;y+=1)m.children[y]=u(p,m.children[y])}),h.opcodes=b})};this.syntax=function(d,h,b,p,g,m){if(m){if(m.traceObject!=="traceObject")throw new TypeError(`${e}trace argument is not a trace object`);a.trace=m}let y={};y.errors=b,y.strict=!!p,y.lite=!!g,y.lines=h,y.findLine=c,y.charsLength=d.length,y.ruleCount=0,a.parse(o,"file",d,y).success||b.push({line:0,char:0,msg:"syntax analysis of input grammar failed"})},this.semantic=function(d,h,b){let p={};return p.errors=b,p.lines=h,p.findLine=c,p.charsLength=d.length,a.ast.translate(p),b.length?null:(l(p.rules),{rules:p.rules,udts:p.udts,lineMap:p.rulesLineMap})},this.generateSource=function(d,h,b,p,g){let m="",y=!1,E=!1;g&&(g.typescript?(y=!0,E=!1):g.lite&&(y=!1,E=!0));let v,k,w,P=0,B=1/0,Z=0,_=[],O=[],S=0,F=0,G=0,R=0,L=0,Y=0,oe=0,fe=0,K=0,ae=0,q=0,I=0,ye=0,st=0,Ke=0;b.forEach(D=>{_.push(D.lower),P+=D.opcodes.length,D.opcodes.forEach(j=>{switch(j.type){case n.ALT:S+=1;break;case n.CAT:F+=1;break;case n.RNM:G+=1;break;case n.UDT:R+=1;break;case n.REP:L+=1;break;case n.AND:Y+=1;break;case n.NOT:oe+=1;break;case n.BKA:I+=1;break;case n.BKN:ye+=1;break;case n.BKR:q+=1;break;case n.ABG:st+=1;break;case n.AEN:Ke+=1;break;case n.TLS:for(fe+=1,v=0;v<j.string.length;v+=1)j.string[v]<B&&(B=j.string[v]),j.string[v]>Z&&(Z=j.string[v]);break;case n.TBS:for(K+=1,v=0;v<j.string.length;v+=1)j.string[v]<B&&(B=j.string[v]),j.string[v]>Z&&(Z=j.string[v]);break;case n.TRG:ae+=1,j.min<B&&(B=j.min),j.max>Z&&(Z=j.max);break;default:throw new Error("generateSource: unrecognized opcode")}})}),_.sort(),p.length>0&&(p.forEach(D=>{O.push(D.lower)}),O.sort()),m+=`// copyright: Copyright (c) 2024 Lowell D. Thomas, all rights reserved<br>
|
|
504
504
|
`,m+=`// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br>
|
|
505
505
|
`,m+=`//
|
|
506
506
|
`,m+=`// Generated by apg-js, Version 4.4.0 [apg-js](https://github.com/ldthomas/apg-js)
|
|
@@ -564,11 +564,11 @@ table.apg-attrs a:hover {
|
|
|
564
564
|
`;break;default:throw new Error("parser.js: ~143: unrecognized opcode")}})}),m+=`
|
|
565
565
|
`,m+=" // The `toString()` function will display the original grammar file(s) that produced these opcodes.\n",m+=` this.toString = function toString(){
|
|
566
566
|
`,m+=` let str = "";
|
|
567
|
-
`;let
|
|
567
|
+
`;let We;return h.forEach(D=>{let j=D.beginChar+D.length;We="",m+=' str += "';for(let N=D.beginChar;N<j;N+=1){switch(d[N]){case 9:We=" ";break;case 10:We="\\n";break;case 13:We="\\r";break;case 34:We='\\"';break;case 92:We="\\\\";break;default:We=String.fromCharCode(d[N]);break}m+=We}m+=`";
|
|
568
568
|
`}),m+=` return str;
|
|
569
569
|
`,m+=` }
|
|
570
570
|
`,m+=`}
|
|
571
|
-
`,m},this.generateObject=function(d,h,b){let p={},g=[],m=[],y=d.slice(0);return p.grammarObject="grammarObject",h.forEach(E=>{g.push(E.lower)}),g.sort(),b.length>0&&(b.forEach(E=>{m.push(E.lower)}),m.sort()),p.callbacks=[],g.forEach(E=>{p.callbacks[E]=!1}),b.length>0&&m.forEach(E=>{p.callbacks[E]=!1}),p.rules=h,p.udts=b,p.toString=function(){return y},p}}});var
|
|
571
|
+
`,m},this.generateObject=function(d,h,b){let p={},g=[],m=[],y=d.slice(0);return p.grammarObject="grammarObject",h.forEach(E=>{g.push(E.lower)}),g.sort(),b.length>0&&(b.forEach(E=>{m.push(E.lower)}),m.sort()),p.callbacks=[],g.forEach(E=>{p.callbacks[E]=!1}),b.length>0&&m.forEach(E=>{p.callbacks[E]=!1}),p.rules=h,p.udts=b,p.toString=function(){return y},p}}});var xE=M((iV,gE)=>{gE.exports=function(){let e=Yn(),t="rule-attributes.js",n=null;function s(_){return _.left||_.nested||_.right||_.cyclic?!1:_.empty}function i(_){return!!(_.left||_.nested||_.right||_.cyclic)}function o(_,O){let S=0,F=0,G=0;for(S=0;S<O;S+=1)if(_[S].nested)return!0;for(S=0;S<O;S+=1)if(_[S].right&&!_[S].leaf){for(F=S+1;F<O;F+=1)if(!s(_[F]))return!0}for(S=O-1;S>=0;S-=1)if(_[S].left&&!_[S].leaf){for(F=S-1;F>=0;F-=1)if(!s(_[F]))return!0}for(S=0;S<O;S+=1)if(!_[S].empty&&!i(_[S])){for(F=S+1;F<O;F+=1)if(i(_[F])){for(G=F+1;G<O;G+=1)if(!_[G].empty&&!i(_[G]))return!0}}return!1}function a(_,O){for(let S=0;S<O;S+=1)if(!_[S].cyclic)return!1;return!0}function c(_,O){for(let S=0;S<O;S+=1){if(_[S].left)return!0;if(!_[S].empty)return!1}return!1}function u(_,O){for(let S=O-1;S>=0;S-=1){if(_[S].right)return!0;if(!_[S].empty)return!1}return!1}function l(_,O){for(let S=0;S<O;S+=1)if(!_[S].empty)return!1;return!0}function f(_,O){for(let S=0;S<O;S+=1)if(!_[S].finite)return!1;return!0}function d(_,O,S,F){let G=0,R=O[S],L=R.children.length,Y=[];for(G=0;G<L;G+=1)Y.push(_.attrGen());for(G=0;G<L;G+=1)p(_,O,R.children[G],Y[G]);F.left=c(Y,L),F.right=u(Y,L),F.nested=o(Y,L),F.empty=l(Y,L),F.finite=f(Y,L),F.cyclic=a(Y,L)}function h(_,O,S,F){let G=0,R=O[S],L=R.children.length,Y=[];for(G=0;G<L;G+=1)Y.push(_.attrGen());for(G=0;G<L;G+=1)p(_,O,R.children[G],Y[G]);for(F.left=!1,F.right=!1,F.nested=!1,F.empty=!1,F.finite=!1,F.cyclic=!1,G=0;G<L;G+=1)Y[G].left&&(F.left=!0),Y[G].nested&&(F.nested=!0),Y[G].right&&(F.right=!0),Y[G].empty&&(F.empty=!0),Y[G].finite&&(F.finite=!0),Y[G].cyclic&&(F.cyclic=!0)}function b(_,O,S,F){let G=O[S];G.index>=_.ruleCount?(F.empty=_.udts[G.index-_.ruleCount].empty,F.finite=!0):(g(_,G.index,F),F.left=!1,F.nested=!1,F.right=!1,F.cyclic=!1)}function p(_,O,S,F){_.attrInit(F);let G=O[S];switch(G.type){case e.ALT:h(_,O,S,F);break;case e.CAT:d(_,O,S,F);break;case e.REP:p(_,O,S+1,F),G.min===0&&(F.empty=!0,F.finite=!0);break;case e.RNM:g(_,O[S].index,F);break;case e.BKR:b(_,O,S,F);break;case e.AND:case e.NOT:case e.BKA:case e.BKN:p(_,O,S+1,F),F.empty=!0;break;case e.TLS:F.empty=!O[S].string.length,F.finite=!0,F.cyclic=!1;break;case e.TBS:case e.TRG:F.empty=!1,F.finite=!0,F.cyclic=!1;break;case e.UDT:F.empty=G.empty,F.finite=!0,F.cyclic=!1;break;case e.ABG:case e.AEN:F.empty=!0,F.finite=!0,F.cyclic=!1;break;default:throw new Error(`unknown opcode type: ${G}`)}}function g(_,O,S){let F=_.attrsWorking[O];F.isComplete?_.attrCopy(S,F):F.isOpen?O===_.startRule?O===_.startRule&&(S.left=!0,S.right=!0,S.cyclic=!0,S.leaf=!0):S.finite=!0:(F.isOpen=!0,p(_,F.rule.opcodes,0,S),F.left=S.left,F.right=S.right,F.nested=S.nested,F.empty=S.empty,F.finite=S.finite,F.cyclic=S.cyclic,F.leaf=!1,F.isOpen=!1,F.isComplete=!0)}let m=_=>{n=_;let O=0,S=0,F=n.attrGen();for(O=0;O<n.ruleCount;O+=1){for(S=0;S<n.ruleCount;S+=1)n.attrInit(n.attrsWorking[S]);n.startRule=O,g(n,O,F),n.attrCopy(n.attrs[O],n.attrsWorking[O])}n.attributesComplete=!0;let G=null;for(O=0;O<n.ruleCount;O+=1)if(G=n.attrs[O],G.left||!G.finite||G.cyclic){let R=n.attrGen(G.rule);n.attrCopy(R,G),n.attrsErrors.push(R),n.attrsErrorCount+=1}},y=_=>_?"t":"f",E=_=>_?"e":"f",v=_=>_?"t":"e",k=(_,O,S,F)=>{let G=`${_}:${O}:`;return G+=`${E(S.left)} `,G+=`${y(S.nested)} `,G+=`${y(S.right)} `,G+=`${E(S.cyclic)} `,G+=`${v(S.finite)} `,G+=`${y(S.empty)}:`,G+=`${n.typeToString(F.recursiveType)}:`,G+=F.recursiveType===e.ATTR_MR?F.groupNumber:"-",G+=`:${S.rule.name}
|
|
572
572
|
`,G},w=()=>{let _=`LEGEND - t=true, f=false, e=error
|
|
573
573
|
`;return _+=`sequence:rule index:left nested right cyclic finite empty:type:group number:rule name
|
|
574
574
|
`,_},P=()=>{let _=null,O=null,S="";if(S+=`RULE ATTRIBUTES WITH ERRORS
|
|
@@ -577,7 +577,7 @@ table.apg-attrs a:hover {
|
|
|
577
577
|
`;return _.charCodeAt(0)===97?(O+=`alphabetical by rule name
|
|
578
578
|
`,O+=S,O+=w(),O+=B(97)):_.charCodeAt(0)===116?(O+=`ordered by rule type
|
|
579
579
|
`,O+=S,O+=w(),O+=B(116)):(O+=`ordered by rule index
|
|
580
|
-
`,O+=S,O+=w(),O+=B()),O},showAttributeErrors:P}}()});var
|
|
580
|
+
`,O+=S,O+=w(),O+=B()),O},showAttributeErrors:P}}()});var wE=M((oV,yE)=>{yE.exports=(()=>{let r=Yn(),e=null,t=(o,a,c,u)=>{let l=0,f=0,d=a[c];u[c]=!0;let h=d.rule.opcodes;for(l=0;l<h.length;l+=1){let b=h[l];if(b.type===r.RNM)for(d.refersTo[b.index]=!0,u[b.index]||t(o,a,b.index,u),f=0;f<o;f+=1)a[b.index].refersTo[f]&&(d.refersTo[f]=!0);else b.type===r.UDT?d.refersToUdt[b.index]=!0:b.type===r.BKR&&(b.index<o?(d.refersTo[b.index]=!0,u[b.index]||t(o,a,b.index,u)):d.refersToUdt[o-b.index]=!0)}},n=o=>{e=o;let a=0,c=0,u=0,l=null,f=null,d=!1;e.dependenciesComplete=!1;let h=e.falseArray(e.ruleCount);for(a=0;a<e.ruleCount;a+=1)e.falsifyArray(h),t(e.ruleCount,e.ruleDeps,a,h);for(a=0;a<e.ruleCount;a+=1)for(c=0;c<e.ruleCount;c+=1)a!==c&&e.ruleDeps[c].refersTo[a]&&(e.ruleDeps[a].referencedBy[c]=!0);for(a=0;a<e.ruleCount;a+=1)e.ruleDeps[a].recursiveType=r.ATTR_N,e.ruleDeps[a].refersTo[a]&&(e.ruleDeps[a].recursiveType=r.ATTR_R);for(u=-1,a=0;a<e.ruleCount;a+=1)if(l=e.ruleDeps[a],l.recursiveType===r.ATTR_R)for(d=!0,c=0;c<e.ruleCount;c+=1)a!==c&&(f=e.ruleDeps[c],f.recursiveType===r.ATTR_R&&l.refersTo[c]&&f.refersTo[a]&&(d&&(u+=1,l.recursiveType=r.ATTR_MR,l.groupNumber=u,d=!1),f.recursiveType=r.ATTR_MR,f.groupNumber=u));e.isMutuallyRecursive=u>-1,e.ruleAlphaIndexes.sort(e.compRulesAlpha),e.ruleTypeIndexes.sort(e.compRulesAlpha),e.ruleTypeIndexes.sort(e.compRulesType),e.isMutuallyRecursive&&e.ruleTypeIndexes.sort(e.compRulesGroup),e.udtCount&&e.udtAlphaIndexes.sort(e.compUdtsAlpha),e.dependenciesComplete=!0},s=(o=null)=>{let a=0,c=0,u=0,l=0,f=e.ruleCount-1,d=e.udtCount-1,h=100,b="",p="",g="=> ",m="<= ",y=!1,E=null,{ruleIndexes:v}=e,{udtIndexes:k}=e;for(o===97?(v=e.ruleAlphaIndexes,k=e.udtAlphaIndexes):o===116&&(v=e.ruleTypeIndexes,k=e.udtAlphaIndexes),a=0;a<e.ruleCount;a+=1){for(E=e.ruleDeps[v[a]],p=`${v[a]}:${e.typeToString(E.recursiveType)}:`,e.isMutuallyRecursive&&(p+=E.groupNumber>-1?E.groupNumber:"-",p+=":"),p+=" ",b+=`${p+e.rules[v[a]].name}
|
|
581
581
|
`,y=!0,u=0,l=b.length,b+=p,c=0;c<e.ruleCount;c+=1)E.refersTo[v[c]]&&(y?(b+=g,y=!1,b+=e.ruleDeps[v[c]].rule.name):b+=`, ${e.ruleDeps[v[c]].rule.name}`,u+=1),b.length-l>h&&c!==f&&(b+=`
|
|
582
582
|
${p}${g}`,l=b.length);if(e.udtCount)for(c=0;c<e.udtCount;c+=1)E.refersToUdt[k[c]]&&(y?(b+=g,y=!1,b+=e.udts[k[c]].name):b+=`, ${e.udts[k[c]].name}`,u+=1),b.length-l>h&&c!==d&&(b+=`
|
|
583
583
|
${p}${g}`,l=b.length);for(u===0&&(b+=`=> <none>
|
|
@@ -592,13 +592,13 @@ ${p}${g}`,l=b.length);u===0&&(b+=`<= <none>
|
|
|
592
592
|
`,e.dependenciesComplete&&(o.charCodeAt(0)===97?(a+=`alphabetical by rule name
|
|
593
593
|
`,a+=s(97)):o.charCodeAt(0)===116?(a+=`ordered by rule type
|
|
594
594
|
`,a+=s(116)):(a+=`ordered by rule index
|
|
595
|
-
`,a+=s(null))),a}}})()});var
|
|
595
|
+
`,a+=s(null))),a}}})()});var EE=M((aV,AE)=>{AE.exports=function(){let e=Yn(),{ruleAttributes:t,showAttributes:n,showAttributeErrors:s}=xE(),{ruleDependencies:i,showRuleDependencies:o}=wE();class a{constructor(l,f){this.rules=l,this.udts=f,this.ruleCount=l.length,this.udtCount=f.length,this.startRule=0,this.dependenciesComplete=!1,this.attributesComplete=!1,this.isMutuallyRecursive=!1,this.ruleIndexes=this.indexArray(this.ruleCount),this.ruleAlphaIndexes=this.indexArray(this.ruleCount),this.ruleTypeIndexes=this.indexArray(this.ruleCount),this.udtIndexes=this.indexArray(this.udtCount),this.udtAlphaIndexes=this.indexArray(this.udtCount),this.attrsErrorCount=0,this.attrs=[],this.attrsErrors=[],this.attrsWorking=[],this.ruleDeps=[];for(let d=0;d<this.ruleCount;d+=1)this.attrs.push(this.attrGen(this.rules[d])),this.attrsWorking.push(this.attrGen(this.rules[d])),this.ruleDeps.push(this.rdGen(l[d],this.ruleCount,this.udtCount));this.compRulesAlpha=this.compRulesAlpha.bind(this),this.compUdtsAlpha=this.compUdtsAlpha.bind(this),this.compRulesType=this.compRulesType.bind(this),this.compRulesGroup=this.compRulesGroup.bind(this)}attrGen(l){return{left:!1,nested:!1,right:!1,empty:!1,finite:!1,cyclic:!1,leaf:!1,isOpen:!1,isComplete:!1,rule:l}}attrInit(l){l.left=!1,l.nested=!1,l.right=!1,l.empty=!1,l.finite=!1,l.cyclic=!1,l.leaf=!1,l.isOpen=!1,l.isComplete=!1}attrCopy(l,f){l.left=f.left,l.nested=f.nested,l.right=f.right,l.empty=f.empty,l.finite=f.finite,l.cyclic=f.cyclic,l.leaf=f.leaf,l.isOpen=f.isOpen,l.isComplete=f.isComplete,l.rule=f.rule}rdGen(l,f,d){return{rule:l,recursiveType:e.ATTR_N,groupNumber:-1,refersTo:this.falseArray(f),refersToUdt:this.falseArray(d),referencedBy:this.falseArray(f)}}typeToString(l){switch(l){case e.ATTR_N:return" N";case e.ATTR_R:return" R";case e.ATTR_MR:return"MR";default:return"UNKNOWN"}}falseArray(l){let f=[];if(l>0)for(let d=0;d<l;d+=1)f.push(!1);return f}falsifyArray(l){for(let f=0;f<l.length;f+=1)l[f]=!1}indexArray(l){let f=[];if(l>0)for(let d=0;d<l;d+=1)f.push(d);return f}compRulesAlpha(l,f){return this.rules[l].lower<this.rules[f].lower?-1:this.rules[l].lower>this.rules[f].lower?1:0}compUdtsAlpha(l,f){return this.udts[l].lower<this.udts[f].lower?-1:this.udts[l].lower>this.udts[f].lower?1:0}compRulesType(l,f){return this.ruleDeps[l].recursiveType<this.ruleDeps[f].recursiveType?-1:this.ruleDeps[l].recursiveType>this.ruleDeps[f].recursiveType?1:0}compRulesGroup(l,f){if(this.ruleDeps[l].recursiveType===e.ATTR_MR&&this.ruleDeps[f].recursiveType===e.ATTR_MR){if(this.ruleDeps[l].groupNumber<this.ruleDeps[f].groupNumber)return-1;if(this.ruleDeps[l].groupNumber>this.ruleDeps[f].groupNumber)return 1}return 0}}return{attributes:function(l=[],f=[],d=[],h=[]){let b=new a(l,f);return i(b),t(b),b.attrsErrorCount&&h.push({line:0,char:0,msg:`${b.attrsErrorCount} attribute errors`}),b.attrsErrorCount},showAttributes:n,showAttributeErrors:s,showRuleDependencies:o}}()});var TE=M((cV,vE)=>{vE.exports=function(){let e="show-rules.js";return function(s=[],i=[],o="index"){let a="showRules",c=[],u=[],l=[],f=[],d=s,h=i,b=s.length,p=i.length,g="RULE/UDT NAMES",m;function y(v,k){return d[v].lower<d[k].lower?-1:d[v].lower>d[k].lower?1:0}function E(v,k){return h[v].lower<h[k].lower?-1:h[v].lower>h[k].lower?1:0}if(!(Array.isArray(s)&&s.length))throw new Error(`${e}:${a}: rules arg must be array with length > 0`);if(!Array.isArray(i))throw new Error(`${e}:${a}: udts arg must be array`);for(m=0;m<b;m+=1)l.push(m);if(c=l.slice(0),c.sort(y),p){for(m=0;m<p;m+=1)f.push(m);u=f.slice(0),u.sort(E)}if(o.charCodeAt(0)===97){for(g+=` - alphabetical by rule/UDT name
|
|
596
596
|
`,m=0;m<b;m+=1)g+=`${m}: ${c[m]}: ${d[c[m]].name}
|
|
597
597
|
`;if(p)for(m=0;m<p;m+=1)g+=`${m}: ${u[m]}: ${h[u[m]].name}
|
|
598
598
|
`}else{for(g+=` - ordered by rule/UDT index
|
|
599
599
|
`,m=0;m<b;m+=1)g+=`${m}: ${d[m].name}
|
|
600
600
|
`;if(p)for(m=0;m<p;m+=1)g+=`${m}: ${h[m].name}
|
|
601
|
-
`}return g}}()});var
|
|
601
|
+
`}return g}}()});var kE=M((uV,PE)=>{PE.exports=function(e){let{Buffer:t}=h0(),n="api.js: ",s=this,i=Aa(),o=Cx(),a=cE(),c=new(bE()),{attributes:u,showAttributes:l,showAttributeErrors:f,showRuleDependencies:d}=EE(),h=TE(),b=function(O,S,F){let Y=`<span class="${i.style.CLASS_CTRLCHAR}">`,oe="</span>",fe=`<span class="${i.style.CLASS_NOMATCH}">`,K="</span>",ae,q="",I=!0;for(;I&&!(!Array.isArray(O)||O.length===0);){if(typeof S!="number")throw new Error("abnfToHtml: beg must be type number");if(S>=O.length)break;typeof F!="number"||S+F>=O.length?ae=O.length:ae=S+F;let ye=0;for(let st=S;st<ae;st+=1){let Ke=O[st];if(Ke>=32&&Ke<=126)switch(ye===1?(q+=oe,ye=0):ye===2&&(q+=K,ye=0),Ke){case 32:q+=" ";break;case 60:q+="<";break;case 62:q+=">";break;case 38:q+="&";break;case 34:q+=""";break;case 39:q+="'";break;case 92:q+="\";break;default:q+=String.fromCharCode(Ke);break}else Ke===9||Ke===10||Ke===13?(ye===0?(q+=Y,ye=1):ye===2&&(q+=K+Y,ye=1),Ke===9&&(q+="TAB"),Ke===10&&(q+="LF"),Ke===13&&(q+="CR")):(ye===0?(q+=fe,ye=2):ye===1&&(q+=oe+fe,ye=2),q+=`\\x${i.utils.charToHex(Ke)}`)}ye===2&&(q+=K),ye===1&&(q+=oe);break}return q},p=function(O,S,F){let G="";for(let R=S;R<S+F;R+=1){let L=O[R];if(L>=32&&L<=126)G+=String.fromCharCode(L);else switch(L){case 9:G+="\\t";break;case 10:G+="\\n";break;case 13:G+="\\r";break;default:G+="\\unknown";break}}return G},g=function(O){let S="Annotated Input Grammar";return O.forEach(F=>{S+=`
|
|
602
602
|
`,S+=`line no: ${F.lineNo}`,S+=` : char index: ${F.beginChar}`,S+=` : length: ${F.length}`,S+=` : abnf: ${p(s.chars,F.beginChar,F.length)}`}),S+=`
|
|
603
603
|
`,S},m=function(O){let S="";return S+=`<table class="${i.style.CLASS_GRAMMAR}">
|
|
604
604
|
`,S+=`<caption>Annotated Input Grammar</caption>
|
|
@@ -613,7 +613,7 @@ ${p}${g}`,l=b.length);u===0&&(b+=`<= <none>
|
|
|
613
613
|
`)}),L+=`</table></p>
|
|
614
614
|
`,L},E=function(O,S,F){let G,R,L,Y;return G="",O.forEach(oe=>{R=S[oe.line],G+=`${R.lineNo}: `,G+=`${R.beginChar}: `,G+=`${oe.char-R.beginChar}: `,L=R.beginChar,Y=oe.char-R.beginChar,G+=p(F,L,Y),G+=" >> ",L=oe.char,Y=R.beginChar+R.length-oe.char,G+=p(F,L,Y),G+=`
|
|
615
615
|
`,G+=`${R.lineNo}: `,G+=`${R.beginChar}: `,G+=`${oe.char-R.beginChar}: `,G+="error: ",G+=oe.msg,G+=`
|
|
616
|
-
`}),G},v=!1,k=!1,w=!1,P=!1,B=0,Z;if(this.errors=[],t.isBuffer(e))this.chars=o.decode("BINARY",e);else if(Array.isArray(e))this.chars=e.slice();else if(typeof e=="string")this.chars=o.decode("STRING",e);else throw new Error(`${n}input source is not a string, byte Buffer or character array`);this.sabnf=o.encode("STRING",this.chars),this.scan=function(O,S){this.lines=a(this.chars,this.errors,O,S),v=!0},this.parse=function(O,S,F){if(!v)throw new Error(`${n}grammar not scanned`);c.syntax(this.chars,this.lines,this.errors,O,S,F),k=!0},this.translate=function(){if(!k)throw new Error(`${n}grammar not scanned and parsed`);let O=c.semantic(this.chars,this.lines,this.errors);this.errors.length===0&&(this.rules=O.rules,this.udts=O.udts,Z=O.lineMap,w=!0)},this.attributes=function(){if(!w)throw new Error(`${n}grammar not scanned, parsed and translated`);return B=u(this.rules,this.udts,Z,this.errors),P=!0,B},this.generate=function(O){if(this.lines=a(this.chars,this.errors,O),this.errors.length||(c.syntax(this.chars,this.lines,this.errors,O),this.errors.length))return;let S=c.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=S.rules,this.udts=S.udts,Z=S.lineMap,B=u(this.rules,this.udts,Z,this.errors),P=!0)},this.displayRules=function(O="index"){if(!w)throw new Error(`${n}grammar not scanned, parsed and translated`);return h(this.rules,this.udts,O)},this.displayRuleDependencies=function(O="index"){if(!P)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return d(O)},this.displayAttributes=function(O="index"){if(!P)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return B&&f(O),l(O)},this.displayAttributeErrors=function(){if(!P)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return f()},this.toSource=function(O=void 0){if(!P)throw new Error(`${n}can't generate parser source - must be preceeded by call to attributes()`);if(B)throw new Error(`${n}can't generate parser source - attributes have ${B} errors`);return c.generateSource(this.chars,this.lines,this.rules,this.udts,O)},this.toObject=function(){if(!P)throw new Error(`${n}can't generate parser source - must be preceeded by call to attributes()`);if(B)throw new Error(`${n}can't generate parser source - attributes have ${B} errors`);return c.generateObject(this.sabnf,this.rules,this.udts)},this.errorsToAscii=function(){return E(this.errors,this.lines,this.chars)},this.errorsToHtml=function(O){return y(this.errors,this.lines,this.chars,O)},this.linesToAscii=function(){return g(this.lines)},this.linesToHtml=function(){return m(this.lines)}}});var Lx=M(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.output=lr.exists=lr.hash=lr.bytes=lr.bool=lr.number=lr.isBytes=void 0;function w0(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`positive integer expected, not ${r}`)}lr.number=w0;function kE(r){if(typeof r!="boolean")throw new Error(`boolean expected, not ${r}`)}lr.bool=kE;function BE(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}lr.isBytes=BE;function Mx(r,...e){if(!BE(r))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(r.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${r.length}`)}lr.bytes=Mx;function SE(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");w0(r.outputLen),w0(r.blockLen)}lr.hash=SE;function OE(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}lr.exists=OE;function _E(r,e){Mx(r);let t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}lr.output=_E;var B7={number:w0,bool:kE,bytes:Mx,hash:SE,exists:OE,output:_E};lr.default=B7});var ZE=M(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.add5L=Se.add5H=Se.add4H=Se.add4L=Se.add3H=Se.add3L=Se.add=Se.rotlBL=Se.rotlBH=Se.rotlSL=Se.rotlSH=Se.rotr32L=Se.rotr32H=Se.rotrBL=Se.rotrBH=Se.rotrSL=Se.rotrSH=Se.shrSL=Se.shrSH=Se.toBig=Se.split=Se.fromBig=void 0;var A0=BigInt(2**32-1),jx=BigInt(32);function Ux(r,e=!1){return e?{h:Number(r&A0),l:Number(r>>jx&A0)}:{h:Number(r>>jx&A0)|0,l:Number(r&A0)|0}}Se.fromBig=Ux;function CE(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let s=0;s<r.length;s++){let{h:i,l:o}=Ux(r[s],e);[t[s],n[s]]=[i,o]}return[t,n]}Se.split=CE;var NE=(r,e)=>BigInt(r>>>0)<<jx|BigInt(e>>>0);Se.toBig=NE;var IE=(r,e,t)=>r>>>t;Se.shrSH=IE;var RE=(r,e,t)=>r<<32-t|e>>>t;Se.shrSL=RE;var ME=(r,e,t)=>r>>>t|e<<32-t;Se.rotrSH=ME;var LE=(r,e,t)=>r<<32-t|e>>>t;Se.rotrSL=LE;var jE=(r,e,t)=>r<<64-t|e>>>t-32;Se.rotrBH=jE;var UE=(r,e,t)=>r>>>t-32|e<<64-t;Se.rotrBL=UE;var FE=(r,e)=>e;Se.rotr32H=FE;var DE=(r,e)=>r;Se.rotr32L=DE;var HE=(r,e,t)=>r<<t|e>>>32-t;Se.rotlSH=HE;var $E=(r,e,t)=>e<<t|r>>>32-t;Se.rotlSL=$E;var qE=(r,e,t)=>e<<t-32|r>>>64-t;Se.rotlBH=qE;var GE=(r,e,t)=>r<<t-32|e>>>64-t;Se.rotlBL=GE;function zE(r,e,t,n){let s=(e>>>0)+(n>>>0);return{h:r+t+(s/2**32|0)|0,l:s|0}}Se.add=zE;var VE=(r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0);Se.add3L=VE;var KE=(r,e,t,n)=>e+t+n+(r/2**32|0)|0;Se.add3H=KE;var JE=(r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0);Se.add4L=JE;var WE=(r,e,t,n,s)=>e+t+n+s+(r/2**32|0)|0;Se.add4H=WE;var QE=(r,e,t,n,s)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(s>>>0);Se.add5L=QE;var YE=(r,e,t,n,s,i)=>e+t+n+s+i+(r/2**32|0)|0;Se.add5H=YE;var S7={fromBig:Ux,split:CE,toBig:NE,shrSH:IE,shrSL:RE,rotrSH:ME,rotrSL:LE,rotrBH:jE,rotrBL:UE,rotr32H:FE,rotr32L:DE,rotlSH:HE,rotlSL:$E,rotlBH:qE,rotlBL:GE,add:zE,add3L:VE,add3H:KE,add4L:JE,add4H:WE,add5H:YE,add5L:QE};Se.default=S7});var XE=M(E0=>{"use strict";Object.defineProperty(E0,"__esModule",{value:!0});E0.crypto=void 0;E0.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});var $x=M(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.randomBytes=Pe.wrapXOFConstructorWithOpts=Pe.wrapConstructorWithOpts=Pe.wrapConstructor=Pe.checkOpts=Pe.Hash=Pe.concatBytes=Pe.toBytes=Pe.utf8ToBytes=Pe.asyncLoop=Pe.nextTick=Pe.hexToBytes=Pe.bytesToHex=Pe.byteSwap32=Pe.byteSwapIfBE=Pe.byteSwap=Pe.isLE=Pe.rotl=Pe.rotr=Pe.createView=Pe.u32=Pe.u8=Pe.isBytes=void 0;var Fx=XE(),Hx=Lx();function O7(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}Pe.isBytes=O7;var _7=r=>new Uint8Array(r.buffer,r.byteOffset,r.byteLength);Pe.u8=_7;var C7=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4));Pe.u32=C7;var N7=r=>new DataView(r.buffer,r.byteOffset,r.byteLength);Pe.createView=N7;var I7=(r,e)=>r<<32-e|r>>>e;Pe.rotr=I7;var R7=(r,e)=>r<<e|r>>>32-e>>>0;Pe.rotl=R7;Pe.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;var M7=r=>r<<24&4278190080|r<<8&16711680|r>>>8&65280|r>>>24&255;Pe.byteSwap=M7;Pe.byteSwapIfBE=Pe.isLE?r=>r:r=>(0,Pe.byteSwap)(r);function L7(r){for(let e=0;e<r.length;e++)r[e]=(0,Pe.byteSwap)(r[e])}Pe.byteSwap32=L7;var j7=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function U7(r){(0,Hx.bytes)(r);let e="";for(let t=0;t<r.length;t++)e+=j7[r[t]];return e}Pe.bytesToHex=U7;var fi={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function e3(r){if(r>=fi._0&&r<=fi._9)return r-fi._0;if(r>=fi._A&&r<=fi._F)return r-(fi._A-10);if(r>=fi._a&&r<=fi._f)return r-(fi._a-10)}function F7(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let e=r.length,t=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(t);for(let s=0,i=0;s<t;s++,i+=2){let o=e3(r.charCodeAt(i)),a=e3(r.charCodeAt(i+1));if(o===void 0||a===void 0){let c=r[i]+r[i+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+i)}n[s]=o*16+a}return n}Pe.hexToBytes=F7;var D7=async()=>{};Pe.nextTick=D7;async function H7(r,e,t){let n=Date.now();for(let s=0;s<r;s++){t(s);let i=Date.now()-n;i>=0&&i<e||(await(0,Pe.nextTick)(),n+=i)}}Pe.asyncLoop=H7;function t3(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}Pe.utf8ToBytes=t3;function v0(r){return typeof r=="string"&&(r=t3(r)),(0,Hx.bytes)(r),r}Pe.toBytes=v0;function $7(...r){let e=0;for(let n=0;n<r.length;n++){let s=r[n];(0,Hx.bytes)(s),e+=s.length}let t=new Uint8Array(e);for(let n=0,s=0;n<r.length;n++){let i=r[n];t.set(i,s),s+=i.length}return t}Pe.concatBytes=$7;var Dx=class{clone(){return this._cloneInto()}};Pe.Hash=Dx;var q7={}.toString;function G7(r,e){if(e!==void 0&&q7.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(r,e)}Pe.checkOpts=G7;function z7(r){let e=n=>r().update(v0(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}Pe.wrapConstructor=z7;function V7(r){let e=(n,s)=>r(s).update(v0(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}Pe.wrapConstructorWithOpts=V7;function K7(r){let e=(n,s)=>r(s).update(v0(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}Pe.wrapXOFConstructorWithOpts=K7;function J7(r=32){if(Fx.crypto&&typeof Fx.crypto.getRandomValues=="function")return Fx.crypto.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}Pe.randomBytes=J7});var u3=M(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.shake256=ft.shake128=ft.keccak_512=ft.keccak_384=ft.keccak_256=ft.keccak_224=ft.sha3_512=ft.sha3_384=ft.sha3_256=ft.sha3_224=ft.Keccak=ft.keccakP=void 0;var yc=Lx(),ef=ZE(),di=$x(),s3=[],i3=[],o3=[],W7=BigInt(0),Xl=BigInt(1),Q7=BigInt(2),Y7=BigInt(7),Z7=BigInt(256),X7=BigInt(113);for(let r=0,e=Xl,t=1,n=0;r<24;r++){[t,n]=[n,(2*t+3*n)%5],s3.push(2*(5*n+t)),i3.push((r+1)*(r+2)/2%64);let s=W7;for(let i=0;i<7;i++)e=(e<<Xl^(e>>Y7)*X7)%Z7,e&Q7&&(s^=Xl<<(Xl<<BigInt(i))-Xl);o3.push(s)}var[eC,tC]=(0,ef.split)(o3,!0),r3=(r,e,t)=>t>32?(0,ef.rotlBH)(r,e,t):(0,ef.rotlSH)(r,e,t),n3=(r,e,t)=>t>32?(0,ef.rotlBL)(r,e,t):(0,ef.rotlSL)(r,e,t);function a3(r,e=24){let t=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)t[o]=r[o]^r[o+10]^r[o+20]^r[o+30]^r[o+40];for(let o=0;o<10;o+=2){let a=(o+8)%10,c=(o+2)%10,u=t[c],l=t[c+1],f=r3(u,l,1)^t[a],d=n3(u,l,1)^t[a+1];for(let h=0;h<50;h+=10)r[o+h]^=f,r[o+h+1]^=d}let s=r[2],i=r[3];for(let o=0;o<24;o++){let a=i3[o],c=r3(s,i,a),u=n3(s,i,a),l=s3[o];s=r[l],i=r[l+1],r[l]=c,r[l+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)t[a]=r[o+a];for(let a=0;a<10;a++)r[o+a]^=~t[(a+2)%10]&t[(a+4)%10]}r[0]^=eC[n],r[1]^=tC[n]}t.fill(0)}ft.keccakP=a3;var Ea=class extends di.Hash{constructor(e,t,n,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,yc.number)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,di.u32)(this.state)}keccak(){di.isLE||(0,di.byteSwap32)(this.state32),a3(this.state32,this.rounds),di.isLE||(0,di.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(e){(0,yc.exists)(this);let{blockLen:t,state:n}=this;e=(0,di.toBytes)(e);let s=e.length;for(let i=0;i<s;){let o=Math.min(t-this.pos,s-i);for(let a=0;a<o;a++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:s}=this;e[n]^=t,(t&128)!==0&&n===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){(0,yc.exists)(this,!1),(0,yc.bytes)(e),this.finish();let t=this.state,{blockLen:n}=this;for(let s=0,i=e.length;s<i;){this.posOut>=n&&this.keccak();let o=Math.min(n-this.posOut,i-s);e.set(t.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,yc.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,yc.output)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:n,outputLen:s,rounds:i,enableXOF:o}=this;return e||(e=new Ea(t,n,s,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}};ft.Keccak=Ea;var Qi=(r,e,t)=>(0,di.wrapConstructor)(()=>new Ea(e,r,t));ft.sha3_224=Qi(6,144,224/8);ft.sha3_256=Qi(6,136,256/8);ft.sha3_384=Qi(6,104,384/8);ft.sha3_512=Qi(6,72,512/8);ft.keccak_224=Qi(1,144,224/8);ft.keccak_256=Qi(1,136,256/8);ft.keccak_384=Qi(1,104,384/8);ft.keccak_512=Qi(1,72,512/8);var c3=(r,e,t)=>(0,di.wrapXOFConstructorWithOpts)((n={})=>new Ea(e,r,n.dkLen===void 0?t:n.dkLen,!0));ft.shake128=c3(31,168,128/8);ft.shake256=c3(31,136,256/8)});var qx=M(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.parseIntegerNumber=wc.isEIP55Address=void 0;var rC=u3(),nC=$x(),sC=r=>{if(r.length!=42)return!1;let e=`${r}`.toLowerCase().replace("0x",""),t=(0,nC.bytesToHex)((0,rC.keccak_256)(e)),n="0x";for(let s=0;s<e.length;s++)parseInt(t[s],16)>=8?n+=e[s].toUpperCase():n+=e[s];return r===n};wc.isEIP55Address=sC;var iC=r=>{let e=parseInt(r);if(isNaN(e))throw new Error("Invalid number.");if(e===1/0)throw new Error("Invalid number.");return e};wc.parseIntegerNumber=iC});var p3=M(Ac=>{"use strict";var f3=Ac&&Ac.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},d3;Object.defineProperty(Ac,"__esModule",{value:!0});Ac.ParsedMessage=void 0;var oC=f3(PE()),mr=f3(Aa()),l3=qx(),aC=`
|
|
616
|
+
`}),G},v=!1,k=!1,w=!1,P=!1,B=0,Z;if(this.errors=[],t.isBuffer(e))this.chars=o.decode("BINARY",e);else if(Array.isArray(e))this.chars=e.slice();else if(typeof e=="string")this.chars=o.decode("STRING",e);else throw new Error(`${n}input source is not a string, byte Buffer or character array`);this.sabnf=o.encode("STRING",this.chars),this.scan=function(O,S){this.lines=a(this.chars,this.errors,O,S),v=!0},this.parse=function(O,S,F){if(!v)throw new Error(`${n}grammar not scanned`);c.syntax(this.chars,this.lines,this.errors,O,S,F),k=!0},this.translate=function(){if(!k)throw new Error(`${n}grammar not scanned and parsed`);let O=c.semantic(this.chars,this.lines,this.errors);this.errors.length===0&&(this.rules=O.rules,this.udts=O.udts,Z=O.lineMap,w=!0)},this.attributes=function(){if(!w)throw new Error(`${n}grammar not scanned, parsed and translated`);return B=u(this.rules,this.udts,Z,this.errors),P=!0,B},this.generate=function(O){if(this.lines=a(this.chars,this.errors,O),this.errors.length||(c.syntax(this.chars,this.lines,this.errors,O),this.errors.length))return;let S=c.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=S.rules,this.udts=S.udts,Z=S.lineMap,B=u(this.rules,this.udts,Z,this.errors),P=!0)},this.displayRules=function(O="index"){if(!w)throw new Error(`${n}grammar not scanned, parsed and translated`);return h(this.rules,this.udts,O)},this.displayRuleDependencies=function(O="index"){if(!P)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return d(O)},this.displayAttributes=function(O="index"){if(!P)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return B&&f(O),l(O)},this.displayAttributeErrors=function(){if(!P)throw new Error(`${n}no attributes - must be preceeded by call to attributes()`);return f()},this.toSource=function(O=void 0){if(!P)throw new Error(`${n}can't generate parser source - must be preceeded by call to attributes()`);if(B)throw new Error(`${n}can't generate parser source - attributes have ${B} errors`);return c.generateSource(this.chars,this.lines,this.rules,this.udts,O)},this.toObject=function(){if(!P)throw new Error(`${n}can't generate parser source - must be preceeded by call to attributes()`);if(B)throw new Error(`${n}can't generate parser source - attributes have ${B} errors`);return c.generateObject(this.sabnf,this.rules,this.udts)},this.errorsToAscii=function(){return E(this.errors,this.lines,this.chars)},this.errorsToHtml=function(O){return y(this.errors,this.lines,this.chars,O)},this.linesToAscii=function(){return g(this.lines)},this.linesToHtml=function(){return m(this.lines)}}});var Lx=M(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.output=lr.exists=lr.hash=lr.bytes=lr.bool=lr.number=lr.isBytes=void 0;function w0(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`positive integer expected, not ${r}`)}lr.number=w0;function BE(r){if(typeof r!="boolean")throw new Error(`boolean expected, not ${r}`)}lr.bool=BE;function SE(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}lr.isBytes=SE;function Mx(r,...e){if(!SE(r))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(r.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${r.length}`)}lr.bytes=Mx;function OE(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");w0(r.outputLen),w0(r.blockLen)}lr.hash=OE;function _E(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}lr.exists=_E;function CE(r,e){Mx(r);let t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}lr.output=CE;var B7={number:w0,bool:BE,bytes:Mx,hash:OE,exists:_E,output:CE};lr.default=B7});var XE=M(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.add5L=Se.add5H=Se.add4H=Se.add4L=Se.add3H=Se.add3L=Se.add=Se.rotlBL=Se.rotlBH=Se.rotlSL=Se.rotlSH=Se.rotr32L=Se.rotr32H=Se.rotrBL=Se.rotrBH=Se.rotrSL=Se.rotrSH=Se.shrSL=Se.shrSH=Se.toBig=Se.split=Se.fromBig=void 0;var A0=BigInt(2**32-1),jx=BigInt(32);function Ux(r,e=!1){return e?{h:Number(r&A0),l:Number(r>>jx&A0)}:{h:Number(r>>jx&A0)|0,l:Number(r&A0)|0}}Se.fromBig=Ux;function NE(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let s=0;s<r.length;s++){let{h:i,l:o}=Ux(r[s],e);[t[s],n[s]]=[i,o]}return[t,n]}Se.split=NE;var IE=(r,e)=>BigInt(r>>>0)<<jx|BigInt(e>>>0);Se.toBig=IE;var RE=(r,e,t)=>r>>>t;Se.shrSH=RE;var ME=(r,e,t)=>r<<32-t|e>>>t;Se.shrSL=ME;var LE=(r,e,t)=>r>>>t|e<<32-t;Se.rotrSH=LE;var jE=(r,e,t)=>r<<32-t|e>>>t;Se.rotrSL=jE;var UE=(r,e,t)=>r<<64-t|e>>>t-32;Se.rotrBH=UE;var FE=(r,e,t)=>r>>>t-32|e<<64-t;Se.rotrBL=FE;var DE=(r,e)=>e;Se.rotr32H=DE;var HE=(r,e)=>r;Se.rotr32L=HE;var $E=(r,e,t)=>r<<t|e>>>32-t;Se.rotlSH=$E;var qE=(r,e,t)=>e<<t|r>>>32-t;Se.rotlSL=qE;var GE=(r,e,t)=>e<<t-32|r>>>64-t;Se.rotlBH=GE;var zE=(r,e,t)=>r<<t-32|e>>>64-t;Se.rotlBL=zE;function VE(r,e,t,n){let s=(e>>>0)+(n>>>0);return{h:r+t+(s/2**32|0)|0,l:s|0}}Se.add=VE;var KE=(r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0);Se.add3L=KE;var WE=(r,e,t,n)=>e+t+n+(r/2**32|0)|0;Se.add3H=WE;var JE=(r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0);Se.add4L=JE;var QE=(r,e,t,n,s)=>e+t+n+s+(r/2**32|0)|0;Se.add4H=QE;var YE=(r,e,t,n,s)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(s>>>0);Se.add5L=YE;var ZE=(r,e,t,n,s,i)=>e+t+n+s+i+(r/2**32|0)|0;Se.add5H=ZE;var S7={fromBig:Ux,split:NE,toBig:IE,shrSH:RE,shrSL:ME,rotrSH:LE,rotrSL:jE,rotrBH:UE,rotrBL:FE,rotr32H:DE,rotr32L:HE,rotlSH:$E,rotlSL:qE,rotlBH:GE,rotlBL:zE,add:VE,add3L:KE,add3H:WE,add4L:JE,add4H:QE,add5H:ZE,add5L:YE};Se.default=S7});var e3=M(E0=>{"use strict";Object.defineProperty(E0,"__esModule",{value:!0});E0.crypto=void 0;E0.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});var $x=M(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.randomBytes=Pe.wrapXOFConstructorWithOpts=Pe.wrapConstructorWithOpts=Pe.wrapConstructor=Pe.checkOpts=Pe.Hash=Pe.concatBytes=Pe.toBytes=Pe.utf8ToBytes=Pe.asyncLoop=Pe.nextTick=Pe.hexToBytes=Pe.bytesToHex=Pe.byteSwap32=Pe.byteSwapIfBE=Pe.byteSwap=Pe.isLE=Pe.rotl=Pe.rotr=Pe.createView=Pe.u32=Pe.u8=Pe.isBytes=void 0;var Fx=e3(),Hx=Lx();function O7(r){return r instanceof Uint8Array||r!=null&&typeof r=="object"&&r.constructor.name==="Uint8Array"}Pe.isBytes=O7;var _7=r=>new Uint8Array(r.buffer,r.byteOffset,r.byteLength);Pe.u8=_7;var C7=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4));Pe.u32=C7;var N7=r=>new DataView(r.buffer,r.byteOffset,r.byteLength);Pe.createView=N7;var I7=(r,e)=>r<<32-e|r>>>e;Pe.rotr=I7;var R7=(r,e)=>r<<e|r>>>32-e>>>0;Pe.rotl=R7;Pe.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;var M7=r=>r<<24&4278190080|r<<8&16711680|r>>>8&65280|r>>>24&255;Pe.byteSwap=M7;Pe.byteSwapIfBE=Pe.isLE?r=>r:r=>(0,Pe.byteSwap)(r);function L7(r){for(let e=0;e<r.length;e++)r[e]=(0,Pe.byteSwap)(r[e])}Pe.byteSwap32=L7;var j7=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function U7(r){(0,Hx.bytes)(r);let e="";for(let t=0;t<r.length;t++)e+=j7[r[t]];return e}Pe.bytesToHex=U7;var fi={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function t3(r){if(r>=fi._0&&r<=fi._9)return r-fi._0;if(r>=fi._A&&r<=fi._F)return r-(fi._A-10);if(r>=fi._a&&r<=fi._f)return r-(fi._a-10)}function F7(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let e=r.length,t=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(t);for(let s=0,i=0;s<t;s++,i+=2){let o=t3(r.charCodeAt(i)),a=t3(r.charCodeAt(i+1));if(o===void 0||a===void 0){let c=r[i]+r[i+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+i)}n[s]=o*16+a}return n}Pe.hexToBytes=F7;var D7=async()=>{};Pe.nextTick=D7;async function H7(r,e,t){let n=Date.now();for(let s=0;s<r;s++){t(s);let i=Date.now()-n;i>=0&&i<e||(await(0,Pe.nextTick)(),n+=i)}}Pe.asyncLoop=H7;function r3(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}Pe.utf8ToBytes=r3;function v0(r){return typeof r=="string"&&(r=r3(r)),(0,Hx.bytes)(r),r}Pe.toBytes=v0;function $7(...r){let e=0;for(let n=0;n<r.length;n++){let s=r[n];(0,Hx.bytes)(s),e+=s.length}let t=new Uint8Array(e);for(let n=0,s=0;n<r.length;n++){let i=r[n];t.set(i,s),s+=i.length}return t}Pe.concatBytes=$7;var Dx=class{clone(){return this._cloneInto()}};Pe.Hash=Dx;var q7={}.toString;function G7(r,e){if(e!==void 0&&q7.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(r,e)}Pe.checkOpts=G7;function z7(r){let e=n=>r().update(v0(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}Pe.wrapConstructor=z7;function V7(r){let e=(n,s)=>r(s).update(v0(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}Pe.wrapConstructorWithOpts=V7;function K7(r){let e=(n,s)=>r(s).update(v0(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}Pe.wrapXOFConstructorWithOpts=K7;function W7(r=32){if(Fx.crypto&&typeof Fx.crypto.getRandomValues=="function")return Fx.crypto.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}Pe.randomBytes=W7});var l3=M(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.shake256=ft.shake128=ft.keccak_512=ft.keccak_384=ft.keccak_256=ft.keccak_224=ft.sha3_512=ft.sha3_384=ft.sha3_256=ft.sha3_224=ft.Keccak=ft.keccakP=void 0;var yc=Lx(),ef=XE(),di=$x(),i3=[],o3=[],a3=[],J7=BigInt(0),Xl=BigInt(1),Q7=BigInt(2),Y7=BigInt(7),Z7=BigInt(256),X7=BigInt(113);for(let r=0,e=Xl,t=1,n=0;r<24;r++){[t,n]=[n,(2*t+3*n)%5],i3.push(2*(5*n+t)),o3.push((r+1)*(r+2)/2%64);let s=J7;for(let i=0;i<7;i++)e=(e<<Xl^(e>>Y7)*X7)%Z7,e&Q7&&(s^=Xl<<(Xl<<BigInt(i))-Xl);a3.push(s)}var[eC,tC]=(0,ef.split)(a3,!0),n3=(r,e,t)=>t>32?(0,ef.rotlBH)(r,e,t):(0,ef.rotlSH)(r,e,t),s3=(r,e,t)=>t>32?(0,ef.rotlBL)(r,e,t):(0,ef.rotlSL)(r,e,t);function c3(r,e=24){let t=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)t[o]=r[o]^r[o+10]^r[o+20]^r[o+30]^r[o+40];for(let o=0;o<10;o+=2){let a=(o+8)%10,c=(o+2)%10,u=t[c],l=t[c+1],f=n3(u,l,1)^t[a],d=s3(u,l,1)^t[a+1];for(let h=0;h<50;h+=10)r[o+h]^=f,r[o+h+1]^=d}let s=r[2],i=r[3];for(let o=0;o<24;o++){let a=o3[o],c=n3(s,i,a),u=s3(s,i,a),l=i3[o];s=r[l],i=r[l+1],r[l]=c,r[l+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)t[a]=r[o+a];for(let a=0;a<10;a++)r[o+a]^=~t[(a+2)%10]&t[(a+4)%10]}r[0]^=eC[n],r[1]^=tC[n]}t.fill(0)}ft.keccakP=c3;var Ea=class extends di.Hash{constructor(e,t,n,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,yc.number)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,di.u32)(this.state)}keccak(){di.isLE||(0,di.byteSwap32)(this.state32),c3(this.state32,this.rounds),di.isLE||(0,di.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(e){(0,yc.exists)(this);let{blockLen:t,state:n}=this;e=(0,di.toBytes)(e);let s=e.length;for(let i=0;i<s;){let o=Math.min(t-this.pos,s-i);for(let a=0;a<o;a++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:s}=this;e[n]^=t,(t&128)!==0&&n===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){(0,yc.exists)(this,!1),(0,yc.bytes)(e),this.finish();let t=this.state,{blockLen:n}=this;for(let s=0,i=e.length;s<i;){this.posOut>=n&&this.keccak();let o=Math.min(n-this.posOut,i-s);e.set(t.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,yc.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,yc.output)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:n,outputLen:s,rounds:i,enableXOF:o}=this;return e||(e=new Ea(t,n,s,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}};ft.Keccak=Ea;var Qi=(r,e,t)=>(0,di.wrapConstructor)(()=>new Ea(e,r,t));ft.sha3_224=Qi(6,144,224/8);ft.sha3_256=Qi(6,136,256/8);ft.sha3_384=Qi(6,104,384/8);ft.sha3_512=Qi(6,72,512/8);ft.keccak_224=Qi(1,144,224/8);ft.keccak_256=Qi(1,136,256/8);ft.keccak_384=Qi(1,104,384/8);ft.keccak_512=Qi(1,72,512/8);var u3=(r,e,t)=>(0,di.wrapXOFConstructorWithOpts)((n={})=>new Ea(e,r,n.dkLen===void 0?t:n.dkLen,!0));ft.shake128=u3(31,168,128/8);ft.shake256=u3(31,136,256/8)});var qx=M(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.parseIntegerNumber=wc.isEIP55Address=void 0;var rC=l3(),nC=$x(),sC=r=>{if(r.length!=42)return!1;let e=`${r}`.toLowerCase().replace("0x",""),t=(0,nC.bytesToHex)((0,rC.keccak_256)(e)),n="0x";for(let s=0;s<e.length;s++)parseInt(t[s],16)>=8?n+=e[s].toUpperCase():n+=e[s];return r===n};wc.isEIP55Address=sC;var iC=r=>{let e=parseInt(r);if(isNaN(e))throw new Error("Invalid number.");if(e===1/0)throw new Error("Invalid number.");return e};wc.parseIntegerNumber=iC});var h3=M(Ac=>{"use strict";var d3=Ac&&Ac.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},p3;Object.defineProperty(Ac,"__esModule",{value:!0});Ac.ParsedMessage=void 0;var oC=d3(kE()),mr=d3(Aa()),f3=qx(),aC=`
|
|
617
617
|
sign-in-with-ethereum =
|
|
618
618
|
[ scheme "://" ] domain %s" wants you to sign in with your Ethereum account:" LF
|
|
619
619
|
address LF
|
|
@@ -753,23 +753,23 @@ LF = %x0A
|
|
|
753
753
|
DIGIT = %x30-39
|
|
754
754
|
; 0-9
|
|
755
755
|
HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
|
|
756
|
-
`,tf=class{static generateApi(){let e=new oC.default(aC);if(e.generate(),e.errors.length)throw console.error(e.errorsToAscii()),console.error(e.linesToAscii()),console.log(e.displayAttributeErrors()),new Error("ABNF grammar has errors");return e.toObject()}};
|
|
757
|
-
- `)),B};t.ast.callbacks.resources=g;let m=t.parse(tf.grammarObj,"sign-in-with-ethereum",e);if(!m.success)throw new Error(`Invalid message: ${JSON.stringify(m)}`);let y={};t.ast.translate(y);for(let[E,v]of Object.entries(y))this[E]=v;if(this.domain.length===0)throw new Error("Domain cannot be empty.");if(!(0,l3.isEIP55Address)(this.address))throw new Error("Address not conformant to EIP-55.")}};Ac.ParsedMessage=Gx});var h3=M(pi=>{"use strict";var cC=pi&&pi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),uC=pi&&pi.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&cC(e,r,t)};Object.defineProperty(pi,"__esModule",{value:!0});pi.ParsedMessage=void 0;var lC=p3();Object.defineProperty(pi,"ParsedMessage",{enumerable:!0,get:function(){return lC.ParsedMessage}});uC(qx(),pi)});var b3=M((xV,m3)=>{(function(r){"use strict";r.exports.is_uri=t,r.exports.is_http_uri=n,r.exports.is_https_uri=s,r.exports.is_web_uri=i,r.exports.isUri=t,r.exports.isHttpUri=n,r.exports.isHttpsUri=s,r.exports.isWebUri=i;var e=function(o){var a=o.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);return a};function t(o){if(!!o&&!/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(o)&&!/%[^0-9a-f]/i.test(o)&&!/%[0-9a-f](:?[^0-9a-f]|$)/i.test(o)){var a=[],c="",u="",l="",f="",d="",h="";if(a=e(o),c=a[1],u=a[2],l=a[3],f=a[4],d=a[5],!!(c&&c.length&&l.length>=0)){if(u&&u.length){if(!(l.length===0||/^\//.test(l)))return}else if(/^\/\//.test(l))return;if(!!/^[a-z][a-z0-9\+\-\.]*$/.test(c.toLowerCase()))return h+=c+":",u&&u.length&&(h+="//"+u),h+=l,f&&f.length&&(h+="?"+f),d&&d.length&&(h+="#"+d),h}}}function n(o,a){if(!!t(o)){var c=[],u="",l="",f="",d="",h="",b="",p="";if(c=e(o),u=c[1],l=c[2],f=c[3],h=c[4],b=c[5],!!u){if(a){if(u.toLowerCase()!="https")return}else if(u.toLowerCase()!="http")return;if(!!l)return/:(\d+)$/.test(l)&&(d=l.match(/:(\d+)$/)[0],l=l.replace(/:\d+$/,"")),p+=u+":",p+="//"+l,d&&(p+=d),p+=f,h&&h.length&&(p+="?"+h),b&&b.length&&(p+="#"+b),p}}}function s(o){return n(o,!0)}function i(o){return n(o)||s(o)}})(m3)});var U3=M((yV,k0)=>{var g3,x3,y3,w3,A3,E3,v3,T3,P3,T0,zx,k3,B3,S3,Ec,O3,_3,C3,N3,I3,R3,M3,L3,j3,P0;(function(r){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof k0=="object"&&typeof k0.exports=="object"?r(t(e,t(k0.exports))):r(t(e));function t(n,s){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(i,o){return n[i]=s?s(i,o):o}}})(function(r){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])};g3=function(n,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");e(n,s);function i(){this.constructor=n}n.prototype=s===null?Object.create(s):(i.prototype=s.prototype,new i)},x3=Object.assign||function(n){for(var s,i=1,o=arguments.length;i<o;i++){s=arguments[i];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(n[a]=s[a])}return n},y3=function(n,s){var i={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&s.indexOf(o)<0&&(i[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(n);a<o.length;a++)s.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(n,o[a])&&(i[o[a]]=n[o[a]]);return i},w3=function(n,s,i,o){var a=arguments.length,c=a<3?s:o===null?o=Object.getOwnPropertyDescriptor(s,i):o,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(n,s,i,o);else for(var l=n.length-1;l>=0;l--)(u=n[l])&&(c=(a<3?u(c):a>3?u(s,i,c):u(s,i))||c);return a>3&&c&&Object.defineProperty(s,i,c),c},A3=function(n,s){return function(i,o){s(i,o,n)}},E3=function(n,s){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,s)},v3=function(n,s,i,o){function a(c){return c instanceof i?c:new i(function(u){u(c)})}return new(i||(i=Promise))(function(c,u){function l(h){try{d(o.next(h))}catch(b){u(b)}}function f(h){try{d(o.throw(h))}catch(b){u(b)}}function d(h){h.done?c(h.value):a(h.value).then(l,f)}d((o=o.apply(n,s||[])).next())})},T3=function(n,s){var i={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},o,a,c,u;return u={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function l(d){return function(h){return f([d,h])}}function f(d){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(c=d[0]&2?a.return:d[0]?a.throw||((c=a.return)&&c.call(a),0):a.next)&&!(c=c.call(a,d[1])).done)return c;switch(a=0,c&&(d=[d[0]&2,c.value]),d[0]){case 0:case 1:c=d;break;case 4:return i.label++,{value:d[1],done:!1};case 5:i.label++,a=d[1],d=[0];continue;case 7:d=i.ops.pop(),i.trys.pop();continue;default:if(c=i.trys,!(c=c.length>0&&c[c.length-1])&&(d[0]===6||d[0]===2)){i=0;continue}if(d[0]===3&&(!c||d[1]>c[0]&&d[1]<c[3])){i.label=d[1];break}if(d[0]===6&&i.label<c[1]){i.label=c[1],c=d;break}if(c&&i.label<c[2]){i.label=c[2],i.ops.push(d);break}c[2]&&i.ops.pop(),i.trys.pop();continue}d=s.call(n,i)}catch(h){d=[6,h],a=0}finally{o=c=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}},P3=function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&P0(s,n,i)},P0=Object.create?function(n,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,o,a)}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]},T0=function(n){var s=typeof Symbol=="function"&&Symbol.iterator,i=s&&n[s],o=0;if(i)return i.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&o>=n.length&&(n=void 0),{value:n&&n[o++],done:!n}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},zx=function(n,s){var i=typeof Symbol=="function"&&n[Symbol.iterator];if(!i)return n;var o=i.call(n),a,c=[],u;try{for(;(s===void 0||s-- >0)&&!(a=o.next()).done;)c.push(a.value)}catch(l){u={error:l}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(u)throw u.error}}return c},k3=function(){for(var n=[],s=0;s<arguments.length;s++)n=n.concat(zx(arguments[s]));return n},B3=function(){for(var n=0,s=0,i=arguments.length;s<i;s++)n+=arguments[s].length;for(var o=Array(n),a=0,s=0;s<i;s++)for(var c=arguments[s],u=0,l=c.length;u<l;u++,a++)o[a]=c[u];return o},S3=function(n,s,i){if(i||arguments.length===2)for(var o=0,a=s.length,c;o<a;o++)(c||!(o in s))&&(c||(c=Array.prototype.slice.call(s,0,o)),c[o]=s[o]);return n.concat(c||Array.prototype.slice.call(s))},Ec=function(n){return this instanceof Ec?(this.v=n,this):new Ec(n)},O3=function(n,s,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=i.apply(n,s||[]),a,c=[];return a={},u("next"),u("throw"),u("return"),a[Symbol.asyncIterator]=function(){return this},a;function u(p){o[p]&&(a[p]=function(g){return new Promise(function(m,y){c.push([p,g,m,y])>1||l(p,g)})})}function l(p,g){try{f(o[p](g))}catch(m){b(c[0][3],m)}}function f(p){p.value instanceof Ec?Promise.resolve(p.value.v).then(d,h):b(c[0][2],p)}function d(p){l("next",p)}function h(p){l("throw",p)}function b(p,g){p(g),c.shift(),c.length&&l(c[0][0],c[0][1])}},_3=function(n){var s,i;return s={},o("next"),o("throw",function(a){throw a}),o("return"),s[Symbol.iterator]=function(){return this},s;function o(a,c){s[a]=n[a]?function(u){return(i=!i)?{value:Ec(n[a](u)),done:a==="return"}:c?c(u):u}:c}},C3=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=n[Symbol.asyncIterator],i;return s?s.call(n):(n=typeof T0=="function"?T0(n):n[Symbol.iterator](),i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i);function o(c){i[c]=n[c]&&function(u){return new Promise(function(l,f){u=n[c](u),a(l,f,u.done,u.value)})}}function a(c,u,l,f){Promise.resolve(f).then(function(d){c({value:d,done:l})},u)}},N3=function(n,s){return Object.defineProperty?Object.defineProperty(n,"raw",{value:s}):n.raw=s,n};var t=Object.create?function(n,s){Object.defineProperty(n,"default",{enumerable:!0,value:s})}:function(n,s){n.default=s};I3=function(n){if(n&&n.__esModule)return n;var s={};if(n!=null)for(var i in n)i!=="default"&&Object.prototype.hasOwnProperty.call(n,i)&&P0(s,n,i);return t(s,n),s},R3=function(n){return n&&n.__esModule?n:{default:n}},M3=function(n,s,i,o){if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof s=="function"?n!==s||!o:!s.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?o:i==="a"?o.call(n):o?o.value:s.get(n)},L3=function(n,s,i,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof s=="function"?n!==s||!a:!s.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(n,i):a?a.value=i:s.set(n,i),i},j3=function(n,s){if(s===null||typeof s!="object"&&typeof s!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?s===n:n.has(s)},r("__extends",g3),r("__assign",x3),r("__rest",y3),r("__decorate",w3),r("__param",A3),r("__metadata",E3),r("__awaiter",v3),r("__generator",T3),r("__exportStar",P3),r("__createBinding",P0),r("__values",T0),r("__read",zx),r("__spread",k3),r("__spreadArrays",B3),r("__spreadArray",S3),r("__await",Ec),r("__asyncGenerator",O3),r("__asyncDelegator",_3),r("__asyncValues",C3),r("__makeTemplateObject",N3),r("__importStar",I3),r("__importDefault",R3),r("__classPrivateFieldGet",M3),r("__classPrivateFieldSet",L3),r("__classPrivateFieldIn",j3)})});var S0=M(B0=>{"use strict";Object.defineProperty(B0,"__esModule",{value:!0});B0.version=void 0;B0.version="6.13.1"});var Yi=M(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.defineProperties=vc.resolveProperties=void 0;function fC(r,e,t){let n=e.split("|").map(i=>i.trim());for(let i=0;i<n.length;i++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof r===e)return}let s=new Error(`invalid value for type ${e}`);throw s.code="INVALID_ARGUMENT",s.argument=`value.${t}`,s.value=r,s}async function dC(r){let e=Object.keys(r);return(await Promise.all(e.map(n=>Promise.resolve(r[n])))).reduce((n,s,i)=>(n[e[i]]=s,n),{})}vc.resolveProperties=dC;function pC(r,e,t){for(let n in e){let s=e[n],i=t?t[n]:null;i&&fC(s,i,n),Object.defineProperty(r,n,{enumerable:!0,value:s,writable:!1})}}vc.defineProperties=pC});var Zn=M(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.assertPrivate=tr.assertNormalize=tr.assertArgumentCount=tr.assertArgument=tr.assert=tr.makeError=tr.isCallException=tr.isError=void 0;var hC=S0(),F3=Yi();function Tc(r){if(r==null)return"null";if(Array.isArray(r))return"[ "+r.map(Tc).join(", ")+" ]";if(r instanceof Uint8Array){let e="0123456789abcdef",t="0x";for(let n=0;n<r.length;n++)t+=e[r[n]>>4],t+=e[r[n]&15];return t}if(typeof r=="object"&&typeof r.toJSON=="function")return Tc(r.toJSON());switch(typeof r){case"boolean":case"symbol":return r.toString();case"bigint":return BigInt(r).toString();case"number":return r.toString();case"string":return JSON.stringify(r);case"object":{let e=Object.keys(r);return e.sort(),"{ "+e.map(t=>`${Tc(t)}: ${Tc(r[t])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function D3(r,e){return r&&r.code===e}tr.isError=D3;function mC(r){return D3(r,"CALL_EXCEPTION")}tr.isCallException=mC;function H3(r,e,t){let n=r;{let i=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${Tc(t)}`);for(let o in t){if(o==="shortMessage")continue;let a=t[o];i.push(o+"="+Tc(a))}}i.push(`code=${e}`),i.push(`version=${hC.version}`),i.length&&(r+=" ("+i.join(", ")+")")}let s;switch(e){case"INVALID_ARGUMENT":s=new TypeError(r);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":s=new RangeError(r);break;default:s=new Error(r)}return(0,F3.defineProperties)(s,{code:e}),t&&Object.assign(s,t),s.shortMessage==null&&(0,F3.defineProperties)(s,{shortMessage:n}),s}tr.makeError=H3;function Pc(r,e,t,n){if(!r)throw H3(e,t,n)}tr.assert=Pc;function bC(r,e,t,n){Pc(r,e,"INVALID_ARGUMENT",{argument:t,value:n})}tr.assertArgument=bC;function gC(r,e,t){t==null&&(t=""),t&&(t=": "+t),Pc(r>=e,"missing arguemnt"+t,"MISSING_ARGUMENT",{count:r,expectedCount:e}),Pc(r<=e,"too many arguments"+t,"UNEXPECTED_ARGUMENT",{count:r,expectedCount:e})}tr.assertArgumentCount=gC;var xC=["NFD","NFC","NFKD","NFKC"].reduce((r,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"){let t=String.fromCharCode(233).normalize("NFD"),n=String.fromCharCode(101,769);if(t!==n)throw new Error("broken")}r.push(e)}catch{}return r},[]);function yC(r){Pc(xC.indexOf(r)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:r}})}tr.assertNormalize=yC;function wC(r,e,t){if(t==null&&(t=""),r!==e){let n=t,s="new";t&&(n+=".",s+=" "+t),Pc(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}tr.assertPrivate=wC});var gn=M(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.zeroPadBytes=vt.zeroPadValue=vt.stripZerosLeft=vt.dataSlice=vt.dataLength=vt.concat=vt.hexlify=vt.isBytesLike=vt.isHexString=vt.getBytesCopy=vt.getBytes=void 0;var Vx=Zn();function q3(r,e,t){if(r instanceof Uint8Array)return t?new Uint8Array(r):r;if(typeof r=="string"&&r.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){let n=new Uint8Array((r.length-2)/2),s=2;for(let i=0;i<n.length;i++)n[i]=parseInt(r.substring(s,s+2),16),s+=2;return n}(0,Vx.assertArgument)(!1,"invalid BytesLike value",e||"value",r)}function rf(r,e){return q3(r,e,!1)}vt.getBytes=rf;function AC(r,e){return q3(r,e,!0)}vt.getBytesCopy=AC;function Kx(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&r.length!==2+2*e||e===!0&&r.length%2!==0)}vt.isHexString=Kx;function EC(r){return Kx(r,!0)||r instanceof Uint8Array}vt.isBytesLike=EC;var $3="0123456789abcdef";function nf(r){let e=rf(r),t="0x";for(let n=0;n<e.length;n++){let s=e[n];t+=$3[(s&240)>>4]+$3[s&15]}return t}vt.hexlify=nf;function vC(r){return"0x"+r.map(e=>nf(e).substring(2)).join("")}vt.concat=vC;function TC(r){return Kx(r,!0)?(r.length-2)/2:rf(r).length}vt.dataLength=TC;function PC(r,e,t){let n=rf(r);return t!=null&&t>n.length&&(0,Vx.assert)(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:t}),nf(n.slice(e??0,t??n.length))}vt.dataSlice=PC;function kC(r){let e=nf(r).substring(2);for(;e.startsWith("00");)e=e.substring(2);return"0x"+e}vt.stripZerosLeft=kC;function G3(r,e,t){let n=rf(r);(0,Vx.assert)(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});let s=new Uint8Array(e);return s.fill(0),t?s.set(n,e-n.length):s.set(n,0),nf(s)}function BC(r,e){return G3(r,e,!0)}vt.zeroPadValue=BC;function SC(r,e){return G3(r,e,!1)}vt.zeroPadBytes=SC});var Bc=M(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.toQuantity=Tt.toBeArray=Tt.toBeHex=Tt.toNumber=Tt.getNumber=Tt.toBigInt=Tt.getUint=Tt.getBigInt=Tt.mask=Tt.toTwos=Tt.fromTwos=void 0;var z3=gn(),Hr=Zn(),O0=BigInt(0),Xn=BigInt(1),kc=9007199254740991;function OC(r,e){let t=sf(r,"value"),n=BigInt(va(e,"width"));if((0,Hr.assert)(t>>n===O0,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:r}),t>>n-Xn){let s=(Xn<<n)-Xn;return-((~t&s)+Xn)}return t}Tt.fromTwos=OC;function _C(r,e){let t=_0(r,"value"),n=BigInt(va(e,"width")),s=Xn<<n-Xn;if(t<O0){t=-t,(0,Hr.assert)(t<=s,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:r});let i=(Xn<<n)-Xn;return(~t&i)+Xn}else(0,Hr.assert)(t<s,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:r});return t}Tt.toTwos=_C;function CC(r,e){let t=sf(r,"value"),n=BigInt(va(e,"bits"));return t&(Xn<<n)-Xn}Tt.mask=CC;function _0(r,e){switch(typeof r){case"bigint":return r;case"number":return(0,Hr.assertArgument)(Number.isInteger(r),"underflow",e||"value",r),(0,Hr.assertArgument)(r>=-kc&&r<=kc,"overflow",e||"value",r),BigInt(r);case"string":try{if(r==="")throw new Error("empty string");return r[0]==="-"&&r[1]!=="-"?-BigInt(r.substring(1)):BigInt(r)}catch(t){(0,Hr.assertArgument)(!1,`invalid BigNumberish string: ${t.message}`,e||"value",r)}}(0,Hr.assertArgument)(!1,"invalid BigNumberish value",e||"value",r)}Tt.getBigInt=_0;function sf(r,e){let t=_0(r,e);return(0,Hr.assert)(t>=O0,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:r}),t}Tt.getUint=sf;var V3="0123456789abcdef";function K3(r){if(r instanceof Uint8Array){let e="0x0";for(let t of r)e+=V3[t>>4],e+=V3[t&15];return BigInt(e)}return _0(r)}Tt.toBigInt=K3;function va(r,e){switch(typeof r){case"bigint":return(0,Hr.assertArgument)(r>=-kc&&r<=kc,"overflow",e||"value",r),Number(r);case"number":return(0,Hr.assertArgument)(Number.isInteger(r),"underflow",e||"value",r),(0,Hr.assertArgument)(r>=-kc&&r<=kc,"overflow",e||"value",r),r;case"string":try{if(r==="")throw new Error("empty string");return va(BigInt(r),e)}catch(t){(0,Hr.assertArgument)(!1,`invalid numeric string: ${t.message}`,e||"value",r)}}(0,Hr.assertArgument)(!1,"invalid numeric value",e||"value",r)}Tt.getNumber=va;function NC(r){return va(K3(r))}Tt.toNumber=NC;function IC(r,e){let n=sf(r,"value").toString(16);if(e==null)n.length%2&&(n="0"+n);else{let s=va(e,"width");for((0,Hr.assert)(s*2>=n.length,`value exceeds width (${s} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:r});n.length<s*2;)n="0"+n}return"0x"+n}Tt.toBeHex=IC;function J3(r){let e=sf(r,"value");if(e===O0)return new Uint8Array([]);let t=e.toString(16);t.length%2&&(t="0"+t);let n=new Uint8Array(t.length/2);for(let s=0;s<n.length;s++){let i=s*2;n[s]=parseInt(t.substring(i,i+2),16)}return n}Tt.toBeArray=J3;function RC(r){let e=(0,z3.hexlify)((0,z3.isBytesLike)(r)?r:J3(r)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}Tt.toQuantity=RC});var W3=M(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.decodeBase58=Sc.encodeBase58=void 0;var MC=gn(),LC=Zn(),jC=Bc(),N0="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",C0=null;function UC(r){if(C0==null){C0={};for(let t=0;t<N0.length;t++)C0[N0[t]]=BigInt(t)}let e=C0[r];return(0,LC.assertArgument)(e!=null,"invalid base58 value","letter",r),e}var FC=BigInt(0),Jx=BigInt(58);function DC(r){let e=(0,MC.getBytes)(r),t=(0,jC.toBigInt)(e),n="";for(;t;)n=N0[Number(t%Jx)]+n,t/=Jx;for(let s=0;s<e.length&&!e[s];s++)n=N0[0]+n;return n}Sc.encodeBase58=DC;function HC(r){let e=FC;for(let t=0;t<r.length;t++)e*=Jx,e+=UC(r[t]);return e}Sc.decodeBase58=HC});var Wx=M(Oc=>{"use strict";Object.defineProperty(Oc,"__esModule",{value:!0});Oc.encodeBase64=Oc.decodeBase64=void 0;var Q3=gn();function $C(r){r=atob(r);let e=new Uint8Array(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return(0,Q3.getBytes)(e)}Oc.decodeBase64=$C;function qC(r){let e=(0,Q3.getBytes)(r),t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}Oc.encodeBase64=qC});var Y3=M(I0=>{"use strict";Object.defineProperty(I0,"__esModule",{value:!0});I0.EventPayload=void 0;var GC=Yi(),Qx=class{filter;emitter;#e;constructor(e,t,n){this.#e=t,(0,GC.defineProperties)(this,{emitter:e,filter:n})}async removeListener(){this.#e!=null&&await this.emitter.off(this.filter,this.#e)}};I0.EventPayload=Qx});var R0=M(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.toUtf8CodePoints=es.toUtf8String=es.toUtf8Bytes=es.Utf8ErrorFuncs=void 0;var zC=gn(),of=Zn();function VC(r,e,t,n,s){(0,of.assertArgument)(!1,`invalid codepoint at offset ${e}; ${r}`,"bytes",t)}function Z3(r,e,t,n,s){if(r==="BAD_PREFIX"||r==="UNEXPECTED_CONTINUE"){let i=0;for(let o=e+1;o<t.length&&t[o]>>6===2;o++)i++;return i}return r==="OVERRUN"?t.length-e-1:0}function KC(r,e,t,n,s){return r==="OVERLONG"?((0,of.assertArgument)(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),n.push(s),0):(n.push(65533),Z3(r,e,t,n,s))}es.Utf8ErrorFuncs=Object.freeze({error:VC,ignore:Z3,replace:KC});function X3(r,e){e==null&&(e=es.Utf8ErrorFuncs.error);let t=(0,zC.getBytes)(r,"bytes"),n=[],s=0;for(;s<t.length;){let i=t[s++];if(i>>7===0){n.push(i);continue}let o=null,a=null;if((i&224)===192)o=1,a=127;else if((i&240)===224)o=2,a=2047;else if((i&248)===240)o=3,a=65535;else{(i&192)===128?s+=e("UNEXPECTED_CONTINUE",s-1,t,n):s+=e("BAD_PREFIX",s-1,t,n);continue}if(s-1+o>=t.length){s+=e("OVERRUN",s-1,t,n);continue}let c=i&(1<<8-o-1)-1;for(let u=0;u<o;u++){let l=t[s];if((l&192)!=128){s+=e("MISSING_CONTINUE",s,t,n),c=null;break}c=c<<6|l&63,s++}if(c!==null){if(c>1114111){s+=e("OUT_OF_RANGE",s-1-o,t,n,c);continue}if(c>=55296&&c<=57343){s+=e("UTF16_SURROGATE",s-1-o,t,n,c);continue}if(c<=a){s+=e("OVERLONG",s-1-o,t,n,c);continue}n.push(c)}}return n}function e8(r,e){(0,of.assertArgument)(typeof r=="string","invalid string value","str",r),e!=null&&((0,of.assertNormalize)(e),r=r.normalize(e));let t=[];for(let n=0;n<r.length;n++){let s=r.charCodeAt(n);if(s<128)t.push(s);else if(s<2048)t.push(s>>6|192),t.push(s&63|128);else if((s&64512)==55296){n++;let i=r.charCodeAt(n);(0,of.assertArgument)(n<r.length&&(i&64512)===56320,"invalid surrogate pair","str",r);let o=65536+((s&1023)<<10)+(i&1023);t.push(o>>18|240),t.push(o>>12&63|128),t.push(o>>6&63|128),t.push(o&63|128)}else t.push(s>>12|224),t.push(s>>6&63|128),t.push(s&63|128)}return new Uint8Array(t)}es.toUtf8Bytes=e8;function JC(r){return r.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function WC(r,e){return JC(X3(r,e))}es.toUtf8String=WC;function QC(r,e){return X3(e8(r,e))}es.toUtf8CodePoints=QC});var r8=M(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.getUrl=_c.createGetUrl=void 0;var af=Zn();function t8(r){async function e(t,n){(0,af.assert)(n==null||!n.cancelled,"request cancelled before sending","CANCELLED");let s=t.url.split(":")[0].toLowerCase();(0,af.assert)(s==="http"||s==="https",`unsupported protocol ${s}`,"UNSUPPORTED_OPERATION",{info:{protocol:s},operation:"request"}),(0,af.assert)(s==="https"||!t.credentials||t.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let i=null,o=new AbortController,a=setTimeout(()=>{i=(0,af.makeError)("request timeout","TIMEOUT"),o.abort()},t.timeout);n&&n.addListener(()=>{i=(0,af.makeError)("request cancelled","CANCELLED"),o.abort()});let c={method:t.method,headers:new Headers(Array.from(t)),body:t.body||void 0,signal:o.signal},u;try{u=await fetch(t.url,c)}catch(h){throw clearTimeout(a),i||h}clearTimeout(a);let l={};u.headers.forEach((h,b)=>{l[b.toLowerCase()]=h});let f=await u.arrayBuffer(),d=f==null?null:new Uint8Array(f);return{statusCode:u.status,statusMessage:u.statusText,headers:l,body:d}}return e}_c.createGetUrl=t8;var YC=t8({});async function ZC(r,e){return YC(r,e)}_c.getUrl=ZC});var f8=M(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.FetchResponse=Zi.FetchRequest=Zi.FetchCancelSignal=void 0;var i8=Wx(),o8=gn(),xn=Zn(),XC=Yi(),Cc=R0(),a8=r8(),eN=12,tN=250,n8=(0,a8.createGetUrl)(),rN=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),nN=new RegExp("^ipfs://(ipfs/)?(.*)$","i"),Yx=!1;async function c8(r,e){try{let t=r.match(rN);if(!t)throw new Error("invalid data");return new ts(200,"OK",{"content-type":t[1]||"text/plain"},t[2]?(0,i8.decodeBase64)(t[3]):sN(t[3]))}catch{return new ts(599,"BAD REQUEST (invalid data: URI)",{},null,new hi(r))}}function u8(r){async function e(t,n){try{let s=t.match(nN);if(!s)throw new Error("invalid link");return new hi(`${r}${s[2]}`)}catch{return new ts(599,"BAD REQUEST (invalid IPFS URI)",{},null,new hi(t))}}return e}var M0={data:c8,ipfs:u8("https://gateway.ipfs.io/ipfs/")},l8=new WeakMap,j0=class{#e;#t;constructor(e){this.#e=[],this.#t=!1,l8.set(e,()=>{if(!this.#t){this.#t=!0;for(let t of this.#e)setTimeout(()=>{t()},0);this.#e=[]}})}addListener(e){(0,xn.assert)(!this.#t,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#e.push(e)}get cancelled(){return this.#t}checkSignal(){(0,xn.assert)(!this.cancelled,"cancelled","CANCELLED",{})}};Zi.FetchCancelSignal=j0;function L0(r){if(r==null)throw new Error("missing signal; should not happen");return r.checkSignal(),r}var hi=class{#e;#t;#r;#n;#s;#o;#i;#a;#f;#u;#h;#m;#c;#l;#d;get url(){return this.#o}set url(e){this.#o=String(e)}get body(){return this.#i==null?null:new Uint8Array(this.#i)}set body(e){if(e==null)this.#i=void 0,this.#a=void 0;else if(typeof e=="string")this.#i=(0,Cc.toUtf8Bytes)(e),this.#a="text/plain";else if(e instanceof Uint8Array)this.#i=e,this.#a="application/octet-stream";else if(typeof e=="object")this.#i=(0,Cc.toUtf8Bytes)(JSON.stringify(e)),this.#a="application/json";else throw new Error("invalid body")}hasBody(){return this.#i!=null}get method(){return this.#n?this.#n:this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),this.#n=String(e).toUpperCase()}get headers(){let e=Object.assign({},this.#r);return this.#f&&(e.authorization=`Basic ${(0,i8.encodeBase64)((0,Cc.toUtf8Bytes)(this.#f))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&this.#a&&(e["content-type"]=this.#a),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,t){this.#r[String(e).toLowerCase()]=String(t)}clearHeaders(){this.#r={}}[Symbol.iterator](){let e=this.headers,t=Object.keys(e),n=0;return{next:()=>{if(n<t.length){let s=t[n++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return this.#f||null}setCredentials(e,t){(0,xn.assertArgument)(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),this.#f=`${e}:${t}`}get allowGzip(){return this.#t}set allowGzip(e){this.#t=!!e}get allowInsecureAuthentication(){return!!this.#e}set allowInsecureAuthentication(e){this.#e=!!e}get timeout(){return this.#s}set timeout(e){(0,xn.assertArgument)(e>=0,"timeout must be non-zero","timeout",e),this.#s=e}get preflightFunc(){return this.#u||null}set preflightFunc(e){this.#u=e}get processFunc(){return this.#h||null}set processFunc(e){this.#h=e}get retryFunc(){return this.#m||null}set retryFunc(e){this.#m=e}get getUrlFunc(){return this.#d||n8}set getUrlFunc(e){this.#d=e}constructor(e){this.#o=String(e),this.#e=!1,this.#t=!0,this.#r={},this.#n="",this.#s=3e5,this.#l={slotInterval:tN,maxAttempts:eN},this.#d=null}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${this.#i?(0,o8.hexlify)(this.#i):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(this.#l.slotInterval=e.slotInterval),e.maxAttempts!=null&&(this.#l.maxAttempts=e.maxAttempts)}async#p(e,t,n,s,i){if(e>=this.#l.maxAttempts)return i.makeServerError("exceeded maximum retry limit");(0,xn.assert)(s8()<=t,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:s}),n>0&&await iN(n);let o=this.clone(),a=(o.url.split(":")[0]||"").toLowerCase();if(a in M0){let l=await M0[a](o.url,L0(s.#c));if(l instanceof ts){let f=l;if(this.processFunc){L0(s.#c);try{f=await this.processFunc(o,f)}catch(d){(d.throttle==null||typeof d.stall!="number")&&f.makeServerError("error in post-processing function",d).assertOk()}}return f}o=l}this.preflightFunc&&(o=await this.preflightFunc(o));let c=await this.getUrlFunc(o,L0(s.#c)),u=new ts(c.statusCode,c.statusMessage,c.headers,c.body,s);if(u.statusCode===301||u.statusCode===302){try{let l=u.headers.location||"";return o.redirect(l).#p(e+1,t,0,s,u)}catch{}return u}else if(u.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,u,e))){let l=u.headers["retry-after"],f=this.#l.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof l=="string"&&l.match(/^[1-9][0-9]*$/)&&(f=parseInt(l)),o.clone().#p(e+1,t,f,s,u)}if(this.processFunc){L0(s.#c);try{u=await this.processFunc(o,u)}catch(l){(l.throttle==null||typeof l.stall!="number")&&u.makeServerError("error in post-processing function",l).assertOk();let f=this.#l.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return l.stall>=0&&(f=l.stall),o.clone().#p(e+1,t,f,s,u)}}return u}send(){return(0,xn.assert)(this.#c==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#c=new j0(this),this.#p(0,s8()+this.timeout,0,this,new ts(0,"",{},null,this))}cancel(){(0,xn.assert)(this.#c!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});let e=l8.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){let t=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();(0,xn.assert)(this.method==="GET"&&(t!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});let s=new hi(e);return s.method="GET",s.allowGzip=this.allowGzip,s.timeout=this.timeout,s.#r=Object.assign({},this.#r),this.#i&&(s.#i=new Uint8Array(this.#i)),s.#a=this.#a,s}clone(){let e=new hi(this.url);return e.#n=this.#n,this.#i&&(e.#i=this.#i),e.#a=this.#a,e.#r=Object.assign({},this.#r),e.#f=this.#f,this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),e.#u=this.#u,e.#h=this.#h,e.#m=this.#m,e.#l=Object.assign({},this.#l),e.#d=this.#d,e}static lockConfig(){Yx=!0}static getGateway(e){return M0[e.toLowerCase()]||null}static registerGateway(e,t){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(Yx)throw new Error("gateways locked");M0[e]=t}static registerGetUrl(e){if(Yx)throw new Error("gateways locked");n8=e}static createGetUrlFunc(e){return(0,a8.createGetUrl)(e)}static createDataGateway(){return c8}static createIpfsGatewayFunc(e){return u8(e)}};Zi.FetchRequest=hi;var ts=class{#e;#t;#r;#n;#s;#o;toString(){return`<FetchResponse status=${this.statusCode} body=${this.#n?(0,o8.hexlify)(this.#n):"null"}>`}get statusCode(){return this.#e}get statusMessage(){return this.#t}get headers(){return Object.assign({},this.#r)}get body(){return this.#n==null?null:new Uint8Array(this.#n)}get bodyText(){try{return this.#n==null?"":(0,Cc.toUtf8String)(this.#n)}catch{(0,xn.assert)(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{(0,xn.assert)(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){let e=this.headers,t=Object.keys(e),n=0;return{next:()=>{if(n<t.length){let s=t[n++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}constructor(e,t,n,s,i){this.#e=e,this.#t=t,this.#r=Object.keys(n).reduce((o,a)=>(o[a.toLowerCase()]=String(n[a]),o),{}),this.#n=s==null?null:new Uint8Array(s),this.#s=i||null,this.#o={message:""}}makeServerError(e,t){let n;e?n=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:(e=`${this.statusCode} ${this.statusMessage}`,n=`CLIENT ESCALATED SERVER ERROR (${e})`);let s=new ts(599,n,this.headers,this.body,this.#s||void 0);return s.#o={message:e,error:t},s}throwThrottleError(e,t){t==null?t=-1:(0,xn.assertArgument)(Number.isInteger(t)&&t>=0,"invalid stall timeout","stall",t);let n=new Error(e||"throttling requests");throw(0,XC.defineProperties)(n,{stall:t,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return this.#n!=null}get request(){return this.#s}ok(){return this.#o.message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:t}=this.#o;e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let n=null;this.request&&(n=this.request.url);let s=null;try{this.#n&&(s=(0,Cc.toUtf8String)(this.#n))}catch{}(0,xn.assert)(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:t,info:{requestUrl:n,responseBody:s,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};Zi.FetchResponse=ts;function s8(){return new Date().getTime()}function sN(r){return(0,Cc.toUtf8Bytes)(r.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))}function iN(r){return new Promise(e=>setTimeout(e,r))}});var Xx=M(U0=>{"use strict";Object.defineProperty(U0,"__esModule",{value:!0});U0.FixedNumber=void 0;var oN=gn(),Pr=Zn(),Xi=Bc(),aN=Yi(),cN=BigInt(-1),rs=BigInt(0),Ic=BigInt(1),uN=BigInt(5),Nc={},Rc="0000";for(;Rc.length<80;)Rc+=Rc;function Ta(r){let e=Rc;for(;e.length<r;)e+=e;return BigInt("1"+e.substring(0,r))}function cf(r,e,t){let n=BigInt(e.width);if(e.signed){let s=Ic<<n-Ic;(0,Pr.assert)(t==null||r>=-s&&r<s,"overflow","NUMERIC_FAULT",{operation:t,fault:"overflow",value:r}),r>rs?r=(0,Xi.fromTwos)((0,Xi.mask)(r,n),n):r=-(0,Xi.fromTwos)((0,Xi.mask)(-r,n),n)}else{let s=Ic<<n;(0,Pr.assert)(t==null||r>=0&&r<s,"overflow","NUMERIC_FAULT",{operation:t,fault:"overflow",value:r}),r=(r%s+s)%s&s-Ic}return r}function Zx(r){typeof r=="number"&&(r=`fixed128x${r}`);let e=!0,t=128,n=18;if(typeof r=="string"){if(r!=="fixed")if(r==="ufixed")e=!1;else{let i=r.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);(0,Pr.assertArgument)(i,"invalid fixed format","format",r),e=i[1]!=="u",t=parseInt(i[2]),n=parseInt(i[3])}}else if(r){let i=r,o=(a,c,u)=>i[a]==null?u:((0,Pr.assertArgument)(typeof i[a]===c,"invalid fixed format ("+a+" not "+c+")","format."+a,i[a]),i[a]);e=o("signed","boolean",e),t=o("width","number",t),n=o("decimals","number",n)}(0,Pr.assertArgument)(t%8===0,"invalid FixedNumber width (not byte aligned)","format.width",t),(0,Pr.assertArgument)(n<=80,"invalid FixedNumber decimals (too large)","format.decimals",n);let s=(e?"":"u")+"fixed"+String(t)+"x"+String(n);return{signed:e,width:t,decimals:n,name:s}}function lN(r,e){let t="";r<rs&&(t="-",r*=cN);let n=r.toString();if(e===0)return t+n;for(;n.length<=e;)n=Rc+n;let s=n.length-e;for(n=n.substring(0,s)+"."+n.substring(s);n[0]==="0"&&n[1]!==".";)n=n.substring(1);for(;n[n.length-1]==="0"&&n[n.length-2]!==".";)n=n.substring(0,n.length-1);return t+n}var Ss=class{format;#e;#t;#r;_value;constructor(e,t,n){(0,Pr.assertPrivate)(e,Nc,"FixedNumber"),this.#t=t,this.#e=n;let s=lN(t,n.decimals);(0,aN.defineProperties)(this,{format:n.name,_value:s}),this.#r=Ta(n.decimals)}get signed(){return this.#e.signed}get width(){return this.#e.width}get decimals(){return this.#e.decimals}get value(){return this.#t}#n(e){(0,Pr.assertArgument)(this.format===e.format,"incompatible format; use fixedNumber.toFormat","other",e)}#s(e,t){return e=cf(e,this.#e,t),new Ss(Nc,e,this.#e)}#o(e,t){return this.#n(e),this.#s(this.#t+e.#t,t)}addUnsafe(e){return this.#o(e)}add(e){return this.#o(e,"add")}#i(e,t){return this.#n(e),this.#s(this.#t-e.#t,t)}subUnsafe(e){return this.#i(e)}sub(e){return this.#i(e,"sub")}#a(e,t){return this.#n(e),this.#s(this.#t*e.#t/this.#r,t)}mulUnsafe(e){return this.#a(e)}mul(e){return this.#a(e,"mul")}mulSignal(e){this.#n(e);let t=this.#t*e.#t;return(0,Pr.assert)(t%this.#r===rs,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),this.#s(t/this.#r,"mulSignal")}#f(e,t){return(0,Pr.assert)(e.#t!==rs,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#n(e),this.#s(this.#t*this.#r/e.#t,t)}divUnsafe(e){return this.#f(e)}div(e){return this.#f(e,"div")}divSignal(e){(0,Pr.assert)(e.#t!==rs,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#n(e);let t=this.#t*this.#r;return(0,Pr.assert)(t%e.#t===rs,"precision lost during signalling div","NUMERIC_FAULT",{operation:"divSignal",fault:"underflow",value:this}),this.#s(t/e.#t,"divSignal")}cmp(e){let t=this.value,n=e.value,s=this.decimals-e.decimals;return s>0?n*=Ta(s):s<0&&(t*=Ta(-s)),t<n?-1:t>n?1:0}eq(e){return this.cmp(e)===0}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=this.#t;return this.#t<rs&&(e-=this.#r-Ic),e=this.#t/this.#r*this.#r,this.#s(e,"floor")}ceiling(){let e=this.#t;return this.#t>rs&&(e+=this.#r-Ic),e=this.#t/this.#r*this.#r,this.#s(e,"ceiling")}round(e){if(e==null&&(e=0),e>=this.decimals)return this;let t=this.decimals-e,n=uN*Ta(t-1),s=this.value+n,i=Ta(t);return s=s/i*i,cf(s,this.#e,"round"),new Ss(Nc,s,this.#e)}isZero(){return this.#t===rs}isNegative(){return this.#t<rs}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Ss.fromString(this.toString(),e)}static fromValue(e,t,n){let s=t==null?0:(0,Xi.getNumber)(t),i=Zx(n),o=(0,Xi.getBigInt)(e,"value"),a=s-i.decimals;if(a>0){let c=Ta(a);(0,Pr.assert)(o%c===rs,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),o/=c}else a<0&&(o*=Ta(-a));return cf(o,i,"fromValue"),new Ss(Nc,o,i)}static fromString(e,t){let n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);(0,Pr.assertArgument)(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);let s=Zx(t),i=n[2]||"0",o=n[3]||"";for(;o.length<s.decimals;)o+=Rc;(0,Pr.assert)(o.substring(s.decimals).match(/^0*$/),"too many decimals for format","NUMERIC_FAULT",{operation:"fromString",fault:"underflow",value:e}),o=o.substring(0,s.decimals);let a=BigInt(n[1]+i+o);return cf(a,s,"fromString"),new Ss(Nc,a,s)}static fromBytes(e,t){let n=(0,Xi.toBigInt)((0,oN.getBytes)(e,"value")),s=Zx(t);return s.signed&&(n=(0,Xi.fromTwos)(n,s.width)),cf(n,s,"fromBytes"),new Ss(Nc,n,s)}};U0.FixedNumber=Ss});var b8=M(D0=>{"use strict";Object.defineProperty(D0,"__esModule",{value:!0});D0.decodeRlp=void 0;var d8=gn(),F0=Zn(),fN=gn();function dN(r){let e=r.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function p8(r,e,t){let n=0;for(let s=0;s<t;s++)n=n*256+r[e+s];return n}function h8(r,e,t,n){let s=[];for(;t<e+1+n;){let i=m8(r,t);s.push(i.result),t+=i.consumed,(0,F0.assert)(t<=e+1+n,"child data too short","BUFFER_OVERRUN",{buffer:r,length:n,offset:e})}return{consumed:1+n,result:s}}function m8(r,e){(0,F0.assert)(r.length!==0,"data too short","BUFFER_OVERRUN",{buffer:r,length:0,offset:1});let t=n=>{(0,F0.assert)(n<=r.length,"data short segment too short","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n})};if(r[e]>=248){let n=r[e]-247;t(e+1+n);let s=p8(r,e+1,n);return t(e+1+n+s),h8(r,e,e+1+n,n+s)}else if(r[e]>=192){let n=r[e]-192;return t(e+1+n),h8(r,e,e+1,n)}else if(r[e]>=184){let n=r[e]-183;t(e+1+n);let s=p8(r,e+1,n);t(e+1+n+s);let i=(0,d8.hexlify)(r.slice(e+1+n,e+1+n+s));return{consumed:1+n+s,result:i}}else if(r[e]>=128){let n=r[e]-128;t(e+1+n);let s=(0,d8.hexlify)(r.slice(e+1,e+1+n));return{consumed:1+n,result:s}}return{consumed:1,result:dN(r[e])}}function pN(r){let e=(0,fN.getBytes)(r,"data"),t=m8(e,0);return(0,F0.assertArgument)(t.consumed===e.length,"unexpected junk after rlp payload","data",r),t.result}D0.decodeRlp=pN});var w8=M(H0=>{"use strict";Object.defineProperty(H0,"__esModule",{value:!0});H0.encodeRlp=void 0;var hN=gn();function g8(r){let e=[];for(;r;)e.unshift(r&255),r>>=8;return e}function y8(r){if(Array.isArray(r)){let n=[];if(r.forEach(function(i){n=n.concat(y8(i))}),n.length<=55)return n.unshift(192+n.length),n;let s=g8(n.length);return s.unshift(247+s.length),s.concat(n)}let e=Array.prototype.slice.call((0,hN.getBytes)(r,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;let t=g8(e.length);return t.unshift(183+t.length),t.concat(e)}var x8="0123456789abcdef";function mN(r){let e="0x";for(let t of y8(r))e+=x8[t>>4],e+=x8[t&15];return e}H0.encodeRlp=mN});var k8=M(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.parseEther=Os.formatEther=Os.parseUnits=Os.formatUnits=void 0;var ey=Zn(),A8=Xx(),E8=Bc(),v8=["wei","kwei","mwei","gwei","szabo","finney","ether"];function T8(r,e){let t=18;if(typeof e=="string"){let n=v8.indexOf(e);(0,ey.assertArgument)(n>=0,"invalid unit","unit",e),t=3*n}else e!=null&&(t=(0,E8.getNumber)(e,"unit"));return A8.FixedNumber.fromValue(r,t,{decimals:t,width:512}).toString()}Os.formatUnits=T8;function P8(r,e){(0,ey.assertArgument)(typeof r=="string","value must be a string","value",r);let t=18;if(typeof e=="string"){let n=v8.indexOf(e);(0,ey.assertArgument)(n>=0,"invalid unit","unit",e),t=3*n}else e!=null&&(t=(0,E8.getNumber)(e,"unit"));return A8.FixedNumber.fromString(r,{decimals:t,width:512}).value}Os.parseUnits=P8;function bN(r){return T8(r,18)}Os.formatEther=bN;function gN(r){return P8(r,18)}Os.parseEther=gN});var S8=M($0=>{"use strict";Object.defineProperty($0,"__esModule",{value:!0});$0.uuidV4=void 0;var B8=gn();function xN(r){let e=(0,B8.getBytes)(r,"randomBytes");e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=(0,B8.hexlify)(e);return[t.substring(2,10),t.substring(10,14),t.substring(14,18),t.substring(18,22),t.substring(22,34)].join("-")}$0.uuidV4=xN});var me=M(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.toUtf8String=ne.toUtf8CodePoints=ne.toUtf8Bytes=ne.parseUnits=ne.formatUnits=ne.parseEther=ne.formatEther=ne.encodeRlp=ne.decodeRlp=ne.defineProperties=ne.resolveProperties=ne.toQuantity=ne.toBeArray=ne.toBeHex=ne.toNumber=ne.toBigInt=ne.getUint=ne.getNumber=ne.getBigInt=ne.mask=ne.toTwos=ne.fromTwos=ne.FixedNumber=ne.FetchCancelSignal=ne.FetchResponse=ne.FetchRequest=ne.EventPayload=ne.makeError=ne.assertNormalize=ne.assertPrivate=ne.assertArgumentCount=ne.assertArgument=ne.assert=ne.isError=ne.isCallException=ne.zeroPadBytes=ne.zeroPadValue=ne.stripZerosLeft=ne.dataSlice=ne.dataLength=ne.concat=ne.hexlify=ne.isBytesLike=ne.isHexString=ne.getBytesCopy=ne.getBytes=ne.encodeBase64=ne.decodeBase64=ne.encodeBase58=ne.decodeBase58=void 0;ne.uuidV4=ne.Utf8ErrorFuncs=void 0;var O8=W3();Object.defineProperty(ne,"decodeBase58",{enumerable:!0,get:function(){return O8.decodeBase58}});Object.defineProperty(ne,"encodeBase58",{enumerable:!0,get:function(){return O8.encodeBase58}});var _8=Wx();Object.defineProperty(ne,"decodeBase64",{enumerable:!0,get:function(){return _8.decodeBase64}});Object.defineProperty(ne,"encodeBase64",{enumerable:!0,get:function(){return _8.encodeBase64}});var ns=gn();Object.defineProperty(ne,"getBytes",{enumerable:!0,get:function(){return ns.getBytes}});Object.defineProperty(ne,"getBytesCopy",{enumerable:!0,get:function(){return ns.getBytesCopy}});Object.defineProperty(ne,"isHexString",{enumerable:!0,get:function(){return ns.isHexString}});Object.defineProperty(ne,"isBytesLike",{enumerable:!0,get:function(){return ns.isBytesLike}});Object.defineProperty(ne,"hexlify",{enumerable:!0,get:function(){return ns.hexlify}});Object.defineProperty(ne,"concat",{enumerable:!0,get:function(){return ns.concat}});Object.defineProperty(ne,"dataLength",{enumerable:!0,get:function(){return ns.dataLength}});Object.defineProperty(ne,"dataSlice",{enumerable:!0,get:function(){return ns.dataSlice}});Object.defineProperty(ne,"stripZerosLeft",{enumerable:!0,get:function(){return ns.stripZerosLeft}});Object.defineProperty(ne,"zeroPadValue",{enumerable:!0,get:function(){return ns.zeroPadValue}});Object.defineProperty(ne,"zeroPadBytes",{enumerable:!0,get:function(){return ns.zeroPadBytes}});var eo=Zn();Object.defineProperty(ne,"isCallException",{enumerable:!0,get:function(){return eo.isCallException}});Object.defineProperty(ne,"isError",{enumerable:!0,get:function(){return eo.isError}});Object.defineProperty(ne,"assert",{enumerable:!0,get:function(){return eo.assert}});Object.defineProperty(ne,"assertArgument",{enumerable:!0,get:function(){return eo.assertArgument}});Object.defineProperty(ne,"assertArgumentCount",{enumerable:!0,get:function(){return eo.assertArgumentCount}});Object.defineProperty(ne,"assertPrivate",{enumerable:!0,get:function(){return eo.assertPrivate}});Object.defineProperty(ne,"assertNormalize",{enumerable:!0,get:function(){return eo.assertNormalize}});Object.defineProperty(ne,"makeError",{enumerable:!0,get:function(){return eo.makeError}});var yN=Y3();Object.defineProperty(ne,"EventPayload",{enumerable:!0,get:function(){return yN.EventPayload}});var ty=f8();Object.defineProperty(ne,"FetchRequest",{enumerable:!0,get:function(){return ty.FetchRequest}});Object.defineProperty(ne,"FetchResponse",{enumerable:!0,get:function(){return ty.FetchResponse}});Object.defineProperty(ne,"FetchCancelSignal",{enumerable:!0,get:function(){return ty.FetchCancelSignal}});var wN=Xx();Object.defineProperty(ne,"FixedNumber",{enumerable:!0,get:function(){return wN.FixedNumber}});var ss=Bc();Object.defineProperty(ne,"fromTwos",{enumerable:!0,get:function(){return ss.fromTwos}});Object.defineProperty(ne,"toTwos",{enumerable:!0,get:function(){return ss.toTwos}});Object.defineProperty(ne,"mask",{enumerable:!0,get:function(){return ss.mask}});Object.defineProperty(ne,"getBigInt",{enumerable:!0,get:function(){return ss.getBigInt}});Object.defineProperty(ne,"getNumber",{enumerable:!0,get:function(){return ss.getNumber}});Object.defineProperty(ne,"getUint",{enumerable:!0,get:function(){return ss.getUint}});Object.defineProperty(ne,"toBigInt",{enumerable:!0,get:function(){return ss.toBigInt}});Object.defineProperty(ne,"toNumber",{enumerable:!0,get:function(){return ss.toNumber}});Object.defineProperty(ne,"toBeHex",{enumerable:!0,get:function(){return ss.toBeHex}});Object.defineProperty(ne,"toBeArray",{enumerable:!0,get:function(){return ss.toBeArray}});Object.defineProperty(ne,"toQuantity",{enumerable:!0,get:function(){return ss.toQuantity}});var C8=Yi();Object.defineProperty(ne,"resolveProperties",{enumerable:!0,get:function(){return C8.resolveProperties}});Object.defineProperty(ne,"defineProperties",{enumerable:!0,get:function(){return C8.defineProperties}});var AN=b8();Object.defineProperty(ne,"decodeRlp",{enumerable:!0,get:function(){return AN.decodeRlp}});var EN=w8();Object.defineProperty(ne,"encodeRlp",{enumerable:!0,get:function(){return EN.encodeRlp}});var q0=k8();Object.defineProperty(ne,"formatEther",{enumerable:!0,get:function(){return q0.formatEther}});Object.defineProperty(ne,"parseEther",{enumerable:!0,get:function(){return q0.parseEther}});Object.defineProperty(ne,"formatUnits",{enumerable:!0,get:function(){return q0.formatUnits}});Object.defineProperty(ne,"parseUnits",{enumerable:!0,get:function(){return q0.parseUnits}});var G0=R0();Object.defineProperty(ne,"toUtf8Bytes",{enumerable:!0,get:function(){return G0.toUtf8Bytes}});Object.defineProperty(ne,"toUtf8CodePoints",{enumerable:!0,get:function(){return G0.toUtf8CodePoints}});Object.defineProperty(ne,"toUtf8String",{enumerable:!0,get:function(){return G0.toUtf8String}});Object.defineProperty(ne,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return G0.Utf8ErrorFuncs}});var vN=S8();Object.defineProperty(ne,"uuidV4",{enumerable:!0,get:function(){return vN.uuidV4}})});var yn=M(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.Reader=gt.Writer=gt.Coder=gt.checkResultErrors=gt.Result=gt.WordSize=void 0;var Ct=me();gt.WordSize=32;var ry=new Uint8Array(gt.WordSize),TN=["then"],z0={},R8=new WeakMap;function Pa(r){return R8.get(r)}function N8(r,e){R8.set(r,e)}function uf(r,e){let t=new Error(`deferred error during ABI decoding triggered accessing ${r}`);throw t.error=e,t}function ny(r,e,t){return r.indexOf(null)>=0?e.map((n,s)=>n instanceof _s?ny(Pa(n),n,t):n):r.reduce((n,s,i)=>{let o=e.getValue(s);return s in n||(t&&o instanceof _s&&(o=ny(Pa(o),o,t)),n[s]=o),n},{})}var _s=class extends Array{#e;constructor(...e){let t=e[0],n=e[1],s=(e[2]||[]).slice(),i=!0;t!==z0&&(n=e,s=[],i=!1),super(n.length),n.forEach((c,u)=>{this[u]=c});let o=s.reduce((c,u)=>(typeof u=="string"&&c.set(u,(c.get(u)||0)+1),c),new Map);if(N8(this,Object.freeze(n.map((c,u)=>{let l=s[u];return l!=null&&o.get(l)===1?l:null}))),this.#e=[],this.#e==null&&this.#e,!i)return;Object.freeze(this);let a=new Proxy(this,{get:(c,u,l)=>{if(typeof u=="string"){if(u.match(/^[0-9]+$/)){let d=(0,Ct.getNumber)(u,"%index");if(d<0||d>=this.length)throw new RangeError("out of result range");let h=c[d];return h instanceof Error&&uf(`index ${d}`,h),h}if(TN.indexOf(u)>=0)return Reflect.get(c,u,l);let f=c[u];if(f instanceof Function)return function(...d){return f.apply(this===l?c:this,d)};if(!(u in c))return c.getValue.apply(this===l?c:this,[u])}return Reflect.get(c,u,l)}});return N8(a,Pa(this)),a}toArray(e){let t=[];return this.forEach((n,s)=>{n instanceof Error&&uf(`index ${s}`,n),e&&n instanceof _s&&(n=n.toArray(e)),t.push(n)}),t}toObject(e){let t=Pa(this);return t.reduce((n,s,i)=>((0,Ct.assert)(s!=null,`value at index ${i} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),ny(t,this,e)),{})}slice(e,t){e==null&&(e=0),e<0&&(e+=this.length,e<0&&(e=0)),t==null&&(t=this.length),t<0&&(t+=this.length,t<0&&(t=0)),t>this.length&&(t=this.length);let n=Pa(this),s=[],i=[];for(let o=e;o<t;o++)s.push(this[o]),i.push(n[o]);return new _s(z0,s,i)}filter(e,t){let n=Pa(this),s=[],i=[];for(let o=0;o<this.length;o++){let a=this[o];a instanceof Error&&uf(`index ${o}`,a),e.call(t,a,o,this)&&(s.push(a),i.push(n[o]))}return new _s(z0,s,i)}map(e,t){let n=[];for(let s=0;s<this.length;s++){let i=this[s];i instanceof Error&&uf(`index ${s}`,i),n.push(e.call(t,i,s,this))}return n}getValue(e){let t=Pa(this).indexOf(e);if(t===-1)return;let n=this[t];return n instanceof Error&&uf(`property ${JSON.stringify(e)}`,n.error),n}static fromItems(e,t){return new _s(z0,e,t)}};gt.Result=_s;function PN(r){let e=[],t=function(n,s){if(!!Array.isArray(s))for(let i in s){let o=n.slice();o.push(i);try{t(o,s[i])}catch(a){e.push({path:o,error:a})}}};return t([],r),e}gt.checkResultErrors=PN;function I8(r){let e=(0,Ct.toBeArray)(r);return(0,Ct.assert)(e.length<=gt.WordSize,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:gt.WordSize,offset:e.length}),e.length!==gt.WordSize&&(e=(0,Ct.getBytesCopy)((0,Ct.concat)([ry.slice(e.length%gt.WordSize),e]))),e}var sy=class{name;type;localName;dynamic;constructor(e,t,n,s){(0,Ct.defineProperties)(this,{name:e,type:t,localName:n,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,t){(0,Ct.assertArgument)(!1,e,this.localName,t)}};gt.Coder=sy;var iy=class{#e;#t;constructor(){this.#e=[],this.#t=0}get data(){return(0,Ct.concat)(this.#e)}get length(){return this.#t}#r(e){return this.#e.push(e),this.#t+=e.length,e.length}appendWriter(e){return this.#r((0,Ct.getBytesCopy)(e.data))}writeBytes(e){let t=(0,Ct.getBytesCopy)(e),n=t.length%gt.WordSize;return n&&(t=(0,Ct.getBytesCopy)((0,Ct.concat)([t,ry.slice(n)]))),this.#r(t)}writeValue(e){return this.#r(I8(e))}writeUpdatableValue(){let e=this.#e.length;return this.#e.push(ry),this.#t+=gt.WordSize,t=>{this.#e[e]=I8(t)}}};gt.Writer=iy;var lf=class{allowLoose;#e;#t;#r;#n;#s;constructor(e,t,n){(0,Ct.defineProperties)(this,{allowLoose:!!t}),this.#e=(0,Ct.getBytesCopy)(e),this.#r=0,this.#n=null,this.#s=n??1024,this.#t=0}get data(){return(0,Ct.hexlify)(this.#e)}get dataLength(){return this.#e.length}get consumed(){return this.#t}get bytes(){return new Uint8Array(this.#e)}#o(e){if(this.#n)return this.#n.#o(e);this.#r+=e,(0,Ct.assert)(this.#s<1||this.#r<=this.#s*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#s} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:(0,Ct.getBytesCopy)(this.#e),offset:this.#t,length:e,info:{bytesRead:this.#r,dataLength:this.dataLength}})}#i(e,t,n){let s=Math.ceil(t/gt.WordSize)*gt.WordSize;return this.#t+s>this.#e.length&&(this.allowLoose&&n&&this.#t+t<=this.#e.length?s=t:(0,Ct.assert)(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:(0,Ct.getBytesCopy)(this.#e),length:this.#e.length,offset:this.#t+s})),this.#e.slice(this.#t,this.#t+s)}subReader(e){let t=new lf(this.#e.slice(this.#t+e),this.allowLoose,this.#s);return t.#n=this,t}readBytes(e,t){let n=this.#i(0,e,!!t);return this.#o(e),this.#t+=n.length,n.slice(0,e)}readValue(){return(0,Ct.toBigInt)(this.readBytes(gt.WordSize))}readIndex(){return(0,Ct.toNumber)(this.readBytes(gt.WordSize))}};gt.Reader=lf});var Mc=M(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.output=kr.exists=kr.hash=kr.bytes=kr.bool=kr.number=void 0;function V0(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}kr.number=V0;function M8(r){if(typeof r!="boolean")throw new Error(`Expected boolean, not ${r}`)}kr.bool=M8;function oy(r,...e){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(r.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${r.length}`)}kr.bytes=oy;function L8(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");V0(r.outputLen),V0(r.blockLen)}kr.hash=L8;function j8(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}kr.exists=j8;function U8(r,e){oy(r);let t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}kr.output=U8;var kN={number:V0,bool:M8,bytes:oy,hash:L8,exists:j8,output:U8};kr.default=kN});var F8=M(K0=>{"use strict";Object.defineProperty(K0,"__esModule",{value:!0});K0.crypto=void 0;K0.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});var is=M(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.randomBytes=je.wrapXOFConstructorWithOpts=je.wrapConstructorWithOpts=je.wrapConstructor=je.checkOpts=je.Hash=je.concatBytes=je.toBytes=je.utf8ToBytes=je.asyncLoop=je.nextTick=je.hexToBytes=je.bytesToHex=je.isLE=je.rotr=je.createView=je.u32=je.u8=void 0;var ay=F8(),uy=r=>r instanceof Uint8Array,BN=r=>new Uint8Array(r.buffer,r.byteOffset,r.byteLength);je.u8=BN;var SN=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4));je.u32=SN;var ON=r=>new DataView(r.buffer,r.byteOffset,r.byteLength);je.createView=ON;var _N=(r,e)=>r<<32-e|r>>>e;je.rotr=_N;je.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!je.isLE)throw new Error("Non little-endian hardware is not supported");var CN=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function NN(r){if(!uy(r))throw new Error("Uint8Array expected");let e="";for(let t=0;t<r.length;t++)e+=CN[r[t]];return e}je.bytesToHex=NN;function IN(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let e=r.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let t=new Uint8Array(e/2);for(let n=0;n<t.length;n++){let s=n*2,i=r.slice(s,s+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[n]=o}return t}je.hexToBytes=IN;var RN=async()=>{};je.nextTick=RN;async function MN(r,e,t){let n=Date.now();for(let s=0;s<r;s++){t(s);let i=Date.now()-n;i>=0&&i<e||(await(0,je.nextTick)(),n+=i)}}je.asyncLoop=MN;function D8(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}je.utf8ToBytes=D8;function J0(r){if(typeof r=="string"&&(r=D8(r)),!uy(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}je.toBytes=J0;function LN(...r){let e=new Uint8Array(r.reduce((n,s)=>n+s.length,0)),t=0;return r.forEach(n=>{if(!uy(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}je.concatBytes=LN;var cy=class{clone(){return this._cloneInto()}};je.Hash=cy;var jN={}.toString;function UN(r,e){if(e!==void 0&&jN.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(r,e)}je.checkOpts=UN;function FN(r){let e=n=>r().update(J0(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}je.wrapConstructor=FN;function DN(r){let e=(n,s)=>r(s).update(J0(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}je.wrapConstructorWithOpts=DN;function HN(r){let e=(n,s)=>r(s).update(J0(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}je.wrapXOFConstructorWithOpts=HN;function $N(r=32){if(ay.crypto&&typeof ay.crypto.getRandomValues=="function")return ay.crypto.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}je.randomBytes=$N});var Q0=M(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.hmac=ka.HMAC=void 0;var W0=Mc(),H8=is(),ff=class extends H8.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,W0.hash)(e);let n=(0,H8.toBytes)(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let s=this.blockLen,i=new Uint8Array(s);i.set(n.length>s?e.create().update(n).digest():n);for(let o=0;o<i.length;o++)i[o]^=54;this.iHash.update(i),this.oHash=e.create();for(let o=0;o<i.length;o++)i[o]^=106;this.oHash.update(i),i.fill(0)}update(e){return(0,W0.exists)(this),this.iHash.update(e),this}digestInto(e){(0,W0.exists)(this),(0,W0.bytes)(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:n,finished:s,destroyed:i,blockLen:o,outputLen:a}=this;return e=e,e.finished=s,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};ka.HMAC=ff;var qN=(r,e,t)=>new ff(r,e).update(t).digest();ka.hmac=qN;ka.hmac.create=(r,e)=>new ff(r,e)});var ly=M(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.pbkdf2Async=jc.pbkdf2=void 0;var Y0=Mc(),GN=Q0(),Lc=is();function $8(r,e,t,n){(0,Y0.hash)(r);let s=(0,Lc.checkOpts)({dkLen:32,asyncTick:10},n),{c:i,dkLen:o,asyncTick:a}=s;if((0,Y0.number)(i),(0,Y0.number)(o),(0,Y0.number)(a),i<1)throw new Error("PBKDF2: iterations (c) should be >= 1");let c=(0,Lc.toBytes)(e),u=(0,Lc.toBytes)(t),l=new Uint8Array(o),f=GN.hmac.create(r,c),d=f._cloneInto().update(u);return{c:i,dkLen:o,asyncTick:a,DK:l,PRF:f,PRFSalt:d}}function q8(r,e,t,n,s){return r.destroy(),e.destroy(),n&&n.destroy(),s.fill(0),t}function zN(r,e,t,n){let{c:s,dkLen:i,DK:o,PRF:a,PRFSalt:c}=$8(r,e,t,n),u,l=new Uint8Array(4),f=(0,Lc.createView)(l),d=new Uint8Array(a.outputLen);for(let h=1,b=0;b<i;h++,b+=a.outputLen){let p=o.subarray(b,b+a.outputLen);f.setInt32(0,h,!1),(u=c._cloneInto(u)).update(l).digestInto(d),p.set(d.subarray(0,p.length));for(let g=1;g<s;g++){a._cloneInto(u).update(d).digestInto(d);for(let m=0;m<p.length;m++)p[m]^=d[m]}}return q8(a,c,o,u,d)}jc.pbkdf2=zN;async function VN(r,e,t,n){let{c:s,dkLen:i,asyncTick:o,DK:a,PRF:c,PRFSalt:u}=$8(r,e,t,n),l,f=new Uint8Array(4),d=(0,Lc.createView)(f),h=new Uint8Array(c.outputLen);for(let b=1,p=0;p<i;b++,p+=c.outputLen){let g=a.subarray(p,p+c.outputLen);d.setInt32(0,b,!1),(l=u._cloneInto(l)).update(f).digestInto(h),g.set(h.subarray(0,g.length)),await(0,Lc.asyncLoop)(s-1,o,()=>{c._cloneInto(l).update(h).digestInto(h);for(let m=0;m<g.length;m++)g[m]^=h[m]})}return q8(c,u,a,l,h)}jc.pbkdf2Async=VN});var X0=M(Z0=>{"use strict";Object.defineProperty(Z0,"__esModule",{value:!0});Z0.SHA2=void 0;var fy=Mc(),df=is();function KN(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);let s=BigInt(32),i=BigInt(4294967295),o=Number(t>>s&i),a=Number(t&i),c=n?4:0,u=n?0:4;r.setUint32(e+c,o,n),r.setUint32(e+u,a,n)}var dy=class extends df.Hash{constructor(e,t,n,s){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,df.createView)(this.buffer)}update(e){(0,fy.exists)(this);let{view:t,buffer:n,blockLen:s}=this;e=(0,df.toBytes)(e);let i=e.length;for(let o=0;o<i;){let a=Math.min(s-this.pos,i-o);if(a===s){let c=(0,df.createView)(e);for(;s<=i-o;o+=s)this.process(c,o);continue}n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,fy.exists)(this),(0,fy.output)(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:s,isLE:i}=this,{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(n,0),o=0);for(let f=o;f<s;f++)t[f]=0;KN(n,s-8,BigInt(this.length*8),i),this.process(n,0);let a=(0,df.createView)(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let u=c/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)a.setUint32(4*f,l[f],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:n,length:s,finished:i,destroyed:o,pos:a}=this;return e.length=s,e.pos=a,e.finished=i,e.destroyed=o,s%t&&e.buffer.set(n),e}};Z0.SHA2=dy});var tp=M(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.sha224=Uc.sha256=void 0;var JN=X0(),wn=is(),WN=(r,e,t)=>r&e^~r&t,QN=(r,e,t)=>r&e^r&t^e&t,YN=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),to=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ro=new Uint32Array(64),ep=class extends JN.SHA2{constructor(){super(64,32,8,!1),this.A=to[0]|0,this.B=to[1]|0,this.C=to[2]|0,this.D=to[3]|0,this.E=to[4]|0,this.F=to[5]|0,this.G=to[6]|0,this.H=to[7]|0}get(){let{A:e,B:t,C:n,D:s,E:i,F:o,G:a,H:c}=this;return[e,t,n,s,i,o,a,c]}set(e,t,n,s,i,o,a,c){this.A=e|0,this.B=t|0,this.C=n|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,t){for(let f=0;f<16;f++,t+=4)ro[f]=e.getUint32(t,!1);for(let f=16;f<64;f++){let d=ro[f-15],h=ro[f-2],b=(0,wn.rotr)(d,7)^(0,wn.rotr)(d,18)^d>>>3,p=(0,wn.rotr)(h,17)^(0,wn.rotr)(h,19)^h>>>10;ro[f]=p+ro[f-7]+b+ro[f-16]|0}let{A:n,B:s,C:i,D:o,E:a,F:c,G:u,H:l}=this;for(let f=0;f<64;f++){let d=(0,wn.rotr)(a,6)^(0,wn.rotr)(a,11)^(0,wn.rotr)(a,25),h=l+d+WN(a,c,u)+YN[f]+ro[f]|0,p=((0,wn.rotr)(n,2)^(0,wn.rotr)(n,13)^(0,wn.rotr)(n,22))+QN(n,s,i)|0;l=u,u=c,c=a,a=o+h|0,o=i,i=s,s=n,n=h+p|0}n=n+this.A|0,s=s+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(n,s,i,o,a,c,u,l)}roundClean(){ro.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},py=class extends ep{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}};Uc.sha256=(0,wn.wrapConstructor)(()=>new ep);Uc.sha224=(0,wn.wrapConstructor)(()=>new py)});var by=M(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.add5L=Oe.add5H=Oe.add4H=Oe.add4L=Oe.add3H=Oe.add3L=Oe.add=Oe.rotlBL=Oe.rotlBH=Oe.rotlSL=Oe.rotlSH=Oe.rotr32L=Oe.rotr32H=Oe.rotrBL=Oe.rotrBH=Oe.rotrSL=Oe.rotrSH=Oe.shrSL=Oe.shrSH=Oe.toBig=Oe.split=Oe.fromBig=void 0;var rp=BigInt(2**32-1),hy=BigInt(32);function my(r,e=!1){return e?{h:Number(r&rp),l:Number(r>>hy&rp)}:{h:Number(r>>hy&rp)|0,l:Number(r&rp)|0}}Oe.fromBig=my;function G8(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let s=0;s<r.length;s++){let{h:i,l:o}=my(r[s],e);[t[s],n[s]]=[i,o]}return[t,n]}Oe.split=G8;var z8=(r,e)=>BigInt(r>>>0)<<hy|BigInt(e>>>0);Oe.toBig=z8;var V8=(r,e,t)=>r>>>t;Oe.shrSH=V8;var K8=(r,e,t)=>r<<32-t|e>>>t;Oe.shrSL=K8;var J8=(r,e,t)=>r>>>t|e<<32-t;Oe.rotrSH=J8;var W8=(r,e,t)=>r<<32-t|e>>>t;Oe.rotrSL=W8;var Q8=(r,e,t)=>r<<64-t|e>>>t-32;Oe.rotrBH=Q8;var Y8=(r,e,t)=>r>>>t-32|e<<64-t;Oe.rotrBL=Y8;var Z8=(r,e)=>e;Oe.rotr32H=Z8;var X8=(r,e)=>r;Oe.rotr32L=X8;var e5=(r,e,t)=>r<<t|e>>>32-t;Oe.rotlSH=e5;var t5=(r,e,t)=>e<<t|r>>>32-t;Oe.rotlSL=t5;var r5=(r,e,t)=>e<<t-32|r>>>64-t;Oe.rotlBH=r5;var n5=(r,e,t)=>r<<t-32|e>>>64-t;Oe.rotlBL=n5;function s5(r,e,t,n){let s=(e>>>0)+(n>>>0);return{h:r+t+(s/2**32|0)|0,l:s|0}}Oe.add=s5;var i5=(r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0);Oe.add3L=i5;var o5=(r,e,t,n)=>e+t+n+(r/2**32|0)|0;Oe.add3H=o5;var a5=(r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0);Oe.add4L=a5;var c5=(r,e,t,n,s)=>e+t+n+s+(r/2**32|0)|0;Oe.add4H=c5;var u5=(r,e,t,n,s)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(s>>>0);Oe.add5L=u5;var l5=(r,e,t,n,s,i)=>e+t+n+s+i+(r/2**32|0)|0;Oe.add5H=l5;var ZN={fromBig:my,split:G8,toBig:z8,shrSH:V8,shrSL:K8,rotrSH:J8,rotrSL:W8,rotrBH:Q8,rotrBL:Y8,rotr32H:Z8,rotr32L:X8,rotlSH:e5,rotlSL:t5,rotlBH:r5,rotlBL:n5,add:s5,add3L:i5,add3H:o5,add4L:a5,add4H:c5,add5H:l5,add5L:u5};Oe.default=ZN});var f5=M(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.sha384=An.sha512_256=An.sha512_224=An.sha512=An.SHA512=void 0;var XN=X0(),Ue=by(),np=is(),[eI,tI]=(()=>Ue.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))))(),no=new Uint32Array(80),so=new Uint32Array(80),Ba=class extends XN.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:t,Bh:n,Bl:s,Ch:i,Cl:o,Dh:a,Dl:c,Eh:u,El:l,Fh:f,Fl:d,Gh:h,Gl:b,Hh:p,Hl:g}=this;return[e,t,n,s,i,o,a,c,u,l,f,d,h,b,p,g]}set(e,t,n,s,i,o,a,c,u,l,f,d,h,b,p,g){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=s|0,this.Ch=i|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=l|0,this.Fh=f|0,this.Fl=d|0,this.Gh=h|0,this.Gl=b|0,this.Hh=p|0,this.Hl=g|0}process(e,t){for(let E=0;E<16;E++,t+=4)no[E]=e.getUint32(t),so[E]=e.getUint32(t+=4);for(let E=16;E<80;E++){let v=no[E-15]|0,k=so[E-15]|0,w=Ue.default.rotrSH(v,k,1)^Ue.default.rotrSH(v,k,8)^Ue.default.shrSH(v,k,7),P=Ue.default.rotrSL(v,k,1)^Ue.default.rotrSL(v,k,8)^Ue.default.shrSL(v,k,7),B=no[E-2]|0,Z=so[E-2]|0,_=Ue.default.rotrSH(B,Z,19)^Ue.default.rotrBH(B,Z,61)^Ue.default.shrSH(B,Z,6),O=Ue.default.rotrSL(B,Z,19)^Ue.default.rotrBL(B,Z,61)^Ue.default.shrSL(B,Z,6),S=Ue.default.add4L(P,O,so[E-7],so[E-16]),F=Ue.default.add4H(S,w,_,no[E-7],no[E-16]);no[E]=F|0,so[E]=S|0}let{Ah:n,Al:s,Bh:i,Bl:o,Ch:a,Cl:c,Dh:u,Dl:l,Eh:f,El:d,Fh:h,Fl:b,Gh:p,Gl:g,Hh:m,Hl:y}=this;for(let E=0;E<80;E++){let v=Ue.default.rotrSH(f,d,14)^Ue.default.rotrSH(f,d,18)^Ue.default.rotrBH(f,d,41),k=Ue.default.rotrSL(f,d,14)^Ue.default.rotrSL(f,d,18)^Ue.default.rotrBL(f,d,41),w=f&h^~f&p,P=d&b^~d&g,B=Ue.default.add5L(y,k,P,tI[E],so[E]),Z=Ue.default.add5H(B,m,v,w,eI[E],no[E]),_=B|0,O=Ue.default.rotrSH(n,s,28)^Ue.default.rotrBH(n,s,34)^Ue.default.rotrBH(n,s,39),S=Ue.default.rotrSL(n,s,28)^Ue.default.rotrBL(n,s,34)^Ue.default.rotrBL(n,s,39),F=n&i^n&a^i&a,G=s&o^s&c^o&c;m=p|0,y=g|0,p=h|0,g=b|0,h=f|0,b=d|0,{h:f,l:d}=Ue.default.add(u|0,l|0,Z|0,_|0),u=a|0,l=c|0,a=i|0,c=o|0,i=n|0,o=s|0;let R=Ue.default.add3L(_,S,G);n=Ue.default.add3H(R,Z,O,F),s=R|0}({h:n,l:s}=Ue.default.add(this.Ah|0,this.Al|0,n|0,s|0)),{h:i,l:o}=Ue.default.add(this.Bh|0,this.Bl|0,i|0,o|0),{h:a,l:c}=Ue.default.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l}=Ue.default.add(this.Dh|0,this.Dl|0,u|0,l|0),{h:f,l:d}=Ue.default.add(this.Eh|0,this.El|0,f|0,d|0),{h,l:b}=Ue.default.add(this.Fh|0,this.Fl|0,h|0,b|0),{h:p,l:g}=Ue.default.add(this.Gh|0,this.Gl|0,p|0,g|0),{h:m,l:y}=Ue.default.add(this.Hh|0,this.Hl|0,m|0,y|0),this.set(n,s,i,o,a,c,u,l,f,d,h,b,p,g,m,y)}roundClean(){no.fill(0),so.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};An.SHA512=Ba;var gy=class extends Ba{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}},xy=class extends Ba{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},yy=class extends Ba{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}};An.sha512=(0,np.wrapConstructor)(()=>new Ba);An.sha512_224=(0,np.wrapConstructor)(()=>new gy);An.sha512_256=(0,np.wrapConstructor)(()=>new xy);An.sha384=(0,np.wrapConstructor)(()=>new yy)});var hf=M(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.randomBytes=Cs.pbkdf2Sync=Cs.createHmac=Cs.createHash=void 0;var rI=Q0(),nI=ly(),wy=tp(),Ay=f5(),pf=me();function sI(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}var d5=sI(),p5=d5.crypto||d5.msCrypto;function iI(r){switch(r){case"sha256":return wy.sha256.create();case"sha512":return Ay.sha512.create()}(0,pf.assertArgument)(!1,"invalid hashing algorithm name","algorithm",r)}Cs.createHash=iI;function oI(r,e){let t={sha256:wy.sha256,sha512:Ay.sha512}[r];return(0,pf.assertArgument)(t!=null,"invalid hmac algorithm","algorithm",r),rI.hmac.create(t,e)}Cs.createHmac=oI;function aI(r,e,t,n,s){let i={sha256:wy.sha256,sha512:Ay.sha512}[s];return(0,pf.assertArgument)(i!=null,"invalid pbkdf2 algorithm","algorithm",s),(0,nI.pbkdf2)(i,r,e,{c:t,dkLen:n})}Cs.pbkdf2Sync=aI;function cI(r){(0,pf.assert)(p5!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),(0,pf.assertArgument)(Number.isInteger(r)&&r>0&&r<=1024,"invalid length","length",r);let e=new Uint8Array(r);return p5.getRandomValues(e),e}Cs.randomBytes=cI});var g5=M(sp=>{"use strict";Object.defineProperty(sp,"__esModule",{value:!0});sp.computeHmac=void 0;var uI=hf(),Ey=me(),h5=!1,m5=function(r,e,t){return(0,uI.createHmac)(r,e).update(t).digest()},b5=m5;function mf(r,e,t){let n=(0,Ey.getBytes)(e,"key"),s=(0,Ey.getBytes)(t,"data");return(0,Ey.hexlify)(b5(r,n,s))}sp.computeHmac=mf;mf._=m5;mf.lock=function(){h5=!0};mf.register=function(r){if(h5)throw new Error("computeHmac is locked");b5=r};Object.freeze(mf)});var P5=M(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.shake256=dt.shake128=dt.keccak_512=dt.keccak_384=dt.keccak_256=dt.keccak_224=dt.sha3_512=dt.sha3_384=dt.sha3_256=dt.sha3_224=dt.Keccak=dt.keccakP=void 0;var Fc=Mc(),xf=by(),gf=is(),[w5,A5,E5]=[[],[],[]],lI=BigInt(0),bf=BigInt(1),fI=BigInt(2),dI=BigInt(7),pI=BigInt(256),hI=BigInt(113);for(let r=0,e=bf,t=1,n=0;r<24;r++){[t,n]=[n,(2*t+3*n)%5],w5.push(2*(5*n+t)),A5.push((r+1)*(r+2)/2%64);let s=lI;for(let i=0;i<7;i++)e=(e<<bf^(e>>dI)*hI)%pI,e&fI&&(s^=bf<<(bf<<BigInt(i))-bf);E5.push(s)}var[mI,bI]=(0,xf.split)(E5,!0),x5=(r,e,t)=>t>32?(0,xf.rotlBH)(r,e,t):(0,xf.rotlSH)(r,e,t),y5=(r,e,t)=>t>32?(0,xf.rotlBL)(r,e,t):(0,xf.rotlSL)(r,e,t);function v5(r,e=24){let t=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)t[o]=r[o]^r[o+10]^r[o+20]^r[o+30]^r[o+40];for(let o=0;o<10;o+=2){let a=(o+8)%10,c=(o+2)%10,u=t[c],l=t[c+1],f=x5(u,l,1)^t[a],d=y5(u,l,1)^t[a+1];for(let h=0;h<50;h+=10)r[o+h]^=f,r[o+h+1]^=d}let s=r[2],i=r[3];for(let o=0;o<24;o++){let a=A5[o],c=x5(s,i,a),u=y5(s,i,a),l=w5[o];s=r[l],i=r[l+1],r[l]=c,r[l+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)t[a]=r[o+a];for(let a=0;a<10;a++)r[o+a]^=~t[(a+2)%10]&t[(a+4)%10]}r[0]^=mI[n],r[1]^=bI[n]}t.fill(0)}dt.keccakP=v5;var Sa=class extends gf.Hash{constructor(e,t,n,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,Fc.number)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,gf.u32)(this.state)}keccak(){v5(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){(0,Fc.exists)(this);let{blockLen:t,state:n}=this;e=(0,gf.toBytes)(e);let s=e.length;for(let i=0;i<s;){let o=Math.min(t-this.pos,s-i);for(let a=0;a<o;a++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:s}=this;e[n]^=t,(t&128)!==0&&n===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){(0,Fc.exists)(this,!1),(0,Fc.bytes)(e),this.finish();let t=this.state,{blockLen:n}=this;for(let s=0,i=e.length;s<i;){this.posOut>=n&&this.keccak();let o=Math.min(n-this.posOut,i-s);e.set(t.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,Fc.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,Fc.output)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:n,outputLen:s,rounds:i,enableXOF:o}=this;return e||(e=new Sa(t,n,s,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}};dt.Keccak=Sa;var io=(r,e,t)=>(0,gf.wrapConstructor)(()=>new Sa(e,r,t));dt.sha3_224=io(6,144,224/8);dt.sha3_256=io(6,136,256/8);dt.sha3_384=io(6,104,384/8);dt.sha3_512=io(6,72,512/8);dt.keccak_224=io(1,144,224/8);dt.keccak_256=io(1,136,256/8);dt.keccak_384=io(1,104,384/8);dt.keccak_512=io(1,72,512/8);var T5=(r,e,t)=>(0,gf.wrapXOFConstructorWithOpts)((n={})=>new Sa(e,r,n.dkLen===void 0?t:n.dkLen,!0));dt.shake128=T5(31,168,128/8);dt.shake256=T5(31,136,256/8)});var _5=M(ip=>{"use strict";Object.defineProperty(ip,"__esModule",{value:!0});ip.keccak256=void 0;var gI=P5(),k5=me(),B5=!1,S5=function(r){return(0,gI.keccak_256)(r)},O5=S5;function yf(r){let e=(0,k5.getBytes)(r,"data");return(0,k5.hexlify)(O5(e))}ip.keccak256=yf;yf._=S5;yf.lock=function(){B5=!0};yf.register=function(r){if(B5)throw new TypeError("keccak256 is locked");O5=r};Object.freeze(yf)});var R5=M(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.ripemd160=Dc.RIPEMD160=void 0;var xI=X0(),yI=is(),wI=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),N5=Uint8Array.from({length:16},(r,e)=>e),AI=N5.map(r=>(9*r+5)%16),vy=[N5],Ty=[AI];for(let r=0;r<4;r++)for(let e of[vy,Ty])e.push(e[r].map(t=>wI[t]));var I5=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(r=>new Uint8Array(r)),EI=vy.map((r,e)=>r.map(t=>I5[e][t])),vI=Ty.map((r,e)=>r.map(t=>I5[e][t])),TI=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),PI=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),op=(r,e)=>r<<e|r>>>32-e;function C5(r,e,t,n){return r===0?e^t^n:r===1?e&t|~e&n:r===2?(e|~t)^n:r===3?e&n|t&~n:e^(t|~n)}var ap=new Uint32Array(16),cp=class extends xI.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:e,h1:t,h2:n,h3:s,h4:i}=this;return[e,t,n,s,i]}set(e,t,n,s,i){this.h0=e|0,this.h1=t|0,this.h2=n|0,this.h3=s|0,this.h4=i|0}process(e,t){for(let h=0;h<16;h++,t+=4)ap[h]=e.getUint32(t,!0);let n=this.h0|0,s=n,i=this.h1|0,o=i,a=this.h2|0,c=a,u=this.h3|0,l=u,f=this.h4|0,d=f;for(let h=0;h<5;h++){let b=4-h,p=TI[h],g=PI[h],m=vy[h],y=Ty[h],E=EI[h],v=vI[h];for(let k=0;k<16;k++){let w=op(n+C5(h,i,a,u)+ap[m[k]]+p,E[k])+f|0;n=f,f=u,u=op(a,10)|0,a=i,i=w}for(let k=0;k<16;k++){let w=op(s+C5(b,o,c,l)+ap[y[k]]+g,v[k])+d|0;s=d,d=l,l=op(c,10)|0,c=o,o=w}}this.set(this.h1+a+l|0,this.h2+u+d|0,this.h3+f+s|0,this.h4+n+o|0,this.h0+i+c|0)}roundClean(){ap.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}};Dc.RIPEMD160=cp;Dc.ripemd160=(0,yI.wrapConstructor)(()=>new cp)});var F5=M(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});up.ripemd160=void 0;var kI=R5(),M5=me(),L5=!1,j5=function(r){return(0,kI.ripemd160)(r)},U5=j5;function wf(r){let e=(0,M5.getBytes)(r,"data");return(0,M5.hexlify)(U5(e))}up.ripemd160=wf;wf._=j5;wf.lock=function(){L5=!0};wf.register=function(r){if(L5)throw new TypeError("ripemd160 is locked");U5=r};Object.freeze(wf)});var q5=M(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});lp.pbkdf2=void 0;var BI=hf(),Py=me(),D5=!1,H5=function(r,e,t,n,s){return(0,BI.pbkdf2Sync)(r,e,t,n,s)},$5=H5;function Af(r,e,t,n,s){let i=(0,Py.getBytes)(r,"password"),o=(0,Py.getBytes)(e,"salt");return(0,Py.hexlify)($5(i,o,t,n,s))}lp.pbkdf2=Af;Af._=H5;Af.lock=function(){D5=!0};Af.register=function(r){if(D5)throw new Error("pbkdf2 is locked");$5=r};Object.freeze(Af)});var K5=M(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});fp.randomBytes=void 0;var SI=hf(),G5=!1,z5=function(r){return new Uint8Array((0,SI.randomBytes)(r))},V5=z5;function Ef(r){return V5(r)}fp.randomBytes=Ef;Ef._=z5;Ef.lock=function(){G5=!0};Ef.register=function(r){if(G5)throw new Error("randomBytes is locked");V5=r};Object.freeze(Ef)});var X5=M(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});Gc.scryptAsync=Gc.scrypt=void 0;var Hc=Mc(),W5=tp(),Q5=ly(),$c=is(),Qe=(r,e)=>r<<e|r>>>32-e;function J5(r,e,t,n,s,i){let o=r[e++]^t[n++],a=r[e++]^t[n++],c=r[e++]^t[n++],u=r[e++]^t[n++],l=r[e++]^t[n++],f=r[e++]^t[n++],d=r[e++]^t[n++],h=r[e++]^t[n++],b=r[e++]^t[n++],p=r[e++]^t[n++],g=r[e++]^t[n++],m=r[e++]^t[n++],y=r[e++]^t[n++],E=r[e++]^t[n++],v=r[e++]^t[n++],k=r[e++]^t[n++],w=o,P=a,B=c,Z=u,_=l,O=f,S=d,F=h,G=b,R=p,L=g,Y=m,oe=y,fe=E,K=v,ae=k;for(let q=0;q<8;q+=2)_^=Qe(w+oe|0,7),G^=Qe(_+w|0,9),oe^=Qe(G+_|0,13),w^=Qe(oe+G|0,18),R^=Qe(O+P|0,7),fe^=Qe(R+O|0,9),P^=Qe(fe+R|0,13),O^=Qe(P+fe|0,18),K^=Qe(L+S|0,7),B^=Qe(K+L|0,9),S^=Qe(B+K|0,13),L^=Qe(S+B|0,18),Z^=Qe(ae+Y|0,7),F^=Qe(Z+ae|0,9),Y^=Qe(F+Z|0,13),ae^=Qe(Y+F|0,18),P^=Qe(w+Z|0,7),B^=Qe(P+w|0,9),Z^=Qe(B+P|0,13),w^=Qe(Z+B|0,18),S^=Qe(O+_|0,7),F^=Qe(S+O|0,9),_^=Qe(F+S|0,13),O^=Qe(_+F|0,18),Y^=Qe(L+R|0,7),G^=Qe(Y+L|0,9),R^=Qe(G+Y|0,13),L^=Qe(R+G|0,18),oe^=Qe(ae+K|0,7),fe^=Qe(oe+ae|0,9),K^=Qe(fe+oe|0,13),ae^=Qe(K+fe|0,18);s[i++]=o+w|0,s[i++]=a+P|0,s[i++]=c+B|0,s[i++]=u+Z|0,s[i++]=l+_|0,s[i++]=f+O|0,s[i++]=d+S|0,s[i++]=h+F|0,s[i++]=b+G|0,s[i++]=p+R|0,s[i++]=g+L|0,s[i++]=m+Y|0,s[i++]=y+oe|0,s[i++]=E+fe|0,s[i++]=v+K|0,s[i++]=k+ae|0}function qc(r,e,t,n,s){let i=n+0,o=n+16*s;for(let a=0;a<16;a++)t[o+a]=r[e+(2*s-1)*16+a];for(let a=0;a<s;a++,i+=16,e+=16)J5(t,o,r,e,t,i),a>0&&(o+=16),J5(t,i,r,e+=16,t,o)}function Y5(r,e,t){let n=(0,$c.checkOpts)({dkLen:32,asyncTick:10,maxmem:1073742848},t),{N:s,r:i,p:o,dkLen:a,asyncTick:c,maxmem:u,onProgress:l}=n;if((0,Hc.number)(s),(0,Hc.number)(i),(0,Hc.number)(o),(0,Hc.number)(a),(0,Hc.number)(c),(0,Hc.number)(u),l!==void 0&&typeof l!="function")throw new Error("progressCb should be function");let f=128*i,d=f/4;if(s<=1||(s&s-1)!==0||s>=2**(f/8)||s>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(o<0||o>(2**32-1)*32/f)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(a<0||a>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");let h=f*(s+o);if(h>u)throw new Error(`Scrypt: parameters too large, ${h} (128 * r * (N + p)) > ${u} (maxmem)`);let b=(0,Q5.pbkdf2)(W5.sha256,r,e,{c:1,dkLen:f*o}),p=(0,$c.u32)(b),g=(0,$c.u32)(new Uint8Array(f*s)),m=(0,$c.u32)(new Uint8Array(f)),y=()=>{};if(l){let E=2*s*o,v=Math.max(Math.floor(E/1e4),1),k=0;y=()=>{k++,l&&(!(k%v)||k===E)&&l(k/E)}}return{N:s,r:i,p:o,dkLen:a,blockSize32:d,V:g,B32:p,B:b,tmp:m,blockMixCb:y,asyncTick:c}}function Z5(r,e,t,n,s){let i=(0,Q5.pbkdf2)(W5.sha256,r,t,{c:1,dkLen:e});return t.fill(0),n.fill(0),s.fill(0),i}function OI(r,e,t){let{N:n,r:s,p:i,dkLen:o,blockSize32:a,V:c,B32:u,B:l,tmp:f,blockMixCb:d}=Y5(r,e,t);for(let h=0;h<i;h++){let b=a*h;for(let p=0;p<a;p++)c[p]=u[b+p];for(let p=0,g=0;p<n-1;p++)qc(c,g,c,g+=a,s),d();qc(c,(n-1)*a,u,b,s),d();for(let p=0;p<n;p++){let g=u[b+a-16]%n;for(let m=0;m<a;m++)f[m]=u[b+m]^c[g*a+m];qc(f,0,u,b,s),d()}}return Z5(r,o,l,c,f)}Gc.scrypt=OI;async function _I(r,e,t){let{N:n,r:s,p:i,dkLen:o,blockSize32:a,V:c,B32:u,B:l,tmp:f,blockMixCb:d,asyncTick:h}=Y5(r,e,t);for(let b=0;b<i;b++){let p=a*b;for(let m=0;m<a;m++)c[m]=u[p+m];let g=0;await(0,$c.asyncLoop)(n-1,h,()=>{qc(c,g,c,g+=a,s),d()}),qc(c,(n-1)*a,u,p,s),d(),await(0,$c.asyncLoop)(n,h,()=>{let m=u[p+a-16]%n;for(let y=0;y<a;y++)f[y]=u[p+y]^c[m*a+y];qc(f,0,u,p,s),d()})}return Z5(r,o,l,c,f)}Gc.scryptAsync=_I});var a4=M(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.scryptSync=Vc.scrypt=void 0;var e4=X5(),zc=me(),t4=!1,r4=!1,n4=async function(r,e,t,n,s,i,o){return await(0,e4.scryptAsync)(r,e,{N:t,r:n,p:s,dkLen:i,onProgress:o})},s4=function(r,e,t,n,s,i){return(0,e4.scrypt)(r,e,{N:t,r:n,p:s,dkLen:i})},i4=n4,o4=s4;async function vf(r,e,t,n,s,i,o){let a=(0,zc.getBytes)(r,"passwd"),c=(0,zc.getBytes)(e,"salt");return(0,zc.hexlify)(await i4(a,c,t,n,s,i,o))}Vc.scrypt=vf;vf._=n4;vf.lock=function(){r4=!0};vf.register=function(r){if(r4)throw new Error("scrypt is locked");i4=r};Object.freeze(vf);function Tf(r,e,t,n,s,i){let o=(0,zc.getBytes)(r,"passwd"),a=(0,zc.getBytes)(e,"salt");return(0,zc.hexlify)(o4(o,a,t,n,s,i))}Vc.scryptSync=Tf;Tf._=s4;Tf.lock=function(){t4=!0};Tf.register=function(r){if(t4)throw new Error("scryptSync is locked");o4=r};Object.freeze(Tf)});var m4=M(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});Kc.sha512=Kc.sha256=void 0;var c4=hf(),dp=me(),u4=function(r){return(0,c4.createHash)("sha256").update(r).digest()},l4=function(r){return(0,c4.createHash)("sha512").update(r).digest()},f4=u4,d4=l4,p4=!1,h4=!1;function Jc(r){let e=(0,dp.getBytes)(r,"data");return(0,dp.hexlify)(f4(e))}Kc.sha256=Jc;Jc._=u4;Jc.lock=function(){p4=!0};Jc.register=function(r){if(p4)throw new Error("sha256 is locked");f4=r};Object.freeze(Jc);function pp(r){let e=(0,dp.getBytes)(r,"data");return(0,dp.hexlify)(d4(e))}Kc.sha512=pp;pp._=l4;pp.lock=function(){h4=!0};pp.register=function(r){if(h4)throw new Error("sha512 is locked");d4=r};Object.freeze(Jc)});var Oa=M(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.validateObject=Fe.createHmacDrbg=Fe.bitMask=Fe.bitSet=Fe.bitGet=Fe.bitLen=Fe.utf8ToBytes=Fe.equalBytes=Fe.concatBytes=Fe.ensureBytes=Fe.numberToVarBytesBE=Fe.numberToBytesLE=Fe.numberToBytesBE=Fe.bytesToNumberLE=Fe.bytesToNumberBE=Fe.hexToBytes=Fe.hexToNumber=Fe.numberToHexUnpadded=Fe.bytesToHex=void 0;var g4=BigInt(0),hp=BigInt(1),CI=BigInt(2),mp=r=>r instanceof Uint8Array,NI=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function By(r){if(!mp(r))throw new Error("Uint8Array expected");let e="";for(let t=0;t<r.length;t++)e+=NI[r[t]];return e}Fe.bytesToHex=By;function x4(r){let e=r.toString(16);return e.length&1?`0${e}`:e}Fe.numberToHexUnpadded=x4;function Sy(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}Fe.hexToNumber=Sy;function bp(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let e=r.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let t=new Uint8Array(e/2);for(let n=0;n<t.length;n++){let s=n*2,i=r.slice(s,s+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[n]=o}return t}Fe.hexToBytes=bp;function II(r){return Sy(By(r))}Fe.bytesToNumberBE=II;function RI(r){if(!mp(r))throw new Error("Uint8Array expected");return Sy(By(Uint8Array.from(r).reverse()))}Fe.bytesToNumberLE=RI;function y4(r,e){return bp(r.toString(16).padStart(e*2,"0"))}Fe.numberToBytesBE=y4;function MI(r,e){return y4(r,e).reverse()}Fe.numberToBytesLE=MI;function LI(r){return bp(x4(r))}Fe.numberToVarBytesBE=LI;function jI(r,e,t){let n;if(typeof e=="string")try{n=bp(e)}catch(i){throw new Error(`${r} must be valid hex string, got "${e}". Cause: ${i}`)}else if(mp(e))n=Uint8Array.from(e);else throw new Error(`${r} must be hex string or Uint8Array`);let s=n.length;if(typeof t=="number"&&s!==t)throw new Error(`${r} expected ${t} bytes, got ${s}`);return n}Fe.ensureBytes=jI;function w4(...r){let e=new Uint8Array(r.reduce((n,s)=>n+s.length,0)),t=0;return r.forEach(n=>{if(!mp(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}Fe.concatBytes=w4;function UI(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}Fe.equalBytes=UI;function FI(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}Fe.utf8ToBytes=FI;function DI(r){let e;for(e=0;r>g4;r>>=hp,e+=1);return e}Fe.bitLen=DI;function HI(r,e){return r>>BigInt(e)&hp}Fe.bitGet=HI;var $I=(r,e,t)=>r|(t?hp:g4)<<BigInt(e);Fe.bitSet=$I;var qI=r=>(CI<<BigInt(r-1))-hp;Fe.bitMask=qI;var ky=r=>new Uint8Array(r),b4=r=>Uint8Array.from(r);function GI(r,e,t){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let n=ky(r),s=ky(r),i=0,o=()=>{n.fill(1),s.fill(0),i=0},a=(...f)=>t(s,n,...f),c=(f=ky())=>{s=a(b4([0]),f),n=a(),f.length!==0&&(s=a(b4([1]),f),n=a())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let f=0,d=[];for(;f<e;){n=a();let h=n.slice();d.push(h),f+=n.length}return w4(...d)};return(f,d)=>{o(),c(f);let h;for(;!(h=d(u()));)c();return o(),h}}Fe.createHmacDrbg=GI;var zI={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||r instanceof Uint8Array,isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function VI(r,e,t={}){let n=(s,i,o)=>{let a=zI[i];if(typeof a!="function")throw new Error(`Invalid validator "${i}", expected function`);let c=r[s];if(!(o&&c===void 0)&&!a(c,r))throw new Error(`Invalid param ${String(s)}=${c} (${typeof c}), expected ${i}`)};for(let[s,i]of Object.entries(e))n(s,i,!1);for(let[s,i]of Object.entries(t))n(s,i,!0);return r}Fe.validateObject=VI});var Pf=M(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.mapHashToField=Me.getMinHashLength=Me.getFieldBytesLength=Me.hashToPrivateScalar=Me.FpSqrtEven=Me.FpSqrtOdd=Me.Field=Me.nLength=Me.FpIsSquare=Me.FpDiv=Me.FpInvertBatch=Me.FpPow=Me.validateField=Me.isNegativeLE=Me.FpSqrt=Me.tonelliShanks=Me.invert=Me.pow2=Me.pow=Me.mod=void 0;var sn=Oa(),Jt=BigInt(0),ct=BigInt(1),oo=BigInt(2),KI=BigInt(3),Oy=BigInt(4),A4=BigInt(5),E4=BigInt(8),JI=BigInt(9),WI=BigInt(16);function nn(r,e){let t=r%e;return t>=Jt?t:e+t}Me.mod=nn;function v4(r,e,t){if(t<=Jt||e<Jt)throw new Error("Expected power/modulo > 0");if(t===ct)return Jt;let n=ct;for(;e>Jt;)e&ct&&(n=n*r%t),r=r*r%t,e>>=ct;return n}Me.pow=v4;function QI(r,e,t){let n=r;for(;e-- >Jt;)n*=n,n%=t;return n}Me.pow2=QI;function gp(r,e){if(r===Jt||e<=Jt)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let t=nn(r,e),n=e,s=Jt,i=ct,o=ct,a=Jt;for(;t!==Jt;){let u=n/t,l=n%t,f=s-o*u,d=i-a*u;n=t,t=l,s=o,i=a,o=f,a=d}if(n!==ct)throw new Error("invert: does not exist");return nn(s,e)}Me.invert=gp;function T4(r){let e=(r-ct)/oo,t,n,s;for(t=r-ct,n=0;t%oo===Jt;t/=oo,n++);for(s=oo;s<r&&v4(s,e,r)!==r-ct;s++);if(n===1){let o=(r+ct)/Oy;return function(c,u){let l=c.pow(u,o);if(!c.eql(c.sqr(l),u))throw new Error("Cannot find square root");return l}}let i=(t+ct)/oo;return function(a,c){if(a.pow(c,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let u=n,l=a.pow(a.mul(a.ONE,s),t),f=a.pow(c,i),d=a.pow(c,t);for(;!a.eql(d,a.ONE);){if(a.eql(d,a.ZERO))return a.ZERO;let h=1;for(let p=a.sqr(d);h<u&&!a.eql(p,a.ONE);h++)p=a.sqr(p);let b=a.pow(l,ct<<BigInt(u-h-1));l=a.sqr(b),f=a.mul(f,b),d=a.mul(d,l),u=h}return f}}Me.tonelliShanks=T4;function P4(r){if(r%Oy===KI){let e=(r+ct)/Oy;return function(n,s){let i=n.pow(s,e);if(!n.eql(n.sqr(i),s))throw new Error("Cannot find square root");return i}}if(r%E4===A4){let e=(r-A4)/E4;return function(n,s){let i=n.mul(s,oo),o=n.pow(i,e),a=n.mul(s,o),c=n.mul(n.mul(a,oo),o),u=n.mul(a,n.sub(c,n.ONE));if(!n.eql(n.sqr(u),s))throw new Error("Cannot find square root");return u}}return r%WI,T4(r)}Me.FpSqrt=P4;var YI=(r,e)=>(nn(r,e)&ct)===ct;Me.isNegativeLE=YI;var ZI=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function XI(r){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=ZI.reduce((n,s)=>(n[s]="function",n),e);return(0,sn.validateObject)(r,t)}Me.validateField=XI;function k4(r,e,t){if(t<Jt)throw new Error("Expected power > 0");if(t===Jt)return r.ONE;if(t===ct)return e;let n=r.ONE,s=e;for(;t>Jt;)t&ct&&(n=r.mul(n,s)),s=r.sqr(s),t>>=ct;return n}Me.FpPow=k4;function B4(r,e){let t=new Array(e.length),n=e.reduce((i,o,a)=>r.is0(o)?i:(t[a]=i,r.mul(i,o)),r.ONE),s=r.inv(n);return e.reduceRight((i,o,a)=>r.is0(o)?i:(t[a]=r.mul(i,t[a]),r.mul(i,o)),s),t}Me.FpInvertBatch=B4;function eR(r,e,t){return r.mul(e,typeof t=="bigint"?gp(t,r.ORDER):r.inv(t))}Me.FpDiv=eR;function tR(r){let e=(r.ORDER-ct)/oo;return t=>{let n=r.pow(t,e);return r.eql(n,r.ZERO)||r.eql(n,r.ONE)}}Me.FpIsSquare=tR;function _y(r,e){let t=e!==void 0?e:r.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}Me.nLength=_y;function rR(r,e,t=!1,n={}){if(r<=Jt)throw new Error(`Expected Field ORDER > 0, got ${r}`);let{nBitLength:s,nByteLength:i}=_y(r,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=P4(r),a=Object.freeze({ORDER:r,BITS:s,BYTES:i,MASK:(0,sn.bitMask)(s),ZERO:Jt,ONE:ct,create:c=>nn(c,r),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Jt<=c&&c<r},is0:c=>c===Jt,isOdd:c=>(c&ct)===ct,neg:c=>nn(-c,r),eql:(c,u)=>c===u,sqr:c=>nn(c*c,r),add:(c,u)=>nn(c+u,r),sub:(c,u)=>nn(c-u,r),mul:(c,u)=>nn(c*u,r),pow:(c,u)=>k4(a,c,u),div:(c,u)=>nn(c*gp(u,r),r),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>gp(c,r),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>B4(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>t?(0,sn.numberToBytesLE)(c,i):(0,sn.numberToBytesBE)(c,i),fromBytes:c=>{if(c.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${c.length}`);return t?(0,sn.bytesToNumberLE)(c):(0,sn.bytesToNumberBE)(c)}});return Object.freeze(a)}Me.Field=rR;function nR(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");let t=r.sqrt(e);return r.isOdd(t)?t:r.neg(t)}Me.FpSqrtOdd=nR;function sR(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");let t=r.sqrt(e);return r.isOdd(t)?r.neg(t):t}Me.FpSqrtEven=sR;function iR(r,e,t=!1){r=(0,sn.ensureBytes)("privateHash",r);let n=r.length,s=_y(e).nByteLength+8;if(s<24||n<s||n>1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${n}`);let i=t?(0,sn.bytesToNumberLE)(r):(0,sn.bytesToNumberBE)(r);return nn(i,e-ct)+ct}Me.hashToPrivateScalar=iR;function Cy(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let e=r.toString(2).length;return Math.ceil(e/8)}Me.getFieldBytesLength=Cy;function S4(r){let e=Cy(r);return e+Math.ceil(e/2)}Me.getMinHashLength=S4;function oR(r,e,t=!1){let n=r.length,s=Cy(e),i=S4(e);if(n<16||n<i||n>1024)throw new Error(`expected ${i}-1024 bytes of input, got ${n}`);let o=t?(0,sn.bytesToNumberBE)(r):(0,sn.bytesToNumberLE)(r),a=nn(o,e-ct)+ct;return t?(0,sn.numberToBytesLE)(a,s):(0,sn.numberToBytesBE)(a,s)}Me.mapHashToField=oR});var _4=M(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});Wc.validateBasic=Wc.wNAF=void 0;var O4=Pf(),aR=Oa(),cR=BigInt(0),Ny=BigInt(1);function uR(r,e){let t=(s,i)=>{let o=i.negate();return s?o:i},n=s=>{let i=Math.ceil(e/s)+1,o=2**(s-1);return{windows:i,windowSize:o}};return{constTimeNegate:t,unsafeLadder(s,i){let o=r.ZERO,a=s;for(;i>cR;)i&Ny&&(o=o.add(a)),a=a.double(),i>>=Ny;return o},precomputeWindow(s,i){let{windows:o,windowSize:a}=n(i),c=[],u=s,l=u;for(let f=0;f<o;f++){l=u,c.push(l);for(let d=1;d<a;d++)l=l.add(u),c.push(l);u=l.double()}return c},wNAF(s,i,o){let{windows:a,windowSize:c}=n(s),u=r.ZERO,l=r.BASE,f=BigInt(2**s-1),d=2**s,h=BigInt(s);for(let b=0;b<a;b++){let p=b*c,g=Number(o&f);o>>=h,g>c&&(g-=d,o+=Ny);let m=p,y=p+Math.abs(g)-1,E=b%2!==0,v=g<0;g===0?l=l.add(t(E,i[m])):u=u.add(t(v,i[y]))}return{p:u,f:l}},wNAFCached(s,i,o,a){let c=s._WINDOW_SIZE||1,u=i.get(s);return u||(u=this.precomputeWindow(s,c),c!==1&&i.set(s,a(u))),this.wNAF(c,u,o)}}}Wc.wNAF=uR;function lR(r){return(0,O4.validateField)(r.Fp),(0,aR.validateObject)(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,O4.nLength)(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}Wc.validateBasic=lR});var Ry=M(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.mapToCurveSimpleSWU=Qt.SWUFpSqrtRatio=Qt.weierstrass=Qt.weierstrassPoints=Qt.DER=void 0;var Qc=Pf(),Wt=Oa(),Ns=Oa(),Iy=_4();function fR(r){let e=(0,Iy.validateBasic)(r);Wt.validateObject(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:t,Fp:n,a:s}=e;if(t){if(!n.eql(s,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:dR,hexToBytes:pR}=Wt;Qt.DER={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(r){let{Err:e}=Qt.DER;if(r.length<2||r[0]!==2)throw new e("Invalid signature integer tag");let t=r[1],n=r.subarray(2,t+2);if(!t||n.length!==t)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:dR(n),l:r.subarray(t+2)}},toSig(r){let{Err:e}=Qt.DER,t=typeof r=="string"?pR(r):r;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let n=t.length;if(n<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:s,l:i}=Qt.DER._parseInt(t.subarray(2)),{d:o,l:a}=Qt.DER._parseInt(i);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:s,s:o}},hexFromSig(r){let e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,t=u=>{let l=u.toString(16);return l.length&1?`0${l}`:l},n=e(t(r.s)),s=e(t(r.r)),i=n.length/2,o=s.length/2,a=t(i),c=t(o);return`30${t(o+i+4)}02${c}${s}02${a}${n}`}};var os=BigInt(0),Nt=BigInt(1),ao=BigInt(2),xp=BigInt(3),C4=BigInt(4);function N4(r){let e=fR(r),{Fp:t}=e,n=e.toBytes||((b,p,g)=>{let m=p.toAffine();return Wt.concatBytes(Uint8Array.from([4]),t.toBytes(m.x),t.toBytes(m.y))}),s=e.fromBytes||(b=>{let p=b.subarray(1),g=t.fromBytes(p.subarray(0,t.BYTES)),m=t.fromBytes(p.subarray(t.BYTES,2*t.BYTES));return{x:g,y:m}});function i(b){let{a:p,b:g}=e,m=t.sqr(b),y=t.mul(m,b);return t.add(t.add(y,t.mul(b,p)),g)}if(!t.eql(t.sqr(e.Gy),i(e.Gx)))throw new Error("bad generator point: equation left != right");function o(b){return typeof b=="bigint"&&os<b&&b<e.n}function a(b){if(!o(b))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(b){let{allowedPrivateKeyLengths:p,nByteLength:g,wrapPrivateKey:m,n:y}=e;if(p&&typeof b!="bigint"){if(b instanceof Uint8Array&&(b=Wt.bytesToHex(b)),typeof b!="string"||!p.includes(b.length))throw new Error("Invalid key");b=b.padStart(g*2,"0")}let E;try{E=typeof b=="bigint"?b:Wt.bytesToNumberBE((0,Ns.ensureBytes)("private key",b,g))}catch{throw new Error(`private key must be ${g} bytes, hex or bigint, not ${typeof b}`)}return m&&(E=Qc.mod(E,y)),a(E),E}let u=new Map;function l(b){if(!(b instanceof f))throw new Error("ProjectivePoint expected")}class f{constructor(p,g,m){if(this.px=p,this.py=g,this.pz=m,p==null||!t.isValid(p))throw new Error("x required");if(g==null||!t.isValid(g))throw new Error("y required");if(m==null||!t.isValid(m))throw new Error("z required")}static fromAffine(p){let{x:g,y:m}=p||{};if(!p||!t.isValid(g)||!t.isValid(m))throw new Error("invalid affine point");if(p instanceof f)throw new Error("projective point not allowed");let y=E=>t.eql(E,t.ZERO);return y(g)&&y(m)?f.ZERO:new f(g,m,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){let g=t.invertBatch(p.map(m=>m.pz));return p.map((m,y)=>m.toAffine(g[y])).map(f.fromAffine)}static fromHex(p){let g=f.fromAffine(s((0,Ns.ensureBytes)("pointHex",p)));return g.assertValidity(),g}static fromPrivateKey(p){return f.BASE.multiply(c(p))}_setWindowSize(p){this._WINDOW_SIZE=p,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:p,y:g}=this.toAffine();if(!t.isValid(p)||!t.isValid(g))throw new Error("bad point: x or y not FE");let m=t.sqr(g),y=i(p);if(!t.eql(m,y))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:p}=this.toAffine();if(t.isOdd)return!t.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){l(p);let{px:g,py:m,pz:y}=this,{px:E,py:v,pz:k}=p,w=t.eql(t.mul(g,k),t.mul(E,y)),P=t.eql(t.mul(m,k),t.mul(v,y));return w&&P}negate(){return new f(this.px,t.neg(this.py),this.pz)}double(){let{a:p,b:g}=e,m=t.mul(g,xp),{px:y,py:E,pz:v}=this,k=t.ZERO,w=t.ZERO,P=t.ZERO,B=t.mul(y,y),Z=t.mul(E,E),_=t.mul(v,v),O=t.mul(y,E);return O=t.add(O,O),P=t.mul(y,v),P=t.add(P,P),k=t.mul(p,P),w=t.mul(m,_),w=t.add(k,w),k=t.sub(Z,w),w=t.add(Z,w),w=t.mul(k,w),k=t.mul(O,k),P=t.mul(m,P),_=t.mul(p,_),O=t.sub(B,_),O=t.mul(p,O),O=t.add(O,P),P=t.add(B,B),B=t.add(P,B),B=t.add(B,_),B=t.mul(B,O),w=t.add(w,B),_=t.mul(E,v),_=t.add(_,_),B=t.mul(_,O),k=t.sub(k,B),P=t.mul(_,Z),P=t.add(P,P),P=t.add(P,P),new f(k,w,P)}add(p){l(p);let{px:g,py:m,pz:y}=this,{px:E,py:v,pz:k}=p,w=t.ZERO,P=t.ZERO,B=t.ZERO,Z=e.a,_=t.mul(e.b,xp),O=t.mul(g,E),S=t.mul(m,v),F=t.mul(y,k),G=t.add(g,m),R=t.add(E,v);G=t.mul(G,R),R=t.add(O,S),G=t.sub(G,R),R=t.add(g,y);let L=t.add(E,k);return R=t.mul(R,L),L=t.add(O,F),R=t.sub(R,L),L=t.add(m,y),w=t.add(v,k),L=t.mul(L,w),w=t.add(S,F),L=t.sub(L,w),B=t.mul(Z,R),w=t.mul(_,F),B=t.add(w,B),w=t.sub(S,B),B=t.add(S,B),P=t.mul(w,B),S=t.add(O,O),S=t.add(S,O),F=t.mul(Z,F),R=t.mul(_,R),S=t.add(S,F),F=t.sub(O,F),F=t.mul(Z,F),R=t.add(R,F),O=t.mul(S,R),P=t.add(P,O),O=t.mul(L,R),w=t.mul(G,w),w=t.sub(w,O),O=t.mul(G,S),B=t.mul(L,B),B=t.add(B,O),new f(w,P,B)}subtract(p){return this.add(p.negate())}is0(){return this.equals(f.ZERO)}wNAF(p){return h.wNAFCached(this,u,p,g=>{let m=t.invertBatch(g.map(y=>y.pz));return g.map((y,E)=>y.toAffine(m[E])).map(f.fromAffine)})}multiplyUnsafe(p){let g=f.ZERO;if(p===os)return g;if(a(p),p===Nt)return this;let{endo:m}=e;if(!m)return h.unsafeLadder(this,p);let{k1neg:y,k1:E,k2neg:v,k2:k}=m.splitScalar(p),w=g,P=g,B=this;for(;E>os||k>os;)E&Nt&&(w=w.add(B)),k&Nt&&(P=P.add(B)),B=B.double(),E>>=Nt,k>>=Nt;return y&&(w=w.negate()),v&&(P=P.negate()),P=new f(t.mul(P.px,m.beta),P.py,P.pz),w.add(P)}multiply(p){a(p);let g=p,m,y,{endo:E}=e;if(E){let{k1neg:v,k1:k,k2neg:w,k2:P}=E.splitScalar(g),{p:B,f:Z}=this.wNAF(k),{p:_,f:O}=this.wNAF(P);B=h.constTimeNegate(v,B),_=h.constTimeNegate(w,_),_=new f(t.mul(_.px,E.beta),_.py,_.pz),m=B.add(_),y=Z.add(O)}else{let{p:v,f:k}=this.wNAF(g);m=v,y=k}return f.normalizeZ([m,y])[0]}multiplyAndAddUnsafe(p,g,m){let y=f.BASE,E=(k,w)=>w===os||w===Nt||!k.equals(y)?k.multiplyUnsafe(w):k.multiply(w),v=E(this,g).add(E(p,m));return v.is0()?void 0:v}toAffine(p){let{px:g,py:m,pz:y}=this,E=this.is0();p==null&&(p=E?t.ONE:t.inv(y));let v=t.mul(g,p),k=t.mul(m,p),w=t.mul(y,p);if(E)return{x:t.ZERO,y:t.ZERO};if(!t.eql(w,t.ONE))throw new Error("invZ was invalid");return{x:v,y:k}}isTorsionFree(){let{h:p,isTorsionFree:g}=e;if(p===Nt)return!0;if(g)return g(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:p,clearCofactor:g}=e;return p===Nt?this:g?g(f,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),n(f,this,p)}toHex(p=!0){return Wt.bytesToHex(this.toRawBytes(p))}}f.BASE=new f(e.Gx,e.Gy,t.ONE),f.ZERO=new f(t.ZERO,t.ONE,t.ZERO);let d=e.nBitLength,h=(0,Iy.wNAF)(f,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:i,isWithinCurveOrder:o}}Qt.weierstrassPoints=N4;function hR(r){let e=(0,Iy.validateBasic)(r);return Wt.validateObject(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function mR(r){let e=hR(r),{Fp:t,n}=e,s=t.BYTES+1,i=2*t.BYTES+1;function o(R){return os<R&&R<t.ORDER}function a(R){return Qc.mod(R,n)}function c(R){return Qc.invert(R,n)}let{ProjectivePoint:u,normPrivateKeyToScalar:l,weierstrassEquation:f,isWithinCurveOrder:d}=N4({...e,toBytes(R,L,Y){let oe=L.toAffine(),fe=t.toBytes(oe.x),K=Wt.concatBytes;return Y?K(Uint8Array.from([L.hasEvenY()?2:3]),fe):K(Uint8Array.from([4]),fe,t.toBytes(oe.y))},fromBytes(R){let L=R.length,Y=R[0],oe=R.subarray(1);if(L===s&&(Y===2||Y===3)){let fe=Wt.bytesToNumberBE(oe);if(!o(fe))throw new Error("Point is not on curve");let K=f(fe),ae=t.sqrt(K),q=(ae&Nt)===Nt;return(Y&1)===1!==q&&(ae=t.neg(ae)),{x:fe,y:ae}}else if(L===i&&Y===4){let fe=t.fromBytes(oe.subarray(0,t.BYTES)),K=t.fromBytes(oe.subarray(t.BYTES,2*t.BYTES));return{x:fe,y:K}}else throw new Error(`Point of length ${L} was invalid. Expected ${s} compressed bytes or ${i} uncompressed bytes`)}}),h=R=>Wt.bytesToHex(Wt.numberToBytesBE(R,e.nByteLength));function b(R){let L=n>>Nt;return R>L}function p(R){return b(R)?a(-R):R}let g=(R,L,Y)=>Wt.bytesToNumberBE(R.slice(L,Y));class m{constructor(L,Y,oe){this.r=L,this.s=Y,this.recovery=oe,this.assertValidity()}static fromCompact(L){let Y=e.nByteLength;return L=(0,Ns.ensureBytes)("compactSignature",L,Y*2),new m(g(L,0,Y),g(L,Y,2*Y))}static fromDER(L){let{r:Y,s:oe}=Qt.DER.toSig((0,Ns.ensureBytes)("DER",L));return new m(Y,oe)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(L){return new m(this.r,this.s,L)}recoverPublicKey(L){let{r:Y,s:oe,recovery:fe}=this,K=P((0,Ns.ensureBytes)("msgHash",L));if(fe==null||![0,1,2,3].includes(fe))throw new Error("recovery id invalid");let ae=fe===2||fe===3?Y+e.n:Y;if(ae>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");let q=(fe&1)===0?"02":"03",I=u.fromHex(q+h(ae)),ye=c(ae),st=a(-K*ye),Ke=a(oe*ye),Je=u.BASE.multiplyAndAddUnsafe(I,st,Ke);if(!Je)throw new Error("point at infinify");return Je.assertValidity(),Je}hasHighS(){return b(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Wt.hexToBytes(this.toDERHex())}toDERHex(){return Qt.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Wt.hexToBytes(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}let y={isValidPrivateKey(R){try{return l(R),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{let R=Qc.getMinHashLength(e.n);return Qc.mapHashToField(e.randomBytes(R),e.n)},precompute(R=8,L=u.BASE){return L._setWindowSize(R),L.multiply(BigInt(3)),L}};function E(R,L=!0){return u.fromPrivateKey(R).toRawBytes(L)}function v(R){let L=R instanceof Uint8Array,Y=typeof R=="string",oe=(L||Y)&&R.length;return L?oe===s||oe===i:Y?oe===2*s||oe===2*i:R instanceof u}function k(R,L,Y=!0){if(v(R))throw new Error("first arg must be private key");if(!v(L))throw new Error("second arg must be public key");return u.fromHex(L).multiply(l(R)).toRawBytes(Y)}let w=e.bits2int||function(R){let L=Wt.bytesToNumberBE(R),Y=R.length*8-e.nBitLength;return Y>0?L>>BigInt(Y):L},P=e.bits2int_modN||function(R){return a(w(R))},B=Wt.bitMask(e.nBitLength);function Z(R){if(typeof R!="bigint")throw new Error("bigint expected");if(!(os<=R&&R<B))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Wt.numberToBytesBE(R,e.nByteLength)}function _(R,L,Y=O){if(["recovered","canonical"].some(j=>j in Y))throw new Error("sign() legacy options not supported");let{hash:oe,randomBytes:fe}=e,{lowS:K,prehash:ae,extraEntropy:q}=Y;K==null&&(K=!0),R=(0,Ns.ensureBytes)("msgHash",R),ae&&(R=(0,Ns.ensureBytes)("prehashed msgHash",oe(R)));let I=P(R),ye=l(L),st=[Z(ye),Z(I)];if(q!=null){let j=q===!0?fe(t.BYTES):q;st.push((0,Ns.ensureBytes)("extraEntropy",j))}let Ke=Wt.concatBytes(...st),Je=I;function D(j){let N=w(j);if(!d(N))return;let ee=c(N),ce=u.BASE.multiply(N).toAffine(),he=a(ce.x);if(he===os)return;let xe=a(ee*a(Je+he*ye));if(xe===os)return;let V=(ce.x===he?0:2)|Number(ce.y&Nt),te=xe;return K&&b(xe)&&(te=p(xe),V^=1),new m(he,te,V)}return{seed:Ke,k2sig:D}}let O={lowS:e.lowS,prehash:!1},S={lowS:e.lowS,prehash:!1};function F(R,L,Y=O){let{seed:oe,k2sig:fe}=_(R,L,Y),K=e;return Wt.createHmacDrbg(K.hash.outputLen,K.nByteLength,K.hmac)(oe,fe)}u.BASE._setWindowSize(8);function G(R,L,Y,oe=S){let fe=R;if(L=(0,Ns.ensureBytes)("msgHash",L),Y=(0,Ns.ensureBytes)("publicKey",Y),"strict"in oe)throw new Error("options.strict was renamed to lowS");let{lowS:K,prehash:ae}=oe,q,I;try{if(typeof fe=="string"||fe instanceof Uint8Array)try{q=m.fromDER(fe)}catch(ce){if(!(ce instanceof Qt.DER.Err))throw ce;q=m.fromCompact(fe)}else if(typeof fe=="object"&&typeof fe.r=="bigint"&&typeof fe.s=="bigint"){let{r:ce,s:he}=fe;q=new m(ce,he)}else throw new Error("PARSE");I=u.fromHex(Y)}catch(ce){if(ce.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(K&&q.hasHighS())return!1;ae&&(L=e.hash(L));let{r:ye,s:st}=q,Ke=P(L),Je=c(st),D=a(Ke*Je),j=a(ye*Je),N=u.BASE.multiplyAndAddUnsafe(I,D,j)?.toAffine();return N?a(N.x)===ye:!1}return{CURVE:e,getPublicKey:E,getSharedSecret:k,sign:F,verify:G,ProjectivePoint:u,Signature:m,utils:y}}Qt.weierstrass=mR;function I4(r,e){let t=r.ORDER,n=os;for(let b=t-Nt;b%ao===os;b/=ao)n+=Nt;let s=n,i=ao<<s-Nt-Nt,o=i*ao,a=(t-Nt)/o,c=(a-Nt)/ao,u=o-Nt,l=i,f=r.pow(e,a),d=r.pow(e,(a+Nt)/ao),h=(b,p)=>{let g=f,m=r.pow(p,u),y=r.sqr(m);y=r.mul(y,p);let E=r.mul(b,y);E=r.pow(E,c),E=r.mul(E,m),m=r.mul(E,p),y=r.mul(E,b);let v=r.mul(y,m);E=r.pow(v,l);let k=r.eql(E,r.ONE);m=r.mul(y,d),E=r.mul(v,g),y=r.cmov(m,y,k),v=r.cmov(E,v,k);for(let w=s;w>Nt;w--){let P=w-ao;P=ao<<P-Nt;let B=r.pow(v,P),Z=r.eql(B,r.ONE);m=r.mul(y,g),g=r.mul(g,g),B=r.mul(v,g),y=r.cmov(m,y,Z),v=r.cmov(B,v,Z)}return{isValid:k,value:y}};if(r.ORDER%C4===xp){let b=(r.ORDER-xp)/C4,p=r.sqrt(r.neg(e));h=(g,m)=>{let y=r.sqr(m),E=r.mul(g,m);y=r.mul(y,E);let v=r.pow(y,b);v=r.mul(v,E);let k=r.mul(v,p),w=r.mul(r.sqr(v),m),P=r.eql(w,g),B=r.cmov(k,v,P);return{isValid:P,value:B}}}return h}Qt.SWUFpSqrtRatio=I4;function bR(r,e){if(Qc.validateField(r),!r.isValid(e.A)||!r.isValid(e.B)||!r.isValid(e.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");let t=I4(r,e.Z);if(!r.isOdd)throw new Error("Fp.isOdd is not implemented!");return n=>{let s,i,o,a,c,u,l,f;s=r.sqr(n),s=r.mul(s,e.Z),i=r.sqr(s),i=r.add(i,s),o=r.add(i,r.ONE),o=r.mul(o,e.B),a=r.cmov(e.Z,r.neg(i),!r.eql(i,r.ZERO)),a=r.mul(a,e.A),i=r.sqr(o),u=r.sqr(a),c=r.mul(u,e.A),i=r.add(i,c),i=r.mul(i,o),u=r.mul(u,a),c=r.mul(u,e.B),i=r.add(i,c),l=r.mul(s,o);let{isValid:d,value:h}=t(i,u);f=r.mul(s,n),f=r.mul(f,h),l=r.cmov(l,o,d),f=r.cmov(f,h,d);let b=r.isOdd(n)===r.isOdd(f);return f=r.cmov(r.neg(f),f,b),l=r.div(l,a),{x:l,y:f}}}Qt.mapToCurveSimpleSWU=bR});var L4=M(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.createHasher=En.isogenyMap=En.hash_to_field=En.expand_message_xof=En.expand_message_xmd=void 0;var gR=Pf(),as=Oa();function xR(r){if(r instanceof Uint8Array)return r;if(typeof r=="string")return(0,as.utf8ToBytes)(r);throw new Error("DST must be Uint8Array or string")}var yR=as.bytesToNumberBE;function co(r,e){if(r<0||r>=1<<8*e)throw new Error(`bad I2OSP call: value=${r} length=${e}`);let t=Array.from({length:e}).fill(0);for(let n=e-1;n>=0;n--)t[n]=r&255,r>>>=8;return new Uint8Array(t)}function wR(r,e){let t=new Uint8Array(r.length);for(let n=0;n<r.length;n++)t[n]=r[n]^e[n];return t}function kf(r){if(!(r instanceof Uint8Array))throw new Error("Uint8Array expected")}function Ly(r){if(!Number.isSafeInteger(r))throw new Error("number expected")}function R4(r,e,t,n){kf(r),kf(e),Ly(t),e.length>255&&(e=n((0,as.concatBytes)((0,as.utf8ToBytes)("H2C-OVERSIZE-DST-"),e)));let{outputLen:s,blockLen:i}=n,o=Math.ceil(t/s);if(o>255)throw new Error("Invalid xmd length");let a=(0,as.concatBytes)(e,co(e.length,1)),c=co(0,i),u=co(t,2),l=new Array(o),f=n((0,as.concatBytes)(c,r,u,co(0,1),a));l[0]=n((0,as.concatBytes)(f,co(1,1),a));for(let h=1;h<=o;h++){let b=[wR(f,l[h-1]),co(h+1,1),a];l[h]=n((0,as.concatBytes)(...b))}return(0,as.concatBytes)(...l).slice(0,t)}En.expand_message_xmd=R4;function M4(r,e,t,n,s){if(kf(r),kf(e),Ly(t),e.length>255){let i=Math.ceil(2*n/8);e=s.create({dkLen:i}).update((0,as.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(e).digest()}if(t>65535||e.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return s.create({dkLen:t}).update(r).update(co(t,2)).update(e).update(co(e.length,1)).digest()}En.expand_message_xof=M4;function My(r,e,t){(0,as.validateObject)(t,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:n,k:s,m:i,hash:o,expand:a,DST:c}=t;kf(r),Ly(e);let u=xR(c),l=n.toString(2).length,f=Math.ceil((l+s)/8),d=e*i*f,h;if(a==="xmd")h=R4(r,u,d,o);else if(a==="xof")h=M4(r,u,d,s,o);else if(a==="_internal_pass")h=r;else throw new Error('expand must be "xmd" or "xof"');let b=new Array(e);for(let p=0;p<e;p++){let g=new Array(i);for(let m=0;m<i;m++){let y=f*(m+p*i),E=h.subarray(y,y+f);g[m]=(0,gR.mod)(yR(E),n)}b[p]=g}return b}En.hash_to_field=My;function AR(r,e){let t=e.map(n=>Array.from(n).reverse());return(n,s)=>{let[i,o,a,c]=t.map(u=>u.reduce((l,f)=>r.add(r.mul(l,n),f)));return n=r.div(i,o),s=r.mul(s,r.div(a,c)),{x:n,y:s}}}En.isogenyMap=AR;function ER(r,e,t){if(typeof e!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(n,s){let i=My(n,2,{...t,DST:t.DST,...s}),o=r.fromAffine(e(i[0])),a=r.fromAffine(e(i[1])),c=o.add(a).clearCofactor();return c.assertValidity(),c},encodeToCurve(n,s){let i=My(n,1,{...t,DST:t.encodeDST,...s}),o=r.fromAffine(e(i[0])).clearCofactor();return o.assertValidity(),o}}}En.createHasher=ER});var F4=M(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.createCurve=Yc.getHash=void 0;var vR=Q0(),j4=is(),TR=Ry();function U4(r){return{hash:r,hmac:(e,...t)=>(0,vR.hmac)(r,e,(0,j4.concatBytes)(...t)),randomBytes:j4.randomBytes}}Yc.getHash=U4;function PR(r,e){let t=n=>(0,TR.weierstrass)({...r,...U4(n)});return Object.freeze({...t(e),create:t})}Yc.createCurve=PR});var Q4=M($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.encodeToCurve=$r.hashToCurve=$r.schnorr=$r.secp256k1=void 0;var yp=tp(),kR=is(),rr=Pf(),BR=Ry(),br=Oa(),$4=L4(),SR=F4(),vp=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),wp=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),q4=BigInt(1),Ap=BigInt(2),D4=(r,e)=>(r+e/Ap)/e;function G4(r){let e=vp,t=BigInt(3),n=BigInt(6),s=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),u=r*r*r%e,l=u*u*r%e,f=(0,rr.pow2)(l,t,e)*l%e,d=(0,rr.pow2)(f,t,e)*l%e,h=(0,rr.pow2)(d,Ap,e)*u%e,b=(0,rr.pow2)(h,s,e)*h%e,p=(0,rr.pow2)(b,i,e)*b%e,g=(0,rr.pow2)(p,a,e)*p%e,m=(0,rr.pow2)(g,c,e)*g%e,y=(0,rr.pow2)(m,a,e)*p%e,E=(0,rr.pow2)(y,t,e)*l%e,v=(0,rr.pow2)(E,o,e)*b%e,k=(0,rr.pow2)(v,n,e)*u%e,w=(0,rr.pow2)(k,Ap,e);if(!uo.eql(uo.sqr(w),r))throw new Error("Cannot find square root");return w}var uo=(0,rr.Field)(vp,void 0,void 0,{sqrt:G4});$r.secp256k1=(0,SR.createCurve)({a:BigInt(0),b:BigInt(7),Fp:uo,n:wp,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let e=wp,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-q4*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=t,o=BigInt("0x100000000000000000000000000000000"),a=D4(i*r,e),c=D4(-n*r,e),u=(0,rr.mod)(r-a*t-c*s,e),l=(0,rr.mod)(-a*n-c*i,e),f=u>o,d=l>o;if(f&&(u=e-u),d&&(l=e-l),u>o||l>o)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:f,k1:u,k2neg:d,k2:l}}}},yp.sha256);var Tp=BigInt(0),z4=r=>typeof r=="bigint"&&Tp<r&&r<vp,OR=r=>typeof r=="bigint"&&Tp<r&&r<wp,H4={};function Ep(r,...e){let t=H4[r];if(t===void 0){let n=(0,yp.sha256)(Uint8Array.from(r,s=>s.charCodeAt(0)));t=(0,br.concatBytes)(n,n),H4[r]=t}return(0,yp.sha256)((0,br.concatBytes)(t,...e))}var Dy=r=>r.toRawBytes(!0).slice(1),Uy=r=>(0,br.numberToBytesBE)(r,32),jy=r=>(0,rr.mod)(r,vp),Bf=r=>(0,rr.mod)(r,wp),Hy=$r.secp256k1.ProjectivePoint,_R=(r,e,t)=>Hy.BASE.multiplyAndAddUnsafe(r,e,t);function Fy(r){let e=$r.secp256k1.utils.normPrivateKeyToScalar(r),t=Hy.fromPrivateKey(e);return{scalar:t.hasEvenY()?e:Bf(-e),bytes:Dy(t)}}function V4(r){if(!z4(r))throw new Error("bad x: need 0 < x < p");let e=jy(r*r),t=jy(e*r+BigInt(7)),n=G4(t);n%Ap!==Tp&&(n=jy(-n));let s=new Hy(r,n,q4);return s.assertValidity(),s}function K4(...r){return Bf((0,br.bytesToNumberBE)(Ep("BIP0340/challenge",...r)))}function CR(r){return Fy(r).bytes}function NR(r,e,t=(0,kR.randomBytes)(32)){let n=(0,br.ensureBytes)("message",r),{bytes:s,scalar:i}=Fy(e),o=(0,br.ensureBytes)("auxRand",t,32),a=Uy(i^(0,br.bytesToNumberBE)(Ep("BIP0340/aux",o))),c=Ep("BIP0340/nonce",a,s,n),u=Bf((0,br.bytesToNumberBE)(c));if(u===Tp)throw new Error("sign failed: k is zero");let{bytes:l,scalar:f}=Fy(u),d=K4(l,s,n),h=new Uint8Array(64);if(h.set(l,0),h.set(Uy(Bf(f+d*i)),32),!J4(h,n,s))throw new Error("sign: Invalid signature produced");return h}function J4(r,e,t){let n=(0,br.ensureBytes)("signature",r,64),s=(0,br.ensureBytes)("message",e),i=(0,br.ensureBytes)("publicKey",t,32);try{let o=V4((0,br.bytesToNumberBE)(i)),a=(0,br.bytesToNumberBE)(n.subarray(0,32));if(!z4(a))return!1;let c=(0,br.bytesToNumberBE)(n.subarray(32,64));if(!OR(c))return!1;let u=K4(Uy(a),Dy(o),s),l=_R(o,c,Bf(-u));return!(!l||!l.hasEvenY()||l.toAffine().x!==a)}catch{return!1}}$r.schnorr=(()=>({getPublicKey:CR,sign:NR,verify:J4,utils:{randomPrivateKey:$r.secp256k1.utils.randomPrivateKey,lift_x:V4,pointToBytes:Dy,numberToBytesBE:br.numberToBytesBE,bytesToNumberBE:br.bytesToNumberBE,taggedHash:Ep,mod:rr.mod}}))();var IR=(()=>(0,$4.isogenyMap)(uo,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(r=>r.map(e=>BigInt(e)))))(),RR=(()=>(0,BR.mapToCurveSimpleSWU)(uo,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:uo.create(BigInt("-11"))}))(),W4=(()=>(0,$4.createHasher)($r.secp256k1.ProjectivePoint,r=>{let{x:e,y:t}=RR(uo.create(r[0]));return IR(e,t)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:uo.ORDER,m:1,k:128,expand:"xmd",hash:yp.sha256}))();$r.hashToCurve=(()=>W4.hashToCurve)();$r.encodeToCurve=(()=>W4.encodeToCurve)()});var $y=M(Pp=>{"use strict";Object.defineProperty(Pp,"__esModule",{value:!0});Pp.ZeroAddress=void 0;Pp.ZeroAddress="0x0000000000000000000000000000000000000000"});var Y4=M(kp=>{"use strict";Object.defineProperty(kp,"__esModule",{value:!0});kp.ZeroHash=void 0;kp.ZeroHash="0x0000000000000000000000000000000000000000000000000000000000000000"});var Z4=M(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.MaxInt256=vn.MinInt256=vn.MaxUint256=vn.WeiPerEther=vn.N=void 0;vn.N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");vn.WeiPerEther=BigInt("1000000000000000000");vn.MaxUint256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");vn.MinInt256=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1);vn.MaxInt256=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")});var X4=M(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.MessagePrefix=Zc.EtherSymbol=void 0;Zc.EtherSymbol="\u039E";Zc.MessagePrefix=`Ethereum Signed Message:
|
|
758
|
-
`});var Xc=M(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.MessagePrefix=Ht.EtherSymbol=Ht.MaxInt256=Ht.MinInt256=Ht.MaxUint256=Ht.WeiPerEther=Ht.N=Ht.ZeroHash=Ht.ZeroAddress=void 0;var MR=$y();Object.defineProperty(Ht,"ZeroAddress",{enumerable:!0,get:function(){return MR.ZeroAddress}});var LR=Y4();Object.defineProperty(Ht,"ZeroHash",{enumerable:!0,get:function(){return LR.ZeroHash}});var Sf=Z4();Object.defineProperty(Ht,"N",{enumerable:!0,get:function(){return Sf.N}});Object.defineProperty(Ht,"WeiPerEther",{enumerable:!0,get:function(){return Sf.WeiPerEther}});Object.defineProperty(Ht,"MaxUint256",{enumerable:!0,get:function(){return Sf.MaxUint256}});Object.defineProperty(Ht,"MinInt256",{enumerable:!0,get:function(){return Sf.MinInt256}});Object.defineProperty(Ht,"MaxInt256",{enumerable:!0,get:function(){return Sf.MaxInt256}});var ev=X4();Object.defineProperty(Ht,"EtherSymbol",{enumerable:!0,get:function(){return ev.EtherSymbol}});Object.defineProperty(Ht,"MessagePrefix",{enumerable:!0,get:function(){return ev.MessagePrefix}})});var qy=M(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});Sp.Signature=void 0;var tv=Xc(),ze=me(),rv=BigInt(0),nv=BigInt(1),sv=BigInt(2),iv=BigInt(27),ov=BigInt(28),Bp=BigInt(35),eu={};function av(r){return(0,ze.zeroPadValue)((0,ze.toBeArray)(r),32)}var on=class{#e;#t;#r;#n;get r(){return this.#e}set r(e){(0,ze.assertArgument)((0,ze.dataLength)(e)===32,"invalid r","value",e),this.#e=(0,ze.hexlify)(e)}get s(){return this.#t}set s(e){(0,ze.assertArgument)((0,ze.dataLength)(e)===32,"invalid s","value",e);let t=(0,ze.hexlify)(e);(0,ze.assertArgument)(parseInt(t.substring(0,3))<8,"non-canonical s","value",t),this.#t=t}get v(){return this.#r}set v(e){let t=(0,ze.getNumber)(e,"value");(0,ze.assertArgument)(t===27||t===28,"invalid v","v",e),this.#r=t}get networkV(){return this.#n}get legacyChainId(){let e=this.networkV;return e==null?null:on.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){let e=(0,ze.getBytes)(this.s);return this.yParity&&(e[0]|=128),(0,ze.hexlify)(e)}get compactSerialized(){return(0,ze.concat)([this.r,this.yParityAndS])}get serialized(){return(0,ze.concat)([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,t,n,s){(0,ze.assertPrivate)(e,eu,"Signature"),this.#e=t,this.#t=n,this.#r=s,this.#n=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){let e=new on(eu,this.r,this.s,this.v);return this.networkV&&(e.#n=this.networkV),e}toJSON(){let e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){let t=(0,ze.getBigInt)(e,"v");return t==iv||t==ov?rv:((0,ze.assertArgument)(t>=Bp,"invalid EIP-155 v","v",e),(t-Bp)/sv)}static getChainIdV(e,t){return(0,ze.getBigInt)(e)*sv+BigInt(35+t-27)}static getNormalizedV(e){let t=(0,ze.getBigInt)(e);return t===rv||t===iv?27:t===nv||t===ov?28:((0,ze.assertArgument)(t>=Bp,"invalid v","v",e),t&nv?27:28)}static from(e){function t(u,l){(0,ze.assertArgument)(u,l,"signature",e)}if(e==null)return new on(eu,tv.ZeroHash,tv.ZeroHash,27);if(typeof e=="string"){let u=(0,ze.getBytes)(e,"signature");if(u.length===64){let l=(0,ze.hexlify)(u.slice(0,32)),f=u.slice(32,64),d=f[0]&128?28:27;return f[0]&=127,new on(eu,l,(0,ze.hexlify)(f),d)}if(u.length===65){let l=(0,ze.hexlify)(u.slice(0,32)),f=u.slice(32,64);t((f[0]&128)===0,"non-canonical s");let d=on.getNormalizedV(u[64]);return new on(eu,l,(0,ze.hexlify)(f),d)}t(!1,"invalid raw signature length")}if(e instanceof on)return e.clone();let n=e.r;t(n!=null,"missing r");let s=av(n),i=function(u,l){if(u!=null)return av(u);if(l!=null){t((0,ze.isHexString)(l,32),"invalid yParityAndS");let f=(0,ze.getBytes)(l);return f[0]&=127,(0,ze.hexlify)(f)}t(!1,"missing s")}(e.s,e.yParityAndS);t(((0,ze.getBytes)(i)[0]&128)==0,"non-canonical s");let{networkV:o,v:a}=function(u,l,f){if(u!=null){let d=(0,ze.getBigInt)(u);return{networkV:d>=Bp?d:void 0,v:on.getNormalizedV(d)}}if(l!=null)return t((0,ze.isHexString)(l,32),"invalid yParityAndS"),{v:(0,ze.getBytes)(l)[0]&128?28:27};if(f!=null){switch((0,ze.getNumber)(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),c=new on(eu,s,i,a);return o&&(c.#n=o),t(e.yParity==null||(0,ze.getNumber)(e.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),t(e.yParityAndS==null||e.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}};Sp.Signature=on});var uv=M(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});Op.SigningKey=void 0;var _a=Q4(),Lt=me(),cv=qy(),mi=class{#e;constructor(e){(0,Lt.assertArgument)((0,Lt.dataLength)(e)===32,"invalid private key","privateKey","[REDACTED]"),this.#e=(0,Lt.hexlify)(e)}get privateKey(){return this.#e}get publicKey(){return mi.computePublicKey(this.#e)}get compressedPublicKey(){return mi.computePublicKey(this.#e,!0)}sign(e){(0,Lt.assertArgument)((0,Lt.dataLength)(e)===32,"invalid digest length","digest",e);let t=_a.secp256k1.sign((0,Lt.getBytesCopy)(e),(0,Lt.getBytesCopy)(this.#e),{lowS:!0});return cv.Signature.from({r:(0,Lt.toBeHex)(t.r,32),s:(0,Lt.toBeHex)(t.s,32),v:t.recovery?28:27})}computeSharedSecret(e){let t=mi.computePublicKey(e);return(0,Lt.hexlify)(_a.secp256k1.getSharedSecret((0,Lt.getBytesCopy)(this.#e),(0,Lt.getBytes)(t),!1))}static computePublicKey(e,t){let n=(0,Lt.getBytes)(e,"key");if(n.length===32){let i=_a.secp256k1.getPublicKey(n,!!t);return(0,Lt.hexlify)(i)}if(n.length===64){let i=new Uint8Array(65);i[0]=4,i.set(n,1),n=i}let s=_a.secp256k1.ProjectivePoint.fromHex(n);return(0,Lt.hexlify)(s.toRawBytes(t))}static recoverPublicKey(e,t){(0,Lt.assertArgument)((0,Lt.dataLength)(e)===32,"invalid digest length","digest",e);let n=cv.Signature.from(t),s=_a.secp256k1.Signature.fromCompact((0,Lt.getBytesCopy)((0,Lt.concat)([n.r,n.s])));s=s.addRecoveryBit(n.yParity);let i=s.recoverPublicKey((0,Lt.getBytesCopy)(e));return(0,Lt.assertArgument)(i!=null,"invalid signautre for digest","signature",t),"0x"+i.toHex(!1)}static addPoints(e,t,n){let s=_a.secp256k1.ProjectivePoint.fromHex(mi.computePublicKey(e).substring(2)),i=_a.secp256k1.ProjectivePoint.fromHex(mi.computePublicKey(t).substring(2));return"0x"+s.add(i).toHex(!!n)}};Op.SigningKey=mi});var nr=M(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.lock=pt.Signature=pt.SigningKey=pt.scryptSync=pt.scrypt=pt.pbkdf2=pt.sha512=pt.sha256=pt.ripemd160=pt.keccak256=pt.randomBytes=pt.computeHmac=void 0;var lv=g5();Object.defineProperty(pt,"computeHmac",{enumerable:!0,get:function(){return lv.computeHmac}});var fv=_5();Object.defineProperty(pt,"keccak256",{enumerable:!0,get:function(){return fv.keccak256}});var dv=F5();Object.defineProperty(pt,"ripemd160",{enumerable:!0,get:function(){return dv.ripemd160}});var pv=q5();Object.defineProperty(pt,"pbkdf2",{enumerable:!0,get:function(){return pv.pbkdf2}});var Gy=K5();Object.defineProperty(pt,"randomBytes",{enumerable:!0,get:function(){return Gy.randomBytes}});var _p=a4();Object.defineProperty(pt,"scrypt",{enumerable:!0,get:function(){return _p.scrypt}});Object.defineProperty(pt,"scryptSync",{enumerable:!0,get:function(){return _p.scryptSync}});var Cp=m4();Object.defineProperty(pt,"sha256",{enumerable:!0,get:function(){return Cp.sha256}});Object.defineProperty(pt,"sha512",{enumerable:!0,get:function(){return Cp.sha512}});var jR=uv();Object.defineProperty(pt,"SigningKey",{enumerable:!0,get:function(){return jR.SigningKey}});var UR=qy();Object.defineProperty(pt,"Signature",{enumerable:!0,get:function(){return UR.Signature}});function FR(){lv.computeHmac.lock(),fv.keccak256.lock(),pv.pbkdf2.lock(),Gy.randomBytes.lock(),dv.ripemd160.lock(),_p.scrypt.lock(),_p.scryptSync.lock(),Cp.sha256.lock(),Cp.sha512.lock(),Gy.randomBytes.lock()}pt.lock=FR});var Np=M(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.getIcapAddress=tu.getAddress=void 0;var DR=nr(),Of=me(),HR=BigInt(0),$R=BigInt(36);function hv(r){r=r.toLowerCase();let e=r.substring(2).split(""),t=new Uint8Array(40);for(let s=0;s<40;s++)t[s]=e[s].charCodeAt(0);let n=(0,Of.getBytes)((0,DR.keccak256)(t));for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(n[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return"0x"+e.join("")}var zy={};for(let r=0;r<10;r++)zy[String(r)]=String(r);for(let r=0;r<26;r++)zy[String.fromCharCode(65+r)]=String(10+r);var mv=15;function bv(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(n=>zy[n]).join("");for(;e.length>=mv;){let n=e.substring(0,mv);e=parseInt(n,10)%97+e.substring(n.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}var qR=function(){let r={};for(let e=0;e<36;e++){let t="0123456789abcdefghijklmnopqrstuvwxyz"[e];r[t]=BigInt(e)}return r}();function GR(r){r=r.toLowerCase();let e=HR;for(let t=0;t<r.length;t++)e=e*$R+qR[r[t]];return e}function gv(r){if((0,Of.assertArgument)(typeof r=="string","invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/)){r.startsWith("0x")||(r="0x"+r);let e=hv(r);return(0,Of.assertArgument)(!r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===r,"bad address checksum","address",r),e}if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){(0,Of.assertArgument)(r.substring(2,4)===bv(r),"bad icap checksum","address",r);let e=GR(r.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return hv("0x"+e)}(0,Of.assertArgument)(!1,"invalid address","address",r)}tu.getAddress=gv;function zR(r){let e=BigInt(gv(r)).toString(36).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+bv("XE00"+e)+e}tu.getIcapAddress=zR});var yv=M(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.getCreate2Address=ru.getCreateAddress=void 0;var xv=nr(),bi=me(),Ip=Np();function VR(r){let e=(0,Ip.getAddress)(r.from),n=(0,bi.getBigInt)(r.nonce,"tx.nonce").toString(16);return n==="0"?n="0x":n.length%2?n="0x0"+n:n="0x"+n,(0,Ip.getAddress)((0,bi.dataSlice)((0,xv.keccak256)((0,bi.encodeRlp)([e,n])),12))}ru.getCreateAddress=VR;function KR(r,e,t){let n=(0,Ip.getAddress)(r),s=(0,bi.getBytes)(e,"salt"),i=(0,bi.getBytes)(t,"initCodeHash");return(0,bi.assertArgument)(s.length===32,"salt must be 32 bytes","salt",e),(0,bi.assertArgument)(i.length===32,"initCodeHash must be 32 bytes","initCodeHash",t),(0,Ip.getAddress)((0,bi.dataSlice)((0,xv.keccak256)((0,bi.concat)(["0xff",n,s,i])),12))}ru.getCreate2Address=KR});var Av=M(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.resolveAddress=lo.isAddress=lo.isAddressable=void 0;var Rp=me(),Ky=Np();function wv(r){return r&&typeof r.getAddress=="function"}lo.isAddressable=wv;function JR(r){try{return(0,Ky.getAddress)(r),!0}catch{}return!1}lo.isAddress=JR;async function Vy(r,e){let t=await e;return(t==null||t==="0x0000000000000000000000000000000000000000")&&((0,Rp.assert)(typeof r!="string","unconfigured name","UNCONFIGURED_NAME",{value:r}),(0,Rp.assertArgument)(!1,"invalid AddressLike value; did not resolve to a value address","target",r)),(0,Ky.getAddress)(t)}function WR(r,e){if(typeof r=="string")return r.match(/^0x[0-9a-f]{40}$/i)?(0,Ky.getAddress)(r):((0,Rp.assert)(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),Vy(r,e.resolveName(r)));if(wv(r))return Vy(r,r.getAddress());if(r&&typeof r.then=="function")return Vy(r,r);(0,Rp.assertArgument)(!1,"unsupported addressable value","target",r)}lo.resolveAddress=WR});var Yt=M(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.resolveAddress=gr.isAddress=gr.isAddressable=gr.getCreate2Address=gr.getCreateAddress=gr.getIcapAddress=gr.getAddress=void 0;var Ev=Np();Object.defineProperty(gr,"getAddress",{enumerable:!0,get:function(){return Ev.getAddress}});Object.defineProperty(gr,"getIcapAddress",{enumerable:!0,get:function(){return Ev.getIcapAddress}});var vv=yv();Object.defineProperty(gr,"getCreateAddress",{enumerable:!0,get:function(){return vv.getCreateAddress}});Object.defineProperty(gr,"getCreate2Address",{enumerable:!0,get:function(){return vv.getCreate2Address}});var Jy=Av();Object.defineProperty(gr,"isAddressable",{enumerable:!0,get:function(){return Jy.isAddressable}});Object.defineProperty(gr,"isAddress",{enumerable:!0,get:function(){return Jy.isAddress}});Object.defineProperty(gr,"resolveAddress",{enumerable:!0,get:function(){return Jy.resolveAddress}})});var Is=M(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});Mp.Typed=void 0;var Tv=me(),cs={};function be(r,e){let t=!1;return e<0&&(t=!0,e*=-1),new Br(cs,`${t?"":"u"}int${e}`,r,{signed:t,width:e})}function Ye(r,e){return new Br(cs,`bytes${e||""}`,r,{size:e})}var Pv=Symbol.for("_ethers_typed"),Br=class{type;value;#e;_typedSymbol;constructor(e,t,n,s){s==null&&(s=null),(0,Tv.assertPrivate)(cs,e,"Typed"),(0,Tv.defineProperties)(this,{_typedSymbol:Pv,type:t,value:n}),this.#e=s,this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return this.#e}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return this.#e===!0?-1:this.#e===!1?this.value.length:null}static from(e,t){return new Br(cs,e,t)}static uint8(e){return be(e,8)}static uint16(e){return be(e,16)}static uint24(e){return be(e,24)}static uint32(e){return be(e,32)}static uint40(e){return be(e,40)}static uint48(e){return be(e,48)}static uint56(e){return be(e,56)}static uint64(e){return be(e,64)}static uint72(e){return be(e,72)}static uint80(e){return be(e,80)}static uint88(e){return be(e,88)}static uint96(e){return be(e,96)}static uint104(e){return be(e,104)}static uint112(e){return be(e,112)}static uint120(e){return be(e,120)}static uint128(e){return be(e,128)}static uint136(e){return be(e,136)}static uint144(e){return be(e,144)}static uint152(e){return be(e,152)}static uint160(e){return be(e,160)}static uint168(e){return be(e,168)}static uint176(e){return be(e,176)}static uint184(e){return be(e,184)}static uint192(e){return be(e,192)}static uint200(e){return be(e,200)}static uint208(e){return be(e,208)}static uint216(e){return be(e,216)}static uint224(e){return be(e,224)}static uint232(e){return be(e,232)}static uint240(e){return be(e,240)}static uint248(e){return be(e,248)}static uint256(e){return be(e,256)}static uint(e){return be(e,256)}static int8(e){return be(e,-8)}static int16(e){return be(e,-16)}static int24(e){return be(e,-24)}static int32(e){return be(e,-32)}static int40(e){return be(e,-40)}static int48(e){return be(e,-48)}static int56(e){return be(e,-56)}static int64(e){return be(e,-64)}static int72(e){return be(e,-72)}static int80(e){return be(e,-80)}static int88(e){return be(e,-88)}static int96(e){return be(e,-96)}static int104(e){return be(e,-104)}static int112(e){return be(e,-112)}static int120(e){return be(e,-120)}static int128(e){return be(e,-128)}static int136(e){return be(e,-136)}static int144(e){return be(e,-144)}static int152(e){return be(e,-152)}static int160(e){return be(e,-160)}static int168(e){return be(e,-168)}static int176(e){return be(e,-176)}static int184(e){return be(e,-184)}static int192(e){return be(e,-192)}static int200(e){return be(e,-200)}static int208(e){return be(e,-208)}static int216(e){return be(e,-216)}static int224(e){return be(e,-224)}static int232(e){return be(e,-232)}static int240(e){return be(e,-240)}static int248(e){return be(e,-248)}static int256(e){return be(e,-256)}static int(e){return be(e,-256)}static bytes1(e){return Ye(e,1)}static bytes2(e){return Ye(e,2)}static bytes3(e){return Ye(e,3)}static bytes4(e){return Ye(e,4)}static bytes5(e){return Ye(e,5)}static bytes6(e){return Ye(e,6)}static bytes7(e){return Ye(e,7)}static bytes8(e){return Ye(e,8)}static bytes9(e){return Ye(e,9)}static bytes10(e){return Ye(e,10)}static bytes11(e){return Ye(e,11)}static bytes12(e){return Ye(e,12)}static bytes13(e){return Ye(e,13)}static bytes14(e){return Ye(e,14)}static bytes15(e){return Ye(e,15)}static bytes16(e){return Ye(e,16)}static bytes17(e){return Ye(e,17)}static bytes18(e){return Ye(e,18)}static bytes19(e){return Ye(e,19)}static bytes20(e){return Ye(e,20)}static bytes21(e){return Ye(e,21)}static bytes22(e){return Ye(e,22)}static bytes23(e){return Ye(e,23)}static bytes24(e){return Ye(e,24)}static bytes25(e){return Ye(e,25)}static bytes26(e){return Ye(e,26)}static bytes27(e){return Ye(e,27)}static bytes28(e){return Ye(e,28)}static bytes29(e){return Ye(e,29)}static bytes30(e){return Ye(e,30)}static bytes31(e){return Ye(e,31)}static bytes32(e){return Ye(e,32)}static address(e){return new Br(cs,"address",e)}static bool(e){return new Br(cs,"bool",!!e)}static bytes(e){return new Br(cs,"bytes",e)}static string(e){return new Br(cs,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new Br(cs,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===Pv}static dereference(e,t){if(Br.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}};Mp.Typed=Br});var Bv=M(Lp=>{"use strict";Object.defineProperty(Lp,"__esModule",{value:!0});Lp.AddressCoder=void 0;var kv=Yt(),QR=Bc(),YR=Is(),ZR=yn(),Wy=class extends ZR.Coder{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let n=YR.Typed.dereference(t,"string");try{n=(0,kv.getAddress)(n)}catch(s){return this._throwError(s.message,t)}return e.writeValue(n)}decode(e){return(0,kv.getAddress)((0,QR.toBeHex)(e.readValue(),20))}};Lp.AddressCoder=Wy});var Sv=M(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});jp.AnonymousCoder=void 0;var XR=yn(),Qy=class extends XR.Coder{coder;constructor(e){super(e.name,e.type,"_",e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}};jp.AnonymousCoder=Qy});var Zy=M(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.ArrayCoder=fo.unpack=fo.pack=void 0;var gi=me(),eM=Is(),nu=yn(),tM=Sv();function Ov(r,e,t){let n=[];if(Array.isArray(t))n=t;else if(t&&typeof t=="object"){let c={};n=e.map(u=>{let l=u.localName;return(0,gi.assert)(l,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:t}),(0,gi.assert)(!c[l],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:t}),c[l]=!0,t[l]})}else(0,gi.assertArgument)(!1,"invalid tuple value","tuple",t);(0,gi.assertArgument)(e.length===n.length,"types/value length mismatch","tuple",t);let s=new nu.Writer,i=new nu.Writer,o=[];e.forEach((c,u)=>{let l=n[u];if(c.dynamic){let f=i.length;c.encode(i,l);let d=s.writeUpdatableValue();o.push(h=>{d(h+f)})}else c.encode(s,l)}),o.forEach(c=>{c(s.length)});let a=r.appendWriter(s);return a+=r.appendWriter(i),a}fo.pack=Ov;function _v(r,e){let t=[],n=[],s=r.subReader(0);return e.forEach(i=>{let o=null;if(i.dynamic){let a=r.readIndex(),c=s.subReader(a);try{o=i.decode(c)}catch(u){if((0,gi.isError)(u,"BUFFER_OVERRUN"))throw u;o=u,o.baseType=i.name,o.name=i.localName,o.type=i.type}}else try{o=i.decode(r)}catch(a){if((0,gi.isError)(a,"BUFFER_OVERRUN"))throw a;o=a,o.baseType=i.name,o.name=i.localName,o.type=i.type}if(o==null)throw new Error("investigate");t.push(o),n.push(i.localName||null)}),nu.Result.fromItems(t,n)}fo.unpack=_v;var Yy=class extends nu.Coder{coder;length;constructor(e,t,n){let s=e.type+"["+(t>=0?t:"")+"]",i=t===-1||e.dynamic;super("array",s,n,i),(0,gi.defineProperties)(this,{coder:e,length:t})}defaultValue(){let e=this.coder.defaultValue(),t=[];for(let n=0;n<this.length;n++)t.push(e);return t}encode(e,t){let n=eM.Typed.dereference(t,"array");Array.isArray(n)||this._throwError("expected array value",n);let s=this.length;s===-1&&(s=n.length,e.writeValue(n.length)),(0,gi.assertArgumentCount)(n.length,s,"coder array"+(this.localName?" "+this.localName:""));let i=[];for(let o=0;o<n.length;o++)i.push(this.coder);return Ov(e,i,n)}decode(e){let t=this.length;t===-1&&(t=e.readIndex(),(0,gi.assert)(t*nu.WordSize<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:t*nu.WordSize,length:e.dataLength}));let n=[];for(let s=0;s<t;s++)n.push(new tM.AnonymousCoder(this.coder));return _v(e,n)}};fo.ArrayCoder=Yy});var Cv=M(Up=>{"use strict";Object.defineProperty(Up,"__esModule",{value:!0});Up.BooleanCoder=void 0;var rM=Is(),nM=yn(),Xy=class extends nM.Coder{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){let n=rM.Typed.dereference(t,"bool");return e.writeValue(n?1:0)}decode(e){return!!e.readValue()}};Up.BooleanCoder=Xy});var t1=M(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.BytesCoder=su.DynamicBytesCoder=void 0;var Nv=me(),sM=yn(),Fp=class extends sM.Coder{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=(0,Nv.getBytesCopy)(t);let n=e.writeValue(t.length);return n+=e.writeBytes(t),n}decode(e){return e.readBytes(e.readIndex(),!0)}};su.DynamicBytesCoder=Fp;var e1=class extends Fp{constructor(e){super("bytes",e)}decode(e){return(0,Nv.hexlify)(super.decode(e))}};su.BytesCoder=e1});var Iv=M(Dp=>{"use strict";Object.defineProperty(Dp,"__esModule",{value:!0});Dp.FixedBytesCoder=void 0;var r1=me(),iM=Is(),oM=yn(),n1=class extends oM.Coder{size;constructor(e,t){let n="bytes"+String(e);super(n,n,t,!1),(0,r1.defineProperties)(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,t){let n=(0,r1.getBytesCopy)(iM.Typed.dereference(t,this.type));return n.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(n)}decode(e){return(0,r1.hexlify)(e.readBytes(this.size))}};Dp.FixedBytesCoder=n1});var Rv=M(Hp=>{"use strict";Object.defineProperty(Hp,"__esModule",{value:!0});Hp.NullCoder=void 0;var aM=yn(),cM=new Uint8Array([]),s1=class extends aM.Coder{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return t!=null&&this._throwError("not null",t),e.writeBytes(cM)}decode(e){return e.readBytes(0),null}};Hp.NullCoder=s1});var Mv=M($p=>{"use strict";Object.defineProperty($p,"__esModule",{value:!0});$p.NumberCoder=void 0;var po=me(),uM=Is(),i1=yn(),lM=BigInt(0),fM=BigInt(1),dM=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),o1=class extends i1.Coder{size;signed;constructor(e,t,n){let s=(t?"int":"uint")+e*8;super(s,s,n,!1),(0,po.defineProperties)(this,{size:e,signed:t},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,t){let n=(0,po.getBigInt)(uM.Typed.dereference(t,this.type)),s=(0,po.mask)(dM,i1.WordSize*8);if(this.signed){let i=(0,po.mask)(s,this.size*8-1);(n>i||n<-(i+fM))&&this._throwError("value out-of-bounds",t),n=(0,po.toTwos)(n,8*i1.WordSize)}else(n<lM||n>(0,po.mask)(s,this.size*8))&&this._throwError("value out-of-bounds",t);return e.writeValue(n)}decode(e){let t=(0,po.mask)(e.readValue(),this.size*8);return this.signed&&(t=(0,po.fromTwos)(t,this.size*8)),t}};$p.NumberCoder=o1});var jv=M(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});qp.StringCoder=void 0;var Lv=R0(),pM=Is(),hM=t1(),a1=class extends hM.DynamicBytesCoder{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,(0,Lv.toUtf8Bytes)(pM.Typed.dereference(t,"string")))}decode(e){return(0,Lv.toUtf8String)(super.decode(e))}};qp.StringCoder=a1});var Fv=M(Gp=>{"use strict";Object.defineProperty(Gp,"__esModule",{value:!0});Gp.TupleCoder=void 0;var mM=Yi(),bM=Is(),gM=yn(),Uv=Zy(),c1=class extends gM.Coder{coders;constructor(e,t){let n=!1,s=[];e.forEach(o=>{o.dynamic&&(n=!0),s.push(o.type)});let i="tuple("+s.join(",")+")";super("tuple",i,t,n),(0,mM.defineProperties)(this,{coders:Object.freeze(e.slice())})}defaultValue(){let e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});let t=this.coders.reduce((n,s)=>{let i=s.localName;return i&&(n[i]||(n[i]=0),n[i]++),n},{});return this.coders.forEach((n,s)=>{let i=n.localName;!i||t[i]!==1||(i==="length"&&(i="_length"),e[i]==null&&(e[i]=e[s]))}),Object.freeze(e)}encode(e,t){let n=bM.Typed.dereference(t,"tuple");return(0,Uv.pack)(e,this.coders,n)}decode(e){return(0,Uv.unpack)(e,this.coders)}};Gp.TupleCoder=c1});var u1=M(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});zp.id=void 0;var xM=nr(),yM=me();function wM(r){return(0,xM.keccak256)((0,yM.toUtf8Bytes)(r))}zp.id=wM});var mT=M(Tn=>{"use strict";var AM="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI",Dv=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),Hv=4;function EM(r){let e=0;function t(){return r[e++]<<8|r[e++]}let n=t(),s=1,i=[0,1];for(let k=1;k<n;k++)i.push(s+=t());let o=t(),a=e;e+=o;let c=0,u=0;function l(){return c==0&&(u=u<<8|r[e++],c=8),u>>--c&1}let f=31,d=2**f,h=d>>>1,b=h>>1,p=d-1,g=0;for(let k=0;k<f;k++)g=g<<1|l();let m=[],y=0,E=d;for(;;){let k=Math.floor(((g-y+1)*s-1)/E),w=0,P=n;for(;P-w>1;){let _=w+P>>>1;k<i[_]?P=_:w=_}if(w==0)break;m.push(w);let B=y+Math.floor(E*i[w]/s),Z=y+Math.floor(E*i[w+1]/s)-1;for(;((B^Z)&h)==0;)g=g<<1&p|l(),B=B<<1&p,Z=Z<<1&p|1;for(;B&~Z&b;)g=g&h|g<<1&p>>>1|l(),B=B<<1^h,Z=(Z^h)<<1|h|1;y=B,E=1+Z-B}let v=n-4;return m.map(k=>{switch(k-v){case 3:return v+65792+(r[a++]<<16|r[a++]<<8|r[a++]);case 2:return v+256+(r[a++]<<8|r[a++]);case 1:return v+r[a++];default:return k-1}})}function vM(r){let e=0;return()=>r[e++]}function Vv(r){return vM(EM(TM(r)))}function TM(r){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,i)=>e[s.charCodeAt(0)]=i);let t=r.length,n=new Uint8Array(6*t>>3);for(let s=0,i=0,o=0,a=0;s<t;s++)a=a<<6|e[r.charCodeAt(s)],o+=6,o>=8&&(n[i++]=a>>(o-=8));return n}function PM(r){return r&1?~r>>1:r>>1}function kM(r,e){let t=Array(r);for(let n=0,s=0;n<r;n++)t[n]=s+=PM(e());return t}function If(r,e=0){let t=[];for(;;){let n=r(),s=r();if(!s)break;e+=n;for(let i=0;i<s;i++)t.push(e+i);e+=s+1}return t}function Kv(r){return Rf(()=>{let e=If(r);if(e.length)return e})}function Jv(r){let e=[];for(;;){let t=r();if(t==0)break;e.push(BM(t,r))}for(;;){let t=r()-1;if(t<0)break;e.push(SM(t,r))}return e.flat()}function Rf(r){let e=[];for(;;){let t=r(e.length);if(!t)break;e.push(t)}return e}function Wv(r,e,t){let n=Array(r).fill().map(()=>[]);for(let s=0;s<e;s++)kM(r,t).forEach((i,o)=>n[o].push(i));return n}function BM(r,e){let t=1+e(),n=e(),s=Rf(e);return Wv(s.length,1+r,e).flatMap((o,a)=>{let[c,...u]=o;return Array(s[a]).fill().map((l,f)=>{let d=f*n;return[c+f*t,u.map(h=>h+d)]})})}function SM(r,e){let t=1+e();return Wv(t,1+r,e).map(s=>[s[0],s.slice(1)])}function OM(r){let e=[],t=If(r);return s(n([]),[]),e;function n(i){let o=r(),a=Rf(()=>{let c=If(r).map(u=>t[u]);if(c.length)return n(c)});return{S:o,B:a,Q:i}}function s({S:i,B:o},a,c){if(!(i&4&&c===a[a.length-1])){i&2&&(c=a[a.length-1]),i&1&&e.push(a);for(let u of o)for(let l of u.Q)s(u,[...a,l],c)}}}function _M(r){return r.toString(16).toUpperCase().padStart(2,"0")}function Qv(r){return`{${_M(r)}}`}function y1(r){let e=[];for(let t=0,n=r.length;t<n;){let s=r.codePointAt(t);t+=s<65536?1:2,e.push(s)}return e}function mo(r){let t=r.length;if(t<4096)return String.fromCodePoint(...r);let n=[];for(let s=0;s<t;)n.push(String.fromCodePoint(...r.slice(s,s+=4096)));return n.join("")}function Yv(r,e){let t=r.length,n=t-e.length;for(let s=0;n==0&&s<t;s++)n=r[s]-e[s];return n}var CM="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g",Mf=44032,Kp=4352,Jp=4449,Wp=4519,Zv=19,Xv=21,au=28,Qp=Xv*au,NM=Zv*Qp,IM=Mf+NM,RM=Kp+Zv,MM=Jp+Xv,LM=Wp+au;function _f(r){return r>>24&255}function eT(r){return r&16777215}var p1,$v,h1,Vp;function jM(){let r=Vv(CM);p1=new Map(Kv(r).flatMap((e,t)=>e.map(n=>[n,t+1<<24]))),$v=new Set(If(r)),h1=new Map,Vp=new Map;for(let[e,t]of Jv(r)){if(!$v.has(e)&&t.length==2){let[n,s]=t,i=Vp.get(n);i||(i=new Map,Vp.set(n,i)),i.set(s,e)}h1.set(e,t.reverse())}}function tT(r){return r>=Mf&&r<IM}function UM(r,e){if(r>=Kp&&r<RM&&e>=Jp&&e<MM)return Mf+(r-Kp)*Qp+(e-Jp)*au;if(tT(r)&&e>Wp&&e<LM&&(r-Mf)%au==0)return r+(e-Wp);{let t=Vp.get(r);return t&&(t=t.get(e),t)?t:-1}}function rT(r){p1||jM();let e=[],t=[],n=!1;function s(i){let o=p1.get(i);o&&(n=!0,i|=o),e.push(i)}for(let i of r)for(;;){if(i<128)e.push(i);else if(tT(i)){let o=i-Mf,a=o/Qp|0,c=o%Qp/au|0,u=o%au;s(Kp+a),s(Jp+c),u>0&&s(Wp+u)}else{let o=h1.get(i);o?t.push(...o):s(i)}if(!t.length)break;i=t.pop()}if(n&&e.length>1){let i=_f(e[0]);for(let o=1;o<e.length;o++){let a=_f(e[o]);if(a==0||i<=a){i=a;continue}let c=o-1;for(;;){let u=e[c+1];if(e[c+1]=e[c],e[c]=u,!c||(i=_f(e[--c]),i<=a))break}i=_f(e[o])}}return e}function FM(r){let e=[],t=[],n=-1,s=0;for(let i of r){let o=_f(i),a=eT(i);if(n==-1)o==0?n=a:e.push(a);else if(s>0&&s>=o)o==0?(e.push(n,...t),t.length=0,n=a):t.push(a),s=o;else{let c=UM(n,a);c>=0?n=c:s==0&&o==0?(e.push(n),n=a):(t.push(a),s=o)}}return n>=0&&e.push(n,...t),e}function eh(r){return rT(r).map(eT)}function cu(r){return FM(rT(r))}var qv=45,DM=46,Yp=".",nT=65039,sT=1,Zp=r=>Array.from(r);function Lf(r,e){return r.P.has(e)||r.Q.has(e)}var m1=class extends Array{get is_emoji(){return!0}},Xp,w1,Ca,b1,iT,oT,ou,l1,iu,ho,g1,x1;function uu(){if(Xp)return;let r=Vv(AM),e=()=>If(r),t=()=>new Set(e()),n=(l,f)=>f.forEach(d=>l.add(d));Xp=new Map(Jv(r)),w1=t(),Ca=e(),b1=new Set(e().map(l=>Ca[l])),Ca=new Set(Ca),iT=t(),oT=t();let s=Kv(r),i=r(),o=()=>{let l=new Set;return e().forEach(f=>n(l,s[f])),n(l,e()),l};ou=Rf(l=>{let f=Rf(r).map(d=>d+96);if(f.length){let d=l>=i;f[0]-=32,f=mo(f),d&&(f=`Restricted[${f}]`);let h=o(),b=o(),p=!r();return{N:f,P:h,Q:b,M:p,R:d}}}),l1=t(),iu=new Map;let a=e().concat(Zp(l1)).sort((l,f)=>l-f);a.forEach((l,f)=>{let d=r(),h=a[f]=d?a[f-d]:{V:[],M:new Map};h.V.push(l),l1.has(l)||iu.set(l,h)});for(let{V:l,M:f}of new Set(iu.values())){let d=[];for(let b of l){let p=ou.filter(m=>Lf(m,b)),g=d.find(({G:m})=>p.some(y=>m.has(y)));g||(g={G:new Set,V:[]},d.push(g)),g.V.push(b),n(g.G,p)}let h=d.flatMap(b=>Zp(b.G));for(let{G:b,V:p}of d){let g=new Set(h.filter(m=>!b.has(m)));for(let m of p)f.set(m,g)}}ho=new Set;let c=new Set,u=l=>ho.has(l)?c.add(l):ho.add(l);for(let l of ou){for(let f of l.P)u(f);for(let f of l.Q)u(f)}for(let l of ho)!iu.has(l)&&!c.has(l)&&iu.set(l,sT);n(ho,eh(ho)),g1=OM(r).map(l=>m1.from(l)).sort(Yv),x1=new Map;for(let l of g1){let f=[x1];for(let d of l){let h=f.map(b=>{let p=b.get(d);return p||(p=new Map,b.set(d,p)),p});d===nT?f.push(...h):f=h}for(let d of f)d.V=l}}function A1(r){return(v1(r)?"":`${E1(jf([r]))} `)+Qv(r)}function E1(r){return`"${r}"\u200E`}function HM(r){if(r.length>=4&&r[2]==qv&&r[3]==qv)throw new Error(`invalid label extension: "${mo(r.slice(0,4))}"`)}function $M(r){for(let t=r.lastIndexOf(95);t>0;)if(r[--t]!==95)throw new Error("underscore allowed only at start")}function qM(r){let e=r[0],t=Dv.get(e);if(t)throw Cf(`leading ${t}`);let n=r.length,s=-1;for(let i=1;i<n;i++){e=r[i];let o=Dv.get(e);if(o){if(s==i)throw Cf(`${t} + ${o}`);s=i+1,t=o}}if(s==n)throw Cf(`trailing ${t}`)}function jf(r,e=1/0,t=Qv){let n=[];aT(r[0])&&n.push("\u25CC"),r.length>e&&(e>>=1,r=[...r.slice(0,e),8230,...r.slice(-e)]);let s=0,i=r.length;for(let o=0;o<i;o++){let a=r[o];v1(a)&&(n.push(mo(r.slice(s,o))),n.push(t(a)),s=o+1)}return n.push(mo(r.slice(s,i))),n.join("")}function aT(r){return uu(),Ca.has(r)}function v1(r){return uu(),iT.has(r)}function GM(){return uu(),g1.map(r=>r.slice())}function zM(r,e){uu();let t=e?eh:cu;return r.split(Yp).map(n=>mo(fT(y1(n),t,th).flat())).join(Yp)}function VM(r){return cT(T1(r,cu,th))}function KM(r){let e=T1(r,cu,t=>t);for(let{type:t,output:n,error:s}of e){if(s)break;t!=="Greek"&&JM(n,958,926)}return cT(e)}function JM(r,e,t){let n=0;for(;;){let s=r.indexOf(e,n);if(s<0)break;r[s]=t,n=s+1}}function WM(r,e){return T1(r,cu,e?t=>t.slice():th)}function T1(r,e,t){if(!r)return[];uu();let n=0;return r.split(Yp).map(s=>{let i=y1(s),o={input:i,offset:n};n+=i.length+1;try{let a=o.tokens=fT(i,e,t),c=a.length,u;if(!c)throw new Error("empty label");let l=o.output=a.flat();if($M(l),!(o.emoji=c>1||a[0].is_emoji)&&l.every(d=>d<128))HM(l),u="ASCII";else{let d=a.flatMap(h=>h.is_emoji?[]:h);if(!d.length)u="Emoji";else{if(Ca.has(l[0]))throw Cf("leading combining mark");for(let p=1;p<c;p++){let g=a[p];if(!g.is_emoji&&Ca.has(g[0]))throw Cf(`emoji + combining mark: "${mo(a[p-1])} + ${jf([g[0]])}"`)}qM(l);let h=Zp(new Set(d)),[b]=YM(h);ZM(b,d),QM(b,h),u=b.N}}o.type=u}catch(a){o.error=a}return o})}function QM(r,e){let t,n=[];for(let s of e){let i=iu.get(s);if(i===sT)return;if(i){let o=i.M.get(s);if(t=t?t.filter(a=>o.has(a)):Zp(o),!t.length)return}else n.push(s)}if(t){for(let s of t)if(n.every(i=>Lf(s,i)))throw new Error(`whole-script confusable: ${r.N}/${s.N}`)}}function YM(r){let e=ou;for(let t of r){let n=e.filter(s=>Lf(s,t));if(!n.length)throw ou.some(s=>Lf(s,t))?lT(e[0],t):uT(t);if(e=n,n.length==1)break}return e}function cT(r){return r.map(({input:e,error:t,output:n})=>{if(t){let s=t.message;throw new Error(r.length==1?s:`Invalid label ${E1(jf(e,63))}: ${s}`)}return mo(n)}).join(Yp)}function uT(r){return new Error(`disallowed character: ${A1(r)}`)}function lT(r,e){let t=A1(e),n=ou.find(s=>s.P.has(e));return n&&(t=`${n.N} ${t}`),new Error(`illegal mixture: ${r.N} + ${t}`)}function Cf(r){return new Error(`illegal placement: ${r}`)}function ZM(r,e){for(let t of e)if(!Lf(r,t))throw lT(r,t);if(r.M){let t=eh(e);for(let n=1,s=t.length;n<s;n++)if(b1.has(t[n])){let i=n+1;for(let o;i<s&&b1.has(o=t[i]);i++)for(let a=n;a<i;a++)if(t[a]==o)throw new Error(`duplicate non-spacing marks: ${A1(o)}`);if(i-n>Hv)throw new Error(`excessive non-spacing marks: ${E1(jf(t.slice(n-1,i)))} (${i-n}/${Hv})`);n=i}}}function fT(r,e,t){let n=[],s=[];for(r=r.slice().reverse();r.length;){let i=dT(r);if(i)s.length&&(n.push(e(s)),s=[]),n.push(t(i));else{let o=r.pop();if(ho.has(o))s.push(o);else{let a=Xp.get(o);if(a)s.push(...a);else if(!w1.has(o))throw uT(o)}}}return s.length&&n.push(e(s)),n}function th(r){return r.filter(e=>e!=nT)}function dT(r,e){let t=x1,n,s=r.length;for(;s&&(t=t.get(r[--s]),!!t);){let{V:i}=t;i&&(n=i,e&&e.push(...r.slice(s).reverse()),r.length=s)}return n}var Nf="valid",pT="mapped",f1="ignored",XM="disallowed",eL="emoji",tL="nfc",rL="stop";function hT(r,{nf:e=!0}={}){uu();let t=y1(r).reverse(),n=[],s=[];for(;t.length;){let i=dT(t,n);if(i)s.push({type:eL,emoji:i.slice(),input:n,cps:th(i)}),n=[];else{let o=t.pop();if(o==DM)s.push({type:rL,cp:o});else if(ho.has(o))s.push({type:Nf,cps:[o]});else if(w1.has(o))s.push({type:f1,cp:o});else{let a=Xp.get(o);a?s.push({type:pT,cp:o,cps:a.slice()}):s.push({type:XM,cp:o})}}}if(e)for(let i=0,o=-1;i<s.length;i++){let a=s[i];if(d1(a.type))if(Gv(a.cps)){let c=i+1;for(let d=c;d<s.length;d++){let{type:h,cps:b}=s[d];if(d1(h)){if(!Gv(b))break;c=d+1}else if(h!==f1)break}o<0&&(o=i);let u=s.slice(o,c),l=u.flatMap(d=>d1(d.type)?d.cps:[]),f=cu(l);Yv(f,l)?(s.splice(o,c-o,{type:tL,input:l,cps:f,tokens0:zv(u),tokens:hT(mo(f),{nf:!1})}),i=o):i=c-1,o=-1}else o=i;else a.type!==f1&&(o=-1)}return zv(s)}function d1(r){return r==Nf||r==pT}function Gv(r){return r.some(e=>oT.has(e))}function zv(r){for(let e=0;e<r.length;e++)if(r[e].type==Nf){let t=e+1;for(;t<r.length&&r[t].type==Nf;)t++;r.splice(e,t-e,{type:Nf,cps:r.slice(e,t).flatMap(n=>n.cps)})}return r}Tn.ens_beautify=KM;Tn.ens_emoji=GM;Tn.ens_normalize=VM;Tn.ens_normalize_fragment=zM;Tn.ens_split=WM;Tn.ens_tokenize=hT;Tn.is_combining_mark=aT;Tn.nfc=cu;Tn.nfd=eh;Tn.safe_str_from_cps=jf;Tn.should_escape=v1});var wT=M(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.dnsEncode=Rs.namehash=Rs.isValidName=Rs.ensNormalize=void 0;var bT=nr(),Pn=me(),nL=mT(),xT=new Uint8Array(32);xT.fill(0);function gT(r){return(0,Pn.assertArgument)(r.length!==0,"invalid ENS name; empty component","comp",r),r}function P1(r){let e=(0,Pn.toUtf8Bytes)(yT(r)),t=[];if(r.length===0)return t;let n=0;for(let s=0;s<e.length;s++)e[s]===46&&(t.push(gT(e.slice(n,s))),n=s+1);return(0,Pn.assertArgument)(n<e.length,"invalid ENS name; empty component","name",r),t.push(gT(e.slice(n))),t}function yT(r){try{if(r.length===0)throw new Error("empty label");return(0,nL.ens_normalize)(r)}catch(e){(0,Pn.assertArgument)(!1,`invalid ENS name (${e.message})`,"name",r)}}Rs.ensNormalize=yT;function sL(r){try{return P1(r).length!==0}catch{}return!1}Rs.isValidName=sL;function iL(r){(0,Pn.assertArgument)(typeof r=="string","invalid ENS name; not a string","name",r),(0,Pn.assertArgument)(r.length,"invalid ENS name (empty label)","name",r);let e=xT,t=P1(r);for(;t.length;)e=(0,bT.keccak256)((0,Pn.concat)([e,(0,bT.keccak256)(t.pop())]));return(0,Pn.hexlify)(e)}Rs.namehash=iL;function oL(r,e){let t=e??63;return(0,Pn.assertArgument)(t<=255,"DNS encoded label cannot exceed 255","length",t),(0,Pn.hexlify)((0,Pn.concat)(P1(r).map(n=>{(0,Pn.assertArgument)(n.length<=t,`label ${JSON.stringify(r)} exceeds ${t} bytes`,"name",r);let s=new Uint8Array(n.length+1);return s.set(n,1),s[0]=s.length-1,s})))+"00"}Rs.dnsEncode=oL});var B1=M(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});rh.accessListify=void 0;var aL=Yt(),Uf=me();function k1(r,e){return{address:(0,aL.getAddress)(r),storageKeys:e.map((t,n)=>((0,Uf.assertArgument)((0,Uf.isHexString)(t,32),"invalid slot",`storageKeys[${n}]`,t),t.toLowerCase()))}}function cL(r){if(Array.isArray(r))return r.map((t,n)=>Array.isArray(t)?((0,Uf.assertArgument)(t.length===2,"invalid slot set",`value[${n}]`,t),k1(t[0],t[1])):((0,Uf.assertArgument)(t!=null&&typeof t=="object","invalid address-slot set","value",r),k1(t.address,t.storageKeys)));(0,Uf.assertArgument)(r!=null&&typeof r=="object","invalid access list","value",r);let e=Object.keys(r).map(t=>{let n=r[t].reduce((s,i)=>(s[i]=!0,s),{});return k1(t,Object.keys(n).sort())});return e.sort((t,n)=>t.address.localeCompare(n.address)),e}rh.accessListify=cL});var O1=M(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.recoverAddress=lu.computeAddress=void 0;var uL=Yt(),S1=nr();function AT(r){let e;return typeof r=="string"?e=S1.SigningKey.computePublicKey(r,!1):e=r.publicKey,(0,uL.getAddress)((0,S1.keccak256)("0x"+e.substring(4)).substring(26))}lu.computeAddress=AT;function lL(r,e){return AT(S1.SigningKey.recoverPublicKey(r,e))}lu.recoverAddress=lL});var PT=M(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});sh.Transaction=void 0;var vT=Yt(),TT=$y(),xi=nr(),ie=me(),C1=B1(),fL=O1(),sr=BigInt(0),dL=BigInt(2),pL=BigInt(27),hL=BigInt(28),mL=BigInt(35),bL=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),_1=4096*32;function ET(r,e){let t=r.toString(16);for(;t.length<2;)t="0"+t;return t+=(0,xi.sha256)(e).substring(4),"0x"+t}function nh(r){return r==="0x"?null:(0,vT.getAddress)(r)}function N1(r,e){try{return(0,C1.accessListify)(r)}catch(t){(0,ie.assertArgument)(!1,t.message,e,r)}}function Ff(r,e){return r==="0x"?0:(0,ie.getNumber)(r,e)}function jt(r,e){if(r==="0x")return sr;let t=(0,ie.getBigInt)(r,e);return(0,ie.assertArgument)(t<=bL,"value exceeds uint size",e,t),t}function xt(r,e){let t=(0,ie.getBigInt)(r,"value"),n=(0,ie.toBeArray)(t);return(0,ie.assertArgument)(n.length<=32,"value too large",`tx.${e}`,t),n}function I1(r){return(0,C1.accessListify)(r).map(e=>[e.address,e.storageKeys])}function gL(r,e){(0,ie.assertArgument)(Array.isArray(r),`invalid ${e}`,"value",r);for(let t=0;t<r.length;t++)(0,ie.assertArgument)((0,ie.isHexString)(r[t],32),"invalid ${ param } hash",`value[${t}]`,r[t]);return r}function xL(r){let e=(0,ie.decodeRlp)(r);(0,ie.assertArgument)(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",r);let t={type:0,nonce:Ff(e[0],"nonce"),gasPrice:jt(e[1],"gasPrice"),gasLimit:jt(e[2],"gasLimit"),to:nh(e[3]),value:jt(e[4],"value"),data:(0,ie.hexlify)(e[5]),chainId:sr};if(e.length===6)return t;let n=jt(e[6],"v"),s=jt(e[7],"r"),i=jt(e[8],"s");if(s===sr&&i===sr)t.chainId=n;else{let o=(n-mL)/dL;o<sr&&(o=sr),t.chainId=o,(0,ie.assertArgument)(o!==sr||n===pL||n===hL,"non-canonical legacy v","v",e[6]),t.signature=xi.Signature.from({r:(0,ie.zeroPadValue)(e[7],32),s:(0,ie.zeroPadValue)(e[8],32),v:n})}return t}function yL(r,e){let t=[xt(r.nonce,"nonce"),xt(r.gasPrice||0,"gasPrice"),xt(r.gasLimit,"gasLimit"),r.to||"0x",xt(r.value,"value"),r.data],n=sr;if(r.chainId!=sr)n=(0,ie.getBigInt)(r.chainId,"tx.chainId"),(0,ie.assertArgument)(!e||e.networkV==null||e.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",e);else if(r.signature){let i=r.signature.legacyChainId;i!=null&&(n=i)}if(!e)return n!==sr&&(t.push((0,ie.toBeArray)(n)),t.push("0x"),t.push("0x")),(0,ie.encodeRlp)(t);let s=BigInt(27+e.yParity);return n!==sr?s=xi.Signature.getChainIdV(n,e.v):BigInt(e.v)!==s&&(0,ie.assertArgument)(!1,"tx.chainId/sig.v mismatch","sig",e),t.push((0,ie.toBeArray)(s)),t.push((0,ie.toBeArray)(e.r)),t.push((0,ie.toBeArray)(e.s)),(0,ie.encodeRlp)(t)}function R1(r,e){let t;try{if(t=Ff(e[0],"yParity"),t!==0&&t!==1)throw new Error("bad yParity")}catch{(0,ie.assertArgument)(!1,"invalid yParity","yParity",e[0])}let n=(0,ie.zeroPadValue)(e[1],32),s=(0,ie.zeroPadValue)(e[2],32),i=xi.Signature.from({r:n,s,yParity:t});r.signature=i}function wL(r){let e=(0,ie.decodeRlp)((0,ie.getBytes)(r).slice(1));(0,ie.assertArgument)(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",(0,ie.hexlify)(r));let t={type:2,chainId:jt(e[0],"chainId"),nonce:Ff(e[1],"nonce"),maxPriorityFeePerGas:jt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:jt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:jt(e[4],"gasLimit"),to:nh(e[5]),value:jt(e[6],"value"),data:(0,ie.hexlify)(e[7]),accessList:N1(e[8],"accessList")};return e.length===9||R1(t,e.slice(9)),t}function AL(r,e){let t=[xt(r.chainId,"chainId"),xt(r.nonce,"nonce"),xt(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),xt(r.maxFeePerGas||0,"maxFeePerGas"),xt(r.gasLimit,"gasLimit"),r.to||"0x",xt(r.value,"value"),r.data,I1(r.accessList||[])];return e&&(t.push(xt(e.yParity,"yParity")),t.push((0,ie.toBeArray)(e.r)),t.push((0,ie.toBeArray)(e.s))),(0,ie.concat)(["0x02",(0,ie.encodeRlp)(t)])}function EL(r){let e=(0,ie.decodeRlp)((0,ie.getBytes)(r).slice(1));(0,ie.assertArgument)(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",(0,ie.hexlify)(r));let t={type:1,chainId:jt(e[0],"chainId"),nonce:Ff(e[1],"nonce"),gasPrice:jt(e[2],"gasPrice"),gasLimit:jt(e[3],"gasLimit"),to:nh(e[4]),value:jt(e[5],"value"),data:(0,ie.hexlify)(e[6]),accessList:N1(e[7],"accessList")};return e.length===8||R1(t,e.slice(8)),t}function vL(r,e){let t=[xt(r.chainId,"chainId"),xt(r.nonce,"nonce"),xt(r.gasPrice||0,"gasPrice"),xt(r.gasLimit,"gasLimit"),r.to||"0x",xt(r.value,"value"),r.data,I1(r.accessList||[])];return e&&(t.push(xt(e.yParity,"recoveryParam")),t.push((0,ie.toBeArray)(e.r)),t.push((0,ie.toBeArray)(e.s))),(0,ie.concat)(["0x01",(0,ie.encodeRlp)(t)])}function TL(r){let e=(0,ie.decodeRlp)((0,ie.getBytes)(r).slice(1)),t="3",n=null;if(e.length===4&&Array.isArray(e[0])){t="3 (network format)";let i=e[1],o=e[2],a=e[3];(0,ie.assertArgument)(Array.isArray(i),"invalid network format: blobs not an array","fields[1]",i),(0,ie.assertArgument)(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),(0,ie.assertArgument)(Array.isArray(a),"invalid network format: proofs not an array","fields[3]",a),(0,ie.assertArgument)(i.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",e),(0,ie.assertArgument)(i.length===a.length,"invalid network format: blobs/proofs length mismatch","fields",e),n=[];for(let c=0;c<e[1].length;c++)n.push({data:i[c],commitment:o[c],proof:a[c]});e=e[0]}(0,ie.assertArgument)(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${t}`,"data",(0,ie.hexlify)(r));let s={type:3,chainId:jt(e[0],"chainId"),nonce:Ff(e[1],"nonce"),maxPriorityFeePerGas:jt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:jt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:jt(e[4],"gasLimit"),to:nh(e[5]),value:jt(e[6],"value"),data:(0,ie.hexlify)(e[7]),accessList:N1(e[8],"accessList"),maxFeePerBlobGas:jt(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10]};n&&(s.blobs=n),(0,ie.assertArgument)(s.to!=null,`invalid address for transaction type: ${t}`,"data",r),(0,ie.assertArgument)(Array.isArray(s.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",r);for(let i=0;i<s.blobVersionedHashes.length;i++)(0,ie.assertArgument)((0,ie.isHexString)(s.blobVersionedHashes[i],32),`invalid blobVersionedHash at index ${i}: must be length 32`,"data",r);return e.length===11||R1(s,e.slice(11)),s}function PL(r,e,t){let n=[xt(r.chainId,"chainId"),xt(r.nonce,"nonce"),xt(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),xt(r.maxFeePerGas||0,"maxFeePerGas"),xt(r.gasLimit,"gasLimit"),r.to||TT.ZeroAddress,xt(r.value,"value"),r.data,I1(r.accessList||[]),xt(r.maxFeePerBlobGas||0,"maxFeePerBlobGas"),gL(r.blobVersionedHashes||[],"blobVersionedHashes")];return e&&(n.push(xt(e.yParity,"yParity")),n.push((0,ie.toBeArray)(e.r)),n.push((0,ie.toBeArray)(e.s)),t)?(0,ie.concat)(["0x03",(0,ie.encodeRlp)([n,t.map(s=>s.data),t.map(s=>s.commitment),t.map(s=>s.proof)])]):(0,ie.concat)(["0x03",(0,ie.encodeRlp)(n)])}var us=class{#e;#t;#r;#n;#s;#o;#i;#a;#f;#u;#h;#m;#c;#l;#d;#p;get type(){return this.#e}set type(e){switch(e){case null:this.#e=null;break;case 0:case"legacy":this.#e=0;break;case 1:case"berlin":case"eip-2930":this.#e=1;break;case 2:case"london":case"eip-1559":this.#e=2;break;case 3:case"cancun":case"eip-4844":this.#e=3;break;default:(0,ie.assertArgument)(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844"}return null}get to(){let e=this.#t;return e==null&&this.type===3?TT.ZeroAddress:e}set to(e){this.#t=e==null?null:(0,vT.getAddress)(e)}get nonce(){return this.#n}set nonce(e){this.#n=(0,ie.getNumber)(e,"value")}get gasLimit(){return this.#s}set gasLimit(e){this.#s=(0,ie.getBigInt)(e)}get gasPrice(){let e=this.#o;return e==null&&(this.type===0||this.type===1)?sr:e}set gasPrice(e){this.#o=e==null?null:(0,ie.getBigInt)(e,"gasPrice")}get maxPriorityFeePerGas(){let e=this.#i;return e??(this.type===2||this.type===3?sr:null)}set maxPriorityFeePerGas(e){this.#i=e==null?null:(0,ie.getBigInt)(e,"maxPriorityFeePerGas")}get maxFeePerGas(){let e=this.#a;return e??(this.type===2||this.type===3?sr:null)}set maxFeePerGas(e){this.#a=e==null?null:(0,ie.getBigInt)(e,"maxFeePerGas")}get data(){return this.#r}set data(e){this.#r=(0,ie.hexlify)(e)}get value(){return this.#f}set value(e){this.#f=(0,ie.getBigInt)(e,"value")}get chainId(){return this.#u}set chainId(e){this.#u=(0,ie.getBigInt)(e)}get signature(){return this.#h||null}set signature(e){this.#h=e==null?null:xi.Signature.from(e)}get accessList(){let e=this.#m||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){this.#m=e==null?null:(0,C1.accessListify)(e)}get maxFeePerBlobGas(){let e=this.#c;return e==null&&this.type===3?sr:e}set maxFeePerBlobGas(e){this.#c=e==null?null:(0,ie.getBigInt)(e,"maxFeePerBlobGas")}get blobVersionedHashes(){let e=this.#l;return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){(0,ie.assertArgument)(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let t=0;t<e.length;t++)(0,ie.assertArgument)((0,ie.isHexString)(e[t],32),"invalid blobVersionedHash",`value[${t}]`,e[t])}this.#l=e}get blobs(){return this.#p==null?null:this.#p.map(e=>Object.assign({},e))}set blobs(e){if(e==null){this.#p=null;return}let t=[],n=[];for(let s=0;s<e.length;s++){let i=e[s];if((0,ie.isBytesLike)(i)){(0,ie.assert)(this.#d,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let o=(0,ie.getBytes)(i);if((0,ie.assertArgument)(o.length<=_1,"blob is too large",`blobs[${s}]`,i),o.length!==_1){let u=new Uint8Array(_1);u.set(o),o=u}let a=this.#d.blobToKzgCommitment(o),c=(0,ie.hexlify)(this.#d.computeBlobKzgProof(o,a));t.push({data:(0,ie.hexlify)(o),commitment:(0,ie.hexlify)(a),proof:c}),n.push(ET(1,a))}else{let o=(0,ie.hexlify)(i.commitment);t.push({data:(0,ie.hexlify)(i.data),commitment:o,proof:(0,ie.hexlify)(i.proof)}),n.push(ET(1,o))}}this.#p=t,this.#l=n}get kzg(){return this.#d}set kzg(e){this.#d=e}constructor(){this.#e=null,this.#t=null,this.#n=0,this.#s=sr,this.#o=null,this.#i=null,this.#a=null,this.#r="0x",this.#f=sr,this.#u=sr,this.#h=null,this.#m=null,this.#c=null,this.#l=null,this.#p=null,this.#d=null}get hash(){return this.signature==null?null:(0,xi.keccak256)(this.#b(!0,!1))}get unsignedHash(){return(0,xi.keccak256)(this.unsignedSerialized)}get from(){return this.signature==null?null:(0,fL.recoverAddress)(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:xi.SigningKey.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}#b(e,t){(0,ie.assert)(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});let n=e?this.signature:null;switch(this.inferType()){case 0:return yL(this,n);case 1:return vL(this,n);case 2:return AL(this,n);case 3:return PL(this,n,t?this.blobs:null)}(0,ie.assert)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#b(!0,!0)}get unsignedSerialized(){return this.#b(!1,!1)}inferType(){let e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){let e=this.gasPrice!=null,t=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,s=this.#c!=null||this.#l;this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&(0,ie.assert)(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),(0,ie.assert)(!t||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),(0,ie.assert)(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});let i=[];return this.type!=null?i.push(this.type):t?i.push(2):e?(i.push(1),n||i.push(0)):n?(i.push(1),i.push(2)):(s&&this.to||(i.push(0),i.push(1),i.push(2)),i.push(3)),i.sort(),i}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return us.from(this)}toJSON(){let e=t=>t==null?null:t.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new us;if(typeof e=="string"){let n=(0,ie.getBytes)(e);if(n[0]>=127)return us.from(xL(n));switch(n[0]){case 1:return us.from(EL(n));case 2:return us.from(wL(n));case 3:return us.from(TL(n))}(0,ie.assert)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}let t=new us;return e.type!=null&&(t.type=e.type),e.to!=null&&(t.to=e.to),e.nonce!=null&&(t.nonce=e.nonce),e.gasLimit!=null&&(t.gasLimit=e.gasLimit),e.gasPrice!=null&&(t.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(t.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(t.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(t.data=e.data),e.value!=null&&(t.value=e.value),e.chainId!=null&&(t.chainId=e.chainId),e.signature!=null&&(t.signature=xi.Signature.from(e.signature)),e.accessList!=null&&(t.accessList=e.accessList),e.blobVersionedHashes!=null&&(t.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(t.kzg=e.kzg),e.blobs!=null&&(t.blobs=e.blobs),e.hash!=null&&((0,ie.assertArgument)(t.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),(0,ie.assertArgument)(t.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&((0,ie.assertArgument)(t.isSigned(),"unsigned transaction cannot define '.from'","tx",e),(0,ie.assertArgument)(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}};sh.Transaction=us});var qr=M(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.Transaction=Ms.recoverAddress=Ms.computeAddress=Ms.accessListify=void 0;var kL=B1();Object.defineProperty(Ms,"accessListify",{enumerable:!0,get:function(){return kL.accessListify}});var kT=O1();Object.defineProperty(Ms,"computeAddress",{enumerable:!0,get:function(){return kT.computeAddress}});Object.defineProperty(Ms,"recoverAddress",{enumerable:!0,get:function(){return kT.recoverAddress}});var BL=PT();Object.defineProperty(Ms,"Transaction",{enumerable:!0,get:function(){return BL.Transaction}})});var ST=M(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.verifyMessage=fu.hashMessage=void 0;var SL=nr(),OL=Xc(),_L=qr(),ih=me();function BT(r){return typeof r=="string"&&(r=(0,ih.toUtf8Bytes)(r)),(0,SL.keccak256)((0,ih.concat)([(0,ih.toUtf8Bytes)(OL.MessagePrefix),(0,ih.toUtf8Bytes)(String(r.length)),r]))}fu.hashMessage=BT;function CL(r,e){let t=BT(r);return(0,_L.recoverAddress)(t,e)}fu.verifyMessage=CL});var CT=M(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.solidityPackedSha256=bo.solidityPackedKeccak256=bo.solidityPacked=void 0;var NL=Yt(),OT=nr(),yt=me(),IL=new RegExp("^bytes([0-9]+)$"),RL=new RegExp("^(u?int)([0-9]*)$"),ML=new RegExp("^(.*)\\[([0-9]*)\\]$");function _T(r,e,t){switch(r){case"address":return t?(0,yt.getBytes)((0,yt.zeroPadValue)(e,32)):(0,yt.getBytes)((0,NL.getAddress)(e));case"string":return(0,yt.toUtf8Bytes)(e);case"bytes":return(0,yt.getBytes)(e);case"bool":return e=e?"0x01":"0x00",t?(0,yt.getBytes)((0,yt.zeroPadValue)(e,32)):(0,yt.getBytes)(e)}let n=r.match(RL);if(n){let s=n[1]==="int",i=parseInt(n[2]||"256");return(0,yt.assertArgument)((!n[2]||n[2]===String(i))&&i%8===0&&i!==0&&i<=256,"invalid number type","type",r),t&&(i=256),s&&(e=(0,yt.toTwos)(e,i)),(0,yt.getBytes)((0,yt.zeroPadValue)((0,yt.toBeArray)(e),i/8))}if(n=r.match(IL),n){let s=parseInt(n[1]);return(0,yt.assertArgument)(String(s)===n[1]&&s!==0&&s<=32,"invalid bytes type","type",r),(0,yt.assertArgument)((0,yt.dataLength)(e)===s,`invalid value for ${r}`,"value",e),t?(0,yt.getBytes)((0,yt.zeroPadBytes)(e,32)):e}if(n=r.match(ML),n&&Array.isArray(e)){let s=n[1],i=parseInt(n[2]||String(e.length));(0,yt.assertArgument)(i===e.length,`invalid array length for ${r}`,"value",e);let o=[];return e.forEach(function(a){o.push(_T(s,a,!0))}),(0,yt.getBytes)((0,yt.concat)(o))}(0,yt.assertArgument)(!1,"invalid type","type",r)}function M1(r,e){(0,yt.assertArgument)(r.length===e.length,"wrong number of values; expected ${ types.length }","values",e);let t=[];return r.forEach(function(n,s){t.push(_T(n,e[s]))}),(0,yt.hexlify)((0,yt.concat)(t))}bo.solidityPacked=M1;function LL(r,e){return(0,OT.keccak256)(M1(r,e))}bo.solidityPackedKeccak256=LL;function jL(r,e){return(0,OT.sha256)(M1(r,e))}bo.solidityPackedSha256=jL});var DT=M(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.verifyTypedData=pu.TypedDataEncoder=void 0;var MT=Yt(),du=nr(),UL=qr(),_e=me(),LT=u1(),jT=new Uint8Array(32);jT.fill(0);var FL=BigInt(-1),UT=BigInt(0),FT=BigInt(1),DL=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function HL(r){let e=(0,_e.getBytes)(r),t=e.length%32;return t?(0,_e.concat)([e,jT.slice(t)]):(0,_e.hexlify)(e)}var $L=(0,_e.toBeHex)(FT,32),qL=(0,_e.toBeHex)(UT,32),NT={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},L1=["name","version","chainId","verifyingContract","salt"];function IT(r){return function(e){return(0,_e.assertArgument)(typeof e=="string",`invalid domain value for ${JSON.stringify(r)}`,`domain.${r}`,e),e}}var GL={name:IT("name"),version:IT("version"),chainId:function(r){let e=(0,_e.getBigInt)(r,"domain.chainId");return(0,_e.assertArgument)(e>=0,"invalid chain ID","domain.chainId",r),Number.isSafeInteger(e)?Number(e):(0,_e.toQuantity)(e)},verifyingContract:function(r){try{return(0,MT.getAddress)(r).toLowerCase()}catch{}(0,_e.assertArgument)(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",r)},salt:function(r){let e=(0,_e.getBytes)(r,"domain.salt");return(0,_e.assertArgument)(e.length===32,'invalid domain value "salt"',"domain.salt",r),(0,_e.hexlify)(e)}};function j1(r){{let e=r.match(/^(u?)int(\d+)$/);if(e){let t=e[1]==="",n=parseInt(e[2]);(0,_e.assertArgument)(n%8===0&&n!==0&&n<=256&&e[2]===String(n),"invalid numeric width","type",r);let s=(0,_e.mask)(DL,t?n-1:n),i=t?(s+FT)*FL:UT;return function(o){let a=(0,_e.getBigInt)(o,"value");return(0,_e.assertArgument)(a>=i&&a<=s,`value out-of-bounds for ${r}`,"value",a),(0,_e.toBeHex)(t?(0,_e.toTwos)(a,256):a,32)}}}{let e=r.match(/^bytes(\d+)$/);if(e){let t=parseInt(e[1]);return(0,_e.assertArgument)(t!==0&&t<=32&&e[1]===String(t),"invalid bytes width","type",r),function(n){let s=(0,_e.getBytes)(n);return(0,_e.assertArgument)(s.length===t,`invalid length for ${r}`,"value",n),HL(n)}}}switch(r){case"address":return function(e){return(0,_e.zeroPadValue)((0,MT.getAddress)(e),32)};case"bool":return function(e){return e?$L:qL};case"bytes":return function(e){return(0,du.keccak256)(e)};case"string":return function(e){return(0,LT.id)(e)}}return null}function RT(r,e){return`${r}(${e.map(({name:t,type:n})=>n+" "+t).join(",")})`}function oh(r){let e=r.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:r}}var Sr=class{primaryType;#e;get types(){return JSON.parse(this.#e)}#t;#r;constructor(e){this.#t=new Map,this.#r=new Map;let t=new Map,n=new Map,s=new Map,i={};Object.keys(e).forEach(c=>{i[c]=e[c].map(({name:u,type:l})=>{let{base:f,index:d}=oh(l);return f==="int"&&!e.int&&(f="int256"),f==="uint"&&!e.uint&&(f="uint256"),{name:u,type:f+(d||"")}}),t.set(c,new Set),n.set(c,[]),s.set(c,new Set)}),this.#e=JSON.stringify(i);for(let c in i){let u=new Set;for(let l of i[c]){(0,_e.assertArgument)(!u.has(l.name),`duplicate variable name ${JSON.stringify(l.name)} in ${JSON.stringify(c)}`,"types",e),u.add(l.name);let f=oh(l.type).base;(0,_e.assertArgument)(f!==c,`circular type reference to ${JSON.stringify(f)}`,"types",e),!j1(f)&&((0,_e.assertArgument)(n.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),n.get(f).push(c),t.get(c).add(f))}}let o=Array.from(n.keys()).filter(c=>n.get(c).length===0);(0,_e.assertArgument)(o.length!==0,"missing primary type","types",e),(0,_e.assertArgument)(o.length===1,`ambiguous primary types or unused types: ${o.map(c=>JSON.stringify(c)).join(", ")}`,"types",e),(0,_e.defineProperties)(this,{primaryType:o[0]});function a(c,u){(0,_e.assertArgument)(!u.has(c),`circular type reference to ${JSON.stringify(c)}`,"types",e),u.add(c);for(let l of t.get(c))if(!!n.has(l)){a(l,u);for(let f of u)s.get(f).add(l)}u.delete(c)}a(this.primaryType,new Set);for(let[c,u]of s){let l=Array.from(u);l.sort(),this.#t.set(c,RT(c,i[c])+l.map(f=>RT(f,i[f])).join(""))}}getEncoder(e){let t=this.#r.get(e);return t||(t=this.#n(e),this.#r.set(e,t)),t}#n(e){{let s=j1(e);if(s)return s}let t=oh(e).array;if(t){let s=t.prefix,i=this.getEncoder(s);return o=>{(0,_e.assertArgument)(t.count===-1||t.count===o.length,`array length mismatch; expected length ${t.count}`,"value",o);let a=o.map(i);return this.#t.has(s)&&(a=a.map(du.keccak256)),(0,du.keccak256)((0,_e.concat)(a))}}let n=this.types[e];if(n){let s=(0,LT.id)(this.#t.get(e));return i=>{let o=n.map(({name:a,type:c})=>{let u=this.getEncoder(c)(i[a]);return this.#t.has(c)?(0,du.keccak256)(u):u});return o.unshift(s),(0,_e.concat)(o)}}(0,_e.assertArgument)(!1,`unknown type: ${e}`,"type",e)}encodeType(e){let t=this.#t.get(e);return(0,_e.assertArgument)(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return(0,du.keccak256)(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(j1(e))return n(e,t);let s=oh(e).array;if(s)return(0,_e.assertArgument)(s.count===-1||s.count===t.length,`array length mismatch; expected length ${s.count}`,"value",t),t.map(o=>this._visit(s.prefix,o,n));let i=this.types[e];if(i)return i.reduce((o,{name:a,type:c})=>(o[a]=this._visit(c,t[a],n),o),{});(0,_e.assertArgument)(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Sr(e)}static getPrimaryType(e){return Sr.from(e).primaryType}static hashStruct(e,t,n){return Sr.from(t).hashStruct(e,n)}static hashDomain(e){let t=[];for(let n in e){if(e[n]==null)continue;let s=NT[n];(0,_e.assertArgument)(s,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),t.push({name:n,type:s})}return t.sort((n,s)=>L1.indexOf(n.name)-L1.indexOf(s.name)),Sr.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,n){return(0,_e.concat)(["0x1901",Sr.hashDomain(e),Sr.from(t).hash(n)])}static hash(e,t,n){return(0,du.keccak256)(Sr.encode(e,t,n))}static async resolveNames(e,t,n,s){e=Object.assign({},e);for(let a in e)e[a]==null&&delete e[a];let i={};e.verifyingContract&&!(0,_e.isHexString)(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");let o=Sr.from(t);o.visit(n,(a,c)=>(a==="address"&&!(0,_e.isHexString)(c,20)&&(i[c]="0x"),c));for(let a in i)i[a]=await s(a);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),n=o.visit(n,(a,c)=>a==="address"&&i[c]?i[c]:c),{domain:e,value:n}}static getPayload(e,t,n){Sr.hashDomain(e);let s={},i=[];L1.forEach(c=>{let u=e[c];u!=null&&(s[c]=GL[c](u),i.push({name:c,type:NT[c]}))});let o=Sr.from(t);t=o.types;let a=Object.assign({},t);return(0,_e.assertArgument)(a.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",t),a.EIP712Domain=i,o.encode(n),{types:a,domain:s,primaryType:o.primaryType,message:o.visit(n,(c,u)=>{if(c.match(/^bytes(\d*)/))return(0,_e.hexlify)((0,_e.getBytes)(u));if(c.match(/^u?int/))return(0,_e.getBigInt)(u).toString();switch(c){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return(0,_e.assertArgument)(typeof u=="string","invalid string","value",u),u}(0,_e.assertArgument)(!1,"unsupported type","type",c)})}}};pu.TypedDataEncoder=Sr;function zL(r,e,t,n){return(0,UL.recoverAddress)(Sr.hash(r,e,t),n)}pu.verifyTypedData=zL});var Ls=M(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.verifyTypedData=ht.TypedDataEncoder=ht.solidityPackedSha256=ht.solidityPackedKeccak256=ht.solidityPacked=ht.verifyMessage=ht.hashMessage=ht.dnsEncode=ht.namehash=ht.isValidName=ht.ensNormalize=ht.id=void 0;var VL=u1();Object.defineProperty(ht,"id",{enumerable:!0,get:function(){return VL.id}});var ah=wT();Object.defineProperty(ht,"ensNormalize",{enumerable:!0,get:function(){return ah.ensNormalize}});Object.defineProperty(ht,"isValidName",{enumerable:!0,get:function(){return ah.isValidName}});Object.defineProperty(ht,"namehash",{enumerable:!0,get:function(){return ah.namehash}});Object.defineProperty(ht,"dnsEncode",{enumerable:!0,get:function(){return ah.dnsEncode}});var HT=ST();Object.defineProperty(ht,"hashMessage",{enumerable:!0,get:function(){return HT.hashMessage}});Object.defineProperty(ht,"verifyMessage",{enumerable:!0,get:function(){return HT.verifyMessage}});var U1=CT();Object.defineProperty(ht,"solidityPacked",{enumerable:!0,get:function(){return U1.solidityPacked}});Object.defineProperty(ht,"solidityPackedKeccak256",{enumerable:!0,get:function(){return U1.solidityPackedKeccak256}});Object.defineProperty(ht,"solidityPackedSha256",{enumerable:!0,get:function(){return U1.solidityPackedSha256}});var $T=DT();Object.defineProperty(ht,"TypedDataEncoder",{enumerable:!0,get:function(){return $T.TypedDataEncoder}});Object.defineProperty(ht,"verifyTypedData",{enumerable:!0,get:function(){return $T.verifyTypedData}})});var uh=M($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.StructFragment=$t.FunctionFragment=$t.FallbackFragment=$t.ConstructorFragment=$t.EventFragment=$t.ErrorFragment=$t.NamedFragment=$t.Fragment=$t.ParamType=void 0;var Ze=me(),F1=Ls();function Or(r){let e=new Set;return r.forEach(t=>e.add(t)),Object.freeze(e)}var KL="external public payable override",JL=Or(KL.split(" ")),ZT="constant external internal payable private public pure view override",WL=Or(ZT.split(" ")),XT="constructor error event fallback function receive struct",eP=Or(XT.split(" ")),tP="calldata memory storage payable indexed",QL=Or(tP.split(" ")),YL="tuple returns",ZL=[XT,tP,YL,ZT].join(" "),XL=Or(ZL.split(" ")),ej={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},tj=new RegExp("^(\\s*)"),rj=new RegExp("^([0-9]+)"),nj=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),rP=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),nP=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"),Gr=class{#e;#t;get offset(){return this.#e}get length(){return this.#t.length-this.#e}constructor(e){this.#e=0,this.#t=e.slice()}clone(){return new Gr(this.#t)}reset(){this.#e=0}#r(e=0,t=0){return new Gr(this.#t.slice(e,t).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))}popKeyword(e){let t=this.peek();if(t.type!=="KEYWORD"||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){let t=this.peek();throw new Error(`expected ${e}; got ${t.type} ${JSON.stringify(t.text)}`)}return this.pop().text}popParen(){let e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");let t=this.#r(this.#e+1,e.match+1);return this.#e=e.match+1,t}popParams(){let e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");let t=[];for(;this.#e<e.match-1;){let n=this.peek().linkNext;t.push(this.#r(this.#e+1,n)),this.#e=n}return this.#e=e.match+1,t}peek(){if(this.#e>=this.#t.length)throw new Error("out-of-bounds");return this.#t[this.#e]}peekKeyword(e){let t=this.peekType("KEYWORD");return t!=null&&e.has(t)?t:null}peekType(e){if(this.length===0)return null;let t=this.peek();return t.type===e?t.text:null}pop(){let e=this.peek();return this.#e++,e}toString(){let e=[];for(let t=this.#e;t<this.#t.length;t++){let n=this.#t[t];e.push(`${n.type}:${n.text}`)}return`<TokenString ${e.join(" ")}>`}};function go(r){let e=[],t=o=>{let a=i<r.length?JSON.stringify(r[i]):"$EOI";throw new Error(`invalid token ${a} at ${i}: ${o}`)},n=[],s=[],i=0;for(;i<r.length;){let o=r.substring(i),a=o.match(tj);a&&(i+=a[1].length,o=r.substring(i));let c={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:i,value:-1};e.push(c);let u=ej[o[0]]||"";if(u){if(c.type=u,c.text=o[0],i++,u==="OPEN_PAREN")n.push(e.length-1),s.push(e.length-1);else if(u=="CLOSE_PAREN")n.length===0&&t("no matching open bracket"),c.match=n.pop(),e[c.match].match=e.length-1,c.depth--,c.linkBack=s.pop(),e[c.linkBack].linkNext=e.length-1;else if(u==="COMMA")c.linkBack=s.pop(),e[c.linkBack].linkNext=e.length-1,s.push(e.length-1);else if(u==="OPEN_BRACKET")c.type="BRACKET";else if(u==="CLOSE_BRACKET"){let l=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){let f=e.pop().text;l=f+l,e[e.length-1].value=(0,Ze.getNumber)(f)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=l}continue}if(a=o.match(nj),a){if(c.text=a[1],i+=c.text.length,XL.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(nP)){c.type="TYPE";continue}c.type="ID";continue}if(a=o.match(rj),a){c.text=a[1],c.type="NUMBER",i+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${i}`)}return new Gr(e.map(o=>Object.freeze(o)))}function qT(r,e){let t=[];for(let n in e.keys())r.has(n)&&t.push(n);if(t.length>1)throw new Error(`conflicting types: ${t.join(", ")}`)}function ch(r,e){if(e.peekKeyword(eP)){let t=e.pop().text;if(t!==r)throw new Error(`expected ${r}, got ${t}`)}return e.popType("ID")}function wi(r,e){let t=new Set;for(;;){let n=r.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(r.pop(),t.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);t.add(n)}return Object.freeze(t)}function sP(r){let e=wi(r,WL);return qT(e,Or("constant payable nonpayable".split(" "))),qT(e,Or("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function yi(r,e){return r.popParams().map(t=>wt.from(t,e))}function iP(r){if(r.peekType("AT")){if(r.pop(),r.peekType("NUMBER"))return(0,Ze.getBigInt)(r.pop().text);throw new Error("invalid gas")}return null}function Na(r){if(r.length)throw new Error(`unexpected tokens at offset ${r.offset}: ${r.toString()}`)}var sj=new RegExp(/^(.*)\[([0-9]*)\]$/);function GT(r){let e=r.match(nP);if((0,Ze.assertArgument)(e,"invalid type","type",r),r==="uint")return"uint256";if(r==="int")return"int256";if(e[2]){let t=parseInt(e[2]);(0,Ze.assertArgument)(t!==0&&t<=32,"invalid bytes length","type",r)}else if(e[3]){let t=parseInt(e[3]);(0,Ze.assertArgument)(t!==0&&t<=256&&t%8===0,"invalid numeric width","type",r)}return r}var kt={},zr=Symbol.for("_ethers_internal"),zT="_ParamTypeInternal",VT="_ErrorInternal",KT="_EventInternal",JT="_ConstructorInternal",WT="_FallbackInternal",QT="_FunctionInternal",YT="_StructInternal",wt=class{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,t,n,s,i,o,a,c){if((0,Ze.assertPrivate)(e,kt,"ParamType"),Object.defineProperty(this,zr,{value:zT}),o&&(o=Object.freeze(o.slice())),s==="array"){if(a==null||c==null)throw new Error("")}else if(a!=null||c!=null)throw new Error("");if(s==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");(0,Ze.defineProperties)(this,{name:t,type:n,baseType:s,indexed:i,components:o,arrayLength:a,arrayChildren:c})}format(e){if(e==null&&(e="sighash"),e==="json"){let n=this.name||"";if(this.isArray()){let i=JSON.parse(this.arrayChildren.format("json"));return i.name=n,i.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(i)}let s={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(s.indexed=this.indexed),this.isTuple()&&(s.components=this.components.map(i=>JSON.parse(i.format(e)))),JSON.stringify(s)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?t+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")":t+=this.type,e!=="sighash"&&(this.indexed===!0&&(t+=" indexed"),e==="full"&&this.name&&(t+=" "+this.name)),t}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,t){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");let n=this;return e.map(s=>n.arrayChildren.walk(s,t))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");let n=this;return e.map((s,i)=>n.components[i].walk(s,t))}return t(this.type,e)}#e(e,t,n,s){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");let o=this.arrayChildren,a=t.slice();a.forEach((c,u)=>{o.#e(e,c,n,l=>{a[u]=l})}),s(a);return}if(this.isTuple()){let o=this.components,a;if(Array.isArray(t))a=t.slice();else{if(t==null||typeof t!="object")throw new Error("invalid tuple value");a=o.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in t))throw new Error(`missing value for component ${c.name}`);return t[c.name]})}if(a.length!==this.components.length)throw new Error("array is wrong length");a.forEach((c,u)=>{o[u].#e(e,c,n,l=>{a[u]=l})}),s(a);return}let i=n(this.type,t);i.then?e.push(async function(){s(await i)}()):s(i)}async walkAsync(e,t){let n=[],s=[e];return this.#e(n,e,t,i=>{s[0]=i}),n.length&&await Promise.all(n),s[0]}static from(e,t){if(wt.isParamType(e))return e;if(typeof e=="string")try{return wt.from(go(e),t)}catch{(0,Ze.assertArgument)(!1,"invalid param type","obj",e)}else if(e instanceof Gr){let a="",c="",u=null;wi(e,Or(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",u=e.popParams().map(p=>wt.from(p)),a=`tuple(${u.map(p=>p.format()).join(",")})`):(a=GT(e.popType("TYPE")),c=a);let l=null,f=null;for(;e.length&&e.peekType("BRACKET");){let p=e.pop();l=new wt(kt,"",a,c,null,u,f,l),f=p.value,a+=p.text,c="array",u=null}let d=null;if(wi(e,QL).has("indexed")){if(!t)throw new Error("");d=!0}let b=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new wt(kt,b,a,c,d,u,f,l)}let n=e.name;(0,Ze.assertArgument)(!n||typeof n=="string"&&n.match(rP),"invalid name","obj.name",n);let s=e.indexed;s!=null&&((0,Ze.assertArgument)(t,"parameter cannot be indexed","obj.indexed",e.indexed),s=!!s);let i=e.type,o=i.match(sj);if(o){let a=parseInt(o[2]||"-1"),c=wt.from({type:o[1],components:e.components});return new wt(kt,n||"",i,"array",s,null,a,c)}if(i==="tuple"||i.startsWith("tuple(")||i.startsWith("(")){let a=e.components!=null?e.components.map(u=>wt.from(u)):null;return new wt(kt,n||"",i,"tuple",s,a,null,null)}return i=GT(e.type),new wt(kt,n||"",i,i,s,null,null,null)}static isParamType(e){return e&&e[zr]===zT}};$t.ParamType=wt;var Ai=class{type;inputs;constructor(e,t,n){(0,Ze.assertPrivate)(e,kt,"Fragment"),n=Object.freeze(n.slice()),(0,Ze.defineProperties)(this,{type:t,inputs:n})}static from(e){if(typeof e=="string"){try{Ai.from(JSON.parse(e))}catch{}return Ai.from(go(e))}if(e instanceof Gr)switch(e.peekKeyword(eP)){case"constructor":return fs.from(e);case"error":return ls.from(e);case"event":return Bn.from(e);case"fallback":case"receive":return kn.from(e);case"function":return Sn.from(e);case"struct":return js.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return fs.from(e);case"error":return ls.from(e);case"event":return Bn.from(e);case"fallback":case"receive":return kn.from(e);case"function":return Sn.from(e);case"struct":return js.from(e)}(0,Ze.assert)(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}(0,Ze.assertArgument)(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return fs.isFragment(e)}static isError(e){return ls.isFragment(e)}static isEvent(e){return Bn.isFragment(e)}static isFunction(e){return Sn.isFragment(e)}static isStruct(e){return js.isFragment(e)}};$t.Fragment=Ai;var Ia=class extends Ai{name;constructor(e,t,n,s){super(e,t,s),(0,Ze.assertArgument)(typeof n=="string"&&n.match(rP),"invalid identifier","name",n),s=Object.freeze(s.slice()),(0,Ze.defineProperties)(this,{name:n})}};$t.NamedFragment=Ia;function Df(r,e){return"("+e.map(t=>t.format(r)).join(r==="full"?", ":",")+")"}var ls=class extends Ia{constructor(e,t,n){super(e,"error",t,n),Object.defineProperty(this,zr,{value:VT})}get selector(){return(0,F1.id)(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let t=[];return e!=="sighash"&&t.push("error"),t.push(this.name+Df(e,this.inputs)),t.join(" ")}static from(e){if(ls.isFragment(e))return e;if(typeof e=="string")return ls.from(go(e));if(e instanceof Gr){let t=ch("error",e),n=yi(e);return Na(e),new ls(kt,t,n)}return new ls(kt,e.name,e.inputs?e.inputs.map(wt.from):[])}static isFragment(e){return e&&e[zr]===VT}};$t.ErrorFragment=ls;var Bn=class extends Ia{anonymous;constructor(e,t,n,s){super(e,"event",t,n),Object.defineProperty(this,zr,{value:KT}),(0,Ze.defineProperties)(this,{anonymous:s})}get topicHash(){return(0,F1.id)(this.format("sighash"))}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let t=[];return e!=="sighash"&&t.push("event"),t.push(this.name+Df(e,this.inputs)),e!=="sighash"&&this.anonymous&&t.push("anonymous"),t.join(" ")}static getTopicHash(e,t){return t=(t||[]).map(s=>wt.from(s)),new Bn(kt,e,t,!1).topicHash}static from(e){if(Bn.isFragment(e))return e;if(typeof e=="string")try{return Bn.from(go(e))}catch{(0,Ze.assertArgument)(!1,"invalid event fragment","obj",e)}else if(e instanceof Gr){let t=ch("event",e),n=yi(e,!0),s=!!wi(e,Or(["anonymous"])).has("anonymous");return Na(e),new Bn(kt,t,n,s)}return new Bn(kt,e.name,e.inputs?e.inputs.map(t=>wt.from(t,!0)):[],!!e.anonymous)}static isFragment(e){return e&&e[zr]===KT}};$t.EventFragment=Bn;var fs=class extends Ai{payable;gas;constructor(e,t,n,s,i){super(e,t,n),Object.defineProperty(this,zr,{value:JT}),(0,Ze.defineProperties)(this,{payable:s,gas:i})}format(e){if((0,Ze.assert)(e!=null&&e!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),e==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let t=[`constructor${Df(e,this.inputs)}`];return this.payable&&t.push("payable"),this.gas!=null&&t.push(`@${this.gas.toString()}`),t.join(" ")}static from(e){if(fs.isFragment(e))return e;if(typeof e=="string")try{return fs.from(go(e))}catch{(0,Ze.assertArgument)(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof Gr){wi(e,Or(["constructor"]));let t=yi(e),n=!!wi(e,JL).has("payable"),s=iP(e);return Na(e),new fs(kt,"constructor",t,n,s)}return new fs(kt,"constructor",e.inputs?e.inputs.map(wt.from):[],!!e.payable,e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[zr]===JT}};$t.ConstructorFragment=fs;var kn=class extends Ai{payable;constructor(e,t,n){super(e,"fallback",t),Object.defineProperty(this,zr,{value:WT}),(0,Ze.defineProperties)(this,{payable:n})}format(e){let t=this.inputs.length===0?"receive":"fallback";if(e==="json"){let n=this.payable?"payable":"nonpayable";return JSON.stringify({type:t,stateMutability:n})}return`${t}()${this.payable?" payable":""}`}static from(e){if(kn.isFragment(e))return e;if(typeof e=="string")try{return kn.from(go(e))}catch{(0,Ze.assertArgument)(!1,"invalid fallback fragment","obj",e)}else if(e instanceof Gr){let t=e.toString(),n=e.peekKeyword(Or(["fallback","receive"]));if((0,Ze.assertArgument)(n,"type must be fallback or receive","obj",t),e.popKeyword(Or(["fallback","receive"]))==="receive"){let a=yi(e);return(0,Ze.assertArgument)(a.length===0,"receive cannot have arguments","obj.inputs",a),wi(e,Or(["payable"])),Na(e),new kn(kt,[],!0)}let i=yi(e);i.length?(0,Ze.assertArgument)(i.length===1&&i[0].type==="bytes","invalid fallback inputs","obj.inputs",i.map(a=>a.format("minimal")).join(", ")):i=[wt.from("bytes")];let o=sP(e);if((0,Ze.assertArgument)(o==="nonpayable"||o==="payable","fallback cannot be constants","obj.stateMutability",o),wi(e,Or(["returns"])).has("returns")){let a=yi(e);(0,Ze.assertArgument)(a.length===1&&a[0].type==="bytes","invalid fallback outputs","obj.outputs",a.map(c=>c.format("minimal")).join(", "))}return Na(e),new kn(kt,i,o==="payable")}if(e.type==="receive")return new kn(kt,[],!0);if(e.type==="fallback"){let t=[wt.from("bytes")],n=e.stateMutability==="payable";return new kn(kt,t,n)}(0,Ze.assertArgument)(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[zr]===WT}};$t.FallbackFragment=kn;var Sn=class extends Ia{constant;outputs;stateMutability;payable;gas;constructor(e,t,n,s,i,o){super(e,"function",t,s),Object.defineProperty(this,zr,{value:QT}),i=Object.freeze(i.slice());let a=n==="view"||n==="pure",c=n==="payable";(0,Ze.defineProperties)(this,{constant:a,gas:o,outputs:i,payable:c,stateMutability:n})}get selector(){return(0,F1.id)(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let t=[];return e!=="sighash"&&t.push("function"),t.push(this.name+Df(e,this.inputs)),e!=="sighash"&&(this.stateMutability!=="nonpayable"&&t.push(this.stateMutability),this.outputs&&this.outputs.length&&(t.push("returns"),t.push(Df(e,this.outputs))),this.gas!=null&&t.push(`@${this.gas.toString()}`)),t.join(" ")}static getSelector(e,t){return t=(t||[]).map(s=>wt.from(s)),new Sn(kt,e,"view",t,[],null).selector}static from(e){if(Sn.isFragment(e))return e;if(typeof e=="string")try{return Sn.from(go(e))}catch{(0,Ze.assertArgument)(!1,"invalid function fragment","obj",e)}else if(e instanceof Gr){let n=ch("function",e),s=yi(e),i=sP(e),o=[];wi(e,Or(["returns"])).has("returns")&&(o=yi(e));let a=iP(e);return Na(e),new Sn(kt,n,i,s,o,a)}let t=e.stateMutability;return t==null&&(t="payable",typeof e.constant=="boolean"?(t="view",e.constant||(t="payable",typeof e.payable=="boolean"&&!e.payable&&(t="nonpayable"))):typeof e.payable=="boolean"&&!e.payable&&(t="nonpayable")),new Sn(kt,e.name,t,e.inputs?e.inputs.map(wt.from):[],e.outputs?e.outputs.map(wt.from):[],e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[zr]===QT}};$t.FunctionFragment=Sn;var js=class extends Ia{constructor(e,t,n){super(e,"struct",t,n),Object.defineProperty(this,zr,{value:YT})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return js.from(go(e))}catch{(0,Ze.assertArgument)(!1,"invalid struct fragment","obj",e)}else if(e instanceof Gr){let t=ch("struct",e),n=yi(e);return Na(e),new js(kt,t,n)}return new js(kt,e.name,e.inputs?e.inputs.map(wt.from):[])}static isFragment(e){return e&&e[zr]===YT}};$t.StructFragment=js});var $1=M(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});fh.AbiCoder=void 0;var Hf=me(),oP=yn(),ij=Bv(),oj=Zy(),aj=Cv(),cj=t1(),uj=Iv(),lj=Rv(),fj=Mv(),dj=jv(),lh=Fv(),D1=uh(),aP=Yt(),$f=me(),ds=new Map;ds.set(0,"GENERIC_PANIC");ds.set(1,"ASSERT_FALSE");ds.set(17,"OVERFLOW");ds.set(18,"DIVIDE_BY_ZERO");ds.set(33,"ENUM_RANGE_ERROR");ds.set(34,"BAD_STORAGE_DATA");ds.set(49,"STACK_UNDERFLOW");ds.set(50,"ARRAY_RANGE_ERROR");ds.set(65,"OUT_OF_MEMORY");ds.set(81,"UNINITIALIZED_FUNCTION_CALL");var pj=new RegExp(/^bytes([0-9]*)$/),hj=new RegExp(/^(u?int)([0-9]*)$/),H1=null,cP=1024;function mj(r,e,t,n){let s="missing revert data",i=null,o=null,a=null;if(t){s="execution reverted";let u=(0,$f.getBytes)(t);if(t=(0,$f.hexlify)(t),u.length===0)s+=" (no data present; likely require(false) occurred",i="require(false)";else if(u.length%32!==4)s+=" (could not decode reason; invalid data length)";else if((0,$f.hexlify)(u.slice(0,4))==="0x08c379a0")try{i=n.decode(["string"],u.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[i]},s+=`: ${JSON.stringify(i)}`}catch{s+=" (could not decode reason; invalid string data)"}else if((0,$f.hexlify)(u.slice(0,4))==="0x4e487b71")try{let l=Number(n.decode(["uint256"],u.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[l]},i=`Panic due to ${ds.get(l)||"UNKNOWN"}(${l})`,s+=`: ${i}`}catch{s+=" (could not decode panic code)"}else s+=" (unknown custom error)"}let c={to:e.to?(0,aP.getAddress)(e.to):null,data:e.data||"0x"};return e.from&&(c.from=(0,aP.getAddress)(e.from)),(0,$f.makeError)(s,"CALL_EXCEPTION",{action:r,data:t,reason:i,transaction:c,invocation:o,revert:a})}var hu=class{#e(e){if(e.isArray())return new oj.ArrayCoder(this.#e(e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new lh.TupleCoder(e.components.map(n=>this.#e(n)),e.name);switch(e.baseType){case"address":return new ij.AddressCoder(e.name);case"bool":return new aj.BooleanCoder(e.name);case"string":return new dj.StringCoder(e.name);case"bytes":return new cj.BytesCoder(e.name);case"":return new lj.NullCoder(e.name)}let t=e.type.match(hj);if(t){let n=parseInt(t[2]||"256");return(0,Hf.assertArgument)(n!==0&&n<=256&&n%8===0,"invalid "+t[1]+" bit length","param",e),new fj.NumberCoder(n/8,t[1]==="int",e.name)}if(t=e.type.match(pj),t){let n=parseInt(t[1]);return(0,Hf.assertArgument)(n!==0&&n<=32,"invalid bytes length","param",e),new uj.FixedBytesCoder(n,e.name)}(0,Hf.assertArgument)(!1,"invalid type","type",e.type)}getDefaultValue(e){let t=e.map(s=>this.#e(D1.ParamType.from(s)));return new lh.TupleCoder(t,"_").defaultValue()}encode(e,t){(0,Hf.assertArgumentCount)(t.length,e.length,"types/values length mismatch");let n=e.map(o=>this.#e(D1.ParamType.from(o))),s=new lh.TupleCoder(n,"_"),i=new oP.Writer;return s.encode(i,t),i.data}decode(e,t,n){let s=e.map(o=>this.#e(D1.ParamType.from(o)));return new lh.TupleCoder(s,"_").decode(new oP.Reader(t,n,cP))}static _setDefaultMaxInflation(e){(0,Hf.assertArgument)(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),cP=e}static defaultAbiCoder(){return H1==null&&(H1=new hu),H1}static getBuiltinCallException(e,t,n){return mj(e,t,n,hu.defaultAbiCoder())}};fh.AbiCoder=hu});var uP=M(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.decodeBytes32String=mu.encodeBytes32String=void 0;var dh=me();function bj(r){let e=(0,dh.toUtf8Bytes)(r);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,dh.zeroPadBytes)(e,32)}mu.encodeBytes32String=bj;function gj(r){let e=(0,dh.getBytes)(r,"bytes");if(e.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(e[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let t=31;for(;e[t-1]===0;)t--;return(0,dh.toUtf8String)(e.slice(0,t))}mu.decodeBytes32String=gj});var mP=M(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.Interface=xr.Indexed=xr.ErrorDescription=xr.TransactionDescription=xr.LogDescription=xr.Result=xr.checkResultErrors=void 0;var lP=nr(),fP=Ls(),we=me(),dP=$1(),G1=yn();Object.defineProperty(xr,"checkResultErrors",{enumerable:!0,get:function(){return G1.checkResultErrors}});Object.defineProperty(xr,"Result",{enumerable:!0,get:function(){return G1.Result}});var ps=uh(),q1=Is(),ph=class{fragment;name;signature;topic;args;constructor(e,t,n){let s=e.name,i=e.format();(0,we.defineProperties)(this,{fragment:e,name:s,signature:i,topic:t,args:n})}};xr.LogDescription=ph;var hh=class{fragment;name;args;signature;selector;value;constructor(e,t,n,s){let i=e.name,o=e.format();(0,we.defineProperties)(this,{fragment:e,name:i,args:n,signature:o,selector:t,value:s})}};xr.TransactionDescription=hh;var mh=class{fragment;name;args;signature;selector;constructor(e,t,n){let s=e.name,i=e.format();(0,we.defineProperties)(this,{fragment:e,name:s,args:n,signature:i,selector:t})}};xr.ErrorDescription=mh;var qf=class{hash;_isIndexed;static isIndexed(e){return!!(e&&e._isIndexed)}constructor(e){(0,we.defineProperties)(this,{hash:e,_isIndexed:!0})}};xr.Indexed=qf;var pP={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},hP={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:r=>`reverted with reason string ${JSON.stringify(r)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:r=>{let e="unknown panic code";return r>=0&&r<=255&&pP[r.toString()]&&(e=pP[r.toString()]),`reverted with panic code 0x${r.toString(16)} (${e})`}}},Ei=class{fragments;deploy;fallback;receive;#e;#t;#r;#n;constructor(e){let t=[];typeof e=="string"?t=JSON.parse(e):t=e,this.#r=new Map,this.#e=new Map,this.#t=new Map;let n=[];for(let o of t)try{n.push(ps.Fragment.from(o))}catch(a){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,a.message)}(0,we.defineProperties)(this,{fragments:Object.freeze(n)});let s=null,i=!1;this.#n=this.getAbiCoder(),this.fragments.forEach((o,a)=>{let c;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}(0,we.defineProperties)(this,{deploy:o});return;case"fallback":o.inputs.length===0?i=!0:((0,we.assertArgument)(!s||o.payable!==s.payable,"conflicting fallback fragments",`fragments[${a}]`,o),s=o,i=s.payable);return;case"function":c=this.#r;break;case"event":c=this.#t;break;case"error":c=this.#e;break;default:return}let u=o.format();c.has(u)||c.set(u,o)}),this.deploy||(0,we.defineProperties)(this,{deploy:ps.ConstructorFragment.from("constructor()")}),(0,we.defineProperties)(this,{fallback:s,receive:i})}format(e){let t=e?"minimal":"full";return this.fragments.map(s=>s.format(t))}formatJson(){let e=this.fragments.map(t=>t.format("json"));return JSON.stringify(e.map(t=>JSON.parse(t)))}getAbiCoder(){return dP.AbiCoder.defaultAbiCoder()}#s(e,t,n){if((0,we.isHexString)(e)){let i=e.toLowerCase();for(let o of this.#r.values())if(i===o.selector)return o;return null}if(e.indexOf("(")===-1){let i=[];for(let[o,a]of this.#r)o.split("(")[0]===e&&i.push(a);if(t){let o=t.length>0?t[t.length-1]:null,a=t.length,c=!0;q1.Typed.isTyped(o)&&o.type==="overrides"&&(c=!1,a--);for(let u=i.length-1;u>=0;u--){let l=i[u].inputs.length;l!==a&&(!c||l!==a-1)&&i.splice(u,1)}for(let u=i.length-1;u>=0;u--){let l=i[u].inputs;for(let f=0;f<t.length;f++)if(!!q1.Typed.isTyped(t[f])){if(f>=l.length){if(t[f].type==="overrides")continue;i.splice(u,1);break}if(t[f].type!==l[f].baseType){i.splice(u,1);break}}}}if(i.length===1&&t&&t.length!==i[0].inputs.length){let o=t[t.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&i.splice(0,1)}if(i.length===0)return null;if(i.length>1&&n){let o=i.map(a=>JSON.stringify(a.format())).join(", ");(0,we.assertArgument)(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return i[0]}let s=this.#r.get(ps.FunctionFragment.from(e).format());return s||null}getFunctionName(e){let t=this.#s(e,null,!1);return(0,we.assertArgument)(t,"no matching function","key",e),t.name}hasFunction(e){return!!this.#s(e,null,!1)}getFunction(e,t){return this.#s(e,t||null,!0)}forEachFunction(e){let t=Array.from(this.#r.keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){let s=t[n];e(this.#r.get(s),n)}}#o(e,t,n){if((0,we.isHexString)(e)){let i=e.toLowerCase();for(let o of this.#t.values())if(i===o.topicHash)return o;return null}if(e.indexOf("(")===-1){let i=[];for(let[o,a]of this.#t)o.split("(")[0]===e&&i.push(a);if(t){for(let o=i.length-1;o>=0;o--)i[o].inputs.length<t.length&&i.splice(o,1);for(let o=i.length-1;o>=0;o--){let a=i[o].inputs;for(let c=0;c<t.length;c++)if(!!q1.Typed.isTyped(t[c])&&t[c].type!==a[c].baseType){i.splice(o,1);break}}}if(i.length===0)return null;if(i.length>1&&n){let o=i.map(a=>JSON.stringify(a.format())).join(", ");(0,we.assertArgument)(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return i[0]}let s=this.#t.get(ps.EventFragment.from(e).format());return s||null}getEventName(e){let t=this.#o(e,null,!1);return(0,we.assertArgument)(t,"no matching event","key",e),t.name}hasEvent(e){return!!this.#o(e,null,!1)}getEvent(e,t){return this.#o(e,t||null,!0)}forEachEvent(e){let t=Array.from(this.#t.keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){let s=t[n];e(this.#t.get(s),n)}}getError(e,t){if((0,we.isHexString)(e)){let s=e.toLowerCase();if(hP[s])return ps.ErrorFragment.from(hP[s].signature);for(let i of this.#e.values())if(s===i.selector)return i;return null}if(e.indexOf("(")===-1){let s=[];for(let[i,o]of this.#e)i.split("(")[0]===e&&s.push(o);if(s.length===0)return e==="Error"?ps.ErrorFragment.from("error Error(string)"):e==="Panic"?ps.ErrorFragment.from("error Panic(uint256)"):null;if(s.length>1){let i=s.map(o=>JSON.stringify(o.format())).join(", ");(0,we.assertArgument)(!1,`ambiguous error description (i.e. ${i})`,"name",e)}return s[0]}if(e=ps.ErrorFragment.from(e).format(),e==="Error(string)")return ps.ErrorFragment.from("error Error(string)");if(e==="Panic(uint256)")return ps.ErrorFragment.from("error Panic(uint256)");let n=this.#e.get(e);return n||null}forEachError(e){let t=Array.from(this.#e.keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){let s=t[n];e(this.#e.get(s),n)}}_decodeParams(e,t){return this.#n.decode(e,t)}_encodeParams(e,t){return this.#n.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){if(typeof e=="string"){let n=this.getError(e);(0,we.assertArgument)(n,"unknown error","fragment",e),e=n}return(0,we.assertArgument)((0,we.dataSlice)(t,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",t),this._decodeParams(e.inputs,(0,we.dataSlice)(t,4))}encodeErrorResult(e,t){if(typeof e=="string"){let n=this.getError(e);(0,we.assertArgument)(n,"unknown error","fragment",e),e=n}return(0,we.concat)([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionData(e,t){if(typeof e=="string"){let n=this.getFunction(e);(0,we.assertArgument)(n,"unknown function","fragment",e),e=n}return(0,we.assertArgument)((0,we.dataSlice)(t,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",t),this._decodeParams(e.inputs,(0,we.dataSlice)(t,4))}encodeFunctionData(e,t){if(typeof e=="string"){let n=this.getFunction(e);(0,we.assertArgument)(n,"unknown function","fragment",e),e=n}return(0,we.concat)([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionResult(e,t){if(typeof e=="string"){let i=this.getFunction(e);(0,we.assertArgument)(i,"unknown function","fragment",e),e=i}let n="invalid length for result data",s=(0,we.getBytesCopy)(t);if(s.length%32===0)try{return this.#n.decode(e.outputs,s)}catch{n="could not decode result data"}(0,we.assert)(!1,n,"BAD_DATA",{value:(0,we.hexlify)(s),info:{method:e.name,signature:e.format()}})}makeError(e,t){let n=(0,we.getBytes)(e,"data"),s=dP.AbiCoder.getBuiltinCallException("call",t,n),i="execution reverted (unknown custom error)";if(s.message.startsWith(i)){let a=(0,we.hexlify)(n.slice(0,4)),c=this.getError(a);if(c)try{let u=this.#n.decode(c.inputs,n.slice(4));s.revert={name:c.name,signature:c.format(),args:u},s.reason=s.revert.signature,s.message=`execution reverted: ${s.reason}`}catch{s.message="execution reverted (coult not decode custom error)"}}let o=this.parseTransaction(t);return o&&(s.invocation={method:o.name,signature:o.signature,args:o.args}),s}encodeFunctionResult(e,t){if(typeof e=="string"){let n=this.getFunction(e);(0,we.assertArgument)(n,"unknown function","fragment",e),e=n}return(0,we.hexlify)(this.#n.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){if(typeof e=="string"){let i=this.getEvent(e);(0,we.assertArgument)(i,"unknown event","eventFragment",e),e=i}(0,we.assert)(t.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:t.length,expectedCount:e.inputs.length});let n=[];e.anonymous||n.push(e.topicHash);let s=(i,o)=>i.type==="string"?(0,fP.id)(o):i.type==="bytes"?(0,lP.keccak256)((0,we.hexlify)(o)):(i.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":i.type.match(/^u?int/)?o=(0,we.toBeHex)(o):i.type.match(/^bytes/)?o=(0,we.zeroPadBytes)(o,32):i.type==="address"&&this.#n.encode(["address"],[o]),(0,we.zeroPadValue)((0,we.hexlify)(o),32));for(t.forEach((i,o)=>{let a=e.inputs[o];if(!a.indexed){(0,we.assertArgument)(i==null,"cannot filter non-indexed parameters; must be null","contract."+a.name,i);return}i==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?(0,we.assertArgument)(!1,"filtering with tuples or arrays not supported","contract."+a.name,i):Array.isArray(i)?n.push(i.map(c=>s(a,c))):n.push(s(a,i))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,t){if(typeof e=="string"){let o=this.getEvent(e);(0,we.assertArgument)(o,"unknown event","eventFragment",e),e=o}let n=[],s=[],i=[];return e.anonymous||n.push(e.topicHash),(0,we.assertArgument)(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach((o,a)=>{let c=t[a];if(o.indexed)if(o.type==="string")n.push((0,fP.id)(c));else if(o.type==="bytes")n.push((0,lP.keccak256)(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(this.#n.encode([o.type],[c]))}else s.push(o),i.push(c)}),{data:this.#n.encode(s,i),topics:n}}decodeEventLog(e,t,n){if(typeof e=="string"){let h=this.getEvent(e);(0,we.assertArgument)(h,"unknown event","eventFragment",e),e=h}if(n!=null&&!e.anonymous){let h=e.topicHash;(0,we.assertArgument)((0,we.isHexString)(n[0],32)&&n[0].toLowerCase()===h,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}let s=[],i=[],o=[];e.inputs.forEach((h,b)=>{h.indexed?h.type==="string"||h.type==="bytes"||h.baseType==="tuple"||h.baseType==="array"?(s.push(ps.ParamType.from({type:"bytes32",name:h.name})),o.push(!0)):(s.push(h),o.push(!1)):(i.push(h),o.push(!1))});let a=n!=null?this.#n.decode(s,(0,we.concat)(n)):null,c=this.#n.decode(i,t,!0),u=[],l=[],f=0,d=0;return e.inputs.forEach((h,b)=>{let p=null;if(h.indexed)if(a==null)p=new qf(null);else if(o[b])p=new qf(a[d++]);else try{p=a[d++]}catch(g){p=g}else try{p=c[f++]}catch(g){p=g}u.push(p),l.push(h.name||null)}),G1.Result.fromItems(u,l)}parseTransaction(e){let t=(0,we.getBytes)(e.data,"tx.data"),n=(0,we.getBigInt)(e.value!=null?e.value:0,"tx.value"),s=this.getFunction((0,we.hexlify)(t.slice(0,4)));if(!s)return null;let i=this.#n.decode(s.inputs,t.slice(4));return new hh(s,s.selector,i,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new ph(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){let t=(0,we.hexlify)(e),n=this.getError((0,we.dataSlice)(t,0,4));if(!n)return null;let s=this.#n.decode(n.inputs,(0,we.dataSlice)(t,4));return new mh(n,n.selector,s)}static from(e){return e instanceof Ei?e:typeof e=="string"?new Ei(JSON.parse(e)):typeof e.formatJson=="function"?new Ei(e.formatJson()):typeof e.format=="function"?new Ei(e.format("json")):new Ei(e)}};xr.Interface=Ei});var bu=M(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.Typed=Le.Result=Le.TransactionDescription=Le.LogDescription=Le.ErrorDescription=Le.Interface=Le.Indexed=Le.checkResultErrors=Le.StructFragment=Le.ParamType=Le.NamedFragment=Le.FunctionFragment=Le.Fragment=Le.FallbackFragment=Le.EventFragment=Le.ErrorFragment=Le.ConstructorFragment=Le.encodeBytes32String=Le.decodeBytes32String=Le.AbiCoder=void 0;var xj=$1();Object.defineProperty(Le,"AbiCoder",{enumerable:!0,get:function(){return xj.AbiCoder}});var bP=uP();Object.defineProperty(Le,"decodeBytes32String",{enumerable:!0,get:function(){return bP.decodeBytes32String}});Object.defineProperty(Le,"encodeBytes32String",{enumerable:!0,get:function(){return bP.encodeBytes32String}});var vi=uh();Object.defineProperty(Le,"ConstructorFragment",{enumerable:!0,get:function(){return vi.ConstructorFragment}});Object.defineProperty(Le,"ErrorFragment",{enumerable:!0,get:function(){return vi.ErrorFragment}});Object.defineProperty(Le,"EventFragment",{enumerable:!0,get:function(){return vi.EventFragment}});Object.defineProperty(Le,"FallbackFragment",{enumerable:!0,get:function(){return vi.FallbackFragment}});Object.defineProperty(Le,"Fragment",{enumerable:!0,get:function(){return vi.Fragment}});Object.defineProperty(Le,"FunctionFragment",{enumerable:!0,get:function(){return vi.FunctionFragment}});Object.defineProperty(Le,"NamedFragment",{enumerable:!0,get:function(){return vi.NamedFragment}});Object.defineProperty(Le,"ParamType",{enumerable:!0,get:function(){return vi.ParamType}});Object.defineProperty(Le,"StructFragment",{enumerable:!0,get:function(){return vi.StructFragment}});var Ra=mP();Object.defineProperty(Le,"checkResultErrors",{enumerable:!0,get:function(){return Ra.checkResultErrors}});Object.defineProperty(Le,"Indexed",{enumerable:!0,get:function(){return Ra.Indexed}});Object.defineProperty(Le,"Interface",{enumerable:!0,get:function(){return Ra.Interface}});Object.defineProperty(Le,"ErrorDescription",{enumerable:!0,get:function(){return Ra.ErrorDescription}});Object.defineProperty(Le,"LogDescription",{enumerable:!0,get:function(){return Ra.LogDescription}});Object.defineProperty(Le,"TransactionDescription",{enumerable:!0,get:function(){return Ra.TransactionDescription}});Object.defineProperty(Le,"Result",{enumerable:!0,get:function(){return Ra.Result}});var yj=Is();Object.defineProperty(Le,"Typed",{enumerable:!0,get:function(){return yj.Typed}})});var yu=M(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.TransactionResponse=Vr.TransactionReceipt=Vr.Log=Vr.Block=Vr.copyRequest=Vr.FeeData=void 0;var At=me(),wj=qr(),gP=BigInt(0);function gu(r){return r??null}function Ut(r){return r==null?null:r.toString()}var z1=class{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(e,t,n){(0,At.defineProperties)(this,{gasPrice:gu(e),maxFeePerGas:gu(t),maxPriorityFeePerGas:gu(n)})}toJSON(){let{gasPrice:e,maxFeePerGas:t,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:Ut(e),maxFeePerGas:Ut(t),maxPriorityFeePerGas:Ut(n)}}};Vr.FeeData=z1;function Aj(r){let e={};r.to&&(e.to=r.to),r.from&&(e.from=r.from),r.data&&(e.data=(0,At.hexlify)(r.data));let t="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(let s of t)!(s in r)||r[s]==null||(e[s]=(0,At.getBigInt)(r[s],`request.${s}`));let n="type,nonce".split(/,/);for(let s of n)!(s in r)||r[s]==null||(e[s]=(0,At.getNumber)(r[s],`request.${s}`));return r.accessList&&(e.accessList=(0,wj.accessListify)(r.accessList)),"blockTag"in r&&(e.blockTag=r.blockTag),"enableCcipRead"in r&&(e.enableCcipRead=!!r.enableCcipRead),"customData"in r&&(e.customData=r.customData),"blobVersionedHashes"in r&&r.blobVersionedHashes&&(e.blobVersionedHashes=r.blobVersionedHashes.slice()),"kzg"in r&&(e.kzg=r.kzg),"blobs"in r&&r.blobs&&(e.blobs=r.blobs.map(s=>(0,At.isBytesLike)(s)?(0,At.hexlify)(s):Object.assign({},s))),e}Vr.copyRequest=Aj;var V1=class{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#e;constructor(e,t){this.#e=e.transactions.map(n=>typeof n!="string"?new xu(n,t):n),(0,At.defineProperties)(this,{provider:t,hash:gu(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:gu(e.prevRandao),extraData:e.extraData,baseFeePerGas:gu(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return this.#e.map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){let e=this.#e.slice();return e.length===0?[]:((0,At.assert)(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){let{baseFeePerGas:e,difficulty:t,extraData:n,gasLimit:s,gasUsed:i,hash:o,miner:a,prevRandao:c,nonce:u,number:l,parentHash:f,parentBeaconBlockRoot:d,stateRoot:h,receiptsRoot:b,timestamp:p,transactions:g}=this;return{_type:"Block",baseFeePerGas:Ut(e),difficulty:Ut(t),extraData:n,gasLimit:Ut(s),gasUsed:Ut(i),blobGasUsed:Ut(this.blobGasUsed),excessBlobGas:Ut(this.excessBlobGas),hash:o,miner:a,prevRandao:c,nonce:u,number:l,parentHash:f,timestamp:p,parentBeaconBlockRoot:d,stateRoot:h,receiptsRoot:b,transactions:g}}[Symbol.iterator](){let e=0,t=this.transactions;return{next:()=>e<this.length?{value:t[e++],done:!1}:{value:void 0,done:!0}}}get length(){return this.#e.length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let t;if(typeof e=="number")t=this.#e[e];else{let n=e.toLowerCase();for(let s of this.#e)if(typeof s=="string"){if(s!==n)continue;t=s;break}else{if(s.hash===n)continue;t=s;break}}if(t==null)throw new Error("no such tx");return typeof t=="string"?await this.provider.getTransaction(t):t}getPrefetchedTransaction(e){let t=this.prefetchedTransactions;if(typeof e=="number")return t[e];e=e.toLowerCase();for(let n of t)if(n.hash===e)return n;(0,At.assertArgument)(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return Ej(this)}};Vr.Block=V1;var bh=class{provider;transactionHash;blockHash;blockNumber;removed;address;data;topics;index;transactionIndex;constructor(e,t){this.provider=t;let n=Object.freeze(e.topics.slice());(0,At.defineProperties)(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:n,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){let{address:e,blockHash:t,blockNumber:n,data:s,index:i,removed:o,topics:a,transactionHash:c,transactionIndex:u}=this;return{_type:"log",address:e,blockHash:t,blockNumber:n,data:s,index:i,removed:o,topics:a,transactionHash:c,transactionIndex:u}}async getBlock(){let e=await this.provider.getBlock(this.blockHash);return(0,At.assert)(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){let e=await this.provider.getTransaction(this.transactionHash);return(0,At.assert)(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){let e=await this.provider.getTransactionReceipt(this.transactionHash);return(0,At.assert)(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return vj(this)}};Vr.Log=bh;var K1=class{provider;to;from;contractAddress;hash;index;blockHash;blockNumber;logsBloom;gasUsed;blobGasUsed;cumulativeGasUsed;gasPrice;blobGasPrice;type;status;root;#e;constructor(e,t){this.#e=Object.freeze(e.logs.map(s=>new bh(s,t)));let n=gP;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),(0,At.defineProperties)(this,{provider:t,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:n,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return this.#e}toJSON(){let{to:e,from:t,contractAddress:n,hash:s,index:i,blockHash:o,blockNumber:a,logsBloom:c,logs:u,status:l,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:a,contractAddress:n,cumulativeGasUsed:Ut(this.cumulativeGasUsed),from:t,gasPrice:Ut(this.gasPrice),blobGasUsed:Ut(this.blobGasUsed),blobGasPrice:Ut(this.blobGasPrice),gasUsed:Ut(this.gasUsed),hash:s,index:i,logs:u,logsBloom:c,root:f,status:l,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){let e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){let e=await this.provider.getTransaction(this.hash);if(e==null)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return yP(this)}reorderedEvent(e){return(0,At.assert)(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),xP(this,e)}};Vr.TransactionReceipt=K1;var xu=class{provider;blockNumber;blockHash;index;hash;type;to;from;nonce;gasLimit;gasPrice;maxPriorityFeePerGas;maxFeePerGas;maxFeePerBlobGas;data;value;chainId;signature;accessList;blobVersionedHashes;#e;constructor(e,t){this.provider=t,this.blockNumber=e.blockNumber!=null?e.blockNumber:null,this.blockHash=e.blockHash!=null?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=e.maxPriorityFeePerGas!=null?e.maxPriorityFeePerGas:null,this.maxFeePerGas=e.maxFeePerGas!=null?e.maxFeePerGas:null,this.maxFeePerBlobGas=e.maxFeePerBlobGas!=null?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,this.blobVersionedHashes=e.blobVersionedHashes!=null?e.blobVersionedHashes:null,this.#e=-1}toJSON(){let{blockNumber:e,blockHash:t,index:n,hash:s,type:i,to:o,from:a,nonce:c,data:u,signature:l,accessList:f,blobVersionedHashes:d}=this;return{_type:"TransactionResponse",accessList:f,blockNumber:e,blockHash:t,blobVersionedHashes:d,chainId:Ut(this.chainId),data:u,from:a,gasLimit:Ut(this.gasLimit),gasPrice:Ut(this.gasPrice),hash:s,maxFeePerGas:Ut(this.maxFeePerGas),maxPriorityFeePerGas:Ut(this.maxPriorityFeePerGas),maxFeePerBlobGas:Ut(this.maxFeePerBlobGas),nonce:c,signature:l,to:o,index:n,type:i,value:Ut(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){let n=await this.getTransaction();n&&(e=n.blockNumber)}if(e==null)return null;let t=this.provider.getBlock(e);if(t==null)throw new Error("TODO");return t}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){let{tx:t,blockNumber:n}=await(0,At.resolveProperties)({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return t==null||t.blockNumber==null?0:n-t.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,t){let n=e??1,s=t??0,i=this.#e,o=-1,a=i===-1,c=async()=>{if(a)return null;let{blockNumber:d,nonce:h}=await(0,At.resolveProperties)({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(h<this.nonce){i=d;return}if(a)return null;let b=await this.getTransaction();if(!(b&&b.blockNumber!=null))for(o===-1&&(o=i-3,o<this.#e&&(o=this.#e));o<=d;){if(a)return null;let p=await this.provider.getBlock(o,!0);if(p==null)return;for(let g of p)if(g===this.hash)return;for(let g=0;g<p.length;g++){let m=await p.getTransaction(g);if(m.from===this.from&&m.nonce===this.nonce){if(a)return null;let y=await this.provider.getTransactionReceipt(m.hash);if(y==null||d-y.blockNumber+1<n)return;let E="replaced";m.data===this.data&&m.to===this.to&&m.value===this.value?E="repriced":m.data==="0x"&&m.from===m.to&&m.value===gP&&(E="cancelled"),(0,At.assert)(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:E==="replaced"||E==="cancelled",reason:E,replacement:m.replaceableTransaction(i),hash:m.hash,receipt:y})}}o++}},u=d=>{if(d==null||d.status!==0)return d;(0,At.assert)(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:d.to,from:d.from,data:""},receipt:d})},l=await this.provider.getTransactionReceipt(this.hash);if(n===0)return u(l);if(l){if(await l.confirmations()>=n)return u(l)}else if(await c(),n===0)return null;return await new Promise((d,h)=>{let b=[],p=()=>{b.forEach(m=>m())};if(b.push(()=>{a=!0}),s>0){let m=setTimeout(()=>{p(),h((0,At.makeError)("wait for transaction timeout","TIMEOUT"))},s);b.push(()=>{clearTimeout(m)})}let g=async m=>{if(await m.confirmations()>=n){p();try{d(u(m))}catch(y){h(y)}}};if(b.push(()=>{this.provider.off(this.hash,g)}),this.provider.on(this.hash,g),i>=0){let m=async()=>{try{await c()}catch(y){if((0,At.isError)(y,"TRANSACTION_REPLACED")){p(),h(y);return}}a||this.provider.once("block",m)};b.push(()=>{this.provider.off("block",m)}),this.provider.once("block",m)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return(0,At.assert)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),yP(this)}reorderedEvent(e){return(0,At.assert)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),(0,At.assert)(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),xP(this,e)}replaceableTransaction(e){(0,At.assertArgument)(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);let t=new xu(this,this.provider);return t.#e=e,t}};Vr.TransactionResponse=xu;function Ej(r){return{orphan:"drop-block",hash:r.hash,number:r.number}}function xP(r,e){return{orphan:"reorder-transaction",tx:r,other:e}}function yP(r){return{orphan:"drop-transaction",tx:r}}function vj(r){return{orphan:"drop-log",log:{transactionHash:r.transactionHash,blockHash:r.blockHash,blockNumber:r.blockNumber,address:r.address,data:r.data,topics:Object.freeze(r.topics.slice()),index:r.index}}}});var Q1=M(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.ContractEventPayload=Kr.ContractUnknownEventPayload=Kr.ContractTransactionResponse=Kr.ContractTransactionReceipt=Kr.UndecodedEventLog=Kr.EventLog=void 0;var wh=yu(),Gf=me(),zf=class extends wh.Log{interface;fragment;args;constructor(e,t,n){super(e,e.provider);let s=t.decodeEventLog(n,e.data,e.topics);(0,Gf.defineProperties)(this,{args:s,fragment:n,interface:t})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}};Kr.EventLog=zf;var gh=class extends wh.Log{error;constructor(e,t){super(e,e.provider),(0,Gf.defineProperties)(this,{error:t})}};Kr.UndecodedEventLog=gh;var xh=class extends wh.TransactionReceipt{#e;constructor(e,t,n){super(n,t),this.#e=e}get logs(){return super.logs.map(e=>{let t=e.topics.length?this.#e.getEvent(e.topics[0]):null;if(t)try{return new zf(e,this.#e,t)}catch(n){return new gh(e,n)}return e})}};Kr.ContractTransactionReceipt=xh;var J1=class extends wh.TransactionResponse{#e;constructor(e,t,n){super(n,t),this.#e=e}async wait(e,t){let n=await super.wait(e,t);return n==null?null:new xh(this.#e,this.provider,n)}};Kr.ContractTransactionResponse=J1;var yh=class extends Gf.EventPayload{log;constructor(e,t,n,s){super(e,t,n),(0,Gf.defineProperties)(this,{log:s})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}};Kr.ContractUnknownEventPayload=yh;var W1=class extends yh{constructor(e,t,n,s,i){super(e,t,n,new zf(i,e.interface,s));let o=e.interface.decodeEventLog(s,this.log.data,this.log.topics);(0,Gf.defineProperties)(this,{args:o,fragment:s})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}};Kr.ContractEventPayload=W1});var sw=M(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.Contract=Us.BaseContract=Us.resolveArgs=Us.copyOverrides=void 0;var tw=bu(),wu=Yt(),EP=yu(),Ie=me(),La=Q1(),wP=BigInt(0);function vP(r){return r&&typeof r.call=="function"}function TP(r){return r&&typeof r.estimateGas=="function"}function vh(r){return r&&typeof r.resolveName=="function"}function PP(r){return r&&typeof r.sendTransaction=="function"}function kP(r){if(r!=null){if(vh(r))return r;if(r.provider)return r.provider}}var Y1=class{#e;fragment;constructor(e,t,n){if((0,Ie.defineProperties)(this,{fragment:t}),t.inputs.length<n.length)throw new Error("too many arguments");let s=ja(e.runner,"resolveName"),i=vh(s)?s:null;this.#e=async function(){let o=await Promise.all(t.inputs.map((a,c)=>n[c]==null?null:a.walkAsync(n[c],(l,f)=>l==="address"?Array.isArray(f)?Promise.all(f.map(d=>(0,wu.resolveAddress)(d,i))):(0,wu.resolveAddress)(f,i):f)));return e.interface.encodeFilterTopics(t,o)}()}getTopicFilter(){return this.#e}};function ja(r,e){return r==null?null:typeof r[e]=="function"?r:r.provider&&typeof r.provider[e]=="function"?r.provider:null}function Ma(r){return r==null?null:r.provider||null}async function rw(r,e){let t=tw.Typed.dereference(r,"overrides");(0,Ie.assertArgument)(typeof t=="object","invalid overrides parameter","overrides",r);let n=(0,EP.copyRequest)(t);return(0,Ie.assertArgument)(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),(0,Ie.assertArgument)(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}Us.copyOverrides=rw;async function BP(r,e,t){let n=ja(r,"resolveName"),s=vh(n)?n:null;return await Promise.all(e.map((i,o)=>i.walkAsync(t[o],(a,c)=>(c=tw.Typed.dereference(c,a),a==="address"?(0,wu.resolveAddress)(c,s):c))))}Us.resolveArgs=BP;function Tj(r){let e=async function(o){let a=await rw(o,["data"]);a.to=await r.getAddress(),a.from&&(a.from=await(0,wu.resolveAddress)(a.from,kP(r.runner)));let c=r.interface,u=(0,Ie.getBigInt)(a.value||wP,"overrides.value")===wP,l=(a.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!l&&!u&&(0,Ie.assertArgument)(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),(0,Ie.assertArgument)(c.fallback||l,"cannot send data to receive-only contract","overrides.data",a.data);let f=c.receive||c.fallback&&c.fallback.payable;return(0,Ie.assertArgument)(f||u,"cannot send value to non-payable fallback","overrides.value",a.value),(0,Ie.assertArgument)(c.fallback||l,"cannot send data to receive-only contract","overrides.data",a.data),a},t=async function(o){let a=ja(r.runner,"call");(0,Ie.assert)(vP(a),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});let c=await e(o);try{return await a.call(c)}catch(u){throw(0,Ie.isCallException)(u)&&u.data?r.interface.makeError(u.data,c):u}},n=async function(o){let a=r.runner;(0,Ie.assert)(PP(a),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let c=await a.sendTransaction(await e(o)),u=Ma(r.runner);return new La.ContractTransactionResponse(r.interface,u,c)},s=async function(o){let a=ja(r.runner,"estimateGas");return(0,Ie.assert)(TP(a),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await a.estimateGas(await e(o))},i=async o=>await n(o);return(0,Ie.defineProperties)(i,{_contract:r,estimateGas:s,populateTransaction:e,send:n,staticCall:t}),i}function Pj(r,e){let t=function(...u){let l=r.interface.getFunction(e,u);return(0,Ie.assert)(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:u}}),l},n=async function(...u){let l=t(...u),f={};if(l.inputs.length+1===u.length&&(f=await rw(u.pop()),f.from&&(f.from=await(0,wu.resolveAddress)(f.from,kP(r.runner)))),l.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");let d=await BP(r.runner,l.inputs,u);return Object.assign({},f,await(0,Ie.resolveProperties)({to:r.getAddress(),data:r.interface.encodeFunctionData(l,d)}))},s=async function(...u){let l=await a(...u);return l.length===1?l[0]:l},i=async function(...u){let l=r.runner;(0,Ie.assert)(PP(l),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let f=await l.sendTransaction(await n(...u)),d=Ma(r.runner);return new La.ContractTransactionResponse(r.interface,d,f)},o=async function(...u){let l=ja(r.runner,"estimateGas");return(0,Ie.assert)(TP(l),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await l.estimateGas(await n(...u))},a=async function(...u){let l=ja(r.runner,"call");(0,Ie.assert)(vP(l),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});let f=await n(...u),d="0x";try{d=await l.call(f)}catch(b){throw(0,Ie.isCallException)(b)&&b.data?r.interface.makeError(b.data,f):b}let h=t(...u);return r.interface.decodeFunctionResult(h,d)},c=async(...u)=>t(...u).constant?await s(...u):await i(...u);return(0,Ie.defineProperties)(c,{name:r.interface.getFunctionName(e),_contract:r,_key:e,getFragment:t,estimateGas:o,populateTransaction:n,send:i,staticCall:s,staticCallResult:a}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{let u=r.interface.getFunction(e);return(0,Ie.assert)(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),u}}),c}function kj(r,e){let t=function(...s){let i=r.interface.getEvent(e,s);return(0,Ie.assert)(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:s}}),i},n=function(...s){return new Y1(r,t(...s),s)};return(0,Ie.defineProperties)(n,{name:r.interface.getEventName(e),_contract:r,_key:e,getFragment:t}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{let s=r.interface.getEvent(e);return(0,Ie.assert)(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),s}}),n}var Eh=Symbol.for("_ethersInternal_contract"),SP=new WeakMap;function Bj(r,e){SP.set(r[Eh],e)}function an(r){return SP.get(r[Eh])}function Sj(r){return r&&typeof r=="object"&&"getTopicFilter"in r&&typeof r.getTopicFilter=="function"&&r.fragment}async function nw(r,e){let t,n=null;if(Array.isArray(e)){let i=function(o){if((0,Ie.isHexString)(o,32))return o;let a=r.interface.getEvent(o);return(0,Ie.assertArgument)(a,"unknown fragment","name",o),a.topicHash};t=e.map(o=>o==null?null:Array.isArray(o)?o.map(i):i(o))}else e==="*"?t=[null]:typeof e=="string"?(0,Ie.isHexString)(e,32)?t=[e]:(n=r.interface.getEvent(e),(0,Ie.assertArgument)(n,"unknown fragment","event",e),t=[n.topicHash]):Sj(e)?t=await e.getTopicFilter():"fragment"in e?(n=e.fragment,t=[n.topicHash]):(0,Ie.assertArgument)(!1,"unknown event name","event",e);t=t.map(i=>{if(i==null)return null;if(Array.isArray(i)){let o=Array.from(new Set(i.map(a=>a.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return i.toLowerCase()});let s=t.map(i=>i==null?"null":Array.isArray(i)?i.join("|"):i).join("&");return{fragment:n,tag:s,topics:t}}async function Vf(r,e){let{subs:t}=an(r);return t.get((await nw(r,e)).tag)||null}async function AP(r,e,t){let n=Ma(r.runner);(0,Ie.assert)(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});let{fragment:s,tag:i,topics:o}=await nw(r,t),{addr:a,subs:c}=an(r),u=c.get(i);if(!u){let f={address:a||r,topics:o},d=g=>{let m=s;if(m==null)try{m=r.interface.getEvent(g.topics[0])}catch{}if(m){let y=m,E=s?r.interface.decodeEventLog(s,g.data,g.topics):[];X1(r,t,E,v=>new La.ContractEventPayload(r,v,t,y,g))}else X1(r,t,[],y=>new La.ContractUnknownEventPayload(r,y,t,g))},h=[];u={tag:i,listeners:[],start:()=>{h.length||h.push(n.on(f,d))},stop:async()=>{if(h.length==0)return;let g=h;h=[],await Promise.all(g),n.off(f,d)}},c.set(i,u)}return u}var Z1=Promise.resolve();async function Oj(r,e,t,n){await Z1;let s=await Vf(r,e);if(!s)return!1;let i=s.listeners.length;return s.listeners=s.listeners.filter(({listener:o,once:a})=>{let c=Array.from(t);n&&c.push(n(a?null:o));try{o.call(r,...c)}catch{}return!a}),s.listeners.length===0&&(s.stop(),an(r).subs.delete(s.tag)),i>0}async function X1(r,e,t,n){try{await Z1}catch{}let s=Oj(r,e,t,n);return Z1=s,await s}var Ah=["then"],xo=class{target;interface;runner;filters;[Eh];fallback;constructor(e,t,n,s){(0,Ie.assertArgument)(typeof e=="string"||(0,wu.isAddressable)(e),"invalid value for Contract target","target",e),n==null&&(n=null);let i=tw.Interface.from(t);(0,Ie.defineProperties)(this,{target:e,runner:n,interface:i}),Object.defineProperty(this,Eh,{value:{}});let o,a=null,c=null;if(s){let f=Ma(n);c=new La.ContractTransactionResponse(this.interface,f,s)}let u=new Map;if(typeof e=="string")if((0,Ie.isHexString)(e))a=e,o=Promise.resolve(e);else{let f=ja(n,"resolveName");if(!vh(f))throw(0,Ie.makeError)("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(d=>{if(d==null)throw(0,Ie.makeError)("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return an(this).addr=d,d})}else o=e.getAddress().then(f=>{if(f==null)throw new Error("TODO");return an(this).addr=f,f});Bj(this,{addrPromise:o,addr:a,deployTx:c,subs:u});let l=new Proxy({},{get:(f,d,h)=>{if(typeof d=="symbol"||Ah.indexOf(d)>=0)return Reflect.get(f,d,h);try{return this.getEvent(d)}catch(b){if(!(0,Ie.isError)(b,"INVALID_ARGUMENT")||b.argument!=="key")throw b}},has:(f,d)=>Ah.indexOf(d)>=0?Reflect.has(f,d):Reflect.has(f,d)||this.interface.hasEvent(String(d))});return(0,Ie.defineProperties)(this,{filters:l}),(0,Ie.defineProperties)(this,{fallback:i.receive||i.fallback?Tj(this):null}),new Proxy(this,{get:(f,d,h)=>{if(typeof d=="symbol"||d in f||Ah.indexOf(d)>=0)return Reflect.get(f,d,h);try{return f.getFunction(d)}catch(b){if(!(0,Ie.isError)(b,"INVALID_ARGUMENT")||b.argument!=="key")throw b}},has:(f,d)=>typeof d=="symbol"||d in f||Ah.indexOf(d)>=0?Reflect.has(f,d):f.interface.hasFunction(d)})}connect(e){return new xo(this.target,this.interface,e)}attach(e){return new xo(e,this.interface,this.runner)}async getAddress(){return await an(this).addrPromise}async getDeployedCode(){let e=Ma(this.runner);(0,Ie.assert)(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});let t=await e.getCode(await this.getAddress());return t==="0x"?null:t}async waitForDeployment(){let e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;let n=Ma(this.runner);return(0,Ie.assert)(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((s,i)=>{let o=async()=>{try{if(await this.getDeployedCode()!=null)return s(this);n.once("block",o)}catch(a){i(a)}};o()})}deploymentTransaction(){return an(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),Pj(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),kj(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,n){t==null&&(t=0),n==null&&(n="latest");let{addr:s,addrPromise:i}=an(this),o=s||await i,{fragment:a,topics:c}=await nw(this,e),u={address:o,topics:c,fromBlock:t,toBlock:n},l=Ma(this.runner);return(0,Ie.assert)(l,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await l.getLogs(u)).map(f=>{let d=a;if(d==null)try{d=this.interface.getEvent(f.topics[0])}catch{}if(d)try{return new La.EventLog(f,this.interface,d)}catch(h){return new La.UndecodedEventLog(f,h)}return new EP.Log(f,l)})}async on(e,t){let n=await AP(this,"on",e);return n.listeners.push({listener:t,once:!1}),n.start(),this}async once(e,t){let n=await AP(this,"once",e);return n.listeners.push({listener:t,once:!0}),n.start(),this}async emit(e,...t){return await X1(this,e,t,null)}async listenerCount(e){if(e){let s=await Vf(this,e);return s?s.listeners.length:0}let{subs:t}=an(this),n=0;for(let{listeners:s}of t.values())n+=s.length;return n}async listeners(e){if(e){let s=await Vf(this,e);return s?s.listeners.map(({listener:i})=>i):[]}let{subs:t}=an(this),n=[];for(let{listeners:s}of t.values())n=n.concat(s.map(({listener:i})=>i));return n}async off(e,t){let n=await Vf(this,e);if(!n)return this;if(t){let s=n.listeners.map(({listener:i})=>i).indexOf(t);s>=0&&n.listeners.splice(s,1)}return(t==null||n.listeners.length===0)&&(n.stop(),an(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){let t=await Vf(this,e);if(!t)return this;t.stop(),an(this).subs.delete(t.tag)}else{let{subs:t}=an(this);for(let{tag:n,stop:s}of t.values())s(),t.delete(n)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){class t extends xo{constructor(s,i=null){super(s,e,i)}}return t}static from(e,t,n){return n==null&&(n=null),new this(e,t,n)}};Us.BaseContract=xo;function _j(){return xo}var ew=class extends _j(){};Us.Contract=ew});var OP=M(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});Ph.ContractFactory=void 0;var Cj=bu(),Nj=Yt(),yo=me(),Th=sw(),Kf=class{interface;bytecode;runner;constructor(e,t,n){let s=Cj.Interface.from(e);t instanceof Uint8Array||(typeof t=="object"&&(t=t.object),t.startsWith("0x")||(t="0x"+t)),t=(0,yo.hexlify)((0,yo.getBytes)(t)),(0,yo.defineProperties)(this,{bytecode:t,interface:s,runner:n||null})}attach(e){return new Th.BaseContract(e,this.interface,this.runner)}async getDeployTransaction(...e){let t={},n=this.interface.deploy;if(n.inputs.length+1===e.length&&(t=await(0,Th.copyOverrides)(e.pop())),n.inputs.length!==e.length)throw new Error("incorrect number of arguments to constructor");let s=await(0,Th.resolveArgs)(this.runner,n.inputs,e),i=(0,yo.concat)([this.bytecode,this.interface.encodeDeploy(s)]);return Object.assign({},t,{data:i})}async deploy(...e){let t=await this.getDeployTransaction(...e);(0,yo.assert)(this.runner&&typeof this.runner.sendTransaction=="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let n=await this.runner.sendTransaction(t),s=(0,Nj.getCreateAddress)(n);return new Th.BaseContract(s,this.interface,this.runner,n)}connect(e){return new Kf(this.interface,this.bytecode,e)}static fromSolidity(e,t){(0,yo.assertArgument)(e!=null,"bad compiler output","output",e),typeof e=="string"&&(e=JSON.parse(e));let n=e.abi,s="";return e.bytecode?s=e.bytecode:e.evm&&e.evm.bytecode&&(s=e.evm.bytecode),new this(n,s,t)}};Ph.ContractFactory=Kf});var Jf=M(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.UndecodedEventLog=qt.EventLog=qt.ContractTransactionResponse=qt.ContractTransactionReceipt=qt.ContractUnknownEventPayload=qt.ContractEventPayload=qt.ContractFactory=qt.Contract=qt.BaseContract=void 0;var _P=sw();Object.defineProperty(qt,"BaseContract",{enumerable:!0,get:function(){return _P.BaseContract}});Object.defineProperty(qt,"Contract",{enumerable:!0,get:function(){return _P.Contract}});var Ij=OP();Object.defineProperty(qt,"ContractFactory",{enumerable:!0,get:function(){return Ij.ContractFactory}});var Au=Q1();Object.defineProperty(qt,"ContractEventPayload",{enumerable:!0,get:function(){return Au.ContractEventPayload}});Object.defineProperty(qt,"ContractUnknownEventPayload",{enumerable:!0,get:function(){return Au.ContractUnknownEventPayload}});Object.defineProperty(qt,"ContractTransactionReceipt",{enumerable:!0,get:function(){return Au.ContractTransactionReceipt}});Object.defineProperty(qt,"ContractTransactionResponse",{enumerable:!0,get:function(){return Au.ContractTransactionResponse}});Object.defineProperty(qt,"EventLog",{enumerable:!0,get:function(){return Au.EventLog}});Object.defineProperty(qt,"UndecodedEventLog",{enumerable:!0,get:function(){return Au.UndecodedEventLog}})});var uw=M(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.EnsResolver=Eo.BasicMulticoinProviderPlugin=Eo.MulticoinProviderPlugin=void 0;var Rj=Yt(),CP=Xc(),iw=Jf(),ow=Ls(),_r=me();function aw(r){return r.match(/^ipfs:\/\/ipfs\//i)?r=r.substring(12):r.match(/^ipfs:\/\//i)?r=r.substring(7):(0,_r.assertArgument)(!1,"unsupported IPFS format","link",r),`https://gateway.ipfs.io/ipfs/${r}`}var Qf=class{name;constructor(e){(0,_r.defineProperties)(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,t){throw new Error("unsupported coin")}async decodeAddress(e,t){throw new Error("unsupported coin")}};Eo.MulticoinProviderPlugin=Qf;var Mj="org.ethers.plugins.provider.BasicMulticoin",cw=class extends Qf{constructor(){super(Mj)}};Eo.BasicMulticoinProviderPlugin=cw;var IP=new RegExp("^(ipfs)://(.*)$","i"),NP=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),IP,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")],wo,Ua,Ao,Eu,Bh,RP,Wf=class{constructor(e,t,n){vs(this,Ao);tn(this,"provider");tn(this,"address");tn(this,"name");vs(this,wo,void 0);vs(this,Ua,void 0);(0,_r.defineProperties)(this,{provider:e,address:t,name:n}),Wl(this,wo,null),Wl(this,Ua,new iw.Contract(t,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return fc(this,wo)==null&&Wl(this,wo,(async()=>{try{return await fc(this,Ua).supportsInterface("0x9061b923")}catch(e){if((0,_r.isError)(e,"CALL_EXCEPTION"))return!1;throw Wl(this,wo,null),e}})()),await fc(this,wo)}async getAddress(e){if(e==null&&(e=60),e===60)try{let i=await ur(this,Ao,Eu).call(this,"addr(bytes32)");return i==null||i===CP.ZeroAddress?null:i}catch(i){if((0,_r.isError)(i,"CALL_EXCEPTION"))return null;throw i}if(e>=0&&e<2147483648){let i=e+2147483648,o=await ur(this,Ao,Eu).call(this,"addr(bytes32,uint)",[i]);if((0,_r.isHexString)(o,20))return(0,Rj.getAddress)(o)}let t=null;for(let i of this.provider.plugins)if(i instanceof Qf&&i.supportsCoinType(e)){t=i;break}if(t==null)return null;let n=await ur(this,Ao,Eu).call(this,"addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;let s=await t.decodeAddress(e,n);if(s!=null)return s;(0,_r.assert)(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){let t=await ur(this,Ao,Eu).call(this,"text(bytes32,string)",[e]);return t==null||t==="0x"?null:t}async getContentHash(){let e=await ur(this,Ao,Eu).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;let t=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){let s=t[1]==="e3010170"?"ipfs":"ipns",i=parseInt(t[4],16);if(t[5].length===i*2)return`${s}://${(0,_r.encodeBase58)("0x"+t[2])}`}let n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;(0,_r.assert)(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){let e=[{type:"name",value:this.name}];try{let t=await this.getText("avatar");if(t==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:t});for(let n=0;n<NP.length;n++){let s=t.match(NP[n]);if(s==null)continue;let i=s[1].toLowerCase();switch(i){case"https":case"data":return e.push({type:"url",value:t}),{linkage:e,url:t};case"ipfs":{let o=aw(t);return e.push({type:"ipfs",value:t}),e.push({type:"url",value:o}),{linkage:e,url:o}}case"erc721":case"erc1155":{let o=i==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:i,value:t});let a=await this.getAddress();if(a==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};let c=(s[2]||"").split("/");if(c.length!==2)return e.push({type:`!${i}caip`,value:s[2]||""}),{url:null,linkage:e};let u=c[1],l=new iw.Contract(c[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(i==="erc721"){let p=await l.ownerOf(u);if(a!==p)return e.push({type:"!owner",value:p}),{url:null,linkage:e};e.push({type:"owner",value:p})}else if(i==="erc1155"){let p=await l.balanceOf(a,u);if(!p)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:p.toString()})}let f=await l[o](u);if(f==null||f==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:f}),i==="erc1155"&&(f=f.replace("{id}",(0,_r.toBeHex)(u,32).substring(2)),e.push({type:"metadata-url-expanded",value:f})),f.match(/^ipfs:/i)&&(f=aw(f)),e.push({type:"metadata-url",value:f});let d={},h=await new _r.FetchRequest(f).send();h.assertOk();try{d=h.bodyJson}catch{try{e.push({type:"!metadata",value:h.bodyText})}catch{let m=h.body;return m&&e.push({type:"!metadata",value:(0,_r.hexlify)(m)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!d)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(d)});let b=d.image;if(typeof b!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!b.match(/^(https:\/\/|data:)/i)){if(b.match(IP)==null)return e.push({type:"!imageUrl-ipfs",value:b}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:b}),b=aw(b)}return e.push({type:"url",value:b}),{linkage:e,url:b}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){let t=await e.getNetwork(),n=t.getPlugin("org.ethers.plugins.network.Ens");return(0,_r.assert)(n,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:t}}),n.address}static async fromName(e,t){var s;let n=t;for(;;){if(n===""||n==="."||t!=="eth"&&n==="eth")return null;let i=await ur(s=Wf,Bh,RP).call(s,e,n);if(i!=null){let o=new Wf(e,i,t);return n!==t&&!await o.supportsWildcard()?null:o}n=n.split(".").slice(1).join(".")}}},kh=Wf;wo=new WeakMap,Ua=new WeakMap,Ao=new WeakSet,Eu=async function(e,t){t=(t||[]).slice();let n=fc(this,Ua).interface;t.unshift((0,ow.namehash)(this.name));let s=null;await this.supportsWildcard()&&(s=n.getFunction(e),(0,_r.assert)(s,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),t=[(0,ow.dnsEncode)(this.name,255),n.encodeFunctionData(s,t)],e="resolve(bytes,bytes)"),t.push({enableCcipRead:!0});try{let i=await fc(this,Ua)[e](...t);return s?n.decodeFunctionResult(s,i)[0]:i}catch(i){if(!(0,_r.isError)(i,"CALL_EXCEPTION"))throw i}return null},Bh=new WeakSet,RP=async function(e,t){let n=await Wf.getEnsAddress(e);try{let i=await new iw.Contract(n,["function resolver(bytes32) view returns (address)"],e).resolver((0,ow.namehash)(t),{enableCcipRead:!0});return i===CP.ZeroAddress?null:i}catch(s){throw s}return null},vs(kh,Bh);Eo.EnsResolver=kh});var DP=M(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.formatTransactionResponse=mt.formatTransactionReceipt=mt.formatReceiptLog=mt.formatBlock=mt.formatLog=mt.formatUint256=mt.formatHash=mt.formatData=mt.formatBoolean=mt.object=mt.arrayOf=mt.allowNull=void 0;var Fs=Yt(),MP=nr(),Lj=qr(),Ne=me(),LP=BigInt(0);function Ve(r,e){return function(t){return t==null?e:r(t)}}mt.allowNull=Ve;function Yf(r,e){return t=>{if(e&&t==null)return null;if(!Array.isArray(t))throw new Error("not an array");return t.map(n=>r(n))}}mt.arrayOf=Yf;function vu(r,e){return t=>{let n={};for(let s in r){let i=s;if(e&&s in e&&!(i in t)){for(let o of e[s])if(o in t){i=o;break}}try{let o=r[s](t[i]);o!==void 0&&(n[s]=o)}catch(o){let a=o instanceof Error?o.message:"not-an-error";(0,Ne.assert)(!1,`invalid value for value.${s} (${a})`,"BAD_DATA",{value:t})}}return n}}mt.object=vu;function jP(r){switch(r){case!0:case"true":return!0;case!1:case"false":return!1}(0,Ne.assertArgument)(!1,`invalid boolean; ${JSON.stringify(r)}`,"value",r)}mt.formatBoolean=jP;function Fa(r){return(0,Ne.assertArgument)((0,Ne.isHexString)(r,!0),"invalid data","value",r),r}mt.formatData=Fa;function ir(r){return(0,Ne.assertArgument)((0,Ne.isHexString)(r,32),"invalid hash","value",r),r}mt.formatHash=ir;function jj(r){if(!(0,Ne.isHexString)(r))throw new Error("invalid uint256");return(0,Ne.zeroPadValue)(r,32)}mt.formatUint256=jj;var Uj=vu({address:Fs.getAddress,blockHash:ir,blockNumber:Ne.getNumber,data:Fa,index:Ne.getNumber,removed:Ve(jP,!1),topics:Yf(ir),transactionHash:ir,transactionIndex:Ne.getNumber},{index:["logIndex"]});function Fj(r){return Uj(r)}mt.formatLog=Fj;var Dj=vu({hash:Ve(ir),parentHash:ir,parentBeaconBlockRoot:Ve(ir,null),number:Ne.getNumber,timestamp:Ne.getNumber,nonce:Ve(Fa),difficulty:Ne.getBigInt,gasLimit:Ne.getBigInt,gasUsed:Ne.getBigInt,stateRoot:Ve(ir,null),receiptsRoot:Ve(ir,null),blobGasUsed:Ve(Ne.getBigInt,null),excessBlobGas:Ve(Ne.getBigInt,null),miner:Ve(Fs.getAddress),prevRandao:Ve(ir,null),extraData:Fa,baseFeePerGas:Ve(Ne.getBigInt)},{prevRandao:["mixHash"]});function Hj(r){let e=Dj(r);return e.transactions=r.transactions.map(t=>typeof t=="string"?t:FP(t)),e}mt.formatBlock=Hj;var $j=vu({transactionIndex:Ne.getNumber,blockNumber:Ne.getNumber,transactionHash:ir,address:Fs.getAddress,topics:Yf(ir),data:Fa,index:Ne.getNumber,blockHash:ir},{index:["logIndex"]});function UP(r){return $j(r)}mt.formatReceiptLog=UP;var qj=vu({to:Ve(Fs.getAddress,null),from:Ve(Fs.getAddress,null),contractAddress:Ve(Fs.getAddress,null),index:Ne.getNumber,root:Ve(Ne.hexlify),gasUsed:Ne.getBigInt,blobGasUsed:Ve(Ne.getBigInt,null),logsBloom:Ve(Fa),blockHash:ir,hash:ir,logs:Yf(UP),blockNumber:Ne.getNumber,cumulativeGasUsed:Ne.getBigInt,effectiveGasPrice:Ve(Ne.getBigInt),blobGasPrice:Ve(Ne.getBigInt,null),status:Ve(Ne.getNumber),type:Ve(Ne.getNumber,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function Gj(r){return qj(r)}mt.formatTransactionReceipt=Gj;function FP(r){r.to&&(0,Ne.getBigInt)(r.to)===LP&&(r.to="0x0000000000000000000000000000000000000000");let e=vu({hash:ir,index:Ve(Ne.getNumber,void 0),type:t=>t==="0x"||t==null?0:(0,Ne.getNumber)(t),accessList:Ve(Lj.accessListify,null),blobVersionedHashes:Ve(Yf(ir,!0),null),blockHash:Ve(ir,null),blockNumber:Ve(Ne.getNumber,null),transactionIndex:Ve(Ne.getNumber,null),from:Fs.getAddress,gasPrice:Ve(Ne.getBigInt),maxPriorityFeePerGas:Ve(Ne.getBigInt),maxFeePerGas:Ve(Ne.getBigInt),maxFeePerBlobGas:Ve(Ne.getBigInt,null),gasLimit:Ne.getBigInt,to:Ve(Fs.getAddress,null),value:Ne.getBigInt,nonce:Ne.getNumber,data:Fa,creates:Ve(Fs.getAddress,null),chainId:Ve(Ne.getBigInt,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(r);if(e.to==null&&e.creates==null&&(e.creates=(0,Fs.getCreateAddress)(e)),(r.type===1||r.type===2)&&r.accessList==null&&(e.accessList=[]),r.signature?e.signature=MP.Signature.from(r.signature):e.signature=MP.Signature.from(r),e.chainId==null){let t=e.signature.legacyChainId;t!=null&&(e.chainId=t)}return e.blockHash&&(0,Ne.getBigInt)(e.blockHash)===LP&&(e.blockHash=null),e}mt.formatTransactionResponse=FP});var Sh=M(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.FetchUrlFeeDataNetworkPlugin=On.FeeDataNetworkPlugin=On.EnsPlugin=On.GasCostPlugin=On.NetworkPlugin=void 0;var fw=Yi(),zj=me(),Vj="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",Ti=class{name;constructor(e){(0,fw.defineProperties)(this,{name:e})}clone(){return new Ti(this.name)}};On.NetworkPlugin=Ti;var Zf=class extends Ti{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(e,t){e==null&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`);let n={effectiveBlock:e};function s(i,o){let a=(t||{})[i];a==null&&(a=o),(0,zj.assertArgument)(typeof a=="number",`invalud value for ${i}`,"costs",t),n[i]=a}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),(0,fw.defineProperties)(this,n)}clone(){return new Zf(this.effectiveBlock,this)}};On.GasCostPlugin=Zf;var Xf=class extends Ti{address;targetNetwork;constructor(e,t){super("org.ethers.plugins.network.Ens"),(0,fw.defineProperties)(this,{address:e||Vj,targetNetwork:t??1})}clone(){return new Xf(this.address,this.targetNetwork)}};On.EnsPlugin=Xf;var ed=class extends Ti{#e;get feeDataFunc(){return this.#e}constructor(e){super("org.ethers.plugins.network.FeeData"),this.#e=e}async getFeeData(e){return await this.#e(e)}clone(){return new ed(this.#e)}};On.FeeDataNetworkPlugin=ed;var lw=class extends Ti{#e;#t;get url(){return this.#e}get processFunc(){return this.#t}constructor(e,t){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#e=e,this.#t=t}clone(){return this}};On.FetchUrlFeeDataNetworkPlugin=lw});var Jr=M(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});Oh.Network=void 0;var Kj=qr(),Ds=me(),td=Sh(),dw=new Map,_n=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=(0,Ds.getBigInt)(t),this.#r=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#e}set name(e){this.#e=e}get chainId(){return this.#t}set chainId(e){this.#t=(0,Ds.getBigInt)(e,"chainId")}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===(0,Ds.getBigInt)(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===(0,Ds.getBigInt)(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===(0,Ds.getBigInt)(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(this.#r.values())}attachPlugin(e){if(this.#r.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#r.set(e.name,e.clone()),this}getPlugin(e){return this.#r.get(e)||null}getPlugins(e){return this.plugins.filter(t=>t.name.split("#")[0]===e)}clone(){let e=new _n(this.name,this.chainId);return this.plugins.forEach(t=>{e.attachPlugin(t.clone())}),e}computeIntrinsicGas(e){let t=this.getPlugin("org.ethers.plugins.network.GasCost")||new td.GasCostPlugin,n=t.txBase;if(e.to==null&&(n+=t.txCreate),e.data)for(let s=2;s<e.data.length;s+=2)e.data.substring(s,s+2)==="00"?n+=t.txDataZero:n+=t.txDataNonzero;if(e.accessList){let s=(0,Kj.accessListify)(e.accessList);for(let i in s)n+=t.txAccessListAddress+t.txAccessListStorageKey*s[i].storageKeys.length}return n}static from(e){if(Jj(),e==null)return _n.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){let t=dw.get(e);if(t)return t();if(typeof e=="bigint")return new _n("unknown",e);(0,Ds.assertArgument)(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){(0,Ds.assertArgument)(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);let t=new _n(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&t.attachPlugin(new td.EnsPlugin(e.ensAddress,e.ensNetwork)),t}(0,Ds.assertArgument)(!1,"invalid network","network",e)}static register(e,t){typeof e=="number"&&(e=BigInt(e));let n=dw.get(e);n&&(0,Ds.assertArgument)(!1,`conflicting network for ${JSON.stringify(n.name)}`,"nameOrChainId",e),dw.set(e,t)}};Oh.Network=_n;function HP(r,e){let t=String(r);if(!t.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${r}`);let n=t.split(".");if(n.length===1&&n.push(""),n.length!==2)throw new Error(`invalid gwei value: ${r}`);for(;n[1].length<e;)n[1]+="0";if(n[1].length>9){let s=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||s++,n[1]=s.toString()}return BigInt(n[0]+n[1])}function $P(r){return new td.FetchUrlFeeDataNetworkPlugin(r,async(e,t,n)=>{n.setHeader("User-Agent","ethers");let s;try{let[i,o]=await Promise.all([n.send(),e()]);s=i;let a=s.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:HP(a.maxFee,9),maxPriorityFeePerGas:HP(a.maxPriorityFee,9)}}catch(i){(0,Ds.assert)(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:s,error:i})}})}var qP=!1;function Jj(){if(qP)return;qP=!0;function r(e,t,n){let s=function(){let i=new _n(e,t);return n.ensNetwork!=null&&i.attachPlugin(new td.EnsPlugin(null,n.ensNetwork)),i.attachPlugin(new td.GasCostPlugin),(n.plugins||[]).forEach(o=>{i.attachPlugin(o)}),i};_n.register(e,s),_n.register(t,s),n.altNames&&n.altNames.forEach(i=>{_n.register(i,s)})}r("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),r("ropsten",3,{ensNetwork:3}),r("rinkeby",4,{ensNetwork:4}),r("goerli",5,{ensNetwork:5}),r("kovan",42,{ensNetwork:42}),r("sepolia",11155111,{ensNetwork:11155111}),r("holesky",17e3,{ensNetwork:17e3}),r("classic",61,{}),r("classicKotti",6,{}),r("arbitrum",42161,{ensNetwork:1}),r("arbitrum-goerli",421613,{}),r("arbitrum-sepolia",421614,{}),r("base",8453,{ensNetwork:1}),r("base-goerli",84531,{}),r("base-sepolia",84532,{}),r("bnb",56,{ensNetwork:1}),r("bnbt",97,{}),r("linea",59144,{ensNetwork:1}),r("linea-goerli",59140,{}),r("linea-sepolia",59141,{}),r("matic",137,{ensNetwork:1,plugins:[$P("https://gasstation.polygon.technology/v2")]}),r("matic-amoy",80002,{}),r("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[$P("https://gasstation-testnet.polygon.technology/v2")]}),r("optimism",10,{ensNetwork:1,plugins:[]}),r("optimism-goerli",420,{}),r("optimism-sepolia",11155420,{}),r("xdai",100,{ensNetwork:1})}});var Nh=M(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.PollingEventSubscriber=yr.PollingTransactionSubscriber=yr.PollingOrphanSubscriber=yr.PollingBlockTagSubscriber=yr.OnBlockSubscriber=yr.PollingBlockSubscriber=yr.getPollingSubscriber=void 0;var GP=me();function pw(r){return JSON.parse(JSON.stringify(r))}function Wj(r,e){if(e==="block")return new _h(r);if((0,GP.isHexString)(e,32))return new Ch(r,e);(0,GP.assert)(!1,"unsupported polling event","UNSUPPORTED_OPERATION",{operation:"getPollingSubscriber",info:{event:e}})}yr.getPollingSubscriber=Wj;var _h=class{#e;#t;#r;#n;constructor(e){this.#e=e,this.#t=null,this.#r=4e3,this.#n=-2}get pollingInterval(){return this.#r}set pollingInterval(e){this.#r=e}async#s(){try{let e=await this.#e.getBlockNumber();if(this.#n===-2){this.#n=e;return}if(e!==this.#n){for(let t=this.#n+1;t<=e;t++){if(this.#t==null)return;await this.#e.emit("block",t)}this.#n=e}}catch{}this.#t!=null&&(this.#t=this.#e._setTimeout(this.#s.bind(this),this.#r))}start(){this.#t||(this.#t=this.#e._setTimeout(this.#s.bind(this),this.#r),this.#s())}stop(){!this.#t||(this.#e._clearTimeout(this.#t),this.#t=null)}pause(e){this.stop(),e&&(this.#n=-2)}resume(){this.start()}};yr.PollingBlockSubscriber=_h;var Tu=class{#e;#t;#r;constructor(e){this.#e=e,this.#r=!1,this.#t=t=>{this._poll(t,this.#e)}}async _poll(e,t){throw new Error("sub-classes must override this")}start(){this.#r||(this.#r=!0,this.#t(-2),this.#e.on("block",this.#t))}stop(){!this.#r||(this.#r=!1,this.#e.off("block",this.#t))}pause(e){this.stop()}resume(){this.start()}};yr.OnBlockSubscriber=Tu;var hw=class extends Tu{#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=-2}pause(e){e&&(this.#t=-2),super.pause(e)}async _poll(e,t){let n=await t.getBlock(this.#e);n!=null&&(this.#t===-2?this.#t=n.number:n.number>this.#t&&(t.emit(this.#e,n.number),this.#t=n.number))}};yr.PollingBlockTagSubscriber=hw;var mw=class extends Tu{#e;constructor(e,t){super(e),this.#e=pw(t)}async _poll(e,t){throw new Error("@TODO")}};yr.PollingOrphanSubscriber=mw;var Ch=class extends Tu{#e;constructor(e,t){super(e),this.#e=t}async _poll(e,t){let n=await t.getTransactionReceipt(this.#e);n&&t.emit(this.#e,n)}};yr.PollingTransactionSubscriber=Ch;var bw=class{#e;#t;#r;#n;#s;constructor(e,t){this.#e=e,this.#t=pw(t),this.#r=this.#o.bind(this),this.#n=!1,this.#s=-2}async#o(e){if(this.#s===-2)return;let t=pw(this.#t);t.fromBlock=this.#s+1,t.toBlock=e;let n=await this.#e.getLogs(t);if(n.length===0){this.#s<e-60&&(this.#s=e-60);return}for(let s of n)this.#e.emit(this.#t,s),this.#s=s.blockNumber}start(){this.#n||(this.#n=!0,this.#s===-2&&this.#e.getBlockNumber().then(e=>{this.#s=e}),this.#e.on("block",this.#r))}stop(){!this.#n||(this.#n=!1,this.#e.off("block",this.#r))}pause(e){this.stop(),e&&(this.#s=-2)}resume(){this.start()}};yr.PollingEventSubscriber=bw});var ku=M(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.AbstractProvider=Pu.UnmanagedSubscriber=void 0;var nd=Yt(),Qj=Xc(),zP=Jf(),Yj=Ls(),Zj=qr(),de=me(),VP=uw(),Ih=DP(),Xj=Jr(),vo=yu(),rd=Nh(),eU=BigInt(2),tU=10;function Rh(r){return r&&typeof r.then=="function"}function Mh(r,e){return r+":"+JSON.stringify(e,(t,n)=>{if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){let s=Object.keys(n);return s.sort(),s.reduce((i,o)=>(i[o]=n[o],i),{})}return n})}var Lh=class{name;constructor(e){(0,de.defineProperties)(this,{name:e})}start(){}stop(){}pause(e){}resume(){}};Pu.UnmanagedSubscriber=Lh;function rU(r){return JSON.parse(JSON.stringify(r))}function yw(r){return r=Array.from(new Set(r).values()),r.sort(),r}async function gw(r,e){if(r==null)throw new Error("invalid event");if(Array.isArray(r)&&(r={topics:r}),typeof r=="string")switch(r){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:r,tag:r}}if((0,de.isHexString)(r,32)){let t=r.toLowerCase();return{type:"transaction",tag:Mh("tx",{hash:t}),hash:t}}if(r.orphan){let t=r;return{type:"orphan",tag:Mh("orphan",t),filter:rU(t)}}if(r.address||r.topics){let t=r,n={topics:(t.topics||[]).map(s=>s==null?null:Array.isArray(s)?yw(s.map(i=>i.toLowerCase())):s.toLowerCase())};if(t.address){let s=[],i=[],o=a=>{(0,de.isHexString)(a)?s.push(a):i.push((async()=>{s.push(await(0,nd.resolveAddress)(a,e))})())};Array.isArray(t.address)?t.address.forEach(o):o(t.address),i.length&&await Promise.all(i),n.address=yw(s.map(a=>a.toLowerCase()))}return{filter:n,tag:Mh("event",n),type:"event"}}(0,de.assertArgument)(!1,"unknown ProviderEvent","event",r)}function xw(){return new Date().getTime()}var nU={cacheTimeout:250,pollingInterval:4e3},ww=class{#e;#t;#r;#n;#s;#o;#i;#a;#f;#u;#h;#m;constructor(e,t){if(this.#m=Object.assign({},nU,t||{}),e==="any")this.#o=!0,this.#s=null;else if(e){let n=Xj.Network.from(e);this.#o=!1,this.#s=Promise.resolve(n),setTimeout(()=>{this.emit("network",n,null)},0)}else this.#o=!1,this.#s=null;this.#a=-1,this.#i=new Map,this.#e=new Map,this.#t=new Map,this.#r=null,this.#n=!1,this.#f=1,this.#u=new Map,this.#h=!1}get pollingInterval(){return this.#m.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#t.values())}attachPlugin(e){if(this.#t.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#t.set(e.name,e.connect(this)),this}getPlugin(e){return this.#t.get(e)||null}get disableCcipRead(){return this.#h}set disableCcipRead(e){this.#h=!!e}async#c(e){let t=this.#m.cacheTimeout;if(t<0)return await this._perform(e);let n=Mh(e.method,e),s=this.#i.get(n);return s||(s=this._perform(e),this.#i.set(n,s),setTimeout(()=>{this.#i.get(n)===s&&this.#i.delete(n)},t)),await s}async ccipReadFetch(e,t,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;let s=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let a=0;a<n.length;a++){let c=n[a],u=c.replace("{sender}",s).replace("{data}",i),l=new de.FetchRequest(u);c.indexOf("{data}")===-1&&(l.body={data:i,sender:s}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:l,index:a,urls:n});let f="unknown error",d=await l.send();try{let h=d.bodyJson;if(h.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:l,result:h}),h.data;h.message&&(f=h.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:l,result:h})}catch{}(0,de.assert)(d.statusCode<400||d.statusCode>=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:c,errorMessage:f}}),o.push(f)}(0,de.assert)(!1,`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:o}})}_wrapBlock(e,t){return new vo.Block((0,Ih.formatBlock)(e),this)}_wrapLog(e,t){return new vo.Log((0,Ih.formatLog)(e),this)}_wrapTransactionReceipt(e,t){return new vo.TransactionReceipt((0,Ih.formatTransactionReceipt)(e),this)}_wrapTransactionResponse(e,t){return new vo.TransactionResponse((0,Ih.formatTransactionResponse)(e),this)}_detectNetwork(){(0,de.assert)(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){(0,de.assert)(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){let e=(0,de.getNumber)(await this.#c({method:"getBlockNumber"}),"%response");return this.#a>=0&&(this.#a=e),e}_getAddress(e){return(0,nd.resolveAddress)(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if((0,de.isHexString)(e))return(0,de.isHexString)(e,32)?e:(0,de.toQuantity)(e);if(typeof e=="bigint"&&(e=(0,de.getNumber)(e,"blockTag")),typeof e=="number")return e>=0?(0,de.toQuantity)(e):this.#a>=0?(0,de.toQuantity)(this.#a+e):this.getBlockNumber().then(t=>(0,de.toQuantity)(t+e));(0,de.assertArgument)(!1,"invalid blockTag","blockTag",e)}_getFilter(e){let t=(e.topics||[]).map(c=>c==null?null:Array.isArray(c)?yw(c.map(u=>u.toLowerCase())):c.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,s=(c,u,l)=>{let f;switch(c.length){case 0:break;case 1:f=c[0];break;default:c.sort(),f=c}if(n&&(u!=null||l!=null))throw new Error("invalid filter");let d={};return f&&(d.address=f),t.length&&(d.topics=t),u&&(d.fromBlock=u),l&&(d.toBlock=l),n&&(d.blockHash=n),d},i=[];if(e.address)if(Array.isArray(e.address))for(let c of e.address)i.push(this._getAddress(c));else i.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let a;return"toBlock"in e&&(a=this._getBlockTag(e.toBlock)),i.filter(c=>typeof c!="string").length||o!=null&&typeof o!="string"||a!=null&&typeof a!="string"?Promise.all([Promise.all(i),o,a]).then(c=>s(c[0],c[1],c[2])):s(i,o,a)}_getTransactionRequest(e){let t=(0,vo.copyRequest)(e),n=[];if(["to","from"].forEach(s=>{if(t[s]==null)return;let i=(0,nd.resolveAddress)(t[s],this);Rh(i)?n.push(async function(){t[s]=await i}()):t[s]=i}),t.blockTag!=null){let s=this._getBlockTag(t.blockTag);Rh(s)?n.push(async function(){t.blockTag=await s}()):t.blockTag=s}return n.length?async function(){return await Promise.all(n),t}():t}async getNetwork(){if(this.#s==null){let s=(async()=>{try{let i=await this._detectNetwork();return this.emit("network",i,null),i}catch(i){throw this.#s===s&&(this.#s=null),i}})();return this.#s=s,(await s).clone()}let e=this.#s,[t,n]=await Promise.all([e,this._detectNetwork()]);return t.chainId!==n.chainId&&(this.#o?(this.emit("network",n,t),this.#s===e&&(this.#s=Promise.resolve(n))):(0,de.assert)(!1,`network changed: ${t.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),t.clone()}async getFeeData(){let e=await this.getNetwork(),t=async()=>{let{_block:s,gasPrice:i,priorityFee:o}=await(0,de.resolveProperties)({_block:this.#b("latest",!1),gasPrice:(async()=>{try{let l=await this.#c({method:"getGasPrice"});return(0,de.getBigInt)(l,"%response")}catch{}return null})(),priorityFee:(async()=>{try{let l=await this.#c({method:"getPriorityFee"});return(0,de.getBigInt)(l,"%response")}catch{}return null})()}),a=null,c=null,u=this._wrapBlock(s,e);return u&&u.baseFeePerGas&&(c=o??BigInt("1000000000"),a=u.baseFeePerGas*eU+c),new vo.FeeData(i,a,c)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){let s=new de.FetchRequest(n.url),i=await n.processFunc(t,this,s);return new vo.FeeData(i.gasPrice,i.maxFeePerGas,i.maxPriorityFeePerGas)}return await t()}async estimateGas(e){let t=this._getTransactionRequest(e);return Rh(t)&&(t=await t),(0,de.getBigInt)(await this.#c({method:"estimateGas",transaction:t}),"%response")}async#l(e,t,n){(0,de.assert)(n<tU,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:t,enableCcipRead:!0})});let s=(0,vo.copyRequest)(e);try{return(0,de.hexlify)(await this._perform({method:"call",transaction:s,blockTag:t}))}catch(i){if(!this.disableCcipRead&&(0,de.isCallException)(i)&&i.data&&n>=0&&t==="latest"&&s.to!=null&&(0,de.dataSlice)(i.data,0,4)==="0x556f1830"){let o=i.data,a=await(0,nd.resolveAddress)(s.to,this),c;try{c=cU((0,de.dataSlice)(i.data,4))}catch(f){(0,de.assert)(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:s,info:{data:o}})}(0,de.assert)(c.sender.toLowerCase()===a.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:s,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});let u=await this.ccipReadFetch(s,c.calldata,c.urls);(0,de.assert)(u!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:s,info:{data:i.data,errorArgs:c.errorArgs}});let l={to:a,data:(0,de.concat)([c.selector,aU([u,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:l});try{let f=await this.#l(l,t,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},l),result:f}),f}catch(f){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},l),error:f}),f}}throw i}}async#d(e){let{value:t}=await(0,de.resolveProperties)({network:this.getNetwork(),value:e});return t}async call(e){let{tx:t,blockTag:n}=await(0,de.resolveProperties)({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await this.#d(this.#l(t,n,e.enableCcipRead?0:-1))}async#p(e,t,n){let s=this._getAddress(t),i=this._getBlockTag(n);return(typeof s!="string"||typeof i!="string")&&([s,i]=await Promise.all([s,i])),await this.#d(this.#c(Object.assign(e,{address:s,blockTag:i})))}async getBalance(e,t){return(0,de.getBigInt)(await this.#p({method:"getBalance"},e,t),"%response")}async getTransactionCount(e,t){return(0,de.getNumber)(await this.#p({method:"getTransactionCount"},e,t),"%response")}async getCode(e,t){return(0,de.hexlify)(await this.#p({method:"getCode"},e,t))}async getStorage(e,t,n){let s=(0,de.getBigInt)(t,"position");return(0,de.hexlify)(await this.#p({method:"getStorage",position:s},e,n))}async broadcastTransaction(e){let{blockNumber:t,hash:n,network:s}=await(0,de.resolveProperties)({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),i=Zj.Transaction.from(e);if(i.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(i,s).replaceableTransaction(t)}async#b(e,t){if((0,de.isHexString)(e,32))return await this.#c({method:"getBlock",blockHash:e,includeTransactions:t});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await this.#c({method:"getBlock",blockTag:n,includeTransactions:t})}async getBlock(e,t){let{network:n,params:s}=await(0,de.resolveProperties)({network:this.getNetwork(),params:this.#b(e,!!t)});return s==null?null:this._wrapBlock(s,n)}async getTransaction(e){let{network:t,params:n}=await(0,de.resolveProperties)({network:this.getNetwork(),params:this.#c({method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,t)}async getTransactionReceipt(e){let{network:t,params:n}=await(0,de.resolveProperties)({network:this.getNetwork(),params:this.#c({method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){let s=await this.#c({method:"getTransaction",hash:e});if(s==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=s.gasPrice}return this._wrapTransactionReceipt(n,t)}async getTransactionResult(e){let{result:t}=await(0,de.resolveProperties)({network:this.getNetwork(),result:this.#c({method:"getTransactionResult",hash:e})});return t==null?null:(0,de.hexlify)(t)}async getLogs(e){let t=this._getFilter(e);Rh(t)&&(t=await t);let{network:n,params:s}=await(0,de.resolveProperties)({network:this.getNetwork(),params:this.#c({method:"getLogs",filter:t})});return s.map(i=>this._wrapLog(i,n))}_getProvider(e){(0,de.assert)(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await VP.EnsResolver.fromName(this,e)}async getAvatar(e){let t=await this.getResolver(e);return t?await t.getAvatar():null}async resolveName(e){let t=await this.getResolver(e);return t?await t.getAddress():null}async lookupAddress(e){e=(0,nd.getAddress)(e);let t=(0,Yj.namehash)(e.substring(2).toLowerCase()+".addr.reverse");try{let n=await VP.EnsResolver.getEnsAddress(this),i=await new zP.Contract(n,["function resolver(bytes32) view returns (address)"],this).resolver(t);if(i==null||i===Qj.ZeroAddress)return null;let a=await new zP.Contract(i,["function name(bytes32) view returns (string)"],this).name(t);return await this.resolveName(a)!==e?null:a}catch(n){if((0,de.isError)(n,"BAD_DATA")&&n.value==="0x"||(0,de.isError)(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,t,n){let s=t??1;return s===0?this.getTransactionReceipt(e):new Promise(async(i,o)=>{let a=null,c=async u=>{try{let l=await this.getTransactionReceipt(e);if(l!=null&&u-l.blockNumber+1>=s){i(l),a&&(clearTimeout(a),a=null);return}}catch(l){console.log("EEE",l)}this.once("block",c)};n!=null&&(a=setTimeout(()=>{a!=null&&(a=null,this.off("block",c),o((0,de.makeError)("timeout","TIMEOUT",{reason:"timeout"})))},n)),c(await this.getBlockNumber())})}async waitForBlock(e){(0,de.assert)(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){let t=this.#u.get(e);!t||(t.timer&&clearTimeout(t.timer),this.#u.delete(e))}_setTimeout(e,t){t==null&&(t=0);let n=this.#f++,s=()=>{this.#u.delete(n),e()};if(this.paused)this.#u.set(n,{timer:null,func:s,time:t});else{let i=setTimeout(s,t);this.#u.set(n,{timer:i,func:s,time:xw()})}return n}_forEachSubscriber(e){for(let t of this.#e.values())e(t.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new Lh(e.type);case"block":{let t=new rd.PollingBlockSubscriber(this);return t.pollingInterval=this.pollingInterval,t}case"safe":case"finalized":return new rd.PollingBlockTagSubscriber(this,e.type);case"event":return new rd.PollingEventSubscriber(this,e.filter);case"transaction":return new rd.PollingTransactionSubscriber(this,e.hash);case"orphan":return new rd.PollingOrphanSubscriber(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,t){for(let n of this.#e.values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=t,n.started&&t.start(),this.#r!=null&&t.pause(this.#r);break}}async#g(e,t){let n=await gw(e,this);return n.type==="event"&&t&&t.length>0&&t[0].removed===!0&&(n=await gw({orphan:"drop-log",log:t[0]},this)),this.#e.get(n.tag)||null}async#x(e){let t=await gw(e,this),n=t.tag,s=this.#e.get(n);return s||(s={subscriber:this._getSubscriber(t),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#e.set(n,s)),s}async on(e,t){let n=await this.#x(e);return n.listeners.push({listener:t,once:!1}),n.started||(n.subscriber.start(),n.started=!0,this.#r!=null&&n.subscriber.pause(this.#r)),this}async once(e,t){let n=await this.#x(e);return n.listeners.push({listener:t,once:!0}),n.started||(n.subscriber.start(),n.started=!0,this.#r!=null&&n.subscriber.pause(this.#r)),this}async emit(e,...t){let n=await this.#g(e,t);if(!n||n.listeners.length===0)return!1;let s=n.listeners.length;return n.listeners=n.listeners.filter(({listener:i,once:o})=>{let a=new de.EventPayload(this,o?null:i,e);try{i.call(this,...t,a)}catch{}return!o}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),this.#e.delete(n.tag)),s>0}async listenerCount(e){if(e){let n=await this.#g(e);return n?n.listeners.length:0}let t=0;for(let{listeners:n}of this.#e.values())t+=n.length;return t}async listeners(e){if(e){let n=await this.#g(e);return n?n.listeners.map(({listener:s})=>s):[]}let t=[];for(let{listeners:n}of this.#e.values())t=t.concat(n.map(({listener:s})=>s));return t}async off(e,t){let n=await this.#g(e);if(!n)return this;if(t){let s=n.listeners.map(({listener:i})=>i).indexOf(t);s>=0&&n.listeners.splice(s,1)}return(!t||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),this.#e.delete(n.tag)),this}async removeAllListeners(e){if(e){let{tag:t,started:n,subscriber:s}=await this.#x(e);n&&s.stop(),this.#e.delete(t)}else for(let[t,{started:n,subscriber:s}]of this.#e)n&&s.stop(),this.#e.delete(t);return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return this.off(e,t)}get destroyed(){return this.#n}destroy(){this.removeAllListeners();for(let e of this.#u.keys())this._clearTimeout(e);this.#n=!0}get paused(){return this.#r!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(this.#a=-1,this.#r!=null){if(this.#r==!!e)return;(0,de.assert)(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(t=>t.pause(e)),this.#r=!!e;for(let t of this.#u.values())t.timer&&clearTimeout(t.timer),t.time=xw()-t.time}resume(){if(this.#r!=null){this._forEachSubscriber(e=>e.resume()),this.#r=null;for(let e of this.#u.values()){let t=e.time;t<0&&(t=0),e.time=xw(),setTimeout(e.func,t)}}}};Pu.AbstractProvider=ww;function sU(r,e){try{let t=Aw(r,e);if(t)return(0,de.toUtf8String)(t)}catch{}return null}function Aw(r,e){if(r==="0x")return null;try{let t=(0,de.getNumber)((0,de.dataSlice)(r,e,e+32)),n=(0,de.getNumber)((0,de.dataSlice)(r,t,t+32));return(0,de.dataSlice)(r,t+32,t+32+n)}catch{}return null}function KP(r){let e=(0,de.toBeArray)(r);if(e.length>32)throw new Error("internal; should not happen");let t=new Uint8Array(32);return t.set(e,32-e.length),t}function iU(r){if(r.length%32===0)return r;let e=new Uint8Array(Math.ceil(r.length/32)*32);return e.set(r),e}var oU=new Uint8Array([]);function aU(r){let e=[],t=0;for(let n=0;n<r.length;n++)e.push(oU),t+=32;for(let n=0;n<r.length;n++){let s=(0,de.getBytes)(r[n]);e[n]=KP(t),e.push(KP(s.length)),e.push(iU(s)),t+=32+Math.ceil(s.length/32)*32}return(0,de.concat)(e)}var JP="0x0000000000000000000000000000000000000000000000000000000000000000";function cU(r){let e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};(0,de.assert)((0,de.dataLength)(r)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});let t=(0,de.dataSlice)(r,0,32);(0,de.assert)((0,de.dataSlice)(t,0,12)===(0,de.dataSlice)(JP,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=(0,de.dataSlice)(t,12);try{let n=[],s=(0,de.getNumber)((0,de.dataSlice)(r,32,64)),i=(0,de.getNumber)((0,de.dataSlice)(r,s,s+32)),o=(0,de.dataSlice)(r,s+32);for(let a=0;a<i;a++){let c=sU(o,a*32);if(c==null)throw new Error("abort");n.push(c)}e.urls=n}catch{(0,de.assert)(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{let n=Aw(r,64);if(n==null)throw new Error("abort");e.calldata=n}catch{(0,de.assert)(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}(0,de.assert)((0,de.dataSlice)(r,100,128)===(0,de.dataSlice)(JP,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=(0,de.dataSlice)(r,96,100);try{let n=Aw(r,128);if(n==null)throw new Error("abort");e.extraData=n}catch{(0,de.assert)(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(n=>e[n]),e}});var Uh=M(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.VoidSigner=Su.AbstractSigner=void 0;var WP=Yt(),uU=qr(),Wr=me(),lU=yu();function Bu(r,e){if(r.provider)return r.provider;(0,Wr.assert)(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function QP(r,e){let t=(0,lU.copyRequest)(e);if(t.to!=null&&(t.to=(0,WP.resolveAddress)(t.to,r)),t.from!=null){let n=t.from;t.from=Promise.all([r.getAddress(),(0,WP.resolveAddress)(n,r)]).then(([s,i])=>((0,Wr.assertArgument)(s.toLowerCase()===i.toLowerCase(),"transaction from mismatch","tx.from",i),s))}else t.from=r.getAddress();return await(0,Wr.resolveProperties)(t)}var jh=class{provider;constructor(e){(0,Wr.defineProperties)(this,{provider:e||null})}async getNonce(e){return Bu(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await QP(this,e)}async populateTransaction(e){let t=Bu(this,"populateTransaction"),n=await QP(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));let s=await this.provider.getNetwork();if(n.chainId!=null){let o=(0,Wr.getBigInt)(n.chainId);(0,Wr.assertArgument)(o===s.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=s.chainId;let i=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||i)?(0,Wr.assertArgument)(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&i&&(0,Wr.assertArgument)(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){let o=await t.getFeeData();(0,Wr.assert)(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice)}else{let o=await t.getFeeData();if(n.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){let a=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=a,n.maxPriorityFeePerGas=a}else n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?((0,Wr.assert)(!i,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice),n.type=0):(0,Wr.assert)(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(n.type===2||n.type===3)&&(n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await(0,Wr.resolveProperties)(n)}async estimateGas(e){return Bu(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Bu(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Bu(this,"resolveName").resolveName(e)}async sendTransaction(e){let t=Bu(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;let s=uU.Transaction.from(n);return await t.broadcastTransaction(await this.signTransaction(s))}};Su.AbstractSigner=jh;var sd=class extends jh{address;constructor(e,t){super(t),(0,Wr.defineProperties)(this,{address:e})}async getAddress(){return this.address}connect(e){return new sd(this.address,e)}#e(e,t){(0,Wr.assert)(!1,`VoidSigner cannot sign ${e}`,"UNSUPPORTED_OPERATION",{operation:t})}async signTransaction(e){this.#e("transactions","signTransaction")}async signMessage(e){this.#e("messages","signMessage")}async signTypedData(e,t,n){this.#e("typed-data","signTypedData")}};Su.VoidSigner=sd});var Pi=M(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});Fh.showThrottleMessage=void 0;var YP=new Set;function fU(r){YP.has(r)||(YP.add(r),console.log("========= NOTICE ========="),console.log(`Request-Rate Exceeded for ${r} (this message will not be repeated)`),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.org/api-keys/"),console.log("=========================="))}Fh.showThrottleMessage=fU});var ZP=M(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.FilterIdPendingSubscriber=To.FilterIdEventSubscriber=To.FilterIdSubscriber=void 0;var dU=me(),pU=Nh();function hU(r){return JSON.parse(JSON.stringify(r))}var id=class{#e;#t;#r;#n;#s;#o;constructor(e){this.#e=e,this.#t=null,this.#r=this.#i.bind(this),this.#n=!1,this.#s=null,this.#o=!1}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,t){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}async#i(e){try{this.#t==null&&(this.#t=this._subscribe(this.#e));let t=null;try{t=await this.#t}catch(i){if(!(0,dU.isError)(i,"UNSUPPORTED_OPERATION")||i.operation!=="eth_newFilter")throw i}if(t==null){this.#t=null,this.#e._recoverSubscriber(this,this._recover(this.#e));return}let n=await this.#e.getNetwork();if(this.#s||(this.#s=n),this.#s.chainId!==n.chainId)throw new Error("chaid changed");if(this.#o)return;let s=await this.#e.send("eth_getFilterChanges",[t]);await this._emitResults(this.#e,s)}catch(t){console.log("@TODO",t)}this.#e.once("block",this.#r)}#a(){let e=this.#t;e&&(this.#t=null,e.then(t=>{this.#e.destroyed||this.#e.send("eth_uninstallFilter",[t])}))}start(){this.#n||(this.#n=!0,this.#i(-2))}stop(){!this.#n||(this.#n=!1,this.#o=!0,this.#a(),this.#e.off("block",this.#r))}pause(e){e&&this.#a(),this.#e.off("block",this.#r)}resume(){this.start()}};To.FilterIdSubscriber=id;var Ew=class extends id{#e;constructor(e,t){super(e),this.#e=hU(t)}_recover(e){return new pU.PollingEventSubscriber(e,this.#e)}async _subscribe(e){return await e.send("eth_newFilter",[this.#e])}async _emitResults(e,t){for(let n of t)e.emit(this.#e,e._wrapLog(n,e._network))}};To.FilterIdEventSubscriber=Ew;var vw=class extends id{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,t){for(let n of t)e.emit("pending",n)}};To.FilterIdPendingSubscriber=vw});var Cn=M(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.JsonRpcProvider=Hs.JsonRpcApiPollingProvider=Hs.JsonRpcApiProvider=Hs.JsonRpcSigner=void 0;var mU=bu(),Da=Yt(),XP=Ls(),bU=qr(),He=me(),ek=ku(),gU=Uh(),Tw=Jr(),tk=ZP(),xU=Nh(),yU="bigint,boolean,function,number,string,symbol".split(/,/g);function Dh(r){if(r==null||yU.indexOf(typeof r)>=0||typeof r.getAddress=="function")return r;if(Array.isArray(r))return r.map(Dh);if(typeof r=="object")return Object.keys(r).reduce((e,t)=>(e[t]=r[t],e),{});throw new Error(`should not happen: ${r} (${typeof r})`)}function wU(r){return new Promise(e=>{setTimeout(e,r)})}function Ou(r){return r&&r.toLowerCase()}function rk(r){return r&&typeof r.pollingInterval=="number"}var nk={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3},_u=class extends gU.AbstractSigner{address;constructor(e,t){super(e),t=(0,Da.getAddress)(t),(0,He.defineProperties)(this,{address:t})}connect(e){(0,He.assert)(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(e){return await this.populateCall(e)}async sendUncheckedTransaction(e){let t=Dh(e),n=[];if(t.from){let i=t.from;n.push((async()=>{let o=await(0,Da.resolveAddress)(i,this.provider);(0,He.assertArgument)(o!=null&&o.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=o})())}else t.from=this.address;if(t.gasLimit==null&&n.push((async()=>{t.gasLimit=await this.provider.estimateGas({...t,from:this.address})})()),t.to!=null){let i=t.to;n.push((async()=>{t.to=await(0,Da.resolveAddress)(i,this.provider)})())}n.length&&await Promise.all(n);let s=this.provider.getRpcTransaction(t);return this.provider.send("eth_sendTransaction",[s])}async sendTransaction(e){let t=await this.provider.getBlockNumber(),n=await this.sendUncheckedTransaction(e);return await new Promise((s,i)=>{let o=[1e3,100],a=0,c=async()=>{try{let u=await this.provider.getTransaction(n);if(u!=null){s(u.replaceableTransaction(t));return}}catch(u){if((0,He.isError)(u,"CANCELLED")||(0,He.isError)(u,"BAD_DATA")||(0,He.isError)(u,"NETWORK_ERROR")){u.info==null&&(u.info={}),u.info.sendTransactionHash=n,i(u);return}if((0,He.isError)(u,"INVALID_ARGUMENT")&&(a++,u.info==null&&(u.info={}),u.info.sendTransactionHash=n,a>10)){i(u);return}this.provider.emit("error",(0,He.makeError)("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:u}))}this.provider._setTimeout(()=>{c()},o.pop()||4e3)};c()})}async signTransaction(e){let t=Dh(e);if(t.from){let s=await(0,Da.resolveAddress)(t.from,this.provider);(0,He.assertArgument)(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=s}else t.from=this.address;let n=this.provider.getRpcTransaction(t);return await this.provider.send("eth_signTransaction",[n])}async signMessage(e){let t=typeof e=="string"?(0,He.toUtf8Bytes)(e):e;return await this.provider.send("personal_sign",[(0,He.hexlify)(t),this.address.toLowerCase()])}async signTypedData(e,t,n){let s=Dh(n),i=await XP.TypedDataEncoder.resolveNames(e,t,s,async o=>{let a=await(0,Da.resolveAddress)(o);return(0,He.assertArgument)(a!=null,"TypedData does not support null address","value",o),a});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(XP.TypedDataEncoder.getPayload(i.domain,t,i.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){let t=typeof e=="string"?(0,He.toUtf8Bytes)(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),(0,He.hexlify)(t)])}};Hs.JsonRpcSigner=_u;var Hh=class extends ek.AbstractProvider{#e;#t;#r;#n;#s;#o;#i;#a(){if(this.#n)return;let e=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");this.#n=setTimeout(()=>{this.#n=null;let t=this.#r;for(this.#r=[];t.length;){let n=[t.shift()];for(;t.length&&n.length!==this.#e.batchMaxCount;)if(n.push(t.shift()),JSON.stringify(n.map(i=>i.payload)).length>this.#e.batchMaxSize){t.unshift(n.pop());break}(async()=>{let s=n.length===1?n[0].payload:n.map(i=>i.payload);this.emit("debug",{action:"sendRpcPayload",payload:s});try{let i=await this._send(s);this.emit("debug",{action:"receiveRpcResult",result:i});for(let{resolve:o,reject:a,payload:c}of n){if(this.destroyed){a((0,He.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:c.method}));continue}let u=i.filter(l=>l.id===c.id)[0];if(u==null){let l=(0,He.makeError)("missing response for request","BAD_DATA",{value:i,info:{payload:c}});this.emit("error",l),a(l);continue}if("error"in u){a(this.getRpcError(c,u));continue}o(u.result)}}catch(i){this.emit("debug",{action:"receiveRpcError",error:i});for(let{reject:o}of n)o(i)}})()}},e)}constructor(e,t){super(e,t),this.#t=1,this.#e=Object.assign({},nk,t||{}),this.#r=[],this.#n=null,this.#o=null,this.#i=null;{let s=null,i=new Promise(o=>{s=o});this.#s={promise:i,resolve:s}}let n=this._getOption("staticNetwork");typeof n=="boolean"?((0,He.assertArgument)(!n||e!=="any","staticNetwork cannot be used on special network 'any'","options",t),n&&e!=null&&(this.#o=Tw.Network.from(e))):n&&((0,He.assertArgument)(e==null||n.matches(e),"staticNetwork MUST match network object","options",t),this.#o=n)}_getOption(e){return this.#e[e]}get _network(){return(0,He.assert)(this.#o,"network is not available yet","NETWORK_ERROR"),this.#o}async _perform(e){if(e.method==="call"||e.method==="estimateGas"){let n=e.transaction;if(n&&n.type!=null&&(0,He.getBigInt)(n.type)&&n.maxFeePerGas==null&&n.maxPriorityFeePerGas==null){let s=await this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(e=Object.assign({},e,{transaction:Object.assign({},n,{type:void 0})}))}}let t=this.getRpcRequest(e);return t!=null?await this.send(t.method,t.args):super._perform(e)}async _detectNetwork(){let e=this._getOption("staticNetwork");if(e)if(e===!0){if(this.#o)return this.#o}else return e;return this.#i?await this.#i:this.ready?(this.#i=(async()=>{try{let t=Tw.Network.from((0,He.getBigInt)(await this.send("eth_chainId",[])));return this.#i=null,t}catch(t){throw this.#i=null,t}})(),await this.#i):(this.#i=(async()=>{let t={id:this.#t++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:t});let n;try{n=(await this._send(t))[0],this.#i=null}catch(s){throw this.#i=null,this.emit("debug",{action:"receiveRpcError",error:s}),s}if(this.emit("debug",{action:"receiveRpcResult",result:n}),"result"in n)return Tw.Network.from((0,He.getBigInt)(n.result));throw this.getRpcError(t,n)})(),await this.#i)}_start(){this.#s==null||this.#s.resolve==null||(this.#s.resolve(),this.#s=null,(async()=>{for(;this.#o==null&&!this.destroyed;)try{this.#o=await this._detectNetwork()}catch(e){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",(0,He.makeError)("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await wU(1e3)}this.#a()})())}async _waitUntilReady(){if(this.#s!=null)return await this.#s.promise}_getSubscriber(e){return e.type==="pending"?new tk.FilterIdPendingSubscriber(this):e.type==="event"?this._getOption("polling")?new xU.PollingEventSubscriber(this,e.filter):new tk.FilterIdEventSubscriber(this,e.filter):e.type==="orphan"&&e.filter.orphan==="drop-log"?new ek.UnmanagedSubscriber("orphan"):super._getSubscriber(e)}get ready(){return this.#s==null}getRpcTransaction(e){let t={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(n=>{if(e[n]==null)return;let s=n;n==="gasLimit"&&(s="gas"),t[s]=(0,He.toQuantity)((0,He.getBigInt)(e[n],`tx.${n}`))}),["from","to","data"].forEach(n=>{e[n]!=null&&(t[n]=(0,He.hexlify)(e[n]))}),e.accessList&&(t.accessList=(0,bU.accessListify)(e.accessList)),e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.map(n=>n.toLowerCase())),t}getRpcRequest(e){switch(e.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Ou(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Ou(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[Ou(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Ou(e.address),"0x"+e.position.toString(16),e.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[e.signedTransaction]};case"getBlock":if("blockTag"in e)return{method:"eth_getBlockByNumber",args:[e.blockTag,!!e.includeTransactions]};if("blockHash"in e)return{method:"eth_getBlockByHash",args:[e.blockHash,!!e.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[e.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[e.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(e.transaction),e.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(e.transaction)]};case"getLogs":return e.filter&&e.filter.address!=null&&(Array.isArray(e.filter.address)?e.filter.address=e.filter.address.map(Ou):e.filter.address=Ou(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,t){let{method:n}=e,{error:s}=t;if(n==="eth_estimateGas"&&s.message){let a=s.message;if(!a.match(/revert/i)&&a.match(/insufficient funds/i))return(0,He.makeError)("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:s}})}if(n==="eth_call"||n==="eth_estimateGas"){let a=kw(s),c=mU.AbiCoder.getBuiltinCallException(n==="eth_call"?"call":"estimateGas",e.params[0],a?a.data:null);return c.info={error:s,payload:e},c}let i=JSON.stringify(AU(s));if(typeof s.message=="string"&&s.message.match(/user denied|ethers-user-denied/i)){let a={eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return(0,He.makeError)("user rejected action","ACTION_REJECTED",{action:a[n]||"unknown",reason:"rejected",info:{payload:e,error:s}})}if(n==="eth_sendRawTransaction"||n==="eth_sendTransaction"){let a=e.params[0];if(i.match(/insufficient funds|base fee exceeds gas limit/i))return(0,He.makeError)("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:a,info:{error:s}});if(i.match(/nonce/i)&&i.match(/too low/i))return(0,He.makeError)("nonce has already been used","NONCE_EXPIRED",{transaction:a,info:{error:s}});if(i.match(/replacement transaction/i)&&i.match(/underpriced/i))return(0,He.makeError)("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:a,info:{error:s}});if(i.match(/only replay-protected/i))return(0,He.makeError)("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:n,info:{transaction:a,info:{error:s}}})}let o=!!i.match(/the method .* does not exist/i);return o||s&&s.details&&s.details.startsWith("Unauthorized method:")&&(o=!0),o?(0,He.makeError)("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:s,payload:e}}):(0,He.makeError)("could not coalesce error","UNKNOWN_ERROR",{error:s,payload:e})}send(e,t){if(this.destroyed)return Promise.reject((0,He.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));let n=this.#t++,s=new Promise((i,o)=>{this.#r.push({resolve:i,reject:o,payload:{method:e,params:t,id:n,jsonrpc:"2.0"}})});return this.#a(),s}async getSigner(e){e==null&&(e=0);let t=this.send("eth_accounts",[]);if(typeof e=="number"){let s=await t;if(e>=s.length)throw new Error("no such account");return new _u(this,s[e])}let{accounts:n}=await(0,He.resolveProperties)({network:this.getNetwork(),accounts:t});e=(0,Da.getAddress)(e);for(let s of n)if((0,Da.getAddress)(s)===e)return new _u(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(t=>new _u(this,t))}destroy(){this.#n&&(clearTimeout(this.#n),this.#n=null);for(let{payload:e,reject:t}of this.#r)t((0,He.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));this.#r=[],super.destroy()}};Hs.JsonRpcApiProvider=Hh;var $h=class extends Hh{#e;constructor(e,t){super(e,t);let n=this._getOption("pollingInterval");n==null&&(n=nk.pollingInterval),this.#e=n}_getSubscriber(e){let t=super._getSubscriber(e);return rk(t)&&(t.pollingInterval=this.#e),t}get pollingInterval(){return this.#e}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");this.#e=e,this._forEachSubscriber(t=>{rk(t)&&(t.pollingInterval=this.#e)})}};Hs.JsonRpcApiPollingProvider=$h;var Pw=class extends $h{#e;constructor(e,t,n){e==null&&(e="http://localhost:8545"),super(t,n),typeof e=="string"?this.#e=new He.FetchRequest(e):this.#e=e.clone()}_getConnection(){return this.#e.clone()}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){let t=this._getConnection();t.body=JSON.stringify(e),t.setHeader("content-type","application/json");let n=await t.send();n.assertOk();let s=n.bodyJson;return Array.isArray(s)||(s=[s]),s}};Hs.JsonRpcProvider=Pw;function kw(r){if(r==null)return null;if(typeof r.message=="string"&&r.message.match(/revert/i)&&(0,He.isHexString)(r.data))return{message:r.message,data:r.data};if(typeof r=="object"){for(let e in r){let t=kw(r[e]);if(t)return t}return null}if(typeof r=="string")try{return kw(JSON.parse(r))}catch{}return null}function Bw(r,e){if(r!=null){if(typeof r.message=="string"&&e.push(r.message),typeof r=="object")for(let t in r)Bw(r[t],e);if(typeof r=="string")try{return Bw(JSON.parse(r),e)}catch{}}}function AU(r){let e=[];return Bw(r,e),e}});var Ow=M(Gh=>{"use strict";Object.defineProperty(Gh,"__esModule",{value:!0});Gh.AnkrProvider=void 0;var Sw=me(),EU=Pi(),vU=Jr(),TU=Cn(),qh="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function PU(r){switch(r){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/eth_goerli";case"sepolia":return"rpc.ankr.com/eth_sepolia";case"arbitrum":return"rpc.ankr.com/arbitrum";case"base":return"rpc.ankr.com/base";case"base-goerli":return"rpc.ankr.com/base_goerli";case"base-sepolia":return"rpc.ankr.com/base_sepolia";case"bnb":return"rpc.ankr.com/bsc";case"bnbt":return"rpc.ankr.com/bsc_testnet_chapel";case"matic":return"rpc.ankr.com/polygon";case"matic-mumbai":return"rpc.ankr.com/polygon_mumbai";case"optimism":return"rpc.ankr.com/optimism";case"optimism-goerli":return"rpc.ankr.com/optimism_testnet";case"optimism-sepolia":return"rpc.ankr.com/optimism_sepolia"}(0,Sw.assertArgument)(!1,"unsupported network","network",r)}var Cu=class extends TU.JsonRpcProvider{apiKey;constructor(e,t){e==null&&(e="mainnet");let n=vU.Network.from(e);t==null&&(t=qh);let s={polling:!0,staticNetwork:n},i=Cu.getRequest(n,t);super(i,n,s),(0,Sw.defineProperties)(this,{apiKey:t})}_getProvider(e){try{return new Cu(e,this.apiKey)}catch{}return super._getProvider(e)}static getRequest(e,t){t==null&&(t=qh);let n=new Sw.FetchRequest(`https://${PU(e.name)}/${t}`);return n.allowGzip=!0,t===qh&&(n.retryFunc=async(s,i,o)=>((0,EU.showThrottleMessage)("AnkrProvider"),!0)),n}getRpcError(e,t){return e.method==="eth_sendRawTransaction"&&t&&t.error&&t.error.message==="INTERNAL_ERROR: could not replace existing tx"&&(t.error.message="replacement transaction underpriced"),super.getRpcError(e,t)}isCommunityResource(){return this.apiKey===qh}};Gh.AnkrProvider=Cu});var _w=M(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.AlchemyProvider=void 0;var Nu=me(),kU=Pi(),BU=Jr(),SU=Cn(),zh="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function OU(r){switch(r){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"arbitrum-sepolia":return"arb-sepolia.g.alchemy.com";case"base":return"base-mainnet.g.alchemy.com";case"base-goerli":return"base-goerli.g.alchemy.com";case"base-sepolia":return"base-sepolia.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-amoy":return"polygon-amoy.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com";case"optimism-sepolia":return"opt-sepolia.g.alchemy.com"}(0,Nu.assertArgument)(!1,"unsupported network","network",r)}var Iu=class extends SU.JsonRpcProvider{apiKey;constructor(e,t){e==null&&(e="mainnet");let n=BU.Network.from(e);t==null&&(t=zh);let s=Iu.getRequest(n,t);super(s,n,{staticNetwork:n}),(0,Nu.defineProperties)(this,{apiKey:t})}_getProvider(e){try{return new Iu(e,this.apiKey)}catch{}return super._getProvider(e)}async _perform(e){if(e.method==="getTransactionResult"){let{trace:t,tx:n}=await(0,Nu.resolveProperties)({trace:this.send("trace_transaction",[e.hash]),tx:this.getTransaction(e.hash)});if(t==null||n==null)return null;let s,i=!1;try{s=t[0].result.output,i=t[0].error==="Reverted"}catch{}if(s)return(0,Nu.assert)(!i,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:s,reason:null,transaction:n,invocation:null,revert:null}),s;(0,Nu.assert)(!1,"could not parse trace result","BAD_DATA",{value:t})}return await super._perform(e)}isCommunityResource(){return this.apiKey===zh}static getRequest(e,t){t==null&&(t=zh);let n=new Nu.FetchRequest(`https://${OU(e.name)}/v2/${t}`);return n.allowGzip=!0,t===zh&&(n.retryFunc=async(s,i,o)=>((0,kU.showThrottleMessage)("alchemy"),!0)),n}};Vh.AlchemyProvider=Iu});var Cw=M(Wh=>{"use strict";Object.defineProperty(Wh,"__esModule",{value:!0});Wh.ChainstackProvider=void 0;var Jh=me(),_U=Pi(),CU=Jr(),NU=Cn();function Kh(r){switch(r){case"mainnet":return"39f1d67cedf8b7831010a665328c9197";case"arbitrum":return"0550c209db33c3abf4cc927e1e18cea1";case"bnb":return"98b5a77e531614387366f6fc5da097f8";case"matic":return"cd9d4d70377471aa7c142ec4a4205249"}(0,Jh.assertArgument)(!1,"unsupported network","network",r)}function IU(r){switch(r){case"mainnet":return"ethereum-mainnet.core.chainstack.com";case"arbitrum":return"arbitrum-mainnet.core.chainstack.com";case"bnb":return"bsc-mainnet.core.chainstack.com";case"matic":return"polygon-mainnet.core.chainstack.com"}(0,Jh.assertArgument)(!1,"unsupported network","network",r)}var Ru=class extends NU.JsonRpcProvider{apiKey;constructor(e,t){e==null&&(e="mainnet");let n=CU.Network.from(e);t==null&&(t=Kh(n.name));let s=Ru.getRequest(n,t);super(s,n,{staticNetwork:n}),(0,Jh.defineProperties)(this,{apiKey:t})}_getProvider(e){try{return new Ru(e,this.apiKey)}catch{}return super._getProvider(e)}isCommunityResource(){return this.apiKey===Kh(this._network.name)}static getRequest(e,t){t==null&&(t=Kh(e.name));let n=new Jh.FetchRequest(`https://${IU(e.name)}/${t}`);return n.allowGzip=!0,t===Kh(e.name)&&(n.retryFunc=async(s,i,o)=>((0,_U.showThrottleMessage)("ChainstackProvider"),!0)),n}};Wh.ChainstackProvider=Ru});var Iw=M(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.CloudflareProvider=void 0;var RU=me(),MU=Jr(),LU=Cn(),Nw=class extends LU.JsonRpcProvider{constructor(e){e==null&&(e="mainnet");let t=MU.Network.from(e);(0,RU.assertArgument)(t.name==="mainnet","unsupported network","network",e),super("https://cloudflare-eth.com/",t,{staticNetwork:t})}};Qh.CloudflareProvider=Nw});var Mw=M(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.EtherscanProvider=Mu.EtherscanPlugin=void 0;var jU=bu(),UU=Jf(),sk=qr(),Gt=me(),FU=ku(),DU=Jr(),HU=Sh(),$U=Pi(),ik=2e3;function qU(r){return r&&typeof r.then=="function"}var ok="org.ethers.plugins.provider.Etherscan",od=class extends HU.NetworkPlugin{baseUrl;constructor(e){super(ok),(0,Gt.defineProperties)(this,{baseUrl:e})}clone(){return new od(this.baseUrl)}};Mu.EtherscanPlugin=od;var GU=["enableCcipRead"],zU=1,Rw=class extends FU.AbstractProvider{network;apiKey;#e;constructor(e,t){let n=t??null;super();let s=DU.Network.from(e);this.#e=s.getPlugin(ok),(0,Gt.defineProperties)(this,{apiKey:n,network:s}),this.getBaseUrl()}getBaseUrl(){if(this.#e)return this.#e.baseUrl;switch(this.network.name){case"mainnet":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"holesky":return"https://api-holesky.etherscan.io";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"base":return"https://api.basescan.org";case"base-sepolia":return"https://api-sepolia.basescan.org";case"bnb":return"https://api.bscscan.com";case"bnbt":return"https://api-testnet.bscscan.com";case"matic":return"https://api.polygonscan.com";case"matic-amoy":return"https://api-amoy.polygonscan.com";case"matic-mumbai":return"https://api-testnet.polygonscan.com";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io";default:}(0,Gt.assertArgument)(!1,"unsupported network","network",this.network)}getUrl(e,t){let n=Object.keys(t).reduce((i,o)=>{let a=t[o];return a!=null&&(i+=`&${o}=${a}`),i},""),s=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.getBaseUrl()}/api?module=${e}${n}${s}`}getPostUrl(){return`${this.getBaseUrl()}/api`}getPostData(e,t){return t.module=e,t.apikey=this.apiKey,t}async detectNetwork(){return this.network}async fetch(e,t,n){let s=zU++,i=n?this.getPostUrl():this.getUrl(e,t),o=n?this.getPostData(e,t):null;this.emit("debug",{action:"sendRequest",id:s,url:i,payload:o});let a=new Gt.FetchRequest(i);a.setThrottleParams({slotInterval:1e3}),a.retryFunc=(l,f,d)=>(this.isCommunityResource()&&(0,$U.showThrottleMessage)("Etherscan"),Promise.resolve(!0)),a.processFunc=async(l,f)=>{let d=f.hasBody()?JSON.parse((0,Gt.toUtf8String)(f.body)):{},h=(typeof d.result=="string"?d.result:"").toLowerCase().indexOf("rate limit")>=0;return e==="proxy"?d&&d.status==0&&d.message=="NOTOK"&&h&&(this.emit("debug",{action:"receiveError",id:s,reason:"proxy-NOTOK",error:d}),f.throwThrottleError(d.result,ik)):h&&(this.emit("debug",{action:"receiveError",id:s,reason:"null result",error:d.result}),f.throwThrottleError(d.result,ik)),f},o&&(a.setHeader("content-type","application/x-www-form-urlencoded; charset=UTF-8"),a.body=Object.keys(o).map(l=>`${l}=${o[l]}`).join("&"));let c=await a.send();try{c.assertOk()}catch(l){this.emit("debug",{action:"receiveError",id:s,error:l,reason:"assertOk"}),(0,Gt.assert)(!1,"response error","SERVER_ERROR",{request:a,response:c})}c.hasBody()||(this.emit("debug",{action:"receiveError",id:s,error:"missing body",reason:"null body"}),(0,Gt.assert)(!1,"missing response","SERVER_ERROR",{request:a,response:c}));let u=JSON.parse((0,Gt.toUtf8String)(c.body));return e==="proxy"?(u.jsonrpc!="2.0"&&(this.emit("debug",{action:"receiveError",id:s,result:u,reason:"invalid JSON-RPC"}),(0,Gt.assert)(!1,"invalid JSON-RPC response (missing jsonrpc='2.0')","SERVER_ERROR",{request:a,response:c,info:{result:u}})),u.error&&(this.emit("debug",{action:"receiveError",id:s,result:u,reason:"JSON-RPC error"}),(0,Gt.assert)(!1,"error response","SERVER_ERROR",{request:a,response:c,info:{result:u}})),this.emit("debug",{action:"receiveRequest",id:s,result:u}),u.result):u.status==0&&(u.message==="No records found"||u.message==="No transactions found")?(this.emit("debug",{action:"receiveRequest",id:s,result:u}),u.result):((u.status!=1||typeof u.message=="string"&&!u.message.match(/^OK/))&&(this.emit("debug",{action:"receiveError",id:s,result:u}),(0,Gt.assert)(!1,"error response","SERVER_ERROR",{request:a,response:c,info:{result:u}})),this.emit("debug",{action:"receiveRequest",id:s,result:u}),u.result)}_getTransactionPostData(e){let t={};for(let n in e){if(GU.indexOf(n)>=0||e[n]==null)continue;let s=e[n];if(!(n==="type"&&s===0)&&!(n==="blockTag"&&s==="latest")){if({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[n])s=(0,Gt.toQuantity)(s);else if(n==="accessList")s="["+(0,sk.accessListify)(s).map(i=>`{address:"${i.address}",storageKeys:["${i.storageKeys.join('","')}"]}`).join(",")+"]";else if(n==="blobVersionedHashes"){if(s.length===0)continue;(0,Gt.assert)(!1,"Etherscan API does not support blobVersionedHashes","UNSUPPORTED_OPERATION",{operation:"_getTransactionPostData",info:{transaction:e}})}else s=(0,Gt.hexlify)(s);t[n]=s}}return t}_checkError(e,t,n){let s="";if((0,Gt.isError)(t,"SERVER_ERROR")){try{s=t.info.result.error.message}catch{}if(!s)try{s=t.info.message}catch{}}if(e.method==="estimateGas"&&!s.match(/revert/i)&&s.match(/insufficient funds/i)&&(0,Gt.assert)(!1,"insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.transaction}),(e.method==="call"||e.method==="estimateGas")&&s.match(/execution reverted/i)){let i="";try{i=t.info.result.error.data}catch{}let o=jU.AbiCoder.getBuiltinCallException(e.method,e.transaction,i);throw o.info={request:e,error:t},o}if(s&&e.method==="broadcastTransaction"){let i=sk.Transaction.from(e.signedTransaction);s.match(/replacement/i)&&s.match(/underpriced/i)&&(0,Gt.assert)(!1,"replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:i}),s.match(/insufficient funds/)&&(0,Gt.assert)(!1,"insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:i}),s.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&(0,Gt.assert)(!1,"nonce has already been used","NONCE_EXPIRED",{transaction:i})}throw t}async _detectNetwork(){return this.network}async _perform(e){switch(e.method){case"chainId":return this.network.chainId;case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getPriorityFee":if(this.network.name==="mainnet")return"1000000000";if(this.network.name==="optimism")return"1000000";throw new Error("fallback onto the AbstractProvider default");case"getBalance":return this.fetch("account",{action:"balance",address:e.address,tag:e.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:e.address,tag:e.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:e.address,tag:e.blockTag});case"getStorage":return this.fetch("proxy",{action:"eth_getStorageAt",address:e.address,position:e.position,tag:e.blockTag});case"broadcastTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:e.signedTransaction},!0).catch(t=>this._checkError(e,t,e.signedTransaction));case"getBlock":if("blockTag"in e)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:e.blockTag,boolean:e.includeTransactions?"true":"false"});(0,Gt.assert)(!1,"getBlock by blockHash not supported by Etherscan","UNSUPPORTED_OPERATION",{operation:"getBlock(blockHash)"});case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:e.hash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:e.hash});case"call":{if(e.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");let t=this._getTransactionPostData(e.transaction);t.module="proxy",t.action="eth_call";try{return await this.fetch("proxy",t,!0)}catch(n){return this._checkError(e,n,e.transaction)}}case"estimateGas":{let t=this._getTransactionPostData(e.transaction);t.module="proxy",t.action="eth_estimateGas";try{return await this.fetch("proxy",t,!0)}catch(n){return this._checkError(e,n,e.transaction)}}default:break}return super._perform(e)}async getNetwork(){return this.network}async getEtherPrice(){return this.network.name!=="mainnet"?0:parseFloat((await this.fetch("stats",{action:"ethprice"})).ethusd)}async getContract(e){let t=this._getAddress(e);qU(t)&&(t=await t);try{let n=await this.fetch("contract",{action:"getabi",address:t}),s=JSON.parse(n);return new UU.Contract(t,s,this)}catch{return null}}isCommunityResource(){return this.apiKey==null}};Mu.EtherscanProvider=Rw});var ak=M(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});Yh.WebSocket=void 0;function VU(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}var KU=VU().WebSocket;Yh.WebSocket=KU});var tm=M(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.SocketProvider=Nn.SocketEventSubscriber=Nn.SocketPendingSubscriber=Nn.SocketBlockSubscriber=Nn.SocketSubscriber=void 0;var ck=ku(),ad=me(),JU=Cn(),Lu=class{#e;#t;get filter(){return JSON.parse(this.#t)}#r;#n;#s;constructor(e,t){this.#e=e,this.#t=JSON.stringify(t),this.#r=null,this.#n=null,this.#s=null}start(){this.#r=this.#e.send("eth_subscribe",this.filter).then(e=>(this.#e._register(e,this),e))}stop(){this.#r.then(e=>{this.#e.destroyed||this.#e.send("eth_unsubscribe",[e])}),this.#r=null}pause(e){(0,ad.assert)(e,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"}),this.#n=!!e}resume(){this.#n=null}_handleMessage(e){if(this.#r!=null&&this.#n===null){let t=this.#s;t==null?t=this._emit(this.#e,e):t=t.then(async()=>{await this._emit(this.#e,e)}),this.#s=t.then(()=>{this.#s===t&&(this.#s=null)})}}async _emit(e,t){throw new Error("sub-classes must implemente this; _emit")}};Nn.SocketSubscriber=Lu;var Zh=class extends Lu{constructor(e){super(e,["newHeads"])}async _emit(e,t){e.emit("block",parseInt(t.number))}};Nn.SocketBlockSubscriber=Zh;var Xh=class extends Lu{constructor(e){super(e,["newPendingTransactions"])}async _emit(e,t){e.emit("pending",t)}};Nn.SocketPendingSubscriber=Xh;var em=class extends Lu{#e;get logFilter(){return JSON.parse(this.#e)}constructor(e,t){super(e,["logs",t]),this.#e=JSON.stringify(t)}async _emit(e,t){e.emit(this.logFilter,e._wrapLog(t,e._network))}};Nn.SocketEventSubscriber=em;var Lw=class extends JU.JsonRpcApiProvider{#e;#t;#r;constructor(e,t){let n=Object.assign({},t??{});(0,ad.assertArgument)(n.batchMaxCount==null||n.batchMaxCount===1,"sockets-based providers do not support batches","options.batchMaxCount",t),n.batchMaxCount=1,n.staticNetwork==null&&(n.staticNetwork=!0),super(e,n),this.#e=new Map,this.#t=new Map,this.#r=new Map}_getSubscriber(e){switch(e.type){case"close":return new ck.UnmanagedSubscriber("close");case"block":return new Zh(this);case"pending":return new Xh(this);case"event":return new em(this,e.filter);case"orphan":if(e.filter.orphan==="drop-log")return new ck.UnmanagedSubscriber("drop-log")}return super._getSubscriber(e)}_register(e,t){this.#t.set(e,t);let n=this.#r.get(e);if(n){for(let s of n)t._handleMessage(s);this.#r.delete(e)}}async _send(e){(0,ad.assertArgument)(!Array.isArray(e),"WebSocket does not support batch send","payload",e);let t=new Promise((n,s)=>{this.#e.set(e.id,{payload:e,resolve:n,reject:s})});return await this._waitUntilReady(),await this._write(JSON.stringify(e)),[await t]}async _processMessage(e){let t=JSON.parse(e);if(t&&typeof t=="object"&&"id"in t){let n=this.#e.get(t.id);if(n==null){this.emit("error",(0,ad.makeError)("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:t}));return}this.#e.delete(t.id),n.resolve(t)}else if(t&&t.method==="eth_subscription"){let n=t.params.subscription,s=this.#t.get(n);if(s)s._handleMessage(t.params.result);else{let i=this.#r.get(n);i==null&&(i=[],this.#r.set(n,i)),i.push(t.params.result)}}else{this.emit("error",(0,ad.makeError)("received unexpected message","UNKNOWN_ERROR",{reasonCode:"UNEXPECTED_MESSAGE",result:t}));return}}async _write(e){throw new Error("sub-classes must override this")}};Nn.SocketProvider=Lw});var nm=M(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});rm.WebSocketProvider=void 0;var WU=ak(),QU=tm(),jw=class extends QU.SocketProvider{#e;#t;get websocket(){if(this.#t==null)throw new Error("websocket closed");return this.#t}constructor(e,t,n){super(t,n),typeof e=="string"?(this.#e=()=>new WU.WebSocket(e),this.#t=this.#e()):typeof e=="function"?(this.#e=e,this.#t=e()):(this.#e=null,this.#t=e),this.websocket.onopen=async()=>{try{await this._start(),this.resume()}catch(s){console.log("failed to start WebsocketProvider",s)}},this.websocket.onmessage=s=>{this._processMessage(s.data)}}async _write(e){this.websocket.send(e)}async destroy(){this.#t!=null&&(this.#t.close(),this.#t=null),super.destroy()}};rm.WebSocketProvider=jw});var Uw=M(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.InfuraProvider=ju.InfuraWebSocketProvider=void 0;var ud=me(),YU=Pi(),ZU=Jr(),XU=Cn(),eF=nm(),cd="84842078b09946638c03157f83405213";function tF(r){switch(r){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"arbitrum-sepolia":return"arbitrum-sepolia.infura.io";case"base":return"base-mainnet.infura.io";case"base-goerlia":return"base-goerli.infura.io";case"base-sepolia":return"base-sepolia.infura.io";case"bnb":return"bnbsmartchain-mainnet.infura.io";case"bnbt":return"bnbsmartchain-testnet.infura.io";case"linea":return"linea-mainnet.infura.io";case"linea-goerli":return"linea-goerli.infura.io";case"linea-sepolia":return"linea-sepolia.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-amoy":return"polygon-amoy.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io";case"optimism-sepolia":return"optimism-sepolia.infura.io"}(0,ud.assertArgument)(!1,"unsupported network","network",r)}var sm=class extends eF.WebSocketProvider{projectId;projectSecret;constructor(e,t){let n=new Ha(e,t),s=n._getConnection();(0,ud.assert)(!s.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});let i=s.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(i,n._network),(0,ud.defineProperties)(this,{projectId:n.projectId,projectSecret:n.projectSecret})}isCommunityResource(){return this.projectId===cd}};ju.InfuraWebSocketProvider=sm;var Ha=class extends XU.JsonRpcProvider{projectId;projectSecret;constructor(e,t,n){e==null&&(e="mainnet");let s=ZU.Network.from(e);t==null&&(t=cd),n==null&&(n=null);let i=Ha.getRequest(s,t,n);super(i,s,{staticNetwork:s}),(0,ud.defineProperties)(this,{projectId:t,projectSecret:n})}_getProvider(e){try{return new Ha(e,this.projectId,this.projectSecret)}catch{}return super._getProvider(e)}isCommunityResource(){return this.projectId===cd}static getWebSocketProvider(e,t){return new sm(e,t)}static getRequest(e,t,n){t==null&&(t=cd),n==null&&(n=null);let s=new ud.FetchRequest(`https://${tF(e.name)}/v3/${t}`);return s.allowGzip=!0,n&&s.setCredentials("",n),t===cd&&(s.retryFunc=async(i,o,a)=>((0,YU.showThrottleMessage)("InfuraProvider"),!0)),s}};ju.InfuraProvider=Ha});var Dw=M(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.QuickNodeProvider=void 0;var Fw=me(),rF=Pi(),nF=Jr(),sF=Cn(),im="919b412a057b5e9c9b6dce193c5a60242d6efadb";function iF(r){switch(r){case"mainnet":return"ethers.quiknode.pro";case"goerli":return"ethers.ethereum-goerli.quiknode.pro";case"sepolia":return"ethers.ethereum-sepolia.quiknode.pro";case"holesky":return"ethers.ethereum-holesky.quiknode.pro";case"arbitrum":return"ethers.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"ethers.arbitrum-goerli.quiknode.pro";case"arbitrum-sepolia":return"ethers.arbitrum-sepolia.quiknode.pro";case"base":return"ethers.base-mainnet.quiknode.pro";case"base-goerli":return"ethers.base-goerli.quiknode.pro";case"base-spolia":return"ethers.base-sepolia.quiknode.pro";case"bnb":return"ethers.bsc.quiknode.pro";case"bnbt":return"ethers.bsc-testnet.quiknode.pro";case"matic":return"ethers.matic.quiknode.pro";case"matic-mumbai":return"ethers.matic-testnet.quiknode.pro";case"optimism":return"ethers.optimism.quiknode.pro";case"optimism-goerli":return"ethers.optimism-goerli.quiknode.pro";case"optimism-sepolia":return"ethers.optimism-sepolia.quiknode.pro";case"xdai":return"ethers.xdai.quiknode.pro"}(0,Fw.assertArgument)(!1,"unsupported network","network",r)}var Uu=class extends sF.JsonRpcProvider{token;constructor(e,t){e==null&&(e="mainnet");let n=nF.Network.from(e);t==null&&(t=im);let s=Uu.getRequest(n,t);super(s,n,{staticNetwork:n}),(0,Fw.defineProperties)(this,{token:t})}_getProvider(e){try{return new Uu(e,this.token)}catch{}return super._getProvider(e)}isCommunityResource(){return this.token===im}static getRequest(e,t){t==null&&(t=im);let n=new Fw.FetchRequest(`https://${iF(e.name)}/${t}`);return n.allowGzip=!0,t===im&&(n.retryFunc=async(s,i,o)=>((0,rF.showThrottleMessage)("QuickNodeProvider"),!0)),n}};om.QuickNodeProvider=Uu});var Kw=M(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});cm.FallbackProvider=void 0;var hs=me(),uk=ku(),oF=Jr(),aF=BigInt("1"),cF=BigInt("2");function uF(r){for(let e=r.length-1;e>0;e--){let t=Math.floor(Math.random()*(e+1)),n=r[e];r[e]=r[t],r[t]=n}}function lF(r){return new Promise(e=>{setTimeout(e,r)})}function Gw(){return new Date().getTime()}function Hw(r){return JSON.stringify(r,(e,t)=>typeof t=="bigint"?{type:"bigint",value:t.toString()}:t)}var lk={stallTimeout:400,priority:1,weight:1},fk={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0,_lastFatalError:null,_lastFatalErrorTimestamp:0};async function fF(r,e){for(;(r.blockNumber<0||r.blockNumber<e)&&(r._updateNumber||(r._updateNumber=(async()=>{try{let t=await r.provider.getBlockNumber();t>r.blockNumber&&(r.blockNumber=t)}catch(t){r.blockNumber=-2,r._lastFatalError=t,r._lastFatalErrorTimestamp=Gw()}r._updateNumber=null})()),await r._updateNumber,r.outOfSync++,!r._lastFatalError););}function ld(r){if(r==null)return"null";if(Array.isArray(r))return"["+r.map(ld).join(",")+"]";if(typeof r=="object"&&typeof r.toJSON=="function")return ld(r.toJSON());switch(typeof r){case"boolean":case"symbol":return r.toString();case"bigint":case"number":return BigInt(r).toString();case"string":return JSON.stringify(r);case"object":{let e=Object.keys(r);return e.sort(),"{"+e.map(t=>`${JSON.stringify(t)}:${ld(r[t])}`).join(",")+"}"}}throw console.log("Could not serialize",r),new Error("Hmm...")}function $w(r){if("error"in r){let t=r.error;return{tag:ld(t),value:t}}let e=r.result;return{tag:ld(e),value:e}}function am(r,e){let t=new Map;for(let{value:s,tag:i,weight:o}of e){let a=t.get(i)||{value:s,weight:0};a.weight+=o,t.set(i,a)}let n=null;for(let s of t.values())s.weight>=r&&(!n||s.weight>n.weight)&&(n=s);if(n)return n.value}function zw(r,e){let t=0,n=new Map,s=null,i=[];for(let{value:a,tag:c,weight:u}of e)if(a instanceof Error){let l=n.get(c)||{value:a,weight:0};l.weight+=u,n.set(c,l),(s==null||l.weight>s.weight)&&(s=l)}else i.push(BigInt(a)),t+=u;if(t<r)return s&&s.weight>=r?s.value:void 0;i.sort((a,c)=>a<c?-1:c>a?1:0);let o=Math.floor(i.length/2);return i.length%2?i[o]:(i[o-1]+i[o]+aF)/cF}function qw(r,e){let t=am(r,e);if(t!==void 0)return t;for(let n of e)if(n.value)return n.value}function dF(r,e){if(r===1)return(0,hs.getNumber)(zw(r,e),"%internal");let t=new Map,n=(o,a)=>{let c=t.get(o)||{result:o,weight:0};c.weight+=a,t.set(o,c)};for(let{weight:o,value:a}of e){let c=(0,hs.getNumber)(a);n(c-1,o),n(c,o),n(c+1,o)}let s=0,i;for(let{weight:o,result:a}of t.values())o>=r&&(o>s||i!=null&&o===s&&a>i)&&(s=o,i=a);return i}var Vw=class extends uk.AbstractProvider{quorum;eventQuorum;eventWorkers;#e;#t;#r;constructor(e,t,n){super(t,n),this.#e=e.map(s=>s instanceof uk.AbstractProvider?Object.assign({provider:s},lk,fk):Object.assign({},lk,s,fk)),this.#t=-2,this.#r=null,n&&n.quorum!=null?this.quorum=n.quorum:this.quorum=Math.ceil(this.#e.reduce((s,i)=>(s+=i.weight,s),0)/2),this.eventQuorum=1,this.eventWorkers=1,(0,hs.assertArgument)(this.quorum<=this.#e.reduce((s,i)=>s+i.weight,0),"quorum exceed provider weight","quorum",this.quorum)}get providerConfigs(){return this.#e.map(e=>{let t=Object.assign({},e);for(let n in t)n[0]==="_"&&delete t[n];return t})}async _detectNetwork(){return oF.Network.from((0,hs.getBigInt)(await this._perform({method:"chainId"})))}async _translatePerform(e,t){switch(t.method){case"broadcastTransaction":return await e.broadcastTransaction(t.signedTransaction);case"call":return await e.call(Object.assign({},t.transaction,{blockTag:t.blockTag}));case"chainId":return(await e.getNetwork()).chainId;case"estimateGas":return await e.estimateGas(t.transaction);case"getBalance":return await e.getBalance(t.address,t.blockTag);case"getBlock":{let n="blockHash"in t?t.blockHash:t.blockTag;return await e.getBlock(n,t.includeTransactions)}case"getBlockNumber":return await e.getBlockNumber();case"getCode":return await e.getCode(t.address,t.blockTag);case"getGasPrice":return(await e.getFeeData()).gasPrice;case"getPriorityFee":return(await e.getFeeData()).maxPriorityFeePerGas;case"getLogs":return await e.getLogs(t.filter);case"getStorage":return await e.getStorage(t.address,t.position,t.blockTag);case"getTransaction":return await e.getTransaction(t.hash);case"getTransactionCount":return await e.getTransactionCount(t.address,t.blockTag);case"getTransactionReceipt":return await e.getTransactionReceipt(t.hash);case"getTransactionResult":return await e.getTransactionResult(t.hash)}}#n(e){let t=Array.from(e).map(s=>s.config),n=this.#e.slice();uF(n),n.sort((s,i)=>s.priority-i.priority);for(let s of n)if(!s._lastFatalError&&t.indexOf(s)===-1)return s;return null}#s(e,t){let n=this.#n(e);if(n==null)return null;let s={config:n,result:null,didBump:!1,perform:null,staller:null},i=Gw();return s.perform=(async()=>{try{n.requests++;let a=await this._translatePerform(n.provider,t);s.result={result:a}}catch(a){n.errorResponses++,s.result={error:a}}let o=Gw()-i;n._totalTime+=o,n.rollingDuration=.95*n.rollingDuration+.05*o,s.perform=null})(),s.staller=(async()=>{await lF(n.stallTimeout),s.staller=null})(),e.add(s),s}async#o(){let e=this.#r;if(!e){let t=[];this.#e.forEach(n=>{t.push((async()=>{await fF(n,0),n._lastFatalError||(n._network=await n.provider.getNetwork())})())}),this.#r=e=(async()=>{await Promise.all(t);let n=null;for(let s of this.#e){if(s._lastFatalError)continue;let i=s._network;n==null?n=i.chainId:i.chainId!==n&&(0,hs.assert)(!1,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}})()}await e}async#i(e,t){let n=[];for(let s of e)if(s.result!=null){let{tag:i,value:o}=$w(s.result);n.push({tag:i,value:o,weight:s.config.weight})}if(!(n.reduce((s,i)=>s+i.weight,0)<this.quorum)){switch(t.method){case"getBlockNumber":{this.#t===-2&&(this.#t=Math.ceil((0,hs.getNumber)(zw(this.quorum,this.#e.filter(i=>!i._lastFatalError).map(i=>({value:i.blockNumber,tag:(0,hs.getNumber)(i.blockNumber).toString(),weight:i.weight}))))));let s=dF(this.quorum,n);return s===void 0?void 0:(s>this.#t&&(this.#t=s),this.#t)}case"getGasPrice":case"getPriorityFee":case"estimateGas":return zw(this.quorum,n);case"getBlock":return"blockTag"in t&&t.blockTag==="pending"?qw(this.quorum,n):am(this.quorum,n);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return am(this.quorum,n);case"broadcastTransaction":return qw(this.quorum,n)}(0,hs.assert)(!1,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${Hw(t.method)})`})}}async#a(e,t){if(e.size===0)throw new Error("no runners?!");let n=[],s=0;for(let o of e){if(o.perform&&n.push(o.perform),o.staller){n.push(o.staller);continue}o.didBump||(o.didBump=!0,s++)}let i=await this.#i(e,t);if(i!==void 0){if(i instanceof Error)throw i;return i}for(let o=0;o<s;o++)this.#s(e,t);return(0,hs.assert)(n.length>0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:t,results:Array.from(e).map(o=>Hw(o.result))}}),await Promise.race(n),await this.#a(e,t)}async _perform(e){if(e.method==="broadcastTransaction"){let i=this.#e.map(c=>null),o=this.#e.map(async({provider:c,weight:u},l)=>{try{let f=await c._perform(e);i[l]=Object.assign($w({result:f}),{weight:u})}catch(f){i[l]=Object.assign($w({error:f}),{weight:u})}});for(;;){let c=i.filter(f=>f!=null);for(let{value:f}of c)if(!(f instanceof Error))return f;let u=am(this.quorum,i.filter(f=>f!=null));if((0,hs.isError)(u,"INSUFFICIENT_FUNDS"))throw u;let l=o.filter((f,d)=>i[d]==null);if(l.length===0)break;await Promise.race(l)}let a=qw(this.quorum,i);if((0,hs.assert)(a!==void 0,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:e,results:i.map(Hw)}}),a instanceof Error)throw a;return a}await this.#o();let t=new Set,n=0;for(;;){let i=this.#s(t,e);if(i==null||(n+=i.config.weight,n>=this.quorum))break}let s=await this.#a(t,e);for(let i of t)i.perform&&i.result==null&&i.config.lateResponses++;return s}async destroy(){for(let{provider:e}of this.#e)e.destroy();super.destroy()}};cm.FallbackProvider=Vw});var dk=M(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});um.getDefaultProvider=void 0;var pF=me(),hF=Ow(),mF=_w(),bF=Cw(),gF=Iw(),xF=Mw(),yF=Uw(),wF=Dw(),AF=Kw(),Jw=Cn(),EF=Jr(),vF=nm();function TF(r){return r&&typeof r.send=="function"&&typeof r.close=="function"}var PF="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");function kF(r,e){e==null&&(e={});let t=o=>e[o]==="-"?!1:typeof e.exclusive=="string"?o===e.exclusive:Array.isArray(e.exclusive)?e.exclusive.indexOf(o)!==-1:!0;if(typeof r=="string"&&r.match(/^https?:/))return new Jw.JsonRpcProvider(r);if(typeof r=="string"&&r.match(/^wss?:/)||TF(r))return new vF.WebSocketProvider(r);let n=null;try{n=EF.Network.from(r)}catch{}let s=[];if(t("publicPolygon")&&n&&(n.name==="matic"?s.push(new Jw.JsonRpcProvider("https://polygon-rpc.com/",n,{staticNetwork:n})):n.name==="matic-amoy"&&s.push(new Jw.JsonRpcProvider("https://rpc-amoy.polygon.technology/",n,{staticNetwork:n}))),t("alchemy"))try{s.push(new mF.AlchemyProvider(r,e.alchemy))}catch{}if(t("ankr")&&e.ankr!=null)try{s.push(new hF.AnkrProvider(r,e.ankr))}catch{}if(t("chainstack"))try{s.push(new bF.ChainstackProvider(r,e.chainstack))}catch{}if(t("cloudflare"))try{s.push(new gF.CloudflareProvider(r))}catch{}if(t("etherscan"))try{s.push(new xF.EtherscanProvider(r,e.etherscan))}catch{}if(t("infura"))try{let o=e.infura,a;typeof o=="object"&&(a=o.projectSecret,o=o.projectId),s.push(new yF.InfuraProvider(r,o,a))}catch{}if(t("quicknode"))try{let o=e.quicknode;s.push(new wF.QuickNodeProvider(r,o))}catch{}if((0,pF.assert)(s.length,"unsupported default network","UNSUPPORTED_OPERATION",{operation:"getDefaultProvider"}),s.length===1)return s[0];let i=Math.floor(s.length/2);return i>2&&(i=2),n&&PF.indexOf(n.name)!==-1&&(i=1),e&&e.quorum&&(i=e.quorum),new AF.FallbackProvider(s,void 0,{quorum:i})}um.getDefaultProvider=kF});var pk=M(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});lm.NonceManager=void 0;var BF=me(),SF=Uh(),fd=class extends SF.AbstractSigner{signer;#e;#t;constructor(e){super(e.provider),(0,BF.defineProperties)(this,{signer:e}),this.#e=null,this.#t=0}async getAddress(){return this.signer.getAddress()}connect(e){return new fd(this.signer.connect(e))}async getNonce(e){if(e==="pending"){this.#e==null&&(this.#e=super.getNonce("pending"));let t=this.#t;return await this.#e+t}return super.getNonce(e)}increment(){this.#t++}reset(){this.#t=0,this.#e=null}async sendTransaction(e){let t=this.getNonce("pending");return this.increment(),e=await this.signer.populateTransaction(e),e.nonce=await t,await this.signer.sendTransaction(e)}signTransaction(e){return this.signer.signTransaction(e)}signMessage(e){return this.signer.signMessage(e)}signTypedData(e,t,n){return this.signer.signTypedData(e,t,n)}};lm.NonceManager=fd});var mk=M(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});fm.BrowserProvider=void 0;var hk=me(),OF=Cn(),Ww=class extends OF.JsonRpcApiPollingProvider{#e;constructor(e,t,n){let s=Object.assign({},n??{},{batchMaxCount:1});(0,hk.assertArgument)(e&&e.request,"invalid EIP-1193 provider","ethereum",e),super(t,s),this.#e=async(i,o)=>{let a={method:i,params:o};this.emit("debug",{action:"sendEip1193Request",payload:a});try{let c=await e.request(a);return this.emit("debug",{action:"receiveEip1193Result",result:c}),c}catch(c){let u=new Error(c.message);throw u.code=c.code,u.data=c.data,u.payload=a,this.emit("debug",{action:"receiveEip1193Error",error:u}),u}}}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){(0,hk.assertArgument)(!Array.isArray(e),"EIP-1193 does not support batch request","payload",e);try{let t=await this.#e(e.method,e.params||[]);return[{id:e.id,result:t}]}catch(t){return[{id:e.id,error:{code:t.code,data:t.data,message:t.message}}]}}getRpcError(e,t){switch(t=JSON.parse(JSON.stringify(t)),t.error.code||-1){case 4001:t.error.message=`ethers-user-denied: ${t.error.message}`;break;case 4200:t.error.message=`ethers-unsupported: ${t.error.message}`;break}return super.getRpcError(e,t)}async hasSigner(e){e==null&&(e=0);let t=await this.send("eth_accounts",[]);return typeof e=="number"?t.length>e:(e=e.toLowerCase(),t.filter(n=>n.toLowerCase()===e).length!==0)}async getSigner(e){if(e==null&&(e=0),!await this.hasSigner(e))try{await this.#e("eth_requestAccounts",[])}catch(t){let n=t.payload;throw this.getRpcError(n,{id:n.id,error:t})}return await super.getSigner(e)}};fm.BrowserProvider=Ww});var bk=M(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});pm.PocketProvider=void 0;var Qw=me(),_F=Pi(),CF=Jr(),NF=Cn(),dm="62e1ad51b37b8e00394bda3b";function IF(r){switch(r){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}(0,Qw.assertArgument)(!1,"unsupported network","network",r)}var Fu=class extends NF.JsonRpcProvider{applicationId;applicationSecret;constructor(e,t,n){e==null&&(e="mainnet");let s=CF.Network.from(e);t==null&&(t=dm),n==null&&(n=null);let i={staticNetwork:s},o=Fu.getRequest(s,t,n);super(o,s,i),(0,Qw.defineProperties)(this,{applicationId:t,applicationSecret:n})}_getProvider(e){try{return new Fu(e,this.applicationId,this.applicationSecret)}catch{}return super._getProvider(e)}static getRequest(e,t,n){t==null&&(t=dm);let s=new Qw.FetchRequest(`https://${IF(e.name)}/v1/lb/${t}`);return s.allowGzip=!0,n&&s.setCredentials("",n),t===dm&&(s.retryFunc=async(i,o,a)=>((0,_F.showThrottleMessage)("PocketProvider"),!0)),s}isCommunityResource(){return this.applicationId===dm}};pm.PocketProvider=Fu});var gk=M(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});hm.IpcSocketProvider=void 0;var RF=void 0;hm.IpcSocketProvider=RF});var bm=M(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.SocketEventSubscriber=ue.SocketPendingSubscriber=ue.SocketBlockSubscriber=ue.SocketSubscriber=ue.WebSocketProvider=ue.SocketProvider=ue.IpcSocketProvider=ue.QuickNodeProvider=ue.PocketProvider=ue.InfuraWebSocketProvider=ue.InfuraProvider=ue.EtherscanPlugin=ue.EtherscanProvider=ue.ChainstackProvider=ue.CloudflareProvider=ue.AnkrProvider=ue.AlchemyProvider=ue.BrowserProvider=ue.JsonRpcSigner=ue.JsonRpcProvider=ue.JsonRpcApiProvider=ue.FallbackProvider=ue.copyRequest=ue.TransactionResponse=ue.TransactionReceipt=ue.Log=ue.FeeData=ue.Block=ue.FetchUrlFeeDataNetworkPlugin=ue.FeeDataNetworkPlugin=ue.EnsPlugin=ue.GasCostPlugin=ue.NetworkPlugin=ue.NonceManager=ue.Network=ue.MulticoinProviderPlugin=ue.EnsResolver=ue.getDefaultProvider=ue.showThrottleMessage=ue.VoidSigner=ue.AbstractSigner=ue.UnmanagedSubscriber=ue.AbstractProvider=void 0;var xk=ku();Object.defineProperty(ue,"AbstractProvider",{enumerable:!0,get:function(){return xk.AbstractProvider}});Object.defineProperty(ue,"UnmanagedSubscriber",{enumerable:!0,get:function(){return xk.UnmanagedSubscriber}});var yk=Uh();Object.defineProperty(ue,"AbstractSigner",{enumerable:!0,get:function(){return yk.AbstractSigner}});Object.defineProperty(ue,"VoidSigner",{enumerable:!0,get:function(){return yk.VoidSigner}});var MF=Pi();Object.defineProperty(ue,"showThrottleMessage",{enumerable:!0,get:function(){return MF.showThrottleMessage}});var LF=dk();Object.defineProperty(ue,"getDefaultProvider",{enumerable:!0,get:function(){return LF.getDefaultProvider}});var wk=uw();Object.defineProperty(ue,"EnsResolver",{enumerable:!0,get:function(){return wk.EnsResolver}});Object.defineProperty(ue,"MulticoinProviderPlugin",{enumerable:!0,get:function(){return wk.MulticoinProviderPlugin}});var jF=Jr();Object.defineProperty(ue,"Network",{enumerable:!0,get:function(){return jF.Network}});var UF=pk();Object.defineProperty(ue,"NonceManager",{enumerable:!0,get:function(){return UF.NonceManager}});var dd=Sh();Object.defineProperty(ue,"NetworkPlugin",{enumerable:!0,get:function(){return dd.NetworkPlugin}});Object.defineProperty(ue,"GasCostPlugin",{enumerable:!0,get:function(){return dd.GasCostPlugin}});Object.defineProperty(ue,"EnsPlugin",{enumerable:!0,get:function(){return dd.EnsPlugin}});Object.defineProperty(ue,"FeeDataNetworkPlugin",{enumerable:!0,get:function(){return dd.FeeDataNetworkPlugin}});Object.defineProperty(ue,"FetchUrlFeeDataNetworkPlugin",{enumerable:!0,get:function(){return dd.FetchUrlFeeDataNetworkPlugin}});var Du=yu();Object.defineProperty(ue,"Block",{enumerable:!0,get:function(){return Du.Block}});Object.defineProperty(ue,"FeeData",{enumerable:!0,get:function(){return Du.FeeData}});Object.defineProperty(ue,"Log",{enumerable:!0,get:function(){return Du.Log}});Object.defineProperty(ue,"TransactionReceipt",{enumerable:!0,get:function(){return Du.TransactionReceipt}});Object.defineProperty(ue,"TransactionResponse",{enumerable:!0,get:function(){return Du.TransactionResponse}});Object.defineProperty(ue,"copyRequest",{enumerable:!0,get:function(){return Du.copyRequest}});var FF=Kw();Object.defineProperty(ue,"FallbackProvider",{enumerable:!0,get:function(){return FF.FallbackProvider}});var Yw=Cn();Object.defineProperty(ue,"JsonRpcApiProvider",{enumerable:!0,get:function(){return Yw.JsonRpcApiProvider}});Object.defineProperty(ue,"JsonRpcProvider",{enumerable:!0,get:function(){return Yw.JsonRpcProvider}});Object.defineProperty(ue,"JsonRpcSigner",{enumerable:!0,get:function(){return Yw.JsonRpcSigner}});var DF=mk();Object.defineProperty(ue,"BrowserProvider",{enumerable:!0,get:function(){return DF.BrowserProvider}});var HF=_w();Object.defineProperty(ue,"AlchemyProvider",{enumerable:!0,get:function(){return HF.AlchemyProvider}});var $F=Ow();Object.defineProperty(ue,"AnkrProvider",{enumerable:!0,get:function(){return $F.AnkrProvider}});var qF=Iw();Object.defineProperty(ue,"CloudflareProvider",{enumerable:!0,get:function(){return qF.CloudflareProvider}});var GF=Cw();Object.defineProperty(ue,"ChainstackProvider",{enumerable:!0,get:function(){return GF.ChainstackProvider}});var Ak=Mw();Object.defineProperty(ue,"EtherscanProvider",{enumerable:!0,get:function(){return Ak.EtherscanProvider}});Object.defineProperty(ue,"EtherscanPlugin",{enumerable:!0,get:function(){return Ak.EtherscanPlugin}});var Ek=Uw();Object.defineProperty(ue,"InfuraProvider",{enumerable:!0,get:function(){return Ek.InfuraProvider}});Object.defineProperty(ue,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return Ek.InfuraWebSocketProvider}});var zF=bk();Object.defineProperty(ue,"PocketProvider",{enumerable:!0,get:function(){return zF.PocketProvider}});var VF=Dw();Object.defineProperty(ue,"QuickNodeProvider",{enumerable:!0,get:function(){return VF.QuickNodeProvider}});var KF=gk();Object.defineProperty(ue,"IpcSocketProvider",{enumerable:!0,get:function(){return KF.IpcSocketProvider}});var JF=tm();Object.defineProperty(ue,"SocketProvider",{enumerable:!0,get:function(){return JF.SocketProvider}});var WF=nm();Object.defineProperty(ue,"WebSocketProvider",{enumerable:!0,get:function(){return WF.WebSocketProvider}});var mm=tm();Object.defineProperty(ue,"SocketSubscriber",{enumerable:!0,get:function(){return mm.SocketSubscriber}});Object.defineProperty(ue,"SocketBlockSubscriber",{enumerable:!0,get:function(){return mm.SocketBlockSubscriber}});Object.defineProperty(ue,"SocketPendingSubscriber",{enumerable:!0,get:function(){return mm.SocketPendingSubscriber}});Object.defineProperty(ue,"SocketEventSubscriber",{enumerable:!0,get:function(){return mm.SocketEventSubscriber}})});var xm=M(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});gm.BaseWallet=void 0;var Zw=Yt(),Xw=Ls(),QF=bm(),vk=qr(),Hu=me(),pd=class extends QF.AbstractSigner{address;#e;constructor(e,t){super(t),(0,Hu.assertArgument)(e&&typeof e.sign=="function","invalid private key","privateKey","[ REDACTED ]"),this.#e=e;let n=(0,vk.computeAddress)(this.signingKey.publicKey);(0,Hu.defineProperties)(this,{address:n})}get signingKey(){return this.#e}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(e){return new pd(this.#e,e)}async signTransaction(e){let{to:t,from:n}=await(0,Hu.resolveProperties)({to:e.to?(0,Zw.resolveAddress)(e.to,this.provider):void 0,from:e.from?(0,Zw.resolveAddress)(e.from,this.provider):void 0});t!=null&&(e.to=t),n!=null&&(e.from=n),e.from!=null&&((0,Hu.assertArgument)((0,Zw.getAddress)(e.from)===this.address,"transaction from address mismatch","tx.from",e.from),delete e.from);let s=vk.Transaction.from(e);return s.signature=this.signingKey.sign(s.unsignedHash),s.serialized}async signMessage(e){return this.signMessageSync(e)}signMessageSync(e){return this.signingKey.sign((0,Xw.hashMessage)(e)).serialized}async signTypedData(e,t,n){let s=await Xw.TypedDataEncoder.resolveNames(e,t,n,async i=>{(0,Hu.assert)(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:i}});let o=await this.provider.resolveName(i);return(0,Hu.assert)(o!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:i}),o});return this.signingKey.sign(Xw.TypedDataEncoder.hash(s.domain,t,s.value)).serialized}};gm.BaseWallet=pd});var e2=M($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.decodeOwl=$u.decode=void 0;var YF=me(),ym=" !#$%&'()*+,-./<=>?@[]^_`{|}~",ZF=/^[a-z]*$/i;function Tk(r,e){let t=97;return r.reduce((n,s)=>(s===e?t++:s.match(ZF)?n.push(String.fromCharCode(t)+s):(t=97,n.push(s)),n),[])}function Pk(r,e){for(let s=ym.length-1;s>=0;s--)r=r.split(ym[s]).join(e.substring(2*s,2*s+2));let t=[],n=r.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(s,i,o,a)=>{if(o)for(let c=parseInt(o);c>=0;c--)t.push(";");else t.push(i.toLowerCase());return""});if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return Tk(Tk(t,";"),":")}$u.decode=Pk;function XF(r){return(0,YF.assertArgument)(r[0]==="0","unsupported auwl data","data",r),Pk(r.substring(1+2*ym.length),r.substring(1,1+2*ym.length))}$u.decodeOwl=XF});var r2=M(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});wm.Wordlist=void 0;var eD=me(),t2=class{locale;constructor(e){(0,eD.defineProperties)(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}};wm.Wordlist=t2});var Em=M(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});Am.WordlistOwl=void 0;var tD=Ls(),rD=me(),nD=e2(),sD=r2(),n2=class extends sD.Wordlist{#e;#t;constructor(e,t,n){super(e),this.#e=t,this.#t=n,this.#r=null}get _data(){return this.#e}_decodeWords(){return(0,nD.decodeOwl)(this.#e)}#r;#n(){if(this.#r==null){let e=this._decodeWords();if((0,tD.id)(e.join(`
|
|
756
|
+
`,tf=class{static generateApi(){let e=new oC.default(aC);if(e.generate(),e.errors.length)throw console.error(e.errorsToAscii()),console.error(e.linesToAscii()),console.log(e.displayAttributeErrors()),new Error("ABNF grammar has errors");return e.toObject()}};p3=tf;tf.grammarObj=p3.generateApi();var Gx=class{constructor(e){let t=new mr.default.parser;t.ast=new mr.default.ast;let n=mr.default.ids,s=function(E,v,k,w,P){let B=n.SEM_OK;return E===n.SEM_PRE&&k===0&&(P.scheme=mr.default.utils.charsToString(v,k,w)),B};t.ast.callbacks.scheme=s;let i=function(E,v,k,w,P){let B=n.SEM_OK;return E===n.SEM_PRE&&(P.domain=mr.default.utils.charsToString(v,k,w)),B};t.ast.callbacks.domain=i;let o=function(E,v,k,w,P){let B=n.SEM_OK;return E===n.SEM_PRE&&(P.address=mr.default.utils.charsToString(v,k,w)),B};t.ast.callbacks.address=o;let a=function(E,v,k,w,P){let B=n.SEM_OK;return E===n.SEM_PRE&&(P.statement=mr.default.utils.charsToString(v,k,w)),B};t.ast.callbacks.statement=a;let c=function(E,v,k,w,P){let B=n.SEM_OK;return E===n.SEM_PRE&&(P.uri||(P.uri=mr.default.utils.charsToString(v,k,w))),B};t.ast.callbacks.uri=c;let u=function(E,v,k,w,P){let B=n.SEM_OK;return E===n.SEM_PRE&&(P.version=mr.default.utils.charsToString(v,k,w)),B};t.ast.callbacks.version=u;let l=function(E,v,k,w,P){let B=n.SEM_OK;return E===n.SEM_PRE&&(P.chainId=(0,f3.parseIntegerNumber)(mr.default.utils.charsToString(v,k,w))),B};t.ast.callbacks["chain-id"]=l;let f=function(E,v,k,w,P){let B=n.SEM_OK;return E===n.SEM_PRE&&(P.nonce=mr.default.utils.charsToString(v,k,w)),B};t.ast.callbacks.nonce=f;let d=function(E,v,k,w,P){let B=n.SEM_OK;return E===n.SEM_PRE&&(P.issuedAt=mr.default.utils.charsToString(v,k,w)),B};t.ast.callbacks["issued-at"]=d;let h=function(E,v,k,w,P){let B=n.SEM_OK;return E===n.SEM_PRE&&(P.expirationTime=mr.default.utils.charsToString(v,k,w)),B};t.ast.callbacks["expiration-time"]=h;let b=function(E,v,k,w,P){let B=n.SEM_OK;return E===n.SEM_PRE&&(P.notBefore=mr.default.utils.charsToString(v,k,w)),B};t.ast.callbacks["not-before"]=b;let p=function(E,v,k,w,P){let B=n.SEM_OK;return E===n.SEM_PRE&&(P.requestId=mr.default.utils.charsToString(v,k,w)),B};t.ast.callbacks["request-id"]=p;let g=function(E,v,k,w,P){let B=n.SEM_OK;return E===n.SEM_PRE&&(P.resources=mr.default.utils.charsToString(v,k,w).slice(3).split(`
|
|
757
|
+
- `)),B};t.ast.callbacks.resources=g;let m=t.parse(tf.grammarObj,"sign-in-with-ethereum",e);if(!m.success)throw new Error(`Invalid message: ${JSON.stringify(m)}`);let y={};t.ast.translate(y);for(let[E,v]of Object.entries(y))this[E]=v;if(this.domain.length===0)throw new Error("Domain cannot be empty.");if(!(0,f3.isEIP55Address)(this.address))throw new Error("Address not conformant to EIP-55.")}};Ac.ParsedMessage=Gx});var m3=M(pi=>{"use strict";var cC=pi&&pi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),uC=pi&&pi.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&cC(e,r,t)};Object.defineProperty(pi,"__esModule",{value:!0});pi.ParsedMessage=void 0;var lC=h3();Object.defineProperty(pi,"ParsedMessage",{enumerable:!0,get:function(){return lC.ParsedMessage}});uC(qx(),pi)});var g3=M((xV,b3)=>{(function(r){"use strict";r.exports.is_uri=t,r.exports.is_http_uri=n,r.exports.is_https_uri=s,r.exports.is_web_uri=i,r.exports.isUri=t,r.exports.isHttpUri=n,r.exports.isHttpsUri=s,r.exports.isWebUri=i;var e=function(o){var a=o.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/);return a};function t(o){if(!!o&&!/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(o)&&!/%[^0-9a-f]/i.test(o)&&!/%[0-9a-f](:?[^0-9a-f]|$)/i.test(o)){var a=[],c="",u="",l="",f="",d="",h="";if(a=e(o),c=a[1],u=a[2],l=a[3],f=a[4],d=a[5],!!(c&&c.length&&l.length>=0)){if(u&&u.length){if(!(l.length===0||/^\//.test(l)))return}else if(/^\/\//.test(l))return;if(!!/^[a-z][a-z0-9\+\-\.]*$/.test(c.toLowerCase()))return h+=c+":",u&&u.length&&(h+="//"+u),h+=l,f&&f.length&&(h+="?"+f),d&&d.length&&(h+="#"+d),h}}}function n(o,a){if(!!t(o)){var c=[],u="",l="",f="",d="",h="",b="",p="";if(c=e(o),u=c[1],l=c[2],f=c[3],h=c[4],b=c[5],!!u){if(a){if(u.toLowerCase()!="https")return}else if(u.toLowerCase()!="http")return;if(!!l)return/:(\d+)$/.test(l)&&(d=l.match(/:(\d+)$/)[0],l=l.replace(/:\d+$/,"")),p+=u+":",p+="//"+l,d&&(p+=d),p+=f,h&&h.length&&(p+="?"+h),b&&b.length&&(p+="#"+b),p}}}function s(o){return n(o,!0)}function i(o){return n(o)||s(o)}})(b3)});var F3=M((yV,k0)=>{var x3,y3,w3,A3,E3,v3,T3,P3,k3,T0,zx,B3,S3,O3,Ec,_3,C3,N3,I3,R3,M3,L3,j3,U3,P0;(function(r){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){r(t(e,t(n)))}):typeof k0=="object"&&typeof k0.exports=="object"?r(t(e,t(k0.exports))):r(t(e));function t(n,s){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(i,o){return n[i]=s?s(i,o):o}}})(function(r){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])};x3=function(n,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");e(n,s);function i(){this.constructor=n}n.prototype=s===null?Object.create(s):(i.prototype=s.prototype,new i)},y3=Object.assign||function(n){for(var s,i=1,o=arguments.length;i<o;i++){s=arguments[i];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(n[a]=s[a])}return n},w3=function(n,s){var i={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&s.indexOf(o)<0&&(i[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(n);a<o.length;a++)s.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(n,o[a])&&(i[o[a]]=n[o[a]]);return i},A3=function(n,s,i,o){var a=arguments.length,c=a<3?s:o===null?o=Object.getOwnPropertyDescriptor(s,i):o,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(n,s,i,o);else for(var l=n.length-1;l>=0;l--)(u=n[l])&&(c=(a<3?u(c):a>3?u(s,i,c):u(s,i))||c);return a>3&&c&&Object.defineProperty(s,i,c),c},E3=function(n,s){return function(i,o){s(i,o,n)}},v3=function(n,s){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,s)},T3=function(n,s,i,o){function a(c){return c instanceof i?c:new i(function(u){u(c)})}return new(i||(i=Promise))(function(c,u){function l(h){try{d(o.next(h))}catch(b){u(b)}}function f(h){try{d(o.throw(h))}catch(b){u(b)}}function d(h){h.done?c(h.value):a(h.value).then(l,f)}d((o=o.apply(n,s||[])).next())})},P3=function(n,s){var i={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},o,a,c,u;return u={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function l(d){return function(h){return f([d,h])}}function f(d){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,a&&(c=d[0]&2?a.return:d[0]?a.throw||((c=a.return)&&c.call(a),0):a.next)&&!(c=c.call(a,d[1])).done)return c;switch(a=0,c&&(d=[d[0]&2,c.value]),d[0]){case 0:case 1:c=d;break;case 4:return i.label++,{value:d[1],done:!1};case 5:i.label++,a=d[1],d=[0];continue;case 7:d=i.ops.pop(),i.trys.pop();continue;default:if(c=i.trys,!(c=c.length>0&&c[c.length-1])&&(d[0]===6||d[0]===2)){i=0;continue}if(d[0]===3&&(!c||d[1]>c[0]&&d[1]<c[3])){i.label=d[1];break}if(d[0]===6&&i.label<c[1]){i.label=c[1],c=d;break}if(c&&i.label<c[2]){i.label=c[2],i.ops.push(d);break}c[2]&&i.ops.pop(),i.trys.pop();continue}d=s.call(n,i)}catch(h){d=[6,h],a=0}finally{o=c=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}},k3=function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&P0(s,n,i)},P0=Object.create?function(n,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,o,a)}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]},T0=function(n){var s=typeof Symbol=="function"&&Symbol.iterator,i=s&&n[s],o=0;if(i)return i.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&o>=n.length&&(n=void 0),{value:n&&n[o++],done:!n}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},zx=function(n,s){var i=typeof Symbol=="function"&&n[Symbol.iterator];if(!i)return n;var o=i.call(n),a,c=[],u;try{for(;(s===void 0||s-- >0)&&!(a=o.next()).done;)c.push(a.value)}catch(l){u={error:l}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(u)throw u.error}}return c},B3=function(){for(var n=[],s=0;s<arguments.length;s++)n=n.concat(zx(arguments[s]));return n},S3=function(){for(var n=0,s=0,i=arguments.length;s<i;s++)n+=arguments[s].length;for(var o=Array(n),a=0,s=0;s<i;s++)for(var c=arguments[s],u=0,l=c.length;u<l;u++,a++)o[a]=c[u];return o},O3=function(n,s,i){if(i||arguments.length===2)for(var o=0,a=s.length,c;o<a;o++)(c||!(o in s))&&(c||(c=Array.prototype.slice.call(s,0,o)),c[o]=s[o]);return n.concat(c||Array.prototype.slice.call(s))},Ec=function(n){return this instanceof Ec?(this.v=n,this):new Ec(n)},_3=function(n,s,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=i.apply(n,s||[]),a,c=[];return a={},u("next"),u("throw"),u("return"),a[Symbol.asyncIterator]=function(){return this},a;function u(p){o[p]&&(a[p]=function(g){return new Promise(function(m,y){c.push([p,g,m,y])>1||l(p,g)})})}function l(p,g){try{f(o[p](g))}catch(m){b(c[0][3],m)}}function f(p){p.value instanceof Ec?Promise.resolve(p.value.v).then(d,h):b(c[0][2],p)}function d(p){l("next",p)}function h(p){l("throw",p)}function b(p,g){p(g),c.shift(),c.length&&l(c[0][0],c[0][1])}},C3=function(n){var s,i;return s={},o("next"),o("throw",function(a){throw a}),o("return"),s[Symbol.iterator]=function(){return this},s;function o(a,c){s[a]=n[a]?function(u){return(i=!i)?{value:Ec(n[a](u)),done:a==="return"}:c?c(u):u}:c}},N3=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=n[Symbol.asyncIterator],i;return s?s.call(n):(n=typeof T0=="function"?T0(n):n[Symbol.iterator](),i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i);function o(c){i[c]=n[c]&&function(u){return new Promise(function(l,f){u=n[c](u),a(l,f,u.done,u.value)})}}function a(c,u,l,f){Promise.resolve(f).then(function(d){c({value:d,done:l})},u)}},I3=function(n,s){return Object.defineProperty?Object.defineProperty(n,"raw",{value:s}):n.raw=s,n};var t=Object.create?function(n,s){Object.defineProperty(n,"default",{enumerable:!0,value:s})}:function(n,s){n.default=s};R3=function(n){if(n&&n.__esModule)return n;var s={};if(n!=null)for(var i in n)i!=="default"&&Object.prototype.hasOwnProperty.call(n,i)&&P0(s,n,i);return t(s,n),s},M3=function(n){return n&&n.__esModule?n:{default:n}},L3=function(n,s,i,o){if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof s=="function"?n!==s||!o:!s.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?o:i==="a"?o.call(n):o?o.value:s.get(n)},j3=function(n,s,i,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof s=="function"?n!==s||!a:!s.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(n,i):a?a.value=i:s.set(n,i),i},U3=function(n,s){if(s===null||typeof s!="object"&&typeof s!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?s===n:n.has(s)},r("__extends",x3),r("__assign",y3),r("__rest",w3),r("__decorate",A3),r("__param",E3),r("__metadata",v3),r("__awaiter",T3),r("__generator",P3),r("__exportStar",k3),r("__createBinding",P0),r("__values",T0),r("__read",zx),r("__spread",B3),r("__spreadArrays",S3),r("__spreadArray",O3),r("__await",Ec),r("__asyncGenerator",_3),r("__asyncDelegator",C3),r("__asyncValues",N3),r("__makeTemplateObject",I3),r("__importStar",R3),r("__importDefault",M3),r("__classPrivateFieldGet",L3),r("__classPrivateFieldSet",j3),r("__classPrivateFieldIn",U3)})});var S0=M(B0=>{"use strict";Object.defineProperty(B0,"__esModule",{value:!0});B0.version=void 0;B0.version="6.13.1"});var Yi=M(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.defineProperties=vc.resolveProperties=void 0;function fC(r,e,t){let n=e.split("|").map(i=>i.trim());for(let i=0;i<n.length;i++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof r===e)return}let s=new Error(`invalid value for type ${e}`);throw s.code="INVALID_ARGUMENT",s.argument=`value.${t}`,s.value=r,s}async function dC(r){let e=Object.keys(r);return(await Promise.all(e.map(n=>Promise.resolve(r[n])))).reduce((n,s,i)=>(n[e[i]]=s,n),{})}vc.resolveProperties=dC;function pC(r,e,t){for(let n in e){let s=e[n],i=t?t[n]:null;i&&fC(s,i,n),Object.defineProperty(r,n,{enumerable:!0,value:s,writable:!1})}}vc.defineProperties=pC});var Zn=M(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.assertPrivate=tr.assertNormalize=tr.assertArgumentCount=tr.assertArgument=tr.assert=tr.makeError=tr.isCallException=tr.isError=void 0;var hC=S0(),D3=Yi();function Tc(r){if(r==null)return"null";if(Array.isArray(r))return"[ "+r.map(Tc).join(", ")+" ]";if(r instanceof Uint8Array){let e="0123456789abcdef",t="0x";for(let n=0;n<r.length;n++)t+=e[r[n]>>4],t+=e[r[n]&15];return t}if(typeof r=="object"&&typeof r.toJSON=="function")return Tc(r.toJSON());switch(typeof r){case"boolean":case"symbol":return r.toString();case"bigint":return BigInt(r).toString();case"number":return r.toString();case"string":return JSON.stringify(r);case"object":{let e=Object.keys(r);return e.sort(),"{ "+e.map(t=>`${Tc(t)}: ${Tc(r[t])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function H3(r,e){return r&&r.code===e}tr.isError=H3;function mC(r){return H3(r,"CALL_EXCEPTION")}tr.isCallException=mC;function $3(r,e,t){let n=r;{let i=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${Tc(t)}`);for(let o in t){if(o==="shortMessage")continue;let a=t[o];i.push(o+"="+Tc(a))}}i.push(`code=${e}`),i.push(`version=${hC.version}`),i.length&&(r+=" ("+i.join(", ")+")")}let s;switch(e){case"INVALID_ARGUMENT":s=new TypeError(r);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":s=new RangeError(r);break;default:s=new Error(r)}return(0,D3.defineProperties)(s,{code:e}),t&&Object.assign(s,t),s.shortMessage==null&&(0,D3.defineProperties)(s,{shortMessage:n}),s}tr.makeError=$3;function Pc(r,e,t,n){if(!r)throw $3(e,t,n)}tr.assert=Pc;function bC(r,e,t,n){Pc(r,e,"INVALID_ARGUMENT",{argument:t,value:n})}tr.assertArgument=bC;function gC(r,e,t){t==null&&(t=""),t&&(t=": "+t),Pc(r>=e,"missing arguemnt"+t,"MISSING_ARGUMENT",{count:r,expectedCount:e}),Pc(r<=e,"too many arguments"+t,"UNEXPECTED_ARGUMENT",{count:r,expectedCount:e})}tr.assertArgumentCount=gC;var xC=["NFD","NFC","NFKD","NFKC"].reduce((r,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"){let t=String.fromCharCode(233).normalize("NFD"),n=String.fromCharCode(101,769);if(t!==n)throw new Error("broken")}r.push(e)}catch{}return r},[]);function yC(r){Pc(xC.indexOf(r)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:r}})}tr.assertNormalize=yC;function wC(r,e,t){if(t==null&&(t=""),r!==e){let n=t,s="new";t&&(n+=".",s+=" "+t),Pc(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}tr.assertPrivate=wC});var gn=M(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.zeroPadBytes=vt.zeroPadValue=vt.stripZerosLeft=vt.dataSlice=vt.dataLength=vt.concat=vt.hexlify=vt.isBytesLike=vt.isHexString=vt.getBytesCopy=vt.getBytes=void 0;var Vx=Zn();function G3(r,e,t){if(r instanceof Uint8Array)return t?new Uint8Array(r):r;if(typeof r=="string"&&r.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){let n=new Uint8Array((r.length-2)/2),s=2;for(let i=0;i<n.length;i++)n[i]=parseInt(r.substring(s,s+2),16),s+=2;return n}(0,Vx.assertArgument)(!1,"invalid BytesLike value",e||"value",r)}function rf(r,e){return G3(r,e,!1)}vt.getBytes=rf;function AC(r,e){return G3(r,e,!0)}vt.getBytesCopy=AC;function Kx(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&r.length!==2+2*e||e===!0&&r.length%2!==0)}vt.isHexString=Kx;function EC(r){return Kx(r,!0)||r instanceof Uint8Array}vt.isBytesLike=EC;var q3="0123456789abcdef";function nf(r){let e=rf(r),t="0x";for(let n=0;n<e.length;n++){let s=e[n];t+=q3[(s&240)>>4]+q3[s&15]}return t}vt.hexlify=nf;function vC(r){return"0x"+r.map(e=>nf(e).substring(2)).join("")}vt.concat=vC;function TC(r){return Kx(r,!0)?(r.length-2)/2:rf(r).length}vt.dataLength=TC;function PC(r,e,t){let n=rf(r);return t!=null&&t>n.length&&(0,Vx.assert)(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:t}),nf(n.slice(e??0,t??n.length))}vt.dataSlice=PC;function kC(r){let e=nf(r).substring(2);for(;e.startsWith("00");)e=e.substring(2);return"0x"+e}vt.stripZerosLeft=kC;function z3(r,e,t){let n=rf(r);(0,Vx.assert)(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});let s=new Uint8Array(e);return s.fill(0),t?s.set(n,e-n.length):s.set(n,0),nf(s)}function BC(r,e){return z3(r,e,!0)}vt.zeroPadValue=BC;function SC(r,e){return z3(r,e,!1)}vt.zeroPadBytes=SC});var Bc=M(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.toQuantity=Tt.toBeArray=Tt.toBeHex=Tt.toNumber=Tt.getNumber=Tt.toBigInt=Tt.getUint=Tt.getBigInt=Tt.mask=Tt.toTwos=Tt.fromTwos=void 0;var V3=gn(),Hr=Zn(),O0=BigInt(0),Xn=BigInt(1),kc=9007199254740991;function OC(r,e){let t=sf(r,"value"),n=BigInt(va(e,"width"));if((0,Hr.assert)(t>>n===O0,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:r}),t>>n-Xn){let s=(Xn<<n)-Xn;return-((~t&s)+Xn)}return t}Tt.fromTwos=OC;function _C(r,e){let t=_0(r,"value"),n=BigInt(va(e,"width")),s=Xn<<n-Xn;if(t<O0){t=-t,(0,Hr.assert)(t<=s,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:r});let i=(Xn<<n)-Xn;return(~t&i)+Xn}else(0,Hr.assert)(t<s,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:r});return t}Tt.toTwos=_C;function CC(r,e){let t=sf(r,"value"),n=BigInt(va(e,"bits"));return t&(Xn<<n)-Xn}Tt.mask=CC;function _0(r,e){switch(typeof r){case"bigint":return r;case"number":return(0,Hr.assertArgument)(Number.isInteger(r),"underflow",e||"value",r),(0,Hr.assertArgument)(r>=-kc&&r<=kc,"overflow",e||"value",r),BigInt(r);case"string":try{if(r==="")throw new Error("empty string");return r[0]==="-"&&r[1]!=="-"?-BigInt(r.substring(1)):BigInt(r)}catch(t){(0,Hr.assertArgument)(!1,`invalid BigNumberish string: ${t.message}`,e||"value",r)}}(0,Hr.assertArgument)(!1,"invalid BigNumberish value",e||"value",r)}Tt.getBigInt=_0;function sf(r,e){let t=_0(r,e);return(0,Hr.assert)(t>=O0,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:r}),t}Tt.getUint=sf;var K3="0123456789abcdef";function W3(r){if(r instanceof Uint8Array){let e="0x0";for(let t of r)e+=K3[t>>4],e+=K3[t&15];return BigInt(e)}return _0(r)}Tt.toBigInt=W3;function va(r,e){switch(typeof r){case"bigint":return(0,Hr.assertArgument)(r>=-kc&&r<=kc,"overflow",e||"value",r),Number(r);case"number":return(0,Hr.assertArgument)(Number.isInteger(r),"underflow",e||"value",r),(0,Hr.assertArgument)(r>=-kc&&r<=kc,"overflow",e||"value",r),r;case"string":try{if(r==="")throw new Error("empty string");return va(BigInt(r),e)}catch(t){(0,Hr.assertArgument)(!1,`invalid numeric string: ${t.message}`,e||"value",r)}}(0,Hr.assertArgument)(!1,"invalid numeric value",e||"value",r)}Tt.getNumber=va;function NC(r){return va(W3(r))}Tt.toNumber=NC;function IC(r,e){let n=sf(r,"value").toString(16);if(e==null)n.length%2&&(n="0"+n);else{let s=va(e,"width");for((0,Hr.assert)(s*2>=n.length,`value exceeds width (${s} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:r});n.length<s*2;)n="0"+n}return"0x"+n}Tt.toBeHex=IC;function J3(r){let e=sf(r,"value");if(e===O0)return new Uint8Array([]);let t=e.toString(16);t.length%2&&(t="0"+t);let n=new Uint8Array(t.length/2);for(let s=0;s<n.length;s++){let i=s*2;n[s]=parseInt(t.substring(i,i+2),16)}return n}Tt.toBeArray=J3;function RC(r){let e=(0,V3.hexlify)((0,V3.isBytesLike)(r)?r:J3(r)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}Tt.toQuantity=RC});var Q3=M(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.decodeBase58=Sc.encodeBase58=void 0;var MC=gn(),LC=Zn(),jC=Bc(),N0="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",C0=null;function UC(r){if(C0==null){C0={};for(let t=0;t<N0.length;t++)C0[N0[t]]=BigInt(t)}let e=C0[r];return(0,LC.assertArgument)(e!=null,"invalid base58 value","letter",r),e}var FC=BigInt(0),Wx=BigInt(58);function DC(r){let e=(0,MC.getBytes)(r),t=(0,jC.toBigInt)(e),n="";for(;t;)n=N0[Number(t%Wx)]+n,t/=Wx;for(let s=0;s<e.length&&!e[s];s++)n=N0[0]+n;return n}Sc.encodeBase58=DC;function HC(r){let e=FC;for(let t=0;t<r.length;t++)e*=Wx,e+=UC(r[t]);return e}Sc.decodeBase58=HC});var Jx=M(Oc=>{"use strict";Object.defineProperty(Oc,"__esModule",{value:!0});Oc.encodeBase64=Oc.decodeBase64=void 0;var Y3=gn();function $C(r){r=atob(r);let e=new Uint8Array(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return(0,Y3.getBytes)(e)}Oc.decodeBase64=$C;function qC(r){let e=(0,Y3.getBytes)(r),t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}Oc.encodeBase64=qC});var Z3=M(I0=>{"use strict";Object.defineProperty(I0,"__esModule",{value:!0});I0.EventPayload=void 0;var GC=Yi(),Qx=class{filter;emitter;#e;constructor(e,t,n){this.#e=t,(0,GC.defineProperties)(this,{emitter:e,filter:n})}async removeListener(){this.#e!=null&&await this.emitter.off(this.filter,this.#e)}};I0.EventPayload=Qx});var R0=M(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.toUtf8CodePoints=es.toUtf8String=es.toUtf8Bytes=es.Utf8ErrorFuncs=void 0;var zC=gn(),of=Zn();function VC(r,e,t,n,s){(0,of.assertArgument)(!1,`invalid codepoint at offset ${e}; ${r}`,"bytes",t)}function X3(r,e,t,n,s){if(r==="BAD_PREFIX"||r==="UNEXPECTED_CONTINUE"){let i=0;for(let o=e+1;o<t.length&&t[o]>>6===2;o++)i++;return i}return r==="OVERRUN"?t.length-e-1:0}function KC(r,e,t,n,s){return r==="OVERLONG"?((0,of.assertArgument)(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),n.push(s),0):(n.push(65533),X3(r,e,t,n,s))}es.Utf8ErrorFuncs=Object.freeze({error:VC,ignore:X3,replace:KC});function e8(r,e){e==null&&(e=es.Utf8ErrorFuncs.error);let t=(0,zC.getBytes)(r,"bytes"),n=[],s=0;for(;s<t.length;){let i=t[s++];if(i>>7===0){n.push(i);continue}let o=null,a=null;if((i&224)===192)o=1,a=127;else if((i&240)===224)o=2,a=2047;else if((i&248)===240)o=3,a=65535;else{(i&192)===128?s+=e("UNEXPECTED_CONTINUE",s-1,t,n):s+=e("BAD_PREFIX",s-1,t,n);continue}if(s-1+o>=t.length){s+=e("OVERRUN",s-1,t,n);continue}let c=i&(1<<8-o-1)-1;for(let u=0;u<o;u++){let l=t[s];if((l&192)!=128){s+=e("MISSING_CONTINUE",s,t,n),c=null;break}c=c<<6|l&63,s++}if(c!==null){if(c>1114111){s+=e("OUT_OF_RANGE",s-1-o,t,n,c);continue}if(c>=55296&&c<=57343){s+=e("UTF16_SURROGATE",s-1-o,t,n,c);continue}if(c<=a){s+=e("OVERLONG",s-1-o,t,n,c);continue}n.push(c)}}return n}function t8(r,e){(0,of.assertArgument)(typeof r=="string","invalid string value","str",r),e!=null&&((0,of.assertNormalize)(e),r=r.normalize(e));let t=[];for(let n=0;n<r.length;n++){let s=r.charCodeAt(n);if(s<128)t.push(s);else if(s<2048)t.push(s>>6|192),t.push(s&63|128);else if((s&64512)==55296){n++;let i=r.charCodeAt(n);(0,of.assertArgument)(n<r.length&&(i&64512)===56320,"invalid surrogate pair","str",r);let o=65536+((s&1023)<<10)+(i&1023);t.push(o>>18|240),t.push(o>>12&63|128),t.push(o>>6&63|128),t.push(o&63|128)}else t.push(s>>12|224),t.push(s>>6&63|128),t.push(s&63|128)}return new Uint8Array(t)}es.toUtf8Bytes=t8;function WC(r){return r.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function JC(r,e){return WC(e8(r,e))}es.toUtf8String=JC;function QC(r,e){return e8(t8(r,e))}es.toUtf8CodePoints=QC});var n8=M(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.getUrl=_c.createGetUrl=void 0;var af=Zn();function r8(r){async function e(t,n){(0,af.assert)(n==null||!n.cancelled,"request cancelled before sending","CANCELLED");let s=t.url.split(":")[0].toLowerCase();(0,af.assert)(s==="http"||s==="https",`unsupported protocol ${s}`,"UNSUPPORTED_OPERATION",{info:{protocol:s},operation:"request"}),(0,af.assert)(s==="https"||!t.credentials||t.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let i=null,o=new AbortController,a=setTimeout(()=>{i=(0,af.makeError)("request timeout","TIMEOUT"),o.abort()},t.timeout);n&&n.addListener(()=>{i=(0,af.makeError)("request cancelled","CANCELLED"),o.abort()});let c={method:t.method,headers:new Headers(Array.from(t)),body:t.body||void 0,signal:o.signal},u;try{u=await fetch(t.url,c)}catch(h){throw clearTimeout(a),i||h}clearTimeout(a);let l={};u.headers.forEach((h,b)=>{l[b.toLowerCase()]=h});let f=await u.arrayBuffer(),d=f==null?null:new Uint8Array(f);return{statusCode:u.status,statusMessage:u.statusText,headers:l,body:d}}return e}_c.createGetUrl=r8;var YC=r8({});async function ZC(r,e){return YC(r,e)}_c.getUrl=ZC});var d8=M(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.FetchResponse=Zi.FetchRequest=Zi.FetchCancelSignal=void 0;var o8=Jx(),a8=gn(),xn=Zn(),XC=Yi(),Cc=R0(),c8=n8(),eN=12,tN=250,s8=(0,c8.createGetUrl)(),rN=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),nN=new RegExp("^ipfs://(ipfs/)?(.*)$","i"),Yx=!1;async function u8(r,e){try{let t=r.match(rN);if(!t)throw new Error("invalid data");return new ts(200,"OK",{"content-type":t[1]||"text/plain"},t[2]?(0,o8.decodeBase64)(t[3]):sN(t[3]))}catch{return new ts(599,"BAD REQUEST (invalid data: URI)",{},null,new hi(r))}}function l8(r){async function e(t,n){try{let s=t.match(nN);if(!s)throw new Error("invalid link");return new hi(`${r}${s[2]}`)}catch{return new ts(599,"BAD REQUEST (invalid IPFS URI)",{},null,new hi(t))}}return e}var M0={data:u8,ipfs:l8("https://gateway.ipfs.io/ipfs/")},f8=new WeakMap,j0=class{#e;#t;constructor(e){this.#e=[],this.#t=!1,f8.set(e,()=>{if(!this.#t){this.#t=!0;for(let t of this.#e)setTimeout(()=>{t()},0);this.#e=[]}})}addListener(e){(0,xn.assert)(!this.#t,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#e.push(e)}get cancelled(){return this.#t}checkSignal(){(0,xn.assert)(!this.cancelled,"cancelled","CANCELLED",{})}};Zi.FetchCancelSignal=j0;function L0(r){if(r==null)throw new Error("missing signal; should not happen");return r.checkSignal(),r}var hi=class{#e;#t;#r;#n;#s;#o;#i;#a;#f;#u;#h;#m;#c;#l;#d;get url(){return this.#o}set url(e){this.#o=String(e)}get body(){return this.#i==null?null:new Uint8Array(this.#i)}set body(e){if(e==null)this.#i=void 0,this.#a=void 0;else if(typeof e=="string")this.#i=(0,Cc.toUtf8Bytes)(e),this.#a="text/plain";else if(e instanceof Uint8Array)this.#i=e,this.#a="application/octet-stream";else if(typeof e=="object")this.#i=(0,Cc.toUtf8Bytes)(JSON.stringify(e)),this.#a="application/json";else throw new Error("invalid body")}hasBody(){return this.#i!=null}get method(){return this.#n?this.#n:this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),this.#n=String(e).toUpperCase()}get headers(){let e=Object.assign({},this.#r);return this.#f&&(e.authorization=`Basic ${(0,o8.encodeBase64)((0,Cc.toUtf8Bytes)(this.#f))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&this.#a&&(e["content-type"]=this.#a),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,t){this.#r[String(e).toLowerCase()]=String(t)}clearHeaders(){this.#r={}}[Symbol.iterator](){let e=this.headers,t=Object.keys(e),n=0;return{next:()=>{if(n<t.length){let s=t[n++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return this.#f||null}setCredentials(e,t){(0,xn.assertArgument)(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),this.#f=`${e}:${t}`}get allowGzip(){return this.#t}set allowGzip(e){this.#t=!!e}get allowInsecureAuthentication(){return!!this.#e}set allowInsecureAuthentication(e){this.#e=!!e}get timeout(){return this.#s}set timeout(e){(0,xn.assertArgument)(e>=0,"timeout must be non-zero","timeout",e),this.#s=e}get preflightFunc(){return this.#u||null}set preflightFunc(e){this.#u=e}get processFunc(){return this.#h||null}set processFunc(e){this.#h=e}get retryFunc(){return this.#m||null}set retryFunc(e){this.#m=e}get getUrlFunc(){return this.#d||s8}set getUrlFunc(e){this.#d=e}constructor(e){this.#o=String(e),this.#e=!1,this.#t=!0,this.#r={},this.#n="",this.#s=3e5,this.#l={slotInterval:tN,maxAttempts:eN},this.#d=null}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${this.#i?(0,a8.hexlify)(this.#i):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(this.#l.slotInterval=e.slotInterval),e.maxAttempts!=null&&(this.#l.maxAttempts=e.maxAttempts)}async#p(e,t,n,s,i){if(e>=this.#l.maxAttempts)return i.makeServerError("exceeded maximum retry limit");(0,xn.assert)(i8()<=t,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:s}),n>0&&await iN(n);let o=this.clone(),a=(o.url.split(":")[0]||"").toLowerCase();if(a in M0){let l=await M0[a](o.url,L0(s.#c));if(l instanceof ts){let f=l;if(this.processFunc){L0(s.#c);try{f=await this.processFunc(o,f)}catch(d){(d.throttle==null||typeof d.stall!="number")&&f.makeServerError("error in post-processing function",d).assertOk()}}return f}o=l}this.preflightFunc&&(o=await this.preflightFunc(o));let c=await this.getUrlFunc(o,L0(s.#c)),u=new ts(c.statusCode,c.statusMessage,c.headers,c.body,s);if(u.statusCode===301||u.statusCode===302){try{let l=u.headers.location||"";return o.redirect(l).#p(e+1,t,0,s,u)}catch{}return u}else if(u.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,u,e))){let l=u.headers["retry-after"],f=this.#l.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof l=="string"&&l.match(/^[1-9][0-9]*$/)&&(f=parseInt(l)),o.clone().#p(e+1,t,f,s,u)}if(this.processFunc){L0(s.#c);try{u=await this.processFunc(o,u)}catch(l){(l.throttle==null||typeof l.stall!="number")&&u.makeServerError("error in post-processing function",l).assertOk();let f=this.#l.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return l.stall>=0&&(f=l.stall),o.clone().#p(e+1,t,f,s,u)}}return u}send(){return(0,xn.assert)(this.#c==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#c=new j0(this),this.#p(0,i8()+this.timeout,0,this,new ts(0,"",{},null,this))}cancel(){(0,xn.assert)(this.#c!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});let e=f8.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){let t=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();(0,xn.assert)(this.method==="GET"&&(t!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});let s=new hi(e);return s.method="GET",s.allowGzip=this.allowGzip,s.timeout=this.timeout,s.#r=Object.assign({},this.#r),this.#i&&(s.#i=new Uint8Array(this.#i)),s.#a=this.#a,s}clone(){let e=new hi(this.url);return e.#n=this.#n,this.#i&&(e.#i=this.#i),e.#a=this.#a,e.#r=Object.assign({},this.#r),e.#f=this.#f,this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),e.#u=this.#u,e.#h=this.#h,e.#m=this.#m,e.#l=Object.assign({},this.#l),e.#d=this.#d,e}static lockConfig(){Yx=!0}static getGateway(e){return M0[e.toLowerCase()]||null}static registerGateway(e,t){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(Yx)throw new Error("gateways locked");M0[e]=t}static registerGetUrl(e){if(Yx)throw new Error("gateways locked");s8=e}static createGetUrlFunc(e){return(0,c8.createGetUrl)(e)}static createDataGateway(){return u8}static createIpfsGatewayFunc(e){return l8(e)}};Zi.FetchRequest=hi;var ts=class{#e;#t;#r;#n;#s;#o;toString(){return`<FetchResponse status=${this.statusCode} body=${this.#n?(0,a8.hexlify)(this.#n):"null"}>`}get statusCode(){return this.#e}get statusMessage(){return this.#t}get headers(){return Object.assign({},this.#r)}get body(){return this.#n==null?null:new Uint8Array(this.#n)}get bodyText(){try{return this.#n==null?"":(0,Cc.toUtf8String)(this.#n)}catch{(0,xn.assert)(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{(0,xn.assert)(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){let e=this.headers,t=Object.keys(e),n=0;return{next:()=>{if(n<t.length){let s=t[n++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}constructor(e,t,n,s,i){this.#e=e,this.#t=t,this.#r=Object.keys(n).reduce((o,a)=>(o[a.toLowerCase()]=String(n[a]),o),{}),this.#n=s==null?null:new Uint8Array(s),this.#s=i||null,this.#o={message:""}}makeServerError(e,t){let n;e?n=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:(e=`${this.statusCode} ${this.statusMessage}`,n=`CLIENT ESCALATED SERVER ERROR (${e})`);let s=new ts(599,n,this.headers,this.body,this.#s||void 0);return s.#o={message:e,error:t},s}throwThrottleError(e,t){t==null?t=-1:(0,xn.assertArgument)(Number.isInteger(t)&&t>=0,"invalid stall timeout","stall",t);let n=new Error(e||"throttling requests");throw(0,XC.defineProperties)(n,{stall:t,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return this.#n!=null}get request(){return this.#s}ok(){return this.#o.message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:t}=this.#o;e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let n=null;this.request&&(n=this.request.url);let s=null;try{this.#n&&(s=(0,Cc.toUtf8String)(this.#n))}catch{}(0,xn.assert)(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:t,info:{requestUrl:n,responseBody:s,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};Zi.FetchResponse=ts;function i8(){return new Date().getTime()}function sN(r){return(0,Cc.toUtf8Bytes)(r.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))}function iN(r){return new Promise(e=>setTimeout(e,r))}});var Xx=M(U0=>{"use strict";Object.defineProperty(U0,"__esModule",{value:!0});U0.FixedNumber=void 0;var oN=gn(),Pr=Zn(),Xi=Bc(),aN=Yi(),cN=BigInt(-1),rs=BigInt(0),Ic=BigInt(1),uN=BigInt(5),Nc={},Rc="0000";for(;Rc.length<80;)Rc+=Rc;function Ta(r){let e=Rc;for(;e.length<r;)e+=e;return BigInt("1"+e.substring(0,r))}function cf(r,e,t){let n=BigInt(e.width);if(e.signed){let s=Ic<<n-Ic;(0,Pr.assert)(t==null||r>=-s&&r<s,"overflow","NUMERIC_FAULT",{operation:t,fault:"overflow",value:r}),r>rs?r=(0,Xi.fromTwos)((0,Xi.mask)(r,n),n):r=-(0,Xi.fromTwos)((0,Xi.mask)(-r,n),n)}else{let s=Ic<<n;(0,Pr.assert)(t==null||r>=0&&r<s,"overflow","NUMERIC_FAULT",{operation:t,fault:"overflow",value:r}),r=(r%s+s)%s&s-Ic}return r}function Zx(r){typeof r=="number"&&(r=`fixed128x${r}`);let e=!0,t=128,n=18;if(typeof r=="string"){if(r!=="fixed")if(r==="ufixed")e=!1;else{let i=r.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);(0,Pr.assertArgument)(i,"invalid fixed format","format",r),e=i[1]!=="u",t=parseInt(i[2]),n=parseInt(i[3])}}else if(r){let i=r,o=(a,c,u)=>i[a]==null?u:((0,Pr.assertArgument)(typeof i[a]===c,"invalid fixed format ("+a+" not "+c+")","format."+a,i[a]),i[a]);e=o("signed","boolean",e),t=o("width","number",t),n=o("decimals","number",n)}(0,Pr.assertArgument)(t%8===0,"invalid FixedNumber width (not byte aligned)","format.width",t),(0,Pr.assertArgument)(n<=80,"invalid FixedNumber decimals (too large)","format.decimals",n);let s=(e?"":"u")+"fixed"+String(t)+"x"+String(n);return{signed:e,width:t,decimals:n,name:s}}function lN(r,e){let t="";r<rs&&(t="-",r*=cN);let n=r.toString();if(e===0)return t+n;for(;n.length<=e;)n=Rc+n;let s=n.length-e;for(n=n.substring(0,s)+"."+n.substring(s);n[0]==="0"&&n[1]!==".";)n=n.substring(1);for(;n[n.length-1]==="0"&&n[n.length-2]!==".";)n=n.substring(0,n.length-1);return t+n}var Ss=class{format;#e;#t;#r;_value;constructor(e,t,n){(0,Pr.assertPrivate)(e,Nc,"FixedNumber"),this.#t=t,this.#e=n;let s=lN(t,n.decimals);(0,aN.defineProperties)(this,{format:n.name,_value:s}),this.#r=Ta(n.decimals)}get signed(){return this.#e.signed}get width(){return this.#e.width}get decimals(){return this.#e.decimals}get value(){return this.#t}#n(e){(0,Pr.assertArgument)(this.format===e.format,"incompatible format; use fixedNumber.toFormat","other",e)}#s(e,t){return e=cf(e,this.#e,t),new Ss(Nc,e,this.#e)}#o(e,t){return this.#n(e),this.#s(this.#t+e.#t,t)}addUnsafe(e){return this.#o(e)}add(e){return this.#o(e,"add")}#i(e,t){return this.#n(e),this.#s(this.#t-e.#t,t)}subUnsafe(e){return this.#i(e)}sub(e){return this.#i(e,"sub")}#a(e,t){return this.#n(e),this.#s(this.#t*e.#t/this.#r,t)}mulUnsafe(e){return this.#a(e)}mul(e){return this.#a(e,"mul")}mulSignal(e){this.#n(e);let t=this.#t*e.#t;return(0,Pr.assert)(t%this.#r===rs,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),this.#s(t/this.#r,"mulSignal")}#f(e,t){return(0,Pr.assert)(e.#t!==rs,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#n(e),this.#s(this.#t*this.#r/e.#t,t)}divUnsafe(e){return this.#f(e)}div(e){return this.#f(e,"div")}divSignal(e){(0,Pr.assert)(e.#t!==rs,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#n(e);let t=this.#t*this.#r;return(0,Pr.assert)(t%e.#t===rs,"precision lost during signalling div","NUMERIC_FAULT",{operation:"divSignal",fault:"underflow",value:this}),this.#s(t/e.#t,"divSignal")}cmp(e){let t=this.value,n=e.value,s=this.decimals-e.decimals;return s>0?n*=Ta(s):s<0&&(t*=Ta(-s)),t<n?-1:t>n?1:0}eq(e){return this.cmp(e)===0}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=this.#t;return this.#t<rs&&(e-=this.#r-Ic),e=this.#t/this.#r*this.#r,this.#s(e,"floor")}ceiling(){let e=this.#t;return this.#t>rs&&(e+=this.#r-Ic),e=this.#t/this.#r*this.#r,this.#s(e,"ceiling")}round(e){if(e==null&&(e=0),e>=this.decimals)return this;let t=this.decimals-e,n=uN*Ta(t-1),s=this.value+n,i=Ta(t);return s=s/i*i,cf(s,this.#e,"round"),new Ss(Nc,s,this.#e)}isZero(){return this.#t===rs}isNegative(){return this.#t<rs}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Ss.fromString(this.toString(),e)}static fromValue(e,t,n){let s=t==null?0:(0,Xi.getNumber)(t),i=Zx(n),o=(0,Xi.getBigInt)(e,"value"),a=s-i.decimals;if(a>0){let c=Ta(a);(0,Pr.assert)(o%c===rs,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),o/=c}else a<0&&(o*=Ta(-a));return cf(o,i,"fromValue"),new Ss(Nc,o,i)}static fromString(e,t){let n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);(0,Pr.assertArgument)(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);let s=Zx(t),i=n[2]||"0",o=n[3]||"";for(;o.length<s.decimals;)o+=Rc;(0,Pr.assert)(o.substring(s.decimals).match(/^0*$/),"too many decimals for format","NUMERIC_FAULT",{operation:"fromString",fault:"underflow",value:e}),o=o.substring(0,s.decimals);let a=BigInt(n[1]+i+o);return cf(a,s,"fromString"),new Ss(Nc,a,s)}static fromBytes(e,t){let n=(0,Xi.toBigInt)((0,oN.getBytes)(e,"value")),s=Zx(t);return s.signed&&(n=(0,Xi.fromTwos)(n,s.width)),cf(n,s,"fromBytes"),new Ss(Nc,n,s)}};U0.FixedNumber=Ss});var g8=M(D0=>{"use strict";Object.defineProperty(D0,"__esModule",{value:!0});D0.decodeRlp=void 0;var p8=gn(),F0=Zn(),fN=gn();function dN(r){let e=r.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function h8(r,e,t){let n=0;for(let s=0;s<t;s++)n=n*256+r[e+s];return n}function m8(r,e,t,n){let s=[];for(;t<e+1+n;){let i=b8(r,t);s.push(i.result),t+=i.consumed,(0,F0.assert)(t<=e+1+n,"child data too short","BUFFER_OVERRUN",{buffer:r,length:n,offset:e})}return{consumed:1+n,result:s}}function b8(r,e){(0,F0.assert)(r.length!==0,"data too short","BUFFER_OVERRUN",{buffer:r,length:0,offset:1});let t=n=>{(0,F0.assert)(n<=r.length,"data short segment too short","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n})};if(r[e]>=248){let n=r[e]-247;t(e+1+n);let s=h8(r,e+1,n);return t(e+1+n+s),m8(r,e,e+1+n,n+s)}else if(r[e]>=192){let n=r[e]-192;return t(e+1+n),m8(r,e,e+1,n)}else if(r[e]>=184){let n=r[e]-183;t(e+1+n);let s=h8(r,e+1,n);t(e+1+n+s);let i=(0,p8.hexlify)(r.slice(e+1+n,e+1+n+s));return{consumed:1+n+s,result:i}}else if(r[e]>=128){let n=r[e]-128;t(e+1+n);let s=(0,p8.hexlify)(r.slice(e+1,e+1+n));return{consumed:1+n,result:s}}return{consumed:1,result:dN(r[e])}}function pN(r){let e=(0,fN.getBytes)(r,"data"),t=b8(e,0);return(0,F0.assertArgument)(t.consumed===e.length,"unexpected junk after rlp payload","data",r),t.result}D0.decodeRlp=pN});var A8=M(H0=>{"use strict";Object.defineProperty(H0,"__esModule",{value:!0});H0.encodeRlp=void 0;var hN=gn();function x8(r){let e=[];for(;r;)e.unshift(r&255),r>>=8;return e}function w8(r){if(Array.isArray(r)){let n=[];if(r.forEach(function(i){n=n.concat(w8(i))}),n.length<=55)return n.unshift(192+n.length),n;let s=x8(n.length);return s.unshift(247+s.length),s.concat(n)}let e=Array.prototype.slice.call((0,hN.getBytes)(r,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;let t=x8(e.length);return t.unshift(183+t.length),t.concat(e)}var y8="0123456789abcdef";function mN(r){let e="0x";for(let t of w8(r))e+=y8[t>>4],e+=y8[t&15];return e}H0.encodeRlp=mN});var B8=M(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.parseEther=Os.formatEther=Os.parseUnits=Os.formatUnits=void 0;var ey=Zn(),E8=Xx(),v8=Bc(),T8=["wei","kwei","mwei","gwei","szabo","finney","ether"];function P8(r,e){let t=18;if(typeof e=="string"){let n=T8.indexOf(e);(0,ey.assertArgument)(n>=0,"invalid unit","unit",e),t=3*n}else e!=null&&(t=(0,v8.getNumber)(e,"unit"));return E8.FixedNumber.fromValue(r,t,{decimals:t,width:512}).toString()}Os.formatUnits=P8;function k8(r,e){(0,ey.assertArgument)(typeof r=="string","value must be a string","value",r);let t=18;if(typeof e=="string"){let n=T8.indexOf(e);(0,ey.assertArgument)(n>=0,"invalid unit","unit",e),t=3*n}else e!=null&&(t=(0,v8.getNumber)(e,"unit"));return E8.FixedNumber.fromString(r,{decimals:t,width:512}).value}Os.parseUnits=k8;function bN(r){return P8(r,18)}Os.formatEther=bN;function gN(r){return k8(r,18)}Os.parseEther=gN});var O8=M($0=>{"use strict";Object.defineProperty($0,"__esModule",{value:!0});$0.uuidV4=void 0;var S8=gn();function xN(r){let e=(0,S8.getBytes)(r,"randomBytes");e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=(0,S8.hexlify)(e);return[t.substring(2,10),t.substring(10,14),t.substring(14,18),t.substring(18,22),t.substring(22,34)].join("-")}$0.uuidV4=xN});var me=M(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.toUtf8String=ne.toUtf8CodePoints=ne.toUtf8Bytes=ne.parseUnits=ne.formatUnits=ne.parseEther=ne.formatEther=ne.encodeRlp=ne.decodeRlp=ne.defineProperties=ne.resolveProperties=ne.toQuantity=ne.toBeArray=ne.toBeHex=ne.toNumber=ne.toBigInt=ne.getUint=ne.getNumber=ne.getBigInt=ne.mask=ne.toTwos=ne.fromTwos=ne.FixedNumber=ne.FetchCancelSignal=ne.FetchResponse=ne.FetchRequest=ne.EventPayload=ne.makeError=ne.assertNormalize=ne.assertPrivate=ne.assertArgumentCount=ne.assertArgument=ne.assert=ne.isError=ne.isCallException=ne.zeroPadBytes=ne.zeroPadValue=ne.stripZerosLeft=ne.dataSlice=ne.dataLength=ne.concat=ne.hexlify=ne.isBytesLike=ne.isHexString=ne.getBytesCopy=ne.getBytes=ne.encodeBase64=ne.decodeBase64=ne.encodeBase58=ne.decodeBase58=void 0;ne.uuidV4=ne.Utf8ErrorFuncs=void 0;var _8=Q3();Object.defineProperty(ne,"decodeBase58",{enumerable:!0,get:function(){return _8.decodeBase58}});Object.defineProperty(ne,"encodeBase58",{enumerable:!0,get:function(){return _8.encodeBase58}});var C8=Jx();Object.defineProperty(ne,"decodeBase64",{enumerable:!0,get:function(){return C8.decodeBase64}});Object.defineProperty(ne,"encodeBase64",{enumerable:!0,get:function(){return C8.encodeBase64}});var ns=gn();Object.defineProperty(ne,"getBytes",{enumerable:!0,get:function(){return ns.getBytes}});Object.defineProperty(ne,"getBytesCopy",{enumerable:!0,get:function(){return ns.getBytesCopy}});Object.defineProperty(ne,"isHexString",{enumerable:!0,get:function(){return ns.isHexString}});Object.defineProperty(ne,"isBytesLike",{enumerable:!0,get:function(){return ns.isBytesLike}});Object.defineProperty(ne,"hexlify",{enumerable:!0,get:function(){return ns.hexlify}});Object.defineProperty(ne,"concat",{enumerable:!0,get:function(){return ns.concat}});Object.defineProperty(ne,"dataLength",{enumerable:!0,get:function(){return ns.dataLength}});Object.defineProperty(ne,"dataSlice",{enumerable:!0,get:function(){return ns.dataSlice}});Object.defineProperty(ne,"stripZerosLeft",{enumerable:!0,get:function(){return ns.stripZerosLeft}});Object.defineProperty(ne,"zeroPadValue",{enumerable:!0,get:function(){return ns.zeroPadValue}});Object.defineProperty(ne,"zeroPadBytes",{enumerable:!0,get:function(){return ns.zeroPadBytes}});var eo=Zn();Object.defineProperty(ne,"isCallException",{enumerable:!0,get:function(){return eo.isCallException}});Object.defineProperty(ne,"isError",{enumerable:!0,get:function(){return eo.isError}});Object.defineProperty(ne,"assert",{enumerable:!0,get:function(){return eo.assert}});Object.defineProperty(ne,"assertArgument",{enumerable:!0,get:function(){return eo.assertArgument}});Object.defineProperty(ne,"assertArgumentCount",{enumerable:!0,get:function(){return eo.assertArgumentCount}});Object.defineProperty(ne,"assertPrivate",{enumerable:!0,get:function(){return eo.assertPrivate}});Object.defineProperty(ne,"assertNormalize",{enumerable:!0,get:function(){return eo.assertNormalize}});Object.defineProperty(ne,"makeError",{enumerable:!0,get:function(){return eo.makeError}});var yN=Z3();Object.defineProperty(ne,"EventPayload",{enumerable:!0,get:function(){return yN.EventPayload}});var ty=d8();Object.defineProperty(ne,"FetchRequest",{enumerable:!0,get:function(){return ty.FetchRequest}});Object.defineProperty(ne,"FetchResponse",{enumerable:!0,get:function(){return ty.FetchResponse}});Object.defineProperty(ne,"FetchCancelSignal",{enumerable:!0,get:function(){return ty.FetchCancelSignal}});var wN=Xx();Object.defineProperty(ne,"FixedNumber",{enumerable:!0,get:function(){return wN.FixedNumber}});var ss=Bc();Object.defineProperty(ne,"fromTwos",{enumerable:!0,get:function(){return ss.fromTwos}});Object.defineProperty(ne,"toTwos",{enumerable:!0,get:function(){return ss.toTwos}});Object.defineProperty(ne,"mask",{enumerable:!0,get:function(){return ss.mask}});Object.defineProperty(ne,"getBigInt",{enumerable:!0,get:function(){return ss.getBigInt}});Object.defineProperty(ne,"getNumber",{enumerable:!0,get:function(){return ss.getNumber}});Object.defineProperty(ne,"getUint",{enumerable:!0,get:function(){return ss.getUint}});Object.defineProperty(ne,"toBigInt",{enumerable:!0,get:function(){return ss.toBigInt}});Object.defineProperty(ne,"toNumber",{enumerable:!0,get:function(){return ss.toNumber}});Object.defineProperty(ne,"toBeHex",{enumerable:!0,get:function(){return ss.toBeHex}});Object.defineProperty(ne,"toBeArray",{enumerable:!0,get:function(){return ss.toBeArray}});Object.defineProperty(ne,"toQuantity",{enumerable:!0,get:function(){return ss.toQuantity}});var N8=Yi();Object.defineProperty(ne,"resolveProperties",{enumerable:!0,get:function(){return N8.resolveProperties}});Object.defineProperty(ne,"defineProperties",{enumerable:!0,get:function(){return N8.defineProperties}});var AN=g8();Object.defineProperty(ne,"decodeRlp",{enumerable:!0,get:function(){return AN.decodeRlp}});var EN=A8();Object.defineProperty(ne,"encodeRlp",{enumerable:!0,get:function(){return EN.encodeRlp}});var q0=B8();Object.defineProperty(ne,"formatEther",{enumerable:!0,get:function(){return q0.formatEther}});Object.defineProperty(ne,"parseEther",{enumerable:!0,get:function(){return q0.parseEther}});Object.defineProperty(ne,"formatUnits",{enumerable:!0,get:function(){return q0.formatUnits}});Object.defineProperty(ne,"parseUnits",{enumerable:!0,get:function(){return q0.parseUnits}});var G0=R0();Object.defineProperty(ne,"toUtf8Bytes",{enumerable:!0,get:function(){return G0.toUtf8Bytes}});Object.defineProperty(ne,"toUtf8CodePoints",{enumerable:!0,get:function(){return G0.toUtf8CodePoints}});Object.defineProperty(ne,"toUtf8String",{enumerable:!0,get:function(){return G0.toUtf8String}});Object.defineProperty(ne,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return G0.Utf8ErrorFuncs}});var vN=O8();Object.defineProperty(ne,"uuidV4",{enumerable:!0,get:function(){return vN.uuidV4}})});var yn=M(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.Reader=gt.Writer=gt.Coder=gt.checkResultErrors=gt.Result=gt.WordSize=void 0;var Ct=me();gt.WordSize=32;var ry=new Uint8Array(gt.WordSize),TN=["then"],z0={},M8=new WeakMap;function Pa(r){return M8.get(r)}function I8(r,e){M8.set(r,e)}function uf(r,e){let t=new Error(`deferred error during ABI decoding triggered accessing ${r}`);throw t.error=e,t}function ny(r,e,t){return r.indexOf(null)>=0?e.map((n,s)=>n instanceof _s?ny(Pa(n),n,t):n):r.reduce((n,s,i)=>{let o=e.getValue(s);return s in n||(t&&o instanceof _s&&(o=ny(Pa(o),o,t)),n[s]=o),n},{})}var _s=class extends Array{#e;constructor(...e){let t=e[0],n=e[1],s=(e[2]||[]).slice(),i=!0;t!==z0&&(n=e,s=[],i=!1),super(n.length),n.forEach((c,u)=>{this[u]=c});let o=s.reduce((c,u)=>(typeof u=="string"&&c.set(u,(c.get(u)||0)+1),c),new Map);if(I8(this,Object.freeze(n.map((c,u)=>{let l=s[u];return l!=null&&o.get(l)===1?l:null}))),this.#e=[],this.#e==null&&this.#e,!i)return;Object.freeze(this);let a=new Proxy(this,{get:(c,u,l)=>{if(typeof u=="string"){if(u.match(/^[0-9]+$/)){let d=(0,Ct.getNumber)(u,"%index");if(d<0||d>=this.length)throw new RangeError("out of result range");let h=c[d];return h instanceof Error&&uf(`index ${d}`,h),h}if(TN.indexOf(u)>=0)return Reflect.get(c,u,l);let f=c[u];if(f instanceof Function)return function(...d){return f.apply(this===l?c:this,d)};if(!(u in c))return c.getValue.apply(this===l?c:this,[u])}return Reflect.get(c,u,l)}});return I8(a,Pa(this)),a}toArray(e){let t=[];return this.forEach((n,s)=>{n instanceof Error&&uf(`index ${s}`,n),e&&n instanceof _s&&(n=n.toArray(e)),t.push(n)}),t}toObject(e){let t=Pa(this);return t.reduce((n,s,i)=>((0,Ct.assert)(s!=null,`value at index ${i} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),ny(t,this,e)),{})}slice(e,t){e==null&&(e=0),e<0&&(e+=this.length,e<0&&(e=0)),t==null&&(t=this.length),t<0&&(t+=this.length,t<0&&(t=0)),t>this.length&&(t=this.length);let n=Pa(this),s=[],i=[];for(let o=e;o<t;o++)s.push(this[o]),i.push(n[o]);return new _s(z0,s,i)}filter(e,t){let n=Pa(this),s=[],i=[];for(let o=0;o<this.length;o++){let a=this[o];a instanceof Error&&uf(`index ${o}`,a),e.call(t,a,o,this)&&(s.push(a),i.push(n[o]))}return new _s(z0,s,i)}map(e,t){let n=[];for(let s=0;s<this.length;s++){let i=this[s];i instanceof Error&&uf(`index ${s}`,i),n.push(e.call(t,i,s,this))}return n}getValue(e){let t=Pa(this).indexOf(e);if(t===-1)return;let n=this[t];return n instanceof Error&&uf(`property ${JSON.stringify(e)}`,n.error),n}static fromItems(e,t){return new _s(z0,e,t)}};gt.Result=_s;function PN(r){let e=[],t=function(n,s){if(!!Array.isArray(s))for(let i in s){let o=n.slice();o.push(i);try{t(o,s[i])}catch(a){e.push({path:o,error:a})}}};return t([],r),e}gt.checkResultErrors=PN;function R8(r){let e=(0,Ct.toBeArray)(r);return(0,Ct.assert)(e.length<=gt.WordSize,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:gt.WordSize,offset:e.length}),e.length!==gt.WordSize&&(e=(0,Ct.getBytesCopy)((0,Ct.concat)([ry.slice(e.length%gt.WordSize),e]))),e}var sy=class{name;type;localName;dynamic;constructor(e,t,n,s){(0,Ct.defineProperties)(this,{name:e,type:t,localName:n,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,t){(0,Ct.assertArgument)(!1,e,this.localName,t)}};gt.Coder=sy;var iy=class{#e;#t;constructor(){this.#e=[],this.#t=0}get data(){return(0,Ct.concat)(this.#e)}get length(){return this.#t}#r(e){return this.#e.push(e),this.#t+=e.length,e.length}appendWriter(e){return this.#r((0,Ct.getBytesCopy)(e.data))}writeBytes(e){let t=(0,Ct.getBytesCopy)(e),n=t.length%gt.WordSize;return n&&(t=(0,Ct.getBytesCopy)((0,Ct.concat)([t,ry.slice(n)]))),this.#r(t)}writeValue(e){return this.#r(R8(e))}writeUpdatableValue(){let e=this.#e.length;return this.#e.push(ry),this.#t+=gt.WordSize,t=>{this.#e[e]=R8(t)}}};gt.Writer=iy;var lf=class{allowLoose;#e;#t;#r;#n;#s;constructor(e,t,n){(0,Ct.defineProperties)(this,{allowLoose:!!t}),this.#e=(0,Ct.getBytesCopy)(e),this.#r=0,this.#n=null,this.#s=n??1024,this.#t=0}get data(){return(0,Ct.hexlify)(this.#e)}get dataLength(){return this.#e.length}get consumed(){return this.#t}get bytes(){return new Uint8Array(this.#e)}#o(e){if(this.#n)return this.#n.#o(e);this.#r+=e,(0,Ct.assert)(this.#s<1||this.#r<=this.#s*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#s} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:(0,Ct.getBytesCopy)(this.#e),offset:this.#t,length:e,info:{bytesRead:this.#r,dataLength:this.dataLength}})}#i(e,t,n){let s=Math.ceil(t/gt.WordSize)*gt.WordSize;return this.#t+s>this.#e.length&&(this.allowLoose&&n&&this.#t+t<=this.#e.length?s=t:(0,Ct.assert)(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:(0,Ct.getBytesCopy)(this.#e),length:this.#e.length,offset:this.#t+s})),this.#e.slice(this.#t,this.#t+s)}subReader(e){let t=new lf(this.#e.slice(this.#t+e),this.allowLoose,this.#s);return t.#n=this,t}readBytes(e,t){let n=this.#i(0,e,!!t);return this.#o(e),this.#t+=n.length,n.slice(0,e)}readValue(){return(0,Ct.toBigInt)(this.readBytes(gt.WordSize))}readIndex(){return(0,Ct.toNumber)(this.readBytes(gt.WordSize))}};gt.Reader=lf});var Mc=M(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.output=kr.exists=kr.hash=kr.bytes=kr.bool=kr.number=void 0;function V0(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}kr.number=V0;function L8(r){if(typeof r!="boolean")throw new Error(`Expected boolean, not ${r}`)}kr.bool=L8;function oy(r,...e){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(r.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${r.length}`)}kr.bytes=oy;function j8(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");V0(r.outputLen),V0(r.blockLen)}kr.hash=j8;function U8(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}kr.exists=U8;function F8(r,e){oy(r);let t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}kr.output=F8;var kN={number:V0,bool:L8,bytes:oy,hash:j8,exists:U8,output:F8};kr.default=kN});var D8=M(K0=>{"use strict";Object.defineProperty(K0,"__esModule",{value:!0});K0.crypto=void 0;K0.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});var is=M(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.randomBytes=je.wrapXOFConstructorWithOpts=je.wrapConstructorWithOpts=je.wrapConstructor=je.checkOpts=je.Hash=je.concatBytes=je.toBytes=je.utf8ToBytes=je.asyncLoop=je.nextTick=je.hexToBytes=je.bytesToHex=je.isLE=je.rotr=je.createView=je.u32=je.u8=void 0;var ay=D8(),uy=r=>r instanceof Uint8Array,BN=r=>new Uint8Array(r.buffer,r.byteOffset,r.byteLength);je.u8=BN;var SN=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4));je.u32=SN;var ON=r=>new DataView(r.buffer,r.byteOffset,r.byteLength);je.createView=ON;var _N=(r,e)=>r<<32-e|r>>>e;je.rotr=_N;je.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!je.isLE)throw new Error("Non little-endian hardware is not supported");var CN=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function NN(r){if(!uy(r))throw new Error("Uint8Array expected");let e="";for(let t=0;t<r.length;t++)e+=CN[r[t]];return e}je.bytesToHex=NN;function IN(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let e=r.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let t=new Uint8Array(e/2);for(let n=0;n<t.length;n++){let s=n*2,i=r.slice(s,s+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[n]=o}return t}je.hexToBytes=IN;var RN=async()=>{};je.nextTick=RN;async function MN(r,e,t){let n=Date.now();for(let s=0;s<r;s++){t(s);let i=Date.now()-n;i>=0&&i<e||(await(0,je.nextTick)(),n+=i)}}je.asyncLoop=MN;function H8(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}je.utf8ToBytes=H8;function W0(r){if(typeof r=="string"&&(r=H8(r)),!uy(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}je.toBytes=W0;function LN(...r){let e=new Uint8Array(r.reduce((n,s)=>n+s.length,0)),t=0;return r.forEach(n=>{if(!uy(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}je.concatBytes=LN;var cy=class{clone(){return this._cloneInto()}};je.Hash=cy;var jN={}.toString;function UN(r,e){if(e!==void 0&&jN.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(r,e)}je.checkOpts=UN;function FN(r){let e=n=>r().update(W0(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}je.wrapConstructor=FN;function DN(r){let e=(n,s)=>r(s).update(W0(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}je.wrapConstructorWithOpts=DN;function HN(r){let e=(n,s)=>r(s).update(W0(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}je.wrapXOFConstructorWithOpts=HN;function $N(r=32){if(ay.crypto&&typeof ay.crypto.getRandomValues=="function")return ay.crypto.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}je.randomBytes=$N});var Q0=M(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.hmac=ka.HMAC=void 0;var J0=Mc(),$8=is(),ff=class extends $8.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,J0.hash)(e);let n=(0,$8.toBytes)(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let s=this.blockLen,i=new Uint8Array(s);i.set(n.length>s?e.create().update(n).digest():n);for(let o=0;o<i.length;o++)i[o]^=54;this.iHash.update(i),this.oHash=e.create();for(let o=0;o<i.length;o++)i[o]^=106;this.oHash.update(i),i.fill(0)}update(e){return(0,J0.exists)(this),this.iHash.update(e),this}digestInto(e){(0,J0.exists)(this),(0,J0.bytes)(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:n,finished:s,destroyed:i,blockLen:o,outputLen:a}=this;return e=e,e.finished=s,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};ka.HMAC=ff;var qN=(r,e,t)=>new ff(r,e).update(t).digest();ka.hmac=qN;ka.hmac.create=(r,e)=>new ff(r,e)});var ly=M(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.pbkdf2Async=jc.pbkdf2=void 0;var Y0=Mc(),GN=Q0(),Lc=is();function q8(r,e,t,n){(0,Y0.hash)(r);let s=(0,Lc.checkOpts)({dkLen:32,asyncTick:10},n),{c:i,dkLen:o,asyncTick:a}=s;if((0,Y0.number)(i),(0,Y0.number)(o),(0,Y0.number)(a),i<1)throw new Error("PBKDF2: iterations (c) should be >= 1");let c=(0,Lc.toBytes)(e),u=(0,Lc.toBytes)(t),l=new Uint8Array(o),f=GN.hmac.create(r,c),d=f._cloneInto().update(u);return{c:i,dkLen:o,asyncTick:a,DK:l,PRF:f,PRFSalt:d}}function G8(r,e,t,n,s){return r.destroy(),e.destroy(),n&&n.destroy(),s.fill(0),t}function zN(r,e,t,n){let{c:s,dkLen:i,DK:o,PRF:a,PRFSalt:c}=q8(r,e,t,n),u,l=new Uint8Array(4),f=(0,Lc.createView)(l),d=new Uint8Array(a.outputLen);for(let h=1,b=0;b<i;h++,b+=a.outputLen){let p=o.subarray(b,b+a.outputLen);f.setInt32(0,h,!1),(u=c._cloneInto(u)).update(l).digestInto(d),p.set(d.subarray(0,p.length));for(let g=1;g<s;g++){a._cloneInto(u).update(d).digestInto(d);for(let m=0;m<p.length;m++)p[m]^=d[m]}}return G8(a,c,o,u,d)}jc.pbkdf2=zN;async function VN(r,e,t,n){let{c:s,dkLen:i,asyncTick:o,DK:a,PRF:c,PRFSalt:u}=q8(r,e,t,n),l,f=new Uint8Array(4),d=(0,Lc.createView)(f),h=new Uint8Array(c.outputLen);for(let b=1,p=0;p<i;b++,p+=c.outputLen){let g=a.subarray(p,p+c.outputLen);d.setInt32(0,b,!1),(l=u._cloneInto(l)).update(f).digestInto(h),g.set(h.subarray(0,g.length)),await(0,Lc.asyncLoop)(s-1,o,()=>{c._cloneInto(l).update(h).digestInto(h);for(let m=0;m<g.length;m++)g[m]^=h[m]})}return G8(c,u,a,l,h)}jc.pbkdf2Async=VN});var X0=M(Z0=>{"use strict";Object.defineProperty(Z0,"__esModule",{value:!0});Z0.SHA2=void 0;var fy=Mc(),df=is();function KN(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);let s=BigInt(32),i=BigInt(4294967295),o=Number(t>>s&i),a=Number(t&i),c=n?4:0,u=n?0:4;r.setUint32(e+c,o,n),r.setUint32(e+u,a,n)}var dy=class extends df.Hash{constructor(e,t,n,s){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,df.createView)(this.buffer)}update(e){(0,fy.exists)(this);let{view:t,buffer:n,blockLen:s}=this;e=(0,df.toBytes)(e);let i=e.length;for(let o=0;o<i;){let a=Math.min(s-this.pos,i-o);if(a===s){let c=(0,df.createView)(e);for(;s<=i-o;o+=s)this.process(c,o);continue}n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,fy.exists)(this),(0,fy.output)(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:s,isLE:i}=this,{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(n,0),o=0);for(let f=o;f<s;f++)t[f]=0;KN(n,s-8,BigInt(this.length*8),i),this.process(n,0);let a=(0,df.createView)(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let u=c/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)a.setUint32(4*f,l[f],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:n,length:s,finished:i,destroyed:o,pos:a}=this;return e.length=s,e.pos=a,e.finished=i,e.destroyed=o,s%t&&e.buffer.set(n),e}};Z0.SHA2=dy});var tp=M(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.sha224=Uc.sha256=void 0;var WN=X0(),wn=is(),JN=(r,e,t)=>r&e^~r&t,QN=(r,e,t)=>r&e^r&t^e&t,YN=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),to=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ro=new Uint32Array(64),ep=class extends WN.SHA2{constructor(){super(64,32,8,!1),this.A=to[0]|0,this.B=to[1]|0,this.C=to[2]|0,this.D=to[3]|0,this.E=to[4]|0,this.F=to[5]|0,this.G=to[6]|0,this.H=to[7]|0}get(){let{A:e,B:t,C:n,D:s,E:i,F:o,G:a,H:c}=this;return[e,t,n,s,i,o,a,c]}set(e,t,n,s,i,o,a,c){this.A=e|0,this.B=t|0,this.C=n|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,t){for(let f=0;f<16;f++,t+=4)ro[f]=e.getUint32(t,!1);for(let f=16;f<64;f++){let d=ro[f-15],h=ro[f-2],b=(0,wn.rotr)(d,7)^(0,wn.rotr)(d,18)^d>>>3,p=(0,wn.rotr)(h,17)^(0,wn.rotr)(h,19)^h>>>10;ro[f]=p+ro[f-7]+b+ro[f-16]|0}let{A:n,B:s,C:i,D:o,E:a,F:c,G:u,H:l}=this;for(let f=0;f<64;f++){let d=(0,wn.rotr)(a,6)^(0,wn.rotr)(a,11)^(0,wn.rotr)(a,25),h=l+d+JN(a,c,u)+YN[f]+ro[f]|0,p=((0,wn.rotr)(n,2)^(0,wn.rotr)(n,13)^(0,wn.rotr)(n,22))+QN(n,s,i)|0;l=u,u=c,c=a,a=o+h|0,o=i,i=s,s=n,n=h+p|0}n=n+this.A|0,s=s+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(n,s,i,o,a,c,u,l)}roundClean(){ro.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},py=class extends ep{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}};Uc.sha256=(0,wn.wrapConstructor)(()=>new ep);Uc.sha224=(0,wn.wrapConstructor)(()=>new py)});var by=M(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.add5L=Oe.add5H=Oe.add4H=Oe.add4L=Oe.add3H=Oe.add3L=Oe.add=Oe.rotlBL=Oe.rotlBH=Oe.rotlSL=Oe.rotlSH=Oe.rotr32L=Oe.rotr32H=Oe.rotrBL=Oe.rotrBH=Oe.rotrSL=Oe.rotrSH=Oe.shrSL=Oe.shrSH=Oe.toBig=Oe.split=Oe.fromBig=void 0;var rp=BigInt(2**32-1),hy=BigInt(32);function my(r,e=!1){return e?{h:Number(r&rp),l:Number(r>>hy&rp)}:{h:Number(r>>hy&rp)|0,l:Number(r&rp)|0}}Oe.fromBig=my;function z8(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let s=0;s<r.length;s++){let{h:i,l:o}=my(r[s],e);[t[s],n[s]]=[i,o]}return[t,n]}Oe.split=z8;var V8=(r,e)=>BigInt(r>>>0)<<hy|BigInt(e>>>0);Oe.toBig=V8;var K8=(r,e,t)=>r>>>t;Oe.shrSH=K8;var W8=(r,e,t)=>r<<32-t|e>>>t;Oe.shrSL=W8;var J8=(r,e,t)=>r>>>t|e<<32-t;Oe.rotrSH=J8;var Q8=(r,e,t)=>r<<32-t|e>>>t;Oe.rotrSL=Q8;var Y8=(r,e,t)=>r<<64-t|e>>>t-32;Oe.rotrBH=Y8;var Z8=(r,e,t)=>r>>>t-32|e<<64-t;Oe.rotrBL=Z8;var X8=(r,e)=>e;Oe.rotr32H=X8;var e5=(r,e)=>r;Oe.rotr32L=e5;var t5=(r,e,t)=>r<<t|e>>>32-t;Oe.rotlSH=t5;var r5=(r,e,t)=>e<<t|r>>>32-t;Oe.rotlSL=r5;var n5=(r,e,t)=>e<<t-32|r>>>64-t;Oe.rotlBH=n5;var s5=(r,e,t)=>r<<t-32|e>>>64-t;Oe.rotlBL=s5;function i5(r,e,t,n){let s=(e>>>0)+(n>>>0);return{h:r+t+(s/2**32|0)|0,l:s|0}}Oe.add=i5;var o5=(r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0);Oe.add3L=o5;var a5=(r,e,t,n)=>e+t+n+(r/2**32|0)|0;Oe.add3H=a5;var c5=(r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0);Oe.add4L=c5;var u5=(r,e,t,n,s)=>e+t+n+s+(r/2**32|0)|0;Oe.add4H=u5;var l5=(r,e,t,n,s)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(s>>>0);Oe.add5L=l5;var f5=(r,e,t,n,s,i)=>e+t+n+s+i+(r/2**32|0)|0;Oe.add5H=f5;var ZN={fromBig:my,split:z8,toBig:V8,shrSH:K8,shrSL:W8,rotrSH:J8,rotrSL:Q8,rotrBH:Y8,rotrBL:Z8,rotr32H:X8,rotr32L:e5,rotlSH:t5,rotlSL:r5,rotlBH:n5,rotlBL:s5,add:i5,add3L:o5,add3H:a5,add4L:c5,add4H:u5,add5H:f5,add5L:l5};Oe.default=ZN});var d5=M(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.sha384=An.sha512_256=An.sha512_224=An.sha512=An.SHA512=void 0;var XN=X0(),Ue=by(),np=is(),[eI,tI]=(()=>Ue.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))))(),no=new Uint32Array(80),so=new Uint32Array(80),Ba=class extends XN.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:t,Bh:n,Bl:s,Ch:i,Cl:o,Dh:a,Dl:c,Eh:u,El:l,Fh:f,Fl:d,Gh:h,Gl:b,Hh:p,Hl:g}=this;return[e,t,n,s,i,o,a,c,u,l,f,d,h,b,p,g]}set(e,t,n,s,i,o,a,c,u,l,f,d,h,b,p,g){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=s|0,this.Ch=i|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=l|0,this.Fh=f|0,this.Fl=d|0,this.Gh=h|0,this.Gl=b|0,this.Hh=p|0,this.Hl=g|0}process(e,t){for(let E=0;E<16;E++,t+=4)no[E]=e.getUint32(t),so[E]=e.getUint32(t+=4);for(let E=16;E<80;E++){let v=no[E-15]|0,k=so[E-15]|0,w=Ue.default.rotrSH(v,k,1)^Ue.default.rotrSH(v,k,8)^Ue.default.shrSH(v,k,7),P=Ue.default.rotrSL(v,k,1)^Ue.default.rotrSL(v,k,8)^Ue.default.shrSL(v,k,7),B=no[E-2]|0,Z=so[E-2]|0,_=Ue.default.rotrSH(B,Z,19)^Ue.default.rotrBH(B,Z,61)^Ue.default.shrSH(B,Z,6),O=Ue.default.rotrSL(B,Z,19)^Ue.default.rotrBL(B,Z,61)^Ue.default.shrSL(B,Z,6),S=Ue.default.add4L(P,O,so[E-7],so[E-16]),F=Ue.default.add4H(S,w,_,no[E-7],no[E-16]);no[E]=F|0,so[E]=S|0}let{Ah:n,Al:s,Bh:i,Bl:o,Ch:a,Cl:c,Dh:u,Dl:l,Eh:f,El:d,Fh:h,Fl:b,Gh:p,Gl:g,Hh:m,Hl:y}=this;for(let E=0;E<80;E++){let v=Ue.default.rotrSH(f,d,14)^Ue.default.rotrSH(f,d,18)^Ue.default.rotrBH(f,d,41),k=Ue.default.rotrSL(f,d,14)^Ue.default.rotrSL(f,d,18)^Ue.default.rotrBL(f,d,41),w=f&h^~f&p,P=d&b^~d&g,B=Ue.default.add5L(y,k,P,tI[E],so[E]),Z=Ue.default.add5H(B,m,v,w,eI[E],no[E]),_=B|0,O=Ue.default.rotrSH(n,s,28)^Ue.default.rotrBH(n,s,34)^Ue.default.rotrBH(n,s,39),S=Ue.default.rotrSL(n,s,28)^Ue.default.rotrBL(n,s,34)^Ue.default.rotrBL(n,s,39),F=n&i^n&a^i&a,G=s&o^s&c^o&c;m=p|0,y=g|0,p=h|0,g=b|0,h=f|0,b=d|0,{h:f,l:d}=Ue.default.add(u|0,l|0,Z|0,_|0),u=a|0,l=c|0,a=i|0,c=o|0,i=n|0,o=s|0;let R=Ue.default.add3L(_,S,G);n=Ue.default.add3H(R,Z,O,F),s=R|0}({h:n,l:s}=Ue.default.add(this.Ah|0,this.Al|0,n|0,s|0)),{h:i,l:o}=Ue.default.add(this.Bh|0,this.Bl|0,i|0,o|0),{h:a,l:c}=Ue.default.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l}=Ue.default.add(this.Dh|0,this.Dl|0,u|0,l|0),{h:f,l:d}=Ue.default.add(this.Eh|0,this.El|0,f|0,d|0),{h,l:b}=Ue.default.add(this.Fh|0,this.Fl|0,h|0,b|0),{h:p,l:g}=Ue.default.add(this.Gh|0,this.Gl|0,p|0,g|0),{h:m,l:y}=Ue.default.add(this.Hh|0,this.Hl|0,m|0,y|0),this.set(n,s,i,o,a,c,u,l,f,d,h,b,p,g,m,y)}roundClean(){no.fill(0),so.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};An.SHA512=Ba;var gy=class extends Ba{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}},xy=class extends Ba{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},yy=class extends Ba{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}};An.sha512=(0,np.wrapConstructor)(()=>new Ba);An.sha512_224=(0,np.wrapConstructor)(()=>new gy);An.sha512_256=(0,np.wrapConstructor)(()=>new xy);An.sha384=(0,np.wrapConstructor)(()=>new yy)});var hf=M(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.randomBytes=Cs.pbkdf2Sync=Cs.createHmac=Cs.createHash=void 0;var rI=Q0(),nI=ly(),wy=tp(),Ay=d5(),pf=me();function sI(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}var p5=sI(),h5=p5.crypto||p5.msCrypto;function iI(r){switch(r){case"sha256":return wy.sha256.create();case"sha512":return Ay.sha512.create()}(0,pf.assertArgument)(!1,"invalid hashing algorithm name","algorithm",r)}Cs.createHash=iI;function oI(r,e){let t={sha256:wy.sha256,sha512:Ay.sha512}[r];return(0,pf.assertArgument)(t!=null,"invalid hmac algorithm","algorithm",r),rI.hmac.create(t,e)}Cs.createHmac=oI;function aI(r,e,t,n,s){let i={sha256:wy.sha256,sha512:Ay.sha512}[s];return(0,pf.assertArgument)(i!=null,"invalid pbkdf2 algorithm","algorithm",s),(0,nI.pbkdf2)(i,r,e,{c:t,dkLen:n})}Cs.pbkdf2Sync=aI;function cI(r){(0,pf.assert)(h5!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),(0,pf.assertArgument)(Number.isInteger(r)&&r>0&&r<=1024,"invalid length","length",r);let e=new Uint8Array(r);return h5.getRandomValues(e),e}Cs.randomBytes=cI});var x5=M(sp=>{"use strict";Object.defineProperty(sp,"__esModule",{value:!0});sp.computeHmac=void 0;var uI=hf(),Ey=me(),m5=!1,b5=function(r,e,t){return(0,uI.createHmac)(r,e).update(t).digest()},g5=b5;function mf(r,e,t){let n=(0,Ey.getBytes)(e,"key"),s=(0,Ey.getBytes)(t,"data");return(0,Ey.hexlify)(g5(r,n,s))}sp.computeHmac=mf;mf._=b5;mf.lock=function(){m5=!0};mf.register=function(r){if(m5)throw new Error("computeHmac is locked");g5=r};Object.freeze(mf)});var k5=M(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.shake256=dt.shake128=dt.keccak_512=dt.keccak_384=dt.keccak_256=dt.keccak_224=dt.sha3_512=dt.sha3_384=dt.sha3_256=dt.sha3_224=dt.Keccak=dt.keccakP=void 0;var Fc=Mc(),xf=by(),gf=is(),[A5,E5,v5]=[[],[],[]],lI=BigInt(0),bf=BigInt(1),fI=BigInt(2),dI=BigInt(7),pI=BigInt(256),hI=BigInt(113);for(let r=0,e=bf,t=1,n=0;r<24;r++){[t,n]=[n,(2*t+3*n)%5],A5.push(2*(5*n+t)),E5.push((r+1)*(r+2)/2%64);let s=lI;for(let i=0;i<7;i++)e=(e<<bf^(e>>dI)*hI)%pI,e&fI&&(s^=bf<<(bf<<BigInt(i))-bf);v5.push(s)}var[mI,bI]=(0,xf.split)(v5,!0),y5=(r,e,t)=>t>32?(0,xf.rotlBH)(r,e,t):(0,xf.rotlSH)(r,e,t),w5=(r,e,t)=>t>32?(0,xf.rotlBL)(r,e,t):(0,xf.rotlSL)(r,e,t);function T5(r,e=24){let t=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)t[o]=r[o]^r[o+10]^r[o+20]^r[o+30]^r[o+40];for(let o=0;o<10;o+=2){let a=(o+8)%10,c=(o+2)%10,u=t[c],l=t[c+1],f=y5(u,l,1)^t[a],d=w5(u,l,1)^t[a+1];for(let h=0;h<50;h+=10)r[o+h]^=f,r[o+h+1]^=d}let s=r[2],i=r[3];for(let o=0;o<24;o++){let a=E5[o],c=y5(s,i,a),u=w5(s,i,a),l=A5[o];s=r[l],i=r[l+1],r[l]=c,r[l+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)t[a]=r[o+a];for(let a=0;a<10;a++)r[o+a]^=~t[(a+2)%10]&t[(a+4)%10]}r[0]^=mI[n],r[1]^=bI[n]}t.fill(0)}dt.keccakP=T5;var Sa=class extends gf.Hash{constructor(e,t,n,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,Fc.number)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,gf.u32)(this.state)}keccak(){T5(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){(0,Fc.exists)(this);let{blockLen:t,state:n}=this;e=(0,gf.toBytes)(e);let s=e.length;for(let i=0;i<s;){let o=Math.min(t-this.pos,s-i);for(let a=0;a<o;a++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:s}=this;e[n]^=t,(t&128)!==0&&n===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){(0,Fc.exists)(this,!1),(0,Fc.bytes)(e),this.finish();let t=this.state,{blockLen:n}=this;for(let s=0,i=e.length;s<i;){this.posOut>=n&&this.keccak();let o=Math.min(n-this.posOut,i-s);e.set(t.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,Fc.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,Fc.output)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:n,outputLen:s,rounds:i,enableXOF:o}=this;return e||(e=new Sa(t,n,s,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}};dt.Keccak=Sa;var io=(r,e,t)=>(0,gf.wrapConstructor)(()=>new Sa(e,r,t));dt.sha3_224=io(6,144,224/8);dt.sha3_256=io(6,136,256/8);dt.sha3_384=io(6,104,384/8);dt.sha3_512=io(6,72,512/8);dt.keccak_224=io(1,144,224/8);dt.keccak_256=io(1,136,256/8);dt.keccak_384=io(1,104,384/8);dt.keccak_512=io(1,72,512/8);var P5=(r,e,t)=>(0,gf.wrapXOFConstructorWithOpts)((n={})=>new Sa(e,r,n.dkLen===void 0?t:n.dkLen,!0));dt.shake128=P5(31,168,128/8);dt.shake256=P5(31,136,256/8)});var C5=M(ip=>{"use strict";Object.defineProperty(ip,"__esModule",{value:!0});ip.keccak256=void 0;var gI=k5(),B5=me(),S5=!1,O5=function(r){return(0,gI.keccak_256)(r)},_5=O5;function yf(r){let e=(0,B5.getBytes)(r,"data");return(0,B5.hexlify)(_5(e))}ip.keccak256=yf;yf._=O5;yf.lock=function(){S5=!0};yf.register=function(r){if(S5)throw new TypeError("keccak256 is locked");_5=r};Object.freeze(yf)});var M5=M(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.ripemd160=Dc.RIPEMD160=void 0;var xI=X0(),yI=is(),wI=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),I5=Uint8Array.from({length:16},(r,e)=>e),AI=I5.map(r=>(9*r+5)%16),vy=[I5],Ty=[AI];for(let r=0;r<4;r++)for(let e of[vy,Ty])e.push(e[r].map(t=>wI[t]));var R5=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(r=>new Uint8Array(r)),EI=vy.map((r,e)=>r.map(t=>R5[e][t])),vI=Ty.map((r,e)=>r.map(t=>R5[e][t])),TI=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),PI=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),op=(r,e)=>r<<e|r>>>32-e;function N5(r,e,t,n){return r===0?e^t^n:r===1?e&t|~e&n:r===2?(e|~t)^n:r===3?e&n|t&~n:e^(t|~n)}var ap=new Uint32Array(16),cp=class extends xI.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:e,h1:t,h2:n,h3:s,h4:i}=this;return[e,t,n,s,i]}set(e,t,n,s,i){this.h0=e|0,this.h1=t|0,this.h2=n|0,this.h3=s|0,this.h4=i|0}process(e,t){for(let h=0;h<16;h++,t+=4)ap[h]=e.getUint32(t,!0);let n=this.h0|0,s=n,i=this.h1|0,o=i,a=this.h2|0,c=a,u=this.h3|0,l=u,f=this.h4|0,d=f;for(let h=0;h<5;h++){let b=4-h,p=TI[h],g=PI[h],m=vy[h],y=Ty[h],E=EI[h],v=vI[h];for(let k=0;k<16;k++){let w=op(n+N5(h,i,a,u)+ap[m[k]]+p,E[k])+f|0;n=f,f=u,u=op(a,10)|0,a=i,i=w}for(let k=0;k<16;k++){let w=op(s+N5(b,o,c,l)+ap[y[k]]+g,v[k])+d|0;s=d,d=l,l=op(c,10)|0,c=o,o=w}}this.set(this.h1+a+l|0,this.h2+u+d|0,this.h3+f+s|0,this.h4+n+o|0,this.h0+i+c|0)}roundClean(){ap.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}};Dc.RIPEMD160=cp;Dc.ripemd160=(0,yI.wrapConstructor)(()=>new cp)});var D5=M(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});up.ripemd160=void 0;var kI=M5(),L5=me(),j5=!1,U5=function(r){return(0,kI.ripemd160)(r)},F5=U5;function wf(r){let e=(0,L5.getBytes)(r,"data");return(0,L5.hexlify)(F5(e))}up.ripemd160=wf;wf._=U5;wf.lock=function(){j5=!0};wf.register=function(r){if(j5)throw new TypeError("ripemd160 is locked");F5=r};Object.freeze(wf)});var G5=M(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});lp.pbkdf2=void 0;var BI=hf(),Py=me(),H5=!1,$5=function(r,e,t,n,s){return(0,BI.pbkdf2Sync)(r,e,t,n,s)},q5=$5;function Af(r,e,t,n,s){let i=(0,Py.getBytes)(r,"password"),o=(0,Py.getBytes)(e,"salt");return(0,Py.hexlify)(q5(i,o,t,n,s))}lp.pbkdf2=Af;Af._=$5;Af.lock=function(){H5=!0};Af.register=function(r){if(H5)throw new Error("pbkdf2 is locked");q5=r};Object.freeze(Af)});var W5=M(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});fp.randomBytes=void 0;var SI=hf(),z5=!1,V5=function(r){return new Uint8Array((0,SI.randomBytes)(r))},K5=V5;function Ef(r){return K5(r)}fp.randomBytes=Ef;Ef._=V5;Ef.lock=function(){z5=!0};Ef.register=function(r){if(z5)throw new Error("randomBytes is locked");K5=r};Object.freeze(Ef)});var e4=M(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});Gc.scryptAsync=Gc.scrypt=void 0;var Hc=Mc(),Q5=tp(),Y5=ly(),$c=is(),Qe=(r,e)=>r<<e|r>>>32-e;function J5(r,e,t,n,s,i){let o=r[e++]^t[n++],a=r[e++]^t[n++],c=r[e++]^t[n++],u=r[e++]^t[n++],l=r[e++]^t[n++],f=r[e++]^t[n++],d=r[e++]^t[n++],h=r[e++]^t[n++],b=r[e++]^t[n++],p=r[e++]^t[n++],g=r[e++]^t[n++],m=r[e++]^t[n++],y=r[e++]^t[n++],E=r[e++]^t[n++],v=r[e++]^t[n++],k=r[e++]^t[n++],w=o,P=a,B=c,Z=u,_=l,O=f,S=d,F=h,G=b,R=p,L=g,Y=m,oe=y,fe=E,K=v,ae=k;for(let q=0;q<8;q+=2)_^=Qe(w+oe|0,7),G^=Qe(_+w|0,9),oe^=Qe(G+_|0,13),w^=Qe(oe+G|0,18),R^=Qe(O+P|0,7),fe^=Qe(R+O|0,9),P^=Qe(fe+R|0,13),O^=Qe(P+fe|0,18),K^=Qe(L+S|0,7),B^=Qe(K+L|0,9),S^=Qe(B+K|0,13),L^=Qe(S+B|0,18),Z^=Qe(ae+Y|0,7),F^=Qe(Z+ae|0,9),Y^=Qe(F+Z|0,13),ae^=Qe(Y+F|0,18),P^=Qe(w+Z|0,7),B^=Qe(P+w|0,9),Z^=Qe(B+P|0,13),w^=Qe(Z+B|0,18),S^=Qe(O+_|0,7),F^=Qe(S+O|0,9),_^=Qe(F+S|0,13),O^=Qe(_+F|0,18),Y^=Qe(L+R|0,7),G^=Qe(Y+L|0,9),R^=Qe(G+Y|0,13),L^=Qe(R+G|0,18),oe^=Qe(ae+K|0,7),fe^=Qe(oe+ae|0,9),K^=Qe(fe+oe|0,13),ae^=Qe(K+fe|0,18);s[i++]=o+w|0,s[i++]=a+P|0,s[i++]=c+B|0,s[i++]=u+Z|0,s[i++]=l+_|0,s[i++]=f+O|0,s[i++]=d+S|0,s[i++]=h+F|0,s[i++]=b+G|0,s[i++]=p+R|0,s[i++]=g+L|0,s[i++]=m+Y|0,s[i++]=y+oe|0,s[i++]=E+fe|0,s[i++]=v+K|0,s[i++]=k+ae|0}function qc(r,e,t,n,s){let i=n+0,o=n+16*s;for(let a=0;a<16;a++)t[o+a]=r[e+(2*s-1)*16+a];for(let a=0;a<s;a++,i+=16,e+=16)J5(t,o,r,e,t,i),a>0&&(o+=16),J5(t,i,r,e+=16,t,o)}function Z5(r,e,t){let n=(0,$c.checkOpts)({dkLen:32,asyncTick:10,maxmem:1073742848},t),{N:s,r:i,p:o,dkLen:a,asyncTick:c,maxmem:u,onProgress:l}=n;if((0,Hc.number)(s),(0,Hc.number)(i),(0,Hc.number)(o),(0,Hc.number)(a),(0,Hc.number)(c),(0,Hc.number)(u),l!==void 0&&typeof l!="function")throw new Error("progressCb should be function");let f=128*i,d=f/4;if(s<=1||(s&s-1)!==0||s>=2**(f/8)||s>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(o<0||o>(2**32-1)*32/f)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(a<0||a>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");let h=f*(s+o);if(h>u)throw new Error(`Scrypt: parameters too large, ${h} (128 * r * (N + p)) > ${u} (maxmem)`);let b=(0,Y5.pbkdf2)(Q5.sha256,r,e,{c:1,dkLen:f*o}),p=(0,$c.u32)(b),g=(0,$c.u32)(new Uint8Array(f*s)),m=(0,$c.u32)(new Uint8Array(f)),y=()=>{};if(l){let E=2*s*o,v=Math.max(Math.floor(E/1e4),1),k=0;y=()=>{k++,l&&(!(k%v)||k===E)&&l(k/E)}}return{N:s,r:i,p:o,dkLen:a,blockSize32:d,V:g,B32:p,B:b,tmp:m,blockMixCb:y,asyncTick:c}}function X5(r,e,t,n,s){let i=(0,Y5.pbkdf2)(Q5.sha256,r,t,{c:1,dkLen:e});return t.fill(0),n.fill(0),s.fill(0),i}function OI(r,e,t){let{N:n,r:s,p:i,dkLen:o,blockSize32:a,V:c,B32:u,B:l,tmp:f,blockMixCb:d}=Z5(r,e,t);for(let h=0;h<i;h++){let b=a*h;for(let p=0;p<a;p++)c[p]=u[b+p];for(let p=0,g=0;p<n-1;p++)qc(c,g,c,g+=a,s),d();qc(c,(n-1)*a,u,b,s),d();for(let p=0;p<n;p++){let g=u[b+a-16]%n;for(let m=0;m<a;m++)f[m]=u[b+m]^c[g*a+m];qc(f,0,u,b,s),d()}}return X5(r,o,l,c,f)}Gc.scrypt=OI;async function _I(r,e,t){let{N:n,r:s,p:i,dkLen:o,blockSize32:a,V:c,B32:u,B:l,tmp:f,blockMixCb:d,asyncTick:h}=Z5(r,e,t);for(let b=0;b<i;b++){let p=a*b;for(let m=0;m<a;m++)c[m]=u[p+m];let g=0;await(0,$c.asyncLoop)(n-1,h,()=>{qc(c,g,c,g+=a,s),d()}),qc(c,(n-1)*a,u,p,s),d(),await(0,$c.asyncLoop)(n,h,()=>{let m=u[p+a-16]%n;for(let y=0;y<a;y++)f[y]=u[p+y]^c[m*a+y];qc(f,0,u,p,s),d()})}return X5(r,o,l,c,f)}Gc.scryptAsync=_I});var c4=M(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.scryptSync=Vc.scrypt=void 0;var t4=e4(),zc=me(),r4=!1,n4=!1,s4=async function(r,e,t,n,s,i,o){return await(0,t4.scryptAsync)(r,e,{N:t,r:n,p:s,dkLen:i,onProgress:o})},i4=function(r,e,t,n,s,i){return(0,t4.scrypt)(r,e,{N:t,r:n,p:s,dkLen:i})},o4=s4,a4=i4;async function vf(r,e,t,n,s,i,o){let a=(0,zc.getBytes)(r,"passwd"),c=(0,zc.getBytes)(e,"salt");return(0,zc.hexlify)(await o4(a,c,t,n,s,i,o))}Vc.scrypt=vf;vf._=s4;vf.lock=function(){n4=!0};vf.register=function(r){if(n4)throw new Error("scrypt is locked");o4=r};Object.freeze(vf);function Tf(r,e,t,n,s,i){let o=(0,zc.getBytes)(r,"passwd"),a=(0,zc.getBytes)(e,"salt");return(0,zc.hexlify)(a4(o,a,t,n,s,i))}Vc.scryptSync=Tf;Tf._=i4;Tf.lock=function(){r4=!0};Tf.register=function(r){if(r4)throw new Error("scryptSync is locked");a4=r};Object.freeze(Tf)});var b4=M(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});Kc.sha512=Kc.sha256=void 0;var u4=hf(),dp=me(),l4=function(r){return(0,u4.createHash)("sha256").update(r).digest()},f4=function(r){return(0,u4.createHash)("sha512").update(r).digest()},d4=l4,p4=f4,h4=!1,m4=!1;function Wc(r){let e=(0,dp.getBytes)(r,"data");return(0,dp.hexlify)(d4(e))}Kc.sha256=Wc;Wc._=l4;Wc.lock=function(){h4=!0};Wc.register=function(r){if(h4)throw new Error("sha256 is locked");d4=r};Object.freeze(Wc);function pp(r){let e=(0,dp.getBytes)(r,"data");return(0,dp.hexlify)(p4(e))}Kc.sha512=pp;pp._=f4;pp.lock=function(){m4=!0};pp.register=function(r){if(m4)throw new Error("sha512 is locked");p4=r};Object.freeze(Wc)});var Oa=M(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.validateObject=Fe.createHmacDrbg=Fe.bitMask=Fe.bitSet=Fe.bitGet=Fe.bitLen=Fe.utf8ToBytes=Fe.equalBytes=Fe.concatBytes=Fe.ensureBytes=Fe.numberToVarBytesBE=Fe.numberToBytesLE=Fe.numberToBytesBE=Fe.bytesToNumberLE=Fe.bytesToNumberBE=Fe.hexToBytes=Fe.hexToNumber=Fe.numberToHexUnpadded=Fe.bytesToHex=void 0;var x4=BigInt(0),hp=BigInt(1),CI=BigInt(2),mp=r=>r instanceof Uint8Array,NI=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function By(r){if(!mp(r))throw new Error("Uint8Array expected");let e="";for(let t=0;t<r.length;t++)e+=NI[r[t]];return e}Fe.bytesToHex=By;function y4(r){let e=r.toString(16);return e.length&1?`0${e}`:e}Fe.numberToHexUnpadded=y4;function Sy(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}Fe.hexToNumber=Sy;function bp(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let e=r.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let t=new Uint8Array(e/2);for(let n=0;n<t.length;n++){let s=n*2,i=r.slice(s,s+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[n]=o}return t}Fe.hexToBytes=bp;function II(r){return Sy(By(r))}Fe.bytesToNumberBE=II;function RI(r){if(!mp(r))throw new Error("Uint8Array expected");return Sy(By(Uint8Array.from(r).reverse()))}Fe.bytesToNumberLE=RI;function w4(r,e){return bp(r.toString(16).padStart(e*2,"0"))}Fe.numberToBytesBE=w4;function MI(r,e){return w4(r,e).reverse()}Fe.numberToBytesLE=MI;function LI(r){return bp(y4(r))}Fe.numberToVarBytesBE=LI;function jI(r,e,t){let n;if(typeof e=="string")try{n=bp(e)}catch(i){throw new Error(`${r} must be valid hex string, got "${e}". Cause: ${i}`)}else if(mp(e))n=Uint8Array.from(e);else throw new Error(`${r} must be hex string or Uint8Array`);let s=n.length;if(typeof t=="number"&&s!==t)throw new Error(`${r} expected ${t} bytes, got ${s}`);return n}Fe.ensureBytes=jI;function A4(...r){let e=new Uint8Array(r.reduce((n,s)=>n+s.length,0)),t=0;return r.forEach(n=>{if(!mp(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}Fe.concatBytes=A4;function UI(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}Fe.equalBytes=UI;function FI(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}Fe.utf8ToBytes=FI;function DI(r){let e;for(e=0;r>x4;r>>=hp,e+=1);return e}Fe.bitLen=DI;function HI(r,e){return r>>BigInt(e)&hp}Fe.bitGet=HI;var $I=(r,e,t)=>r|(t?hp:x4)<<BigInt(e);Fe.bitSet=$I;var qI=r=>(CI<<BigInt(r-1))-hp;Fe.bitMask=qI;var ky=r=>new Uint8Array(r),g4=r=>Uint8Array.from(r);function GI(r,e,t){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let n=ky(r),s=ky(r),i=0,o=()=>{n.fill(1),s.fill(0),i=0},a=(...f)=>t(s,n,...f),c=(f=ky())=>{s=a(g4([0]),f),n=a(),f.length!==0&&(s=a(g4([1]),f),n=a())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let f=0,d=[];for(;f<e;){n=a();let h=n.slice();d.push(h),f+=n.length}return A4(...d)};return(f,d)=>{o(),c(f);let h;for(;!(h=d(u()));)c();return o(),h}}Fe.createHmacDrbg=GI;var zI={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||r instanceof Uint8Array,isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function VI(r,e,t={}){let n=(s,i,o)=>{let a=zI[i];if(typeof a!="function")throw new Error(`Invalid validator "${i}", expected function`);let c=r[s];if(!(o&&c===void 0)&&!a(c,r))throw new Error(`Invalid param ${String(s)}=${c} (${typeof c}), expected ${i}`)};for(let[s,i]of Object.entries(e))n(s,i,!1);for(let[s,i]of Object.entries(t))n(s,i,!0);return r}Fe.validateObject=VI});var Pf=M(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.mapHashToField=Me.getMinHashLength=Me.getFieldBytesLength=Me.hashToPrivateScalar=Me.FpSqrtEven=Me.FpSqrtOdd=Me.Field=Me.nLength=Me.FpIsSquare=Me.FpDiv=Me.FpInvertBatch=Me.FpPow=Me.validateField=Me.isNegativeLE=Me.FpSqrt=Me.tonelliShanks=Me.invert=Me.pow2=Me.pow=Me.mod=void 0;var sn=Oa(),Wt=BigInt(0),ct=BigInt(1),oo=BigInt(2),KI=BigInt(3),Oy=BigInt(4),E4=BigInt(5),v4=BigInt(8),WI=BigInt(9),JI=BigInt(16);function nn(r,e){let t=r%e;return t>=Wt?t:e+t}Me.mod=nn;function T4(r,e,t){if(t<=Wt||e<Wt)throw new Error("Expected power/modulo > 0");if(t===ct)return Wt;let n=ct;for(;e>Wt;)e&ct&&(n=n*r%t),r=r*r%t,e>>=ct;return n}Me.pow=T4;function QI(r,e,t){let n=r;for(;e-- >Wt;)n*=n,n%=t;return n}Me.pow2=QI;function gp(r,e){if(r===Wt||e<=Wt)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let t=nn(r,e),n=e,s=Wt,i=ct,o=ct,a=Wt;for(;t!==Wt;){let u=n/t,l=n%t,f=s-o*u,d=i-a*u;n=t,t=l,s=o,i=a,o=f,a=d}if(n!==ct)throw new Error("invert: does not exist");return nn(s,e)}Me.invert=gp;function P4(r){let e=(r-ct)/oo,t,n,s;for(t=r-ct,n=0;t%oo===Wt;t/=oo,n++);for(s=oo;s<r&&T4(s,e,r)!==r-ct;s++);if(n===1){let o=(r+ct)/Oy;return function(c,u){let l=c.pow(u,o);if(!c.eql(c.sqr(l),u))throw new Error("Cannot find square root");return l}}let i=(t+ct)/oo;return function(a,c){if(a.pow(c,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let u=n,l=a.pow(a.mul(a.ONE,s),t),f=a.pow(c,i),d=a.pow(c,t);for(;!a.eql(d,a.ONE);){if(a.eql(d,a.ZERO))return a.ZERO;let h=1;for(let p=a.sqr(d);h<u&&!a.eql(p,a.ONE);h++)p=a.sqr(p);let b=a.pow(l,ct<<BigInt(u-h-1));l=a.sqr(b),f=a.mul(f,b),d=a.mul(d,l),u=h}return f}}Me.tonelliShanks=P4;function k4(r){if(r%Oy===KI){let e=(r+ct)/Oy;return function(n,s){let i=n.pow(s,e);if(!n.eql(n.sqr(i),s))throw new Error("Cannot find square root");return i}}if(r%v4===E4){let e=(r-E4)/v4;return function(n,s){let i=n.mul(s,oo),o=n.pow(i,e),a=n.mul(s,o),c=n.mul(n.mul(a,oo),o),u=n.mul(a,n.sub(c,n.ONE));if(!n.eql(n.sqr(u),s))throw new Error("Cannot find square root");return u}}return r%JI,P4(r)}Me.FpSqrt=k4;var YI=(r,e)=>(nn(r,e)&ct)===ct;Me.isNegativeLE=YI;var ZI=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function XI(r){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=ZI.reduce((n,s)=>(n[s]="function",n),e);return(0,sn.validateObject)(r,t)}Me.validateField=XI;function B4(r,e,t){if(t<Wt)throw new Error("Expected power > 0");if(t===Wt)return r.ONE;if(t===ct)return e;let n=r.ONE,s=e;for(;t>Wt;)t&ct&&(n=r.mul(n,s)),s=r.sqr(s),t>>=ct;return n}Me.FpPow=B4;function S4(r,e){let t=new Array(e.length),n=e.reduce((i,o,a)=>r.is0(o)?i:(t[a]=i,r.mul(i,o)),r.ONE),s=r.inv(n);return e.reduceRight((i,o,a)=>r.is0(o)?i:(t[a]=r.mul(i,t[a]),r.mul(i,o)),s),t}Me.FpInvertBatch=S4;function eR(r,e,t){return r.mul(e,typeof t=="bigint"?gp(t,r.ORDER):r.inv(t))}Me.FpDiv=eR;function tR(r){let e=(r.ORDER-ct)/oo;return t=>{let n=r.pow(t,e);return r.eql(n,r.ZERO)||r.eql(n,r.ONE)}}Me.FpIsSquare=tR;function _y(r,e){let t=e!==void 0?e:r.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}Me.nLength=_y;function rR(r,e,t=!1,n={}){if(r<=Wt)throw new Error(`Expected Field ORDER > 0, got ${r}`);let{nBitLength:s,nByteLength:i}=_y(r,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=k4(r),a=Object.freeze({ORDER:r,BITS:s,BYTES:i,MASK:(0,sn.bitMask)(s),ZERO:Wt,ONE:ct,create:c=>nn(c,r),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Wt<=c&&c<r},is0:c=>c===Wt,isOdd:c=>(c&ct)===ct,neg:c=>nn(-c,r),eql:(c,u)=>c===u,sqr:c=>nn(c*c,r),add:(c,u)=>nn(c+u,r),sub:(c,u)=>nn(c-u,r),mul:(c,u)=>nn(c*u,r),pow:(c,u)=>B4(a,c,u),div:(c,u)=>nn(c*gp(u,r),r),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>gp(c,r),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>S4(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>t?(0,sn.numberToBytesLE)(c,i):(0,sn.numberToBytesBE)(c,i),fromBytes:c=>{if(c.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${c.length}`);return t?(0,sn.bytesToNumberLE)(c):(0,sn.bytesToNumberBE)(c)}});return Object.freeze(a)}Me.Field=rR;function nR(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");let t=r.sqrt(e);return r.isOdd(t)?t:r.neg(t)}Me.FpSqrtOdd=nR;function sR(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");let t=r.sqrt(e);return r.isOdd(t)?r.neg(t):t}Me.FpSqrtEven=sR;function iR(r,e,t=!1){r=(0,sn.ensureBytes)("privateHash",r);let n=r.length,s=_y(e).nByteLength+8;if(s<24||n<s||n>1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${n}`);let i=t?(0,sn.bytesToNumberLE)(r):(0,sn.bytesToNumberBE)(r);return nn(i,e-ct)+ct}Me.hashToPrivateScalar=iR;function Cy(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let e=r.toString(2).length;return Math.ceil(e/8)}Me.getFieldBytesLength=Cy;function O4(r){let e=Cy(r);return e+Math.ceil(e/2)}Me.getMinHashLength=O4;function oR(r,e,t=!1){let n=r.length,s=Cy(e),i=O4(e);if(n<16||n<i||n>1024)throw new Error(`expected ${i}-1024 bytes of input, got ${n}`);let o=t?(0,sn.bytesToNumberBE)(r):(0,sn.bytesToNumberLE)(r),a=nn(o,e-ct)+ct;return t?(0,sn.numberToBytesLE)(a,s):(0,sn.numberToBytesBE)(a,s)}Me.mapHashToField=oR});var C4=M(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});Jc.validateBasic=Jc.wNAF=void 0;var _4=Pf(),aR=Oa(),cR=BigInt(0),Ny=BigInt(1);function uR(r,e){let t=(s,i)=>{let o=i.negate();return s?o:i},n=s=>{let i=Math.ceil(e/s)+1,o=2**(s-1);return{windows:i,windowSize:o}};return{constTimeNegate:t,unsafeLadder(s,i){let o=r.ZERO,a=s;for(;i>cR;)i&Ny&&(o=o.add(a)),a=a.double(),i>>=Ny;return o},precomputeWindow(s,i){let{windows:o,windowSize:a}=n(i),c=[],u=s,l=u;for(let f=0;f<o;f++){l=u,c.push(l);for(let d=1;d<a;d++)l=l.add(u),c.push(l);u=l.double()}return c},wNAF(s,i,o){let{windows:a,windowSize:c}=n(s),u=r.ZERO,l=r.BASE,f=BigInt(2**s-1),d=2**s,h=BigInt(s);for(let b=0;b<a;b++){let p=b*c,g=Number(o&f);o>>=h,g>c&&(g-=d,o+=Ny);let m=p,y=p+Math.abs(g)-1,E=b%2!==0,v=g<0;g===0?l=l.add(t(E,i[m])):u=u.add(t(v,i[y]))}return{p:u,f:l}},wNAFCached(s,i,o,a){let c=s._WINDOW_SIZE||1,u=i.get(s);return u||(u=this.precomputeWindow(s,c),c!==1&&i.set(s,a(u))),this.wNAF(c,u,o)}}}Jc.wNAF=uR;function lR(r){return(0,_4.validateField)(r.Fp),(0,aR.validateObject)(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,_4.nLength)(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}Jc.validateBasic=lR});var Ry=M(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.mapToCurveSimpleSWU=Qt.SWUFpSqrtRatio=Qt.weierstrass=Qt.weierstrassPoints=Qt.DER=void 0;var Qc=Pf(),Jt=Oa(),Ns=Oa(),Iy=C4();function fR(r){let e=(0,Iy.validateBasic)(r);Jt.validateObject(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:t,Fp:n,a:s}=e;if(t){if(!n.eql(s,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:dR,hexToBytes:pR}=Jt;Qt.DER={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(r){let{Err:e}=Qt.DER;if(r.length<2||r[0]!==2)throw new e("Invalid signature integer tag");let t=r[1],n=r.subarray(2,t+2);if(!t||n.length!==t)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:dR(n),l:r.subarray(t+2)}},toSig(r){let{Err:e}=Qt.DER,t=typeof r=="string"?pR(r):r;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let n=t.length;if(n<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:s,l:i}=Qt.DER._parseInt(t.subarray(2)),{d:o,l:a}=Qt.DER._parseInt(i);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:s,s:o}},hexFromSig(r){let e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,t=u=>{let l=u.toString(16);return l.length&1?`0${l}`:l},n=e(t(r.s)),s=e(t(r.r)),i=n.length/2,o=s.length/2,a=t(i),c=t(o);return`30${t(o+i+4)}02${c}${s}02${a}${n}`}};var os=BigInt(0),Nt=BigInt(1),ao=BigInt(2),xp=BigInt(3),N4=BigInt(4);function I4(r){let e=fR(r),{Fp:t}=e,n=e.toBytes||((b,p,g)=>{let m=p.toAffine();return Jt.concatBytes(Uint8Array.from([4]),t.toBytes(m.x),t.toBytes(m.y))}),s=e.fromBytes||(b=>{let p=b.subarray(1),g=t.fromBytes(p.subarray(0,t.BYTES)),m=t.fromBytes(p.subarray(t.BYTES,2*t.BYTES));return{x:g,y:m}});function i(b){let{a:p,b:g}=e,m=t.sqr(b),y=t.mul(m,b);return t.add(t.add(y,t.mul(b,p)),g)}if(!t.eql(t.sqr(e.Gy),i(e.Gx)))throw new Error("bad generator point: equation left != right");function o(b){return typeof b=="bigint"&&os<b&&b<e.n}function a(b){if(!o(b))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(b){let{allowedPrivateKeyLengths:p,nByteLength:g,wrapPrivateKey:m,n:y}=e;if(p&&typeof b!="bigint"){if(b instanceof Uint8Array&&(b=Jt.bytesToHex(b)),typeof b!="string"||!p.includes(b.length))throw new Error("Invalid key");b=b.padStart(g*2,"0")}let E;try{E=typeof b=="bigint"?b:Jt.bytesToNumberBE((0,Ns.ensureBytes)("private key",b,g))}catch{throw new Error(`private key must be ${g} bytes, hex or bigint, not ${typeof b}`)}return m&&(E=Qc.mod(E,y)),a(E),E}let u=new Map;function l(b){if(!(b instanceof f))throw new Error("ProjectivePoint expected")}class f{constructor(p,g,m){if(this.px=p,this.py=g,this.pz=m,p==null||!t.isValid(p))throw new Error("x required");if(g==null||!t.isValid(g))throw new Error("y required");if(m==null||!t.isValid(m))throw new Error("z required")}static fromAffine(p){let{x:g,y:m}=p||{};if(!p||!t.isValid(g)||!t.isValid(m))throw new Error("invalid affine point");if(p instanceof f)throw new Error("projective point not allowed");let y=E=>t.eql(E,t.ZERO);return y(g)&&y(m)?f.ZERO:new f(g,m,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){let g=t.invertBatch(p.map(m=>m.pz));return p.map((m,y)=>m.toAffine(g[y])).map(f.fromAffine)}static fromHex(p){let g=f.fromAffine(s((0,Ns.ensureBytes)("pointHex",p)));return g.assertValidity(),g}static fromPrivateKey(p){return f.BASE.multiply(c(p))}_setWindowSize(p){this._WINDOW_SIZE=p,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:p,y:g}=this.toAffine();if(!t.isValid(p)||!t.isValid(g))throw new Error("bad point: x or y not FE");let m=t.sqr(g),y=i(p);if(!t.eql(m,y))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:p}=this.toAffine();if(t.isOdd)return!t.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){l(p);let{px:g,py:m,pz:y}=this,{px:E,py:v,pz:k}=p,w=t.eql(t.mul(g,k),t.mul(E,y)),P=t.eql(t.mul(m,k),t.mul(v,y));return w&&P}negate(){return new f(this.px,t.neg(this.py),this.pz)}double(){let{a:p,b:g}=e,m=t.mul(g,xp),{px:y,py:E,pz:v}=this,k=t.ZERO,w=t.ZERO,P=t.ZERO,B=t.mul(y,y),Z=t.mul(E,E),_=t.mul(v,v),O=t.mul(y,E);return O=t.add(O,O),P=t.mul(y,v),P=t.add(P,P),k=t.mul(p,P),w=t.mul(m,_),w=t.add(k,w),k=t.sub(Z,w),w=t.add(Z,w),w=t.mul(k,w),k=t.mul(O,k),P=t.mul(m,P),_=t.mul(p,_),O=t.sub(B,_),O=t.mul(p,O),O=t.add(O,P),P=t.add(B,B),B=t.add(P,B),B=t.add(B,_),B=t.mul(B,O),w=t.add(w,B),_=t.mul(E,v),_=t.add(_,_),B=t.mul(_,O),k=t.sub(k,B),P=t.mul(_,Z),P=t.add(P,P),P=t.add(P,P),new f(k,w,P)}add(p){l(p);let{px:g,py:m,pz:y}=this,{px:E,py:v,pz:k}=p,w=t.ZERO,P=t.ZERO,B=t.ZERO,Z=e.a,_=t.mul(e.b,xp),O=t.mul(g,E),S=t.mul(m,v),F=t.mul(y,k),G=t.add(g,m),R=t.add(E,v);G=t.mul(G,R),R=t.add(O,S),G=t.sub(G,R),R=t.add(g,y);let L=t.add(E,k);return R=t.mul(R,L),L=t.add(O,F),R=t.sub(R,L),L=t.add(m,y),w=t.add(v,k),L=t.mul(L,w),w=t.add(S,F),L=t.sub(L,w),B=t.mul(Z,R),w=t.mul(_,F),B=t.add(w,B),w=t.sub(S,B),B=t.add(S,B),P=t.mul(w,B),S=t.add(O,O),S=t.add(S,O),F=t.mul(Z,F),R=t.mul(_,R),S=t.add(S,F),F=t.sub(O,F),F=t.mul(Z,F),R=t.add(R,F),O=t.mul(S,R),P=t.add(P,O),O=t.mul(L,R),w=t.mul(G,w),w=t.sub(w,O),O=t.mul(G,S),B=t.mul(L,B),B=t.add(B,O),new f(w,P,B)}subtract(p){return this.add(p.negate())}is0(){return this.equals(f.ZERO)}wNAF(p){return h.wNAFCached(this,u,p,g=>{let m=t.invertBatch(g.map(y=>y.pz));return g.map((y,E)=>y.toAffine(m[E])).map(f.fromAffine)})}multiplyUnsafe(p){let g=f.ZERO;if(p===os)return g;if(a(p),p===Nt)return this;let{endo:m}=e;if(!m)return h.unsafeLadder(this,p);let{k1neg:y,k1:E,k2neg:v,k2:k}=m.splitScalar(p),w=g,P=g,B=this;for(;E>os||k>os;)E&Nt&&(w=w.add(B)),k&Nt&&(P=P.add(B)),B=B.double(),E>>=Nt,k>>=Nt;return y&&(w=w.negate()),v&&(P=P.negate()),P=new f(t.mul(P.px,m.beta),P.py,P.pz),w.add(P)}multiply(p){a(p);let g=p,m,y,{endo:E}=e;if(E){let{k1neg:v,k1:k,k2neg:w,k2:P}=E.splitScalar(g),{p:B,f:Z}=this.wNAF(k),{p:_,f:O}=this.wNAF(P);B=h.constTimeNegate(v,B),_=h.constTimeNegate(w,_),_=new f(t.mul(_.px,E.beta),_.py,_.pz),m=B.add(_),y=Z.add(O)}else{let{p:v,f:k}=this.wNAF(g);m=v,y=k}return f.normalizeZ([m,y])[0]}multiplyAndAddUnsafe(p,g,m){let y=f.BASE,E=(k,w)=>w===os||w===Nt||!k.equals(y)?k.multiplyUnsafe(w):k.multiply(w),v=E(this,g).add(E(p,m));return v.is0()?void 0:v}toAffine(p){let{px:g,py:m,pz:y}=this,E=this.is0();p==null&&(p=E?t.ONE:t.inv(y));let v=t.mul(g,p),k=t.mul(m,p),w=t.mul(y,p);if(E)return{x:t.ZERO,y:t.ZERO};if(!t.eql(w,t.ONE))throw new Error("invZ was invalid");return{x:v,y:k}}isTorsionFree(){let{h:p,isTorsionFree:g}=e;if(p===Nt)return!0;if(g)return g(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:p,clearCofactor:g}=e;return p===Nt?this:g?g(f,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),n(f,this,p)}toHex(p=!0){return Jt.bytesToHex(this.toRawBytes(p))}}f.BASE=new f(e.Gx,e.Gy,t.ONE),f.ZERO=new f(t.ZERO,t.ONE,t.ZERO);let d=e.nBitLength,h=(0,Iy.wNAF)(f,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:i,isWithinCurveOrder:o}}Qt.weierstrassPoints=I4;function hR(r){let e=(0,Iy.validateBasic)(r);return Jt.validateObject(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function mR(r){let e=hR(r),{Fp:t,n}=e,s=t.BYTES+1,i=2*t.BYTES+1;function o(R){return os<R&&R<t.ORDER}function a(R){return Qc.mod(R,n)}function c(R){return Qc.invert(R,n)}let{ProjectivePoint:u,normPrivateKeyToScalar:l,weierstrassEquation:f,isWithinCurveOrder:d}=I4({...e,toBytes(R,L,Y){let oe=L.toAffine(),fe=t.toBytes(oe.x),K=Jt.concatBytes;return Y?K(Uint8Array.from([L.hasEvenY()?2:3]),fe):K(Uint8Array.from([4]),fe,t.toBytes(oe.y))},fromBytes(R){let L=R.length,Y=R[0],oe=R.subarray(1);if(L===s&&(Y===2||Y===3)){let fe=Jt.bytesToNumberBE(oe);if(!o(fe))throw new Error("Point is not on curve");let K=f(fe),ae=t.sqrt(K),q=(ae&Nt)===Nt;return(Y&1)===1!==q&&(ae=t.neg(ae)),{x:fe,y:ae}}else if(L===i&&Y===4){let fe=t.fromBytes(oe.subarray(0,t.BYTES)),K=t.fromBytes(oe.subarray(t.BYTES,2*t.BYTES));return{x:fe,y:K}}else throw new Error(`Point of length ${L} was invalid. Expected ${s} compressed bytes or ${i} uncompressed bytes`)}}),h=R=>Jt.bytesToHex(Jt.numberToBytesBE(R,e.nByteLength));function b(R){let L=n>>Nt;return R>L}function p(R){return b(R)?a(-R):R}let g=(R,L,Y)=>Jt.bytesToNumberBE(R.slice(L,Y));class m{constructor(L,Y,oe){this.r=L,this.s=Y,this.recovery=oe,this.assertValidity()}static fromCompact(L){let Y=e.nByteLength;return L=(0,Ns.ensureBytes)("compactSignature",L,Y*2),new m(g(L,0,Y),g(L,Y,2*Y))}static fromDER(L){let{r:Y,s:oe}=Qt.DER.toSig((0,Ns.ensureBytes)("DER",L));return new m(Y,oe)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(L){return new m(this.r,this.s,L)}recoverPublicKey(L){let{r:Y,s:oe,recovery:fe}=this,K=P((0,Ns.ensureBytes)("msgHash",L));if(fe==null||![0,1,2,3].includes(fe))throw new Error("recovery id invalid");let ae=fe===2||fe===3?Y+e.n:Y;if(ae>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");let q=(fe&1)===0?"02":"03",I=u.fromHex(q+h(ae)),ye=c(ae),st=a(-K*ye),Ke=a(oe*ye),We=u.BASE.multiplyAndAddUnsafe(I,st,Ke);if(!We)throw new Error("point at infinify");return We.assertValidity(),We}hasHighS(){return b(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Jt.hexToBytes(this.toDERHex())}toDERHex(){return Qt.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Jt.hexToBytes(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}let y={isValidPrivateKey(R){try{return l(R),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{let R=Qc.getMinHashLength(e.n);return Qc.mapHashToField(e.randomBytes(R),e.n)},precompute(R=8,L=u.BASE){return L._setWindowSize(R),L.multiply(BigInt(3)),L}};function E(R,L=!0){return u.fromPrivateKey(R).toRawBytes(L)}function v(R){let L=R instanceof Uint8Array,Y=typeof R=="string",oe=(L||Y)&&R.length;return L?oe===s||oe===i:Y?oe===2*s||oe===2*i:R instanceof u}function k(R,L,Y=!0){if(v(R))throw new Error("first arg must be private key");if(!v(L))throw new Error("second arg must be public key");return u.fromHex(L).multiply(l(R)).toRawBytes(Y)}let w=e.bits2int||function(R){let L=Jt.bytesToNumberBE(R),Y=R.length*8-e.nBitLength;return Y>0?L>>BigInt(Y):L},P=e.bits2int_modN||function(R){return a(w(R))},B=Jt.bitMask(e.nBitLength);function Z(R){if(typeof R!="bigint")throw new Error("bigint expected");if(!(os<=R&&R<B))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Jt.numberToBytesBE(R,e.nByteLength)}function _(R,L,Y=O){if(["recovered","canonical"].some(j=>j in Y))throw new Error("sign() legacy options not supported");let{hash:oe,randomBytes:fe}=e,{lowS:K,prehash:ae,extraEntropy:q}=Y;K==null&&(K=!0),R=(0,Ns.ensureBytes)("msgHash",R),ae&&(R=(0,Ns.ensureBytes)("prehashed msgHash",oe(R)));let I=P(R),ye=l(L),st=[Z(ye),Z(I)];if(q!=null){let j=q===!0?fe(t.BYTES):q;st.push((0,Ns.ensureBytes)("extraEntropy",j))}let Ke=Jt.concatBytes(...st),We=I;function D(j){let N=w(j);if(!d(N))return;let ee=c(N),ce=u.BASE.multiply(N).toAffine(),he=a(ce.x);if(he===os)return;let xe=a(ee*a(We+he*ye));if(xe===os)return;let V=(ce.x===he?0:2)|Number(ce.y&Nt),te=xe;return K&&b(xe)&&(te=p(xe),V^=1),new m(he,te,V)}return{seed:Ke,k2sig:D}}let O={lowS:e.lowS,prehash:!1},S={lowS:e.lowS,prehash:!1};function F(R,L,Y=O){let{seed:oe,k2sig:fe}=_(R,L,Y),K=e;return Jt.createHmacDrbg(K.hash.outputLen,K.nByteLength,K.hmac)(oe,fe)}u.BASE._setWindowSize(8);function G(R,L,Y,oe=S){let fe=R;if(L=(0,Ns.ensureBytes)("msgHash",L),Y=(0,Ns.ensureBytes)("publicKey",Y),"strict"in oe)throw new Error("options.strict was renamed to lowS");let{lowS:K,prehash:ae}=oe,q,I;try{if(typeof fe=="string"||fe instanceof Uint8Array)try{q=m.fromDER(fe)}catch(ce){if(!(ce instanceof Qt.DER.Err))throw ce;q=m.fromCompact(fe)}else if(typeof fe=="object"&&typeof fe.r=="bigint"&&typeof fe.s=="bigint"){let{r:ce,s:he}=fe;q=new m(ce,he)}else throw new Error("PARSE");I=u.fromHex(Y)}catch(ce){if(ce.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(K&&q.hasHighS())return!1;ae&&(L=e.hash(L));let{r:ye,s:st}=q,Ke=P(L),We=c(st),D=a(Ke*We),j=a(ye*We),N=u.BASE.multiplyAndAddUnsafe(I,D,j)?.toAffine();return N?a(N.x)===ye:!1}return{CURVE:e,getPublicKey:E,getSharedSecret:k,sign:F,verify:G,ProjectivePoint:u,Signature:m,utils:y}}Qt.weierstrass=mR;function R4(r,e){let t=r.ORDER,n=os;for(let b=t-Nt;b%ao===os;b/=ao)n+=Nt;let s=n,i=ao<<s-Nt-Nt,o=i*ao,a=(t-Nt)/o,c=(a-Nt)/ao,u=o-Nt,l=i,f=r.pow(e,a),d=r.pow(e,(a+Nt)/ao),h=(b,p)=>{let g=f,m=r.pow(p,u),y=r.sqr(m);y=r.mul(y,p);let E=r.mul(b,y);E=r.pow(E,c),E=r.mul(E,m),m=r.mul(E,p),y=r.mul(E,b);let v=r.mul(y,m);E=r.pow(v,l);let k=r.eql(E,r.ONE);m=r.mul(y,d),E=r.mul(v,g),y=r.cmov(m,y,k),v=r.cmov(E,v,k);for(let w=s;w>Nt;w--){let P=w-ao;P=ao<<P-Nt;let B=r.pow(v,P),Z=r.eql(B,r.ONE);m=r.mul(y,g),g=r.mul(g,g),B=r.mul(v,g),y=r.cmov(m,y,Z),v=r.cmov(B,v,Z)}return{isValid:k,value:y}};if(r.ORDER%N4===xp){let b=(r.ORDER-xp)/N4,p=r.sqrt(r.neg(e));h=(g,m)=>{let y=r.sqr(m),E=r.mul(g,m);y=r.mul(y,E);let v=r.pow(y,b);v=r.mul(v,E);let k=r.mul(v,p),w=r.mul(r.sqr(v),m),P=r.eql(w,g),B=r.cmov(k,v,P);return{isValid:P,value:B}}}return h}Qt.SWUFpSqrtRatio=R4;function bR(r,e){if(Qc.validateField(r),!r.isValid(e.A)||!r.isValid(e.B)||!r.isValid(e.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");let t=R4(r,e.Z);if(!r.isOdd)throw new Error("Fp.isOdd is not implemented!");return n=>{let s,i,o,a,c,u,l,f;s=r.sqr(n),s=r.mul(s,e.Z),i=r.sqr(s),i=r.add(i,s),o=r.add(i,r.ONE),o=r.mul(o,e.B),a=r.cmov(e.Z,r.neg(i),!r.eql(i,r.ZERO)),a=r.mul(a,e.A),i=r.sqr(o),u=r.sqr(a),c=r.mul(u,e.A),i=r.add(i,c),i=r.mul(i,o),u=r.mul(u,a),c=r.mul(u,e.B),i=r.add(i,c),l=r.mul(s,o);let{isValid:d,value:h}=t(i,u);f=r.mul(s,n),f=r.mul(f,h),l=r.cmov(l,o,d),f=r.cmov(f,h,d);let b=r.isOdd(n)===r.isOdd(f);return f=r.cmov(r.neg(f),f,b),l=r.div(l,a),{x:l,y:f}}}Qt.mapToCurveSimpleSWU=bR});var j4=M(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.createHasher=En.isogenyMap=En.hash_to_field=En.expand_message_xof=En.expand_message_xmd=void 0;var gR=Pf(),as=Oa();function xR(r){if(r instanceof Uint8Array)return r;if(typeof r=="string")return(0,as.utf8ToBytes)(r);throw new Error("DST must be Uint8Array or string")}var yR=as.bytesToNumberBE;function co(r,e){if(r<0||r>=1<<8*e)throw new Error(`bad I2OSP call: value=${r} length=${e}`);let t=Array.from({length:e}).fill(0);for(let n=e-1;n>=0;n--)t[n]=r&255,r>>>=8;return new Uint8Array(t)}function wR(r,e){let t=new Uint8Array(r.length);for(let n=0;n<r.length;n++)t[n]=r[n]^e[n];return t}function kf(r){if(!(r instanceof Uint8Array))throw new Error("Uint8Array expected")}function Ly(r){if(!Number.isSafeInteger(r))throw new Error("number expected")}function M4(r,e,t,n){kf(r),kf(e),Ly(t),e.length>255&&(e=n((0,as.concatBytes)((0,as.utf8ToBytes)("H2C-OVERSIZE-DST-"),e)));let{outputLen:s,blockLen:i}=n,o=Math.ceil(t/s);if(o>255)throw new Error("Invalid xmd length");let a=(0,as.concatBytes)(e,co(e.length,1)),c=co(0,i),u=co(t,2),l=new Array(o),f=n((0,as.concatBytes)(c,r,u,co(0,1),a));l[0]=n((0,as.concatBytes)(f,co(1,1),a));for(let h=1;h<=o;h++){let b=[wR(f,l[h-1]),co(h+1,1),a];l[h]=n((0,as.concatBytes)(...b))}return(0,as.concatBytes)(...l).slice(0,t)}En.expand_message_xmd=M4;function L4(r,e,t,n,s){if(kf(r),kf(e),Ly(t),e.length>255){let i=Math.ceil(2*n/8);e=s.create({dkLen:i}).update((0,as.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(e).digest()}if(t>65535||e.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return s.create({dkLen:t}).update(r).update(co(t,2)).update(e).update(co(e.length,1)).digest()}En.expand_message_xof=L4;function My(r,e,t){(0,as.validateObject)(t,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:n,k:s,m:i,hash:o,expand:a,DST:c}=t;kf(r),Ly(e);let u=xR(c),l=n.toString(2).length,f=Math.ceil((l+s)/8),d=e*i*f,h;if(a==="xmd")h=M4(r,u,d,o);else if(a==="xof")h=L4(r,u,d,s,o);else if(a==="_internal_pass")h=r;else throw new Error('expand must be "xmd" or "xof"');let b=new Array(e);for(let p=0;p<e;p++){let g=new Array(i);for(let m=0;m<i;m++){let y=f*(m+p*i),E=h.subarray(y,y+f);g[m]=(0,gR.mod)(yR(E),n)}b[p]=g}return b}En.hash_to_field=My;function AR(r,e){let t=e.map(n=>Array.from(n).reverse());return(n,s)=>{let[i,o,a,c]=t.map(u=>u.reduce((l,f)=>r.add(r.mul(l,n),f)));return n=r.div(i,o),s=r.mul(s,r.div(a,c)),{x:n,y:s}}}En.isogenyMap=AR;function ER(r,e,t){if(typeof e!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(n,s){let i=My(n,2,{...t,DST:t.DST,...s}),o=r.fromAffine(e(i[0])),a=r.fromAffine(e(i[1])),c=o.add(a).clearCofactor();return c.assertValidity(),c},encodeToCurve(n,s){let i=My(n,1,{...t,DST:t.encodeDST,...s}),o=r.fromAffine(e(i[0])).clearCofactor();return o.assertValidity(),o}}}En.createHasher=ER});var D4=M(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.createCurve=Yc.getHash=void 0;var vR=Q0(),U4=is(),TR=Ry();function F4(r){return{hash:r,hmac:(e,...t)=>(0,vR.hmac)(r,e,(0,U4.concatBytes)(...t)),randomBytes:U4.randomBytes}}Yc.getHash=F4;function PR(r,e){let t=n=>(0,TR.weierstrass)({...r,...F4(n)});return Object.freeze({...t(e),create:t})}Yc.createCurve=PR});var Y4=M($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.encodeToCurve=$r.hashToCurve=$r.schnorr=$r.secp256k1=void 0;var yp=tp(),kR=is(),rr=Pf(),BR=Ry(),br=Oa(),q4=j4(),SR=D4(),vp=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),wp=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),G4=BigInt(1),Ap=BigInt(2),H4=(r,e)=>(r+e/Ap)/e;function z4(r){let e=vp,t=BigInt(3),n=BigInt(6),s=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),u=r*r*r%e,l=u*u*r%e,f=(0,rr.pow2)(l,t,e)*l%e,d=(0,rr.pow2)(f,t,e)*l%e,h=(0,rr.pow2)(d,Ap,e)*u%e,b=(0,rr.pow2)(h,s,e)*h%e,p=(0,rr.pow2)(b,i,e)*b%e,g=(0,rr.pow2)(p,a,e)*p%e,m=(0,rr.pow2)(g,c,e)*g%e,y=(0,rr.pow2)(m,a,e)*p%e,E=(0,rr.pow2)(y,t,e)*l%e,v=(0,rr.pow2)(E,o,e)*b%e,k=(0,rr.pow2)(v,n,e)*u%e,w=(0,rr.pow2)(k,Ap,e);if(!uo.eql(uo.sqr(w),r))throw new Error("Cannot find square root");return w}var uo=(0,rr.Field)(vp,void 0,void 0,{sqrt:z4});$r.secp256k1=(0,SR.createCurve)({a:BigInt(0),b:BigInt(7),Fp:uo,n:wp,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let e=wp,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-G4*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=t,o=BigInt("0x100000000000000000000000000000000"),a=H4(i*r,e),c=H4(-n*r,e),u=(0,rr.mod)(r-a*t-c*s,e),l=(0,rr.mod)(-a*n-c*i,e),f=u>o,d=l>o;if(f&&(u=e-u),d&&(l=e-l),u>o||l>o)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:f,k1:u,k2neg:d,k2:l}}}},yp.sha256);var Tp=BigInt(0),V4=r=>typeof r=="bigint"&&Tp<r&&r<vp,OR=r=>typeof r=="bigint"&&Tp<r&&r<wp,$4={};function Ep(r,...e){let t=$4[r];if(t===void 0){let n=(0,yp.sha256)(Uint8Array.from(r,s=>s.charCodeAt(0)));t=(0,br.concatBytes)(n,n),$4[r]=t}return(0,yp.sha256)((0,br.concatBytes)(t,...e))}var Dy=r=>r.toRawBytes(!0).slice(1),Uy=r=>(0,br.numberToBytesBE)(r,32),jy=r=>(0,rr.mod)(r,vp),Bf=r=>(0,rr.mod)(r,wp),Hy=$r.secp256k1.ProjectivePoint,_R=(r,e,t)=>Hy.BASE.multiplyAndAddUnsafe(r,e,t);function Fy(r){let e=$r.secp256k1.utils.normPrivateKeyToScalar(r),t=Hy.fromPrivateKey(e);return{scalar:t.hasEvenY()?e:Bf(-e),bytes:Dy(t)}}function K4(r){if(!V4(r))throw new Error("bad x: need 0 < x < p");let e=jy(r*r),t=jy(e*r+BigInt(7)),n=z4(t);n%Ap!==Tp&&(n=jy(-n));let s=new Hy(r,n,G4);return s.assertValidity(),s}function W4(...r){return Bf((0,br.bytesToNumberBE)(Ep("BIP0340/challenge",...r)))}function CR(r){return Fy(r).bytes}function NR(r,e,t=(0,kR.randomBytes)(32)){let n=(0,br.ensureBytes)("message",r),{bytes:s,scalar:i}=Fy(e),o=(0,br.ensureBytes)("auxRand",t,32),a=Uy(i^(0,br.bytesToNumberBE)(Ep("BIP0340/aux",o))),c=Ep("BIP0340/nonce",a,s,n),u=Bf((0,br.bytesToNumberBE)(c));if(u===Tp)throw new Error("sign failed: k is zero");let{bytes:l,scalar:f}=Fy(u),d=W4(l,s,n),h=new Uint8Array(64);if(h.set(l,0),h.set(Uy(Bf(f+d*i)),32),!J4(h,n,s))throw new Error("sign: Invalid signature produced");return h}function J4(r,e,t){let n=(0,br.ensureBytes)("signature",r,64),s=(0,br.ensureBytes)("message",e),i=(0,br.ensureBytes)("publicKey",t,32);try{let o=K4((0,br.bytesToNumberBE)(i)),a=(0,br.bytesToNumberBE)(n.subarray(0,32));if(!V4(a))return!1;let c=(0,br.bytesToNumberBE)(n.subarray(32,64));if(!OR(c))return!1;let u=W4(Uy(a),Dy(o),s),l=_R(o,c,Bf(-u));return!(!l||!l.hasEvenY()||l.toAffine().x!==a)}catch{return!1}}$r.schnorr=(()=>({getPublicKey:CR,sign:NR,verify:J4,utils:{randomPrivateKey:$r.secp256k1.utils.randomPrivateKey,lift_x:K4,pointToBytes:Dy,numberToBytesBE:br.numberToBytesBE,bytesToNumberBE:br.bytesToNumberBE,taggedHash:Ep,mod:rr.mod}}))();var IR=(()=>(0,q4.isogenyMap)(uo,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(r=>r.map(e=>BigInt(e)))))(),RR=(()=>(0,BR.mapToCurveSimpleSWU)(uo,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:uo.create(BigInt("-11"))}))(),Q4=(()=>(0,q4.createHasher)($r.secp256k1.ProjectivePoint,r=>{let{x:e,y:t}=RR(uo.create(r[0]));return IR(e,t)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:uo.ORDER,m:1,k:128,expand:"xmd",hash:yp.sha256}))();$r.hashToCurve=(()=>Q4.hashToCurve)();$r.encodeToCurve=(()=>Q4.encodeToCurve)()});var $y=M(Pp=>{"use strict";Object.defineProperty(Pp,"__esModule",{value:!0});Pp.ZeroAddress=void 0;Pp.ZeroAddress="0x0000000000000000000000000000000000000000"});var Z4=M(kp=>{"use strict";Object.defineProperty(kp,"__esModule",{value:!0});kp.ZeroHash=void 0;kp.ZeroHash="0x0000000000000000000000000000000000000000000000000000000000000000"});var X4=M(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.MaxInt256=vn.MinInt256=vn.MaxUint256=vn.WeiPerEther=vn.N=void 0;vn.N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");vn.WeiPerEther=BigInt("1000000000000000000");vn.MaxUint256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");vn.MinInt256=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1);vn.MaxInt256=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")});var ev=M(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.MessagePrefix=Zc.EtherSymbol=void 0;Zc.EtherSymbol="\u039E";Zc.MessagePrefix=`Ethereum Signed Message:
|
|
758
|
+
`});var Xc=M(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.MessagePrefix=Ht.EtherSymbol=Ht.MaxInt256=Ht.MinInt256=Ht.MaxUint256=Ht.WeiPerEther=Ht.N=Ht.ZeroHash=Ht.ZeroAddress=void 0;var MR=$y();Object.defineProperty(Ht,"ZeroAddress",{enumerable:!0,get:function(){return MR.ZeroAddress}});var LR=Z4();Object.defineProperty(Ht,"ZeroHash",{enumerable:!0,get:function(){return LR.ZeroHash}});var Sf=X4();Object.defineProperty(Ht,"N",{enumerable:!0,get:function(){return Sf.N}});Object.defineProperty(Ht,"WeiPerEther",{enumerable:!0,get:function(){return Sf.WeiPerEther}});Object.defineProperty(Ht,"MaxUint256",{enumerable:!0,get:function(){return Sf.MaxUint256}});Object.defineProperty(Ht,"MinInt256",{enumerable:!0,get:function(){return Sf.MinInt256}});Object.defineProperty(Ht,"MaxInt256",{enumerable:!0,get:function(){return Sf.MaxInt256}});var tv=ev();Object.defineProperty(Ht,"EtherSymbol",{enumerable:!0,get:function(){return tv.EtherSymbol}});Object.defineProperty(Ht,"MessagePrefix",{enumerable:!0,get:function(){return tv.MessagePrefix}})});var qy=M(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});Sp.Signature=void 0;var rv=Xc(),ze=me(),nv=BigInt(0),sv=BigInt(1),iv=BigInt(2),ov=BigInt(27),av=BigInt(28),Bp=BigInt(35),eu={};function cv(r){return(0,ze.zeroPadValue)((0,ze.toBeArray)(r),32)}var on=class{#e;#t;#r;#n;get r(){return this.#e}set r(e){(0,ze.assertArgument)((0,ze.dataLength)(e)===32,"invalid r","value",e),this.#e=(0,ze.hexlify)(e)}get s(){return this.#t}set s(e){(0,ze.assertArgument)((0,ze.dataLength)(e)===32,"invalid s","value",e);let t=(0,ze.hexlify)(e);(0,ze.assertArgument)(parseInt(t.substring(0,3))<8,"non-canonical s","value",t),this.#t=t}get v(){return this.#r}set v(e){let t=(0,ze.getNumber)(e,"value");(0,ze.assertArgument)(t===27||t===28,"invalid v","v",e),this.#r=t}get networkV(){return this.#n}get legacyChainId(){let e=this.networkV;return e==null?null:on.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){let e=(0,ze.getBytes)(this.s);return this.yParity&&(e[0]|=128),(0,ze.hexlify)(e)}get compactSerialized(){return(0,ze.concat)([this.r,this.yParityAndS])}get serialized(){return(0,ze.concat)([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,t,n,s){(0,ze.assertPrivate)(e,eu,"Signature"),this.#e=t,this.#t=n,this.#r=s,this.#n=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){let e=new on(eu,this.r,this.s,this.v);return this.networkV&&(e.#n=this.networkV),e}toJSON(){let e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){let t=(0,ze.getBigInt)(e,"v");return t==ov||t==av?nv:((0,ze.assertArgument)(t>=Bp,"invalid EIP-155 v","v",e),(t-Bp)/iv)}static getChainIdV(e,t){return(0,ze.getBigInt)(e)*iv+BigInt(35+t-27)}static getNormalizedV(e){let t=(0,ze.getBigInt)(e);return t===nv||t===ov?27:t===sv||t===av?28:((0,ze.assertArgument)(t>=Bp,"invalid v","v",e),t&sv?27:28)}static from(e){function t(u,l){(0,ze.assertArgument)(u,l,"signature",e)}if(e==null)return new on(eu,rv.ZeroHash,rv.ZeroHash,27);if(typeof e=="string"){let u=(0,ze.getBytes)(e,"signature");if(u.length===64){let l=(0,ze.hexlify)(u.slice(0,32)),f=u.slice(32,64),d=f[0]&128?28:27;return f[0]&=127,new on(eu,l,(0,ze.hexlify)(f),d)}if(u.length===65){let l=(0,ze.hexlify)(u.slice(0,32)),f=u.slice(32,64);t((f[0]&128)===0,"non-canonical s");let d=on.getNormalizedV(u[64]);return new on(eu,l,(0,ze.hexlify)(f),d)}t(!1,"invalid raw signature length")}if(e instanceof on)return e.clone();let n=e.r;t(n!=null,"missing r");let s=cv(n),i=function(u,l){if(u!=null)return cv(u);if(l!=null){t((0,ze.isHexString)(l,32),"invalid yParityAndS");let f=(0,ze.getBytes)(l);return f[0]&=127,(0,ze.hexlify)(f)}t(!1,"missing s")}(e.s,e.yParityAndS);t(((0,ze.getBytes)(i)[0]&128)==0,"non-canonical s");let{networkV:o,v:a}=function(u,l,f){if(u!=null){let d=(0,ze.getBigInt)(u);return{networkV:d>=Bp?d:void 0,v:on.getNormalizedV(d)}}if(l!=null)return t((0,ze.isHexString)(l,32),"invalid yParityAndS"),{v:(0,ze.getBytes)(l)[0]&128?28:27};if(f!=null){switch((0,ze.getNumber)(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),c=new on(eu,s,i,a);return o&&(c.#n=o),t(e.yParity==null||(0,ze.getNumber)(e.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),t(e.yParityAndS==null||e.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}};Sp.Signature=on});var lv=M(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});Op.SigningKey=void 0;var _a=Y4(),Lt=me(),uv=qy(),mi=class{#e;constructor(e){(0,Lt.assertArgument)((0,Lt.dataLength)(e)===32,"invalid private key","privateKey","[REDACTED]"),this.#e=(0,Lt.hexlify)(e)}get privateKey(){return this.#e}get publicKey(){return mi.computePublicKey(this.#e)}get compressedPublicKey(){return mi.computePublicKey(this.#e,!0)}sign(e){(0,Lt.assertArgument)((0,Lt.dataLength)(e)===32,"invalid digest length","digest",e);let t=_a.secp256k1.sign((0,Lt.getBytesCopy)(e),(0,Lt.getBytesCopy)(this.#e),{lowS:!0});return uv.Signature.from({r:(0,Lt.toBeHex)(t.r,32),s:(0,Lt.toBeHex)(t.s,32),v:t.recovery?28:27})}computeSharedSecret(e){let t=mi.computePublicKey(e);return(0,Lt.hexlify)(_a.secp256k1.getSharedSecret((0,Lt.getBytesCopy)(this.#e),(0,Lt.getBytes)(t),!1))}static computePublicKey(e,t){let n=(0,Lt.getBytes)(e,"key");if(n.length===32){let i=_a.secp256k1.getPublicKey(n,!!t);return(0,Lt.hexlify)(i)}if(n.length===64){let i=new Uint8Array(65);i[0]=4,i.set(n,1),n=i}let s=_a.secp256k1.ProjectivePoint.fromHex(n);return(0,Lt.hexlify)(s.toRawBytes(t))}static recoverPublicKey(e,t){(0,Lt.assertArgument)((0,Lt.dataLength)(e)===32,"invalid digest length","digest",e);let n=uv.Signature.from(t),s=_a.secp256k1.Signature.fromCompact((0,Lt.getBytesCopy)((0,Lt.concat)([n.r,n.s])));s=s.addRecoveryBit(n.yParity);let i=s.recoverPublicKey((0,Lt.getBytesCopy)(e));return(0,Lt.assertArgument)(i!=null,"invalid signautre for digest","signature",t),"0x"+i.toHex(!1)}static addPoints(e,t,n){let s=_a.secp256k1.ProjectivePoint.fromHex(mi.computePublicKey(e).substring(2)),i=_a.secp256k1.ProjectivePoint.fromHex(mi.computePublicKey(t).substring(2));return"0x"+s.add(i).toHex(!!n)}};Op.SigningKey=mi});var nr=M(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.lock=pt.Signature=pt.SigningKey=pt.scryptSync=pt.scrypt=pt.pbkdf2=pt.sha512=pt.sha256=pt.ripemd160=pt.keccak256=pt.randomBytes=pt.computeHmac=void 0;var fv=x5();Object.defineProperty(pt,"computeHmac",{enumerable:!0,get:function(){return fv.computeHmac}});var dv=C5();Object.defineProperty(pt,"keccak256",{enumerable:!0,get:function(){return dv.keccak256}});var pv=D5();Object.defineProperty(pt,"ripemd160",{enumerable:!0,get:function(){return pv.ripemd160}});var hv=G5();Object.defineProperty(pt,"pbkdf2",{enumerable:!0,get:function(){return hv.pbkdf2}});var Gy=W5();Object.defineProperty(pt,"randomBytes",{enumerable:!0,get:function(){return Gy.randomBytes}});var _p=c4();Object.defineProperty(pt,"scrypt",{enumerable:!0,get:function(){return _p.scrypt}});Object.defineProperty(pt,"scryptSync",{enumerable:!0,get:function(){return _p.scryptSync}});var Cp=b4();Object.defineProperty(pt,"sha256",{enumerable:!0,get:function(){return Cp.sha256}});Object.defineProperty(pt,"sha512",{enumerable:!0,get:function(){return Cp.sha512}});var jR=lv();Object.defineProperty(pt,"SigningKey",{enumerable:!0,get:function(){return jR.SigningKey}});var UR=qy();Object.defineProperty(pt,"Signature",{enumerable:!0,get:function(){return UR.Signature}});function FR(){fv.computeHmac.lock(),dv.keccak256.lock(),hv.pbkdf2.lock(),Gy.randomBytes.lock(),pv.ripemd160.lock(),_p.scrypt.lock(),_p.scryptSync.lock(),Cp.sha256.lock(),Cp.sha512.lock(),Gy.randomBytes.lock()}pt.lock=FR});var Np=M(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.getIcapAddress=tu.getAddress=void 0;var DR=nr(),Of=me(),HR=BigInt(0),$R=BigInt(36);function mv(r){r=r.toLowerCase();let e=r.substring(2).split(""),t=new Uint8Array(40);for(let s=0;s<40;s++)t[s]=e[s].charCodeAt(0);let n=(0,Of.getBytes)((0,DR.keccak256)(t));for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(n[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return"0x"+e.join("")}var zy={};for(let r=0;r<10;r++)zy[String(r)]=String(r);for(let r=0;r<26;r++)zy[String.fromCharCode(65+r)]=String(10+r);var bv=15;function gv(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(n=>zy[n]).join("");for(;e.length>=bv;){let n=e.substring(0,bv);e=parseInt(n,10)%97+e.substring(n.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}var qR=function(){let r={};for(let e=0;e<36;e++){let t="0123456789abcdefghijklmnopqrstuvwxyz"[e];r[t]=BigInt(e)}return r}();function GR(r){r=r.toLowerCase();let e=HR;for(let t=0;t<r.length;t++)e=e*$R+qR[r[t]];return e}function xv(r){if((0,Of.assertArgument)(typeof r=="string","invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/)){r.startsWith("0x")||(r="0x"+r);let e=mv(r);return(0,Of.assertArgument)(!r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===r,"bad address checksum","address",r),e}if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){(0,Of.assertArgument)(r.substring(2,4)===gv(r),"bad icap checksum","address",r);let e=GR(r.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return mv("0x"+e)}(0,Of.assertArgument)(!1,"invalid address","address",r)}tu.getAddress=xv;function zR(r){let e=BigInt(xv(r)).toString(36).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+gv("XE00"+e)+e}tu.getIcapAddress=zR});var wv=M(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.getCreate2Address=ru.getCreateAddress=void 0;var yv=nr(),bi=me(),Ip=Np();function VR(r){let e=(0,Ip.getAddress)(r.from),n=(0,bi.getBigInt)(r.nonce,"tx.nonce").toString(16);return n==="0"?n="0x":n.length%2?n="0x0"+n:n="0x"+n,(0,Ip.getAddress)((0,bi.dataSlice)((0,yv.keccak256)((0,bi.encodeRlp)([e,n])),12))}ru.getCreateAddress=VR;function KR(r,e,t){let n=(0,Ip.getAddress)(r),s=(0,bi.getBytes)(e,"salt"),i=(0,bi.getBytes)(t,"initCodeHash");return(0,bi.assertArgument)(s.length===32,"salt must be 32 bytes","salt",e),(0,bi.assertArgument)(i.length===32,"initCodeHash must be 32 bytes","initCodeHash",t),(0,Ip.getAddress)((0,bi.dataSlice)((0,yv.keccak256)((0,bi.concat)(["0xff",n,s,i])),12))}ru.getCreate2Address=KR});var Ev=M(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.resolveAddress=lo.isAddress=lo.isAddressable=void 0;var Rp=me(),Ky=Np();function Av(r){return r&&typeof r.getAddress=="function"}lo.isAddressable=Av;function WR(r){try{return(0,Ky.getAddress)(r),!0}catch{}return!1}lo.isAddress=WR;async function Vy(r,e){let t=await e;return(t==null||t==="0x0000000000000000000000000000000000000000")&&((0,Rp.assert)(typeof r!="string","unconfigured name","UNCONFIGURED_NAME",{value:r}),(0,Rp.assertArgument)(!1,"invalid AddressLike value; did not resolve to a value address","target",r)),(0,Ky.getAddress)(t)}function JR(r,e){if(typeof r=="string")return r.match(/^0x[0-9a-f]{40}$/i)?(0,Ky.getAddress)(r):((0,Rp.assert)(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),Vy(r,e.resolveName(r)));if(Av(r))return Vy(r,r.getAddress());if(r&&typeof r.then=="function")return Vy(r,r);(0,Rp.assertArgument)(!1,"unsupported addressable value","target",r)}lo.resolveAddress=JR});var Yt=M(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.resolveAddress=gr.isAddress=gr.isAddressable=gr.getCreate2Address=gr.getCreateAddress=gr.getIcapAddress=gr.getAddress=void 0;var vv=Np();Object.defineProperty(gr,"getAddress",{enumerable:!0,get:function(){return vv.getAddress}});Object.defineProperty(gr,"getIcapAddress",{enumerable:!0,get:function(){return vv.getIcapAddress}});var Tv=wv();Object.defineProperty(gr,"getCreateAddress",{enumerable:!0,get:function(){return Tv.getCreateAddress}});Object.defineProperty(gr,"getCreate2Address",{enumerable:!0,get:function(){return Tv.getCreate2Address}});var Wy=Ev();Object.defineProperty(gr,"isAddressable",{enumerable:!0,get:function(){return Wy.isAddressable}});Object.defineProperty(gr,"isAddress",{enumerable:!0,get:function(){return Wy.isAddress}});Object.defineProperty(gr,"resolveAddress",{enumerable:!0,get:function(){return Wy.resolveAddress}})});var Is=M(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});Mp.Typed=void 0;var Pv=me(),cs={};function be(r,e){let t=!1;return e<0&&(t=!0,e*=-1),new Br(cs,`${t?"":"u"}int${e}`,r,{signed:t,width:e})}function Ye(r,e){return new Br(cs,`bytes${e||""}`,r,{size:e})}var kv=Symbol.for("_ethers_typed"),Br=class{type;value;#e;_typedSymbol;constructor(e,t,n,s){s==null&&(s=null),(0,Pv.assertPrivate)(cs,e,"Typed"),(0,Pv.defineProperties)(this,{_typedSymbol:kv,type:t,value:n}),this.#e=s,this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return this.#e}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return this.#e===!0?-1:this.#e===!1?this.value.length:null}static from(e,t){return new Br(cs,e,t)}static uint8(e){return be(e,8)}static uint16(e){return be(e,16)}static uint24(e){return be(e,24)}static uint32(e){return be(e,32)}static uint40(e){return be(e,40)}static uint48(e){return be(e,48)}static uint56(e){return be(e,56)}static uint64(e){return be(e,64)}static uint72(e){return be(e,72)}static uint80(e){return be(e,80)}static uint88(e){return be(e,88)}static uint96(e){return be(e,96)}static uint104(e){return be(e,104)}static uint112(e){return be(e,112)}static uint120(e){return be(e,120)}static uint128(e){return be(e,128)}static uint136(e){return be(e,136)}static uint144(e){return be(e,144)}static uint152(e){return be(e,152)}static uint160(e){return be(e,160)}static uint168(e){return be(e,168)}static uint176(e){return be(e,176)}static uint184(e){return be(e,184)}static uint192(e){return be(e,192)}static uint200(e){return be(e,200)}static uint208(e){return be(e,208)}static uint216(e){return be(e,216)}static uint224(e){return be(e,224)}static uint232(e){return be(e,232)}static uint240(e){return be(e,240)}static uint248(e){return be(e,248)}static uint256(e){return be(e,256)}static uint(e){return be(e,256)}static int8(e){return be(e,-8)}static int16(e){return be(e,-16)}static int24(e){return be(e,-24)}static int32(e){return be(e,-32)}static int40(e){return be(e,-40)}static int48(e){return be(e,-48)}static int56(e){return be(e,-56)}static int64(e){return be(e,-64)}static int72(e){return be(e,-72)}static int80(e){return be(e,-80)}static int88(e){return be(e,-88)}static int96(e){return be(e,-96)}static int104(e){return be(e,-104)}static int112(e){return be(e,-112)}static int120(e){return be(e,-120)}static int128(e){return be(e,-128)}static int136(e){return be(e,-136)}static int144(e){return be(e,-144)}static int152(e){return be(e,-152)}static int160(e){return be(e,-160)}static int168(e){return be(e,-168)}static int176(e){return be(e,-176)}static int184(e){return be(e,-184)}static int192(e){return be(e,-192)}static int200(e){return be(e,-200)}static int208(e){return be(e,-208)}static int216(e){return be(e,-216)}static int224(e){return be(e,-224)}static int232(e){return be(e,-232)}static int240(e){return be(e,-240)}static int248(e){return be(e,-248)}static int256(e){return be(e,-256)}static int(e){return be(e,-256)}static bytes1(e){return Ye(e,1)}static bytes2(e){return Ye(e,2)}static bytes3(e){return Ye(e,3)}static bytes4(e){return Ye(e,4)}static bytes5(e){return Ye(e,5)}static bytes6(e){return Ye(e,6)}static bytes7(e){return Ye(e,7)}static bytes8(e){return Ye(e,8)}static bytes9(e){return Ye(e,9)}static bytes10(e){return Ye(e,10)}static bytes11(e){return Ye(e,11)}static bytes12(e){return Ye(e,12)}static bytes13(e){return Ye(e,13)}static bytes14(e){return Ye(e,14)}static bytes15(e){return Ye(e,15)}static bytes16(e){return Ye(e,16)}static bytes17(e){return Ye(e,17)}static bytes18(e){return Ye(e,18)}static bytes19(e){return Ye(e,19)}static bytes20(e){return Ye(e,20)}static bytes21(e){return Ye(e,21)}static bytes22(e){return Ye(e,22)}static bytes23(e){return Ye(e,23)}static bytes24(e){return Ye(e,24)}static bytes25(e){return Ye(e,25)}static bytes26(e){return Ye(e,26)}static bytes27(e){return Ye(e,27)}static bytes28(e){return Ye(e,28)}static bytes29(e){return Ye(e,29)}static bytes30(e){return Ye(e,30)}static bytes31(e){return Ye(e,31)}static bytes32(e){return Ye(e,32)}static address(e){return new Br(cs,"address",e)}static bool(e){return new Br(cs,"bool",!!e)}static bytes(e){return new Br(cs,"bytes",e)}static string(e){return new Br(cs,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new Br(cs,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===kv}static dereference(e,t){if(Br.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}};Mp.Typed=Br});var Sv=M(Lp=>{"use strict";Object.defineProperty(Lp,"__esModule",{value:!0});Lp.AddressCoder=void 0;var Bv=Yt(),QR=Bc(),YR=Is(),ZR=yn(),Jy=class extends ZR.Coder{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let n=YR.Typed.dereference(t,"string");try{n=(0,Bv.getAddress)(n)}catch(s){return this._throwError(s.message,t)}return e.writeValue(n)}decode(e){return(0,Bv.getAddress)((0,QR.toBeHex)(e.readValue(),20))}};Lp.AddressCoder=Jy});var Ov=M(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});jp.AnonymousCoder=void 0;var XR=yn(),Qy=class extends XR.Coder{coder;constructor(e){super(e.name,e.type,"_",e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}};jp.AnonymousCoder=Qy});var Zy=M(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.ArrayCoder=fo.unpack=fo.pack=void 0;var gi=me(),eM=Is(),nu=yn(),tM=Ov();function _v(r,e,t){let n=[];if(Array.isArray(t))n=t;else if(t&&typeof t=="object"){let c={};n=e.map(u=>{let l=u.localName;return(0,gi.assert)(l,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:t}),(0,gi.assert)(!c[l],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:t}),c[l]=!0,t[l]})}else(0,gi.assertArgument)(!1,"invalid tuple value","tuple",t);(0,gi.assertArgument)(e.length===n.length,"types/value length mismatch","tuple",t);let s=new nu.Writer,i=new nu.Writer,o=[];e.forEach((c,u)=>{let l=n[u];if(c.dynamic){let f=i.length;c.encode(i,l);let d=s.writeUpdatableValue();o.push(h=>{d(h+f)})}else c.encode(s,l)}),o.forEach(c=>{c(s.length)});let a=r.appendWriter(s);return a+=r.appendWriter(i),a}fo.pack=_v;function Cv(r,e){let t=[],n=[],s=r.subReader(0);return e.forEach(i=>{let o=null;if(i.dynamic){let a=r.readIndex(),c=s.subReader(a);try{o=i.decode(c)}catch(u){if((0,gi.isError)(u,"BUFFER_OVERRUN"))throw u;o=u,o.baseType=i.name,o.name=i.localName,o.type=i.type}}else try{o=i.decode(r)}catch(a){if((0,gi.isError)(a,"BUFFER_OVERRUN"))throw a;o=a,o.baseType=i.name,o.name=i.localName,o.type=i.type}if(o==null)throw new Error("investigate");t.push(o),n.push(i.localName||null)}),nu.Result.fromItems(t,n)}fo.unpack=Cv;var Yy=class extends nu.Coder{coder;length;constructor(e,t,n){let s=e.type+"["+(t>=0?t:"")+"]",i=t===-1||e.dynamic;super("array",s,n,i),(0,gi.defineProperties)(this,{coder:e,length:t})}defaultValue(){let e=this.coder.defaultValue(),t=[];for(let n=0;n<this.length;n++)t.push(e);return t}encode(e,t){let n=eM.Typed.dereference(t,"array");Array.isArray(n)||this._throwError("expected array value",n);let s=this.length;s===-1&&(s=n.length,e.writeValue(n.length)),(0,gi.assertArgumentCount)(n.length,s,"coder array"+(this.localName?" "+this.localName:""));let i=[];for(let o=0;o<n.length;o++)i.push(this.coder);return _v(e,i,n)}decode(e){let t=this.length;t===-1&&(t=e.readIndex(),(0,gi.assert)(t*nu.WordSize<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:t*nu.WordSize,length:e.dataLength}));let n=[];for(let s=0;s<t;s++)n.push(new tM.AnonymousCoder(this.coder));return Cv(e,n)}};fo.ArrayCoder=Yy});var Nv=M(Up=>{"use strict";Object.defineProperty(Up,"__esModule",{value:!0});Up.BooleanCoder=void 0;var rM=Is(),nM=yn(),Xy=class extends nM.Coder{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){let n=rM.Typed.dereference(t,"bool");return e.writeValue(n?1:0)}decode(e){return!!e.readValue()}};Up.BooleanCoder=Xy});var t1=M(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.BytesCoder=su.DynamicBytesCoder=void 0;var Iv=me(),sM=yn(),Fp=class extends sM.Coder{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=(0,Iv.getBytesCopy)(t);let n=e.writeValue(t.length);return n+=e.writeBytes(t),n}decode(e){return e.readBytes(e.readIndex(),!0)}};su.DynamicBytesCoder=Fp;var e1=class extends Fp{constructor(e){super("bytes",e)}decode(e){return(0,Iv.hexlify)(super.decode(e))}};su.BytesCoder=e1});var Rv=M(Dp=>{"use strict";Object.defineProperty(Dp,"__esModule",{value:!0});Dp.FixedBytesCoder=void 0;var r1=me(),iM=Is(),oM=yn(),n1=class extends oM.Coder{size;constructor(e,t){let n="bytes"+String(e);super(n,n,t,!1),(0,r1.defineProperties)(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,t){let n=(0,r1.getBytesCopy)(iM.Typed.dereference(t,this.type));return n.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(n)}decode(e){return(0,r1.hexlify)(e.readBytes(this.size))}};Dp.FixedBytesCoder=n1});var Mv=M(Hp=>{"use strict";Object.defineProperty(Hp,"__esModule",{value:!0});Hp.NullCoder=void 0;var aM=yn(),cM=new Uint8Array([]),s1=class extends aM.Coder{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return t!=null&&this._throwError("not null",t),e.writeBytes(cM)}decode(e){return e.readBytes(0),null}};Hp.NullCoder=s1});var Lv=M($p=>{"use strict";Object.defineProperty($p,"__esModule",{value:!0});$p.NumberCoder=void 0;var po=me(),uM=Is(),i1=yn(),lM=BigInt(0),fM=BigInt(1),dM=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),o1=class extends i1.Coder{size;signed;constructor(e,t,n){let s=(t?"int":"uint")+e*8;super(s,s,n,!1),(0,po.defineProperties)(this,{size:e,signed:t},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,t){let n=(0,po.getBigInt)(uM.Typed.dereference(t,this.type)),s=(0,po.mask)(dM,i1.WordSize*8);if(this.signed){let i=(0,po.mask)(s,this.size*8-1);(n>i||n<-(i+fM))&&this._throwError("value out-of-bounds",t),n=(0,po.toTwos)(n,8*i1.WordSize)}else(n<lM||n>(0,po.mask)(s,this.size*8))&&this._throwError("value out-of-bounds",t);return e.writeValue(n)}decode(e){let t=(0,po.mask)(e.readValue(),this.size*8);return this.signed&&(t=(0,po.fromTwos)(t,this.size*8)),t}};$p.NumberCoder=o1});var Uv=M(qp=>{"use strict";Object.defineProperty(qp,"__esModule",{value:!0});qp.StringCoder=void 0;var jv=R0(),pM=Is(),hM=t1(),a1=class extends hM.DynamicBytesCoder{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,(0,jv.toUtf8Bytes)(pM.Typed.dereference(t,"string")))}decode(e){return(0,jv.toUtf8String)(super.decode(e))}};qp.StringCoder=a1});var Dv=M(Gp=>{"use strict";Object.defineProperty(Gp,"__esModule",{value:!0});Gp.TupleCoder=void 0;var mM=Yi(),bM=Is(),gM=yn(),Fv=Zy(),c1=class extends gM.Coder{coders;constructor(e,t){let n=!1,s=[];e.forEach(o=>{o.dynamic&&(n=!0),s.push(o.type)});let i="tuple("+s.join(",")+")";super("tuple",i,t,n),(0,mM.defineProperties)(this,{coders:Object.freeze(e.slice())})}defaultValue(){let e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});let t=this.coders.reduce((n,s)=>{let i=s.localName;return i&&(n[i]||(n[i]=0),n[i]++),n},{});return this.coders.forEach((n,s)=>{let i=n.localName;!i||t[i]!==1||(i==="length"&&(i="_length"),e[i]==null&&(e[i]=e[s]))}),Object.freeze(e)}encode(e,t){let n=bM.Typed.dereference(t,"tuple");return(0,Fv.pack)(e,this.coders,n)}decode(e){return(0,Fv.unpack)(e,this.coders)}};Gp.TupleCoder=c1});var u1=M(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});zp.id=void 0;var xM=nr(),yM=me();function wM(r){return(0,xM.keccak256)((0,yM.toUtf8Bytes)(r))}zp.id=wM});var bT=M(Tn=>{"use strict";var AM="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI",Hv=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),$v=4;function EM(r){let e=0;function t(){return r[e++]<<8|r[e++]}let n=t(),s=1,i=[0,1];for(let k=1;k<n;k++)i.push(s+=t());let o=t(),a=e;e+=o;let c=0,u=0;function l(){return c==0&&(u=u<<8|r[e++],c=8),u>>--c&1}let f=31,d=2**f,h=d>>>1,b=h>>1,p=d-1,g=0;for(let k=0;k<f;k++)g=g<<1|l();let m=[],y=0,E=d;for(;;){let k=Math.floor(((g-y+1)*s-1)/E),w=0,P=n;for(;P-w>1;){let _=w+P>>>1;k<i[_]?P=_:w=_}if(w==0)break;m.push(w);let B=y+Math.floor(E*i[w]/s),Z=y+Math.floor(E*i[w+1]/s)-1;for(;((B^Z)&h)==0;)g=g<<1&p|l(),B=B<<1&p,Z=Z<<1&p|1;for(;B&~Z&b;)g=g&h|g<<1&p>>>1|l(),B=B<<1^h,Z=(Z^h)<<1|h|1;y=B,E=1+Z-B}let v=n-4;return m.map(k=>{switch(k-v){case 3:return v+65792+(r[a++]<<16|r[a++]<<8|r[a++]);case 2:return v+256+(r[a++]<<8|r[a++]);case 1:return v+r[a++];default:return k-1}})}function vM(r){let e=0;return()=>r[e++]}function Kv(r){return vM(EM(TM(r)))}function TM(r){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,i)=>e[s.charCodeAt(0)]=i);let t=r.length,n=new Uint8Array(6*t>>3);for(let s=0,i=0,o=0,a=0;s<t;s++)a=a<<6|e[r.charCodeAt(s)],o+=6,o>=8&&(n[i++]=a>>(o-=8));return n}function PM(r){return r&1?~r>>1:r>>1}function kM(r,e){let t=Array(r);for(let n=0,s=0;n<r;n++)t[n]=s+=PM(e());return t}function If(r,e=0){let t=[];for(;;){let n=r(),s=r();if(!s)break;e+=n;for(let i=0;i<s;i++)t.push(e+i);e+=s+1}return t}function Wv(r){return Rf(()=>{let e=If(r);if(e.length)return e})}function Jv(r){let e=[];for(;;){let t=r();if(t==0)break;e.push(BM(t,r))}for(;;){let t=r()-1;if(t<0)break;e.push(SM(t,r))}return e.flat()}function Rf(r){let e=[];for(;;){let t=r(e.length);if(!t)break;e.push(t)}return e}function Qv(r,e,t){let n=Array(r).fill().map(()=>[]);for(let s=0;s<e;s++)kM(r,t).forEach((i,o)=>n[o].push(i));return n}function BM(r,e){let t=1+e(),n=e(),s=Rf(e);return Qv(s.length,1+r,e).flatMap((o,a)=>{let[c,...u]=o;return Array(s[a]).fill().map((l,f)=>{let d=f*n;return[c+f*t,u.map(h=>h+d)]})})}function SM(r,e){let t=1+e();return Qv(t,1+r,e).map(s=>[s[0],s.slice(1)])}function OM(r){let e=[],t=If(r);return s(n([]),[]),e;function n(i){let o=r(),a=Rf(()=>{let c=If(r).map(u=>t[u]);if(c.length)return n(c)});return{S:o,B:a,Q:i}}function s({S:i,B:o},a,c){if(!(i&4&&c===a[a.length-1])){i&2&&(c=a[a.length-1]),i&1&&e.push(a);for(let u of o)for(let l of u.Q)s(u,[...a,l],c)}}}function _M(r){return r.toString(16).toUpperCase().padStart(2,"0")}function Yv(r){return`{${_M(r)}}`}function y1(r){let e=[];for(let t=0,n=r.length;t<n;){let s=r.codePointAt(t);t+=s<65536?1:2,e.push(s)}return e}function mo(r){let t=r.length;if(t<4096)return String.fromCodePoint(...r);let n=[];for(let s=0;s<t;)n.push(String.fromCodePoint(...r.slice(s,s+=4096)));return n.join("")}function Zv(r,e){let t=r.length,n=t-e.length;for(let s=0;n==0&&s<t;s++)n=r[s]-e[s];return n}var CM="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g",Mf=44032,Kp=4352,Wp=4449,Jp=4519,Xv=19,eT=21,au=28,Qp=eT*au,NM=Xv*Qp,IM=Mf+NM,RM=Kp+Xv,MM=Wp+eT,LM=Jp+au;function _f(r){return r>>24&255}function tT(r){return r&16777215}var p1,qv,h1,Vp;function jM(){let r=Kv(CM);p1=new Map(Wv(r).flatMap((e,t)=>e.map(n=>[n,t+1<<24]))),qv=new Set(If(r)),h1=new Map,Vp=new Map;for(let[e,t]of Jv(r)){if(!qv.has(e)&&t.length==2){let[n,s]=t,i=Vp.get(n);i||(i=new Map,Vp.set(n,i)),i.set(s,e)}h1.set(e,t.reverse())}}function rT(r){return r>=Mf&&r<IM}function UM(r,e){if(r>=Kp&&r<RM&&e>=Wp&&e<MM)return Mf+(r-Kp)*Qp+(e-Wp)*au;if(rT(r)&&e>Jp&&e<LM&&(r-Mf)%au==0)return r+(e-Jp);{let t=Vp.get(r);return t&&(t=t.get(e),t)?t:-1}}function nT(r){p1||jM();let e=[],t=[],n=!1;function s(i){let o=p1.get(i);o&&(n=!0,i|=o),e.push(i)}for(let i of r)for(;;){if(i<128)e.push(i);else if(rT(i)){let o=i-Mf,a=o/Qp|0,c=o%Qp/au|0,u=o%au;s(Kp+a),s(Wp+c),u>0&&s(Jp+u)}else{let o=h1.get(i);o?t.push(...o):s(i)}if(!t.length)break;i=t.pop()}if(n&&e.length>1){let i=_f(e[0]);for(let o=1;o<e.length;o++){let a=_f(e[o]);if(a==0||i<=a){i=a;continue}let c=o-1;for(;;){let u=e[c+1];if(e[c+1]=e[c],e[c]=u,!c||(i=_f(e[--c]),i<=a))break}i=_f(e[o])}}return e}function FM(r){let e=[],t=[],n=-1,s=0;for(let i of r){let o=_f(i),a=tT(i);if(n==-1)o==0?n=a:e.push(a);else if(s>0&&s>=o)o==0?(e.push(n,...t),t.length=0,n=a):t.push(a),s=o;else{let c=UM(n,a);c>=0?n=c:s==0&&o==0?(e.push(n),n=a):(t.push(a),s=o)}}return n>=0&&e.push(n,...t),e}function eh(r){return nT(r).map(tT)}function cu(r){return FM(nT(r))}var Gv=45,DM=46,Yp=".",sT=65039,iT=1,Zp=r=>Array.from(r);function Lf(r,e){return r.P.has(e)||r.Q.has(e)}var m1=class extends Array{get is_emoji(){return!0}},Xp,w1,Ca,b1,oT,aT,ou,l1,iu,ho,g1,x1;function uu(){if(Xp)return;let r=Kv(AM),e=()=>If(r),t=()=>new Set(e()),n=(l,f)=>f.forEach(d=>l.add(d));Xp=new Map(Jv(r)),w1=t(),Ca=e(),b1=new Set(e().map(l=>Ca[l])),Ca=new Set(Ca),oT=t(),aT=t();let s=Wv(r),i=r(),o=()=>{let l=new Set;return e().forEach(f=>n(l,s[f])),n(l,e()),l};ou=Rf(l=>{let f=Rf(r).map(d=>d+96);if(f.length){let d=l>=i;f[0]-=32,f=mo(f),d&&(f=`Restricted[${f}]`);let h=o(),b=o(),p=!r();return{N:f,P:h,Q:b,M:p,R:d}}}),l1=t(),iu=new Map;let a=e().concat(Zp(l1)).sort((l,f)=>l-f);a.forEach((l,f)=>{let d=r(),h=a[f]=d?a[f-d]:{V:[],M:new Map};h.V.push(l),l1.has(l)||iu.set(l,h)});for(let{V:l,M:f}of new Set(iu.values())){let d=[];for(let b of l){let p=ou.filter(m=>Lf(m,b)),g=d.find(({G:m})=>p.some(y=>m.has(y)));g||(g={G:new Set,V:[]},d.push(g)),g.V.push(b),n(g.G,p)}let h=d.flatMap(b=>Zp(b.G));for(let{G:b,V:p}of d){let g=new Set(h.filter(m=>!b.has(m)));for(let m of p)f.set(m,g)}}ho=new Set;let c=new Set,u=l=>ho.has(l)?c.add(l):ho.add(l);for(let l of ou){for(let f of l.P)u(f);for(let f of l.Q)u(f)}for(let l of ho)!iu.has(l)&&!c.has(l)&&iu.set(l,iT);n(ho,eh(ho)),g1=OM(r).map(l=>m1.from(l)).sort(Zv),x1=new Map;for(let l of g1){let f=[x1];for(let d of l){let h=f.map(b=>{let p=b.get(d);return p||(p=new Map,b.set(d,p)),p});d===sT?f.push(...h):f=h}for(let d of f)d.V=l}}function A1(r){return(v1(r)?"":`${E1(jf([r]))} `)+Yv(r)}function E1(r){return`"${r}"\u200E`}function HM(r){if(r.length>=4&&r[2]==Gv&&r[3]==Gv)throw new Error(`invalid label extension: "${mo(r.slice(0,4))}"`)}function $M(r){for(let t=r.lastIndexOf(95);t>0;)if(r[--t]!==95)throw new Error("underscore allowed only at start")}function qM(r){let e=r[0],t=Hv.get(e);if(t)throw Cf(`leading ${t}`);let n=r.length,s=-1;for(let i=1;i<n;i++){e=r[i];let o=Hv.get(e);if(o){if(s==i)throw Cf(`${t} + ${o}`);s=i+1,t=o}}if(s==n)throw Cf(`trailing ${t}`)}function jf(r,e=1/0,t=Yv){let n=[];cT(r[0])&&n.push("\u25CC"),r.length>e&&(e>>=1,r=[...r.slice(0,e),8230,...r.slice(-e)]);let s=0,i=r.length;for(let o=0;o<i;o++){let a=r[o];v1(a)&&(n.push(mo(r.slice(s,o))),n.push(t(a)),s=o+1)}return n.push(mo(r.slice(s,i))),n.join("")}function cT(r){return uu(),Ca.has(r)}function v1(r){return uu(),oT.has(r)}function GM(){return uu(),g1.map(r=>r.slice())}function zM(r,e){uu();let t=e?eh:cu;return r.split(Yp).map(n=>mo(dT(y1(n),t,th).flat())).join(Yp)}function VM(r){return uT(T1(r,cu,th))}function KM(r){let e=T1(r,cu,t=>t);for(let{type:t,output:n,error:s}of e){if(s)break;t!=="Greek"&&WM(n,958,926)}return uT(e)}function WM(r,e,t){let n=0;for(;;){let s=r.indexOf(e,n);if(s<0)break;r[s]=t,n=s+1}}function JM(r,e){return T1(r,cu,e?t=>t.slice():th)}function T1(r,e,t){if(!r)return[];uu();let n=0;return r.split(Yp).map(s=>{let i=y1(s),o={input:i,offset:n};n+=i.length+1;try{let a=o.tokens=dT(i,e,t),c=a.length,u;if(!c)throw new Error("empty label");let l=o.output=a.flat();if($M(l),!(o.emoji=c>1||a[0].is_emoji)&&l.every(d=>d<128))HM(l),u="ASCII";else{let d=a.flatMap(h=>h.is_emoji?[]:h);if(!d.length)u="Emoji";else{if(Ca.has(l[0]))throw Cf("leading combining mark");for(let p=1;p<c;p++){let g=a[p];if(!g.is_emoji&&Ca.has(g[0]))throw Cf(`emoji + combining mark: "${mo(a[p-1])} + ${jf([g[0]])}"`)}qM(l);let h=Zp(new Set(d)),[b]=YM(h);ZM(b,d),QM(b,h),u=b.N}}o.type=u}catch(a){o.error=a}return o})}function QM(r,e){let t,n=[];for(let s of e){let i=iu.get(s);if(i===iT)return;if(i){let o=i.M.get(s);if(t=t?t.filter(a=>o.has(a)):Zp(o),!t.length)return}else n.push(s)}if(t){for(let s of t)if(n.every(i=>Lf(s,i)))throw new Error(`whole-script confusable: ${r.N}/${s.N}`)}}function YM(r){let e=ou;for(let t of r){let n=e.filter(s=>Lf(s,t));if(!n.length)throw ou.some(s=>Lf(s,t))?fT(e[0],t):lT(t);if(e=n,n.length==1)break}return e}function uT(r){return r.map(({input:e,error:t,output:n})=>{if(t){let s=t.message;throw new Error(r.length==1?s:`Invalid label ${E1(jf(e,63))}: ${s}`)}return mo(n)}).join(Yp)}function lT(r){return new Error(`disallowed character: ${A1(r)}`)}function fT(r,e){let t=A1(e),n=ou.find(s=>s.P.has(e));return n&&(t=`${n.N} ${t}`),new Error(`illegal mixture: ${r.N} + ${t}`)}function Cf(r){return new Error(`illegal placement: ${r}`)}function ZM(r,e){for(let t of e)if(!Lf(r,t))throw fT(r,t);if(r.M){let t=eh(e);for(let n=1,s=t.length;n<s;n++)if(b1.has(t[n])){let i=n+1;for(let o;i<s&&b1.has(o=t[i]);i++)for(let a=n;a<i;a++)if(t[a]==o)throw new Error(`duplicate non-spacing marks: ${A1(o)}`);if(i-n>$v)throw new Error(`excessive non-spacing marks: ${E1(jf(t.slice(n-1,i)))} (${i-n}/${$v})`);n=i}}}function dT(r,e,t){let n=[],s=[];for(r=r.slice().reverse();r.length;){let i=pT(r);if(i)s.length&&(n.push(e(s)),s=[]),n.push(t(i));else{let o=r.pop();if(ho.has(o))s.push(o);else{let a=Xp.get(o);if(a)s.push(...a);else if(!w1.has(o))throw lT(o)}}}return s.length&&n.push(e(s)),n}function th(r){return r.filter(e=>e!=sT)}function pT(r,e){let t=x1,n,s=r.length;for(;s&&(t=t.get(r[--s]),!!t);){let{V:i}=t;i&&(n=i,e&&e.push(...r.slice(s).reverse()),r.length=s)}return n}var Nf="valid",hT="mapped",f1="ignored",XM="disallowed",eL="emoji",tL="nfc",rL="stop";function mT(r,{nf:e=!0}={}){uu();let t=y1(r).reverse(),n=[],s=[];for(;t.length;){let i=pT(t,n);if(i)s.push({type:eL,emoji:i.slice(),input:n,cps:th(i)}),n=[];else{let o=t.pop();if(o==DM)s.push({type:rL,cp:o});else if(ho.has(o))s.push({type:Nf,cps:[o]});else if(w1.has(o))s.push({type:f1,cp:o});else{let a=Xp.get(o);a?s.push({type:hT,cp:o,cps:a.slice()}):s.push({type:XM,cp:o})}}}if(e)for(let i=0,o=-1;i<s.length;i++){let a=s[i];if(d1(a.type))if(zv(a.cps)){let c=i+1;for(let d=c;d<s.length;d++){let{type:h,cps:b}=s[d];if(d1(h)){if(!zv(b))break;c=d+1}else if(h!==f1)break}o<0&&(o=i);let u=s.slice(o,c),l=u.flatMap(d=>d1(d.type)?d.cps:[]),f=cu(l);Zv(f,l)?(s.splice(o,c-o,{type:tL,input:l,cps:f,tokens0:Vv(u),tokens:mT(mo(f),{nf:!1})}),i=o):i=c-1,o=-1}else o=i;else a.type!==f1&&(o=-1)}return Vv(s)}function d1(r){return r==Nf||r==hT}function zv(r){return r.some(e=>aT.has(e))}function Vv(r){for(let e=0;e<r.length;e++)if(r[e].type==Nf){let t=e+1;for(;t<r.length&&r[t].type==Nf;)t++;r.splice(e,t-e,{type:Nf,cps:r.slice(e,t).flatMap(n=>n.cps)})}return r}Tn.ens_beautify=KM;Tn.ens_emoji=GM;Tn.ens_normalize=VM;Tn.ens_normalize_fragment=zM;Tn.ens_split=JM;Tn.ens_tokenize=mT;Tn.is_combining_mark=cT;Tn.nfc=cu;Tn.nfd=eh;Tn.safe_str_from_cps=jf;Tn.should_escape=v1});var AT=M(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.dnsEncode=Rs.namehash=Rs.isValidName=Rs.ensNormalize=void 0;var gT=nr(),Pn=me(),nL=bT(),yT=new Uint8Array(32);yT.fill(0);function xT(r){return(0,Pn.assertArgument)(r.length!==0,"invalid ENS name; empty component","comp",r),r}function P1(r){let e=(0,Pn.toUtf8Bytes)(wT(r)),t=[];if(r.length===0)return t;let n=0;for(let s=0;s<e.length;s++)e[s]===46&&(t.push(xT(e.slice(n,s))),n=s+1);return(0,Pn.assertArgument)(n<e.length,"invalid ENS name; empty component","name",r),t.push(xT(e.slice(n))),t}function wT(r){try{if(r.length===0)throw new Error("empty label");return(0,nL.ens_normalize)(r)}catch(e){(0,Pn.assertArgument)(!1,`invalid ENS name (${e.message})`,"name",r)}}Rs.ensNormalize=wT;function sL(r){try{return P1(r).length!==0}catch{}return!1}Rs.isValidName=sL;function iL(r){(0,Pn.assertArgument)(typeof r=="string","invalid ENS name; not a string","name",r),(0,Pn.assertArgument)(r.length,"invalid ENS name (empty label)","name",r);let e=yT,t=P1(r);for(;t.length;)e=(0,gT.keccak256)((0,Pn.concat)([e,(0,gT.keccak256)(t.pop())]));return(0,Pn.hexlify)(e)}Rs.namehash=iL;function oL(r,e){let t=e??63;return(0,Pn.assertArgument)(t<=255,"DNS encoded label cannot exceed 255","length",t),(0,Pn.hexlify)((0,Pn.concat)(P1(r).map(n=>{(0,Pn.assertArgument)(n.length<=t,`label ${JSON.stringify(r)} exceeds ${t} bytes`,"name",r);let s=new Uint8Array(n.length+1);return s.set(n,1),s[0]=s.length-1,s})))+"00"}Rs.dnsEncode=oL});var B1=M(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});rh.accessListify=void 0;var aL=Yt(),Uf=me();function k1(r,e){return{address:(0,aL.getAddress)(r),storageKeys:e.map((t,n)=>((0,Uf.assertArgument)((0,Uf.isHexString)(t,32),"invalid slot",`storageKeys[${n}]`,t),t.toLowerCase()))}}function cL(r){if(Array.isArray(r))return r.map((t,n)=>Array.isArray(t)?((0,Uf.assertArgument)(t.length===2,"invalid slot set",`value[${n}]`,t),k1(t[0],t[1])):((0,Uf.assertArgument)(t!=null&&typeof t=="object","invalid address-slot set","value",r),k1(t.address,t.storageKeys)));(0,Uf.assertArgument)(r!=null&&typeof r=="object","invalid access list","value",r);let e=Object.keys(r).map(t=>{let n=r[t].reduce((s,i)=>(s[i]=!0,s),{});return k1(t,Object.keys(n).sort())});return e.sort((t,n)=>t.address.localeCompare(n.address)),e}rh.accessListify=cL});var O1=M(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.recoverAddress=lu.computeAddress=void 0;var uL=Yt(),S1=nr();function ET(r){let e;return typeof r=="string"?e=S1.SigningKey.computePublicKey(r,!1):e=r.publicKey,(0,uL.getAddress)((0,S1.keccak256)("0x"+e.substring(4)).substring(26))}lu.computeAddress=ET;function lL(r,e){return ET(S1.SigningKey.recoverPublicKey(r,e))}lu.recoverAddress=lL});var kT=M(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});sh.Transaction=void 0;var TT=Yt(),PT=$y(),xi=nr(),ie=me(),C1=B1(),fL=O1(),sr=BigInt(0),dL=BigInt(2),pL=BigInt(27),hL=BigInt(28),mL=BigInt(35),bL=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),_1=4096*32;function vT(r,e){let t=r.toString(16);for(;t.length<2;)t="0"+t;return t+=(0,xi.sha256)(e).substring(4),"0x"+t}function nh(r){return r==="0x"?null:(0,TT.getAddress)(r)}function N1(r,e){try{return(0,C1.accessListify)(r)}catch(t){(0,ie.assertArgument)(!1,t.message,e,r)}}function Ff(r,e){return r==="0x"?0:(0,ie.getNumber)(r,e)}function jt(r,e){if(r==="0x")return sr;let t=(0,ie.getBigInt)(r,e);return(0,ie.assertArgument)(t<=bL,"value exceeds uint size",e,t),t}function xt(r,e){let t=(0,ie.getBigInt)(r,"value"),n=(0,ie.toBeArray)(t);return(0,ie.assertArgument)(n.length<=32,"value too large",`tx.${e}`,t),n}function I1(r){return(0,C1.accessListify)(r).map(e=>[e.address,e.storageKeys])}function gL(r,e){(0,ie.assertArgument)(Array.isArray(r),`invalid ${e}`,"value",r);for(let t=0;t<r.length;t++)(0,ie.assertArgument)((0,ie.isHexString)(r[t],32),"invalid ${ param } hash",`value[${t}]`,r[t]);return r}function xL(r){let e=(0,ie.decodeRlp)(r);(0,ie.assertArgument)(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",r);let t={type:0,nonce:Ff(e[0],"nonce"),gasPrice:jt(e[1],"gasPrice"),gasLimit:jt(e[2],"gasLimit"),to:nh(e[3]),value:jt(e[4],"value"),data:(0,ie.hexlify)(e[5]),chainId:sr};if(e.length===6)return t;let n=jt(e[6],"v"),s=jt(e[7],"r"),i=jt(e[8],"s");if(s===sr&&i===sr)t.chainId=n;else{let o=(n-mL)/dL;o<sr&&(o=sr),t.chainId=o,(0,ie.assertArgument)(o!==sr||n===pL||n===hL,"non-canonical legacy v","v",e[6]),t.signature=xi.Signature.from({r:(0,ie.zeroPadValue)(e[7],32),s:(0,ie.zeroPadValue)(e[8],32),v:n})}return t}function yL(r,e){let t=[xt(r.nonce,"nonce"),xt(r.gasPrice||0,"gasPrice"),xt(r.gasLimit,"gasLimit"),r.to||"0x",xt(r.value,"value"),r.data],n=sr;if(r.chainId!=sr)n=(0,ie.getBigInt)(r.chainId,"tx.chainId"),(0,ie.assertArgument)(!e||e.networkV==null||e.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",e);else if(r.signature){let i=r.signature.legacyChainId;i!=null&&(n=i)}if(!e)return n!==sr&&(t.push((0,ie.toBeArray)(n)),t.push("0x"),t.push("0x")),(0,ie.encodeRlp)(t);let s=BigInt(27+e.yParity);return n!==sr?s=xi.Signature.getChainIdV(n,e.v):BigInt(e.v)!==s&&(0,ie.assertArgument)(!1,"tx.chainId/sig.v mismatch","sig",e),t.push((0,ie.toBeArray)(s)),t.push((0,ie.toBeArray)(e.r)),t.push((0,ie.toBeArray)(e.s)),(0,ie.encodeRlp)(t)}function R1(r,e){let t;try{if(t=Ff(e[0],"yParity"),t!==0&&t!==1)throw new Error("bad yParity")}catch{(0,ie.assertArgument)(!1,"invalid yParity","yParity",e[0])}let n=(0,ie.zeroPadValue)(e[1],32),s=(0,ie.zeroPadValue)(e[2],32),i=xi.Signature.from({r:n,s,yParity:t});r.signature=i}function wL(r){let e=(0,ie.decodeRlp)((0,ie.getBytes)(r).slice(1));(0,ie.assertArgument)(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",(0,ie.hexlify)(r));let t={type:2,chainId:jt(e[0],"chainId"),nonce:Ff(e[1],"nonce"),maxPriorityFeePerGas:jt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:jt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:jt(e[4],"gasLimit"),to:nh(e[5]),value:jt(e[6],"value"),data:(0,ie.hexlify)(e[7]),accessList:N1(e[8],"accessList")};return e.length===9||R1(t,e.slice(9)),t}function AL(r,e){let t=[xt(r.chainId,"chainId"),xt(r.nonce,"nonce"),xt(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),xt(r.maxFeePerGas||0,"maxFeePerGas"),xt(r.gasLimit,"gasLimit"),r.to||"0x",xt(r.value,"value"),r.data,I1(r.accessList||[])];return e&&(t.push(xt(e.yParity,"yParity")),t.push((0,ie.toBeArray)(e.r)),t.push((0,ie.toBeArray)(e.s))),(0,ie.concat)(["0x02",(0,ie.encodeRlp)(t)])}function EL(r){let e=(0,ie.decodeRlp)((0,ie.getBytes)(r).slice(1));(0,ie.assertArgument)(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",(0,ie.hexlify)(r));let t={type:1,chainId:jt(e[0],"chainId"),nonce:Ff(e[1],"nonce"),gasPrice:jt(e[2],"gasPrice"),gasLimit:jt(e[3],"gasLimit"),to:nh(e[4]),value:jt(e[5],"value"),data:(0,ie.hexlify)(e[6]),accessList:N1(e[7],"accessList")};return e.length===8||R1(t,e.slice(8)),t}function vL(r,e){let t=[xt(r.chainId,"chainId"),xt(r.nonce,"nonce"),xt(r.gasPrice||0,"gasPrice"),xt(r.gasLimit,"gasLimit"),r.to||"0x",xt(r.value,"value"),r.data,I1(r.accessList||[])];return e&&(t.push(xt(e.yParity,"recoveryParam")),t.push((0,ie.toBeArray)(e.r)),t.push((0,ie.toBeArray)(e.s))),(0,ie.concat)(["0x01",(0,ie.encodeRlp)(t)])}function TL(r){let e=(0,ie.decodeRlp)((0,ie.getBytes)(r).slice(1)),t="3",n=null;if(e.length===4&&Array.isArray(e[0])){t="3 (network format)";let i=e[1],o=e[2],a=e[3];(0,ie.assertArgument)(Array.isArray(i),"invalid network format: blobs not an array","fields[1]",i),(0,ie.assertArgument)(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),(0,ie.assertArgument)(Array.isArray(a),"invalid network format: proofs not an array","fields[3]",a),(0,ie.assertArgument)(i.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",e),(0,ie.assertArgument)(i.length===a.length,"invalid network format: blobs/proofs length mismatch","fields",e),n=[];for(let c=0;c<e[1].length;c++)n.push({data:i[c],commitment:o[c],proof:a[c]});e=e[0]}(0,ie.assertArgument)(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${t}`,"data",(0,ie.hexlify)(r));let s={type:3,chainId:jt(e[0],"chainId"),nonce:Ff(e[1],"nonce"),maxPriorityFeePerGas:jt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:jt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:jt(e[4],"gasLimit"),to:nh(e[5]),value:jt(e[6],"value"),data:(0,ie.hexlify)(e[7]),accessList:N1(e[8],"accessList"),maxFeePerBlobGas:jt(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10]};n&&(s.blobs=n),(0,ie.assertArgument)(s.to!=null,`invalid address for transaction type: ${t}`,"data",r),(0,ie.assertArgument)(Array.isArray(s.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",r);for(let i=0;i<s.blobVersionedHashes.length;i++)(0,ie.assertArgument)((0,ie.isHexString)(s.blobVersionedHashes[i],32),`invalid blobVersionedHash at index ${i}: must be length 32`,"data",r);return e.length===11||R1(s,e.slice(11)),s}function PL(r,e,t){let n=[xt(r.chainId,"chainId"),xt(r.nonce,"nonce"),xt(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),xt(r.maxFeePerGas||0,"maxFeePerGas"),xt(r.gasLimit,"gasLimit"),r.to||PT.ZeroAddress,xt(r.value,"value"),r.data,I1(r.accessList||[]),xt(r.maxFeePerBlobGas||0,"maxFeePerBlobGas"),gL(r.blobVersionedHashes||[],"blobVersionedHashes")];return e&&(n.push(xt(e.yParity,"yParity")),n.push((0,ie.toBeArray)(e.r)),n.push((0,ie.toBeArray)(e.s)),t)?(0,ie.concat)(["0x03",(0,ie.encodeRlp)([n,t.map(s=>s.data),t.map(s=>s.commitment),t.map(s=>s.proof)])]):(0,ie.concat)(["0x03",(0,ie.encodeRlp)(n)])}var us=class{#e;#t;#r;#n;#s;#o;#i;#a;#f;#u;#h;#m;#c;#l;#d;#p;get type(){return this.#e}set type(e){switch(e){case null:this.#e=null;break;case 0:case"legacy":this.#e=0;break;case 1:case"berlin":case"eip-2930":this.#e=1;break;case 2:case"london":case"eip-1559":this.#e=2;break;case 3:case"cancun":case"eip-4844":this.#e=3;break;default:(0,ie.assertArgument)(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844"}return null}get to(){let e=this.#t;return e==null&&this.type===3?PT.ZeroAddress:e}set to(e){this.#t=e==null?null:(0,TT.getAddress)(e)}get nonce(){return this.#n}set nonce(e){this.#n=(0,ie.getNumber)(e,"value")}get gasLimit(){return this.#s}set gasLimit(e){this.#s=(0,ie.getBigInt)(e)}get gasPrice(){let e=this.#o;return e==null&&(this.type===0||this.type===1)?sr:e}set gasPrice(e){this.#o=e==null?null:(0,ie.getBigInt)(e,"gasPrice")}get maxPriorityFeePerGas(){let e=this.#i;return e??(this.type===2||this.type===3?sr:null)}set maxPriorityFeePerGas(e){this.#i=e==null?null:(0,ie.getBigInt)(e,"maxPriorityFeePerGas")}get maxFeePerGas(){let e=this.#a;return e??(this.type===2||this.type===3?sr:null)}set maxFeePerGas(e){this.#a=e==null?null:(0,ie.getBigInt)(e,"maxFeePerGas")}get data(){return this.#r}set data(e){this.#r=(0,ie.hexlify)(e)}get value(){return this.#f}set value(e){this.#f=(0,ie.getBigInt)(e,"value")}get chainId(){return this.#u}set chainId(e){this.#u=(0,ie.getBigInt)(e)}get signature(){return this.#h||null}set signature(e){this.#h=e==null?null:xi.Signature.from(e)}get accessList(){let e=this.#m||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){this.#m=e==null?null:(0,C1.accessListify)(e)}get maxFeePerBlobGas(){let e=this.#c;return e==null&&this.type===3?sr:e}set maxFeePerBlobGas(e){this.#c=e==null?null:(0,ie.getBigInt)(e,"maxFeePerBlobGas")}get blobVersionedHashes(){let e=this.#l;return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){(0,ie.assertArgument)(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let t=0;t<e.length;t++)(0,ie.assertArgument)((0,ie.isHexString)(e[t],32),"invalid blobVersionedHash",`value[${t}]`,e[t])}this.#l=e}get blobs(){return this.#p==null?null:this.#p.map(e=>Object.assign({},e))}set blobs(e){if(e==null){this.#p=null;return}let t=[],n=[];for(let s=0;s<e.length;s++){let i=e[s];if((0,ie.isBytesLike)(i)){(0,ie.assert)(this.#d,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let o=(0,ie.getBytes)(i);if((0,ie.assertArgument)(o.length<=_1,"blob is too large",`blobs[${s}]`,i),o.length!==_1){let u=new Uint8Array(_1);u.set(o),o=u}let a=this.#d.blobToKzgCommitment(o),c=(0,ie.hexlify)(this.#d.computeBlobKzgProof(o,a));t.push({data:(0,ie.hexlify)(o),commitment:(0,ie.hexlify)(a),proof:c}),n.push(vT(1,a))}else{let o=(0,ie.hexlify)(i.commitment);t.push({data:(0,ie.hexlify)(i.data),commitment:o,proof:(0,ie.hexlify)(i.proof)}),n.push(vT(1,o))}}this.#p=t,this.#l=n}get kzg(){return this.#d}set kzg(e){this.#d=e}constructor(){this.#e=null,this.#t=null,this.#n=0,this.#s=sr,this.#o=null,this.#i=null,this.#a=null,this.#r="0x",this.#f=sr,this.#u=sr,this.#h=null,this.#m=null,this.#c=null,this.#l=null,this.#p=null,this.#d=null}get hash(){return this.signature==null?null:(0,xi.keccak256)(this.#b(!0,!1))}get unsignedHash(){return(0,xi.keccak256)(this.unsignedSerialized)}get from(){return this.signature==null?null:(0,fL.recoverAddress)(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:xi.SigningKey.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}#b(e,t){(0,ie.assert)(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});let n=e?this.signature:null;switch(this.inferType()){case 0:return yL(this,n);case 1:return vL(this,n);case 2:return AL(this,n);case 3:return PL(this,n,t?this.blobs:null)}(0,ie.assert)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#b(!0,!0)}get unsignedSerialized(){return this.#b(!1,!1)}inferType(){let e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){let e=this.gasPrice!=null,t=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,s=this.#c!=null||this.#l;this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&(0,ie.assert)(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),(0,ie.assert)(!t||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),(0,ie.assert)(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});let i=[];return this.type!=null?i.push(this.type):t?i.push(2):e?(i.push(1),n||i.push(0)):n?(i.push(1),i.push(2)):(s&&this.to||(i.push(0),i.push(1),i.push(2)),i.push(3)),i.sort(),i}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return us.from(this)}toJSON(){let e=t=>t==null?null:t.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new us;if(typeof e=="string"){let n=(0,ie.getBytes)(e);if(n[0]>=127)return us.from(xL(n));switch(n[0]){case 1:return us.from(EL(n));case 2:return us.from(wL(n));case 3:return us.from(TL(n))}(0,ie.assert)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}let t=new us;return e.type!=null&&(t.type=e.type),e.to!=null&&(t.to=e.to),e.nonce!=null&&(t.nonce=e.nonce),e.gasLimit!=null&&(t.gasLimit=e.gasLimit),e.gasPrice!=null&&(t.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(t.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(t.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(t.data=e.data),e.value!=null&&(t.value=e.value),e.chainId!=null&&(t.chainId=e.chainId),e.signature!=null&&(t.signature=xi.Signature.from(e.signature)),e.accessList!=null&&(t.accessList=e.accessList),e.blobVersionedHashes!=null&&(t.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(t.kzg=e.kzg),e.blobs!=null&&(t.blobs=e.blobs),e.hash!=null&&((0,ie.assertArgument)(t.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),(0,ie.assertArgument)(t.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&((0,ie.assertArgument)(t.isSigned(),"unsigned transaction cannot define '.from'","tx",e),(0,ie.assertArgument)(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}};sh.Transaction=us});var qr=M(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.Transaction=Ms.recoverAddress=Ms.computeAddress=Ms.accessListify=void 0;var kL=B1();Object.defineProperty(Ms,"accessListify",{enumerable:!0,get:function(){return kL.accessListify}});var BT=O1();Object.defineProperty(Ms,"computeAddress",{enumerable:!0,get:function(){return BT.computeAddress}});Object.defineProperty(Ms,"recoverAddress",{enumerable:!0,get:function(){return BT.recoverAddress}});var BL=kT();Object.defineProperty(Ms,"Transaction",{enumerable:!0,get:function(){return BL.Transaction}})});var OT=M(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.verifyMessage=fu.hashMessage=void 0;var SL=nr(),OL=Xc(),_L=qr(),ih=me();function ST(r){return typeof r=="string"&&(r=(0,ih.toUtf8Bytes)(r)),(0,SL.keccak256)((0,ih.concat)([(0,ih.toUtf8Bytes)(OL.MessagePrefix),(0,ih.toUtf8Bytes)(String(r.length)),r]))}fu.hashMessage=ST;function CL(r,e){let t=ST(r);return(0,_L.recoverAddress)(t,e)}fu.verifyMessage=CL});var NT=M(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.solidityPackedSha256=bo.solidityPackedKeccak256=bo.solidityPacked=void 0;var NL=Yt(),_T=nr(),yt=me(),IL=new RegExp("^bytes([0-9]+)$"),RL=new RegExp("^(u?int)([0-9]*)$"),ML=new RegExp("^(.*)\\[([0-9]*)\\]$");function CT(r,e,t){switch(r){case"address":return t?(0,yt.getBytes)((0,yt.zeroPadValue)(e,32)):(0,yt.getBytes)((0,NL.getAddress)(e));case"string":return(0,yt.toUtf8Bytes)(e);case"bytes":return(0,yt.getBytes)(e);case"bool":return e=e?"0x01":"0x00",t?(0,yt.getBytes)((0,yt.zeroPadValue)(e,32)):(0,yt.getBytes)(e)}let n=r.match(RL);if(n){let s=n[1]==="int",i=parseInt(n[2]||"256");return(0,yt.assertArgument)((!n[2]||n[2]===String(i))&&i%8===0&&i!==0&&i<=256,"invalid number type","type",r),t&&(i=256),s&&(e=(0,yt.toTwos)(e,i)),(0,yt.getBytes)((0,yt.zeroPadValue)((0,yt.toBeArray)(e),i/8))}if(n=r.match(IL),n){let s=parseInt(n[1]);return(0,yt.assertArgument)(String(s)===n[1]&&s!==0&&s<=32,"invalid bytes type","type",r),(0,yt.assertArgument)((0,yt.dataLength)(e)===s,`invalid value for ${r}`,"value",e),t?(0,yt.getBytes)((0,yt.zeroPadBytes)(e,32)):e}if(n=r.match(ML),n&&Array.isArray(e)){let s=n[1],i=parseInt(n[2]||String(e.length));(0,yt.assertArgument)(i===e.length,`invalid array length for ${r}`,"value",e);let o=[];return e.forEach(function(a){o.push(CT(s,a,!0))}),(0,yt.getBytes)((0,yt.concat)(o))}(0,yt.assertArgument)(!1,"invalid type","type",r)}function M1(r,e){(0,yt.assertArgument)(r.length===e.length,"wrong number of values; expected ${ types.length }","values",e);let t=[];return r.forEach(function(n,s){t.push(CT(n,e[s]))}),(0,yt.hexlify)((0,yt.concat)(t))}bo.solidityPacked=M1;function LL(r,e){return(0,_T.keccak256)(M1(r,e))}bo.solidityPackedKeccak256=LL;function jL(r,e){return(0,_T.sha256)(M1(r,e))}bo.solidityPackedSha256=jL});var HT=M(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.verifyTypedData=pu.TypedDataEncoder=void 0;var LT=Yt(),du=nr(),UL=qr(),_e=me(),jT=u1(),UT=new Uint8Array(32);UT.fill(0);var FL=BigInt(-1),FT=BigInt(0),DT=BigInt(1),DL=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function HL(r){let e=(0,_e.getBytes)(r),t=e.length%32;return t?(0,_e.concat)([e,UT.slice(t)]):(0,_e.hexlify)(e)}var $L=(0,_e.toBeHex)(DT,32),qL=(0,_e.toBeHex)(FT,32),IT={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},L1=["name","version","chainId","verifyingContract","salt"];function RT(r){return function(e){return(0,_e.assertArgument)(typeof e=="string",`invalid domain value for ${JSON.stringify(r)}`,`domain.${r}`,e),e}}var GL={name:RT("name"),version:RT("version"),chainId:function(r){let e=(0,_e.getBigInt)(r,"domain.chainId");return(0,_e.assertArgument)(e>=0,"invalid chain ID","domain.chainId",r),Number.isSafeInteger(e)?Number(e):(0,_e.toQuantity)(e)},verifyingContract:function(r){try{return(0,LT.getAddress)(r).toLowerCase()}catch{}(0,_e.assertArgument)(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",r)},salt:function(r){let e=(0,_e.getBytes)(r,"domain.salt");return(0,_e.assertArgument)(e.length===32,'invalid domain value "salt"',"domain.salt",r),(0,_e.hexlify)(e)}};function j1(r){{let e=r.match(/^(u?)int(\d+)$/);if(e){let t=e[1]==="",n=parseInt(e[2]);(0,_e.assertArgument)(n%8===0&&n!==0&&n<=256&&e[2]===String(n),"invalid numeric width","type",r);let s=(0,_e.mask)(DL,t?n-1:n),i=t?(s+DT)*FL:FT;return function(o){let a=(0,_e.getBigInt)(o,"value");return(0,_e.assertArgument)(a>=i&&a<=s,`value out-of-bounds for ${r}`,"value",a),(0,_e.toBeHex)(t?(0,_e.toTwos)(a,256):a,32)}}}{let e=r.match(/^bytes(\d+)$/);if(e){let t=parseInt(e[1]);return(0,_e.assertArgument)(t!==0&&t<=32&&e[1]===String(t),"invalid bytes width","type",r),function(n){let s=(0,_e.getBytes)(n);return(0,_e.assertArgument)(s.length===t,`invalid length for ${r}`,"value",n),HL(n)}}}switch(r){case"address":return function(e){return(0,_e.zeroPadValue)((0,LT.getAddress)(e),32)};case"bool":return function(e){return e?$L:qL};case"bytes":return function(e){return(0,du.keccak256)(e)};case"string":return function(e){return(0,jT.id)(e)}}return null}function MT(r,e){return`${r}(${e.map(({name:t,type:n})=>n+" "+t).join(",")})`}function oh(r){let e=r.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:r}}var Sr=class{primaryType;#e;get types(){return JSON.parse(this.#e)}#t;#r;constructor(e){this.#t=new Map,this.#r=new Map;let t=new Map,n=new Map,s=new Map,i={};Object.keys(e).forEach(c=>{i[c]=e[c].map(({name:u,type:l})=>{let{base:f,index:d}=oh(l);return f==="int"&&!e.int&&(f="int256"),f==="uint"&&!e.uint&&(f="uint256"),{name:u,type:f+(d||"")}}),t.set(c,new Set),n.set(c,[]),s.set(c,new Set)}),this.#e=JSON.stringify(i);for(let c in i){let u=new Set;for(let l of i[c]){(0,_e.assertArgument)(!u.has(l.name),`duplicate variable name ${JSON.stringify(l.name)} in ${JSON.stringify(c)}`,"types",e),u.add(l.name);let f=oh(l.type).base;(0,_e.assertArgument)(f!==c,`circular type reference to ${JSON.stringify(f)}`,"types",e),!j1(f)&&((0,_e.assertArgument)(n.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),n.get(f).push(c),t.get(c).add(f))}}let o=Array.from(n.keys()).filter(c=>n.get(c).length===0);(0,_e.assertArgument)(o.length!==0,"missing primary type","types",e),(0,_e.assertArgument)(o.length===1,`ambiguous primary types or unused types: ${o.map(c=>JSON.stringify(c)).join(", ")}`,"types",e),(0,_e.defineProperties)(this,{primaryType:o[0]});function a(c,u){(0,_e.assertArgument)(!u.has(c),`circular type reference to ${JSON.stringify(c)}`,"types",e),u.add(c);for(let l of t.get(c))if(!!n.has(l)){a(l,u);for(let f of u)s.get(f).add(l)}u.delete(c)}a(this.primaryType,new Set);for(let[c,u]of s){let l=Array.from(u);l.sort(),this.#t.set(c,MT(c,i[c])+l.map(f=>MT(f,i[f])).join(""))}}getEncoder(e){let t=this.#r.get(e);return t||(t=this.#n(e),this.#r.set(e,t)),t}#n(e){{let s=j1(e);if(s)return s}let t=oh(e).array;if(t){let s=t.prefix,i=this.getEncoder(s);return o=>{(0,_e.assertArgument)(t.count===-1||t.count===o.length,`array length mismatch; expected length ${t.count}`,"value",o);let a=o.map(i);return this.#t.has(s)&&(a=a.map(du.keccak256)),(0,du.keccak256)((0,_e.concat)(a))}}let n=this.types[e];if(n){let s=(0,jT.id)(this.#t.get(e));return i=>{let o=n.map(({name:a,type:c})=>{let u=this.getEncoder(c)(i[a]);return this.#t.has(c)?(0,du.keccak256)(u):u});return o.unshift(s),(0,_e.concat)(o)}}(0,_e.assertArgument)(!1,`unknown type: ${e}`,"type",e)}encodeType(e){let t=this.#t.get(e);return(0,_e.assertArgument)(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return(0,du.keccak256)(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(j1(e))return n(e,t);let s=oh(e).array;if(s)return(0,_e.assertArgument)(s.count===-1||s.count===t.length,`array length mismatch; expected length ${s.count}`,"value",t),t.map(o=>this._visit(s.prefix,o,n));let i=this.types[e];if(i)return i.reduce((o,{name:a,type:c})=>(o[a]=this._visit(c,t[a],n),o),{});(0,_e.assertArgument)(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Sr(e)}static getPrimaryType(e){return Sr.from(e).primaryType}static hashStruct(e,t,n){return Sr.from(t).hashStruct(e,n)}static hashDomain(e){let t=[];for(let n in e){if(e[n]==null)continue;let s=IT[n];(0,_e.assertArgument)(s,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),t.push({name:n,type:s})}return t.sort((n,s)=>L1.indexOf(n.name)-L1.indexOf(s.name)),Sr.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,n){return(0,_e.concat)(["0x1901",Sr.hashDomain(e),Sr.from(t).hash(n)])}static hash(e,t,n){return(0,du.keccak256)(Sr.encode(e,t,n))}static async resolveNames(e,t,n,s){e=Object.assign({},e);for(let a in e)e[a]==null&&delete e[a];let i={};e.verifyingContract&&!(0,_e.isHexString)(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");let o=Sr.from(t);o.visit(n,(a,c)=>(a==="address"&&!(0,_e.isHexString)(c,20)&&(i[c]="0x"),c));for(let a in i)i[a]=await s(a);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),n=o.visit(n,(a,c)=>a==="address"&&i[c]?i[c]:c),{domain:e,value:n}}static getPayload(e,t,n){Sr.hashDomain(e);let s={},i=[];L1.forEach(c=>{let u=e[c];u!=null&&(s[c]=GL[c](u),i.push({name:c,type:IT[c]}))});let o=Sr.from(t);t=o.types;let a=Object.assign({},t);return(0,_e.assertArgument)(a.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",t),a.EIP712Domain=i,o.encode(n),{types:a,domain:s,primaryType:o.primaryType,message:o.visit(n,(c,u)=>{if(c.match(/^bytes(\d*)/))return(0,_e.hexlify)((0,_e.getBytes)(u));if(c.match(/^u?int/))return(0,_e.getBigInt)(u).toString();switch(c){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return(0,_e.assertArgument)(typeof u=="string","invalid string","value",u),u}(0,_e.assertArgument)(!1,"unsupported type","type",c)})}}};pu.TypedDataEncoder=Sr;function zL(r,e,t,n){return(0,UL.recoverAddress)(Sr.hash(r,e,t),n)}pu.verifyTypedData=zL});var Ls=M(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.verifyTypedData=ht.TypedDataEncoder=ht.solidityPackedSha256=ht.solidityPackedKeccak256=ht.solidityPacked=ht.verifyMessage=ht.hashMessage=ht.dnsEncode=ht.namehash=ht.isValidName=ht.ensNormalize=ht.id=void 0;var VL=u1();Object.defineProperty(ht,"id",{enumerable:!0,get:function(){return VL.id}});var ah=AT();Object.defineProperty(ht,"ensNormalize",{enumerable:!0,get:function(){return ah.ensNormalize}});Object.defineProperty(ht,"isValidName",{enumerable:!0,get:function(){return ah.isValidName}});Object.defineProperty(ht,"namehash",{enumerable:!0,get:function(){return ah.namehash}});Object.defineProperty(ht,"dnsEncode",{enumerable:!0,get:function(){return ah.dnsEncode}});var $T=OT();Object.defineProperty(ht,"hashMessage",{enumerable:!0,get:function(){return $T.hashMessage}});Object.defineProperty(ht,"verifyMessage",{enumerable:!0,get:function(){return $T.verifyMessage}});var U1=NT();Object.defineProperty(ht,"solidityPacked",{enumerable:!0,get:function(){return U1.solidityPacked}});Object.defineProperty(ht,"solidityPackedKeccak256",{enumerable:!0,get:function(){return U1.solidityPackedKeccak256}});Object.defineProperty(ht,"solidityPackedSha256",{enumerable:!0,get:function(){return U1.solidityPackedSha256}});var qT=HT();Object.defineProperty(ht,"TypedDataEncoder",{enumerable:!0,get:function(){return qT.TypedDataEncoder}});Object.defineProperty(ht,"verifyTypedData",{enumerable:!0,get:function(){return qT.verifyTypedData}})});var uh=M($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.StructFragment=$t.FunctionFragment=$t.FallbackFragment=$t.ConstructorFragment=$t.EventFragment=$t.ErrorFragment=$t.NamedFragment=$t.Fragment=$t.ParamType=void 0;var Ze=me(),F1=Ls();function Or(r){let e=new Set;return r.forEach(t=>e.add(t)),Object.freeze(e)}var KL="external public payable override",WL=Or(KL.split(" ")),XT="constant external internal payable private public pure view override",JL=Or(XT.split(" ")),eP="constructor error event fallback function receive struct",tP=Or(eP.split(" ")),rP="calldata memory storage payable indexed",QL=Or(rP.split(" ")),YL="tuple returns",ZL=[eP,rP,YL,XT].join(" "),XL=Or(ZL.split(" ")),ej={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},tj=new RegExp("^(\\s*)"),rj=new RegExp("^([0-9]+)"),nj=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),nP=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),sP=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"),Gr=class{#e;#t;get offset(){return this.#e}get length(){return this.#t.length-this.#e}constructor(e){this.#e=0,this.#t=e.slice()}clone(){return new Gr(this.#t)}reset(){this.#e=0}#r(e=0,t=0){return new Gr(this.#t.slice(e,t).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))}popKeyword(e){let t=this.peek();if(t.type!=="KEYWORD"||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){let t=this.peek();throw new Error(`expected ${e}; got ${t.type} ${JSON.stringify(t.text)}`)}return this.pop().text}popParen(){let e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");let t=this.#r(this.#e+1,e.match+1);return this.#e=e.match+1,t}popParams(){let e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");let t=[];for(;this.#e<e.match-1;){let n=this.peek().linkNext;t.push(this.#r(this.#e+1,n)),this.#e=n}return this.#e=e.match+1,t}peek(){if(this.#e>=this.#t.length)throw new Error("out-of-bounds");return this.#t[this.#e]}peekKeyword(e){let t=this.peekType("KEYWORD");return t!=null&&e.has(t)?t:null}peekType(e){if(this.length===0)return null;let t=this.peek();return t.type===e?t.text:null}pop(){let e=this.peek();return this.#e++,e}toString(){let e=[];for(let t=this.#e;t<this.#t.length;t++){let n=this.#t[t];e.push(`${n.type}:${n.text}`)}return`<TokenString ${e.join(" ")}>`}};function go(r){let e=[],t=o=>{let a=i<r.length?JSON.stringify(r[i]):"$EOI";throw new Error(`invalid token ${a} at ${i}: ${o}`)},n=[],s=[],i=0;for(;i<r.length;){let o=r.substring(i),a=o.match(tj);a&&(i+=a[1].length,o=r.substring(i));let c={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:i,value:-1};e.push(c);let u=ej[o[0]]||"";if(u){if(c.type=u,c.text=o[0],i++,u==="OPEN_PAREN")n.push(e.length-1),s.push(e.length-1);else if(u=="CLOSE_PAREN")n.length===0&&t("no matching open bracket"),c.match=n.pop(),e[c.match].match=e.length-1,c.depth--,c.linkBack=s.pop(),e[c.linkBack].linkNext=e.length-1;else if(u==="COMMA")c.linkBack=s.pop(),e[c.linkBack].linkNext=e.length-1,s.push(e.length-1);else if(u==="OPEN_BRACKET")c.type="BRACKET";else if(u==="CLOSE_BRACKET"){let l=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){let f=e.pop().text;l=f+l,e[e.length-1].value=(0,Ze.getNumber)(f)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=l}continue}if(a=o.match(nj),a){if(c.text=a[1],i+=c.text.length,XL.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(sP)){c.type="TYPE";continue}c.type="ID";continue}if(a=o.match(rj),a){c.text=a[1],c.type="NUMBER",i+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${i}`)}return new Gr(e.map(o=>Object.freeze(o)))}function GT(r,e){let t=[];for(let n in e.keys())r.has(n)&&t.push(n);if(t.length>1)throw new Error(`conflicting types: ${t.join(", ")}`)}function ch(r,e){if(e.peekKeyword(tP)){let t=e.pop().text;if(t!==r)throw new Error(`expected ${r}, got ${t}`)}return e.popType("ID")}function wi(r,e){let t=new Set;for(;;){let n=r.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(r.pop(),t.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);t.add(n)}return Object.freeze(t)}function iP(r){let e=wi(r,JL);return GT(e,Or("constant payable nonpayable".split(" "))),GT(e,Or("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function yi(r,e){return r.popParams().map(t=>wt.from(t,e))}function oP(r){if(r.peekType("AT")){if(r.pop(),r.peekType("NUMBER"))return(0,Ze.getBigInt)(r.pop().text);throw new Error("invalid gas")}return null}function Na(r){if(r.length)throw new Error(`unexpected tokens at offset ${r.offset}: ${r.toString()}`)}var sj=new RegExp(/^(.*)\[([0-9]*)\]$/);function zT(r){let e=r.match(sP);if((0,Ze.assertArgument)(e,"invalid type","type",r),r==="uint")return"uint256";if(r==="int")return"int256";if(e[2]){let t=parseInt(e[2]);(0,Ze.assertArgument)(t!==0&&t<=32,"invalid bytes length","type",r)}else if(e[3]){let t=parseInt(e[3]);(0,Ze.assertArgument)(t!==0&&t<=256&&t%8===0,"invalid numeric width","type",r)}return r}var kt={},zr=Symbol.for("_ethers_internal"),VT="_ParamTypeInternal",KT="_ErrorInternal",WT="_EventInternal",JT="_ConstructorInternal",QT="_FallbackInternal",YT="_FunctionInternal",ZT="_StructInternal",wt=class{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,t,n,s,i,o,a,c){if((0,Ze.assertPrivate)(e,kt,"ParamType"),Object.defineProperty(this,zr,{value:VT}),o&&(o=Object.freeze(o.slice())),s==="array"){if(a==null||c==null)throw new Error("")}else if(a!=null||c!=null)throw new Error("");if(s==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");(0,Ze.defineProperties)(this,{name:t,type:n,baseType:s,indexed:i,components:o,arrayLength:a,arrayChildren:c})}format(e){if(e==null&&(e="sighash"),e==="json"){let n=this.name||"";if(this.isArray()){let i=JSON.parse(this.arrayChildren.format("json"));return i.name=n,i.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(i)}let s={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(s.indexed=this.indexed),this.isTuple()&&(s.components=this.components.map(i=>JSON.parse(i.format(e)))),JSON.stringify(s)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?t+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")":t+=this.type,e!=="sighash"&&(this.indexed===!0&&(t+=" indexed"),e==="full"&&this.name&&(t+=" "+this.name)),t}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,t){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");let n=this;return e.map(s=>n.arrayChildren.walk(s,t))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");let n=this;return e.map((s,i)=>n.components[i].walk(s,t))}return t(this.type,e)}#e(e,t,n,s){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");let o=this.arrayChildren,a=t.slice();a.forEach((c,u)=>{o.#e(e,c,n,l=>{a[u]=l})}),s(a);return}if(this.isTuple()){let o=this.components,a;if(Array.isArray(t))a=t.slice();else{if(t==null||typeof t!="object")throw new Error("invalid tuple value");a=o.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in t))throw new Error(`missing value for component ${c.name}`);return t[c.name]})}if(a.length!==this.components.length)throw new Error("array is wrong length");a.forEach((c,u)=>{o[u].#e(e,c,n,l=>{a[u]=l})}),s(a);return}let i=n(this.type,t);i.then?e.push(async function(){s(await i)}()):s(i)}async walkAsync(e,t){let n=[],s=[e];return this.#e(n,e,t,i=>{s[0]=i}),n.length&&await Promise.all(n),s[0]}static from(e,t){if(wt.isParamType(e))return e;if(typeof e=="string")try{return wt.from(go(e),t)}catch{(0,Ze.assertArgument)(!1,"invalid param type","obj",e)}else if(e instanceof Gr){let a="",c="",u=null;wi(e,Or(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",u=e.popParams().map(p=>wt.from(p)),a=`tuple(${u.map(p=>p.format()).join(",")})`):(a=zT(e.popType("TYPE")),c=a);let l=null,f=null;for(;e.length&&e.peekType("BRACKET");){let p=e.pop();l=new wt(kt,"",a,c,null,u,f,l),f=p.value,a+=p.text,c="array",u=null}let d=null;if(wi(e,QL).has("indexed")){if(!t)throw new Error("");d=!0}let b=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new wt(kt,b,a,c,d,u,f,l)}let n=e.name;(0,Ze.assertArgument)(!n||typeof n=="string"&&n.match(nP),"invalid name","obj.name",n);let s=e.indexed;s!=null&&((0,Ze.assertArgument)(t,"parameter cannot be indexed","obj.indexed",e.indexed),s=!!s);let i=e.type,o=i.match(sj);if(o){let a=parseInt(o[2]||"-1"),c=wt.from({type:o[1],components:e.components});return new wt(kt,n||"",i,"array",s,null,a,c)}if(i==="tuple"||i.startsWith("tuple(")||i.startsWith("(")){let a=e.components!=null?e.components.map(u=>wt.from(u)):null;return new wt(kt,n||"",i,"tuple",s,a,null,null)}return i=zT(e.type),new wt(kt,n||"",i,i,s,null,null,null)}static isParamType(e){return e&&e[zr]===VT}};$t.ParamType=wt;var Ai=class{type;inputs;constructor(e,t,n){(0,Ze.assertPrivate)(e,kt,"Fragment"),n=Object.freeze(n.slice()),(0,Ze.defineProperties)(this,{type:t,inputs:n})}static from(e){if(typeof e=="string"){try{Ai.from(JSON.parse(e))}catch{}return Ai.from(go(e))}if(e instanceof Gr)switch(e.peekKeyword(tP)){case"constructor":return fs.from(e);case"error":return ls.from(e);case"event":return Bn.from(e);case"fallback":case"receive":return kn.from(e);case"function":return Sn.from(e);case"struct":return js.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return fs.from(e);case"error":return ls.from(e);case"event":return Bn.from(e);case"fallback":case"receive":return kn.from(e);case"function":return Sn.from(e);case"struct":return js.from(e)}(0,Ze.assert)(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}(0,Ze.assertArgument)(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return fs.isFragment(e)}static isError(e){return ls.isFragment(e)}static isEvent(e){return Bn.isFragment(e)}static isFunction(e){return Sn.isFragment(e)}static isStruct(e){return js.isFragment(e)}};$t.Fragment=Ai;var Ia=class extends Ai{name;constructor(e,t,n,s){super(e,t,s),(0,Ze.assertArgument)(typeof n=="string"&&n.match(nP),"invalid identifier","name",n),s=Object.freeze(s.slice()),(0,Ze.defineProperties)(this,{name:n})}};$t.NamedFragment=Ia;function Df(r,e){return"("+e.map(t=>t.format(r)).join(r==="full"?", ":",")+")"}var ls=class extends Ia{constructor(e,t,n){super(e,"error",t,n),Object.defineProperty(this,zr,{value:KT})}get selector(){return(0,F1.id)(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let t=[];return e!=="sighash"&&t.push("error"),t.push(this.name+Df(e,this.inputs)),t.join(" ")}static from(e){if(ls.isFragment(e))return e;if(typeof e=="string")return ls.from(go(e));if(e instanceof Gr){let t=ch("error",e),n=yi(e);return Na(e),new ls(kt,t,n)}return new ls(kt,e.name,e.inputs?e.inputs.map(wt.from):[])}static isFragment(e){return e&&e[zr]===KT}};$t.ErrorFragment=ls;var Bn=class extends Ia{anonymous;constructor(e,t,n,s){super(e,"event",t,n),Object.defineProperty(this,zr,{value:WT}),(0,Ze.defineProperties)(this,{anonymous:s})}get topicHash(){return(0,F1.id)(this.format("sighash"))}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let t=[];return e!=="sighash"&&t.push("event"),t.push(this.name+Df(e,this.inputs)),e!=="sighash"&&this.anonymous&&t.push("anonymous"),t.join(" ")}static getTopicHash(e,t){return t=(t||[]).map(s=>wt.from(s)),new Bn(kt,e,t,!1).topicHash}static from(e){if(Bn.isFragment(e))return e;if(typeof e=="string")try{return Bn.from(go(e))}catch{(0,Ze.assertArgument)(!1,"invalid event fragment","obj",e)}else if(e instanceof Gr){let t=ch("event",e),n=yi(e,!0),s=!!wi(e,Or(["anonymous"])).has("anonymous");return Na(e),new Bn(kt,t,n,s)}return new Bn(kt,e.name,e.inputs?e.inputs.map(t=>wt.from(t,!0)):[],!!e.anonymous)}static isFragment(e){return e&&e[zr]===WT}};$t.EventFragment=Bn;var fs=class extends Ai{payable;gas;constructor(e,t,n,s,i){super(e,t,n),Object.defineProperty(this,zr,{value:JT}),(0,Ze.defineProperties)(this,{payable:s,gas:i})}format(e){if((0,Ze.assert)(e!=null&&e!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),e==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let t=[`constructor${Df(e,this.inputs)}`];return this.payable&&t.push("payable"),this.gas!=null&&t.push(`@${this.gas.toString()}`),t.join(" ")}static from(e){if(fs.isFragment(e))return e;if(typeof e=="string")try{return fs.from(go(e))}catch{(0,Ze.assertArgument)(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof Gr){wi(e,Or(["constructor"]));let t=yi(e),n=!!wi(e,WL).has("payable"),s=oP(e);return Na(e),new fs(kt,"constructor",t,n,s)}return new fs(kt,"constructor",e.inputs?e.inputs.map(wt.from):[],!!e.payable,e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[zr]===JT}};$t.ConstructorFragment=fs;var kn=class extends Ai{payable;constructor(e,t,n){super(e,"fallback",t),Object.defineProperty(this,zr,{value:QT}),(0,Ze.defineProperties)(this,{payable:n})}format(e){let t=this.inputs.length===0?"receive":"fallback";if(e==="json"){let n=this.payable?"payable":"nonpayable";return JSON.stringify({type:t,stateMutability:n})}return`${t}()${this.payable?" payable":""}`}static from(e){if(kn.isFragment(e))return e;if(typeof e=="string")try{return kn.from(go(e))}catch{(0,Ze.assertArgument)(!1,"invalid fallback fragment","obj",e)}else if(e instanceof Gr){let t=e.toString(),n=e.peekKeyword(Or(["fallback","receive"]));if((0,Ze.assertArgument)(n,"type must be fallback or receive","obj",t),e.popKeyword(Or(["fallback","receive"]))==="receive"){let a=yi(e);return(0,Ze.assertArgument)(a.length===0,"receive cannot have arguments","obj.inputs",a),wi(e,Or(["payable"])),Na(e),new kn(kt,[],!0)}let i=yi(e);i.length?(0,Ze.assertArgument)(i.length===1&&i[0].type==="bytes","invalid fallback inputs","obj.inputs",i.map(a=>a.format("minimal")).join(", ")):i=[wt.from("bytes")];let o=iP(e);if((0,Ze.assertArgument)(o==="nonpayable"||o==="payable","fallback cannot be constants","obj.stateMutability",o),wi(e,Or(["returns"])).has("returns")){let a=yi(e);(0,Ze.assertArgument)(a.length===1&&a[0].type==="bytes","invalid fallback outputs","obj.outputs",a.map(c=>c.format("minimal")).join(", "))}return Na(e),new kn(kt,i,o==="payable")}if(e.type==="receive")return new kn(kt,[],!0);if(e.type==="fallback"){let t=[wt.from("bytes")],n=e.stateMutability==="payable";return new kn(kt,t,n)}(0,Ze.assertArgument)(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[zr]===QT}};$t.FallbackFragment=kn;var Sn=class extends Ia{constant;outputs;stateMutability;payable;gas;constructor(e,t,n,s,i,o){super(e,"function",t,s),Object.defineProperty(this,zr,{value:YT}),i=Object.freeze(i.slice());let a=n==="view"||n==="pure",c=n==="payable";(0,Ze.defineProperties)(this,{constant:a,gas:o,outputs:i,payable:c,stateMutability:n})}get selector(){return(0,F1.id)(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let t=[];return e!=="sighash"&&t.push("function"),t.push(this.name+Df(e,this.inputs)),e!=="sighash"&&(this.stateMutability!=="nonpayable"&&t.push(this.stateMutability),this.outputs&&this.outputs.length&&(t.push("returns"),t.push(Df(e,this.outputs))),this.gas!=null&&t.push(`@${this.gas.toString()}`)),t.join(" ")}static getSelector(e,t){return t=(t||[]).map(s=>wt.from(s)),new Sn(kt,e,"view",t,[],null).selector}static from(e){if(Sn.isFragment(e))return e;if(typeof e=="string")try{return Sn.from(go(e))}catch{(0,Ze.assertArgument)(!1,"invalid function fragment","obj",e)}else if(e instanceof Gr){let n=ch("function",e),s=yi(e),i=iP(e),o=[];wi(e,Or(["returns"])).has("returns")&&(o=yi(e));let a=oP(e);return Na(e),new Sn(kt,n,i,s,o,a)}let t=e.stateMutability;return t==null&&(t="payable",typeof e.constant=="boolean"?(t="view",e.constant||(t="payable",typeof e.payable=="boolean"&&!e.payable&&(t="nonpayable"))):typeof e.payable=="boolean"&&!e.payable&&(t="nonpayable")),new Sn(kt,e.name,t,e.inputs?e.inputs.map(wt.from):[],e.outputs?e.outputs.map(wt.from):[],e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[zr]===YT}};$t.FunctionFragment=Sn;var js=class extends Ia{constructor(e,t,n){super(e,"struct",t,n),Object.defineProperty(this,zr,{value:ZT})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return js.from(go(e))}catch{(0,Ze.assertArgument)(!1,"invalid struct fragment","obj",e)}else if(e instanceof Gr){let t=ch("struct",e),n=yi(e);return Na(e),new js(kt,t,n)}return new js(kt,e.name,e.inputs?e.inputs.map(wt.from):[])}static isFragment(e){return e&&e[zr]===ZT}};$t.StructFragment=js});var $1=M(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});fh.AbiCoder=void 0;var Hf=me(),aP=yn(),ij=Sv(),oj=Zy(),aj=Nv(),cj=t1(),uj=Rv(),lj=Mv(),fj=Lv(),dj=Uv(),lh=Dv(),D1=uh(),cP=Yt(),$f=me(),ds=new Map;ds.set(0,"GENERIC_PANIC");ds.set(1,"ASSERT_FALSE");ds.set(17,"OVERFLOW");ds.set(18,"DIVIDE_BY_ZERO");ds.set(33,"ENUM_RANGE_ERROR");ds.set(34,"BAD_STORAGE_DATA");ds.set(49,"STACK_UNDERFLOW");ds.set(50,"ARRAY_RANGE_ERROR");ds.set(65,"OUT_OF_MEMORY");ds.set(81,"UNINITIALIZED_FUNCTION_CALL");var pj=new RegExp(/^bytes([0-9]*)$/),hj=new RegExp(/^(u?int)([0-9]*)$/),H1=null,uP=1024;function mj(r,e,t,n){let s="missing revert data",i=null,o=null,a=null;if(t){s="execution reverted";let u=(0,$f.getBytes)(t);if(t=(0,$f.hexlify)(t),u.length===0)s+=" (no data present; likely require(false) occurred",i="require(false)";else if(u.length%32!==4)s+=" (could not decode reason; invalid data length)";else if((0,$f.hexlify)(u.slice(0,4))==="0x08c379a0")try{i=n.decode(["string"],u.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[i]},s+=`: ${JSON.stringify(i)}`}catch{s+=" (could not decode reason; invalid string data)"}else if((0,$f.hexlify)(u.slice(0,4))==="0x4e487b71")try{let l=Number(n.decode(["uint256"],u.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[l]},i=`Panic due to ${ds.get(l)||"UNKNOWN"}(${l})`,s+=`: ${i}`}catch{s+=" (could not decode panic code)"}else s+=" (unknown custom error)"}let c={to:e.to?(0,cP.getAddress)(e.to):null,data:e.data||"0x"};return e.from&&(c.from=(0,cP.getAddress)(e.from)),(0,$f.makeError)(s,"CALL_EXCEPTION",{action:r,data:t,reason:i,transaction:c,invocation:o,revert:a})}var hu=class{#e(e){if(e.isArray())return new oj.ArrayCoder(this.#e(e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new lh.TupleCoder(e.components.map(n=>this.#e(n)),e.name);switch(e.baseType){case"address":return new ij.AddressCoder(e.name);case"bool":return new aj.BooleanCoder(e.name);case"string":return new dj.StringCoder(e.name);case"bytes":return new cj.BytesCoder(e.name);case"":return new lj.NullCoder(e.name)}let t=e.type.match(hj);if(t){let n=parseInt(t[2]||"256");return(0,Hf.assertArgument)(n!==0&&n<=256&&n%8===0,"invalid "+t[1]+" bit length","param",e),new fj.NumberCoder(n/8,t[1]==="int",e.name)}if(t=e.type.match(pj),t){let n=parseInt(t[1]);return(0,Hf.assertArgument)(n!==0&&n<=32,"invalid bytes length","param",e),new uj.FixedBytesCoder(n,e.name)}(0,Hf.assertArgument)(!1,"invalid type","type",e.type)}getDefaultValue(e){let t=e.map(s=>this.#e(D1.ParamType.from(s)));return new lh.TupleCoder(t,"_").defaultValue()}encode(e,t){(0,Hf.assertArgumentCount)(t.length,e.length,"types/values length mismatch");let n=e.map(o=>this.#e(D1.ParamType.from(o))),s=new lh.TupleCoder(n,"_"),i=new aP.Writer;return s.encode(i,t),i.data}decode(e,t,n){let s=e.map(o=>this.#e(D1.ParamType.from(o)));return new lh.TupleCoder(s,"_").decode(new aP.Reader(t,n,uP))}static _setDefaultMaxInflation(e){(0,Hf.assertArgument)(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),uP=e}static defaultAbiCoder(){return H1==null&&(H1=new hu),H1}static getBuiltinCallException(e,t,n){return mj(e,t,n,hu.defaultAbiCoder())}};fh.AbiCoder=hu});var lP=M(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.decodeBytes32String=mu.encodeBytes32String=void 0;var dh=me();function bj(r){let e=(0,dh.toUtf8Bytes)(r);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,dh.zeroPadBytes)(e,32)}mu.encodeBytes32String=bj;function gj(r){let e=(0,dh.getBytes)(r,"bytes");if(e.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(e[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let t=31;for(;e[t-1]===0;)t--;return(0,dh.toUtf8String)(e.slice(0,t))}mu.decodeBytes32String=gj});var bP=M(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.Interface=xr.Indexed=xr.ErrorDescription=xr.TransactionDescription=xr.LogDescription=xr.Result=xr.checkResultErrors=void 0;var fP=nr(),dP=Ls(),we=me(),pP=$1(),G1=yn();Object.defineProperty(xr,"checkResultErrors",{enumerable:!0,get:function(){return G1.checkResultErrors}});Object.defineProperty(xr,"Result",{enumerable:!0,get:function(){return G1.Result}});var ps=uh(),q1=Is(),ph=class{fragment;name;signature;topic;args;constructor(e,t,n){let s=e.name,i=e.format();(0,we.defineProperties)(this,{fragment:e,name:s,signature:i,topic:t,args:n})}};xr.LogDescription=ph;var hh=class{fragment;name;args;signature;selector;value;constructor(e,t,n,s){let i=e.name,o=e.format();(0,we.defineProperties)(this,{fragment:e,name:i,args:n,signature:o,selector:t,value:s})}};xr.TransactionDescription=hh;var mh=class{fragment;name;args;signature;selector;constructor(e,t,n){let s=e.name,i=e.format();(0,we.defineProperties)(this,{fragment:e,name:s,args:n,signature:i,selector:t})}};xr.ErrorDescription=mh;var qf=class{hash;_isIndexed;static isIndexed(e){return!!(e&&e._isIndexed)}constructor(e){(0,we.defineProperties)(this,{hash:e,_isIndexed:!0})}};xr.Indexed=qf;var hP={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},mP={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:r=>`reverted with reason string ${JSON.stringify(r)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:r=>{let e="unknown panic code";return r>=0&&r<=255&&hP[r.toString()]&&(e=hP[r.toString()]),`reverted with panic code 0x${r.toString(16)} (${e})`}}},Ei=class{fragments;deploy;fallback;receive;#e;#t;#r;#n;constructor(e){let t=[];typeof e=="string"?t=JSON.parse(e):t=e,this.#r=new Map,this.#e=new Map,this.#t=new Map;let n=[];for(let o of t)try{n.push(ps.Fragment.from(o))}catch(a){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,a.message)}(0,we.defineProperties)(this,{fragments:Object.freeze(n)});let s=null,i=!1;this.#n=this.getAbiCoder(),this.fragments.forEach((o,a)=>{let c;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}(0,we.defineProperties)(this,{deploy:o});return;case"fallback":o.inputs.length===0?i=!0:((0,we.assertArgument)(!s||o.payable!==s.payable,"conflicting fallback fragments",`fragments[${a}]`,o),s=o,i=s.payable);return;case"function":c=this.#r;break;case"event":c=this.#t;break;case"error":c=this.#e;break;default:return}let u=o.format();c.has(u)||c.set(u,o)}),this.deploy||(0,we.defineProperties)(this,{deploy:ps.ConstructorFragment.from("constructor()")}),(0,we.defineProperties)(this,{fallback:s,receive:i})}format(e){let t=e?"minimal":"full";return this.fragments.map(s=>s.format(t))}formatJson(){let e=this.fragments.map(t=>t.format("json"));return JSON.stringify(e.map(t=>JSON.parse(t)))}getAbiCoder(){return pP.AbiCoder.defaultAbiCoder()}#s(e,t,n){if((0,we.isHexString)(e)){let i=e.toLowerCase();for(let o of this.#r.values())if(i===o.selector)return o;return null}if(e.indexOf("(")===-1){let i=[];for(let[o,a]of this.#r)o.split("(")[0]===e&&i.push(a);if(t){let o=t.length>0?t[t.length-1]:null,a=t.length,c=!0;q1.Typed.isTyped(o)&&o.type==="overrides"&&(c=!1,a--);for(let u=i.length-1;u>=0;u--){let l=i[u].inputs.length;l!==a&&(!c||l!==a-1)&&i.splice(u,1)}for(let u=i.length-1;u>=0;u--){let l=i[u].inputs;for(let f=0;f<t.length;f++)if(!!q1.Typed.isTyped(t[f])){if(f>=l.length){if(t[f].type==="overrides")continue;i.splice(u,1);break}if(t[f].type!==l[f].baseType){i.splice(u,1);break}}}}if(i.length===1&&t&&t.length!==i[0].inputs.length){let o=t[t.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&i.splice(0,1)}if(i.length===0)return null;if(i.length>1&&n){let o=i.map(a=>JSON.stringify(a.format())).join(", ");(0,we.assertArgument)(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return i[0]}let s=this.#r.get(ps.FunctionFragment.from(e).format());return s||null}getFunctionName(e){let t=this.#s(e,null,!1);return(0,we.assertArgument)(t,"no matching function","key",e),t.name}hasFunction(e){return!!this.#s(e,null,!1)}getFunction(e,t){return this.#s(e,t||null,!0)}forEachFunction(e){let t=Array.from(this.#r.keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){let s=t[n];e(this.#r.get(s),n)}}#o(e,t,n){if((0,we.isHexString)(e)){let i=e.toLowerCase();for(let o of this.#t.values())if(i===o.topicHash)return o;return null}if(e.indexOf("(")===-1){let i=[];for(let[o,a]of this.#t)o.split("(")[0]===e&&i.push(a);if(t){for(let o=i.length-1;o>=0;o--)i[o].inputs.length<t.length&&i.splice(o,1);for(let o=i.length-1;o>=0;o--){let a=i[o].inputs;for(let c=0;c<t.length;c++)if(!!q1.Typed.isTyped(t[c])&&t[c].type!==a[c].baseType){i.splice(o,1);break}}}if(i.length===0)return null;if(i.length>1&&n){let o=i.map(a=>JSON.stringify(a.format())).join(", ");(0,we.assertArgument)(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return i[0]}let s=this.#t.get(ps.EventFragment.from(e).format());return s||null}getEventName(e){let t=this.#o(e,null,!1);return(0,we.assertArgument)(t,"no matching event","key",e),t.name}hasEvent(e){return!!this.#o(e,null,!1)}getEvent(e,t){return this.#o(e,t||null,!0)}forEachEvent(e){let t=Array.from(this.#t.keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){let s=t[n];e(this.#t.get(s),n)}}getError(e,t){if((0,we.isHexString)(e)){let s=e.toLowerCase();if(mP[s])return ps.ErrorFragment.from(mP[s].signature);for(let i of this.#e.values())if(s===i.selector)return i;return null}if(e.indexOf("(")===-1){let s=[];for(let[i,o]of this.#e)i.split("(")[0]===e&&s.push(o);if(s.length===0)return e==="Error"?ps.ErrorFragment.from("error Error(string)"):e==="Panic"?ps.ErrorFragment.from("error Panic(uint256)"):null;if(s.length>1){let i=s.map(o=>JSON.stringify(o.format())).join(", ");(0,we.assertArgument)(!1,`ambiguous error description (i.e. ${i})`,"name",e)}return s[0]}if(e=ps.ErrorFragment.from(e).format(),e==="Error(string)")return ps.ErrorFragment.from("error Error(string)");if(e==="Panic(uint256)")return ps.ErrorFragment.from("error Panic(uint256)");let n=this.#e.get(e);return n||null}forEachError(e){let t=Array.from(this.#e.keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){let s=t[n];e(this.#e.get(s),n)}}_decodeParams(e,t){return this.#n.decode(e,t)}_encodeParams(e,t){return this.#n.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){if(typeof e=="string"){let n=this.getError(e);(0,we.assertArgument)(n,"unknown error","fragment",e),e=n}return(0,we.assertArgument)((0,we.dataSlice)(t,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",t),this._decodeParams(e.inputs,(0,we.dataSlice)(t,4))}encodeErrorResult(e,t){if(typeof e=="string"){let n=this.getError(e);(0,we.assertArgument)(n,"unknown error","fragment",e),e=n}return(0,we.concat)([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionData(e,t){if(typeof e=="string"){let n=this.getFunction(e);(0,we.assertArgument)(n,"unknown function","fragment",e),e=n}return(0,we.assertArgument)((0,we.dataSlice)(t,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",t),this._decodeParams(e.inputs,(0,we.dataSlice)(t,4))}encodeFunctionData(e,t){if(typeof e=="string"){let n=this.getFunction(e);(0,we.assertArgument)(n,"unknown function","fragment",e),e=n}return(0,we.concat)([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionResult(e,t){if(typeof e=="string"){let i=this.getFunction(e);(0,we.assertArgument)(i,"unknown function","fragment",e),e=i}let n="invalid length for result data",s=(0,we.getBytesCopy)(t);if(s.length%32===0)try{return this.#n.decode(e.outputs,s)}catch{n="could not decode result data"}(0,we.assert)(!1,n,"BAD_DATA",{value:(0,we.hexlify)(s),info:{method:e.name,signature:e.format()}})}makeError(e,t){let n=(0,we.getBytes)(e,"data"),s=pP.AbiCoder.getBuiltinCallException("call",t,n),i="execution reverted (unknown custom error)";if(s.message.startsWith(i)){let a=(0,we.hexlify)(n.slice(0,4)),c=this.getError(a);if(c)try{let u=this.#n.decode(c.inputs,n.slice(4));s.revert={name:c.name,signature:c.format(),args:u},s.reason=s.revert.signature,s.message=`execution reverted: ${s.reason}`}catch{s.message="execution reverted (coult not decode custom error)"}}let o=this.parseTransaction(t);return o&&(s.invocation={method:o.name,signature:o.signature,args:o.args}),s}encodeFunctionResult(e,t){if(typeof e=="string"){let n=this.getFunction(e);(0,we.assertArgument)(n,"unknown function","fragment",e),e=n}return(0,we.hexlify)(this.#n.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){if(typeof e=="string"){let i=this.getEvent(e);(0,we.assertArgument)(i,"unknown event","eventFragment",e),e=i}(0,we.assert)(t.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:t.length,expectedCount:e.inputs.length});let n=[];e.anonymous||n.push(e.topicHash);let s=(i,o)=>i.type==="string"?(0,dP.id)(o):i.type==="bytes"?(0,fP.keccak256)((0,we.hexlify)(o)):(i.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":i.type.match(/^u?int/)?o=(0,we.toBeHex)(o):i.type.match(/^bytes/)?o=(0,we.zeroPadBytes)(o,32):i.type==="address"&&this.#n.encode(["address"],[o]),(0,we.zeroPadValue)((0,we.hexlify)(o),32));for(t.forEach((i,o)=>{let a=e.inputs[o];if(!a.indexed){(0,we.assertArgument)(i==null,"cannot filter non-indexed parameters; must be null","contract."+a.name,i);return}i==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?(0,we.assertArgument)(!1,"filtering with tuples or arrays not supported","contract."+a.name,i):Array.isArray(i)?n.push(i.map(c=>s(a,c))):n.push(s(a,i))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,t){if(typeof e=="string"){let o=this.getEvent(e);(0,we.assertArgument)(o,"unknown event","eventFragment",e),e=o}let n=[],s=[],i=[];return e.anonymous||n.push(e.topicHash),(0,we.assertArgument)(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach((o,a)=>{let c=t[a];if(o.indexed)if(o.type==="string")n.push((0,dP.id)(c));else if(o.type==="bytes")n.push((0,fP.keccak256)(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(this.#n.encode([o.type],[c]))}else s.push(o),i.push(c)}),{data:this.#n.encode(s,i),topics:n}}decodeEventLog(e,t,n){if(typeof e=="string"){let h=this.getEvent(e);(0,we.assertArgument)(h,"unknown event","eventFragment",e),e=h}if(n!=null&&!e.anonymous){let h=e.topicHash;(0,we.assertArgument)((0,we.isHexString)(n[0],32)&&n[0].toLowerCase()===h,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}let s=[],i=[],o=[];e.inputs.forEach((h,b)=>{h.indexed?h.type==="string"||h.type==="bytes"||h.baseType==="tuple"||h.baseType==="array"?(s.push(ps.ParamType.from({type:"bytes32",name:h.name})),o.push(!0)):(s.push(h),o.push(!1)):(i.push(h),o.push(!1))});let a=n!=null?this.#n.decode(s,(0,we.concat)(n)):null,c=this.#n.decode(i,t,!0),u=[],l=[],f=0,d=0;return e.inputs.forEach((h,b)=>{let p=null;if(h.indexed)if(a==null)p=new qf(null);else if(o[b])p=new qf(a[d++]);else try{p=a[d++]}catch(g){p=g}else try{p=c[f++]}catch(g){p=g}u.push(p),l.push(h.name||null)}),G1.Result.fromItems(u,l)}parseTransaction(e){let t=(0,we.getBytes)(e.data,"tx.data"),n=(0,we.getBigInt)(e.value!=null?e.value:0,"tx.value"),s=this.getFunction((0,we.hexlify)(t.slice(0,4)));if(!s)return null;let i=this.#n.decode(s.inputs,t.slice(4));return new hh(s,s.selector,i,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new ph(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){let t=(0,we.hexlify)(e),n=this.getError((0,we.dataSlice)(t,0,4));if(!n)return null;let s=this.#n.decode(n.inputs,(0,we.dataSlice)(t,4));return new mh(n,n.selector,s)}static from(e){return e instanceof Ei?e:typeof e=="string"?new Ei(JSON.parse(e)):typeof e.formatJson=="function"?new Ei(e.formatJson()):typeof e.format=="function"?new Ei(e.format("json")):new Ei(e)}};xr.Interface=Ei});var bu=M(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.Typed=Le.Result=Le.TransactionDescription=Le.LogDescription=Le.ErrorDescription=Le.Interface=Le.Indexed=Le.checkResultErrors=Le.StructFragment=Le.ParamType=Le.NamedFragment=Le.FunctionFragment=Le.Fragment=Le.FallbackFragment=Le.EventFragment=Le.ErrorFragment=Le.ConstructorFragment=Le.encodeBytes32String=Le.decodeBytes32String=Le.AbiCoder=void 0;var xj=$1();Object.defineProperty(Le,"AbiCoder",{enumerable:!0,get:function(){return xj.AbiCoder}});var gP=lP();Object.defineProperty(Le,"decodeBytes32String",{enumerable:!0,get:function(){return gP.decodeBytes32String}});Object.defineProperty(Le,"encodeBytes32String",{enumerable:!0,get:function(){return gP.encodeBytes32String}});var vi=uh();Object.defineProperty(Le,"ConstructorFragment",{enumerable:!0,get:function(){return vi.ConstructorFragment}});Object.defineProperty(Le,"ErrorFragment",{enumerable:!0,get:function(){return vi.ErrorFragment}});Object.defineProperty(Le,"EventFragment",{enumerable:!0,get:function(){return vi.EventFragment}});Object.defineProperty(Le,"FallbackFragment",{enumerable:!0,get:function(){return vi.FallbackFragment}});Object.defineProperty(Le,"Fragment",{enumerable:!0,get:function(){return vi.Fragment}});Object.defineProperty(Le,"FunctionFragment",{enumerable:!0,get:function(){return vi.FunctionFragment}});Object.defineProperty(Le,"NamedFragment",{enumerable:!0,get:function(){return vi.NamedFragment}});Object.defineProperty(Le,"ParamType",{enumerable:!0,get:function(){return vi.ParamType}});Object.defineProperty(Le,"StructFragment",{enumerable:!0,get:function(){return vi.StructFragment}});var Ra=bP();Object.defineProperty(Le,"checkResultErrors",{enumerable:!0,get:function(){return Ra.checkResultErrors}});Object.defineProperty(Le,"Indexed",{enumerable:!0,get:function(){return Ra.Indexed}});Object.defineProperty(Le,"Interface",{enumerable:!0,get:function(){return Ra.Interface}});Object.defineProperty(Le,"ErrorDescription",{enumerable:!0,get:function(){return Ra.ErrorDescription}});Object.defineProperty(Le,"LogDescription",{enumerable:!0,get:function(){return Ra.LogDescription}});Object.defineProperty(Le,"TransactionDescription",{enumerable:!0,get:function(){return Ra.TransactionDescription}});Object.defineProperty(Le,"Result",{enumerable:!0,get:function(){return Ra.Result}});var yj=Is();Object.defineProperty(Le,"Typed",{enumerable:!0,get:function(){return yj.Typed}})});var yu=M(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.TransactionResponse=Vr.TransactionReceipt=Vr.Log=Vr.Block=Vr.copyRequest=Vr.FeeData=void 0;var At=me(),wj=qr(),xP=BigInt(0);function gu(r){return r??null}function Ut(r){return r==null?null:r.toString()}var z1=class{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(e,t,n){(0,At.defineProperties)(this,{gasPrice:gu(e),maxFeePerGas:gu(t),maxPriorityFeePerGas:gu(n)})}toJSON(){let{gasPrice:e,maxFeePerGas:t,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:Ut(e),maxFeePerGas:Ut(t),maxPriorityFeePerGas:Ut(n)}}};Vr.FeeData=z1;function Aj(r){let e={};r.to&&(e.to=r.to),r.from&&(e.from=r.from),r.data&&(e.data=(0,At.hexlify)(r.data));let t="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(let s of t)!(s in r)||r[s]==null||(e[s]=(0,At.getBigInt)(r[s],`request.${s}`));let n="type,nonce".split(/,/);for(let s of n)!(s in r)||r[s]==null||(e[s]=(0,At.getNumber)(r[s],`request.${s}`));return r.accessList&&(e.accessList=(0,wj.accessListify)(r.accessList)),"blockTag"in r&&(e.blockTag=r.blockTag),"enableCcipRead"in r&&(e.enableCcipRead=!!r.enableCcipRead),"customData"in r&&(e.customData=r.customData),"blobVersionedHashes"in r&&r.blobVersionedHashes&&(e.blobVersionedHashes=r.blobVersionedHashes.slice()),"kzg"in r&&(e.kzg=r.kzg),"blobs"in r&&r.blobs&&(e.blobs=r.blobs.map(s=>(0,At.isBytesLike)(s)?(0,At.hexlify)(s):Object.assign({},s))),e}Vr.copyRequest=Aj;var V1=class{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#e;constructor(e,t){this.#e=e.transactions.map(n=>typeof n!="string"?new xu(n,t):n),(0,At.defineProperties)(this,{provider:t,hash:gu(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:gu(e.prevRandao),extraData:e.extraData,baseFeePerGas:gu(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return this.#e.map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){let e=this.#e.slice();return e.length===0?[]:((0,At.assert)(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){let{baseFeePerGas:e,difficulty:t,extraData:n,gasLimit:s,gasUsed:i,hash:o,miner:a,prevRandao:c,nonce:u,number:l,parentHash:f,parentBeaconBlockRoot:d,stateRoot:h,receiptsRoot:b,timestamp:p,transactions:g}=this;return{_type:"Block",baseFeePerGas:Ut(e),difficulty:Ut(t),extraData:n,gasLimit:Ut(s),gasUsed:Ut(i),blobGasUsed:Ut(this.blobGasUsed),excessBlobGas:Ut(this.excessBlobGas),hash:o,miner:a,prevRandao:c,nonce:u,number:l,parentHash:f,timestamp:p,parentBeaconBlockRoot:d,stateRoot:h,receiptsRoot:b,transactions:g}}[Symbol.iterator](){let e=0,t=this.transactions;return{next:()=>e<this.length?{value:t[e++],done:!1}:{value:void 0,done:!0}}}get length(){return this.#e.length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let t;if(typeof e=="number")t=this.#e[e];else{let n=e.toLowerCase();for(let s of this.#e)if(typeof s=="string"){if(s!==n)continue;t=s;break}else{if(s.hash===n)continue;t=s;break}}if(t==null)throw new Error("no such tx");return typeof t=="string"?await this.provider.getTransaction(t):t}getPrefetchedTransaction(e){let t=this.prefetchedTransactions;if(typeof e=="number")return t[e];e=e.toLowerCase();for(let n of t)if(n.hash===e)return n;(0,At.assertArgument)(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return Ej(this)}};Vr.Block=V1;var bh=class{provider;transactionHash;blockHash;blockNumber;removed;address;data;topics;index;transactionIndex;constructor(e,t){this.provider=t;let n=Object.freeze(e.topics.slice());(0,At.defineProperties)(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:n,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){let{address:e,blockHash:t,blockNumber:n,data:s,index:i,removed:o,topics:a,transactionHash:c,transactionIndex:u}=this;return{_type:"log",address:e,blockHash:t,blockNumber:n,data:s,index:i,removed:o,topics:a,transactionHash:c,transactionIndex:u}}async getBlock(){let e=await this.provider.getBlock(this.blockHash);return(0,At.assert)(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){let e=await this.provider.getTransaction(this.transactionHash);return(0,At.assert)(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){let e=await this.provider.getTransactionReceipt(this.transactionHash);return(0,At.assert)(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return vj(this)}};Vr.Log=bh;var K1=class{provider;to;from;contractAddress;hash;index;blockHash;blockNumber;logsBloom;gasUsed;blobGasUsed;cumulativeGasUsed;gasPrice;blobGasPrice;type;status;root;#e;constructor(e,t){this.#e=Object.freeze(e.logs.map(s=>new bh(s,t)));let n=xP;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),(0,At.defineProperties)(this,{provider:t,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:n,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return this.#e}toJSON(){let{to:e,from:t,contractAddress:n,hash:s,index:i,blockHash:o,blockNumber:a,logsBloom:c,logs:u,status:l,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:a,contractAddress:n,cumulativeGasUsed:Ut(this.cumulativeGasUsed),from:t,gasPrice:Ut(this.gasPrice),blobGasUsed:Ut(this.blobGasUsed),blobGasPrice:Ut(this.blobGasPrice),gasUsed:Ut(this.gasUsed),hash:s,index:i,logs:u,logsBloom:c,root:f,status:l,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){let e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){let e=await this.provider.getTransaction(this.hash);if(e==null)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return wP(this)}reorderedEvent(e){return(0,At.assert)(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),yP(this,e)}};Vr.TransactionReceipt=K1;var xu=class{provider;blockNumber;blockHash;index;hash;type;to;from;nonce;gasLimit;gasPrice;maxPriorityFeePerGas;maxFeePerGas;maxFeePerBlobGas;data;value;chainId;signature;accessList;blobVersionedHashes;#e;constructor(e,t){this.provider=t,this.blockNumber=e.blockNumber!=null?e.blockNumber:null,this.blockHash=e.blockHash!=null?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=e.maxPriorityFeePerGas!=null?e.maxPriorityFeePerGas:null,this.maxFeePerGas=e.maxFeePerGas!=null?e.maxFeePerGas:null,this.maxFeePerBlobGas=e.maxFeePerBlobGas!=null?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,this.blobVersionedHashes=e.blobVersionedHashes!=null?e.blobVersionedHashes:null,this.#e=-1}toJSON(){let{blockNumber:e,blockHash:t,index:n,hash:s,type:i,to:o,from:a,nonce:c,data:u,signature:l,accessList:f,blobVersionedHashes:d}=this;return{_type:"TransactionResponse",accessList:f,blockNumber:e,blockHash:t,blobVersionedHashes:d,chainId:Ut(this.chainId),data:u,from:a,gasLimit:Ut(this.gasLimit),gasPrice:Ut(this.gasPrice),hash:s,maxFeePerGas:Ut(this.maxFeePerGas),maxPriorityFeePerGas:Ut(this.maxPriorityFeePerGas),maxFeePerBlobGas:Ut(this.maxFeePerBlobGas),nonce:c,signature:l,to:o,index:n,type:i,value:Ut(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){let n=await this.getTransaction();n&&(e=n.blockNumber)}if(e==null)return null;let t=this.provider.getBlock(e);if(t==null)throw new Error("TODO");return t}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){let{tx:t,blockNumber:n}=await(0,At.resolveProperties)({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return t==null||t.blockNumber==null?0:n-t.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,t){let n=e??1,s=t??0,i=this.#e,o=-1,a=i===-1,c=async()=>{if(a)return null;let{blockNumber:d,nonce:h}=await(0,At.resolveProperties)({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(h<this.nonce){i=d;return}if(a)return null;let b=await this.getTransaction();if(!(b&&b.blockNumber!=null))for(o===-1&&(o=i-3,o<this.#e&&(o=this.#e));o<=d;){if(a)return null;let p=await this.provider.getBlock(o,!0);if(p==null)return;for(let g of p)if(g===this.hash)return;for(let g=0;g<p.length;g++){let m=await p.getTransaction(g);if(m.from===this.from&&m.nonce===this.nonce){if(a)return null;let y=await this.provider.getTransactionReceipt(m.hash);if(y==null||d-y.blockNumber+1<n)return;let E="replaced";m.data===this.data&&m.to===this.to&&m.value===this.value?E="repriced":m.data==="0x"&&m.from===m.to&&m.value===xP&&(E="cancelled"),(0,At.assert)(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:E==="replaced"||E==="cancelled",reason:E,replacement:m.replaceableTransaction(i),hash:m.hash,receipt:y})}}o++}},u=d=>{if(d==null||d.status!==0)return d;(0,At.assert)(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:d.to,from:d.from,data:""},receipt:d})},l=await this.provider.getTransactionReceipt(this.hash);if(n===0)return u(l);if(l){if(await l.confirmations()>=n)return u(l)}else if(await c(),n===0)return null;return await new Promise((d,h)=>{let b=[],p=()=>{b.forEach(m=>m())};if(b.push(()=>{a=!0}),s>0){let m=setTimeout(()=>{p(),h((0,At.makeError)("wait for transaction timeout","TIMEOUT"))},s);b.push(()=>{clearTimeout(m)})}let g=async m=>{if(await m.confirmations()>=n){p();try{d(u(m))}catch(y){h(y)}}};if(b.push(()=>{this.provider.off(this.hash,g)}),this.provider.on(this.hash,g),i>=0){let m=async()=>{try{await c()}catch(y){if((0,At.isError)(y,"TRANSACTION_REPLACED")){p(),h(y);return}}a||this.provider.once("block",m)};b.push(()=>{this.provider.off("block",m)}),this.provider.once("block",m)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return(0,At.assert)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),wP(this)}reorderedEvent(e){return(0,At.assert)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),(0,At.assert)(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),yP(this,e)}replaceableTransaction(e){(0,At.assertArgument)(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);let t=new xu(this,this.provider);return t.#e=e,t}};Vr.TransactionResponse=xu;function Ej(r){return{orphan:"drop-block",hash:r.hash,number:r.number}}function yP(r,e){return{orphan:"reorder-transaction",tx:r,other:e}}function wP(r){return{orphan:"drop-transaction",tx:r}}function vj(r){return{orphan:"drop-log",log:{transactionHash:r.transactionHash,blockHash:r.blockHash,blockNumber:r.blockNumber,address:r.address,data:r.data,topics:Object.freeze(r.topics.slice()),index:r.index}}}});var Q1=M(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.ContractEventPayload=Kr.ContractUnknownEventPayload=Kr.ContractTransactionResponse=Kr.ContractTransactionReceipt=Kr.UndecodedEventLog=Kr.EventLog=void 0;var wh=yu(),Gf=me(),zf=class extends wh.Log{interface;fragment;args;constructor(e,t,n){super(e,e.provider);let s=t.decodeEventLog(n,e.data,e.topics);(0,Gf.defineProperties)(this,{args:s,fragment:n,interface:t})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}};Kr.EventLog=zf;var gh=class extends wh.Log{error;constructor(e,t){super(e,e.provider),(0,Gf.defineProperties)(this,{error:t})}};Kr.UndecodedEventLog=gh;var xh=class extends wh.TransactionReceipt{#e;constructor(e,t,n){super(n,t),this.#e=e}get logs(){return super.logs.map(e=>{let t=e.topics.length?this.#e.getEvent(e.topics[0]):null;if(t)try{return new zf(e,this.#e,t)}catch(n){return new gh(e,n)}return e})}};Kr.ContractTransactionReceipt=xh;var W1=class extends wh.TransactionResponse{#e;constructor(e,t,n){super(n,t),this.#e=e}async wait(e,t){let n=await super.wait(e,t);return n==null?null:new xh(this.#e,this.provider,n)}};Kr.ContractTransactionResponse=W1;var yh=class extends Gf.EventPayload{log;constructor(e,t,n,s){super(e,t,n),(0,Gf.defineProperties)(this,{log:s})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}};Kr.ContractUnknownEventPayload=yh;var J1=class extends yh{constructor(e,t,n,s,i){super(e,t,n,new zf(i,e.interface,s));let o=e.interface.decodeEventLog(s,this.log.data,this.log.topics);(0,Gf.defineProperties)(this,{args:o,fragment:s})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}};Kr.ContractEventPayload=J1});var sw=M(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.Contract=Us.BaseContract=Us.resolveArgs=Us.copyOverrides=void 0;var tw=bu(),wu=Yt(),vP=yu(),Ie=me(),La=Q1(),AP=BigInt(0);function TP(r){return r&&typeof r.call=="function"}function PP(r){return r&&typeof r.estimateGas=="function"}function vh(r){return r&&typeof r.resolveName=="function"}function kP(r){return r&&typeof r.sendTransaction=="function"}function BP(r){if(r!=null){if(vh(r))return r;if(r.provider)return r.provider}}var Y1=class{#e;fragment;constructor(e,t,n){if((0,Ie.defineProperties)(this,{fragment:t}),t.inputs.length<n.length)throw new Error("too many arguments");let s=ja(e.runner,"resolveName"),i=vh(s)?s:null;this.#e=async function(){let o=await Promise.all(t.inputs.map((a,c)=>n[c]==null?null:a.walkAsync(n[c],(l,f)=>l==="address"?Array.isArray(f)?Promise.all(f.map(d=>(0,wu.resolveAddress)(d,i))):(0,wu.resolveAddress)(f,i):f)));return e.interface.encodeFilterTopics(t,o)}()}getTopicFilter(){return this.#e}};function ja(r,e){return r==null?null:typeof r[e]=="function"?r:r.provider&&typeof r.provider[e]=="function"?r.provider:null}function Ma(r){return r==null?null:r.provider||null}async function rw(r,e){let t=tw.Typed.dereference(r,"overrides");(0,Ie.assertArgument)(typeof t=="object","invalid overrides parameter","overrides",r);let n=(0,vP.copyRequest)(t);return(0,Ie.assertArgument)(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),(0,Ie.assertArgument)(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}Us.copyOverrides=rw;async function SP(r,e,t){let n=ja(r,"resolveName"),s=vh(n)?n:null;return await Promise.all(e.map((i,o)=>i.walkAsync(t[o],(a,c)=>(c=tw.Typed.dereference(c,a),a==="address"?(0,wu.resolveAddress)(c,s):c))))}Us.resolveArgs=SP;function Tj(r){let e=async function(o){let a=await rw(o,["data"]);a.to=await r.getAddress(),a.from&&(a.from=await(0,wu.resolveAddress)(a.from,BP(r.runner)));let c=r.interface,u=(0,Ie.getBigInt)(a.value||AP,"overrides.value")===AP,l=(a.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!l&&!u&&(0,Ie.assertArgument)(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),(0,Ie.assertArgument)(c.fallback||l,"cannot send data to receive-only contract","overrides.data",a.data);let f=c.receive||c.fallback&&c.fallback.payable;return(0,Ie.assertArgument)(f||u,"cannot send value to non-payable fallback","overrides.value",a.value),(0,Ie.assertArgument)(c.fallback||l,"cannot send data to receive-only contract","overrides.data",a.data),a},t=async function(o){let a=ja(r.runner,"call");(0,Ie.assert)(TP(a),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});let c=await e(o);try{return await a.call(c)}catch(u){throw(0,Ie.isCallException)(u)&&u.data?r.interface.makeError(u.data,c):u}},n=async function(o){let a=r.runner;(0,Ie.assert)(kP(a),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let c=await a.sendTransaction(await e(o)),u=Ma(r.runner);return new La.ContractTransactionResponse(r.interface,u,c)},s=async function(o){let a=ja(r.runner,"estimateGas");return(0,Ie.assert)(PP(a),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await a.estimateGas(await e(o))},i=async o=>await n(o);return(0,Ie.defineProperties)(i,{_contract:r,estimateGas:s,populateTransaction:e,send:n,staticCall:t}),i}function Pj(r,e){let t=function(...u){let l=r.interface.getFunction(e,u);return(0,Ie.assert)(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:u}}),l},n=async function(...u){let l=t(...u),f={};if(l.inputs.length+1===u.length&&(f=await rw(u.pop()),f.from&&(f.from=await(0,wu.resolveAddress)(f.from,BP(r.runner)))),l.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");let d=await SP(r.runner,l.inputs,u);return Object.assign({},f,await(0,Ie.resolveProperties)({to:r.getAddress(),data:r.interface.encodeFunctionData(l,d)}))},s=async function(...u){let l=await a(...u);return l.length===1?l[0]:l},i=async function(...u){let l=r.runner;(0,Ie.assert)(kP(l),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let f=await l.sendTransaction(await n(...u)),d=Ma(r.runner);return new La.ContractTransactionResponse(r.interface,d,f)},o=async function(...u){let l=ja(r.runner,"estimateGas");return(0,Ie.assert)(PP(l),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await l.estimateGas(await n(...u))},a=async function(...u){let l=ja(r.runner,"call");(0,Ie.assert)(TP(l),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});let f=await n(...u),d="0x";try{d=await l.call(f)}catch(b){throw(0,Ie.isCallException)(b)&&b.data?r.interface.makeError(b.data,f):b}let h=t(...u);return r.interface.decodeFunctionResult(h,d)},c=async(...u)=>t(...u).constant?await s(...u):await i(...u);return(0,Ie.defineProperties)(c,{name:r.interface.getFunctionName(e),_contract:r,_key:e,getFragment:t,estimateGas:o,populateTransaction:n,send:i,staticCall:s,staticCallResult:a}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{let u=r.interface.getFunction(e);return(0,Ie.assert)(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),u}}),c}function kj(r,e){let t=function(...s){let i=r.interface.getEvent(e,s);return(0,Ie.assert)(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:s}}),i},n=function(...s){return new Y1(r,t(...s),s)};return(0,Ie.defineProperties)(n,{name:r.interface.getEventName(e),_contract:r,_key:e,getFragment:t}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{let s=r.interface.getEvent(e);return(0,Ie.assert)(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),s}}),n}var Eh=Symbol.for("_ethersInternal_contract"),OP=new WeakMap;function Bj(r,e){OP.set(r[Eh],e)}function an(r){return OP.get(r[Eh])}function Sj(r){return r&&typeof r=="object"&&"getTopicFilter"in r&&typeof r.getTopicFilter=="function"&&r.fragment}async function nw(r,e){let t,n=null;if(Array.isArray(e)){let i=function(o){if((0,Ie.isHexString)(o,32))return o;let a=r.interface.getEvent(o);return(0,Ie.assertArgument)(a,"unknown fragment","name",o),a.topicHash};t=e.map(o=>o==null?null:Array.isArray(o)?o.map(i):i(o))}else e==="*"?t=[null]:typeof e=="string"?(0,Ie.isHexString)(e,32)?t=[e]:(n=r.interface.getEvent(e),(0,Ie.assertArgument)(n,"unknown fragment","event",e),t=[n.topicHash]):Sj(e)?t=await e.getTopicFilter():"fragment"in e?(n=e.fragment,t=[n.topicHash]):(0,Ie.assertArgument)(!1,"unknown event name","event",e);t=t.map(i=>{if(i==null)return null;if(Array.isArray(i)){let o=Array.from(new Set(i.map(a=>a.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return i.toLowerCase()});let s=t.map(i=>i==null?"null":Array.isArray(i)?i.join("|"):i).join("&");return{fragment:n,tag:s,topics:t}}async function Vf(r,e){let{subs:t}=an(r);return t.get((await nw(r,e)).tag)||null}async function EP(r,e,t){let n=Ma(r.runner);(0,Ie.assert)(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});let{fragment:s,tag:i,topics:o}=await nw(r,t),{addr:a,subs:c}=an(r),u=c.get(i);if(!u){let f={address:a||r,topics:o},d=g=>{let m=s;if(m==null)try{m=r.interface.getEvent(g.topics[0])}catch{}if(m){let y=m,E=s?r.interface.decodeEventLog(s,g.data,g.topics):[];X1(r,t,E,v=>new La.ContractEventPayload(r,v,t,y,g))}else X1(r,t,[],y=>new La.ContractUnknownEventPayload(r,y,t,g))},h=[];u={tag:i,listeners:[],start:()=>{h.length||h.push(n.on(f,d))},stop:async()=>{if(h.length==0)return;let g=h;h=[],await Promise.all(g),n.off(f,d)}},c.set(i,u)}return u}var Z1=Promise.resolve();async function Oj(r,e,t,n){await Z1;let s=await Vf(r,e);if(!s)return!1;let i=s.listeners.length;return s.listeners=s.listeners.filter(({listener:o,once:a})=>{let c=Array.from(t);n&&c.push(n(a?null:o));try{o.call(r,...c)}catch{}return!a}),s.listeners.length===0&&(s.stop(),an(r).subs.delete(s.tag)),i>0}async function X1(r,e,t,n){try{await Z1}catch{}let s=Oj(r,e,t,n);return Z1=s,await s}var Ah=["then"],xo=class{target;interface;runner;filters;[Eh];fallback;constructor(e,t,n,s){(0,Ie.assertArgument)(typeof e=="string"||(0,wu.isAddressable)(e),"invalid value for Contract target","target",e),n==null&&(n=null);let i=tw.Interface.from(t);(0,Ie.defineProperties)(this,{target:e,runner:n,interface:i}),Object.defineProperty(this,Eh,{value:{}});let o,a=null,c=null;if(s){let f=Ma(n);c=new La.ContractTransactionResponse(this.interface,f,s)}let u=new Map;if(typeof e=="string")if((0,Ie.isHexString)(e))a=e,o=Promise.resolve(e);else{let f=ja(n,"resolveName");if(!vh(f))throw(0,Ie.makeError)("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(d=>{if(d==null)throw(0,Ie.makeError)("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return an(this).addr=d,d})}else o=e.getAddress().then(f=>{if(f==null)throw new Error("TODO");return an(this).addr=f,f});Bj(this,{addrPromise:o,addr:a,deployTx:c,subs:u});let l=new Proxy({},{get:(f,d,h)=>{if(typeof d=="symbol"||Ah.indexOf(d)>=0)return Reflect.get(f,d,h);try{return this.getEvent(d)}catch(b){if(!(0,Ie.isError)(b,"INVALID_ARGUMENT")||b.argument!=="key")throw b}},has:(f,d)=>Ah.indexOf(d)>=0?Reflect.has(f,d):Reflect.has(f,d)||this.interface.hasEvent(String(d))});return(0,Ie.defineProperties)(this,{filters:l}),(0,Ie.defineProperties)(this,{fallback:i.receive||i.fallback?Tj(this):null}),new Proxy(this,{get:(f,d,h)=>{if(typeof d=="symbol"||d in f||Ah.indexOf(d)>=0)return Reflect.get(f,d,h);try{return f.getFunction(d)}catch(b){if(!(0,Ie.isError)(b,"INVALID_ARGUMENT")||b.argument!=="key")throw b}},has:(f,d)=>typeof d=="symbol"||d in f||Ah.indexOf(d)>=0?Reflect.has(f,d):f.interface.hasFunction(d)})}connect(e){return new xo(this.target,this.interface,e)}attach(e){return new xo(e,this.interface,this.runner)}async getAddress(){return await an(this).addrPromise}async getDeployedCode(){let e=Ma(this.runner);(0,Ie.assert)(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});let t=await e.getCode(await this.getAddress());return t==="0x"?null:t}async waitForDeployment(){let e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;let n=Ma(this.runner);return(0,Ie.assert)(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((s,i)=>{let o=async()=>{try{if(await this.getDeployedCode()!=null)return s(this);n.once("block",o)}catch(a){i(a)}};o()})}deploymentTransaction(){return an(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),Pj(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),kj(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,n){t==null&&(t=0),n==null&&(n="latest");let{addr:s,addrPromise:i}=an(this),o=s||await i,{fragment:a,topics:c}=await nw(this,e),u={address:o,topics:c,fromBlock:t,toBlock:n},l=Ma(this.runner);return(0,Ie.assert)(l,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await l.getLogs(u)).map(f=>{let d=a;if(d==null)try{d=this.interface.getEvent(f.topics[0])}catch{}if(d)try{return new La.EventLog(f,this.interface,d)}catch(h){return new La.UndecodedEventLog(f,h)}return new vP.Log(f,l)})}async on(e,t){let n=await EP(this,"on",e);return n.listeners.push({listener:t,once:!1}),n.start(),this}async once(e,t){let n=await EP(this,"once",e);return n.listeners.push({listener:t,once:!0}),n.start(),this}async emit(e,...t){return await X1(this,e,t,null)}async listenerCount(e){if(e){let s=await Vf(this,e);return s?s.listeners.length:0}let{subs:t}=an(this),n=0;for(let{listeners:s}of t.values())n+=s.length;return n}async listeners(e){if(e){let s=await Vf(this,e);return s?s.listeners.map(({listener:i})=>i):[]}let{subs:t}=an(this),n=[];for(let{listeners:s}of t.values())n=n.concat(s.map(({listener:i})=>i));return n}async off(e,t){let n=await Vf(this,e);if(!n)return this;if(t){let s=n.listeners.map(({listener:i})=>i).indexOf(t);s>=0&&n.listeners.splice(s,1)}return(t==null||n.listeners.length===0)&&(n.stop(),an(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){let t=await Vf(this,e);if(!t)return this;t.stop(),an(this).subs.delete(t.tag)}else{let{subs:t}=an(this);for(let{tag:n,stop:s}of t.values())s(),t.delete(n)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){class t extends xo{constructor(s,i=null){super(s,e,i)}}return t}static from(e,t,n){return n==null&&(n=null),new this(e,t,n)}};Us.BaseContract=xo;function _j(){return xo}var ew=class extends _j(){};Us.Contract=ew});var _P=M(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});Ph.ContractFactory=void 0;var Cj=bu(),Nj=Yt(),yo=me(),Th=sw(),Kf=class{interface;bytecode;runner;constructor(e,t,n){let s=Cj.Interface.from(e);t instanceof Uint8Array||(typeof t=="object"&&(t=t.object),t.startsWith("0x")||(t="0x"+t)),t=(0,yo.hexlify)((0,yo.getBytes)(t)),(0,yo.defineProperties)(this,{bytecode:t,interface:s,runner:n||null})}attach(e){return new Th.BaseContract(e,this.interface,this.runner)}async getDeployTransaction(...e){let t={},n=this.interface.deploy;if(n.inputs.length+1===e.length&&(t=await(0,Th.copyOverrides)(e.pop())),n.inputs.length!==e.length)throw new Error("incorrect number of arguments to constructor");let s=await(0,Th.resolveArgs)(this.runner,n.inputs,e),i=(0,yo.concat)([this.bytecode,this.interface.encodeDeploy(s)]);return Object.assign({},t,{data:i})}async deploy(...e){let t=await this.getDeployTransaction(...e);(0,yo.assert)(this.runner&&typeof this.runner.sendTransaction=="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let n=await this.runner.sendTransaction(t),s=(0,Nj.getCreateAddress)(n);return new Th.BaseContract(s,this.interface,this.runner,n)}connect(e){return new Kf(this.interface,this.bytecode,e)}static fromSolidity(e,t){(0,yo.assertArgument)(e!=null,"bad compiler output","output",e),typeof e=="string"&&(e=JSON.parse(e));let n=e.abi,s="";return e.bytecode?s=e.bytecode:e.evm&&e.evm.bytecode&&(s=e.evm.bytecode),new this(n,s,t)}};Ph.ContractFactory=Kf});var Wf=M(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.UndecodedEventLog=qt.EventLog=qt.ContractTransactionResponse=qt.ContractTransactionReceipt=qt.ContractUnknownEventPayload=qt.ContractEventPayload=qt.ContractFactory=qt.Contract=qt.BaseContract=void 0;var CP=sw();Object.defineProperty(qt,"BaseContract",{enumerable:!0,get:function(){return CP.BaseContract}});Object.defineProperty(qt,"Contract",{enumerable:!0,get:function(){return CP.Contract}});var Ij=_P();Object.defineProperty(qt,"ContractFactory",{enumerable:!0,get:function(){return Ij.ContractFactory}});var Au=Q1();Object.defineProperty(qt,"ContractEventPayload",{enumerable:!0,get:function(){return Au.ContractEventPayload}});Object.defineProperty(qt,"ContractUnknownEventPayload",{enumerable:!0,get:function(){return Au.ContractUnknownEventPayload}});Object.defineProperty(qt,"ContractTransactionReceipt",{enumerable:!0,get:function(){return Au.ContractTransactionReceipt}});Object.defineProperty(qt,"ContractTransactionResponse",{enumerable:!0,get:function(){return Au.ContractTransactionResponse}});Object.defineProperty(qt,"EventLog",{enumerable:!0,get:function(){return Au.EventLog}});Object.defineProperty(qt,"UndecodedEventLog",{enumerable:!0,get:function(){return Au.UndecodedEventLog}})});var uw=M(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.EnsResolver=Eo.BasicMulticoinProviderPlugin=Eo.MulticoinProviderPlugin=void 0;var Rj=Yt(),NP=Xc(),iw=Wf(),ow=Ls(),_r=me();function aw(r){return r.match(/^ipfs:\/\/ipfs\//i)?r=r.substring(12):r.match(/^ipfs:\/\//i)?r=r.substring(7):(0,_r.assertArgument)(!1,"unsupported IPFS format","link",r),`https://gateway.ipfs.io/ipfs/${r}`}var Qf=class{name;constructor(e){(0,_r.defineProperties)(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,t){throw new Error("unsupported coin")}async decodeAddress(e,t){throw new Error("unsupported coin")}};Eo.MulticoinProviderPlugin=Qf;var Mj="org.ethers.plugins.provider.BasicMulticoin",cw=class extends Qf{constructor(){super(Mj)}};Eo.BasicMulticoinProviderPlugin=cw;var RP=new RegExp("^(ipfs)://(.*)$","i"),IP=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),RP,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")],wo,Ua,Ao,Eu,Bh,MP,Jf=class{constructor(e,t,n){vs(this,Ao);tn(this,"provider");tn(this,"address");tn(this,"name");vs(this,wo,void 0);vs(this,Ua,void 0);(0,_r.defineProperties)(this,{provider:e,address:t,name:n}),Jl(this,wo,null),Jl(this,Ua,new iw.Contract(t,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return fc(this,wo)==null&&Jl(this,wo,(async()=>{try{return await fc(this,Ua).supportsInterface("0x9061b923")}catch(e){if((0,_r.isError)(e,"CALL_EXCEPTION"))return!1;throw Jl(this,wo,null),e}})()),await fc(this,wo)}async getAddress(e){if(e==null&&(e=60),e===60)try{let i=await ur(this,Ao,Eu).call(this,"addr(bytes32)");return i==null||i===NP.ZeroAddress?null:i}catch(i){if((0,_r.isError)(i,"CALL_EXCEPTION"))return null;throw i}if(e>=0&&e<2147483648){let i=e+2147483648,o=await ur(this,Ao,Eu).call(this,"addr(bytes32,uint)",[i]);if((0,_r.isHexString)(o,20))return(0,Rj.getAddress)(o)}let t=null;for(let i of this.provider.plugins)if(i instanceof Qf&&i.supportsCoinType(e)){t=i;break}if(t==null)return null;let n=await ur(this,Ao,Eu).call(this,"addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;let s=await t.decodeAddress(e,n);if(s!=null)return s;(0,_r.assert)(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){let t=await ur(this,Ao,Eu).call(this,"text(bytes32,string)",[e]);return t==null||t==="0x"?null:t}async getContentHash(){let e=await ur(this,Ao,Eu).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;let t=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){let s=t[1]==="e3010170"?"ipfs":"ipns",i=parseInt(t[4],16);if(t[5].length===i*2)return`${s}://${(0,_r.encodeBase58)("0x"+t[2])}`}let n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;(0,_r.assert)(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){let e=[{type:"name",value:this.name}];try{let t=await this.getText("avatar");if(t==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:t});for(let n=0;n<IP.length;n++){let s=t.match(IP[n]);if(s==null)continue;let i=s[1].toLowerCase();switch(i){case"https":case"data":return e.push({type:"url",value:t}),{linkage:e,url:t};case"ipfs":{let o=aw(t);return e.push({type:"ipfs",value:t}),e.push({type:"url",value:o}),{linkage:e,url:o}}case"erc721":case"erc1155":{let o=i==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:i,value:t});let a=await this.getAddress();if(a==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};let c=(s[2]||"").split("/");if(c.length!==2)return e.push({type:`!${i}caip`,value:s[2]||""}),{url:null,linkage:e};let u=c[1],l=new iw.Contract(c[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(i==="erc721"){let p=await l.ownerOf(u);if(a!==p)return e.push({type:"!owner",value:p}),{url:null,linkage:e};e.push({type:"owner",value:p})}else if(i==="erc1155"){let p=await l.balanceOf(a,u);if(!p)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:p.toString()})}let f=await l[o](u);if(f==null||f==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:f}),i==="erc1155"&&(f=f.replace("{id}",(0,_r.toBeHex)(u,32).substring(2)),e.push({type:"metadata-url-expanded",value:f})),f.match(/^ipfs:/i)&&(f=aw(f)),e.push({type:"metadata-url",value:f});let d={},h=await new _r.FetchRequest(f).send();h.assertOk();try{d=h.bodyJson}catch{try{e.push({type:"!metadata",value:h.bodyText})}catch{let m=h.body;return m&&e.push({type:"!metadata",value:(0,_r.hexlify)(m)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!d)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(d)});let b=d.image;if(typeof b!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!b.match(/^(https:\/\/|data:)/i)){if(b.match(RP)==null)return e.push({type:"!imageUrl-ipfs",value:b}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:b}),b=aw(b)}return e.push({type:"url",value:b}),{linkage:e,url:b}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){let t=await e.getNetwork(),n=t.getPlugin("org.ethers.plugins.network.Ens");return(0,_r.assert)(n,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:t}}),n.address}static async fromName(e,t){var s;let n=t;for(;;){if(n===""||n==="."||t!=="eth"&&n==="eth")return null;let i=await ur(s=Jf,Bh,MP).call(s,e,n);if(i!=null){let o=new Jf(e,i,t);return n!==t&&!await o.supportsWildcard()?null:o}n=n.split(".").slice(1).join(".")}}},kh=Jf;wo=new WeakMap,Ua=new WeakMap,Ao=new WeakSet,Eu=async function(e,t){t=(t||[]).slice();let n=fc(this,Ua).interface;t.unshift((0,ow.namehash)(this.name));let s=null;await this.supportsWildcard()&&(s=n.getFunction(e),(0,_r.assert)(s,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),t=[(0,ow.dnsEncode)(this.name,255),n.encodeFunctionData(s,t)],e="resolve(bytes,bytes)"),t.push({enableCcipRead:!0});try{let i=await fc(this,Ua)[e](...t);return s?n.decodeFunctionResult(s,i)[0]:i}catch(i){if(!(0,_r.isError)(i,"CALL_EXCEPTION"))throw i}return null},Bh=new WeakSet,MP=async function(e,t){let n=await Jf.getEnsAddress(e);try{let i=await new iw.Contract(n,["function resolver(bytes32) view returns (address)"],e).resolver((0,ow.namehash)(t),{enableCcipRead:!0});return i===NP.ZeroAddress?null:i}catch(s){throw s}return null},vs(kh,Bh);Eo.EnsResolver=kh});var HP=M(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.formatTransactionResponse=mt.formatTransactionReceipt=mt.formatReceiptLog=mt.formatBlock=mt.formatLog=mt.formatUint256=mt.formatHash=mt.formatData=mt.formatBoolean=mt.object=mt.arrayOf=mt.allowNull=void 0;var Fs=Yt(),LP=nr(),Lj=qr(),Ne=me(),jP=BigInt(0);function Ve(r,e){return function(t){return t==null?e:r(t)}}mt.allowNull=Ve;function Yf(r,e){return t=>{if(e&&t==null)return null;if(!Array.isArray(t))throw new Error("not an array");return t.map(n=>r(n))}}mt.arrayOf=Yf;function vu(r,e){return t=>{let n={};for(let s in r){let i=s;if(e&&s in e&&!(i in t)){for(let o of e[s])if(o in t){i=o;break}}try{let o=r[s](t[i]);o!==void 0&&(n[s]=o)}catch(o){let a=o instanceof Error?o.message:"not-an-error";(0,Ne.assert)(!1,`invalid value for value.${s} (${a})`,"BAD_DATA",{value:t})}}return n}}mt.object=vu;function UP(r){switch(r){case!0:case"true":return!0;case!1:case"false":return!1}(0,Ne.assertArgument)(!1,`invalid boolean; ${JSON.stringify(r)}`,"value",r)}mt.formatBoolean=UP;function Fa(r){return(0,Ne.assertArgument)((0,Ne.isHexString)(r,!0),"invalid data","value",r),r}mt.formatData=Fa;function ir(r){return(0,Ne.assertArgument)((0,Ne.isHexString)(r,32),"invalid hash","value",r),r}mt.formatHash=ir;function jj(r){if(!(0,Ne.isHexString)(r))throw new Error("invalid uint256");return(0,Ne.zeroPadValue)(r,32)}mt.formatUint256=jj;var Uj=vu({address:Fs.getAddress,blockHash:ir,blockNumber:Ne.getNumber,data:Fa,index:Ne.getNumber,removed:Ve(UP,!1),topics:Yf(ir),transactionHash:ir,transactionIndex:Ne.getNumber},{index:["logIndex"]});function Fj(r){return Uj(r)}mt.formatLog=Fj;var Dj=vu({hash:Ve(ir),parentHash:ir,parentBeaconBlockRoot:Ve(ir,null),number:Ne.getNumber,timestamp:Ne.getNumber,nonce:Ve(Fa),difficulty:Ne.getBigInt,gasLimit:Ne.getBigInt,gasUsed:Ne.getBigInt,stateRoot:Ve(ir,null),receiptsRoot:Ve(ir,null),blobGasUsed:Ve(Ne.getBigInt,null),excessBlobGas:Ve(Ne.getBigInt,null),miner:Ve(Fs.getAddress),prevRandao:Ve(ir,null),extraData:Fa,baseFeePerGas:Ve(Ne.getBigInt)},{prevRandao:["mixHash"]});function Hj(r){let e=Dj(r);return e.transactions=r.transactions.map(t=>typeof t=="string"?t:DP(t)),e}mt.formatBlock=Hj;var $j=vu({transactionIndex:Ne.getNumber,blockNumber:Ne.getNumber,transactionHash:ir,address:Fs.getAddress,topics:Yf(ir),data:Fa,index:Ne.getNumber,blockHash:ir},{index:["logIndex"]});function FP(r){return $j(r)}mt.formatReceiptLog=FP;var qj=vu({to:Ve(Fs.getAddress,null),from:Ve(Fs.getAddress,null),contractAddress:Ve(Fs.getAddress,null),index:Ne.getNumber,root:Ve(Ne.hexlify),gasUsed:Ne.getBigInt,blobGasUsed:Ve(Ne.getBigInt,null),logsBloom:Ve(Fa),blockHash:ir,hash:ir,logs:Yf(FP),blockNumber:Ne.getNumber,cumulativeGasUsed:Ne.getBigInt,effectiveGasPrice:Ve(Ne.getBigInt),blobGasPrice:Ve(Ne.getBigInt,null),status:Ve(Ne.getNumber),type:Ve(Ne.getNumber,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function Gj(r){return qj(r)}mt.formatTransactionReceipt=Gj;function DP(r){r.to&&(0,Ne.getBigInt)(r.to)===jP&&(r.to="0x0000000000000000000000000000000000000000");let e=vu({hash:ir,index:Ve(Ne.getNumber,void 0),type:t=>t==="0x"||t==null?0:(0,Ne.getNumber)(t),accessList:Ve(Lj.accessListify,null),blobVersionedHashes:Ve(Yf(ir,!0),null),blockHash:Ve(ir,null),blockNumber:Ve(Ne.getNumber,null),transactionIndex:Ve(Ne.getNumber,null),from:Fs.getAddress,gasPrice:Ve(Ne.getBigInt),maxPriorityFeePerGas:Ve(Ne.getBigInt),maxFeePerGas:Ve(Ne.getBigInt),maxFeePerBlobGas:Ve(Ne.getBigInt,null),gasLimit:Ne.getBigInt,to:Ve(Fs.getAddress,null),value:Ne.getBigInt,nonce:Ne.getNumber,data:Fa,creates:Ve(Fs.getAddress,null),chainId:Ve(Ne.getBigInt,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(r);if(e.to==null&&e.creates==null&&(e.creates=(0,Fs.getCreateAddress)(e)),(r.type===1||r.type===2)&&r.accessList==null&&(e.accessList=[]),r.signature?e.signature=LP.Signature.from(r.signature):e.signature=LP.Signature.from(r),e.chainId==null){let t=e.signature.legacyChainId;t!=null&&(e.chainId=t)}return e.blockHash&&(0,Ne.getBigInt)(e.blockHash)===jP&&(e.blockHash=null),e}mt.formatTransactionResponse=DP});var Sh=M(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.FetchUrlFeeDataNetworkPlugin=On.FeeDataNetworkPlugin=On.EnsPlugin=On.GasCostPlugin=On.NetworkPlugin=void 0;var fw=Yi(),zj=me(),Vj="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",Ti=class{name;constructor(e){(0,fw.defineProperties)(this,{name:e})}clone(){return new Ti(this.name)}};On.NetworkPlugin=Ti;var Zf=class extends Ti{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(e,t){e==null&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`);let n={effectiveBlock:e};function s(i,o){let a=(t||{})[i];a==null&&(a=o),(0,zj.assertArgument)(typeof a=="number",`invalud value for ${i}`,"costs",t),n[i]=a}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),(0,fw.defineProperties)(this,n)}clone(){return new Zf(this.effectiveBlock,this)}};On.GasCostPlugin=Zf;var Xf=class extends Ti{address;targetNetwork;constructor(e,t){super("org.ethers.plugins.network.Ens"),(0,fw.defineProperties)(this,{address:e||Vj,targetNetwork:t??1})}clone(){return new Xf(this.address,this.targetNetwork)}};On.EnsPlugin=Xf;var ed=class extends Ti{#e;get feeDataFunc(){return this.#e}constructor(e){super("org.ethers.plugins.network.FeeData"),this.#e=e}async getFeeData(e){return await this.#e(e)}clone(){return new ed(this.#e)}};On.FeeDataNetworkPlugin=ed;var lw=class extends Ti{#e;#t;get url(){return this.#e}get processFunc(){return this.#t}constructor(e,t){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#e=e,this.#t=t}clone(){return this}};On.FetchUrlFeeDataNetworkPlugin=lw});var Wr=M(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});Oh.Network=void 0;var Kj=qr(),Ds=me(),td=Sh(),dw=new Map,_n=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=(0,Ds.getBigInt)(t),this.#r=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#e}set name(e){this.#e=e}get chainId(){return this.#t}set chainId(e){this.#t=(0,Ds.getBigInt)(e,"chainId")}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===(0,Ds.getBigInt)(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===(0,Ds.getBigInt)(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===(0,Ds.getBigInt)(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(this.#r.values())}attachPlugin(e){if(this.#r.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#r.set(e.name,e.clone()),this}getPlugin(e){return this.#r.get(e)||null}getPlugins(e){return this.plugins.filter(t=>t.name.split("#")[0]===e)}clone(){let e=new _n(this.name,this.chainId);return this.plugins.forEach(t=>{e.attachPlugin(t.clone())}),e}computeIntrinsicGas(e){let t=this.getPlugin("org.ethers.plugins.network.GasCost")||new td.GasCostPlugin,n=t.txBase;if(e.to==null&&(n+=t.txCreate),e.data)for(let s=2;s<e.data.length;s+=2)e.data.substring(s,s+2)==="00"?n+=t.txDataZero:n+=t.txDataNonzero;if(e.accessList){let s=(0,Kj.accessListify)(e.accessList);for(let i in s)n+=t.txAccessListAddress+t.txAccessListStorageKey*s[i].storageKeys.length}return n}static from(e){if(Wj(),e==null)return _n.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){let t=dw.get(e);if(t)return t();if(typeof e=="bigint")return new _n("unknown",e);(0,Ds.assertArgument)(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){(0,Ds.assertArgument)(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);let t=new _n(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&t.attachPlugin(new td.EnsPlugin(e.ensAddress,e.ensNetwork)),t}(0,Ds.assertArgument)(!1,"invalid network","network",e)}static register(e,t){typeof e=="number"&&(e=BigInt(e));let n=dw.get(e);n&&(0,Ds.assertArgument)(!1,`conflicting network for ${JSON.stringify(n.name)}`,"nameOrChainId",e),dw.set(e,t)}};Oh.Network=_n;function $P(r,e){let t=String(r);if(!t.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${r}`);let n=t.split(".");if(n.length===1&&n.push(""),n.length!==2)throw new Error(`invalid gwei value: ${r}`);for(;n[1].length<e;)n[1]+="0";if(n[1].length>9){let s=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||s++,n[1]=s.toString()}return BigInt(n[0]+n[1])}function qP(r){return new td.FetchUrlFeeDataNetworkPlugin(r,async(e,t,n)=>{n.setHeader("User-Agent","ethers");let s;try{let[i,o]=await Promise.all([n.send(),e()]);s=i;let a=s.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:$P(a.maxFee,9),maxPriorityFeePerGas:$P(a.maxPriorityFee,9)}}catch(i){(0,Ds.assert)(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:s,error:i})}})}var GP=!1;function Wj(){if(GP)return;GP=!0;function r(e,t,n){let s=function(){let i=new _n(e,t);return n.ensNetwork!=null&&i.attachPlugin(new td.EnsPlugin(null,n.ensNetwork)),i.attachPlugin(new td.GasCostPlugin),(n.plugins||[]).forEach(o=>{i.attachPlugin(o)}),i};_n.register(e,s),_n.register(t,s),n.altNames&&n.altNames.forEach(i=>{_n.register(i,s)})}r("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),r("ropsten",3,{ensNetwork:3}),r("rinkeby",4,{ensNetwork:4}),r("goerli",5,{ensNetwork:5}),r("kovan",42,{ensNetwork:42}),r("sepolia",11155111,{ensNetwork:11155111}),r("holesky",17e3,{ensNetwork:17e3}),r("classic",61,{}),r("classicKotti",6,{}),r("arbitrum",42161,{ensNetwork:1}),r("arbitrum-goerli",421613,{}),r("arbitrum-sepolia",421614,{}),r("base",8453,{ensNetwork:1}),r("base-goerli",84531,{}),r("base-sepolia",84532,{}),r("bnb",56,{ensNetwork:1}),r("bnbt",97,{}),r("linea",59144,{ensNetwork:1}),r("linea-goerli",59140,{}),r("linea-sepolia",59141,{}),r("matic",137,{ensNetwork:1,plugins:[qP("https://gasstation.polygon.technology/v2")]}),r("matic-amoy",80002,{}),r("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[qP("https://gasstation-testnet.polygon.technology/v2")]}),r("optimism",10,{ensNetwork:1,plugins:[]}),r("optimism-goerli",420,{}),r("optimism-sepolia",11155420,{}),r("xdai",100,{ensNetwork:1})}});var Nh=M(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.PollingEventSubscriber=yr.PollingTransactionSubscriber=yr.PollingOrphanSubscriber=yr.PollingBlockTagSubscriber=yr.OnBlockSubscriber=yr.PollingBlockSubscriber=yr.getPollingSubscriber=void 0;var zP=me();function pw(r){return JSON.parse(JSON.stringify(r))}function Jj(r,e){if(e==="block")return new _h(r);if((0,zP.isHexString)(e,32))return new Ch(r,e);(0,zP.assert)(!1,"unsupported polling event","UNSUPPORTED_OPERATION",{operation:"getPollingSubscriber",info:{event:e}})}yr.getPollingSubscriber=Jj;var _h=class{#e;#t;#r;#n;constructor(e){this.#e=e,this.#t=null,this.#r=4e3,this.#n=-2}get pollingInterval(){return this.#r}set pollingInterval(e){this.#r=e}async#s(){try{let e=await this.#e.getBlockNumber();if(this.#n===-2){this.#n=e;return}if(e!==this.#n){for(let t=this.#n+1;t<=e;t++){if(this.#t==null)return;await this.#e.emit("block",t)}this.#n=e}}catch{}this.#t!=null&&(this.#t=this.#e._setTimeout(this.#s.bind(this),this.#r))}start(){this.#t||(this.#t=this.#e._setTimeout(this.#s.bind(this),this.#r),this.#s())}stop(){!this.#t||(this.#e._clearTimeout(this.#t),this.#t=null)}pause(e){this.stop(),e&&(this.#n=-2)}resume(){this.start()}};yr.PollingBlockSubscriber=_h;var Tu=class{#e;#t;#r;constructor(e){this.#e=e,this.#r=!1,this.#t=t=>{this._poll(t,this.#e)}}async _poll(e,t){throw new Error("sub-classes must override this")}start(){this.#r||(this.#r=!0,this.#t(-2),this.#e.on("block",this.#t))}stop(){!this.#r||(this.#r=!1,this.#e.off("block",this.#t))}pause(e){this.stop()}resume(){this.start()}};yr.OnBlockSubscriber=Tu;var hw=class extends Tu{#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=-2}pause(e){e&&(this.#t=-2),super.pause(e)}async _poll(e,t){let n=await t.getBlock(this.#e);n!=null&&(this.#t===-2?this.#t=n.number:n.number>this.#t&&(t.emit(this.#e,n.number),this.#t=n.number))}};yr.PollingBlockTagSubscriber=hw;var mw=class extends Tu{#e;constructor(e,t){super(e),this.#e=pw(t)}async _poll(e,t){throw new Error("@TODO")}};yr.PollingOrphanSubscriber=mw;var Ch=class extends Tu{#e;constructor(e,t){super(e),this.#e=t}async _poll(e,t){let n=await t.getTransactionReceipt(this.#e);n&&t.emit(this.#e,n)}};yr.PollingTransactionSubscriber=Ch;var bw=class{#e;#t;#r;#n;#s;constructor(e,t){this.#e=e,this.#t=pw(t),this.#r=this.#o.bind(this),this.#n=!1,this.#s=-2}async#o(e){if(this.#s===-2)return;let t=pw(this.#t);t.fromBlock=this.#s+1,t.toBlock=e;let n=await this.#e.getLogs(t);if(n.length===0){this.#s<e-60&&(this.#s=e-60);return}for(let s of n)this.#e.emit(this.#t,s),this.#s=s.blockNumber}start(){this.#n||(this.#n=!0,this.#s===-2&&this.#e.getBlockNumber().then(e=>{this.#s=e}),this.#e.on("block",this.#r))}stop(){!this.#n||(this.#n=!1,this.#e.off("block",this.#r))}pause(e){this.stop(),e&&(this.#s=-2)}resume(){this.start()}};yr.PollingEventSubscriber=bw});var ku=M(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.AbstractProvider=Pu.UnmanagedSubscriber=void 0;var nd=Yt(),Qj=Xc(),VP=Wf(),Yj=Ls(),Zj=qr(),de=me(),KP=uw(),Ih=HP(),Xj=Wr(),vo=yu(),rd=Nh(),eU=BigInt(2),tU=10;function Rh(r){return r&&typeof r.then=="function"}function Mh(r,e){return r+":"+JSON.stringify(e,(t,n)=>{if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){let s=Object.keys(n);return s.sort(),s.reduce((i,o)=>(i[o]=n[o],i),{})}return n})}var Lh=class{name;constructor(e){(0,de.defineProperties)(this,{name:e})}start(){}stop(){}pause(e){}resume(){}};Pu.UnmanagedSubscriber=Lh;function rU(r){return JSON.parse(JSON.stringify(r))}function yw(r){return r=Array.from(new Set(r).values()),r.sort(),r}async function gw(r,e){if(r==null)throw new Error("invalid event");if(Array.isArray(r)&&(r={topics:r}),typeof r=="string")switch(r){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:r,tag:r}}if((0,de.isHexString)(r,32)){let t=r.toLowerCase();return{type:"transaction",tag:Mh("tx",{hash:t}),hash:t}}if(r.orphan){let t=r;return{type:"orphan",tag:Mh("orphan",t),filter:rU(t)}}if(r.address||r.topics){let t=r,n={topics:(t.topics||[]).map(s=>s==null?null:Array.isArray(s)?yw(s.map(i=>i.toLowerCase())):s.toLowerCase())};if(t.address){let s=[],i=[],o=a=>{(0,de.isHexString)(a)?s.push(a):i.push((async()=>{s.push(await(0,nd.resolveAddress)(a,e))})())};Array.isArray(t.address)?t.address.forEach(o):o(t.address),i.length&&await Promise.all(i),n.address=yw(s.map(a=>a.toLowerCase()))}return{filter:n,tag:Mh("event",n),type:"event"}}(0,de.assertArgument)(!1,"unknown ProviderEvent","event",r)}function xw(){return new Date().getTime()}var nU={cacheTimeout:250,pollingInterval:4e3},ww=class{#e;#t;#r;#n;#s;#o;#i;#a;#f;#u;#h;#m;constructor(e,t){if(this.#m=Object.assign({},nU,t||{}),e==="any")this.#o=!0,this.#s=null;else if(e){let n=Xj.Network.from(e);this.#o=!1,this.#s=Promise.resolve(n),setTimeout(()=>{this.emit("network",n,null)},0)}else this.#o=!1,this.#s=null;this.#a=-1,this.#i=new Map,this.#e=new Map,this.#t=new Map,this.#r=null,this.#n=!1,this.#f=1,this.#u=new Map,this.#h=!1}get pollingInterval(){return this.#m.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#t.values())}attachPlugin(e){if(this.#t.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#t.set(e.name,e.connect(this)),this}getPlugin(e){return this.#t.get(e)||null}get disableCcipRead(){return this.#h}set disableCcipRead(e){this.#h=!!e}async#c(e){let t=this.#m.cacheTimeout;if(t<0)return await this._perform(e);let n=Mh(e.method,e),s=this.#i.get(n);return s||(s=this._perform(e),this.#i.set(n,s),setTimeout(()=>{this.#i.get(n)===s&&this.#i.delete(n)},t)),await s}async ccipReadFetch(e,t,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;let s=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let a=0;a<n.length;a++){let c=n[a],u=c.replace("{sender}",s).replace("{data}",i),l=new de.FetchRequest(u);c.indexOf("{data}")===-1&&(l.body={data:i,sender:s}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:l,index:a,urls:n});let f="unknown error",d=await l.send();try{let h=d.bodyJson;if(h.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:l,result:h}),h.data;h.message&&(f=h.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:l,result:h})}catch{}(0,de.assert)(d.statusCode<400||d.statusCode>=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:c,errorMessage:f}}),o.push(f)}(0,de.assert)(!1,`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:o}})}_wrapBlock(e,t){return new vo.Block((0,Ih.formatBlock)(e),this)}_wrapLog(e,t){return new vo.Log((0,Ih.formatLog)(e),this)}_wrapTransactionReceipt(e,t){return new vo.TransactionReceipt((0,Ih.formatTransactionReceipt)(e),this)}_wrapTransactionResponse(e,t){return new vo.TransactionResponse((0,Ih.formatTransactionResponse)(e),this)}_detectNetwork(){(0,de.assert)(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){(0,de.assert)(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){let e=(0,de.getNumber)(await this.#c({method:"getBlockNumber"}),"%response");return this.#a>=0&&(this.#a=e),e}_getAddress(e){return(0,nd.resolveAddress)(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if((0,de.isHexString)(e))return(0,de.isHexString)(e,32)?e:(0,de.toQuantity)(e);if(typeof e=="bigint"&&(e=(0,de.getNumber)(e,"blockTag")),typeof e=="number")return e>=0?(0,de.toQuantity)(e):this.#a>=0?(0,de.toQuantity)(this.#a+e):this.getBlockNumber().then(t=>(0,de.toQuantity)(t+e));(0,de.assertArgument)(!1,"invalid blockTag","blockTag",e)}_getFilter(e){let t=(e.topics||[]).map(c=>c==null?null:Array.isArray(c)?yw(c.map(u=>u.toLowerCase())):c.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,s=(c,u,l)=>{let f;switch(c.length){case 0:break;case 1:f=c[0];break;default:c.sort(),f=c}if(n&&(u!=null||l!=null))throw new Error("invalid filter");let d={};return f&&(d.address=f),t.length&&(d.topics=t),u&&(d.fromBlock=u),l&&(d.toBlock=l),n&&(d.blockHash=n),d},i=[];if(e.address)if(Array.isArray(e.address))for(let c of e.address)i.push(this._getAddress(c));else i.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let a;return"toBlock"in e&&(a=this._getBlockTag(e.toBlock)),i.filter(c=>typeof c!="string").length||o!=null&&typeof o!="string"||a!=null&&typeof a!="string"?Promise.all([Promise.all(i),o,a]).then(c=>s(c[0],c[1],c[2])):s(i,o,a)}_getTransactionRequest(e){let t=(0,vo.copyRequest)(e),n=[];if(["to","from"].forEach(s=>{if(t[s]==null)return;let i=(0,nd.resolveAddress)(t[s],this);Rh(i)?n.push(async function(){t[s]=await i}()):t[s]=i}),t.blockTag!=null){let s=this._getBlockTag(t.blockTag);Rh(s)?n.push(async function(){t.blockTag=await s}()):t.blockTag=s}return n.length?async function(){return await Promise.all(n),t}():t}async getNetwork(){if(this.#s==null){let s=(async()=>{try{let i=await this._detectNetwork();return this.emit("network",i,null),i}catch(i){throw this.#s===s&&(this.#s=null),i}})();return this.#s=s,(await s).clone()}let e=this.#s,[t,n]=await Promise.all([e,this._detectNetwork()]);return t.chainId!==n.chainId&&(this.#o?(this.emit("network",n,t),this.#s===e&&(this.#s=Promise.resolve(n))):(0,de.assert)(!1,`network changed: ${t.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),t.clone()}async getFeeData(){let e=await this.getNetwork(),t=async()=>{let{_block:s,gasPrice:i,priorityFee:o}=await(0,de.resolveProperties)({_block:this.#b("latest",!1),gasPrice:(async()=>{try{let l=await this.#c({method:"getGasPrice"});return(0,de.getBigInt)(l,"%response")}catch{}return null})(),priorityFee:(async()=>{try{let l=await this.#c({method:"getPriorityFee"});return(0,de.getBigInt)(l,"%response")}catch{}return null})()}),a=null,c=null,u=this._wrapBlock(s,e);return u&&u.baseFeePerGas&&(c=o??BigInt("1000000000"),a=u.baseFeePerGas*eU+c),new vo.FeeData(i,a,c)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){let s=new de.FetchRequest(n.url),i=await n.processFunc(t,this,s);return new vo.FeeData(i.gasPrice,i.maxFeePerGas,i.maxPriorityFeePerGas)}return await t()}async estimateGas(e){let t=this._getTransactionRequest(e);return Rh(t)&&(t=await t),(0,de.getBigInt)(await this.#c({method:"estimateGas",transaction:t}),"%response")}async#l(e,t,n){(0,de.assert)(n<tU,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:t,enableCcipRead:!0})});let s=(0,vo.copyRequest)(e);try{return(0,de.hexlify)(await this._perform({method:"call",transaction:s,blockTag:t}))}catch(i){if(!this.disableCcipRead&&(0,de.isCallException)(i)&&i.data&&n>=0&&t==="latest"&&s.to!=null&&(0,de.dataSlice)(i.data,0,4)==="0x556f1830"){let o=i.data,a=await(0,nd.resolveAddress)(s.to,this),c;try{c=cU((0,de.dataSlice)(i.data,4))}catch(f){(0,de.assert)(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:s,info:{data:o}})}(0,de.assert)(c.sender.toLowerCase()===a.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:s,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});let u=await this.ccipReadFetch(s,c.calldata,c.urls);(0,de.assert)(u!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:s,info:{data:i.data,errorArgs:c.errorArgs}});let l={to:a,data:(0,de.concat)([c.selector,aU([u,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:l});try{let f=await this.#l(l,t,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},l),result:f}),f}catch(f){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},l),error:f}),f}}throw i}}async#d(e){let{value:t}=await(0,de.resolveProperties)({network:this.getNetwork(),value:e});return t}async call(e){let{tx:t,blockTag:n}=await(0,de.resolveProperties)({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await this.#d(this.#l(t,n,e.enableCcipRead?0:-1))}async#p(e,t,n){let s=this._getAddress(t),i=this._getBlockTag(n);return(typeof s!="string"||typeof i!="string")&&([s,i]=await Promise.all([s,i])),await this.#d(this.#c(Object.assign(e,{address:s,blockTag:i})))}async getBalance(e,t){return(0,de.getBigInt)(await this.#p({method:"getBalance"},e,t),"%response")}async getTransactionCount(e,t){return(0,de.getNumber)(await this.#p({method:"getTransactionCount"},e,t),"%response")}async getCode(e,t){return(0,de.hexlify)(await this.#p({method:"getCode"},e,t))}async getStorage(e,t,n){let s=(0,de.getBigInt)(t,"position");return(0,de.hexlify)(await this.#p({method:"getStorage",position:s},e,n))}async broadcastTransaction(e){let{blockNumber:t,hash:n,network:s}=await(0,de.resolveProperties)({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),i=Zj.Transaction.from(e);if(i.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(i,s).replaceableTransaction(t)}async#b(e,t){if((0,de.isHexString)(e,32))return await this.#c({method:"getBlock",blockHash:e,includeTransactions:t});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await this.#c({method:"getBlock",blockTag:n,includeTransactions:t})}async getBlock(e,t){let{network:n,params:s}=await(0,de.resolveProperties)({network:this.getNetwork(),params:this.#b(e,!!t)});return s==null?null:this._wrapBlock(s,n)}async getTransaction(e){let{network:t,params:n}=await(0,de.resolveProperties)({network:this.getNetwork(),params:this.#c({method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,t)}async getTransactionReceipt(e){let{network:t,params:n}=await(0,de.resolveProperties)({network:this.getNetwork(),params:this.#c({method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){let s=await this.#c({method:"getTransaction",hash:e});if(s==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=s.gasPrice}return this._wrapTransactionReceipt(n,t)}async getTransactionResult(e){let{result:t}=await(0,de.resolveProperties)({network:this.getNetwork(),result:this.#c({method:"getTransactionResult",hash:e})});return t==null?null:(0,de.hexlify)(t)}async getLogs(e){let t=this._getFilter(e);Rh(t)&&(t=await t);let{network:n,params:s}=await(0,de.resolveProperties)({network:this.getNetwork(),params:this.#c({method:"getLogs",filter:t})});return s.map(i=>this._wrapLog(i,n))}_getProvider(e){(0,de.assert)(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await KP.EnsResolver.fromName(this,e)}async getAvatar(e){let t=await this.getResolver(e);return t?await t.getAvatar():null}async resolveName(e){let t=await this.getResolver(e);return t?await t.getAddress():null}async lookupAddress(e){e=(0,nd.getAddress)(e);let t=(0,Yj.namehash)(e.substring(2).toLowerCase()+".addr.reverse");try{let n=await KP.EnsResolver.getEnsAddress(this),i=await new VP.Contract(n,["function resolver(bytes32) view returns (address)"],this).resolver(t);if(i==null||i===Qj.ZeroAddress)return null;let a=await new VP.Contract(i,["function name(bytes32) view returns (string)"],this).name(t);return await this.resolveName(a)!==e?null:a}catch(n){if((0,de.isError)(n,"BAD_DATA")&&n.value==="0x"||(0,de.isError)(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,t,n){let s=t??1;return s===0?this.getTransactionReceipt(e):new Promise(async(i,o)=>{let a=null,c=async u=>{try{let l=await this.getTransactionReceipt(e);if(l!=null&&u-l.blockNumber+1>=s){i(l),a&&(clearTimeout(a),a=null);return}}catch(l){console.log("EEE",l)}this.once("block",c)};n!=null&&(a=setTimeout(()=>{a!=null&&(a=null,this.off("block",c),o((0,de.makeError)("timeout","TIMEOUT",{reason:"timeout"})))},n)),c(await this.getBlockNumber())})}async waitForBlock(e){(0,de.assert)(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){let t=this.#u.get(e);!t||(t.timer&&clearTimeout(t.timer),this.#u.delete(e))}_setTimeout(e,t){t==null&&(t=0);let n=this.#f++,s=()=>{this.#u.delete(n),e()};if(this.paused)this.#u.set(n,{timer:null,func:s,time:t});else{let i=setTimeout(s,t);this.#u.set(n,{timer:i,func:s,time:xw()})}return n}_forEachSubscriber(e){for(let t of this.#e.values())e(t.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new Lh(e.type);case"block":{let t=new rd.PollingBlockSubscriber(this);return t.pollingInterval=this.pollingInterval,t}case"safe":case"finalized":return new rd.PollingBlockTagSubscriber(this,e.type);case"event":return new rd.PollingEventSubscriber(this,e.filter);case"transaction":return new rd.PollingTransactionSubscriber(this,e.hash);case"orphan":return new rd.PollingOrphanSubscriber(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,t){for(let n of this.#e.values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=t,n.started&&t.start(),this.#r!=null&&t.pause(this.#r);break}}async#g(e,t){let n=await gw(e,this);return n.type==="event"&&t&&t.length>0&&t[0].removed===!0&&(n=await gw({orphan:"drop-log",log:t[0]},this)),this.#e.get(n.tag)||null}async#x(e){let t=await gw(e,this),n=t.tag,s=this.#e.get(n);return s||(s={subscriber:this._getSubscriber(t),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#e.set(n,s)),s}async on(e,t){let n=await this.#x(e);return n.listeners.push({listener:t,once:!1}),n.started||(n.subscriber.start(),n.started=!0,this.#r!=null&&n.subscriber.pause(this.#r)),this}async once(e,t){let n=await this.#x(e);return n.listeners.push({listener:t,once:!0}),n.started||(n.subscriber.start(),n.started=!0,this.#r!=null&&n.subscriber.pause(this.#r)),this}async emit(e,...t){let n=await this.#g(e,t);if(!n||n.listeners.length===0)return!1;let s=n.listeners.length;return n.listeners=n.listeners.filter(({listener:i,once:o})=>{let a=new de.EventPayload(this,o?null:i,e);try{i.call(this,...t,a)}catch{}return!o}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),this.#e.delete(n.tag)),s>0}async listenerCount(e){if(e){let n=await this.#g(e);return n?n.listeners.length:0}let t=0;for(let{listeners:n}of this.#e.values())t+=n.length;return t}async listeners(e){if(e){let n=await this.#g(e);return n?n.listeners.map(({listener:s})=>s):[]}let t=[];for(let{listeners:n}of this.#e.values())t=t.concat(n.map(({listener:s})=>s));return t}async off(e,t){let n=await this.#g(e);if(!n)return this;if(t){let s=n.listeners.map(({listener:i})=>i).indexOf(t);s>=0&&n.listeners.splice(s,1)}return(!t||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),this.#e.delete(n.tag)),this}async removeAllListeners(e){if(e){let{tag:t,started:n,subscriber:s}=await this.#x(e);n&&s.stop(),this.#e.delete(t)}else for(let[t,{started:n,subscriber:s}]of this.#e)n&&s.stop(),this.#e.delete(t);return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return this.off(e,t)}get destroyed(){return this.#n}destroy(){this.removeAllListeners();for(let e of this.#u.keys())this._clearTimeout(e);this.#n=!0}get paused(){return this.#r!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(this.#a=-1,this.#r!=null){if(this.#r==!!e)return;(0,de.assert)(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(t=>t.pause(e)),this.#r=!!e;for(let t of this.#u.values())t.timer&&clearTimeout(t.timer),t.time=xw()-t.time}resume(){if(this.#r!=null){this._forEachSubscriber(e=>e.resume()),this.#r=null;for(let e of this.#u.values()){let t=e.time;t<0&&(t=0),e.time=xw(),setTimeout(e.func,t)}}}};Pu.AbstractProvider=ww;function sU(r,e){try{let t=Aw(r,e);if(t)return(0,de.toUtf8String)(t)}catch{}return null}function Aw(r,e){if(r==="0x")return null;try{let t=(0,de.getNumber)((0,de.dataSlice)(r,e,e+32)),n=(0,de.getNumber)((0,de.dataSlice)(r,t,t+32));return(0,de.dataSlice)(r,t+32,t+32+n)}catch{}return null}function WP(r){let e=(0,de.toBeArray)(r);if(e.length>32)throw new Error("internal; should not happen");let t=new Uint8Array(32);return t.set(e,32-e.length),t}function iU(r){if(r.length%32===0)return r;let e=new Uint8Array(Math.ceil(r.length/32)*32);return e.set(r),e}var oU=new Uint8Array([]);function aU(r){let e=[],t=0;for(let n=0;n<r.length;n++)e.push(oU),t+=32;for(let n=0;n<r.length;n++){let s=(0,de.getBytes)(r[n]);e[n]=WP(t),e.push(WP(s.length)),e.push(iU(s)),t+=32+Math.ceil(s.length/32)*32}return(0,de.concat)(e)}var JP="0x0000000000000000000000000000000000000000000000000000000000000000";function cU(r){let e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};(0,de.assert)((0,de.dataLength)(r)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});let t=(0,de.dataSlice)(r,0,32);(0,de.assert)((0,de.dataSlice)(t,0,12)===(0,de.dataSlice)(JP,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=(0,de.dataSlice)(t,12);try{let n=[],s=(0,de.getNumber)((0,de.dataSlice)(r,32,64)),i=(0,de.getNumber)((0,de.dataSlice)(r,s,s+32)),o=(0,de.dataSlice)(r,s+32);for(let a=0;a<i;a++){let c=sU(o,a*32);if(c==null)throw new Error("abort");n.push(c)}e.urls=n}catch{(0,de.assert)(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{let n=Aw(r,64);if(n==null)throw new Error("abort");e.calldata=n}catch{(0,de.assert)(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}(0,de.assert)((0,de.dataSlice)(r,100,128)===(0,de.dataSlice)(JP,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=(0,de.dataSlice)(r,96,100);try{let n=Aw(r,128);if(n==null)throw new Error("abort");e.extraData=n}catch{(0,de.assert)(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(n=>e[n]),e}});var Uh=M(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.VoidSigner=Su.AbstractSigner=void 0;var QP=Yt(),uU=qr(),Jr=me(),lU=yu();function Bu(r,e){if(r.provider)return r.provider;(0,Jr.assert)(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function YP(r,e){let t=(0,lU.copyRequest)(e);if(t.to!=null&&(t.to=(0,QP.resolveAddress)(t.to,r)),t.from!=null){let n=t.from;t.from=Promise.all([r.getAddress(),(0,QP.resolveAddress)(n,r)]).then(([s,i])=>((0,Jr.assertArgument)(s.toLowerCase()===i.toLowerCase(),"transaction from mismatch","tx.from",i),s))}else t.from=r.getAddress();return await(0,Jr.resolveProperties)(t)}var jh=class{provider;constructor(e){(0,Jr.defineProperties)(this,{provider:e||null})}async getNonce(e){return Bu(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await YP(this,e)}async populateTransaction(e){let t=Bu(this,"populateTransaction"),n=await YP(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));let s=await this.provider.getNetwork();if(n.chainId!=null){let o=(0,Jr.getBigInt)(n.chainId);(0,Jr.assertArgument)(o===s.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=s.chainId;let i=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||i)?(0,Jr.assertArgument)(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&i&&(0,Jr.assertArgument)(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){let o=await t.getFeeData();(0,Jr.assert)(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice)}else{let o=await t.getFeeData();if(n.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(n.type=2,n.gasPrice!=null){let a=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=a,n.maxPriorityFeePerGas=a}else n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?((0,Jr.assert)(!i,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice),n.type=0):(0,Jr.assert)(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(n.type===2||n.type===3)&&(n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await(0,Jr.resolveProperties)(n)}async estimateGas(e){return Bu(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Bu(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Bu(this,"resolveName").resolveName(e)}async sendTransaction(e){let t=Bu(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;let s=uU.Transaction.from(n);return await t.broadcastTransaction(await this.signTransaction(s))}};Su.AbstractSigner=jh;var sd=class extends jh{address;constructor(e,t){super(t),(0,Jr.defineProperties)(this,{address:e})}async getAddress(){return this.address}connect(e){return new sd(this.address,e)}#e(e,t){(0,Jr.assert)(!1,`VoidSigner cannot sign ${e}`,"UNSUPPORTED_OPERATION",{operation:t})}async signTransaction(e){this.#e("transactions","signTransaction")}async signMessage(e){this.#e("messages","signMessage")}async signTypedData(e,t,n){this.#e("typed-data","signTypedData")}};Su.VoidSigner=sd});var Pi=M(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});Fh.showThrottleMessage=void 0;var ZP=new Set;function fU(r){ZP.has(r)||(ZP.add(r),console.log("========= NOTICE ========="),console.log(`Request-Rate Exceeded for ${r} (this message will not be repeated)`),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.org/api-keys/"),console.log("=========================="))}Fh.showThrottleMessage=fU});var XP=M(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.FilterIdPendingSubscriber=To.FilterIdEventSubscriber=To.FilterIdSubscriber=void 0;var dU=me(),pU=Nh();function hU(r){return JSON.parse(JSON.stringify(r))}var id=class{#e;#t;#r;#n;#s;#o;constructor(e){this.#e=e,this.#t=null,this.#r=this.#i.bind(this),this.#n=!1,this.#s=null,this.#o=!1}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,t){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}async#i(e){try{this.#t==null&&(this.#t=this._subscribe(this.#e));let t=null;try{t=await this.#t}catch(i){if(!(0,dU.isError)(i,"UNSUPPORTED_OPERATION")||i.operation!=="eth_newFilter")throw i}if(t==null){this.#t=null,this.#e._recoverSubscriber(this,this._recover(this.#e));return}let n=await this.#e.getNetwork();if(this.#s||(this.#s=n),this.#s.chainId!==n.chainId)throw new Error("chaid changed");if(this.#o)return;let s=await this.#e.send("eth_getFilterChanges",[t]);await this._emitResults(this.#e,s)}catch(t){console.log("@TODO",t)}this.#e.once("block",this.#r)}#a(){let e=this.#t;e&&(this.#t=null,e.then(t=>{this.#e.destroyed||this.#e.send("eth_uninstallFilter",[t])}))}start(){this.#n||(this.#n=!0,this.#i(-2))}stop(){!this.#n||(this.#n=!1,this.#o=!0,this.#a(),this.#e.off("block",this.#r))}pause(e){e&&this.#a(),this.#e.off("block",this.#r)}resume(){this.start()}};To.FilterIdSubscriber=id;var Ew=class extends id{#e;constructor(e,t){super(e),this.#e=hU(t)}_recover(e){return new pU.PollingEventSubscriber(e,this.#e)}async _subscribe(e){return await e.send("eth_newFilter",[this.#e])}async _emitResults(e,t){for(let n of t)e.emit(this.#e,e._wrapLog(n,e._network))}};To.FilterIdEventSubscriber=Ew;var vw=class extends id{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,t){for(let n of t)e.emit("pending",n)}};To.FilterIdPendingSubscriber=vw});var Cn=M(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.JsonRpcProvider=Hs.JsonRpcApiPollingProvider=Hs.JsonRpcApiProvider=Hs.JsonRpcSigner=void 0;var mU=bu(),Da=Yt(),ek=Ls(),bU=qr(),He=me(),tk=ku(),gU=Uh(),Tw=Wr(),rk=XP(),xU=Nh(),yU="bigint,boolean,function,number,string,symbol".split(/,/g);function Dh(r){if(r==null||yU.indexOf(typeof r)>=0||typeof r.getAddress=="function")return r;if(Array.isArray(r))return r.map(Dh);if(typeof r=="object")return Object.keys(r).reduce((e,t)=>(e[t]=r[t],e),{});throw new Error(`should not happen: ${r} (${typeof r})`)}function wU(r){return new Promise(e=>{setTimeout(e,r)})}function Ou(r){return r&&r.toLowerCase()}function nk(r){return r&&typeof r.pollingInterval=="number"}var sk={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3},_u=class extends gU.AbstractSigner{address;constructor(e,t){super(e),t=(0,Da.getAddress)(t),(0,He.defineProperties)(this,{address:t})}connect(e){(0,He.assert)(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(e){return await this.populateCall(e)}async sendUncheckedTransaction(e){let t=Dh(e),n=[];if(t.from){let i=t.from;n.push((async()=>{let o=await(0,Da.resolveAddress)(i,this.provider);(0,He.assertArgument)(o!=null&&o.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=o})())}else t.from=this.address;if(t.gasLimit==null&&n.push((async()=>{t.gasLimit=await this.provider.estimateGas({...t,from:this.address})})()),t.to!=null){let i=t.to;n.push((async()=>{t.to=await(0,Da.resolveAddress)(i,this.provider)})())}n.length&&await Promise.all(n);let s=this.provider.getRpcTransaction(t);return this.provider.send("eth_sendTransaction",[s])}async sendTransaction(e){let t=await this.provider.getBlockNumber(),n=await this.sendUncheckedTransaction(e);return await new Promise((s,i)=>{let o=[1e3,100],a=0,c=async()=>{try{let u=await this.provider.getTransaction(n);if(u!=null){s(u.replaceableTransaction(t));return}}catch(u){if((0,He.isError)(u,"CANCELLED")||(0,He.isError)(u,"BAD_DATA")||(0,He.isError)(u,"NETWORK_ERROR")){u.info==null&&(u.info={}),u.info.sendTransactionHash=n,i(u);return}if((0,He.isError)(u,"INVALID_ARGUMENT")&&(a++,u.info==null&&(u.info={}),u.info.sendTransactionHash=n,a>10)){i(u);return}this.provider.emit("error",(0,He.makeError)("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:u}))}this.provider._setTimeout(()=>{c()},o.pop()||4e3)};c()})}async signTransaction(e){let t=Dh(e);if(t.from){let s=await(0,Da.resolveAddress)(t.from,this.provider);(0,He.assertArgument)(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=s}else t.from=this.address;let n=this.provider.getRpcTransaction(t);return await this.provider.send("eth_signTransaction",[n])}async signMessage(e){let t=typeof e=="string"?(0,He.toUtf8Bytes)(e):e;return await this.provider.send("personal_sign",[(0,He.hexlify)(t),this.address.toLowerCase()])}async signTypedData(e,t,n){let s=Dh(n),i=await ek.TypedDataEncoder.resolveNames(e,t,s,async o=>{let a=await(0,Da.resolveAddress)(o);return(0,He.assertArgument)(a!=null,"TypedData does not support null address","value",o),a});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(ek.TypedDataEncoder.getPayload(i.domain,t,i.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){let t=typeof e=="string"?(0,He.toUtf8Bytes)(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),(0,He.hexlify)(t)])}};Hs.JsonRpcSigner=_u;var Hh=class extends tk.AbstractProvider{#e;#t;#r;#n;#s;#o;#i;#a(){if(this.#n)return;let e=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");this.#n=setTimeout(()=>{this.#n=null;let t=this.#r;for(this.#r=[];t.length;){let n=[t.shift()];for(;t.length&&n.length!==this.#e.batchMaxCount;)if(n.push(t.shift()),JSON.stringify(n.map(i=>i.payload)).length>this.#e.batchMaxSize){t.unshift(n.pop());break}(async()=>{let s=n.length===1?n[0].payload:n.map(i=>i.payload);this.emit("debug",{action:"sendRpcPayload",payload:s});try{let i=await this._send(s);this.emit("debug",{action:"receiveRpcResult",result:i});for(let{resolve:o,reject:a,payload:c}of n){if(this.destroyed){a((0,He.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:c.method}));continue}let u=i.filter(l=>l.id===c.id)[0];if(u==null){let l=(0,He.makeError)("missing response for request","BAD_DATA",{value:i,info:{payload:c}});this.emit("error",l),a(l);continue}if("error"in u){a(this.getRpcError(c,u));continue}o(u.result)}}catch(i){this.emit("debug",{action:"receiveRpcError",error:i});for(let{reject:o}of n)o(i)}})()}},e)}constructor(e,t){super(e,t),this.#t=1,this.#e=Object.assign({},sk,t||{}),this.#r=[],this.#n=null,this.#o=null,this.#i=null;{let s=null,i=new Promise(o=>{s=o});this.#s={promise:i,resolve:s}}let n=this._getOption("staticNetwork");typeof n=="boolean"?((0,He.assertArgument)(!n||e!=="any","staticNetwork cannot be used on special network 'any'","options",t),n&&e!=null&&(this.#o=Tw.Network.from(e))):n&&((0,He.assertArgument)(e==null||n.matches(e),"staticNetwork MUST match network object","options",t),this.#o=n)}_getOption(e){return this.#e[e]}get _network(){return(0,He.assert)(this.#o,"network is not available yet","NETWORK_ERROR"),this.#o}async _perform(e){if(e.method==="call"||e.method==="estimateGas"){let n=e.transaction;if(n&&n.type!=null&&(0,He.getBigInt)(n.type)&&n.maxFeePerGas==null&&n.maxPriorityFeePerGas==null){let s=await this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(e=Object.assign({},e,{transaction:Object.assign({},n,{type:void 0})}))}}let t=this.getRpcRequest(e);return t!=null?await this.send(t.method,t.args):super._perform(e)}async _detectNetwork(){let e=this._getOption("staticNetwork");if(e)if(e===!0){if(this.#o)return this.#o}else return e;return this.#i?await this.#i:this.ready?(this.#i=(async()=>{try{let t=Tw.Network.from((0,He.getBigInt)(await this.send("eth_chainId",[])));return this.#i=null,t}catch(t){throw this.#i=null,t}})(),await this.#i):(this.#i=(async()=>{let t={id:this.#t++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:t});let n;try{n=(await this._send(t))[0],this.#i=null}catch(s){throw this.#i=null,this.emit("debug",{action:"receiveRpcError",error:s}),s}if(this.emit("debug",{action:"receiveRpcResult",result:n}),"result"in n)return Tw.Network.from((0,He.getBigInt)(n.result));throw this.getRpcError(t,n)})(),await this.#i)}_start(){this.#s==null||this.#s.resolve==null||(this.#s.resolve(),this.#s=null,(async()=>{for(;this.#o==null&&!this.destroyed;)try{this.#o=await this._detectNetwork()}catch(e){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",(0,He.makeError)("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await wU(1e3)}this.#a()})())}async _waitUntilReady(){if(this.#s!=null)return await this.#s.promise}_getSubscriber(e){return e.type==="pending"?new rk.FilterIdPendingSubscriber(this):e.type==="event"?this._getOption("polling")?new xU.PollingEventSubscriber(this,e.filter):new rk.FilterIdEventSubscriber(this,e.filter):e.type==="orphan"&&e.filter.orphan==="drop-log"?new tk.UnmanagedSubscriber("orphan"):super._getSubscriber(e)}get ready(){return this.#s==null}getRpcTransaction(e){let t={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(n=>{if(e[n]==null)return;let s=n;n==="gasLimit"&&(s="gas"),t[s]=(0,He.toQuantity)((0,He.getBigInt)(e[n],`tx.${n}`))}),["from","to","data"].forEach(n=>{e[n]!=null&&(t[n]=(0,He.hexlify)(e[n]))}),e.accessList&&(t.accessList=(0,bU.accessListify)(e.accessList)),e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.map(n=>n.toLowerCase())),t}getRpcRequest(e){switch(e.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Ou(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Ou(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[Ou(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Ou(e.address),"0x"+e.position.toString(16),e.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[e.signedTransaction]};case"getBlock":if("blockTag"in e)return{method:"eth_getBlockByNumber",args:[e.blockTag,!!e.includeTransactions]};if("blockHash"in e)return{method:"eth_getBlockByHash",args:[e.blockHash,!!e.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[e.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[e.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(e.transaction),e.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(e.transaction)]};case"getLogs":return e.filter&&e.filter.address!=null&&(Array.isArray(e.filter.address)?e.filter.address=e.filter.address.map(Ou):e.filter.address=Ou(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,t){let{method:n}=e,{error:s}=t;if(n==="eth_estimateGas"&&s.message){let a=s.message;if(!a.match(/revert/i)&&a.match(/insufficient funds/i))return(0,He.makeError)("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:s}})}if(n==="eth_call"||n==="eth_estimateGas"){let a=kw(s),c=mU.AbiCoder.getBuiltinCallException(n==="eth_call"?"call":"estimateGas",e.params[0],a?a.data:null);return c.info={error:s,payload:e},c}let i=JSON.stringify(AU(s));if(typeof s.message=="string"&&s.message.match(/user denied|ethers-user-denied/i)){let a={eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return(0,He.makeError)("user rejected action","ACTION_REJECTED",{action:a[n]||"unknown",reason:"rejected",info:{payload:e,error:s}})}if(n==="eth_sendRawTransaction"||n==="eth_sendTransaction"){let a=e.params[0];if(i.match(/insufficient funds|base fee exceeds gas limit/i))return(0,He.makeError)("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:a,info:{error:s}});if(i.match(/nonce/i)&&i.match(/too low/i))return(0,He.makeError)("nonce has already been used","NONCE_EXPIRED",{transaction:a,info:{error:s}});if(i.match(/replacement transaction/i)&&i.match(/underpriced/i))return(0,He.makeError)("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:a,info:{error:s}});if(i.match(/only replay-protected/i))return(0,He.makeError)("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:n,info:{transaction:a,info:{error:s}}})}let o=!!i.match(/the method .* does not exist/i);return o||s&&s.details&&s.details.startsWith("Unauthorized method:")&&(o=!0),o?(0,He.makeError)("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:s,payload:e}}):(0,He.makeError)("could not coalesce error","UNKNOWN_ERROR",{error:s,payload:e})}send(e,t){if(this.destroyed)return Promise.reject((0,He.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));let n=this.#t++,s=new Promise((i,o)=>{this.#r.push({resolve:i,reject:o,payload:{method:e,params:t,id:n,jsonrpc:"2.0"}})});return this.#a(),s}async getSigner(e){e==null&&(e=0);let t=this.send("eth_accounts",[]);if(typeof e=="number"){let s=await t;if(e>=s.length)throw new Error("no such account");return new _u(this,s[e])}let{accounts:n}=await(0,He.resolveProperties)({network:this.getNetwork(),accounts:t});e=(0,Da.getAddress)(e);for(let s of n)if((0,Da.getAddress)(s)===e)return new _u(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(t=>new _u(this,t))}destroy(){this.#n&&(clearTimeout(this.#n),this.#n=null);for(let{payload:e,reject:t}of this.#r)t((0,He.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));this.#r=[],super.destroy()}};Hs.JsonRpcApiProvider=Hh;var $h=class extends Hh{#e;constructor(e,t){super(e,t);let n=this._getOption("pollingInterval");n==null&&(n=sk.pollingInterval),this.#e=n}_getSubscriber(e){let t=super._getSubscriber(e);return nk(t)&&(t.pollingInterval=this.#e),t}get pollingInterval(){return this.#e}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");this.#e=e,this._forEachSubscriber(t=>{nk(t)&&(t.pollingInterval=this.#e)})}};Hs.JsonRpcApiPollingProvider=$h;var Pw=class extends $h{#e;constructor(e,t,n){e==null&&(e="http://localhost:8545"),super(t,n),typeof e=="string"?this.#e=new He.FetchRequest(e):this.#e=e.clone()}_getConnection(){return this.#e.clone()}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){let t=this._getConnection();t.body=JSON.stringify(e),t.setHeader("content-type","application/json");let n=await t.send();n.assertOk();let s=n.bodyJson;return Array.isArray(s)||(s=[s]),s}};Hs.JsonRpcProvider=Pw;function kw(r){if(r==null)return null;if(typeof r.message=="string"&&r.message.match(/revert/i)&&(0,He.isHexString)(r.data))return{message:r.message,data:r.data};if(typeof r=="object"){for(let e in r){let t=kw(r[e]);if(t)return t}return null}if(typeof r=="string")try{return kw(JSON.parse(r))}catch{}return null}function Bw(r,e){if(r!=null){if(typeof r.message=="string"&&e.push(r.message),typeof r=="object")for(let t in r)Bw(r[t],e);if(typeof r=="string")try{return Bw(JSON.parse(r),e)}catch{}}}function AU(r){let e=[];return Bw(r,e),e}});var Ow=M(Gh=>{"use strict";Object.defineProperty(Gh,"__esModule",{value:!0});Gh.AnkrProvider=void 0;var Sw=me(),EU=Pi(),vU=Wr(),TU=Cn(),qh="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function PU(r){switch(r){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/eth_goerli";case"sepolia":return"rpc.ankr.com/eth_sepolia";case"arbitrum":return"rpc.ankr.com/arbitrum";case"base":return"rpc.ankr.com/base";case"base-goerli":return"rpc.ankr.com/base_goerli";case"base-sepolia":return"rpc.ankr.com/base_sepolia";case"bnb":return"rpc.ankr.com/bsc";case"bnbt":return"rpc.ankr.com/bsc_testnet_chapel";case"matic":return"rpc.ankr.com/polygon";case"matic-mumbai":return"rpc.ankr.com/polygon_mumbai";case"optimism":return"rpc.ankr.com/optimism";case"optimism-goerli":return"rpc.ankr.com/optimism_testnet";case"optimism-sepolia":return"rpc.ankr.com/optimism_sepolia"}(0,Sw.assertArgument)(!1,"unsupported network","network",r)}var Cu=class extends TU.JsonRpcProvider{apiKey;constructor(e,t){e==null&&(e="mainnet");let n=vU.Network.from(e);t==null&&(t=qh);let s={polling:!0,staticNetwork:n},i=Cu.getRequest(n,t);super(i,n,s),(0,Sw.defineProperties)(this,{apiKey:t})}_getProvider(e){try{return new Cu(e,this.apiKey)}catch{}return super._getProvider(e)}static getRequest(e,t){t==null&&(t=qh);let n=new Sw.FetchRequest(`https://${PU(e.name)}/${t}`);return n.allowGzip=!0,t===qh&&(n.retryFunc=async(s,i,o)=>((0,EU.showThrottleMessage)("AnkrProvider"),!0)),n}getRpcError(e,t){return e.method==="eth_sendRawTransaction"&&t&&t.error&&t.error.message==="INTERNAL_ERROR: could not replace existing tx"&&(t.error.message="replacement transaction underpriced"),super.getRpcError(e,t)}isCommunityResource(){return this.apiKey===qh}};Gh.AnkrProvider=Cu});var _w=M(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.AlchemyProvider=void 0;var Nu=me(),kU=Pi(),BU=Wr(),SU=Cn(),zh="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function OU(r){switch(r){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"arbitrum-sepolia":return"arb-sepolia.g.alchemy.com";case"base":return"base-mainnet.g.alchemy.com";case"base-goerli":return"base-goerli.g.alchemy.com";case"base-sepolia":return"base-sepolia.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-amoy":return"polygon-amoy.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com";case"optimism-sepolia":return"opt-sepolia.g.alchemy.com"}(0,Nu.assertArgument)(!1,"unsupported network","network",r)}var Iu=class extends SU.JsonRpcProvider{apiKey;constructor(e,t){e==null&&(e="mainnet");let n=BU.Network.from(e);t==null&&(t=zh);let s=Iu.getRequest(n,t);super(s,n,{staticNetwork:n}),(0,Nu.defineProperties)(this,{apiKey:t})}_getProvider(e){try{return new Iu(e,this.apiKey)}catch{}return super._getProvider(e)}async _perform(e){if(e.method==="getTransactionResult"){let{trace:t,tx:n}=await(0,Nu.resolveProperties)({trace:this.send("trace_transaction",[e.hash]),tx:this.getTransaction(e.hash)});if(t==null||n==null)return null;let s,i=!1;try{s=t[0].result.output,i=t[0].error==="Reverted"}catch{}if(s)return(0,Nu.assert)(!i,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:s,reason:null,transaction:n,invocation:null,revert:null}),s;(0,Nu.assert)(!1,"could not parse trace result","BAD_DATA",{value:t})}return await super._perform(e)}isCommunityResource(){return this.apiKey===zh}static getRequest(e,t){t==null&&(t=zh);let n=new Nu.FetchRequest(`https://${OU(e.name)}/v2/${t}`);return n.allowGzip=!0,t===zh&&(n.retryFunc=async(s,i,o)=>((0,kU.showThrottleMessage)("alchemy"),!0)),n}};Vh.AlchemyProvider=Iu});var Cw=M(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});Jh.ChainstackProvider=void 0;var Wh=me(),_U=Pi(),CU=Wr(),NU=Cn();function Kh(r){switch(r){case"mainnet":return"39f1d67cedf8b7831010a665328c9197";case"arbitrum":return"0550c209db33c3abf4cc927e1e18cea1";case"bnb":return"98b5a77e531614387366f6fc5da097f8";case"matic":return"cd9d4d70377471aa7c142ec4a4205249"}(0,Wh.assertArgument)(!1,"unsupported network","network",r)}function IU(r){switch(r){case"mainnet":return"ethereum-mainnet.core.chainstack.com";case"arbitrum":return"arbitrum-mainnet.core.chainstack.com";case"bnb":return"bsc-mainnet.core.chainstack.com";case"matic":return"polygon-mainnet.core.chainstack.com"}(0,Wh.assertArgument)(!1,"unsupported network","network",r)}var Ru=class extends NU.JsonRpcProvider{apiKey;constructor(e,t){e==null&&(e="mainnet");let n=CU.Network.from(e);t==null&&(t=Kh(n.name));let s=Ru.getRequest(n,t);super(s,n,{staticNetwork:n}),(0,Wh.defineProperties)(this,{apiKey:t})}_getProvider(e){try{return new Ru(e,this.apiKey)}catch{}return super._getProvider(e)}isCommunityResource(){return this.apiKey===Kh(this._network.name)}static getRequest(e,t){t==null&&(t=Kh(e.name));let n=new Wh.FetchRequest(`https://${IU(e.name)}/${t}`);return n.allowGzip=!0,t===Kh(e.name)&&(n.retryFunc=async(s,i,o)=>((0,_U.showThrottleMessage)("ChainstackProvider"),!0)),n}};Jh.ChainstackProvider=Ru});var Iw=M(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.CloudflareProvider=void 0;var RU=me(),MU=Wr(),LU=Cn(),Nw=class extends LU.JsonRpcProvider{constructor(e){e==null&&(e="mainnet");let t=MU.Network.from(e);(0,RU.assertArgument)(t.name==="mainnet","unsupported network","network",e),super("https://cloudflare-eth.com/",t,{staticNetwork:t})}};Qh.CloudflareProvider=Nw});var Mw=M(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.EtherscanProvider=Mu.EtherscanPlugin=void 0;var jU=bu(),UU=Wf(),ik=qr(),Gt=me(),FU=ku(),DU=Wr(),HU=Sh(),$U=Pi(),ok=2e3;function qU(r){return r&&typeof r.then=="function"}var ak="org.ethers.plugins.provider.Etherscan",od=class extends HU.NetworkPlugin{baseUrl;constructor(e){super(ak),(0,Gt.defineProperties)(this,{baseUrl:e})}clone(){return new od(this.baseUrl)}};Mu.EtherscanPlugin=od;var GU=["enableCcipRead"],zU=1,Rw=class extends FU.AbstractProvider{network;apiKey;#e;constructor(e,t){let n=t??null;super();let s=DU.Network.from(e);this.#e=s.getPlugin(ak),(0,Gt.defineProperties)(this,{apiKey:n,network:s}),this.getBaseUrl()}getBaseUrl(){if(this.#e)return this.#e.baseUrl;switch(this.network.name){case"mainnet":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"holesky":return"https://api-holesky.etherscan.io";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"base":return"https://api.basescan.org";case"base-sepolia":return"https://api-sepolia.basescan.org";case"bnb":return"https://api.bscscan.com";case"bnbt":return"https://api-testnet.bscscan.com";case"matic":return"https://api.polygonscan.com";case"matic-amoy":return"https://api-amoy.polygonscan.com";case"matic-mumbai":return"https://api-testnet.polygonscan.com";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io";default:}(0,Gt.assertArgument)(!1,"unsupported network","network",this.network)}getUrl(e,t){let n=Object.keys(t).reduce((i,o)=>{let a=t[o];return a!=null&&(i+=`&${o}=${a}`),i},""),s=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.getBaseUrl()}/api?module=${e}${n}${s}`}getPostUrl(){return`${this.getBaseUrl()}/api`}getPostData(e,t){return t.module=e,t.apikey=this.apiKey,t}async detectNetwork(){return this.network}async fetch(e,t,n){let s=zU++,i=n?this.getPostUrl():this.getUrl(e,t),o=n?this.getPostData(e,t):null;this.emit("debug",{action:"sendRequest",id:s,url:i,payload:o});let a=new Gt.FetchRequest(i);a.setThrottleParams({slotInterval:1e3}),a.retryFunc=(l,f,d)=>(this.isCommunityResource()&&(0,$U.showThrottleMessage)("Etherscan"),Promise.resolve(!0)),a.processFunc=async(l,f)=>{let d=f.hasBody()?JSON.parse((0,Gt.toUtf8String)(f.body)):{},h=(typeof d.result=="string"?d.result:"").toLowerCase().indexOf("rate limit")>=0;return e==="proxy"?d&&d.status==0&&d.message=="NOTOK"&&h&&(this.emit("debug",{action:"receiveError",id:s,reason:"proxy-NOTOK",error:d}),f.throwThrottleError(d.result,ok)):h&&(this.emit("debug",{action:"receiveError",id:s,reason:"null result",error:d.result}),f.throwThrottleError(d.result,ok)),f},o&&(a.setHeader("content-type","application/x-www-form-urlencoded; charset=UTF-8"),a.body=Object.keys(o).map(l=>`${l}=${o[l]}`).join("&"));let c=await a.send();try{c.assertOk()}catch(l){this.emit("debug",{action:"receiveError",id:s,error:l,reason:"assertOk"}),(0,Gt.assert)(!1,"response error","SERVER_ERROR",{request:a,response:c})}c.hasBody()||(this.emit("debug",{action:"receiveError",id:s,error:"missing body",reason:"null body"}),(0,Gt.assert)(!1,"missing response","SERVER_ERROR",{request:a,response:c}));let u=JSON.parse((0,Gt.toUtf8String)(c.body));return e==="proxy"?(u.jsonrpc!="2.0"&&(this.emit("debug",{action:"receiveError",id:s,result:u,reason:"invalid JSON-RPC"}),(0,Gt.assert)(!1,"invalid JSON-RPC response (missing jsonrpc='2.0')","SERVER_ERROR",{request:a,response:c,info:{result:u}})),u.error&&(this.emit("debug",{action:"receiveError",id:s,result:u,reason:"JSON-RPC error"}),(0,Gt.assert)(!1,"error response","SERVER_ERROR",{request:a,response:c,info:{result:u}})),this.emit("debug",{action:"receiveRequest",id:s,result:u}),u.result):u.status==0&&(u.message==="No records found"||u.message==="No transactions found")?(this.emit("debug",{action:"receiveRequest",id:s,result:u}),u.result):((u.status!=1||typeof u.message=="string"&&!u.message.match(/^OK/))&&(this.emit("debug",{action:"receiveError",id:s,result:u}),(0,Gt.assert)(!1,"error response","SERVER_ERROR",{request:a,response:c,info:{result:u}})),this.emit("debug",{action:"receiveRequest",id:s,result:u}),u.result)}_getTransactionPostData(e){let t={};for(let n in e){if(GU.indexOf(n)>=0||e[n]==null)continue;let s=e[n];if(!(n==="type"&&s===0)&&!(n==="blockTag"&&s==="latest")){if({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[n])s=(0,Gt.toQuantity)(s);else if(n==="accessList")s="["+(0,ik.accessListify)(s).map(i=>`{address:"${i.address}",storageKeys:["${i.storageKeys.join('","')}"]}`).join(",")+"]";else if(n==="blobVersionedHashes"){if(s.length===0)continue;(0,Gt.assert)(!1,"Etherscan API does not support blobVersionedHashes","UNSUPPORTED_OPERATION",{operation:"_getTransactionPostData",info:{transaction:e}})}else s=(0,Gt.hexlify)(s);t[n]=s}}return t}_checkError(e,t,n){let s="";if((0,Gt.isError)(t,"SERVER_ERROR")){try{s=t.info.result.error.message}catch{}if(!s)try{s=t.info.message}catch{}}if(e.method==="estimateGas"&&!s.match(/revert/i)&&s.match(/insufficient funds/i)&&(0,Gt.assert)(!1,"insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.transaction}),(e.method==="call"||e.method==="estimateGas")&&s.match(/execution reverted/i)){let i="";try{i=t.info.result.error.data}catch{}let o=jU.AbiCoder.getBuiltinCallException(e.method,e.transaction,i);throw o.info={request:e,error:t},o}if(s&&e.method==="broadcastTransaction"){let i=ik.Transaction.from(e.signedTransaction);s.match(/replacement/i)&&s.match(/underpriced/i)&&(0,Gt.assert)(!1,"replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:i}),s.match(/insufficient funds/)&&(0,Gt.assert)(!1,"insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:i}),s.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&(0,Gt.assert)(!1,"nonce has already been used","NONCE_EXPIRED",{transaction:i})}throw t}async _detectNetwork(){return this.network}async _perform(e){switch(e.method){case"chainId":return this.network.chainId;case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getPriorityFee":if(this.network.name==="mainnet")return"1000000000";if(this.network.name==="optimism")return"1000000";throw new Error("fallback onto the AbstractProvider default");case"getBalance":return this.fetch("account",{action:"balance",address:e.address,tag:e.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:e.address,tag:e.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:e.address,tag:e.blockTag});case"getStorage":return this.fetch("proxy",{action:"eth_getStorageAt",address:e.address,position:e.position,tag:e.blockTag});case"broadcastTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:e.signedTransaction},!0).catch(t=>this._checkError(e,t,e.signedTransaction));case"getBlock":if("blockTag"in e)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:e.blockTag,boolean:e.includeTransactions?"true":"false"});(0,Gt.assert)(!1,"getBlock by blockHash not supported by Etherscan","UNSUPPORTED_OPERATION",{operation:"getBlock(blockHash)"});case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:e.hash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:e.hash});case"call":{if(e.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");let t=this._getTransactionPostData(e.transaction);t.module="proxy",t.action="eth_call";try{return await this.fetch("proxy",t,!0)}catch(n){return this._checkError(e,n,e.transaction)}}case"estimateGas":{let t=this._getTransactionPostData(e.transaction);t.module="proxy",t.action="eth_estimateGas";try{return await this.fetch("proxy",t,!0)}catch(n){return this._checkError(e,n,e.transaction)}}default:break}return super._perform(e)}async getNetwork(){return this.network}async getEtherPrice(){return this.network.name!=="mainnet"?0:parseFloat((await this.fetch("stats",{action:"ethprice"})).ethusd)}async getContract(e){let t=this._getAddress(e);qU(t)&&(t=await t);try{let n=await this.fetch("contract",{action:"getabi",address:t}),s=JSON.parse(n);return new UU.Contract(t,s,this)}catch{return null}}isCommunityResource(){return this.apiKey==null}};Mu.EtherscanProvider=Rw});var ck=M(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});Yh.WebSocket=void 0;function VU(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}var KU=VU().WebSocket;Yh.WebSocket=KU});var tm=M(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.SocketProvider=Nn.SocketEventSubscriber=Nn.SocketPendingSubscriber=Nn.SocketBlockSubscriber=Nn.SocketSubscriber=void 0;var uk=ku(),ad=me(),WU=Cn(),Lu=class{#e;#t;get filter(){return JSON.parse(this.#t)}#r;#n;#s;constructor(e,t){this.#e=e,this.#t=JSON.stringify(t),this.#r=null,this.#n=null,this.#s=null}start(){this.#r=this.#e.send("eth_subscribe",this.filter).then(e=>(this.#e._register(e,this),e))}stop(){this.#r.then(e=>{this.#e.destroyed||this.#e.send("eth_unsubscribe",[e])}),this.#r=null}pause(e){(0,ad.assert)(e,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"}),this.#n=!!e}resume(){this.#n=null}_handleMessage(e){if(this.#r!=null&&this.#n===null){let t=this.#s;t==null?t=this._emit(this.#e,e):t=t.then(async()=>{await this._emit(this.#e,e)}),this.#s=t.then(()=>{this.#s===t&&(this.#s=null)})}}async _emit(e,t){throw new Error("sub-classes must implemente this; _emit")}};Nn.SocketSubscriber=Lu;var Zh=class extends Lu{constructor(e){super(e,["newHeads"])}async _emit(e,t){e.emit("block",parseInt(t.number))}};Nn.SocketBlockSubscriber=Zh;var Xh=class extends Lu{constructor(e){super(e,["newPendingTransactions"])}async _emit(e,t){e.emit("pending",t)}};Nn.SocketPendingSubscriber=Xh;var em=class extends Lu{#e;get logFilter(){return JSON.parse(this.#e)}constructor(e,t){super(e,["logs",t]),this.#e=JSON.stringify(t)}async _emit(e,t){e.emit(this.logFilter,e._wrapLog(t,e._network))}};Nn.SocketEventSubscriber=em;var Lw=class extends WU.JsonRpcApiProvider{#e;#t;#r;constructor(e,t){let n=Object.assign({},t??{});(0,ad.assertArgument)(n.batchMaxCount==null||n.batchMaxCount===1,"sockets-based providers do not support batches","options.batchMaxCount",t),n.batchMaxCount=1,n.staticNetwork==null&&(n.staticNetwork=!0),super(e,n),this.#e=new Map,this.#t=new Map,this.#r=new Map}_getSubscriber(e){switch(e.type){case"close":return new uk.UnmanagedSubscriber("close");case"block":return new Zh(this);case"pending":return new Xh(this);case"event":return new em(this,e.filter);case"orphan":if(e.filter.orphan==="drop-log")return new uk.UnmanagedSubscriber("drop-log")}return super._getSubscriber(e)}_register(e,t){this.#t.set(e,t);let n=this.#r.get(e);if(n){for(let s of n)t._handleMessage(s);this.#r.delete(e)}}async _send(e){(0,ad.assertArgument)(!Array.isArray(e),"WebSocket does not support batch send","payload",e);let t=new Promise((n,s)=>{this.#e.set(e.id,{payload:e,resolve:n,reject:s})});return await this._waitUntilReady(),await this._write(JSON.stringify(e)),[await t]}async _processMessage(e){let t=JSON.parse(e);if(t&&typeof t=="object"&&"id"in t){let n=this.#e.get(t.id);if(n==null){this.emit("error",(0,ad.makeError)("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:t}));return}this.#e.delete(t.id),n.resolve(t)}else if(t&&t.method==="eth_subscription"){let n=t.params.subscription,s=this.#t.get(n);if(s)s._handleMessage(t.params.result);else{let i=this.#r.get(n);i==null&&(i=[],this.#r.set(n,i)),i.push(t.params.result)}}else{this.emit("error",(0,ad.makeError)("received unexpected message","UNKNOWN_ERROR",{reasonCode:"UNEXPECTED_MESSAGE",result:t}));return}}async _write(e){throw new Error("sub-classes must override this")}};Nn.SocketProvider=Lw});var nm=M(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});rm.WebSocketProvider=void 0;var JU=ck(),QU=tm(),jw=class extends QU.SocketProvider{#e;#t;get websocket(){if(this.#t==null)throw new Error("websocket closed");return this.#t}constructor(e,t,n){super(t,n),typeof e=="string"?(this.#e=()=>new JU.WebSocket(e),this.#t=this.#e()):typeof e=="function"?(this.#e=e,this.#t=e()):(this.#e=null,this.#t=e),this.websocket.onopen=async()=>{try{await this._start(),this.resume()}catch(s){console.log("failed to start WebsocketProvider",s)}},this.websocket.onmessage=s=>{this._processMessage(s.data)}}async _write(e){this.websocket.send(e)}async destroy(){this.#t!=null&&(this.#t.close(),this.#t=null),super.destroy()}};rm.WebSocketProvider=jw});var Uw=M(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.InfuraProvider=ju.InfuraWebSocketProvider=void 0;var ud=me(),YU=Pi(),ZU=Wr(),XU=Cn(),eF=nm(),cd="84842078b09946638c03157f83405213";function tF(r){switch(r){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"arbitrum-sepolia":return"arbitrum-sepolia.infura.io";case"base":return"base-mainnet.infura.io";case"base-goerlia":return"base-goerli.infura.io";case"base-sepolia":return"base-sepolia.infura.io";case"bnb":return"bnbsmartchain-mainnet.infura.io";case"bnbt":return"bnbsmartchain-testnet.infura.io";case"linea":return"linea-mainnet.infura.io";case"linea-goerli":return"linea-goerli.infura.io";case"linea-sepolia":return"linea-sepolia.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-amoy":return"polygon-amoy.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io";case"optimism-sepolia":return"optimism-sepolia.infura.io"}(0,ud.assertArgument)(!1,"unsupported network","network",r)}var sm=class extends eF.WebSocketProvider{projectId;projectSecret;constructor(e,t){let n=new Ha(e,t),s=n._getConnection();(0,ud.assert)(!s.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});let i=s.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(i,n._network),(0,ud.defineProperties)(this,{projectId:n.projectId,projectSecret:n.projectSecret})}isCommunityResource(){return this.projectId===cd}};ju.InfuraWebSocketProvider=sm;var Ha=class extends XU.JsonRpcProvider{projectId;projectSecret;constructor(e,t,n){e==null&&(e="mainnet");let s=ZU.Network.from(e);t==null&&(t=cd),n==null&&(n=null);let i=Ha.getRequest(s,t,n);super(i,s,{staticNetwork:s}),(0,ud.defineProperties)(this,{projectId:t,projectSecret:n})}_getProvider(e){try{return new Ha(e,this.projectId,this.projectSecret)}catch{}return super._getProvider(e)}isCommunityResource(){return this.projectId===cd}static getWebSocketProvider(e,t){return new sm(e,t)}static getRequest(e,t,n){t==null&&(t=cd),n==null&&(n=null);let s=new ud.FetchRequest(`https://${tF(e.name)}/v3/${t}`);return s.allowGzip=!0,n&&s.setCredentials("",n),t===cd&&(s.retryFunc=async(i,o,a)=>((0,YU.showThrottleMessage)("InfuraProvider"),!0)),s}};ju.InfuraProvider=Ha});var Dw=M(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});om.QuickNodeProvider=void 0;var Fw=me(),rF=Pi(),nF=Wr(),sF=Cn(),im="919b412a057b5e9c9b6dce193c5a60242d6efadb";function iF(r){switch(r){case"mainnet":return"ethers.quiknode.pro";case"goerli":return"ethers.ethereum-goerli.quiknode.pro";case"sepolia":return"ethers.ethereum-sepolia.quiknode.pro";case"holesky":return"ethers.ethereum-holesky.quiknode.pro";case"arbitrum":return"ethers.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"ethers.arbitrum-goerli.quiknode.pro";case"arbitrum-sepolia":return"ethers.arbitrum-sepolia.quiknode.pro";case"base":return"ethers.base-mainnet.quiknode.pro";case"base-goerli":return"ethers.base-goerli.quiknode.pro";case"base-spolia":return"ethers.base-sepolia.quiknode.pro";case"bnb":return"ethers.bsc.quiknode.pro";case"bnbt":return"ethers.bsc-testnet.quiknode.pro";case"matic":return"ethers.matic.quiknode.pro";case"matic-mumbai":return"ethers.matic-testnet.quiknode.pro";case"optimism":return"ethers.optimism.quiknode.pro";case"optimism-goerli":return"ethers.optimism-goerli.quiknode.pro";case"optimism-sepolia":return"ethers.optimism-sepolia.quiknode.pro";case"xdai":return"ethers.xdai.quiknode.pro"}(0,Fw.assertArgument)(!1,"unsupported network","network",r)}var Uu=class extends sF.JsonRpcProvider{token;constructor(e,t){e==null&&(e="mainnet");let n=nF.Network.from(e);t==null&&(t=im);let s=Uu.getRequest(n,t);super(s,n,{staticNetwork:n}),(0,Fw.defineProperties)(this,{token:t})}_getProvider(e){try{return new Uu(e,this.token)}catch{}return super._getProvider(e)}isCommunityResource(){return this.token===im}static getRequest(e,t){t==null&&(t=im);let n=new Fw.FetchRequest(`https://${iF(e.name)}/${t}`);return n.allowGzip=!0,t===im&&(n.retryFunc=async(s,i,o)=>((0,rF.showThrottleMessage)("QuickNodeProvider"),!0)),n}};om.QuickNodeProvider=Uu});var Kw=M(cm=>{"use strict";Object.defineProperty(cm,"__esModule",{value:!0});cm.FallbackProvider=void 0;var hs=me(),lk=ku(),oF=Wr(),aF=BigInt("1"),cF=BigInt("2");function uF(r){for(let e=r.length-1;e>0;e--){let t=Math.floor(Math.random()*(e+1)),n=r[e];r[e]=r[t],r[t]=n}}function lF(r){return new Promise(e=>{setTimeout(e,r)})}function Gw(){return new Date().getTime()}function Hw(r){return JSON.stringify(r,(e,t)=>typeof t=="bigint"?{type:"bigint",value:t.toString()}:t)}var fk={stallTimeout:400,priority:1,weight:1},dk={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0,_lastFatalError:null,_lastFatalErrorTimestamp:0};async function fF(r,e){for(;(r.blockNumber<0||r.blockNumber<e)&&(r._updateNumber||(r._updateNumber=(async()=>{try{let t=await r.provider.getBlockNumber();t>r.blockNumber&&(r.blockNumber=t)}catch(t){r.blockNumber=-2,r._lastFatalError=t,r._lastFatalErrorTimestamp=Gw()}r._updateNumber=null})()),await r._updateNumber,r.outOfSync++,!r._lastFatalError););}function ld(r){if(r==null)return"null";if(Array.isArray(r))return"["+r.map(ld).join(",")+"]";if(typeof r=="object"&&typeof r.toJSON=="function")return ld(r.toJSON());switch(typeof r){case"boolean":case"symbol":return r.toString();case"bigint":case"number":return BigInt(r).toString();case"string":return JSON.stringify(r);case"object":{let e=Object.keys(r);return e.sort(),"{"+e.map(t=>`${JSON.stringify(t)}:${ld(r[t])}`).join(",")+"}"}}throw console.log("Could not serialize",r),new Error("Hmm...")}function $w(r){if("error"in r){let t=r.error;return{tag:ld(t),value:t}}let e=r.result;return{tag:ld(e),value:e}}function am(r,e){let t=new Map;for(let{value:s,tag:i,weight:o}of e){let a=t.get(i)||{value:s,weight:0};a.weight+=o,t.set(i,a)}let n=null;for(let s of t.values())s.weight>=r&&(!n||s.weight>n.weight)&&(n=s);if(n)return n.value}function zw(r,e){let t=0,n=new Map,s=null,i=[];for(let{value:a,tag:c,weight:u}of e)if(a instanceof Error){let l=n.get(c)||{value:a,weight:0};l.weight+=u,n.set(c,l),(s==null||l.weight>s.weight)&&(s=l)}else i.push(BigInt(a)),t+=u;if(t<r)return s&&s.weight>=r?s.value:void 0;i.sort((a,c)=>a<c?-1:c>a?1:0);let o=Math.floor(i.length/2);return i.length%2?i[o]:(i[o-1]+i[o]+aF)/cF}function qw(r,e){let t=am(r,e);if(t!==void 0)return t;for(let n of e)if(n.value)return n.value}function dF(r,e){if(r===1)return(0,hs.getNumber)(zw(r,e),"%internal");let t=new Map,n=(o,a)=>{let c=t.get(o)||{result:o,weight:0};c.weight+=a,t.set(o,c)};for(let{weight:o,value:a}of e){let c=(0,hs.getNumber)(a);n(c-1,o),n(c,o),n(c+1,o)}let s=0,i;for(let{weight:o,result:a}of t.values())o>=r&&(o>s||i!=null&&o===s&&a>i)&&(s=o,i=a);return i}var Vw=class extends lk.AbstractProvider{quorum;eventQuorum;eventWorkers;#e;#t;#r;constructor(e,t,n){super(t,n),this.#e=e.map(s=>s instanceof lk.AbstractProvider?Object.assign({provider:s},fk,dk):Object.assign({},fk,s,dk)),this.#t=-2,this.#r=null,n&&n.quorum!=null?this.quorum=n.quorum:this.quorum=Math.ceil(this.#e.reduce((s,i)=>(s+=i.weight,s),0)/2),this.eventQuorum=1,this.eventWorkers=1,(0,hs.assertArgument)(this.quorum<=this.#e.reduce((s,i)=>s+i.weight,0),"quorum exceed provider weight","quorum",this.quorum)}get providerConfigs(){return this.#e.map(e=>{let t=Object.assign({},e);for(let n in t)n[0]==="_"&&delete t[n];return t})}async _detectNetwork(){return oF.Network.from((0,hs.getBigInt)(await this._perform({method:"chainId"})))}async _translatePerform(e,t){switch(t.method){case"broadcastTransaction":return await e.broadcastTransaction(t.signedTransaction);case"call":return await e.call(Object.assign({},t.transaction,{blockTag:t.blockTag}));case"chainId":return(await e.getNetwork()).chainId;case"estimateGas":return await e.estimateGas(t.transaction);case"getBalance":return await e.getBalance(t.address,t.blockTag);case"getBlock":{let n="blockHash"in t?t.blockHash:t.blockTag;return await e.getBlock(n,t.includeTransactions)}case"getBlockNumber":return await e.getBlockNumber();case"getCode":return await e.getCode(t.address,t.blockTag);case"getGasPrice":return(await e.getFeeData()).gasPrice;case"getPriorityFee":return(await e.getFeeData()).maxPriorityFeePerGas;case"getLogs":return await e.getLogs(t.filter);case"getStorage":return await e.getStorage(t.address,t.position,t.blockTag);case"getTransaction":return await e.getTransaction(t.hash);case"getTransactionCount":return await e.getTransactionCount(t.address,t.blockTag);case"getTransactionReceipt":return await e.getTransactionReceipt(t.hash);case"getTransactionResult":return await e.getTransactionResult(t.hash)}}#n(e){let t=Array.from(e).map(s=>s.config),n=this.#e.slice();uF(n),n.sort((s,i)=>s.priority-i.priority);for(let s of n)if(!s._lastFatalError&&t.indexOf(s)===-1)return s;return null}#s(e,t){let n=this.#n(e);if(n==null)return null;let s={config:n,result:null,didBump:!1,perform:null,staller:null},i=Gw();return s.perform=(async()=>{try{n.requests++;let a=await this._translatePerform(n.provider,t);s.result={result:a}}catch(a){n.errorResponses++,s.result={error:a}}let o=Gw()-i;n._totalTime+=o,n.rollingDuration=.95*n.rollingDuration+.05*o,s.perform=null})(),s.staller=(async()=>{await lF(n.stallTimeout),s.staller=null})(),e.add(s),s}async#o(){let e=this.#r;if(!e){let t=[];this.#e.forEach(n=>{t.push((async()=>{await fF(n,0),n._lastFatalError||(n._network=await n.provider.getNetwork())})())}),this.#r=e=(async()=>{await Promise.all(t);let n=null;for(let s of this.#e){if(s._lastFatalError)continue;let i=s._network;n==null?n=i.chainId:i.chainId!==n&&(0,hs.assert)(!1,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}})()}await e}async#i(e,t){let n=[];for(let s of e)if(s.result!=null){let{tag:i,value:o}=$w(s.result);n.push({tag:i,value:o,weight:s.config.weight})}if(!(n.reduce((s,i)=>s+i.weight,0)<this.quorum)){switch(t.method){case"getBlockNumber":{this.#t===-2&&(this.#t=Math.ceil((0,hs.getNumber)(zw(this.quorum,this.#e.filter(i=>!i._lastFatalError).map(i=>({value:i.blockNumber,tag:(0,hs.getNumber)(i.blockNumber).toString(),weight:i.weight}))))));let s=dF(this.quorum,n);return s===void 0?void 0:(s>this.#t&&(this.#t=s),this.#t)}case"getGasPrice":case"getPriorityFee":case"estimateGas":return zw(this.quorum,n);case"getBlock":return"blockTag"in t&&t.blockTag==="pending"?qw(this.quorum,n):am(this.quorum,n);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return am(this.quorum,n);case"broadcastTransaction":return qw(this.quorum,n)}(0,hs.assert)(!1,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${Hw(t.method)})`})}}async#a(e,t){if(e.size===0)throw new Error("no runners?!");let n=[],s=0;for(let o of e){if(o.perform&&n.push(o.perform),o.staller){n.push(o.staller);continue}o.didBump||(o.didBump=!0,s++)}let i=await this.#i(e,t);if(i!==void 0){if(i instanceof Error)throw i;return i}for(let o=0;o<s;o++)this.#s(e,t);return(0,hs.assert)(n.length>0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:t,results:Array.from(e).map(o=>Hw(o.result))}}),await Promise.race(n),await this.#a(e,t)}async _perform(e){if(e.method==="broadcastTransaction"){let i=this.#e.map(c=>null),o=this.#e.map(async({provider:c,weight:u},l)=>{try{let f=await c._perform(e);i[l]=Object.assign($w({result:f}),{weight:u})}catch(f){i[l]=Object.assign($w({error:f}),{weight:u})}});for(;;){let c=i.filter(f=>f!=null);for(let{value:f}of c)if(!(f instanceof Error))return f;let u=am(this.quorum,i.filter(f=>f!=null));if((0,hs.isError)(u,"INSUFFICIENT_FUNDS"))throw u;let l=o.filter((f,d)=>i[d]==null);if(l.length===0)break;await Promise.race(l)}let a=qw(this.quorum,i);if((0,hs.assert)(a!==void 0,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:e,results:i.map(Hw)}}),a instanceof Error)throw a;return a}await this.#o();let t=new Set,n=0;for(;;){let i=this.#s(t,e);if(i==null||(n+=i.config.weight,n>=this.quorum))break}let s=await this.#a(t,e);for(let i of t)i.perform&&i.result==null&&i.config.lateResponses++;return s}async destroy(){for(let{provider:e}of this.#e)e.destroy();super.destroy()}};cm.FallbackProvider=Vw});var pk=M(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});um.getDefaultProvider=void 0;var pF=me(),hF=Ow(),mF=_w(),bF=Cw(),gF=Iw(),xF=Mw(),yF=Uw(),wF=Dw(),AF=Kw(),Ww=Cn(),EF=Wr(),vF=nm();function TF(r){return r&&typeof r.send=="function"&&typeof r.close=="function"}var PF="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");function kF(r,e){e==null&&(e={});let t=o=>e[o]==="-"?!1:typeof e.exclusive=="string"?o===e.exclusive:Array.isArray(e.exclusive)?e.exclusive.indexOf(o)!==-1:!0;if(typeof r=="string"&&r.match(/^https?:/))return new Ww.JsonRpcProvider(r);if(typeof r=="string"&&r.match(/^wss?:/)||TF(r))return new vF.WebSocketProvider(r);let n=null;try{n=EF.Network.from(r)}catch{}let s=[];if(t("publicPolygon")&&n&&(n.name==="matic"?s.push(new Ww.JsonRpcProvider("https://polygon-rpc.com/",n,{staticNetwork:n})):n.name==="matic-amoy"&&s.push(new Ww.JsonRpcProvider("https://rpc-amoy.polygon.technology/",n,{staticNetwork:n}))),t("alchemy"))try{s.push(new mF.AlchemyProvider(r,e.alchemy))}catch{}if(t("ankr")&&e.ankr!=null)try{s.push(new hF.AnkrProvider(r,e.ankr))}catch{}if(t("chainstack"))try{s.push(new bF.ChainstackProvider(r,e.chainstack))}catch{}if(t("cloudflare"))try{s.push(new gF.CloudflareProvider(r))}catch{}if(t("etherscan"))try{s.push(new xF.EtherscanProvider(r,e.etherscan))}catch{}if(t("infura"))try{let o=e.infura,a;typeof o=="object"&&(a=o.projectSecret,o=o.projectId),s.push(new yF.InfuraProvider(r,o,a))}catch{}if(t("quicknode"))try{let o=e.quicknode;s.push(new wF.QuickNodeProvider(r,o))}catch{}if((0,pF.assert)(s.length,"unsupported default network","UNSUPPORTED_OPERATION",{operation:"getDefaultProvider"}),s.length===1)return s[0];let i=Math.floor(s.length/2);return i>2&&(i=2),n&&PF.indexOf(n.name)!==-1&&(i=1),e&&e.quorum&&(i=e.quorum),new AF.FallbackProvider(s,void 0,{quorum:i})}um.getDefaultProvider=kF});var hk=M(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});lm.NonceManager=void 0;var BF=me(),SF=Uh(),fd=class extends SF.AbstractSigner{signer;#e;#t;constructor(e){super(e.provider),(0,BF.defineProperties)(this,{signer:e}),this.#e=null,this.#t=0}async getAddress(){return this.signer.getAddress()}connect(e){return new fd(this.signer.connect(e))}async getNonce(e){if(e==="pending"){this.#e==null&&(this.#e=super.getNonce("pending"));let t=this.#t;return await this.#e+t}return super.getNonce(e)}increment(){this.#t++}reset(){this.#t=0,this.#e=null}async sendTransaction(e){let t=this.getNonce("pending");return this.increment(),e=await this.signer.populateTransaction(e),e.nonce=await t,await this.signer.sendTransaction(e)}signTransaction(e){return this.signer.signTransaction(e)}signMessage(e){return this.signer.signMessage(e)}signTypedData(e,t,n){return this.signer.signTypedData(e,t,n)}};lm.NonceManager=fd});var bk=M(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});fm.BrowserProvider=void 0;var mk=me(),OF=Cn(),Jw=class extends OF.JsonRpcApiPollingProvider{#e;constructor(e,t,n){let s=Object.assign({},n??{},{batchMaxCount:1});(0,mk.assertArgument)(e&&e.request,"invalid EIP-1193 provider","ethereum",e),super(t,s),this.#e=async(i,o)=>{let a={method:i,params:o};this.emit("debug",{action:"sendEip1193Request",payload:a});try{let c=await e.request(a);return this.emit("debug",{action:"receiveEip1193Result",result:c}),c}catch(c){let u=new Error(c.message);throw u.code=c.code,u.data=c.data,u.payload=a,this.emit("debug",{action:"receiveEip1193Error",error:u}),u}}}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){(0,mk.assertArgument)(!Array.isArray(e),"EIP-1193 does not support batch request","payload",e);try{let t=await this.#e(e.method,e.params||[]);return[{id:e.id,result:t}]}catch(t){return[{id:e.id,error:{code:t.code,data:t.data,message:t.message}}]}}getRpcError(e,t){switch(t=JSON.parse(JSON.stringify(t)),t.error.code||-1){case 4001:t.error.message=`ethers-user-denied: ${t.error.message}`;break;case 4200:t.error.message=`ethers-unsupported: ${t.error.message}`;break}return super.getRpcError(e,t)}async hasSigner(e){e==null&&(e=0);let t=await this.send("eth_accounts",[]);return typeof e=="number"?t.length>e:(e=e.toLowerCase(),t.filter(n=>n.toLowerCase()===e).length!==0)}async getSigner(e){if(e==null&&(e=0),!await this.hasSigner(e))try{await this.#e("eth_requestAccounts",[])}catch(t){let n=t.payload;throw this.getRpcError(n,{id:n.id,error:t})}return await super.getSigner(e)}};fm.BrowserProvider=Jw});var gk=M(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});pm.PocketProvider=void 0;var Qw=me(),_F=Pi(),CF=Wr(),NF=Cn(),dm="62e1ad51b37b8e00394bda3b";function IF(r){switch(r){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}(0,Qw.assertArgument)(!1,"unsupported network","network",r)}var Fu=class extends NF.JsonRpcProvider{applicationId;applicationSecret;constructor(e,t,n){e==null&&(e="mainnet");let s=CF.Network.from(e);t==null&&(t=dm),n==null&&(n=null);let i={staticNetwork:s},o=Fu.getRequest(s,t,n);super(o,s,i),(0,Qw.defineProperties)(this,{applicationId:t,applicationSecret:n})}_getProvider(e){try{return new Fu(e,this.applicationId,this.applicationSecret)}catch{}return super._getProvider(e)}static getRequest(e,t,n){t==null&&(t=dm);let s=new Qw.FetchRequest(`https://${IF(e.name)}/v1/lb/${t}`);return s.allowGzip=!0,n&&s.setCredentials("",n),t===dm&&(s.retryFunc=async(i,o,a)=>((0,_F.showThrottleMessage)("PocketProvider"),!0)),s}isCommunityResource(){return this.applicationId===dm}};pm.PocketProvider=Fu});var xk=M(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});hm.IpcSocketProvider=void 0;var RF=void 0;hm.IpcSocketProvider=RF});var bm=M(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.SocketEventSubscriber=ue.SocketPendingSubscriber=ue.SocketBlockSubscriber=ue.SocketSubscriber=ue.WebSocketProvider=ue.SocketProvider=ue.IpcSocketProvider=ue.QuickNodeProvider=ue.PocketProvider=ue.InfuraWebSocketProvider=ue.InfuraProvider=ue.EtherscanPlugin=ue.EtherscanProvider=ue.ChainstackProvider=ue.CloudflareProvider=ue.AnkrProvider=ue.AlchemyProvider=ue.BrowserProvider=ue.JsonRpcSigner=ue.JsonRpcProvider=ue.JsonRpcApiProvider=ue.FallbackProvider=ue.copyRequest=ue.TransactionResponse=ue.TransactionReceipt=ue.Log=ue.FeeData=ue.Block=ue.FetchUrlFeeDataNetworkPlugin=ue.FeeDataNetworkPlugin=ue.EnsPlugin=ue.GasCostPlugin=ue.NetworkPlugin=ue.NonceManager=ue.Network=ue.MulticoinProviderPlugin=ue.EnsResolver=ue.getDefaultProvider=ue.showThrottleMessage=ue.VoidSigner=ue.AbstractSigner=ue.UnmanagedSubscriber=ue.AbstractProvider=void 0;var yk=ku();Object.defineProperty(ue,"AbstractProvider",{enumerable:!0,get:function(){return yk.AbstractProvider}});Object.defineProperty(ue,"UnmanagedSubscriber",{enumerable:!0,get:function(){return yk.UnmanagedSubscriber}});var wk=Uh();Object.defineProperty(ue,"AbstractSigner",{enumerable:!0,get:function(){return wk.AbstractSigner}});Object.defineProperty(ue,"VoidSigner",{enumerable:!0,get:function(){return wk.VoidSigner}});var MF=Pi();Object.defineProperty(ue,"showThrottleMessage",{enumerable:!0,get:function(){return MF.showThrottleMessage}});var LF=pk();Object.defineProperty(ue,"getDefaultProvider",{enumerable:!0,get:function(){return LF.getDefaultProvider}});var Ak=uw();Object.defineProperty(ue,"EnsResolver",{enumerable:!0,get:function(){return Ak.EnsResolver}});Object.defineProperty(ue,"MulticoinProviderPlugin",{enumerable:!0,get:function(){return Ak.MulticoinProviderPlugin}});var jF=Wr();Object.defineProperty(ue,"Network",{enumerable:!0,get:function(){return jF.Network}});var UF=hk();Object.defineProperty(ue,"NonceManager",{enumerable:!0,get:function(){return UF.NonceManager}});var dd=Sh();Object.defineProperty(ue,"NetworkPlugin",{enumerable:!0,get:function(){return dd.NetworkPlugin}});Object.defineProperty(ue,"GasCostPlugin",{enumerable:!0,get:function(){return dd.GasCostPlugin}});Object.defineProperty(ue,"EnsPlugin",{enumerable:!0,get:function(){return dd.EnsPlugin}});Object.defineProperty(ue,"FeeDataNetworkPlugin",{enumerable:!0,get:function(){return dd.FeeDataNetworkPlugin}});Object.defineProperty(ue,"FetchUrlFeeDataNetworkPlugin",{enumerable:!0,get:function(){return dd.FetchUrlFeeDataNetworkPlugin}});var Du=yu();Object.defineProperty(ue,"Block",{enumerable:!0,get:function(){return Du.Block}});Object.defineProperty(ue,"FeeData",{enumerable:!0,get:function(){return Du.FeeData}});Object.defineProperty(ue,"Log",{enumerable:!0,get:function(){return Du.Log}});Object.defineProperty(ue,"TransactionReceipt",{enumerable:!0,get:function(){return Du.TransactionReceipt}});Object.defineProperty(ue,"TransactionResponse",{enumerable:!0,get:function(){return Du.TransactionResponse}});Object.defineProperty(ue,"copyRequest",{enumerable:!0,get:function(){return Du.copyRequest}});var FF=Kw();Object.defineProperty(ue,"FallbackProvider",{enumerable:!0,get:function(){return FF.FallbackProvider}});var Yw=Cn();Object.defineProperty(ue,"JsonRpcApiProvider",{enumerable:!0,get:function(){return Yw.JsonRpcApiProvider}});Object.defineProperty(ue,"JsonRpcProvider",{enumerable:!0,get:function(){return Yw.JsonRpcProvider}});Object.defineProperty(ue,"JsonRpcSigner",{enumerable:!0,get:function(){return Yw.JsonRpcSigner}});var DF=bk();Object.defineProperty(ue,"BrowserProvider",{enumerable:!0,get:function(){return DF.BrowserProvider}});var HF=_w();Object.defineProperty(ue,"AlchemyProvider",{enumerable:!0,get:function(){return HF.AlchemyProvider}});var $F=Ow();Object.defineProperty(ue,"AnkrProvider",{enumerable:!0,get:function(){return $F.AnkrProvider}});var qF=Iw();Object.defineProperty(ue,"CloudflareProvider",{enumerable:!0,get:function(){return qF.CloudflareProvider}});var GF=Cw();Object.defineProperty(ue,"ChainstackProvider",{enumerable:!0,get:function(){return GF.ChainstackProvider}});var Ek=Mw();Object.defineProperty(ue,"EtherscanProvider",{enumerable:!0,get:function(){return Ek.EtherscanProvider}});Object.defineProperty(ue,"EtherscanPlugin",{enumerable:!0,get:function(){return Ek.EtherscanPlugin}});var vk=Uw();Object.defineProperty(ue,"InfuraProvider",{enumerable:!0,get:function(){return vk.InfuraProvider}});Object.defineProperty(ue,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return vk.InfuraWebSocketProvider}});var zF=gk();Object.defineProperty(ue,"PocketProvider",{enumerable:!0,get:function(){return zF.PocketProvider}});var VF=Dw();Object.defineProperty(ue,"QuickNodeProvider",{enumerable:!0,get:function(){return VF.QuickNodeProvider}});var KF=xk();Object.defineProperty(ue,"IpcSocketProvider",{enumerable:!0,get:function(){return KF.IpcSocketProvider}});var WF=tm();Object.defineProperty(ue,"SocketProvider",{enumerable:!0,get:function(){return WF.SocketProvider}});var JF=nm();Object.defineProperty(ue,"WebSocketProvider",{enumerable:!0,get:function(){return JF.WebSocketProvider}});var mm=tm();Object.defineProperty(ue,"SocketSubscriber",{enumerable:!0,get:function(){return mm.SocketSubscriber}});Object.defineProperty(ue,"SocketBlockSubscriber",{enumerable:!0,get:function(){return mm.SocketBlockSubscriber}});Object.defineProperty(ue,"SocketPendingSubscriber",{enumerable:!0,get:function(){return mm.SocketPendingSubscriber}});Object.defineProperty(ue,"SocketEventSubscriber",{enumerable:!0,get:function(){return mm.SocketEventSubscriber}})});var xm=M(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});gm.BaseWallet=void 0;var Zw=Yt(),Xw=Ls(),QF=bm(),Tk=qr(),Hu=me(),pd=class extends QF.AbstractSigner{address;#e;constructor(e,t){super(t),(0,Hu.assertArgument)(e&&typeof e.sign=="function","invalid private key","privateKey","[ REDACTED ]"),this.#e=e;let n=(0,Tk.computeAddress)(this.signingKey.publicKey);(0,Hu.defineProperties)(this,{address:n})}get signingKey(){return this.#e}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(e){return new pd(this.#e,e)}async signTransaction(e){let{to:t,from:n}=await(0,Hu.resolveProperties)({to:e.to?(0,Zw.resolveAddress)(e.to,this.provider):void 0,from:e.from?(0,Zw.resolveAddress)(e.from,this.provider):void 0});t!=null&&(e.to=t),n!=null&&(e.from=n),e.from!=null&&((0,Hu.assertArgument)((0,Zw.getAddress)(e.from)===this.address,"transaction from address mismatch","tx.from",e.from),delete e.from);let s=Tk.Transaction.from(e);return s.signature=this.signingKey.sign(s.unsignedHash),s.serialized}async signMessage(e){return this.signMessageSync(e)}signMessageSync(e){return this.signingKey.sign((0,Xw.hashMessage)(e)).serialized}async signTypedData(e,t,n){let s=await Xw.TypedDataEncoder.resolveNames(e,t,n,async i=>{(0,Hu.assert)(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:i}});let o=await this.provider.resolveName(i);return(0,Hu.assert)(o!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:i}),o});return this.signingKey.sign(Xw.TypedDataEncoder.hash(s.domain,t,s.value)).serialized}};gm.BaseWallet=pd});var e2=M($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.decodeOwl=$u.decode=void 0;var YF=me(),ym=" !#$%&'()*+,-./<=>?@[]^_`{|}~",ZF=/^[a-z]*$/i;function Pk(r,e){let t=97;return r.reduce((n,s)=>(s===e?t++:s.match(ZF)?n.push(String.fromCharCode(t)+s):(t=97,n.push(s)),n),[])}function kk(r,e){for(let s=ym.length-1;s>=0;s--)r=r.split(ym[s]).join(e.substring(2*s,2*s+2));let t=[],n=r.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(s,i,o,a)=>{if(o)for(let c=parseInt(o);c>=0;c--)t.push(";");else t.push(i.toLowerCase());return""});if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return Pk(Pk(t,";"),":")}$u.decode=kk;function XF(r){return(0,YF.assertArgument)(r[0]==="0","unsupported auwl data","data",r),kk(r.substring(1+2*ym.length),r.substring(1,1+2*ym.length))}$u.decodeOwl=XF});var r2=M(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});wm.Wordlist=void 0;var eD=me(),t2=class{locale;constructor(e){(0,eD.defineProperties)(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}};wm.Wordlist=t2});var Em=M(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});Am.WordlistOwl=void 0;var tD=Ls(),rD=me(),nD=e2(),sD=r2(),n2=class extends sD.Wordlist{#e;#t;constructor(e,t,n){super(e),this.#e=t,this.#t=n,this.#r=null}get _data(){return this.#e}_decodeWords(){return(0,nD.decodeOwl)(this.#e)}#r;#n(){if(this.#r==null){let e=this._decodeWords();if((0,tD.id)(e.join(`
|
|
759
759
|
`)+`
|
|
760
|
-
`)!==this.#t)throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#r=e}return this.#r}getWord(e){let t=this.#n();return(0,rD.assertArgument)(e>=0&&e<t.length,`invalid word index: ${e}`,"index",e),t[e]}getWordIndex(e){return this.#n().indexOf(e)}};Am.WordlistOwl=n2});var md=M(vm=>{"use strict";Object.defineProperty(vm,"__esModule",{value:!0});vm.LangEn=void 0;var iD=Em(),oD="0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO",aD="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60",s2=null,hd=class extends iD.WordlistOwl{constructor(){super("en",oD,aD)}static wordlist(){return s2==null&&(s2=new hd),s2}};vm.LangEn=hd});var Pm=M(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.Mnemonic=void 0;var c2=nr(),Cr=me(),u2=md();function kk(r){return(1<<r)-1<<8-r&255}function cD(r){return(1<<r)-1&255}function i2(r,e){(0,Cr.assertNormalize)("NFKD"),e==null&&(e=u2.LangEn.wordlist());let t=e.split(r);(0,Cr.assertArgument)(t.length%3===0&&t.length>=12&&t.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");let n=new Uint8Array(Math.ceil(11*t.length/8)),s=0;for(let u=0;u<t.length;u++){let l=e.getWordIndex(t[u].normalize("NFKD"));(0,Cr.assertArgument)(l>=0,`invalid mnemonic word at index ${u}`,"mnemonic","[ REDACTED ]");for(let f=0;f<11;f++)l&1<<10-f&&(n[s>>3]|=1<<7-s%8),s++}let i=32*t.length/3,o=t.length/3,a=kk(o),c=(0,Cr.getBytes)((0,c2.sha256)(n.slice(0,i/8)))[0]&a;return(0,Cr.assertArgument)(c===(n[n.length-1]&a),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),(0,Cr.hexlify)(n.slice(0,i/8))}function o2(r,e){(0,Cr.assertArgument)(r.length%4===0&&r.length>=16&&r.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),e==null&&(e=u2.LangEn.wordlist());let t=[0],n=11;for(let o=0;o<r.length;o++)n>8?(t[t.length-1]<<=8,t[t.length-1]|=r[o],n-=8):(t[t.length-1]<<=n,t[t.length-1]|=r[o]>>8-n,t.push(r[o]&cD(8-n)),n+=3);let s=r.length/4,i=parseInt((0,c2.sha256)(r).substring(2,4),16)&kk(s);return t[t.length-1]<<=s,t[t.length-1]|=i>>8-s,e.join(t.map(o=>e.getWord(o)))}var a2={},qu=class{phrase;password;wordlist;entropy;constructor(e,t,n,s,i){s==null&&(s=""),i==null&&(i=u2.LangEn.wordlist()),(0,Cr.assertPrivate)(e,a2,"Mnemonic"),(0,Cr.defineProperties)(this,{phrase:n,password:s,wordlist:i,entropy:t})}computeSeed(){let e=(0,Cr.toUtf8Bytes)("mnemonic"+this.password,"NFKD");return(0,c2.pbkdf2)((0,Cr.toUtf8Bytes)(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,t,n){let s=i2(e,n);return e=o2((0,Cr.getBytes)(s),n),new qu(a2,s,e,t,n)}static fromEntropy(e,t,n){let s=(0,Cr.getBytes)(e,"entropy"),i=o2(s,n);return new qu(a2,(0,Cr.hexlify)(s),i,t,n)}static entropyToPhrase(e,t){let n=(0,Cr.getBytes)(e,"entropy");return o2(n,t)}static phraseToEntropy(e,t){return i2(e,t)}static isValidMnemonic(e,t){try{return i2(e,t),!0}catch{}return!1}};Tm.Mnemonic=qu});var d2=M(Po=>{"use strict";var fr=Po&&Po.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},l2=Po&&Po.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},Bm,Rn,$s;Object.defineProperty(Po,"__esModule",{value:!0});Po.AES=void 0;var uD={16:10,24:12,32:14},lD=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],In=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],km=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],fD=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],dD=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],pD=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],hD=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],mD=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],bD=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],gD=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],xD=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],yD=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],wD=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],AD=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],ED=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function f2(r){let e=[];for(let t=0;t<r.length;t+=4)e.push(r[t]<<24|r[t+1]<<16|r[t+2]<<8|r[t+3]);return e}var bd=class{get key(){return fr(this,Bm,"f").slice()}constructor(e){if(Bm.set(this,void 0),Rn.set(this,void 0),$s.set(this,void 0),!(this instanceof bd))throw Error("AES must be instanitated with `new`");l2(this,Bm,new Uint8Array(e),"f");let t=uD[this.key.length];if(t==null)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");l2(this,$s,[],"f"),l2(this,Rn,[],"f");for(let l=0;l<=t;l++)fr(this,$s,"f").push([0,0,0,0]),fr(this,Rn,"f").push([0,0,0,0]);let n=(t+1)*4,s=this.key.length/4,i=f2(this.key),o;for(let l=0;l<s;l++)o=l>>2,fr(this,$s,"f")[o][l%4]=i[l],fr(this,Rn,"f")[t-o][l%4]=i[l];let a=0,c=s,u;for(;c<n;){if(u=i[s-1],i[0]^=In[u>>16&255]<<24^In[u>>8&255]<<16^In[u&255]<<8^In[u>>24&255]^lD[a]<<24,a+=1,s!=8)for(let h=1;h<s;h++)i[h]^=i[h-1];else{for(let h=1;h<s/2;h++)i[h]^=i[h-1];u=i[s/2-1],i[s/2]^=In[u&255]^In[u>>8&255]<<8^In[u>>16&255]<<16^In[u>>24&255]<<24;for(let h=s/2+1;h<s;h++)i[h]^=i[h-1]}let l=0,f,d;for(;l<s&&c<n;)f=c>>2,d=c%4,fr(this,$s,"f")[f][d]=i[l],fr(this,Rn,"f")[t-f][d]=i[l++],c++}for(let l=1;l<t;l++)for(let f=0;f<4;f++)u=fr(this,Rn,"f")[l][f],fr(this,Rn,"f")[l][f]=yD[u>>24&255]^wD[u>>16&255]^AD[u>>8&255]^ED[u&255]}encrypt(e){if(e.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");let t=fr(this,$s,"f").length-1,n=[0,0,0,0],s=f2(e);for(let a=0;a<4;a++)s[a]^=fr(this,$s,"f")[0][a];for(let a=1;a<t;a++){for(let c=0;c<4;c++)n[c]=fD[s[c]>>24&255]^dD[s[(c+1)%4]>>16&255]^pD[s[(c+2)%4]>>8&255]^hD[s[(c+3)%4]&255]^fr(this,$s,"f")[a][c];s=n.slice()}let i=new Uint8Array(16),o=0;for(let a=0;a<4;a++)o=fr(this,$s,"f")[t][a],i[4*a]=(In[s[a]>>24&255]^o>>24)&255,i[4*a+1]=(In[s[(a+1)%4]>>16&255]^o>>16)&255,i[4*a+2]=(In[s[(a+2)%4]>>8&255]^o>>8)&255,i[4*a+3]=(In[s[(a+3)%4]&255]^o)&255;return i}decrypt(e){if(e.length!=16)throw new TypeError("invalid ciphertext size (must be 16 bytes)");let t=fr(this,Rn,"f").length-1,n=[0,0,0,0],s=f2(e);for(let a=0;a<4;a++)s[a]^=fr(this,Rn,"f")[0][a];for(let a=1;a<t;a++){for(let c=0;c<4;c++)n[c]=mD[s[c]>>24&255]^bD[s[(c+3)%4]>>16&255]^gD[s[(c+2)%4]>>8&255]^xD[s[(c+1)%4]&255]^fr(this,Rn,"f")[a][c];s=n.slice()}let i=new Uint8Array(16),o=0;for(let a=0;a<4;a++)o=fr(this,Rn,"f")[t][a],i[4*a]=(km[s[a]>>24&255]^o>>24)&255,i[4*a+1]=(km[s[(a+3)%4]>>16&255]^o>>16)&255,i[4*a+2]=(km[s[(a+2)%4]>>8&255]^o>>8)&255,i[4*a+3]=(km[s[(a+1)%4]&255]^o)&255;return i}};Po.AES=bd;Bm=new WeakMap,Rn=new WeakMap,$s=new WeakMap});var $a=M(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});Sm.ModeOfOperation=void 0;var vD=d2(),p2=class{constructor(e,t,n){if(n&&!(this instanceof n))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new vD.AES(t)},name:{enumerable:!0,value:e}})}};Sm.ModeOfOperation=p2});var Bk=M(ko=>{"use strict";var Om=ko&&ko.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},Gu=ko&&ko.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},gd,ki;Object.defineProperty(ko,"__esModule",{value:!0});ko.CBC=void 0;var TD=$a(),xd=class extends TD.ModeOfOperation{constructor(e,t){if(super("ECC",e,xd),gd.set(this,void 0),ki.set(this,void 0),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");Om(this,gd,new Uint8Array(t),"f")}else Om(this,gd,new Uint8Array(16),"f");Om(this,ki,this.iv,"f")}get iv(){return new Uint8Array(Gu(this,gd,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){for(let s=0;s<16;s++)Gu(this,ki,"f")[s]^=e[n+s];Om(this,ki,this.aes.encrypt(Gu(this,ki,"f")),"f"),t.set(Gu(this,ki,"f"),n)}return t}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){let s=this.aes.decrypt(e.subarray(n,n+16));for(let i=0;i<16;i++)t[n+i]=s[i]^Gu(this,ki,"f")[i],Gu(this,ki,"f")[i]=e[n+i]}return t}};ko.CBC=xd;gd=new WeakMap,ki=new WeakMap});var Sk=M(Oo=>{"use strict";var h2=Oo&&Oo.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},Bo=Oo&&Oo.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},_m,yd,So,m2;Object.defineProperty(Oo,"__esModule",{value:!0});Oo.CFB=void 0;var PD=$a(),wd=class extends PD.ModeOfOperation{constructor(e,t,n=8){if(super("CFB",e,wd),_m.add(this),yd.set(this,void 0),So.set(this,void 0),!Number.isInteger(n)||n%8)throw new TypeError("invalid segmentSize");if(Object.defineProperties(this,{segmentSize:{enumerable:!0,value:n}}),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");h2(this,yd,new Uint8Array(t),"f")}else h2(this,yd,new Uint8Array(16),"f");h2(this,So,this.iv,"f")}get iv(){return new Uint8Array(Bo(this,yd,"f"))}encrypt(e){if(8*e.length%this.segmentSize)throw new TypeError("invalid plaintext size (must be multiple of segmentSize bytes)");let t=this.segmentSize/8,n=new Uint8Array(e);for(let s=0;s<n.length;s+=t){let i=this.aes.encrypt(Bo(this,So,"f"));for(let o=0;o<t;o++)n[s+o]^=i[o];Bo(this,_m,"m",m2).call(this,n.subarray(s))}return n}decrypt(e){if(8*e.length%this.segmentSize)throw new TypeError("invalid ciphertext size (must be multiple of segmentSize bytes)");let t=this.segmentSize/8,n=new Uint8Array(e);for(let s=0;s<n.length;s+=t){let i=this.aes.encrypt(Bo(this,So,"f"));for(let o=0;o<t;o++)n[s+o]^=i[o];Bo(this,_m,"m",m2).call(this,e.subarray(s))}return n}};Oo.CFB=wd;yd=new WeakMap,So=new WeakMap,_m=new WeakSet,m2=function(e){let t=this.segmentSize/8;Bo(this,So,"f").set(Bo(this,So,"f").subarray(t)),Bo(this,So,"f").set(e.subarray(0,t),16-t)}});var Ok=M(_o=>{"use strict";var zu=_o&&_o.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},Mn=_o&&_o.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Ad,qa,Ln;Object.defineProperty(_o,"__esModule",{value:!0});_o.CTR=void 0;var kD=$a(),Ed=class extends kD.ModeOfOperation{constructor(e,t){super("CTR",e,Ed),Ad.set(this,void 0),qa.set(this,void 0),Ln.set(this,void 0),zu(this,Ln,new Uint8Array(16),"f"),Mn(this,Ln,"f").fill(0),zu(this,Ad,Mn(this,Ln,"f"),"f"),zu(this,qa,16,"f"),t==null&&(t=1),typeof t=="number"?this.setCounterValue(t):this.setCounterBytes(t)}get counter(){return new Uint8Array(Mn(this,Ln,"f"))}setCounterValue(e){if(!Number.isInteger(e)||e<0||e>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let t=15;t>=0;--t)Mn(this,Ln,"f")[t]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");Mn(this,Ln,"f").set(e)}increment(){for(let e=15;e>=0;e--)if(Mn(this,Ln,"f")[e]===255)Mn(this,Ln,"f")[e]=0;else{Mn(this,Ln,"f")[e]++;break}}encrypt(e){var t,n;let s=new Uint8Array(e);for(let i=0;i<s.length;i++)Mn(this,qa,"f")===16&&(zu(this,Ad,this.aes.encrypt(Mn(this,Ln,"f")),"f"),zu(this,qa,0,"f"),this.increment()),s[i]^=Mn(this,Ad,"f")[zu(this,qa,(n=Mn(this,qa,"f"),t=n++,n),"f"),t];return s}decrypt(e){return this.encrypt(e)}};_o.CTR=Ed;Ad=new WeakMap,qa=new WeakMap,Ln=new WeakMap});var _k=M(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.ECB=void 0;var BD=$a(),vd=class extends BD.ModeOfOperation{constructor(e){super("ECB",e,vd)}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16)t.set(this.aes.encrypt(e.subarray(n,n+16)),n);return t}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16)t.set(this.aes.decrypt(e.subarray(n,n+16)),n);return t}};Cm.ECB=vd});var Ck=M(Co=>{"use strict";var Ga=Co&&Co.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},Td=Co&&Co.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Pd,Vu,za;Object.defineProperty(Co,"__esModule",{value:!0});Co.OFB=void 0;var SD=$a(),kd=class extends SD.ModeOfOperation{constructor(e,t){if(super("OFB",e,kd),Pd.set(this,void 0),Vu.set(this,void 0),za.set(this,void 0),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");Ga(this,Pd,new Uint8Array(t),"f")}else Ga(this,Pd,new Uint8Array(16),"f");Ga(this,Vu,this.iv,"f"),Ga(this,za,16,"f")}get iv(){return new Uint8Array(Td(this,Pd,"f"))}encrypt(e){var t,n;if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");let s=new Uint8Array(e);for(let i=0;i<s.length;i++)Td(this,za,"f")===16&&(Ga(this,Vu,this.aes.encrypt(Td(this,Vu,"f")),"f"),Ga(this,za,0,"f")),s[i]^=Td(this,Vu,"f")[Ga(this,za,(n=Td(this,za,"f"),t=n++,n),"f"),t];return s}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");return this.encrypt(e)}};Co.OFB=kd;Pd=new WeakMap,Vu=new WeakMap,za=new WeakMap});var Nk=M(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});Ku.pkcs7Strip=Ku.pkcs7Pad=void 0;function OD(r){let e=16-r.length%16,t=new Uint8Array(r.length+e);t.set(r);for(let n=r.length;n<t.length;n++)t[n]=e;return t}Ku.pkcs7Pad=OD;function _D(r){if(r.length<16)throw new TypeError("PKCS#7 invalid length");let e=r[r.length-1];if(e>16)throw new TypeError("PKCS#7 padding byte out of range");let t=r.length-e;for(let n=0;n<e;n++)if(r[t+n]!==e)throw new TypeError("PKCS#7 invalid padding byte");return new Uint8Array(r.subarray(0,t))}Ku.pkcs7Strip=_D});var b2=M(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.pkcs7Strip=zt.pkcs7Pad=zt.OFB=zt.ECB=zt.CTR=zt.CFB=zt.CBC=zt.ModeOfOperation=zt.AES=void 0;var CD=d2();Object.defineProperty(zt,"AES",{enumerable:!0,get:function(){return CD.AES}});var ND=$a();Object.defineProperty(zt,"ModeOfOperation",{enumerable:!0,get:function(){return ND.ModeOfOperation}});var ID=Bk();Object.defineProperty(zt,"CBC",{enumerable:!0,get:function(){return ID.CBC}});var RD=Sk();Object.defineProperty(zt,"CFB",{enumerable:!0,get:function(){return RD.CFB}});var MD=Ok();Object.defineProperty(zt,"CTR",{enumerable:!0,get:function(){return MD.CTR}});var LD=_k();Object.defineProperty(zt,"ECB",{enumerable:!0,get:function(){return LD.ECB}});var jD=Ck();Object.defineProperty(zt,"OFB",{enumerable:!0,get:function(){return jD.OFB}});var Ik=Nk();Object.defineProperty(zt,"pkcs7Pad",{enumerable:!0,get:function(){return Ik.pkcs7Pad}});Object.defineProperty(zt,"pkcs7Strip",{enumerable:!0,get:function(){return Ik.pkcs7Strip}})});var g2=M(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.spelunk=qs.getPassword=qs.zpad=qs.looseArrayify=void 0;var Ju=me();function Rk(r){return typeof r=="string"&&!r.startsWith("0x")&&(r="0x"+r),(0,Ju.getBytesCopy)(r)}qs.looseArrayify=Rk;function UD(r,e){for(r=String(r);r.length<e;)r="0"+r;return r}qs.zpad=UD;function FD(r){return typeof r=="string"?(0,Ju.toUtf8Bytes)(r,"NFKC"):(0,Ju.getBytesCopy)(r)}qs.getPassword=FD;function DD(r,e){let t=e.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);(0,Ju.assertArgument)(t!=null,"invalid path","path",e);let n=t[1],s=t[3],i=t[4]==="!",o=r;for(let a of n.toLowerCase().split(".")){if(Array.isArray(o)){if(!a.match(/^[0-9]+$/))break;o=o[parseInt(a)]}else if(typeof o=="object"){let c=null;for(let u in o)if(u.toLowerCase()===a){c=o[u];break}o=c}else o=null;if(o==null)break}if((0,Ju.assertArgument)(!i||o!=null,"missing required value","path",n),s&&o!=null){if(s==="int"){if(typeof o=="string"&&o.match(/^-?[0-9]+$/))return parseInt(o);if(Number.isSafeInteger(o))return o}if(s==="number"&&typeof o=="string"&&o.match(/^-?[0-9.]*$/))return parseFloat(o);if(s==="data"&&typeof o=="string")return Rk(o);if(s==="array"&&Array.isArray(o)||s===typeof o)return o;(0,Ju.assertArgument)(!1,`wrong type found for ${s} `,"path",n)}return o}qs.spelunk=DD});var Rm=M(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.encryptKeystoreJson=jn.encryptKeystoreJsonSync=jn.decryptKeystoreJson=jn.decryptKeystoreJsonSync=jn.isKeystoreJson=void 0;var Nm=b2(),HD=Yt(),Un=nr(),$D=qr(),$e=me(),ot=g2(),qD=S0(),Lk="m/44'/60'/0'/0/0";function GD(r){try{let e=JSON.parse(r);if((e.version!=null?parseInt(e.version):0)===3)return!0}catch{}return!1}jn.isKeystoreJson=GD;function zD(r,e,t){if((0,ot.spelunk)(r,"crypto.cipher:string")==="aes-128-ctr"){let s=(0,ot.spelunk)(r,"crypto.cipherparams.iv:data!"),i=new Nm.CTR(e,s);return(0,$e.hexlify)(i.decrypt(t))}(0,$e.assert)(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}function Im(r,e){let t=(0,$e.getBytes)(e),n=(0,ot.spelunk)(r,"crypto.ciphertext:data!"),s=(0,$e.hexlify)((0,Un.keccak256)((0,$e.concat)([t.slice(16,32),n]))).substring(2);(0,$e.assertArgument)(s===(0,ot.spelunk)(r,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");let i=zD(r,t.slice(0,16),n),o=(0,$D.computeAddress)(i);if(r.address){let u=r.address.toLowerCase();u.startsWith("0x")||(u="0x"+u),(0,$e.assertArgument)((0,HD.getAddress)(u)===o,"keystore address/privateKey mismatch","address",r.address)}let a={address:o,privateKey:i};if((0,ot.spelunk)(r,"x-ethers.version:string")==="0.1"){let u=t.slice(32,64),l=(0,ot.spelunk)(r,"x-ethers.mnemonicCiphertext:data!"),f=(0,ot.spelunk)(r,"x-ethers.mnemonicCounter:data!"),d=new Nm.CTR(u,f);a.mnemonic={path:(0,ot.spelunk)(r,"x-ethers.path:string")||Lk,locale:(0,ot.spelunk)(r,"x-ethers.locale:string")||"en",entropy:(0,$e.hexlify)((0,$e.getBytes)(d.decrypt(l)))}}return a}function jk(r){let e=(0,ot.spelunk)(r,"crypto.kdf:string");if(e&&typeof e=="string"){if(e.toLowerCase()==="scrypt"){let t=(0,ot.spelunk)(r,"crypto.kdfparams.salt:data!"),n=(0,ot.spelunk)(r,"crypto.kdfparams.n:int!"),s=(0,ot.spelunk)(r,"crypto.kdfparams.r:int!"),i=(0,ot.spelunk)(r,"crypto.kdfparams.p:int!");(0,$e.assertArgument)(n>0&&(n&n-1)===0,"invalid kdf.N","kdf.N",n),(0,$e.assertArgument)(s>0&&i>0,"invalid kdf","kdf",e);let o=(0,ot.spelunk)(r,"crypto.kdfparams.dklen:int!");return(0,$e.assertArgument)(o===32,"invalid kdf.dklen","kdf.dflen",o),{name:"scrypt",salt:t,N:n,r:s,p:i,dkLen:64}}else if(e.toLowerCase()==="pbkdf2"){let t=(0,ot.spelunk)(r,"crypto.kdfparams.salt:data!"),n=(0,ot.spelunk)(r,"crypto.kdfparams.prf:string!"),s=n.split("-").pop();(0,$e.assertArgument)(s==="sha256"||s==="sha512","invalid kdf.pdf","kdf.pdf",n);let i=(0,ot.spelunk)(r,"crypto.kdfparams.c:int!"),o=(0,ot.spelunk)(r,"crypto.kdfparams.dklen:int!");return(0,$e.assertArgument)(o===32,"invalid kdf.dklen","kdf.dklen",o),{name:"pbkdf2",salt:t,count:i,dkLen:o,algorithm:s}}}(0,$e.assertArgument)(!1,"unsupported key-derivation function","kdf",e)}function VD(r,e){let t=JSON.parse(r),n=(0,ot.getPassword)(e),s=jk(t);if(s.name==="pbkdf2"){let{salt:f,count:d,dkLen:h,algorithm:b}=s,p=(0,Un.pbkdf2)(n,f,d,h,b);return Im(t,p)}(0,$e.assert)(s.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:s});let{salt:i,N:o,r:a,p:c,dkLen:u}=s,l=(0,Un.scryptSync)(n,i,o,a,c,u);return Im(t,l)}jn.decryptKeystoreJsonSync=VD;function Mk(r){return new Promise(e=>{setTimeout(()=>{e()},r)})}async function KD(r,e,t){let n=JSON.parse(r),s=(0,ot.getPassword)(e),i=jk(n);if(i.name==="pbkdf2"){t&&(t(0),await Mk(0));let{salt:d,count:h,dkLen:b,algorithm:p}=i,g=(0,Un.pbkdf2)(s,d,h,b,p);return t&&(t(1),await Mk(0)),Im(n,g)}(0,$e.assert)(i.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:i});let{salt:o,N:a,r:c,p:u,dkLen:l}=i,f=await(0,Un.scrypt)(s,o,a,c,u,l,t);return Im(n,f)}jn.decryptKeystoreJson=KD;function Uk(r){let e=r.salt!=null?(0,$e.getBytes)(r.salt,"options.salt"):(0,Un.randomBytes)(32),t=1<<17,n=8,s=1;return r.scrypt&&(r.scrypt.N&&(t=r.scrypt.N),r.scrypt.r&&(n=r.scrypt.r),r.scrypt.p&&(s=r.scrypt.p)),(0,$e.assertArgument)(typeof t=="number"&&t>0&&Number.isSafeInteger(t)&&(BigInt(t)&BigInt(t-1))===BigInt(0),"invalid scrypt N parameter","options.N",t),(0,$e.assertArgument)(typeof n=="number"&&n>0&&Number.isSafeInteger(n),"invalid scrypt r parameter","options.r",n),(0,$e.assertArgument)(typeof s=="number"&&s>0&&Number.isSafeInteger(s),"invalid scrypt p parameter","options.p",s),{name:"scrypt",dkLen:32,salt:e,N:t,r:n,p:s}}function Fk(r,e,t,n){let s=(0,$e.getBytes)(t.privateKey,"privateKey"),i=n.iv!=null?(0,$e.getBytes)(n.iv,"options.iv"):(0,Un.randomBytes)(16);(0,$e.assertArgument)(i.length===16,"invalid options.iv length","options.iv",n.iv);let o=n.uuid!=null?(0,$e.getBytes)(n.uuid,"options.uuid"):(0,Un.randomBytes)(16);(0,$e.assertArgument)(o.length===16,"invalid options.uuid length","options.uuid",n.iv);let a=r.slice(0,16),c=r.slice(16,32),u=new Nm.CTR(a,i),l=(0,$e.getBytes)(u.encrypt(s)),f=(0,Un.keccak256)((0,$e.concat)([c,l])),d={address:t.address.substring(2).toLowerCase(),id:(0,$e.uuidV4)(o),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,$e.hexlify)(i).substring(2)},ciphertext:(0,$e.hexlify)(l).substring(2),kdf:"scrypt",kdfparams:{salt:(0,$e.hexlify)(e.salt).substring(2),n:e.N,dklen:32,p:e.p,r:e.r},mac:f.substring(2)}};if(t.mnemonic){let h=n.client!=null?n.client:`ethers/${qD.version}`,b=t.mnemonic.path||Lk,p=t.mnemonic.locale||"en",g=r.slice(32,64),m=(0,$e.getBytes)(t.mnemonic.entropy,"account.mnemonic.entropy"),y=(0,Un.randomBytes)(16),E=new Nm.CTR(g,y),v=(0,$e.getBytes)(E.encrypt(m)),k=new Date,w=k.getUTCFullYear()+"-"+(0,ot.zpad)(k.getUTCMonth()+1,2)+"-"+(0,ot.zpad)(k.getUTCDate(),2)+"T"+(0,ot.zpad)(k.getUTCHours(),2)+"-"+(0,ot.zpad)(k.getUTCMinutes(),2)+"-"+(0,ot.zpad)(k.getUTCSeconds(),2)+".0Z",P="UTC--"+w+"--"+d.address;d["x-ethers"]={client:h,gethFilename:P,path:b,locale:p,mnemonicCounter:(0,$e.hexlify)(y).substring(2),mnemonicCiphertext:(0,$e.hexlify)(v).substring(2),version:"0.1"}}return JSON.stringify(d)}function JD(r,e,t){t==null&&(t={});let n=(0,ot.getPassword)(e),s=Uk(t),i=(0,Un.scryptSync)(n,s.salt,s.N,s.r,s.p,64);return Fk((0,$e.getBytes)(i),s,r,t)}jn.encryptKeystoreJsonSync=JD;async function WD(r,e,t){t==null&&(t={});let n=(0,ot.getPassword)(e),s=Uk(t),i=await(0,Un.scrypt)(n,s.salt,s.N,s.r,s.p,64,t.progressCallback);return Fk((0,$e.getBytes)(i),s,r,t)}jn.encryptKeystoreJson=WD});var w2=M(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.getIndexedAccountPath=Nr.getAccountPath=Nr.HDNodeVoidWallet=Nr.HDNodeWallet=Nr.defaultPath=void 0;var cn=nr(),QD=bm(),qk=qr(),ve=me(),Dk=md(),YD=xm(),Hk=Pm(),$k=Rm();Nr.defaultPath="m/44'/60'/0'/0/0";var ZD=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Vs=2147483648,XD=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),eH="0123456789abcdef";function Lm(r,e){let t="";for(;r;)t=eH[r%16]+t,r=Math.trunc(r/16);for(;t.length<e*2;)t="0"+t;return"0x"+t}function x2(r){let e=(0,ve.getBytes)(r),t=(0,ve.dataSlice)((0,cn.sha256)((0,cn.sha256)(e)),0,4),n=(0,ve.concat)([e,t]);return(0,ve.encodeBase58)(n)}var zs={};function Gk(r,e,t,n){let s=new Uint8Array(37);r&Vs?((0,ve.assert)(n!=null,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),s.set((0,ve.getBytes)(n),1)):s.set((0,ve.getBytes)(t));for(let o=24;o>=0;o-=8)s[33+(o>>3)]=r>>24-o&255;let i=(0,ve.getBytes)((0,cn.computeHmac)("sha512",e,s));return{IL:i.slice(0,32),IR:i.slice(32)}}function zk(r,e){let t=e.split("/");(0,ve.assertArgument)(t.length>0,"invalid path","path",e),t[0]==="m"&&((0,ve.assertArgument)(r.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${r.depth}`,"path",e),t.shift());let n=r;for(let s=0;s<t.length;s++){let i=t[s];if(i.match(/^[0-9]+'$/)){let o=parseInt(i.substring(0,i.length-1));(0,ve.assertArgument)(o<Vs,"invalid path index",`path[${s}]`,i),n=n.deriveChild(Vs+o)}else if(i.match(/^[0-9]+$/)){let o=parseInt(i);(0,ve.assertArgument)(o<Vs,"invalid path index",`path[${s}]`,i),n=n.deriveChild(o)}else(0,ve.assertArgument)(!1,"invalid path component",`path[${s}]`,i)}return n}var Sd,y2,Va,Bd,Gs=class extends YD.BaseWallet{constructor(t,n,s,i,o,a,c,u,l){super(n,l);vs(this,Sd);tn(this,"publicKey");tn(this,"fingerprint");tn(this,"parentFingerprint");tn(this,"mnemonic");tn(this,"chainCode");tn(this,"path");tn(this,"index");tn(this,"depth");(0,ve.assertPrivate)(t,zs,"HDNodeWallet"),(0,ve.defineProperties)(this,{publicKey:n.compressedPublicKey});let f=(0,ve.dataSlice)((0,cn.ripemd160)((0,cn.sha256)(this.publicKey)),0,4);(0,ve.defineProperties)(this,{parentFingerprint:s,fingerprint:f,chainCode:i,path:o,index:a,depth:c}),(0,ve.defineProperties)(this,{mnemonic:u})}connect(t){return new Gs(zs,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,t)}async encrypt(t,n){return await(0,$k.encryptKeystoreJson)(ur(this,Sd,y2).call(this),t,{progressCallback:n})}encryptSync(t){return(0,$k.encryptKeystoreJsonSync)(ur(this,Sd,y2).call(this),t)}get extendedKey(){return(0,ve.assert)(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),x2((0,ve.concat)(["0x0488ADE4",Lm(this.depth,1),this.parentFingerprint,Lm(this.index,4),this.chainCode,(0,ve.concat)(["0x00",this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new No(zs,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(t){let n=(0,ve.getNumber)(t,"index");(0,ve.assertArgument)(n<=4294967295,"invalid index","index",n);let s=this.path;s&&(s+="/"+(n&~Vs),n&Vs&&(s+="'"));let{IR:i,IL:o}=Gk(n,this.chainCode,this.publicKey,this.privateKey),a=new cn.SigningKey((0,ve.toBeHex)(((0,ve.toBigInt)(o)+BigInt(this.privateKey))%XD,32));return new Gs(zs,a,this.fingerprint,(0,ve.hexlify)(i),s,n,this.depth+1,this.mnemonic,this.provider)}derivePath(t){return zk(this,t)}static fromExtendedKey(t){let n=(0,ve.toBeArray)((0,ve.decodeBase58)(t));(0,ve.assertArgument)(n.length===82||x2(n.slice(0,78))===t,"invalid extended key","extendedKey","[ REDACTED ]");let s=n[4],i=(0,ve.hexlify)(n.slice(5,9)),o=parseInt((0,ve.hexlify)(n.slice(9,13)).substring(2),16),a=(0,ve.hexlify)(n.slice(13,45)),c=n.slice(45,78);switch((0,ve.hexlify)(n.slice(0,4))){case"0x0488b21e":case"0x043587cf":{let u=(0,ve.hexlify)(c);return new No(zs,(0,qk.computeAddress)(u),u,i,a,null,o,s,null)}case"0x0488ade4":case"0x04358394 ":if(c[0]!==0)break;return new Gs(zs,new cn.SigningKey(c.slice(1)),i,a,null,o,s,null,null)}(0,ve.assertArgument)(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(t,n,s){var o;t==null&&(t=""),n==null&&(n=Nr.defaultPath),s==null&&(s=Dk.LangEn.wordlist());let i=Hk.Mnemonic.fromEntropy((0,cn.randomBytes)(16),t,s);return ur(o=Gs,Va,Bd).call(o,i.computeSeed(),i).derivePath(n)}static fromMnemonic(t,n){var s;return n||(n=Nr.defaultPath),ur(s=Gs,Va,Bd).call(s,t.computeSeed(),t).derivePath(n)}static fromPhrase(t,n,s,i){var a;n==null&&(n=""),s==null&&(s=Nr.defaultPath),i==null&&(i=Dk.LangEn.wordlist());let o=Hk.Mnemonic.fromPhrase(t,n,i);return ur(a=Gs,Va,Bd).call(a,o.computeSeed(),o).derivePath(s)}static fromSeed(t){var n;return ur(n=Gs,Va,Bd).call(n,t,null)}},Mm=Gs;Sd=new WeakSet,y2=function(){let t={address:this.address,privateKey:this.privateKey},n=this.mnemonic;return this.path&&n&&n.wordlist.locale==="en"&&n.password===""&&(t.mnemonic={path:this.path,locale:"en",entropy:n.entropy}),t},Va=new WeakSet,Bd=function(t,n){(0,ve.assertArgument)((0,ve.isBytesLike)(t),"invalid seed","seed","[REDACTED]");let s=(0,ve.getBytes)(t,"seed");(0,ve.assertArgument)(s.length>=16&&s.length<=64,"invalid seed","seed","[REDACTED]");let i=(0,ve.getBytes)((0,cn.computeHmac)("sha512",ZD,s)),o=new cn.SigningKey((0,ve.hexlify)(i.slice(0,32)));return new Gs(zs,o,"0x00000000",(0,ve.hexlify)(i.slice(32)),"m",0,0,n,null)},vs(Mm,Va);Nr.HDNodeWallet=Mm;var No=class extends QD.VoidSigner{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(e,t,n,s,i,o,a,c,u){super(t,u),(0,ve.assertPrivate)(e,zs,"HDNodeVoidWallet"),(0,ve.defineProperties)(this,{publicKey:n});let l=(0,ve.dataSlice)((0,cn.ripemd160)((0,cn.sha256)(n)),0,4);(0,ve.defineProperties)(this,{publicKey:n,fingerprint:l,parentFingerprint:s,chainCode:i,path:o,index:a,depth:c})}connect(e){return new No(zs,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,e)}get extendedKey(){return(0,ve.assert)(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),x2((0,ve.concat)(["0x0488B21E",Lm(this.depth,1),this.parentFingerprint,Lm(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(e){let t=(0,ve.getNumber)(e,"index");(0,ve.assertArgument)(t<=4294967295,"invalid index","index",t);let n=this.path;n&&(n+="/"+(t&~Vs),t&Vs&&(n+="'"));let{IR:s,IL:i}=Gk(t,this.chainCode,this.publicKey,null),o=cn.SigningKey.addPoints(i,this.publicKey,!0),a=(0,qk.computeAddress)(o);return new No(zs,a,o,this.fingerprint,(0,ve.hexlify)(s),n,t,this.depth+1,this.provider)}derivePath(e){return zk(this,e)}};Nr.HDNodeVoidWallet=No;function tH(r){let e=(0,ve.getNumber)(r,"index");return(0,ve.assertArgument)(e>=0&&e<Vs,"invalid account index","index",e),`m/44'/60'/${e}'/0/0`}Nr.getAccountPath=tH;function rH(r){let e=(0,ve.getNumber)(r,"index");return(0,ve.assertArgument)(e>=0&&e<Vs,"invalid account index","index",e),`m/44'/60'/0'/0/${e}`}Nr.getIndexedAccountPath=rH});var E2=M(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.decryptCrowdsaleJson=Wu.isCrowdsaleJson=void 0;var Vk=b2(),nH=Yt(),sH=nr(),iH=Ls(),A2=me(),jm=g2();function oH(r){try{if(JSON.parse(r).encseed)return!0}catch{}return!1}Wu.isCrowdsaleJson=oH;function aH(r,e){let t=JSON.parse(r),n=(0,jm.getPassword)(e),s=(0,nH.getAddress)((0,jm.spelunk)(t,"ethaddr:string!")),i=(0,jm.looseArrayify)((0,jm.spelunk)(t,"encseed:string!"));(0,A2.assertArgument)(i&&i.length%16===0,"invalid encseed","json",r);let o=(0,A2.getBytes)((0,sH.pbkdf2)(n,n,2e3,32,"sha256")).slice(0,16),a=i.slice(0,16),c=i.slice(16),u=new Vk.CBC(o,a),l=(0,Vk.pkcs7Strip)((0,A2.getBytes)(u.decrypt(c))),f="";for(let d=0;d<l.length;d++)f+=String.fromCharCode(l[d]);return{address:s,privateKey:(0,iH.id)(f)}}Wu.decryptCrowdsaleJson=aH});var Jk=M(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});Dm.Wallet=void 0;var cH=nr(),v2=me(),uH=xm(),T2=w2(),Um=E2(),Qu=Rm(),lH=Pm();function Kk(r){return new Promise(e=>{setTimeout(()=>{e()},r)})}var Od,P2,Yu=class extends uH.BaseWallet{constructor(e,t){typeof e=="string"&&!e.startsWith("0x")&&(e="0x"+e);let n=typeof e=="string"?new cH.SigningKey(e):e;super(n,t)}connect(e){return new Yu(this.signingKey,e)}async encrypt(e,t){let n={address:this.address,privateKey:this.privateKey};return await(0,Qu.encryptKeystoreJson)(n,e,{progressCallback:t})}encryptSync(e){let t={address:this.address,privateKey:this.privateKey};return(0,Qu.encryptKeystoreJsonSync)(t,e)}static async fromEncryptedJson(e,t,n){var i;let s=null;return(0,Qu.isKeystoreJson)(e)?s=await(0,Qu.decryptKeystoreJson)(e,t,n):(0,Um.isCrowdsaleJson)(e)&&(n&&(n(0),await Kk(0)),s=(0,Um.decryptCrowdsaleJson)(e,t),n&&(n(1),await Kk(0))),ur(i=Yu,Od,P2).call(i,s)}static fromEncryptedJsonSync(e,t){var s;let n=null;return(0,Qu.isKeystoreJson)(e)?n=(0,Qu.decryptKeystoreJsonSync)(e,t):(0,Um.isCrowdsaleJson)(e)?n=(0,Um.decryptCrowdsaleJson)(e,t):(0,v2.assertArgument)(!1,"invalid JSON wallet","json","[ REDACTED ]"),ur(s=Yu,Od,P2).call(s,n)}static createRandom(e){let t=T2.HDNodeWallet.createRandom();return e?t.connect(e):t}static fromPhrase(e,t){let n=T2.HDNodeWallet.fromPhrase(e);return t?n.connect(t):n}},Fm=Yu;Od=new WeakSet,P2=function(e){if((0,v2.assertArgument)(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&e.mnemonic.locale==="en"){let n=lH.Mnemonic.fromEntropy(e.mnemonic.entropy),s=T2.HDNodeWallet.fromMnemonic(n,e.mnemonic.path);if(s.address===e.address&&s.privateKey===e.privateKey)return s;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}let t=new Yu(e.privateKey);return(0,v2.assertArgument)(t.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),t},vs(Fm,Od);Dm.Wallet=Fm});var Qk=M(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.Wallet=Xe.Mnemonic=Xe.encryptKeystoreJsonSync=Xe.encryptKeystoreJson=Xe.decryptKeystoreJson=Xe.decryptKeystoreJsonSync=Xe.isKeystoreJson=Xe.decryptCrowdsaleJson=Xe.isCrowdsaleJson=Xe.HDNodeVoidWallet=Xe.HDNodeWallet=Xe.getIndexedAccountPath=Xe.getAccountPath=Xe.defaultPath=Xe.BaseWallet=void 0;var fH=xm();Object.defineProperty(Xe,"BaseWallet",{enumerable:!0,get:function(){return fH.BaseWallet}});var _d=w2();Object.defineProperty(Xe,"defaultPath",{enumerable:!0,get:function(){return _d.defaultPath}});Object.defineProperty(Xe,"getAccountPath",{enumerable:!0,get:function(){return _d.getAccountPath}});Object.defineProperty(Xe,"getIndexedAccountPath",{enumerable:!0,get:function(){return _d.getIndexedAccountPath}});Object.defineProperty(Xe,"HDNodeWallet",{enumerable:!0,get:function(){return _d.HDNodeWallet}});Object.defineProperty(Xe,"HDNodeVoidWallet",{enumerable:!0,get:function(){return _d.HDNodeVoidWallet}});var Wk=E2();Object.defineProperty(Xe,"isCrowdsaleJson",{enumerable:!0,get:function(){return Wk.isCrowdsaleJson}});Object.defineProperty(Xe,"decryptCrowdsaleJson",{enumerable:!0,get:function(){return Wk.decryptCrowdsaleJson}});var Cd=Rm();Object.defineProperty(Xe,"isKeystoreJson",{enumerable:!0,get:function(){return Cd.isKeystoreJson}});Object.defineProperty(Xe,"decryptKeystoreJsonSync",{enumerable:!0,get:function(){return Cd.decryptKeystoreJsonSync}});Object.defineProperty(Xe,"decryptKeystoreJson",{enumerable:!0,get:function(){return Cd.decryptKeystoreJson}});Object.defineProperty(Xe,"encryptKeystoreJson",{enumerable:!0,get:function(){return Cd.encryptKeystoreJson}});Object.defineProperty(Xe,"encryptKeystoreJsonSync",{enumerable:!0,get:function(){return Cd.encryptKeystoreJsonSync}});var dH=Pm();Object.defineProperty(Xe,"Mnemonic",{enumerable:!0,get:function(){return dH.Mnemonic}});var pH=Jk();Object.defineProperty(Xe,"Wallet",{enumerable:!0,get:function(){return pH.Wallet}})});var Yk=M(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});Hm.decodeBits=void 0;var hH=")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";function mH(r,e){let t=(1<<r)-1,n=[],s=0,i=0,o=0;for(let a=0;a<e.length;a++)for(s=s<<6|hH.indexOf(e[a]),i+=6;i>=r;){let c=s>>i-r;s&=(1<<i-r)-1,i-=r,c===0?o+=t:(n.push(c+o),o=0)}return n}Hm.decodeBits=mH});var Zk=M($m=>{"use strict";Object.defineProperty($m,"__esModule",{value:!0});$m.decodeOwlA=void 0;var bH=me(),gH=Yk(),xH=e2();function yH(r,e){let t=(0,xH.decodeOwl)(r).join(",");return e.split(/,/g).forEach(n=>{let s=n.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);(0,bH.assertArgument)(s!==null,"internal error parsing accents","accents",e);let i=0,o=(0,gH.decodeBits)(parseInt(s[3]),s[4]),a=parseInt(s[2]),c=new RegExp(`([${s[1]}])`,"g");t=t.replace(c,(u,l)=>(--o[i]===0&&(l=String.fromCharCode(l.charCodeAt(0),a),i++),l))}),t.split(",")}$m.decodeOwlA=yH});var Xk=M(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});qm.WordlistOwlA=void 0;var wH=Em(),AH=Zk(),k2=class extends wH.WordlistOwl{#e;constructor(e,t,n,s){super(e,t,s),this.#e=n}get _accent(){return this.#e}_decodeWords(){return(0,AH.decodeOwlA)(this._data,this._accent)}};qm.WordlistOwlA=k2});var eB=M(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});Gm.wordlists=void 0;var EH=md();Gm.wordlists={en:EH.LangEn.wordlist()}});var tB=M(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.wordlists=Fn.WordlistOwlA=Fn.WordlistOwl=Fn.LangEn=Fn.Wordlist=void 0;var vH=r2();Object.defineProperty(Fn,"Wordlist",{enumerable:!0,get:function(){return vH.Wordlist}});var TH=md();Object.defineProperty(Fn,"LangEn",{enumerable:!0,get:function(){return TH.LangEn}});var PH=Em();Object.defineProperty(Fn,"WordlistOwl",{enumerable:!0,get:function(){return PH.WordlistOwl}});var kH=Xk();Object.defineProperty(Fn,"WordlistOwlA",{enumerable:!0,get:function(){return kH.WordlistOwlA}});var BH=eB();Object.defineProperty(Fn,"wordlists",{enumerable:!0,get:function(){return BH.wordlists}})});var B2=M(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.ripemd160=x.keccak256=x.randomBytes=x.computeHmac=x.UndecodedEventLog=x.EventLog=x.ContractUnknownEventPayload=x.ContractTransactionResponse=x.ContractTransactionReceipt=x.ContractEventPayload=x.ContractFactory=x.Contract=x.BaseContract=x.MessagePrefix=x.EtherSymbol=x.ZeroHash=x.N=x.MaxInt256=x.MinInt256=x.MaxUint256=x.WeiPerEther=x.ZeroAddress=x.resolveAddress=x.isAddress=x.isAddressable=x.getCreate2Address=x.getCreateAddress=x.getIcapAddress=x.getAddress=x.Typed=x.TransactionDescription=x.Result=x.LogDescription=x.Interface=x.Indexed=x.ErrorDescription=x.checkResultErrors=x.StructFragment=x.ParamType=x.NamedFragment=x.FunctionFragment=x.FallbackFragment=x.Fragment=x.EventFragment=x.ErrorFragment=x.ConstructorFragment=x.AbiCoder=x.encodeBytes32String=x.decodeBytes32String=x.version=void 0;x.EnsPlugin=x.Network=x.EnsResolver=x.WebSocketProvider=x.SocketProvider=x.IpcSocketProvider=x.QuickNodeProvider=x.PocketProvider=x.InfuraWebSocketProvider=x.InfuraProvider=x.EtherscanProvider=x.CloudflareProvider=x.ChainstackProvider=x.AnkrProvider=x.AlchemyProvider=x.BrowserProvider=x.JsonRpcSigner=x.JsonRpcProvider=x.JsonRpcApiProvider=x.FallbackProvider=x.AbstractProvider=x.VoidSigner=x.NonceManager=x.AbstractSigner=x.TransactionResponse=x.TransactionReceipt=x.Log=x.FeeData=x.Block=x.getDefaultProvider=x.verifyTypedData=x.TypedDataEncoder=x.solidityPackedSha256=x.solidityPackedKeccak256=x.solidityPacked=x.verifyMessage=x.hashMessage=x.dnsEncode=x.namehash=x.isValidName=x.ensNormalize=x.id=x.SigningKey=x.Signature=x.lock=x.scryptSync=x.scrypt=x.pbkdf2=x.sha512=x.sha256=void 0;x.getUint=x.getNumber=x.getBigInt=x.FixedNumber=x.FetchCancelSignal=x.FetchResponse=x.FetchRequest=x.EventPayload=x.isError=x.isCallException=x.makeError=x.assertPrivate=x.assertNormalize=x.assertArgumentCount=x.assertArgument=x.assert=x.resolveProperties=x.defineProperties=x.zeroPadValue=x.zeroPadBytes=x.stripZerosLeft=x.isBytesLike=x.isHexString=x.hexlify=x.getBytesCopy=x.getBytes=x.dataSlice=x.dataLength=x.concat=x.encodeBase64=x.decodeBase64=x.encodeBase58=x.decodeBase58=x.Transaction=x.recoverAddress=x.computeAddress=x.accessListify=x.showThrottleMessage=x.copyRequest=x.UnmanagedSubscriber=x.SocketSubscriber=x.SocketPendingSubscriber=x.SocketEventSubscriber=x.SocketBlockSubscriber=x.MulticoinProviderPlugin=x.NetworkPlugin=x.GasCostPlugin=x.FetchUrlFeeDataNetworkPlugin=x.FeeDataNetworkPlugin=x.EtherscanPlugin=void 0;x.wordlists=x.WordlistOwlA=x.WordlistOwl=x.LangEn=x.Wordlist=x.encryptKeystoreJsonSync=x.encryptKeystoreJson=x.decryptKeystoreJson=x.decryptKeystoreJsonSync=x.decryptCrowdsaleJson=x.isKeystoreJson=x.isCrowdsaleJson=x.getIndexedAccountPath=x.getAccountPath=x.defaultPath=x.Wallet=x.HDNodeVoidWallet=x.HDNodeWallet=x.BaseWallet=x.Mnemonic=x.uuidV4=x.encodeRlp=x.decodeRlp=x.Utf8ErrorFuncs=x.toUtf8String=x.toUtf8CodePoints=x.toUtf8Bytes=x.parseUnits=x.formatUnits=x.parseEther=x.formatEther=x.mask=x.toTwos=x.fromTwos=x.toQuantity=x.toNumber=x.toBeHex=x.toBigInt=x.toBeArray=void 0;var SH=S0();Object.defineProperty(x,"version",{enumerable:!0,get:function(){return SH.version}});var Vt=bu();Object.defineProperty(x,"decodeBytes32String",{enumerable:!0,get:function(){return Vt.decodeBytes32String}});Object.defineProperty(x,"encodeBytes32String",{enumerable:!0,get:function(){return Vt.encodeBytes32String}});Object.defineProperty(x,"AbiCoder",{enumerable:!0,get:function(){return Vt.AbiCoder}});Object.defineProperty(x,"ConstructorFragment",{enumerable:!0,get:function(){return Vt.ConstructorFragment}});Object.defineProperty(x,"ErrorFragment",{enumerable:!0,get:function(){return Vt.ErrorFragment}});Object.defineProperty(x,"EventFragment",{enumerable:!0,get:function(){return Vt.EventFragment}});Object.defineProperty(x,"Fragment",{enumerable:!0,get:function(){return Vt.Fragment}});Object.defineProperty(x,"FallbackFragment",{enumerable:!0,get:function(){return Vt.FallbackFragment}});Object.defineProperty(x,"FunctionFragment",{enumerable:!0,get:function(){return Vt.FunctionFragment}});Object.defineProperty(x,"NamedFragment",{enumerable:!0,get:function(){return Vt.NamedFragment}});Object.defineProperty(x,"ParamType",{enumerable:!0,get:function(){return Vt.ParamType}});Object.defineProperty(x,"StructFragment",{enumerable:!0,get:function(){return Vt.StructFragment}});Object.defineProperty(x,"checkResultErrors",{enumerable:!0,get:function(){return Vt.checkResultErrors}});Object.defineProperty(x,"ErrorDescription",{enumerable:!0,get:function(){return Vt.ErrorDescription}});Object.defineProperty(x,"Indexed",{enumerable:!0,get:function(){return Vt.Indexed}});Object.defineProperty(x,"Interface",{enumerable:!0,get:function(){return Vt.Interface}});Object.defineProperty(x,"LogDescription",{enumerable:!0,get:function(){return Vt.LogDescription}});Object.defineProperty(x,"Result",{enumerable:!0,get:function(){return Vt.Result}});Object.defineProperty(x,"TransactionDescription",{enumerable:!0,get:function(){return Vt.TransactionDescription}});Object.defineProperty(x,"Typed",{enumerable:!0,get:function(){return Vt.Typed}});var Ka=Yt();Object.defineProperty(x,"getAddress",{enumerable:!0,get:function(){return Ka.getAddress}});Object.defineProperty(x,"getIcapAddress",{enumerable:!0,get:function(){return Ka.getIcapAddress}});Object.defineProperty(x,"getCreateAddress",{enumerable:!0,get:function(){return Ka.getCreateAddress}});Object.defineProperty(x,"getCreate2Address",{enumerable:!0,get:function(){return Ka.getCreate2Address}});Object.defineProperty(x,"isAddressable",{enumerable:!0,get:function(){return Ka.isAddressable}});Object.defineProperty(x,"isAddress",{enumerable:!0,get:function(){return Ka.isAddress}});Object.defineProperty(x,"resolveAddress",{enumerable:!0,get:function(){return Ka.resolveAddress}});var Bi=Xc();Object.defineProperty(x,"ZeroAddress",{enumerable:!0,get:function(){return Bi.ZeroAddress}});Object.defineProperty(x,"WeiPerEther",{enumerable:!0,get:function(){return Bi.WeiPerEther}});Object.defineProperty(x,"MaxUint256",{enumerable:!0,get:function(){return Bi.MaxUint256}});Object.defineProperty(x,"MinInt256",{enumerable:!0,get:function(){return Bi.MinInt256}});Object.defineProperty(x,"MaxInt256",{enumerable:!0,get:function(){return Bi.MaxInt256}});Object.defineProperty(x,"N",{enumerable:!0,get:function(){return Bi.N}});Object.defineProperty(x,"ZeroHash",{enumerable:!0,get:function(){return Bi.ZeroHash}});Object.defineProperty(x,"EtherSymbol",{enumerable:!0,get:function(){return Bi.EtherSymbol}});Object.defineProperty(x,"MessagePrefix",{enumerable:!0,get:function(){return Bi.MessagePrefix}});var Si=Jf();Object.defineProperty(x,"BaseContract",{enumerable:!0,get:function(){return Si.BaseContract}});Object.defineProperty(x,"Contract",{enumerable:!0,get:function(){return Si.Contract}});Object.defineProperty(x,"ContractFactory",{enumerable:!0,get:function(){return Si.ContractFactory}});Object.defineProperty(x,"ContractEventPayload",{enumerable:!0,get:function(){return Si.ContractEventPayload}});Object.defineProperty(x,"ContractTransactionReceipt",{enumerable:!0,get:function(){return Si.ContractTransactionReceipt}});Object.defineProperty(x,"ContractTransactionResponse",{enumerable:!0,get:function(){return Si.ContractTransactionResponse}});Object.defineProperty(x,"ContractUnknownEventPayload",{enumerable:!0,get:function(){return Si.ContractUnknownEventPayload}});Object.defineProperty(x,"EventLog",{enumerable:!0,get:function(){return Si.EventLog}});Object.defineProperty(x,"UndecodedEventLog",{enumerable:!0,get:function(){return Si.UndecodedEventLog}});var Dn=nr();Object.defineProperty(x,"computeHmac",{enumerable:!0,get:function(){return Dn.computeHmac}});Object.defineProperty(x,"randomBytes",{enumerable:!0,get:function(){return Dn.randomBytes}});Object.defineProperty(x,"keccak256",{enumerable:!0,get:function(){return Dn.keccak256}});Object.defineProperty(x,"ripemd160",{enumerable:!0,get:function(){return Dn.ripemd160}});Object.defineProperty(x,"sha256",{enumerable:!0,get:function(){return Dn.sha256}});Object.defineProperty(x,"sha512",{enumerable:!0,get:function(){return Dn.sha512}});Object.defineProperty(x,"pbkdf2",{enumerable:!0,get:function(){return Dn.pbkdf2}});Object.defineProperty(x,"scrypt",{enumerable:!0,get:function(){return Dn.scrypt}});Object.defineProperty(x,"scryptSync",{enumerable:!0,get:function(){return Dn.scryptSync}});Object.defineProperty(x,"lock",{enumerable:!0,get:function(){return Dn.lock}});Object.defineProperty(x,"Signature",{enumerable:!0,get:function(){return Dn.Signature}});Object.defineProperty(x,"SigningKey",{enumerable:!0,get:function(){return Dn.SigningKey}});var Hn=Ls();Object.defineProperty(x,"id",{enumerable:!0,get:function(){return Hn.id}});Object.defineProperty(x,"ensNormalize",{enumerable:!0,get:function(){return Hn.ensNormalize}});Object.defineProperty(x,"isValidName",{enumerable:!0,get:function(){return Hn.isValidName}});Object.defineProperty(x,"namehash",{enumerable:!0,get:function(){return Hn.namehash}});Object.defineProperty(x,"dnsEncode",{enumerable:!0,get:function(){return Hn.dnsEncode}});Object.defineProperty(x,"hashMessage",{enumerable:!0,get:function(){return Hn.hashMessage}});Object.defineProperty(x,"verifyMessage",{enumerable:!0,get:function(){return Hn.verifyMessage}});Object.defineProperty(x,"solidityPacked",{enumerable:!0,get:function(){return Hn.solidityPacked}});Object.defineProperty(x,"solidityPackedKeccak256",{enumerable:!0,get:function(){return Hn.solidityPackedKeccak256}});Object.defineProperty(x,"solidityPackedSha256",{enumerable:!0,get:function(){return Hn.solidityPackedSha256}});Object.defineProperty(x,"TypedDataEncoder",{enumerable:!0,get:function(){return Hn.TypedDataEncoder}});Object.defineProperty(x,"verifyTypedData",{enumerable:!0,get:function(){return Hn.verifyTypedData}});var Re=bm();Object.defineProperty(x,"getDefaultProvider",{enumerable:!0,get:function(){return Re.getDefaultProvider}});Object.defineProperty(x,"Block",{enumerable:!0,get:function(){return Re.Block}});Object.defineProperty(x,"FeeData",{enumerable:!0,get:function(){return Re.FeeData}});Object.defineProperty(x,"Log",{enumerable:!0,get:function(){return Re.Log}});Object.defineProperty(x,"TransactionReceipt",{enumerable:!0,get:function(){return Re.TransactionReceipt}});Object.defineProperty(x,"TransactionResponse",{enumerable:!0,get:function(){return Re.TransactionResponse}});Object.defineProperty(x,"AbstractSigner",{enumerable:!0,get:function(){return Re.AbstractSigner}});Object.defineProperty(x,"NonceManager",{enumerable:!0,get:function(){return Re.NonceManager}});Object.defineProperty(x,"VoidSigner",{enumerable:!0,get:function(){return Re.VoidSigner}});Object.defineProperty(x,"AbstractProvider",{enumerable:!0,get:function(){return Re.AbstractProvider}});Object.defineProperty(x,"FallbackProvider",{enumerable:!0,get:function(){return Re.FallbackProvider}});Object.defineProperty(x,"JsonRpcApiProvider",{enumerable:!0,get:function(){return Re.JsonRpcApiProvider}});Object.defineProperty(x,"JsonRpcProvider",{enumerable:!0,get:function(){return Re.JsonRpcProvider}});Object.defineProperty(x,"JsonRpcSigner",{enumerable:!0,get:function(){return Re.JsonRpcSigner}});Object.defineProperty(x,"BrowserProvider",{enumerable:!0,get:function(){return Re.BrowserProvider}});Object.defineProperty(x,"AlchemyProvider",{enumerable:!0,get:function(){return Re.AlchemyProvider}});Object.defineProperty(x,"AnkrProvider",{enumerable:!0,get:function(){return Re.AnkrProvider}});Object.defineProperty(x,"ChainstackProvider",{enumerable:!0,get:function(){return Re.ChainstackProvider}});Object.defineProperty(x,"CloudflareProvider",{enumerable:!0,get:function(){return Re.CloudflareProvider}});Object.defineProperty(x,"EtherscanProvider",{enumerable:!0,get:function(){return Re.EtherscanProvider}});Object.defineProperty(x,"InfuraProvider",{enumerable:!0,get:function(){return Re.InfuraProvider}});Object.defineProperty(x,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return Re.InfuraWebSocketProvider}});Object.defineProperty(x,"PocketProvider",{enumerable:!0,get:function(){return Re.PocketProvider}});Object.defineProperty(x,"QuickNodeProvider",{enumerable:!0,get:function(){return Re.QuickNodeProvider}});Object.defineProperty(x,"IpcSocketProvider",{enumerable:!0,get:function(){return Re.IpcSocketProvider}});Object.defineProperty(x,"SocketProvider",{enumerable:!0,get:function(){return Re.SocketProvider}});Object.defineProperty(x,"WebSocketProvider",{enumerable:!0,get:function(){return Re.WebSocketProvider}});Object.defineProperty(x,"EnsResolver",{enumerable:!0,get:function(){return Re.EnsResolver}});Object.defineProperty(x,"Network",{enumerable:!0,get:function(){return Re.Network}});Object.defineProperty(x,"EnsPlugin",{enumerable:!0,get:function(){return Re.EnsPlugin}});Object.defineProperty(x,"EtherscanPlugin",{enumerable:!0,get:function(){return Re.EtherscanPlugin}});Object.defineProperty(x,"FeeDataNetworkPlugin",{enumerable:!0,get:function(){return Re.FeeDataNetworkPlugin}});Object.defineProperty(x,"FetchUrlFeeDataNetworkPlugin",{enumerable:!0,get:function(){return Re.FetchUrlFeeDataNetworkPlugin}});Object.defineProperty(x,"GasCostPlugin",{enumerable:!0,get:function(){return Re.GasCostPlugin}});Object.defineProperty(x,"NetworkPlugin",{enumerable:!0,get:function(){return Re.NetworkPlugin}});Object.defineProperty(x,"MulticoinProviderPlugin",{enumerable:!0,get:function(){return Re.MulticoinProviderPlugin}});Object.defineProperty(x,"SocketBlockSubscriber",{enumerable:!0,get:function(){return Re.SocketBlockSubscriber}});Object.defineProperty(x,"SocketEventSubscriber",{enumerable:!0,get:function(){return Re.SocketEventSubscriber}});Object.defineProperty(x,"SocketPendingSubscriber",{enumerable:!0,get:function(){return Re.SocketPendingSubscriber}});Object.defineProperty(x,"SocketSubscriber",{enumerable:!0,get:function(){return Re.SocketSubscriber}});Object.defineProperty(x,"UnmanagedSubscriber",{enumerable:!0,get:function(){return Re.UnmanagedSubscriber}});Object.defineProperty(x,"copyRequest",{enumerable:!0,get:function(){return Re.copyRequest}});Object.defineProperty(x,"showThrottleMessage",{enumerable:!0,get:function(){return Re.showThrottleMessage}});var zm=qr();Object.defineProperty(x,"accessListify",{enumerable:!0,get:function(){return zm.accessListify}});Object.defineProperty(x,"computeAddress",{enumerable:!0,get:function(){return zm.computeAddress}});Object.defineProperty(x,"recoverAddress",{enumerable:!0,get:function(){return zm.recoverAddress}});Object.defineProperty(x,"Transaction",{enumerable:!0,get:function(){return zm.Transaction}});var ke=me();Object.defineProperty(x,"decodeBase58",{enumerable:!0,get:function(){return ke.decodeBase58}});Object.defineProperty(x,"encodeBase58",{enumerable:!0,get:function(){return ke.encodeBase58}});Object.defineProperty(x,"decodeBase64",{enumerable:!0,get:function(){return ke.decodeBase64}});Object.defineProperty(x,"encodeBase64",{enumerable:!0,get:function(){return ke.encodeBase64}});Object.defineProperty(x,"concat",{enumerable:!0,get:function(){return ke.concat}});Object.defineProperty(x,"dataLength",{enumerable:!0,get:function(){return ke.dataLength}});Object.defineProperty(x,"dataSlice",{enumerable:!0,get:function(){return ke.dataSlice}});Object.defineProperty(x,"getBytes",{enumerable:!0,get:function(){return ke.getBytes}});Object.defineProperty(x,"getBytesCopy",{enumerable:!0,get:function(){return ke.getBytesCopy}});Object.defineProperty(x,"hexlify",{enumerable:!0,get:function(){return ke.hexlify}});Object.defineProperty(x,"isHexString",{enumerable:!0,get:function(){return ke.isHexString}});Object.defineProperty(x,"isBytesLike",{enumerable:!0,get:function(){return ke.isBytesLike}});Object.defineProperty(x,"stripZerosLeft",{enumerable:!0,get:function(){return ke.stripZerosLeft}});Object.defineProperty(x,"zeroPadBytes",{enumerable:!0,get:function(){return ke.zeroPadBytes}});Object.defineProperty(x,"zeroPadValue",{enumerable:!0,get:function(){return ke.zeroPadValue}});Object.defineProperty(x,"defineProperties",{enumerable:!0,get:function(){return ke.defineProperties}});Object.defineProperty(x,"resolveProperties",{enumerable:!0,get:function(){return ke.resolveProperties}});Object.defineProperty(x,"assert",{enumerable:!0,get:function(){return ke.assert}});Object.defineProperty(x,"assertArgument",{enumerable:!0,get:function(){return ke.assertArgument}});Object.defineProperty(x,"assertArgumentCount",{enumerable:!0,get:function(){return ke.assertArgumentCount}});Object.defineProperty(x,"assertNormalize",{enumerable:!0,get:function(){return ke.assertNormalize}});Object.defineProperty(x,"assertPrivate",{enumerable:!0,get:function(){return ke.assertPrivate}});Object.defineProperty(x,"makeError",{enumerable:!0,get:function(){return ke.makeError}});Object.defineProperty(x,"isCallException",{enumerable:!0,get:function(){return ke.isCallException}});Object.defineProperty(x,"isError",{enumerable:!0,get:function(){return ke.isError}});Object.defineProperty(x,"EventPayload",{enumerable:!0,get:function(){return ke.EventPayload}});Object.defineProperty(x,"FetchRequest",{enumerable:!0,get:function(){return ke.FetchRequest}});Object.defineProperty(x,"FetchResponse",{enumerable:!0,get:function(){return ke.FetchResponse}});Object.defineProperty(x,"FetchCancelSignal",{enumerable:!0,get:function(){return ke.FetchCancelSignal}});Object.defineProperty(x,"FixedNumber",{enumerable:!0,get:function(){return ke.FixedNumber}});Object.defineProperty(x,"getBigInt",{enumerable:!0,get:function(){return ke.getBigInt}});Object.defineProperty(x,"getNumber",{enumerable:!0,get:function(){return ke.getNumber}});Object.defineProperty(x,"getUint",{enumerable:!0,get:function(){return ke.getUint}});Object.defineProperty(x,"toBeArray",{enumerable:!0,get:function(){return ke.toBeArray}});Object.defineProperty(x,"toBigInt",{enumerable:!0,get:function(){return ke.toBigInt}});Object.defineProperty(x,"toBeHex",{enumerable:!0,get:function(){return ke.toBeHex}});Object.defineProperty(x,"toNumber",{enumerable:!0,get:function(){return ke.toNumber}});Object.defineProperty(x,"toQuantity",{enumerable:!0,get:function(){return ke.toQuantity}});Object.defineProperty(x,"fromTwos",{enumerable:!0,get:function(){return ke.fromTwos}});Object.defineProperty(x,"toTwos",{enumerable:!0,get:function(){return ke.toTwos}});Object.defineProperty(x,"mask",{enumerable:!0,get:function(){return ke.mask}});Object.defineProperty(x,"formatEther",{enumerable:!0,get:function(){return ke.formatEther}});Object.defineProperty(x,"parseEther",{enumerable:!0,get:function(){return ke.parseEther}});Object.defineProperty(x,"formatUnits",{enumerable:!0,get:function(){return ke.formatUnits}});Object.defineProperty(x,"parseUnits",{enumerable:!0,get:function(){return ke.parseUnits}});Object.defineProperty(x,"toUtf8Bytes",{enumerable:!0,get:function(){return ke.toUtf8Bytes}});Object.defineProperty(x,"toUtf8CodePoints",{enumerable:!0,get:function(){return ke.toUtf8CodePoints}});Object.defineProperty(x,"toUtf8String",{enumerable:!0,get:function(){return ke.toUtf8String}});Object.defineProperty(x,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return ke.Utf8ErrorFuncs}});Object.defineProperty(x,"decodeRlp",{enumerable:!0,get:function(){return ke.decodeRlp}});Object.defineProperty(x,"encodeRlp",{enumerable:!0,get:function(){return ke.encodeRlp}});Object.defineProperty(x,"uuidV4",{enumerable:!0,get:function(){return ke.uuidV4}});var Ir=Qk();Object.defineProperty(x,"Mnemonic",{enumerable:!0,get:function(){return Ir.Mnemonic}});Object.defineProperty(x,"BaseWallet",{enumerable:!0,get:function(){return Ir.BaseWallet}});Object.defineProperty(x,"HDNodeWallet",{enumerable:!0,get:function(){return Ir.HDNodeWallet}});Object.defineProperty(x,"HDNodeVoidWallet",{enumerable:!0,get:function(){return Ir.HDNodeVoidWallet}});Object.defineProperty(x,"Wallet",{enumerable:!0,get:function(){return Ir.Wallet}});Object.defineProperty(x,"defaultPath",{enumerable:!0,get:function(){return Ir.defaultPath}});Object.defineProperty(x,"getAccountPath",{enumerable:!0,get:function(){return Ir.getAccountPath}});Object.defineProperty(x,"getIndexedAccountPath",{enumerable:!0,get:function(){return Ir.getIndexedAccountPath}});Object.defineProperty(x,"isCrowdsaleJson",{enumerable:!0,get:function(){return Ir.isCrowdsaleJson}});Object.defineProperty(x,"isKeystoreJson",{enumerable:!0,get:function(){return Ir.isKeystoreJson}});Object.defineProperty(x,"decryptCrowdsaleJson",{enumerable:!0,get:function(){return Ir.decryptCrowdsaleJson}});Object.defineProperty(x,"decryptKeystoreJsonSync",{enumerable:!0,get:function(){return Ir.decryptKeystoreJsonSync}});Object.defineProperty(x,"decryptKeystoreJson",{enumerable:!0,get:function(){return Ir.decryptKeystoreJson}});Object.defineProperty(x,"encryptKeystoreJson",{enumerable:!0,get:function(){return Ir.encryptKeystoreJson}});Object.defineProperty(x,"encryptKeystoreJsonSync",{enumerable:!0,get:function(){return Ir.encryptKeystoreJsonSync}});var Nd=tB();Object.defineProperty(x,"Wordlist",{enumerable:!0,get:function(){return Nd.Wordlist}});Object.defineProperty(x,"LangEn",{enumerable:!0,get:function(){return Nd.LangEn}});Object.defineProperty(x,"WordlistOwl",{enumerable:!0,get:function(){return Nd.WordlistOwl}});Object.defineProperty(x,"WordlistOwlA",{enumerable:!0,get:function(){return Nd.WordlistOwlA}});Object.defineProperty(x,"wordlists",{enumerable:!0,get:function(){return Nd.wordlists}})});var S2=M(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.ethers=void 0;var rB=U3(),OH=rB.__importStar(B2());Id.ethers=OH;rB.__exportStar(B2(),Id)});var N2=M(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.getAddress=Io.hashMessage=Io.verifyMessage=void 0;var Zu=S2(),O2=null,_2=null,C2=null;try{O2=Zu.ethers.utils.verifyMessage,_2=Zu.ethers.utils.hashMessage,C2=Zu.ethers.utils.getAddress}catch{O2=Zu.ethers.verifyMessage,_2=Zu.ethers.hashMessage,C2=Zu.ethers.getAddress}Io.verifyMessage=O2;Io.hashMessage=_2;Io.getAddress=C2});var R2=M(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.SiweErrorType=ms.SiweError=ms.VerifyOptsKeys=ms.VerifyParamsKeys=void 0;ms.VerifyParamsKeys=["signature","scheme","domain","nonce","time"];ms.VerifyOptsKeys=["provider","suppressExceptions","verificationFallback"];var I2=class{constructor(e,t,n){this.type=e,this.expected=t,this.received=n}};ms.SiweError=I2;var _H;(function(r){r.EXPIRED_MESSAGE="Expired message.",r.INVALID_DOMAIN="Invalid domain.",r.SCHEME_MISMATCH="Scheme does not match provided scheme for verification.",r.DOMAIN_MISMATCH="Domain does not match provided domain for verification.",r.NONCE_MISMATCH="Nonce does not match provided nonce for verification.",r.INVALID_ADDRESS="Invalid address.",r.INVALID_URI="URI does not conform to RFC 3986.",r.INVALID_NONCE="Nonce size smaller then 8 characters or is not alphanumeric.",r.NOT_YET_VALID_MESSAGE="Message is not valid yet.",r.INVALID_SIGNATURE="Signature does not match address of the message.",r.INVALID_TIME_FORMAT="Invalid time format.",r.INVALID_MESSAGE_VERSION="Invalid message version.",r.UNABLE_TO_PARSE="Unable to parse the message."})(_H=ms.SiweErrorType||(ms.SiweErrorType={}))});var sB=M(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});Vm.BrowserRandomSource=void 0;var nB=65536,M2=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;let e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");let t=new Uint8Array(e);for(let n=0;n<t.length;n+=nB)this._crypto.getRandomValues(t.subarray(n,n+Math.min(t.length-n,nB)));return t}};Vm.BrowserRandomSource=M2});var j2=M(L2=>{"use strict";Object.defineProperty(L2,"__esModule",{value:!0});function CH(r){for(var e=0;e<r.length;e++)r[e]=0;return r}L2.wipe=CH});var iB=M(()=>{});var oB=M(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});Km.NodeRandomSource=void 0;var NH=j2(),U2=class{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof gA<"u"){let e=iB();e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");let n=new Uint8Array(e);for(let s=0;s<n.length;s++)n[s]=t[s];return(0,NH.wipe)(t),n}};Km.NodeRandomSource=U2});var aB=M(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});Jm.SystemRandomSource=void 0;var IH=sB(),RH=oB(),F2=class{constructor(){if(this.isAvailable=!1,this.name="",this._source=new IH.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new RH.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}};Jm.SystemRandomSource=F2});var cB=M(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});function MH(r,e){var t=r>>>16&65535,n=r&65535,s=e>>>16&65535,i=e&65535;return n*i+(t*i+n*s<<16>>>0)|0}un.mul=Math.imul||MH;function LH(r,e){return r+e|0}un.add=LH;function jH(r,e){return r-e|0}un.sub=jH;function UH(r,e){return r<<e|r>>>32-e}un.rotl=UH;function FH(r,e){return r<<32-e|r>>>e}un.rotr=FH;function DH(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}un.isInteger=Number.isInteger||DH;un.MAX_SAFE_INTEGER=9007199254740991;un.isSafeInteger=function(r){return un.isInteger(r)&&r>=-un.MAX_SAFE_INTEGER&&r<=un.MAX_SAFE_INTEGER}});var hB=M(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});var uB=cB();function HH(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}qe.readInt16BE=HH;function $H(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}qe.readUint16BE=$H;function qH(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}qe.readInt16LE=qH;function GH(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}qe.readUint16LE=GH;function lB(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>8,e[t+1]=r>>>0,e}qe.writeUint16BE=lB;qe.writeInt16BE=lB;function fB(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e}qe.writeUint16LE=fB;qe.writeInt16LE=fB;function D2(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}qe.readInt32BE=D2;function H2(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}qe.readUint32BE=H2;function $2(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}qe.readInt32LE=$2;function q2(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}qe.readUint32LE=q2;function Wm(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>24,e[t+1]=r>>>16,e[t+2]=r>>>8,e[t+3]=r>>>0,e}qe.writeUint32BE=Wm;qe.writeInt32BE=Wm;function Qm(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24,e}qe.writeUint32LE=Qm;qe.writeInt32LE=Qm;function zH(r,e){e===void 0&&(e=0);var t=D2(r,e),n=D2(r,e+4);return t*4294967296+n-(n>>31)*4294967296}qe.readInt64BE=zH;function VH(r,e){e===void 0&&(e=0);var t=H2(r,e),n=H2(r,e+4);return t*4294967296+n}qe.readUint64BE=VH;function KH(r,e){e===void 0&&(e=0);var t=$2(r,e),n=$2(r,e+4);return n*4294967296+t-(t>>31)*4294967296}qe.readInt64LE=KH;function JH(r,e){e===void 0&&(e=0);var t=q2(r,e),n=q2(r,e+4);return n*4294967296+t}qe.readUint64LE=JH;function dB(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Wm(r/4294967296>>>0,e,t),Wm(r>>>0,e,t+4),e}qe.writeUint64BE=dB;qe.writeInt64BE=dB;function pB(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Qm(r>>>0,e,t),Qm(r/4294967296>>>0,e,t+4),e}qe.writeUint64LE=pB;qe.writeInt64LE=pB;function WH(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,s=1,i=r/8+t-1;i>=t;i--)n+=e[i]*s,s*=256;return n}qe.readUintBE=WH;function QH(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,s=1,i=t;i<t+r/8;i++)n+=e[i]*s,s*=256;return n}qe.readUintLE=QH;function YH(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!uB.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var s=1,i=r/8+n-1;i>=n;i--)t[i]=e/s&255,s*=256;return t}qe.writeUintBE=YH;function ZH(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!uB.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var s=1,i=n;i<n+r/8;i++)t[i]=e/s&255,s*=256;return t}qe.writeUintLE=ZH;function XH(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}qe.readFloat32BE=XH;function e$(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}qe.readFloat32LE=e$;function t$(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}qe.readFloat64BE=t$;function r$(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}qe.readFloat64LE=r$;function n$(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r),e}qe.writeFloat32BE=n$;function s$(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r,!0),e}qe.writeFloat32LE=s$;function i$(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r),e}qe.writeFloat64BE=i$;function o$(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r,!0),e}qe.writeFloat64LE=o$});var xB=M(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.randomStringForEntropy=wr.randomString=wr.randomUint32=wr.randomBytes=wr.defaultRandomSource=void 0;var a$=aB(),c$=hB(),mB=j2();wr.defaultRandomSource=new a$.SystemRandomSource;function G2(r,e=wr.defaultRandomSource){return e.randomBytes(r)}wr.randomBytes=G2;function u$(r=wr.defaultRandomSource){let e=G2(4,r),t=(0,c$.readUint32LE)(e);return(0,mB.wipe)(e),t}wr.randomUint32=u$;var bB="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function gB(r,e=bB,t=wr.defaultRandomSource){if(e.length<2)throw new Error("randomString charset is too short");if(e.length>256)throw new Error("randomString charset is too long");let n="",s=e.length,i=256-256%s;for(;r>0;){let o=G2(Math.ceil(r*256/i),t);for(let a=0;a<o.length&&r>0;a++){let c=o[a];c<i&&(n+=e.charAt(c%s),r--)}(0,mB.wipe)(o)}return n}wr.randomString=gB;function l$(r,e=bB,t=wr.defaultRandomSource){let n=Math.ceil(r/(Math.log(e.length)/Math.LN2));return gB(n,e,t)}wr.randomStringForEntropy=l$});var z2=M($n=>{"use strict";var f$=$n&&$n.__awaiter||function(r,e,t,n){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{u(n.next(l))}catch(f){o(f)}}function c(l){try{u(n.throw(l))}catch(f){o(f)}}function u(l){l.done?i(l.value):s(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})};Object.defineProperty($n,"__esModule",{value:!0});$n.checkInvalidKeys=$n.isValidISO8601Date=$n.generateNonce=$n.checkContractWalletSignature=void 0;var d$=xB(),p$=S2(),h$=N2(),m$=["function isValidSignature(bytes32 _message, bytes _signature) public view returns (bytes4)"],b$="0x1626ba7e",yB=/^(?<date>[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]))[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(.[0-9]+)?(([Zz])|([+|-]([01][0-9]|2[0-3]):[0-5][0-9]))$/,g$=(r,e,t)=>f$(void 0,void 0,void 0,function*(){if(!t)return!1;let n=new p$.Contract(r.address,m$,t),s=(0,h$.hashMessage)(r.prepareMessage());return(yield n.isValidSignature(s,e))===b$});$n.checkContractWalletSignature=g$;var x$=()=>{let r=(0,d$.randomStringForEntropy)(96);if(!r||r.length<8)throw new Error("Error during nonce creation.");return r};$n.generateNonce=x$;var y$=r=>{let e=yB.exec(r);if(!r)return!1;let t=new Date(e.groups.date).toISOString(),n=yB.exec(t);return e.groups.date===n.groups.date};$n.isValidISO8601Date=y$;var w$=(r,e)=>{let t=[];return Object.keys(r).forEach(n=>{e.includes(n)||t.push(n)}),t};$n.checkInvalidKeys=w$});var EB=M(qn=>{"use strict";var A$=qn&&qn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),E$=qn&&qn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),v$=qn&&qn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&A$(e,r,t);return E$(e,r),e},wB=qn&&qn.__awaiter||function(r,e,t,n){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{u(n.next(l))}catch(f){o(f)}}function c(l){try{u(n.throw(l))}catch(f){o(f)}}function u(l){l.done?i(l.value):s(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})};Object.defineProperty(qn,"__esModule",{value:!0});qn.SiweMessage=void 0;var V2=h3(),T$=v$(b3()),AB=N2(),it=R2(),Ro=z2(),K2=class{constructor(e){if(typeof e=="string"){let t=new V2.ParsedMessage(e);this.scheme=t.scheme,this.domain=t.domain,this.address=t.address,this.statement=t.statement,this.uri=t.uri,this.version=t.version,this.nonce=t.nonce,this.issuedAt=t.issuedAt,this.expirationTime=t.expirationTime,this.notBefore=t.notBefore,this.requestId=t.requestId,this.chainId=t.chainId,this.resources=t.resources}else this.scheme=e?.scheme,this.domain=e.domain,this.address=e.address,this.statement=e?.statement,this.uri=e.uri,this.version=e.version,this.chainId=e.chainId,this.nonce=e.nonce,this.issuedAt=e?.issuedAt,this.expirationTime=e?.expirationTime,this.notBefore=e?.notBefore,this.requestId=e?.requestId,this.resources=e?.resources,typeof this.chainId=="string"&&(this.chainId=(0,V2.parseIntegerNumber)(this.chainId));this.nonce=this.nonce||(0,Ro.generateNonce)(),this.validateMessage()}toMessage(){this.validateMessage();let t=`${this.scheme?`${this.scheme}://${this.domain}`:this.domain} wants you to sign in with your Ethereum account:`,n=`URI: ${this.uri}`,s=[t,this.address].join(`
|
|
760
|
+
`)!==this.#t)throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#r=e}return this.#r}getWord(e){let t=this.#n();return(0,rD.assertArgument)(e>=0&&e<t.length,`invalid word index: ${e}`,"index",e),t[e]}getWordIndex(e){return this.#n().indexOf(e)}};Am.WordlistOwl=n2});var md=M(vm=>{"use strict";Object.defineProperty(vm,"__esModule",{value:!0});vm.LangEn=void 0;var iD=Em(),oD="0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO",aD="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60",s2=null,hd=class extends iD.WordlistOwl{constructor(){super("en",oD,aD)}static wordlist(){return s2==null&&(s2=new hd),s2}};vm.LangEn=hd});var Pm=M(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.Mnemonic=void 0;var c2=nr(),Cr=me(),u2=md();function Bk(r){return(1<<r)-1<<8-r&255}function cD(r){return(1<<r)-1&255}function i2(r,e){(0,Cr.assertNormalize)("NFKD"),e==null&&(e=u2.LangEn.wordlist());let t=e.split(r);(0,Cr.assertArgument)(t.length%3===0&&t.length>=12&&t.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");let n=new Uint8Array(Math.ceil(11*t.length/8)),s=0;for(let u=0;u<t.length;u++){let l=e.getWordIndex(t[u].normalize("NFKD"));(0,Cr.assertArgument)(l>=0,`invalid mnemonic word at index ${u}`,"mnemonic","[ REDACTED ]");for(let f=0;f<11;f++)l&1<<10-f&&(n[s>>3]|=1<<7-s%8),s++}let i=32*t.length/3,o=t.length/3,a=Bk(o),c=(0,Cr.getBytes)((0,c2.sha256)(n.slice(0,i/8)))[0]&a;return(0,Cr.assertArgument)(c===(n[n.length-1]&a),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),(0,Cr.hexlify)(n.slice(0,i/8))}function o2(r,e){(0,Cr.assertArgument)(r.length%4===0&&r.length>=16&&r.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),e==null&&(e=u2.LangEn.wordlist());let t=[0],n=11;for(let o=0;o<r.length;o++)n>8?(t[t.length-1]<<=8,t[t.length-1]|=r[o],n-=8):(t[t.length-1]<<=n,t[t.length-1]|=r[o]>>8-n,t.push(r[o]&cD(8-n)),n+=3);let s=r.length/4,i=parseInt((0,c2.sha256)(r).substring(2,4),16)&Bk(s);return t[t.length-1]<<=s,t[t.length-1]|=i>>8-s,e.join(t.map(o=>e.getWord(o)))}var a2={},qu=class{phrase;password;wordlist;entropy;constructor(e,t,n,s,i){s==null&&(s=""),i==null&&(i=u2.LangEn.wordlist()),(0,Cr.assertPrivate)(e,a2,"Mnemonic"),(0,Cr.defineProperties)(this,{phrase:n,password:s,wordlist:i,entropy:t})}computeSeed(){let e=(0,Cr.toUtf8Bytes)("mnemonic"+this.password,"NFKD");return(0,c2.pbkdf2)((0,Cr.toUtf8Bytes)(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,t,n){let s=i2(e,n);return e=o2((0,Cr.getBytes)(s),n),new qu(a2,s,e,t,n)}static fromEntropy(e,t,n){let s=(0,Cr.getBytes)(e,"entropy"),i=o2(s,n);return new qu(a2,(0,Cr.hexlify)(s),i,t,n)}static entropyToPhrase(e,t){let n=(0,Cr.getBytes)(e,"entropy");return o2(n,t)}static phraseToEntropy(e,t){return i2(e,t)}static isValidMnemonic(e,t){try{return i2(e,t),!0}catch{}return!1}};Tm.Mnemonic=qu});var d2=M(Po=>{"use strict";var fr=Po&&Po.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},l2=Po&&Po.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},Bm,Rn,$s;Object.defineProperty(Po,"__esModule",{value:!0});Po.AES=void 0;var uD={16:10,24:12,32:14},lD=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],In=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],km=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],fD=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],dD=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],pD=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],hD=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],mD=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],bD=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],gD=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],xD=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],yD=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],wD=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],AD=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],ED=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function f2(r){let e=[];for(let t=0;t<r.length;t+=4)e.push(r[t]<<24|r[t+1]<<16|r[t+2]<<8|r[t+3]);return e}var bd=class{get key(){return fr(this,Bm,"f").slice()}constructor(e){if(Bm.set(this,void 0),Rn.set(this,void 0),$s.set(this,void 0),!(this instanceof bd))throw Error("AES must be instanitated with `new`");l2(this,Bm,new Uint8Array(e),"f");let t=uD[this.key.length];if(t==null)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");l2(this,$s,[],"f"),l2(this,Rn,[],"f");for(let l=0;l<=t;l++)fr(this,$s,"f").push([0,0,0,0]),fr(this,Rn,"f").push([0,0,0,0]);let n=(t+1)*4,s=this.key.length/4,i=f2(this.key),o;for(let l=0;l<s;l++)o=l>>2,fr(this,$s,"f")[o][l%4]=i[l],fr(this,Rn,"f")[t-o][l%4]=i[l];let a=0,c=s,u;for(;c<n;){if(u=i[s-1],i[0]^=In[u>>16&255]<<24^In[u>>8&255]<<16^In[u&255]<<8^In[u>>24&255]^lD[a]<<24,a+=1,s!=8)for(let h=1;h<s;h++)i[h]^=i[h-1];else{for(let h=1;h<s/2;h++)i[h]^=i[h-1];u=i[s/2-1],i[s/2]^=In[u&255]^In[u>>8&255]<<8^In[u>>16&255]<<16^In[u>>24&255]<<24;for(let h=s/2+1;h<s;h++)i[h]^=i[h-1]}let l=0,f,d;for(;l<s&&c<n;)f=c>>2,d=c%4,fr(this,$s,"f")[f][d]=i[l],fr(this,Rn,"f")[t-f][d]=i[l++],c++}for(let l=1;l<t;l++)for(let f=0;f<4;f++)u=fr(this,Rn,"f")[l][f],fr(this,Rn,"f")[l][f]=yD[u>>24&255]^wD[u>>16&255]^AD[u>>8&255]^ED[u&255]}encrypt(e){if(e.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");let t=fr(this,$s,"f").length-1,n=[0,0,0,0],s=f2(e);for(let a=0;a<4;a++)s[a]^=fr(this,$s,"f")[0][a];for(let a=1;a<t;a++){for(let c=0;c<4;c++)n[c]=fD[s[c]>>24&255]^dD[s[(c+1)%4]>>16&255]^pD[s[(c+2)%4]>>8&255]^hD[s[(c+3)%4]&255]^fr(this,$s,"f")[a][c];s=n.slice()}let i=new Uint8Array(16),o=0;for(let a=0;a<4;a++)o=fr(this,$s,"f")[t][a],i[4*a]=(In[s[a]>>24&255]^o>>24)&255,i[4*a+1]=(In[s[(a+1)%4]>>16&255]^o>>16)&255,i[4*a+2]=(In[s[(a+2)%4]>>8&255]^o>>8)&255,i[4*a+3]=(In[s[(a+3)%4]&255]^o)&255;return i}decrypt(e){if(e.length!=16)throw new TypeError("invalid ciphertext size (must be 16 bytes)");let t=fr(this,Rn,"f").length-1,n=[0,0,0,0],s=f2(e);for(let a=0;a<4;a++)s[a]^=fr(this,Rn,"f")[0][a];for(let a=1;a<t;a++){for(let c=0;c<4;c++)n[c]=mD[s[c]>>24&255]^bD[s[(c+3)%4]>>16&255]^gD[s[(c+2)%4]>>8&255]^xD[s[(c+1)%4]&255]^fr(this,Rn,"f")[a][c];s=n.slice()}let i=new Uint8Array(16),o=0;for(let a=0;a<4;a++)o=fr(this,Rn,"f")[t][a],i[4*a]=(km[s[a]>>24&255]^o>>24)&255,i[4*a+1]=(km[s[(a+3)%4]>>16&255]^o>>16)&255,i[4*a+2]=(km[s[(a+2)%4]>>8&255]^o>>8)&255,i[4*a+3]=(km[s[(a+1)%4]&255]^o)&255;return i}};Po.AES=bd;Bm=new WeakMap,Rn=new WeakMap,$s=new WeakMap});var $a=M(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});Sm.ModeOfOperation=void 0;var vD=d2(),p2=class{constructor(e,t,n){if(n&&!(this instanceof n))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new vD.AES(t)},name:{enumerable:!0,value:e}})}};Sm.ModeOfOperation=p2});var Sk=M(ko=>{"use strict";var Om=ko&&ko.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},Gu=ko&&ko.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},gd,ki;Object.defineProperty(ko,"__esModule",{value:!0});ko.CBC=void 0;var TD=$a(),xd=class extends TD.ModeOfOperation{constructor(e,t){if(super("ECC",e,xd),gd.set(this,void 0),ki.set(this,void 0),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");Om(this,gd,new Uint8Array(t),"f")}else Om(this,gd,new Uint8Array(16),"f");Om(this,ki,this.iv,"f")}get iv(){return new Uint8Array(Gu(this,gd,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){for(let s=0;s<16;s++)Gu(this,ki,"f")[s]^=e[n+s];Om(this,ki,this.aes.encrypt(Gu(this,ki,"f")),"f"),t.set(Gu(this,ki,"f"),n)}return t}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){let s=this.aes.decrypt(e.subarray(n,n+16));for(let i=0;i<16;i++)t[n+i]=s[i]^Gu(this,ki,"f")[i],Gu(this,ki,"f")[i]=e[n+i]}return t}};ko.CBC=xd;gd=new WeakMap,ki=new WeakMap});var Ok=M(Oo=>{"use strict";var h2=Oo&&Oo.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},Bo=Oo&&Oo.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},_m,yd,So,m2;Object.defineProperty(Oo,"__esModule",{value:!0});Oo.CFB=void 0;var PD=$a(),wd=class extends PD.ModeOfOperation{constructor(e,t,n=8){if(super("CFB",e,wd),_m.add(this),yd.set(this,void 0),So.set(this,void 0),!Number.isInteger(n)||n%8)throw new TypeError("invalid segmentSize");if(Object.defineProperties(this,{segmentSize:{enumerable:!0,value:n}}),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");h2(this,yd,new Uint8Array(t),"f")}else h2(this,yd,new Uint8Array(16),"f");h2(this,So,this.iv,"f")}get iv(){return new Uint8Array(Bo(this,yd,"f"))}encrypt(e){if(8*e.length%this.segmentSize)throw new TypeError("invalid plaintext size (must be multiple of segmentSize bytes)");let t=this.segmentSize/8,n=new Uint8Array(e);for(let s=0;s<n.length;s+=t){let i=this.aes.encrypt(Bo(this,So,"f"));for(let o=0;o<t;o++)n[s+o]^=i[o];Bo(this,_m,"m",m2).call(this,n.subarray(s))}return n}decrypt(e){if(8*e.length%this.segmentSize)throw new TypeError("invalid ciphertext size (must be multiple of segmentSize bytes)");let t=this.segmentSize/8,n=new Uint8Array(e);for(let s=0;s<n.length;s+=t){let i=this.aes.encrypt(Bo(this,So,"f"));for(let o=0;o<t;o++)n[s+o]^=i[o];Bo(this,_m,"m",m2).call(this,e.subarray(s))}return n}};Oo.CFB=wd;yd=new WeakMap,So=new WeakMap,_m=new WeakSet,m2=function(e){let t=this.segmentSize/8;Bo(this,So,"f").set(Bo(this,So,"f").subarray(t)),Bo(this,So,"f").set(e.subarray(0,t),16-t)}});var _k=M(_o=>{"use strict";var zu=_o&&_o.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},Mn=_o&&_o.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Ad,qa,Ln;Object.defineProperty(_o,"__esModule",{value:!0});_o.CTR=void 0;var kD=$a(),Ed=class extends kD.ModeOfOperation{constructor(e,t){super("CTR",e,Ed),Ad.set(this,void 0),qa.set(this,void 0),Ln.set(this,void 0),zu(this,Ln,new Uint8Array(16),"f"),Mn(this,Ln,"f").fill(0),zu(this,Ad,Mn(this,Ln,"f"),"f"),zu(this,qa,16,"f"),t==null&&(t=1),typeof t=="number"?this.setCounterValue(t):this.setCounterBytes(t)}get counter(){return new Uint8Array(Mn(this,Ln,"f"))}setCounterValue(e){if(!Number.isInteger(e)||e<0||e>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let t=15;t>=0;--t)Mn(this,Ln,"f")[t]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");Mn(this,Ln,"f").set(e)}increment(){for(let e=15;e>=0;e--)if(Mn(this,Ln,"f")[e]===255)Mn(this,Ln,"f")[e]=0;else{Mn(this,Ln,"f")[e]++;break}}encrypt(e){var t,n;let s=new Uint8Array(e);for(let i=0;i<s.length;i++)Mn(this,qa,"f")===16&&(zu(this,Ad,this.aes.encrypt(Mn(this,Ln,"f")),"f"),zu(this,qa,0,"f"),this.increment()),s[i]^=Mn(this,Ad,"f")[zu(this,qa,(n=Mn(this,qa,"f"),t=n++,n),"f"),t];return s}decrypt(e){return this.encrypt(e)}};_o.CTR=Ed;Ad=new WeakMap,qa=new WeakMap,Ln=new WeakMap});var Ck=M(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.ECB=void 0;var BD=$a(),vd=class extends BD.ModeOfOperation{constructor(e){super("ECB",e,vd)}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16)t.set(this.aes.encrypt(e.subarray(n,n+16)),n);return t}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16)t.set(this.aes.decrypt(e.subarray(n,n+16)),n);return t}};Cm.ECB=vd});var Nk=M(Co=>{"use strict";var Ga=Co&&Co.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},Td=Co&&Co.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Pd,Vu,za;Object.defineProperty(Co,"__esModule",{value:!0});Co.OFB=void 0;var SD=$a(),kd=class extends SD.ModeOfOperation{constructor(e,t){if(super("OFB",e,kd),Pd.set(this,void 0),Vu.set(this,void 0),za.set(this,void 0),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");Ga(this,Pd,new Uint8Array(t),"f")}else Ga(this,Pd,new Uint8Array(16),"f");Ga(this,Vu,this.iv,"f"),Ga(this,za,16,"f")}get iv(){return new Uint8Array(Td(this,Pd,"f"))}encrypt(e){var t,n;if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");let s=new Uint8Array(e);for(let i=0;i<s.length;i++)Td(this,za,"f")===16&&(Ga(this,Vu,this.aes.encrypt(Td(this,Vu,"f")),"f"),Ga(this,za,0,"f")),s[i]^=Td(this,Vu,"f")[Ga(this,za,(n=Td(this,za,"f"),t=n++,n),"f"),t];return s}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");return this.encrypt(e)}};Co.OFB=kd;Pd=new WeakMap,Vu=new WeakMap,za=new WeakMap});var Ik=M(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});Ku.pkcs7Strip=Ku.pkcs7Pad=void 0;function OD(r){let e=16-r.length%16,t=new Uint8Array(r.length+e);t.set(r);for(let n=r.length;n<t.length;n++)t[n]=e;return t}Ku.pkcs7Pad=OD;function _D(r){if(r.length<16)throw new TypeError("PKCS#7 invalid length");let e=r[r.length-1];if(e>16)throw new TypeError("PKCS#7 padding byte out of range");let t=r.length-e;for(let n=0;n<e;n++)if(r[t+n]!==e)throw new TypeError("PKCS#7 invalid padding byte");return new Uint8Array(r.subarray(0,t))}Ku.pkcs7Strip=_D});var b2=M(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.pkcs7Strip=zt.pkcs7Pad=zt.OFB=zt.ECB=zt.CTR=zt.CFB=zt.CBC=zt.ModeOfOperation=zt.AES=void 0;var CD=d2();Object.defineProperty(zt,"AES",{enumerable:!0,get:function(){return CD.AES}});var ND=$a();Object.defineProperty(zt,"ModeOfOperation",{enumerable:!0,get:function(){return ND.ModeOfOperation}});var ID=Sk();Object.defineProperty(zt,"CBC",{enumerable:!0,get:function(){return ID.CBC}});var RD=Ok();Object.defineProperty(zt,"CFB",{enumerable:!0,get:function(){return RD.CFB}});var MD=_k();Object.defineProperty(zt,"CTR",{enumerable:!0,get:function(){return MD.CTR}});var LD=Ck();Object.defineProperty(zt,"ECB",{enumerable:!0,get:function(){return LD.ECB}});var jD=Nk();Object.defineProperty(zt,"OFB",{enumerable:!0,get:function(){return jD.OFB}});var Rk=Ik();Object.defineProperty(zt,"pkcs7Pad",{enumerable:!0,get:function(){return Rk.pkcs7Pad}});Object.defineProperty(zt,"pkcs7Strip",{enumerable:!0,get:function(){return Rk.pkcs7Strip}})});var g2=M(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.spelunk=qs.getPassword=qs.zpad=qs.looseArrayify=void 0;var Wu=me();function Mk(r){return typeof r=="string"&&!r.startsWith("0x")&&(r="0x"+r),(0,Wu.getBytesCopy)(r)}qs.looseArrayify=Mk;function UD(r,e){for(r=String(r);r.length<e;)r="0"+r;return r}qs.zpad=UD;function FD(r){return typeof r=="string"?(0,Wu.toUtf8Bytes)(r,"NFKC"):(0,Wu.getBytesCopy)(r)}qs.getPassword=FD;function DD(r,e){let t=e.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);(0,Wu.assertArgument)(t!=null,"invalid path","path",e);let n=t[1],s=t[3],i=t[4]==="!",o=r;for(let a of n.toLowerCase().split(".")){if(Array.isArray(o)){if(!a.match(/^[0-9]+$/))break;o=o[parseInt(a)]}else if(typeof o=="object"){let c=null;for(let u in o)if(u.toLowerCase()===a){c=o[u];break}o=c}else o=null;if(o==null)break}if((0,Wu.assertArgument)(!i||o!=null,"missing required value","path",n),s&&o!=null){if(s==="int"){if(typeof o=="string"&&o.match(/^-?[0-9]+$/))return parseInt(o);if(Number.isSafeInteger(o))return o}if(s==="number"&&typeof o=="string"&&o.match(/^-?[0-9.]*$/))return parseFloat(o);if(s==="data"&&typeof o=="string")return Mk(o);if(s==="array"&&Array.isArray(o)||s===typeof o)return o;(0,Wu.assertArgument)(!1,`wrong type found for ${s} `,"path",n)}return o}qs.spelunk=DD});var Rm=M(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.encryptKeystoreJson=jn.encryptKeystoreJsonSync=jn.decryptKeystoreJson=jn.decryptKeystoreJsonSync=jn.isKeystoreJson=void 0;var Nm=b2(),HD=Yt(),Un=nr(),$D=qr(),$e=me(),ot=g2(),qD=S0(),jk="m/44'/60'/0'/0/0";function GD(r){try{let e=JSON.parse(r);if((e.version!=null?parseInt(e.version):0)===3)return!0}catch{}return!1}jn.isKeystoreJson=GD;function zD(r,e,t){if((0,ot.spelunk)(r,"crypto.cipher:string")==="aes-128-ctr"){let s=(0,ot.spelunk)(r,"crypto.cipherparams.iv:data!"),i=new Nm.CTR(e,s);return(0,$e.hexlify)(i.decrypt(t))}(0,$e.assert)(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}function Im(r,e){let t=(0,$e.getBytes)(e),n=(0,ot.spelunk)(r,"crypto.ciphertext:data!"),s=(0,$e.hexlify)((0,Un.keccak256)((0,$e.concat)([t.slice(16,32),n]))).substring(2);(0,$e.assertArgument)(s===(0,ot.spelunk)(r,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");let i=zD(r,t.slice(0,16),n),o=(0,$D.computeAddress)(i);if(r.address){let u=r.address.toLowerCase();u.startsWith("0x")||(u="0x"+u),(0,$e.assertArgument)((0,HD.getAddress)(u)===o,"keystore address/privateKey mismatch","address",r.address)}let a={address:o,privateKey:i};if((0,ot.spelunk)(r,"x-ethers.version:string")==="0.1"){let u=t.slice(32,64),l=(0,ot.spelunk)(r,"x-ethers.mnemonicCiphertext:data!"),f=(0,ot.spelunk)(r,"x-ethers.mnemonicCounter:data!"),d=new Nm.CTR(u,f);a.mnemonic={path:(0,ot.spelunk)(r,"x-ethers.path:string")||jk,locale:(0,ot.spelunk)(r,"x-ethers.locale:string")||"en",entropy:(0,$e.hexlify)((0,$e.getBytes)(d.decrypt(l)))}}return a}function Uk(r){let e=(0,ot.spelunk)(r,"crypto.kdf:string");if(e&&typeof e=="string"){if(e.toLowerCase()==="scrypt"){let t=(0,ot.spelunk)(r,"crypto.kdfparams.salt:data!"),n=(0,ot.spelunk)(r,"crypto.kdfparams.n:int!"),s=(0,ot.spelunk)(r,"crypto.kdfparams.r:int!"),i=(0,ot.spelunk)(r,"crypto.kdfparams.p:int!");(0,$e.assertArgument)(n>0&&(n&n-1)===0,"invalid kdf.N","kdf.N",n),(0,$e.assertArgument)(s>0&&i>0,"invalid kdf","kdf",e);let o=(0,ot.spelunk)(r,"crypto.kdfparams.dklen:int!");return(0,$e.assertArgument)(o===32,"invalid kdf.dklen","kdf.dflen",o),{name:"scrypt",salt:t,N:n,r:s,p:i,dkLen:64}}else if(e.toLowerCase()==="pbkdf2"){let t=(0,ot.spelunk)(r,"crypto.kdfparams.salt:data!"),n=(0,ot.spelunk)(r,"crypto.kdfparams.prf:string!"),s=n.split("-").pop();(0,$e.assertArgument)(s==="sha256"||s==="sha512","invalid kdf.pdf","kdf.pdf",n);let i=(0,ot.spelunk)(r,"crypto.kdfparams.c:int!"),o=(0,ot.spelunk)(r,"crypto.kdfparams.dklen:int!");return(0,$e.assertArgument)(o===32,"invalid kdf.dklen","kdf.dklen",o),{name:"pbkdf2",salt:t,count:i,dkLen:o,algorithm:s}}}(0,$e.assertArgument)(!1,"unsupported key-derivation function","kdf",e)}function VD(r,e){let t=JSON.parse(r),n=(0,ot.getPassword)(e),s=Uk(t);if(s.name==="pbkdf2"){let{salt:f,count:d,dkLen:h,algorithm:b}=s,p=(0,Un.pbkdf2)(n,f,d,h,b);return Im(t,p)}(0,$e.assert)(s.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:s});let{salt:i,N:o,r:a,p:c,dkLen:u}=s,l=(0,Un.scryptSync)(n,i,o,a,c,u);return Im(t,l)}jn.decryptKeystoreJsonSync=VD;function Lk(r){return new Promise(e=>{setTimeout(()=>{e()},r)})}async function KD(r,e,t){let n=JSON.parse(r),s=(0,ot.getPassword)(e),i=Uk(n);if(i.name==="pbkdf2"){t&&(t(0),await Lk(0));let{salt:d,count:h,dkLen:b,algorithm:p}=i,g=(0,Un.pbkdf2)(s,d,h,b,p);return t&&(t(1),await Lk(0)),Im(n,g)}(0,$e.assert)(i.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:i});let{salt:o,N:a,r:c,p:u,dkLen:l}=i,f=await(0,Un.scrypt)(s,o,a,c,u,l,t);return Im(n,f)}jn.decryptKeystoreJson=KD;function Fk(r){let e=r.salt!=null?(0,$e.getBytes)(r.salt,"options.salt"):(0,Un.randomBytes)(32),t=1<<17,n=8,s=1;return r.scrypt&&(r.scrypt.N&&(t=r.scrypt.N),r.scrypt.r&&(n=r.scrypt.r),r.scrypt.p&&(s=r.scrypt.p)),(0,$e.assertArgument)(typeof t=="number"&&t>0&&Number.isSafeInteger(t)&&(BigInt(t)&BigInt(t-1))===BigInt(0),"invalid scrypt N parameter","options.N",t),(0,$e.assertArgument)(typeof n=="number"&&n>0&&Number.isSafeInteger(n),"invalid scrypt r parameter","options.r",n),(0,$e.assertArgument)(typeof s=="number"&&s>0&&Number.isSafeInteger(s),"invalid scrypt p parameter","options.p",s),{name:"scrypt",dkLen:32,salt:e,N:t,r:n,p:s}}function Dk(r,e,t,n){let s=(0,$e.getBytes)(t.privateKey,"privateKey"),i=n.iv!=null?(0,$e.getBytes)(n.iv,"options.iv"):(0,Un.randomBytes)(16);(0,$e.assertArgument)(i.length===16,"invalid options.iv length","options.iv",n.iv);let o=n.uuid!=null?(0,$e.getBytes)(n.uuid,"options.uuid"):(0,Un.randomBytes)(16);(0,$e.assertArgument)(o.length===16,"invalid options.uuid length","options.uuid",n.iv);let a=r.slice(0,16),c=r.slice(16,32),u=new Nm.CTR(a,i),l=(0,$e.getBytes)(u.encrypt(s)),f=(0,Un.keccak256)((0,$e.concat)([c,l])),d={address:t.address.substring(2).toLowerCase(),id:(0,$e.uuidV4)(o),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,$e.hexlify)(i).substring(2)},ciphertext:(0,$e.hexlify)(l).substring(2),kdf:"scrypt",kdfparams:{salt:(0,$e.hexlify)(e.salt).substring(2),n:e.N,dklen:32,p:e.p,r:e.r},mac:f.substring(2)}};if(t.mnemonic){let h=n.client!=null?n.client:`ethers/${qD.version}`,b=t.mnemonic.path||jk,p=t.mnemonic.locale||"en",g=r.slice(32,64),m=(0,$e.getBytes)(t.mnemonic.entropy,"account.mnemonic.entropy"),y=(0,Un.randomBytes)(16),E=new Nm.CTR(g,y),v=(0,$e.getBytes)(E.encrypt(m)),k=new Date,w=k.getUTCFullYear()+"-"+(0,ot.zpad)(k.getUTCMonth()+1,2)+"-"+(0,ot.zpad)(k.getUTCDate(),2)+"T"+(0,ot.zpad)(k.getUTCHours(),2)+"-"+(0,ot.zpad)(k.getUTCMinutes(),2)+"-"+(0,ot.zpad)(k.getUTCSeconds(),2)+".0Z",P="UTC--"+w+"--"+d.address;d["x-ethers"]={client:h,gethFilename:P,path:b,locale:p,mnemonicCounter:(0,$e.hexlify)(y).substring(2),mnemonicCiphertext:(0,$e.hexlify)(v).substring(2),version:"0.1"}}return JSON.stringify(d)}function WD(r,e,t){t==null&&(t={});let n=(0,ot.getPassword)(e),s=Fk(t),i=(0,Un.scryptSync)(n,s.salt,s.N,s.r,s.p,64);return Dk((0,$e.getBytes)(i),s,r,t)}jn.encryptKeystoreJsonSync=WD;async function JD(r,e,t){t==null&&(t={});let n=(0,ot.getPassword)(e),s=Fk(t),i=await(0,Un.scrypt)(n,s.salt,s.N,s.r,s.p,64,t.progressCallback);return Dk((0,$e.getBytes)(i),s,r,t)}jn.encryptKeystoreJson=JD});var w2=M(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.getIndexedAccountPath=Nr.getAccountPath=Nr.HDNodeVoidWallet=Nr.HDNodeWallet=Nr.defaultPath=void 0;var cn=nr(),QD=bm(),Gk=qr(),ve=me(),Hk=md(),YD=xm(),$k=Pm(),qk=Rm();Nr.defaultPath="m/44'/60'/0'/0/0";var ZD=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Vs=2147483648,XD=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),eH="0123456789abcdef";function Lm(r,e){let t="";for(;r;)t=eH[r%16]+t,r=Math.trunc(r/16);for(;t.length<e*2;)t="0"+t;return"0x"+t}function x2(r){let e=(0,ve.getBytes)(r),t=(0,ve.dataSlice)((0,cn.sha256)((0,cn.sha256)(e)),0,4),n=(0,ve.concat)([e,t]);return(0,ve.encodeBase58)(n)}var zs={};function zk(r,e,t,n){let s=new Uint8Array(37);r&Vs?((0,ve.assert)(n!=null,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),s.set((0,ve.getBytes)(n),1)):s.set((0,ve.getBytes)(t));for(let o=24;o>=0;o-=8)s[33+(o>>3)]=r>>24-o&255;let i=(0,ve.getBytes)((0,cn.computeHmac)("sha512",e,s));return{IL:i.slice(0,32),IR:i.slice(32)}}function Vk(r,e){let t=e.split("/");(0,ve.assertArgument)(t.length>0,"invalid path","path",e),t[0]==="m"&&((0,ve.assertArgument)(r.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${r.depth}`,"path",e),t.shift());let n=r;for(let s=0;s<t.length;s++){let i=t[s];if(i.match(/^[0-9]+'$/)){let o=parseInt(i.substring(0,i.length-1));(0,ve.assertArgument)(o<Vs,"invalid path index",`path[${s}]`,i),n=n.deriveChild(Vs+o)}else if(i.match(/^[0-9]+$/)){let o=parseInt(i);(0,ve.assertArgument)(o<Vs,"invalid path index",`path[${s}]`,i),n=n.deriveChild(o)}else(0,ve.assertArgument)(!1,"invalid path component",`path[${s}]`,i)}return n}var Sd,y2,Va,Bd,Gs=class extends YD.BaseWallet{constructor(t,n,s,i,o,a,c,u,l){super(n,l);vs(this,Sd);tn(this,"publicKey");tn(this,"fingerprint");tn(this,"parentFingerprint");tn(this,"mnemonic");tn(this,"chainCode");tn(this,"path");tn(this,"index");tn(this,"depth");(0,ve.assertPrivate)(t,zs,"HDNodeWallet"),(0,ve.defineProperties)(this,{publicKey:n.compressedPublicKey});let f=(0,ve.dataSlice)((0,cn.ripemd160)((0,cn.sha256)(this.publicKey)),0,4);(0,ve.defineProperties)(this,{parentFingerprint:s,fingerprint:f,chainCode:i,path:o,index:a,depth:c}),(0,ve.defineProperties)(this,{mnemonic:u})}connect(t){return new Gs(zs,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,t)}async encrypt(t,n){return await(0,qk.encryptKeystoreJson)(ur(this,Sd,y2).call(this),t,{progressCallback:n})}encryptSync(t){return(0,qk.encryptKeystoreJsonSync)(ur(this,Sd,y2).call(this),t)}get extendedKey(){return(0,ve.assert)(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),x2((0,ve.concat)(["0x0488ADE4",Lm(this.depth,1),this.parentFingerprint,Lm(this.index,4),this.chainCode,(0,ve.concat)(["0x00",this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new No(zs,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(t){let n=(0,ve.getNumber)(t,"index");(0,ve.assertArgument)(n<=4294967295,"invalid index","index",n);let s=this.path;s&&(s+="/"+(n&~Vs),n&Vs&&(s+="'"));let{IR:i,IL:o}=zk(n,this.chainCode,this.publicKey,this.privateKey),a=new cn.SigningKey((0,ve.toBeHex)(((0,ve.toBigInt)(o)+BigInt(this.privateKey))%XD,32));return new Gs(zs,a,this.fingerprint,(0,ve.hexlify)(i),s,n,this.depth+1,this.mnemonic,this.provider)}derivePath(t){return Vk(this,t)}static fromExtendedKey(t){let n=(0,ve.toBeArray)((0,ve.decodeBase58)(t));(0,ve.assertArgument)(n.length===82||x2(n.slice(0,78))===t,"invalid extended key","extendedKey","[ REDACTED ]");let s=n[4],i=(0,ve.hexlify)(n.slice(5,9)),o=parseInt((0,ve.hexlify)(n.slice(9,13)).substring(2),16),a=(0,ve.hexlify)(n.slice(13,45)),c=n.slice(45,78);switch((0,ve.hexlify)(n.slice(0,4))){case"0x0488b21e":case"0x043587cf":{let u=(0,ve.hexlify)(c);return new No(zs,(0,Gk.computeAddress)(u),u,i,a,null,o,s,null)}case"0x0488ade4":case"0x04358394 ":if(c[0]!==0)break;return new Gs(zs,new cn.SigningKey(c.slice(1)),i,a,null,o,s,null,null)}(0,ve.assertArgument)(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(t,n,s){var o;t==null&&(t=""),n==null&&(n=Nr.defaultPath),s==null&&(s=Hk.LangEn.wordlist());let i=$k.Mnemonic.fromEntropy((0,cn.randomBytes)(16),t,s);return ur(o=Gs,Va,Bd).call(o,i.computeSeed(),i).derivePath(n)}static fromMnemonic(t,n){var s;return n||(n=Nr.defaultPath),ur(s=Gs,Va,Bd).call(s,t.computeSeed(),t).derivePath(n)}static fromPhrase(t,n,s,i){var a;n==null&&(n=""),s==null&&(s=Nr.defaultPath),i==null&&(i=Hk.LangEn.wordlist());let o=$k.Mnemonic.fromPhrase(t,n,i);return ur(a=Gs,Va,Bd).call(a,o.computeSeed(),o).derivePath(s)}static fromSeed(t){var n;return ur(n=Gs,Va,Bd).call(n,t,null)}},Mm=Gs;Sd=new WeakSet,y2=function(){let t={address:this.address,privateKey:this.privateKey},n=this.mnemonic;return this.path&&n&&n.wordlist.locale==="en"&&n.password===""&&(t.mnemonic={path:this.path,locale:"en",entropy:n.entropy}),t},Va=new WeakSet,Bd=function(t,n){(0,ve.assertArgument)((0,ve.isBytesLike)(t),"invalid seed","seed","[REDACTED]");let s=(0,ve.getBytes)(t,"seed");(0,ve.assertArgument)(s.length>=16&&s.length<=64,"invalid seed","seed","[REDACTED]");let i=(0,ve.getBytes)((0,cn.computeHmac)("sha512",ZD,s)),o=new cn.SigningKey((0,ve.hexlify)(i.slice(0,32)));return new Gs(zs,o,"0x00000000",(0,ve.hexlify)(i.slice(32)),"m",0,0,n,null)},vs(Mm,Va);Nr.HDNodeWallet=Mm;var No=class extends QD.VoidSigner{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(e,t,n,s,i,o,a,c,u){super(t,u),(0,ve.assertPrivate)(e,zs,"HDNodeVoidWallet"),(0,ve.defineProperties)(this,{publicKey:n});let l=(0,ve.dataSlice)((0,cn.ripemd160)((0,cn.sha256)(n)),0,4);(0,ve.defineProperties)(this,{publicKey:n,fingerprint:l,parentFingerprint:s,chainCode:i,path:o,index:a,depth:c})}connect(e){return new No(zs,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,e)}get extendedKey(){return(0,ve.assert)(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),x2((0,ve.concat)(["0x0488B21E",Lm(this.depth,1),this.parentFingerprint,Lm(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(e){let t=(0,ve.getNumber)(e,"index");(0,ve.assertArgument)(t<=4294967295,"invalid index","index",t);let n=this.path;n&&(n+="/"+(t&~Vs),t&Vs&&(n+="'"));let{IR:s,IL:i}=zk(t,this.chainCode,this.publicKey,null),o=cn.SigningKey.addPoints(i,this.publicKey,!0),a=(0,Gk.computeAddress)(o);return new No(zs,a,o,this.fingerprint,(0,ve.hexlify)(s),n,t,this.depth+1,this.provider)}derivePath(e){return Vk(this,e)}};Nr.HDNodeVoidWallet=No;function tH(r){let e=(0,ve.getNumber)(r,"index");return(0,ve.assertArgument)(e>=0&&e<Vs,"invalid account index","index",e),`m/44'/60'/${e}'/0/0`}Nr.getAccountPath=tH;function rH(r){let e=(0,ve.getNumber)(r,"index");return(0,ve.assertArgument)(e>=0&&e<Vs,"invalid account index","index",e),`m/44'/60'/0'/0/${e}`}Nr.getIndexedAccountPath=rH});var E2=M(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.decryptCrowdsaleJson=Ju.isCrowdsaleJson=void 0;var Kk=b2(),nH=Yt(),sH=nr(),iH=Ls(),A2=me(),jm=g2();function oH(r){try{if(JSON.parse(r).encseed)return!0}catch{}return!1}Ju.isCrowdsaleJson=oH;function aH(r,e){let t=JSON.parse(r),n=(0,jm.getPassword)(e),s=(0,nH.getAddress)((0,jm.spelunk)(t,"ethaddr:string!")),i=(0,jm.looseArrayify)((0,jm.spelunk)(t,"encseed:string!"));(0,A2.assertArgument)(i&&i.length%16===0,"invalid encseed","json",r);let o=(0,A2.getBytes)((0,sH.pbkdf2)(n,n,2e3,32,"sha256")).slice(0,16),a=i.slice(0,16),c=i.slice(16),u=new Kk.CBC(o,a),l=(0,Kk.pkcs7Strip)((0,A2.getBytes)(u.decrypt(c))),f="";for(let d=0;d<l.length;d++)f+=String.fromCharCode(l[d]);return{address:s,privateKey:(0,iH.id)(f)}}Ju.decryptCrowdsaleJson=aH});var Jk=M(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});Dm.Wallet=void 0;var cH=nr(),v2=me(),uH=xm(),T2=w2(),Um=E2(),Qu=Rm(),lH=Pm();function Wk(r){return new Promise(e=>{setTimeout(()=>{e()},r)})}var Od,P2,Yu=class extends uH.BaseWallet{constructor(e,t){typeof e=="string"&&!e.startsWith("0x")&&(e="0x"+e);let n=typeof e=="string"?new cH.SigningKey(e):e;super(n,t)}connect(e){return new Yu(this.signingKey,e)}async encrypt(e,t){let n={address:this.address,privateKey:this.privateKey};return await(0,Qu.encryptKeystoreJson)(n,e,{progressCallback:t})}encryptSync(e){let t={address:this.address,privateKey:this.privateKey};return(0,Qu.encryptKeystoreJsonSync)(t,e)}static async fromEncryptedJson(e,t,n){var i;let s=null;return(0,Qu.isKeystoreJson)(e)?s=await(0,Qu.decryptKeystoreJson)(e,t,n):(0,Um.isCrowdsaleJson)(e)&&(n&&(n(0),await Wk(0)),s=(0,Um.decryptCrowdsaleJson)(e,t),n&&(n(1),await Wk(0))),ur(i=Yu,Od,P2).call(i,s)}static fromEncryptedJsonSync(e,t){var s;let n=null;return(0,Qu.isKeystoreJson)(e)?n=(0,Qu.decryptKeystoreJsonSync)(e,t):(0,Um.isCrowdsaleJson)(e)?n=(0,Um.decryptCrowdsaleJson)(e,t):(0,v2.assertArgument)(!1,"invalid JSON wallet","json","[ REDACTED ]"),ur(s=Yu,Od,P2).call(s,n)}static createRandom(e){let t=T2.HDNodeWallet.createRandom();return e?t.connect(e):t}static fromPhrase(e,t){let n=T2.HDNodeWallet.fromPhrase(e);return t?n.connect(t):n}},Fm=Yu;Od=new WeakSet,P2=function(e){if((0,v2.assertArgument)(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&e.mnemonic.locale==="en"){let n=lH.Mnemonic.fromEntropy(e.mnemonic.entropy),s=T2.HDNodeWallet.fromMnemonic(n,e.mnemonic.path);if(s.address===e.address&&s.privateKey===e.privateKey)return s;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}let t=new Yu(e.privateKey);return(0,v2.assertArgument)(t.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),t},vs(Fm,Od);Dm.Wallet=Fm});var Yk=M(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.Wallet=Xe.Mnemonic=Xe.encryptKeystoreJsonSync=Xe.encryptKeystoreJson=Xe.decryptKeystoreJson=Xe.decryptKeystoreJsonSync=Xe.isKeystoreJson=Xe.decryptCrowdsaleJson=Xe.isCrowdsaleJson=Xe.HDNodeVoidWallet=Xe.HDNodeWallet=Xe.getIndexedAccountPath=Xe.getAccountPath=Xe.defaultPath=Xe.BaseWallet=void 0;var fH=xm();Object.defineProperty(Xe,"BaseWallet",{enumerable:!0,get:function(){return fH.BaseWallet}});var _d=w2();Object.defineProperty(Xe,"defaultPath",{enumerable:!0,get:function(){return _d.defaultPath}});Object.defineProperty(Xe,"getAccountPath",{enumerable:!0,get:function(){return _d.getAccountPath}});Object.defineProperty(Xe,"getIndexedAccountPath",{enumerable:!0,get:function(){return _d.getIndexedAccountPath}});Object.defineProperty(Xe,"HDNodeWallet",{enumerable:!0,get:function(){return _d.HDNodeWallet}});Object.defineProperty(Xe,"HDNodeVoidWallet",{enumerable:!0,get:function(){return _d.HDNodeVoidWallet}});var Qk=E2();Object.defineProperty(Xe,"isCrowdsaleJson",{enumerable:!0,get:function(){return Qk.isCrowdsaleJson}});Object.defineProperty(Xe,"decryptCrowdsaleJson",{enumerable:!0,get:function(){return Qk.decryptCrowdsaleJson}});var Cd=Rm();Object.defineProperty(Xe,"isKeystoreJson",{enumerable:!0,get:function(){return Cd.isKeystoreJson}});Object.defineProperty(Xe,"decryptKeystoreJsonSync",{enumerable:!0,get:function(){return Cd.decryptKeystoreJsonSync}});Object.defineProperty(Xe,"decryptKeystoreJson",{enumerable:!0,get:function(){return Cd.decryptKeystoreJson}});Object.defineProperty(Xe,"encryptKeystoreJson",{enumerable:!0,get:function(){return Cd.encryptKeystoreJson}});Object.defineProperty(Xe,"encryptKeystoreJsonSync",{enumerable:!0,get:function(){return Cd.encryptKeystoreJsonSync}});var dH=Pm();Object.defineProperty(Xe,"Mnemonic",{enumerable:!0,get:function(){return dH.Mnemonic}});var pH=Jk();Object.defineProperty(Xe,"Wallet",{enumerable:!0,get:function(){return pH.Wallet}})});var Zk=M(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});Hm.decodeBits=void 0;var hH=")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";function mH(r,e){let t=(1<<r)-1,n=[],s=0,i=0,o=0;for(let a=0;a<e.length;a++)for(s=s<<6|hH.indexOf(e[a]),i+=6;i>=r;){let c=s>>i-r;s&=(1<<i-r)-1,i-=r,c===0?o+=t:(n.push(c+o),o=0)}return n}Hm.decodeBits=mH});var Xk=M($m=>{"use strict";Object.defineProperty($m,"__esModule",{value:!0});$m.decodeOwlA=void 0;var bH=me(),gH=Zk(),xH=e2();function yH(r,e){let t=(0,xH.decodeOwl)(r).join(",");return e.split(/,/g).forEach(n=>{let s=n.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);(0,bH.assertArgument)(s!==null,"internal error parsing accents","accents",e);let i=0,o=(0,gH.decodeBits)(parseInt(s[3]),s[4]),a=parseInt(s[2]),c=new RegExp(`([${s[1]}])`,"g");t=t.replace(c,(u,l)=>(--o[i]===0&&(l=String.fromCharCode(l.charCodeAt(0),a),i++),l))}),t.split(",")}$m.decodeOwlA=yH});var eB=M(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});qm.WordlistOwlA=void 0;var wH=Em(),AH=Xk(),k2=class extends wH.WordlistOwl{#e;constructor(e,t,n,s){super(e,t,s),this.#e=n}get _accent(){return this.#e}_decodeWords(){return(0,AH.decodeOwlA)(this._data,this._accent)}};qm.WordlistOwlA=k2});var tB=M(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});Gm.wordlists=void 0;var EH=md();Gm.wordlists={en:EH.LangEn.wordlist()}});var rB=M(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.wordlists=Fn.WordlistOwlA=Fn.WordlistOwl=Fn.LangEn=Fn.Wordlist=void 0;var vH=r2();Object.defineProperty(Fn,"Wordlist",{enumerable:!0,get:function(){return vH.Wordlist}});var TH=md();Object.defineProperty(Fn,"LangEn",{enumerable:!0,get:function(){return TH.LangEn}});var PH=Em();Object.defineProperty(Fn,"WordlistOwl",{enumerable:!0,get:function(){return PH.WordlistOwl}});var kH=eB();Object.defineProperty(Fn,"WordlistOwlA",{enumerable:!0,get:function(){return kH.WordlistOwlA}});var BH=tB();Object.defineProperty(Fn,"wordlists",{enumerable:!0,get:function(){return BH.wordlists}})});var B2=M(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.ripemd160=x.keccak256=x.randomBytes=x.computeHmac=x.UndecodedEventLog=x.EventLog=x.ContractUnknownEventPayload=x.ContractTransactionResponse=x.ContractTransactionReceipt=x.ContractEventPayload=x.ContractFactory=x.Contract=x.BaseContract=x.MessagePrefix=x.EtherSymbol=x.ZeroHash=x.N=x.MaxInt256=x.MinInt256=x.MaxUint256=x.WeiPerEther=x.ZeroAddress=x.resolveAddress=x.isAddress=x.isAddressable=x.getCreate2Address=x.getCreateAddress=x.getIcapAddress=x.getAddress=x.Typed=x.TransactionDescription=x.Result=x.LogDescription=x.Interface=x.Indexed=x.ErrorDescription=x.checkResultErrors=x.StructFragment=x.ParamType=x.NamedFragment=x.FunctionFragment=x.FallbackFragment=x.Fragment=x.EventFragment=x.ErrorFragment=x.ConstructorFragment=x.AbiCoder=x.encodeBytes32String=x.decodeBytes32String=x.version=void 0;x.EnsPlugin=x.Network=x.EnsResolver=x.WebSocketProvider=x.SocketProvider=x.IpcSocketProvider=x.QuickNodeProvider=x.PocketProvider=x.InfuraWebSocketProvider=x.InfuraProvider=x.EtherscanProvider=x.CloudflareProvider=x.ChainstackProvider=x.AnkrProvider=x.AlchemyProvider=x.BrowserProvider=x.JsonRpcSigner=x.JsonRpcProvider=x.JsonRpcApiProvider=x.FallbackProvider=x.AbstractProvider=x.VoidSigner=x.NonceManager=x.AbstractSigner=x.TransactionResponse=x.TransactionReceipt=x.Log=x.FeeData=x.Block=x.getDefaultProvider=x.verifyTypedData=x.TypedDataEncoder=x.solidityPackedSha256=x.solidityPackedKeccak256=x.solidityPacked=x.verifyMessage=x.hashMessage=x.dnsEncode=x.namehash=x.isValidName=x.ensNormalize=x.id=x.SigningKey=x.Signature=x.lock=x.scryptSync=x.scrypt=x.pbkdf2=x.sha512=x.sha256=void 0;x.getUint=x.getNumber=x.getBigInt=x.FixedNumber=x.FetchCancelSignal=x.FetchResponse=x.FetchRequest=x.EventPayload=x.isError=x.isCallException=x.makeError=x.assertPrivate=x.assertNormalize=x.assertArgumentCount=x.assertArgument=x.assert=x.resolveProperties=x.defineProperties=x.zeroPadValue=x.zeroPadBytes=x.stripZerosLeft=x.isBytesLike=x.isHexString=x.hexlify=x.getBytesCopy=x.getBytes=x.dataSlice=x.dataLength=x.concat=x.encodeBase64=x.decodeBase64=x.encodeBase58=x.decodeBase58=x.Transaction=x.recoverAddress=x.computeAddress=x.accessListify=x.showThrottleMessage=x.copyRequest=x.UnmanagedSubscriber=x.SocketSubscriber=x.SocketPendingSubscriber=x.SocketEventSubscriber=x.SocketBlockSubscriber=x.MulticoinProviderPlugin=x.NetworkPlugin=x.GasCostPlugin=x.FetchUrlFeeDataNetworkPlugin=x.FeeDataNetworkPlugin=x.EtherscanPlugin=void 0;x.wordlists=x.WordlistOwlA=x.WordlistOwl=x.LangEn=x.Wordlist=x.encryptKeystoreJsonSync=x.encryptKeystoreJson=x.decryptKeystoreJson=x.decryptKeystoreJsonSync=x.decryptCrowdsaleJson=x.isKeystoreJson=x.isCrowdsaleJson=x.getIndexedAccountPath=x.getAccountPath=x.defaultPath=x.Wallet=x.HDNodeVoidWallet=x.HDNodeWallet=x.BaseWallet=x.Mnemonic=x.uuidV4=x.encodeRlp=x.decodeRlp=x.Utf8ErrorFuncs=x.toUtf8String=x.toUtf8CodePoints=x.toUtf8Bytes=x.parseUnits=x.formatUnits=x.parseEther=x.formatEther=x.mask=x.toTwos=x.fromTwos=x.toQuantity=x.toNumber=x.toBeHex=x.toBigInt=x.toBeArray=void 0;var SH=S0();Object.defineProperty(x,"version",{enumerable:!0,get:function(){return SH.version}});var Vt=bu();Object.defineProperty(x,"decodeBytes32String",{enumerable:!0,get:function(){return Vt.decodeBytes32String}});Object.defineProperty(x,"encodeBytes32String",{enumerable:!0,get:function(){return Vt.encodeBytes32String}});Object.defineProperty(x,"AbiCoder",{enumerable:!0,get:function(){return Vt.AbiCoder}});Object.defineProperty(x,"ConstructorFragment",{enumerable:!0,get:function(){return Vt.ConstructorFragment}});Object.defineProperty(x,"ErrorFragment",{enumerable:!0,get:function(){return Vt.ErrorFragment}});Object.defineProperty(x,"EventFragment",{enumerable:!0,get:function(){return Vt.EventFragment}});Object.defineProperty(x,"Fragment",{enumerable:!0,get:function(){return Vt.Fragment}});Object.defineProperty(x,"FallbackFragment",{enumerable:!0,get:function(){return Vt.FallbackFragment}});Object.defineProperty(x,"FunctionFragment",{enumerable:!0,get:function(){return Vt.FunctionFragment}});Object.defineProperty(x,"NamedFragment",{enumerable:!0,get:function(){return Vt.NamedFragment}});Object.defineProperty(x,"ParamType",{enumerable:!0,get:function(){return Vt.ParamType}});Object.defineProperty(x,"StructFragment",{enumerable:!0,get:function(){return Vt.StructFragment}});Object.defineProperty(x,"checkResultErrors",{enumerable:!0,get:function(){return Vt.checkResultErrors}});Object.defineProperty(x,"ErrorDescription",{enumerable:!0,get:function(){return Vt.ErrorDescription}});Object.defineProperty(x,"Indexed",{enumerable:!0,get:function(){return Vt.Indexed}});Object.defineProperty(x,"Interface",{enumerable:!0,get:function(){return Vt.Interface}});Object.defineProperty(x,"LogDescription",{enumerable:!0,get:function(){return Vt.LogDescription}});Object.defineProperty(x,"Result",{enumerable:!0,get:function(){return Vt.Result}});Object.defineProperty(x,"TransactionDescription",{enumerable:!0,get:function(){return Vt.TransactionDescription}});Object.defineProperty(x,"Typed",{enumerable:!0,get:function(){return Vt.Typed}});var Ka=Yt();Object.defineProperty(x,"getAddress",{enumerable:!0,get:function(){return Ka.getAddress}});Object.defineProperty(x,"getIcapAddress",{enumerable:!0,get:function(){return Ka.getIcapAddress}});Object.defineProperty(x,"getCreateAddress",{enumerable:!0,get:function(){return Ka.getCreateAddress}});Object.defineProperty(x,"getCreate2Address",{enumerable:!0,get:function(){return Ka.getCreate2Address}});Object.defineProperty(x,"isAddressable",{enumerable:!0,get:function(){return Ka.isAddressable}});Object.defineProperty(x,"isAddress",{enumerable:!0,get:function(){return Ka.isAddress}});Object.defineProperty(x,"resolveAddress",{enumerable:!0,get:function(){return Ka.resolveAddress}});var Bi=Xc();Object.defineProperty(x,"ZeroAddress",{enumerable:!0,get:function(){return Bi.ZeroAddress}});Object.defineProperty(x,"WeiPerEther",{enumerable:!0,get:function(){return Bi.WeiPerEther}});Object.defineProperty(x,"MaxUint256",{enumerable:!0,get:function(){return Bi.MaxUint256}});Object.defineProperty(x,"MinInt256",{enumerable:!0,get:function(){return Bi.MinInt256}});Object.defineProperty(x,"MaxInt256",{enumerable:!0,get:function(){return Bi.MaxInt256}});Object.defineProperty(x,"N",{enumerable:!0,get:function(){return Bi.N}});Object.defineProperty(x,"ZeroHash",{enumerable:!0,get:function(){return Bi.ZeroHash}});Object.defineProperty(x,"EtherSymbol",{enumerable:!0,get:function(){return Bi.EtherSymbol}});Object.defineProperty(x,"MessagePrefix",{enumerable:!0,get:function(){return Bi.MessagePrefix}});var Si=Wf();Object.defineProperty(x,"BaseContract",{enumerable:!0,get:function(){return Si.BaseContract}});Object.defineProperty(x,"Contract",{enumerable:!0,get:function(){return Si.Contract}});Object.defineProperty(x,"ContractFactory",{enumerable:!0,get:function(){return Si.ContractFactory}});Object.defineProperty(x,"ContractEventPayload",{enumerable:!0,get:function(){return Si.ContractEventPayload}});Object.defineProperty(x,"ContractTransactionReceipt",{enumerable:!0,get:function(){return Si.ContractTransactionReceipt}});Object.defineProperty(x,"ContractTransactionResponse",{enumerable:!0,get:function(){return Si.ContractTransactionResponse}});Object.defineProperty(x,"ContractUnknownEventPayload",{enumerable:!0,get:function(){return Si.ContractUnknownEventPayload}});Object.defineProperty(x,"EventLog",{enumerable:!0,get:function(){return Si.EventLog}});Object.defineProperty(x,"UndecodedEventLog",{enumerable:!0,get:function(){return Si.UndecodedEventLog}});var Dn=nr();Object.defineProperty(x,"computeHmac",{enumerable:!0,get:function(){return Dn.computeHmac}});Object.defineProperty(x,"randomBytes",{enumerable:!0,get:function(){return Dn.randomBytes}});Object.defineProperty(x,"keccak256",{enumerable:!0,get:function(){return Dn.keccak256}});Object.defineProperty(x,"ripemd160",{enumerable:!0,get:function(){return Dn.ripemd160}});Object.defineProperty(x,"sha256",{enumerable:!0,get:function(){return Dn.sha256}});Object.defineProperty(x,"sha512",{enumerable:!0,get:function(){return Dn.sha512}});Object.defineProperty(x,"pbkdf2",{enumerable:!0,get:function(){return Dn.pbkdf2}});Object.defineProperty(x,"scrypt",{enumerable:!0,get:function(){return Dn.scrypt}});Object.defineProperty(x,"scryptSync",{enumerable:!0,get:function(){return Dn.scryptSync}});Object.defineProperty(x,"lock",{enumerable:!0,get:function(){return Dn.lock}});Object.defineProperty(x,"Signature",{enumerable:!0,get:function(){return Dn.Signature}});Object.defineProperty(x,"SigningKey",{enumerable:!0,get:function(){return Dn.SigningKey}});var Hn=Ls();Object.defineProperty(x,"id",{enumerable:!0,get:function(){return Hn.id}});Object.defineProperty(x,"ensNormalize",{enumerable:!0,get:function(){return Hn.ensNormalize}});Object.defineProperty(x,"isValidName",{enumerable:!0,get:function(){return Hn.isValidName}});Object.defineProperty(x,"namehash",{enumerable:!0,get:function(){return Hn.namehash}});Object.defineProperty(x,"dnsEncode",{enumerable:!0,get:function(){return Hn.dnsEncode}});Object.defineProperty(x,"hashMessage",{enumerable:!0,get:function(){return Hn.hashMessage}});Object.defineProperty(x,"verifyMessage",{enumerable:!0,get:function(){return Hn.verifyMessage}});Object.defineProperty(x,"solidityPacked",{enumerable:!0,get:function(){return Hn.solidityPacked}});Object.defineProperty(x,"solidityPackedKeccak256",{enumerable:!0,get:function(){return Hn.solidityPackedKeccak256}});Object.defineProperty(x,"solidityPackedSha256",{enumerable:!0,get:function(){return Hn.solidityPackedSha256}});Object.defineProperty(x,"TypedDataEncoder",{enumerable:!0,get:function(){return Hn.TypedDataEncoder}});Object.defineProperty(x,"verifyTypedData",{enumerable:!0,get:function(){return Hn.verifyTypedData}});var Re=bm();Object.defineProperty(x,"getDefaultProvider",{enumerable:!0,get:function(){return Re.getDefaultProvider}});Object.defineProperty(x,"Block",{enumerable:!0,get:function(){return Re.Block}});Object.defineProperty(x,"FeeData",{enumerable:!0,get:function(){return Re.FeeData}});Object.defineProperty(x,"Log",{enumerable:!0,get:function(){return Re.Log}});Object.defineProperty(x,"TransactionReceipt",{enumerable:!0,get:function(){return Re.TransactionReceipt}});Object.defineProperty(x,"TransactionResponse",{enumerable:!0,get:function(){return Re.TransactionResponse}});Object.defineProperty(x,"AbstractSigner",{enumerable:!0,get:function(){return Re.AbstractSigner}});Object.defineProperty(x,"NonceManager",{enumerable:!0,get:function(){return Re.NonceManager}});Object.defineProperty(x,"VoidSigner",{enumerable:!0,get:function(){return Re.VoidSigner}});Object.defineProperty(x,"AbstractProvider",{enumerable:!0,get:function(){return Re.AbstractProvider}});Object.defineProperty(x,"FallbackProvider",{enumerable:!0,get:function(){return Re.FallbackProvider}});Object.defineProperty(x,"JsonRpcApiProvider",{enumerable:!0,get:function(){return Re.JsonRpcApiProvider}});Object.defineProperty(x,"JsonRpcProvider",{enumerable:!0,get:function(){return Re.JsonRpcProvider}});Object.defineProperty(x,"JsonRpcSigner",{enumerable:!0,get:function(){return Re.JsonRpcSigner}});Object.defineProperty(x,"BrowserProvider",{enumerable:!0,get:function(){return Re.BrowserProvider}});Object.defineProperty(x,"AlchemyProvider",{enumerable:!0,get:function(){return Re.AlchemyProvider}});Object.defineProperty(x,"AnkrProvider",{enumerable:!0,get:function(){return Re.AnkrProvider}});Object.defineProperty(x,"ChainstackProvider",{enumerable:!0,get:function(){return Re.ChainstackProvider}});Object.defineProperty(x,"CloudflareProvider",{enumerable:!0,get:function(){return Re.CloudflareProvider}});Object.defineProperty(x,"EtherscanProvider",{enumerable:!0,get:function(){return Re.EtherscanProvider}});Object.defineProperty(x,"InfuraProvider",{enumerable:!0,get:function(){return Re.InfuraProvider}});Object.defineProperty(x,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return Re.InfuraWebSocketProvider}});Object.defineProperty(x,"PocketProvider",{enumerable:!0,get:function(){return Re.PocketProvider}});Object.defineProperty(x,"QuickNodeProvider",{enumerable:!0,get:function(){return Re.QuickNodeProvider}});Object.defineProperty(x,"IpcSocketProvider",{enumerable:!0,get:function(){return Re.IpcSocketProvider}});Object.defineProperty(x,"SocketProvider",{enumerable:!0,get:function(){return Re.SocketProvider}});Object.defineProperty(x,"WebSocketProvider",{enumerable:!0,get:function(){return Re.WebSocketProvider}});Object.defineProperty(x,"EnsResolver",{enumerable:!0,get:function(){return Re.EnsResolver}});Object.defineProperty(x,"Network",{enumerable:!0,get:function(){return Re.Network}});Object.defineProperty(x,"EnsPlugin",{enumerable:!0,get:function(){return Re.EnsPlugin}});Object.defineProperty(x,"EtherscanPlugin",{enumerable:!0,get:function(){return Re.EtherscanPlugin}});Object.defineProperty(x,"FeeDataNetworkPlugin",{enumerable:!0,get:function(){return Re.FeeDataNetworkPlugin}});Object.defineProperty(x,"FetchUrlFeeDataNetworkPlugin",{enumerable:!0,get:function(){return Re.FetchUrlFeeDataNetworkPlugin}});Object.defineProperty(x,"GasCostPlugin",{enumerable:!0,get:function(){return Re.GasCostPlugin}});Object.defineProperty(x,"NetworkPlugin",{enumerable:!0,get:function(){return Re.NetworkPlugin}});Object.defineProperty(x,"MulticoinProviderPlugin",{enumerable:!0,get:function(){return Re.MulticoinProviderPlugin}});Object.defineProperty(x,"SocketBlockSubscriber",{enumerable:!0,get:function(){return Re.SocketBlockSubscriber}});Object.defineProperty(x,"SocketEventSubscriber",{enumerable:!0,get:function(){return Re.SocketEventSubscriber}});Object.defineProperty(x,"SocketPendingSubscriber",{enumerable:!0,get:function(){return Re.SocketPendingSubscriber}});Object.defineProperty(x,"SocketSubscriber",{enumerable:!0,get:function(){return Re.SocketSubscriber}});Object.defineProperty(x,"UnmanagedSubscriber",{enumerable:!0,get:function(){return Re.UnmanagedSubscriber}});Object.defineProperty(x,"copyRequest",{enumerable:!0,get:function(){return Re.copyRequest}});Object.defineProperty(x,"showThrottleMessage",{enumerable:!0,get:function(){return Re.showThrottleMessage}});var zm=qr();Object.defineProperty(x,"accessListify",{enumerable:!0,get:function(){return zm.accessListify}});Object.defineProperty(x,"computeAddress",{enumerable:!0,get:function(){return zm.computeAddress}});Object.defineProperty(x,"recoverAddress",{enumerable:!0,get:function(){return zm.recoverAddress}});Object.defineProperty(x,"Transaction",{enumerable:!0,get:function(){return zm.Transaction}});var ke=me();Object.defineProperty(x,"decodeBase58",{enumerable:!0,get:function(){return ke.decodeBase58}});Object.defineProperty(x,"encodeBase58",{enumerable:!0,get:function(){return ke.encodeBase58}});Object.defineProperty(x,"decodeBase64",{enumerable:!0,get:function(){return ke.decodeBase64}});Object.defineProperty(x,"encodeBase64",{enumerable:!0,get:function(){return ke.encodeBase64}});Object.defineProperty(x,"concat",{enumerable:!0,get:function(){return ke.concat}});Object.defineProperty(x,"dataLength",{enumerable:!0,get:function(){return ke.dataLength}});Object.defineProperty(x,"dataSlice",{enumerable:!0,get:function(){return ke.dataSlice}});Object.defineProperty(x,"getBytes",{enumerable:!0,get:function(){return ke.getBytes}});Object.defineProperty(x,"getBytesCopy",{enumerable:!0,get:function(){return ke.getBytesCopy}});Object.defineProperty(x,"hexlify",{enumerable:!0,get:function(){return ke.hexlify}});Object.defineProperty(x,"isHexString",{enumerable:!0,get:function(){return ke.isHexString}});Object.defineProperty(x,"isBytesLike",{enumerable:!0,get:function(){return ke.isBytesLike}});Object.defineProperty(x,"stripZerosLeft",{enumerable:!0,get:function(){return ke.stripZerosLeft}});Object.defineProperty(x,"zeroPadBytes",{enumerable:!0,get:function(){return ke.zeroPadBytes}});Object.defineProperty(x,"zeroPadValue",{enumerable:!0,get:function(){return ke.zeroPadValue}});Object.defineProperty(x,"defineProperties",{enumerable:!0,get:function(){return ke.defineProperties}});Object.defineProperty(x,"resolveProperties",{enumerable:!0,get:function(){return ke.resolveProperties}});Object.defineProperty(x,"assert",{enumerable:!0,get:function(){return ke.assert}});Object.defineProperty(x,"assertArgument",{enumerable:!0,get:function(){return ke.assertArgument}});Object.defineProperty(x,"assertArgumentCount",{enumerable:!0,get:function(){return ke.assertArgumentCount}});Object.defineProperty(x,"assertNormalize",{enumerable:!0,get:function(){return ke.assertNormalize}});Object.defineProperty(x,"assertPrivate",{enumerable:!0,get:function(){return ke.assertPrivate}});Object.defineProperty(x,"makeError",{enumerable:!0,get:function(){return ke.makeError}});Object.defineProperty(x,"isCallException",{enumerable:!0,get:function(){return ke.isCallException}});Object.defineProperty(x,"isError",{enumerable:!0,get:function(){return ke.isError}});Object.defineProperty(x,"EventPayload",{enumerable:!0,get:function(){return ke.EventPayload}});Object.defineProperty(x,"FetchRequest",{enumerable:!0,get:function(){return ke.FetchRequest}});Object.defineProperty(x,"FetchResponse",{enumerable:!0,get:function(){return ke.FetchResponse}});Object.defineProperty(x,"FetchCancelSignal",{enumerable:!0,get:function(){return ke.FetchCancelSignal}});Object.defineProperty(x,"FixedNumber",{enumerable:!0,get:function(){return ke.FixedNumber}});Object.defineProperty(x,"getBigInt",{enumerable:!0,get:function(){return ke.getBigInt}});Object.defineProperty(x,"getNumber",{enumerable:!0,get:function(){return ke.getNumber}});Object.defineProperty(x,"getUint",{enumerable:!0,get:function(){return ke.getUint}});Object.defineProperty(x,"toBeArray",{enumerable:!0,get:function(){return ke.toBeArray}});Object.defineProperty(x,"toBigInt",{enumerable:!0,get:function(){return ke.toBigInt}});Object.defineProperty(x,"toBeHex",{enumerable:!0,get:function(){return ke.toBeHex}});Object.defineProperty(x,"toNumber",{enumerable:!0,get:function(){return ke.toNumber}});Object.defineProperty(x,"toQuantity",{enumerable:!0,get:function(){return ke.toQuantity}});Object.defineProperty(x,"fromTwos",{enumerable:!0,get:function(){return ke.fromTwos}});Object.defineProperty(x,"toTwos",{enumerable:!0,get:function(){return ke.toTwos}});Object.defineProperty(x,"mask",{enumerable:!0,get:function(){return ke.mask}});Object.defineProperty(x,"formatEther",{enumerable:!0,get:function(){return ke.formatEther}});Object.defineProperty(x,"parseEther",{enumerable:!0,get:function(){return ke.parseEther}});Object.defineProperty(x,"formatUnits",{enumerable:!0,get:function(){return ke.formatUnits}});Object.defineProperty(x,"parseUnits",{enumerable:!0,get:function(){return ke.parseUnits}});Object.defineProperty(x,"toUtf8Bytes",{enumerable:!0,get:function(){return ke.toUtf8Bytes}});Object.defineProperty(x,"toUtf8CodePoints",{enumerable:!0,get:function(){return ke.toUtf8CodePoints}});Object.defineProperty(x,"toUtf8String",{enumerable:!0,get:function(){return ke.toUtf8String}});Object.defineProperty(x,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return ke.Utf8ErrorFuncs}});Object.defineProperty(x,"decodeRlp",{enumerable:!0,get:function(){return ke.decodeRlp}});Object.defineProperty(x,"encodeRlp",{enumerable:!0,get:function(){return ke.encodeRlp}});Object.defineProperty(x,"uuidV4",{enumerable:!0,get:function(){return ke.uuidV4}});var Ir=Yk();Object.defineProperty(x,"Mnemonic",{enumerable:!0,get:function(){return Ir.Mnemonic}});Object.defineProperty(x,"BaseWallet",{enumerable:!0,get:function(){return Ir.BaseWallet}});Object.defineProperty(x,"HDNodeWallet",{enumerable:!0,get:function(){return Ir.HDNodeWallet}});Object.defineProperty(x,"HDNodeVoidWallet",{enumerable:!0,get:function(){return Ir.HDNodeVoidWallet}});Object.defineProperty(x,"Wallet",{enumerable:!0,get:function(){return Ir.Wallet}});Object.defineProperty(x,"defaultPath",{enumerable:!0,get:function(){return Ir.defaultPath}});Object.defineProperty(x,"getAccountPath",{enumerable:!0,get:function(){return Ir.getAccountPath}});Object.defineProperty(x,"getIndexedAccountPath",{enumerable:!0,get:function(){return Ir.getIndexedAccountPath}});Object.defineProperty(x,"isCrowdsaleJson",{enumerable:!0,get:function(){return Ir.isCrowdsaleJson}});Object.defineProperty(x,"isKeystoreJson",{enumerable:!0,get:function(){return Ir.isKeystoreJson}});Object.defineProperty(x,"decryptCrowdsaleJson",{enumerable:!0,get:function(){return Ir.decryptCrowdsaleJson}});Object.defineProperty(x,"decryptKeystoreJsonSync",{enumerable:!0,get:function(){return Ir.decryptKeystoreJsonSync}});Object.defineProperty(x,"decryptKeystoreJson",{enumerable:!0,get:function(){return Ir.decryptKeystoreJson}});Object.defineProperty(x,"encryptKeystoreJson",{enumerable:!0,get:function(){return Ir.encryptKeystoreJson}});Object.defineProperty(x,"encryptKeystoreJsonSync",{enumerable:!0,get:function(){return Ir.encryptKeystoreJsonSync}});var Nd=rB();Object.defineProperty(x,"Wordlist",{enumerable:!0,get:function(){return Nd.Wordlist}});Object.defineProperty(x,"LangEn",{enumerable:!0,get:function(){return Nd.LangEn}});Object.defineProperty(x,"WordlistOwl",{enumerable:!0,get:function(){return Nd.WordlistOwl}});Object.defineProperty(x,"WordlistOwlA",{enumerable:!0,get:function(){return Nd.WordlistOwlA}});Object.defineProperty(x,"wordlists",{enumerable:!0,get:function(){return Nd.wordlists}})});var S2=M(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.ethers=void 0;var nB=F3(),OH=nB.__importStar(B2());Id.ethers=OH;nB.__exportStar(B2(),Id)});var N2=M(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.getAddress=Io.hashMessage=Io.verifyMessage=void 0;var Zu=S2(),O2=null,_2=null,C2=null;try{O2=Zu.ethers.utils.verifyMessage,_2=Zu.ethers.utils.hashMessage,C2=Zu.ethers.utils.getAddress}catch{O2=Zu.ethers.verifyMessage,_2=Zu.ethers.hashMessage,C2=Zu.ethers.getAddress}Io.verifyMessage=O2;Io.hashMessage=_2;Io.getAddress=C2});var R2=M(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.SiweErrorType=ms.SiweError=ms.VerifyOptsKeys=ms.VerifyParamsKeys=void 0;ms.VerifyParamsKeys=["signature","scheme","domain","nonce","time"];ms.VerifyOptsKeys=["provider","suppressExceptions","verificationFallback"];var I2=class{constructor(e,t,n){this.type=e,this.expected=t,this.received=n}};ms.SiweError=I2;var _H;(function(r){r.EXPIRED_MESSAGE="Expired message.",r.INVALID_DOMAIN="Invalid domain.",r.SCHEME_MISMATCH="Scheme does not match provided scheme for verification.",r.DOMAIN_MISMATCH="Domain does not match provided domain for verification.",r.NONCE_MISMATCH="Nonce does not match provided nonce for verification.",r.INVALID_ADDRESS="Invalid address.",r.INVALID_URI="URI does not conform to RFC 3986.",r.INVALID_NONCE="Nonce size smaller then 8 characters or is not alphanumeric.",r.NOT_YET_VALID_MESSAGE="Message is not valid yet.",r.INVALID_SIGNATURE="Signature does not match address of the message.",r.INVALID_TIME_FORMAT="Invalid time format.",r.INVALID_MESSAGE_VERSION="Invalid message version.",r.UNABLE_TO_PARSE="Unable to parse the message."})(_H=ms.SiweErrorType||(ms.SiweErrorType={}))});var iB=M(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});Vm.BrowserRandomSource=void 0;var sB=65536,M2=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;let e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");let t=new Uint8Array(e);for(let n=0;n<t.length;n+=sB)this._crypto.getRandomValues(t.subarray(n,n+Math.min(t.length-n,sB)));return t}};Vm.BrowserRandomSource=M2});var j2=M(L2=>{"use strict";Object.defineProperty(L2,"__esModule",{value:!0});function CH(r){for(var e=0;e<r.length;e++)r[e]=0;return r}L2.wipe=CH});var oB=M(()=>{});var aB=M(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});Km.NodeRandomSource=void 0;var NH=j2(),U2=class{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof xA<"u"){let e=oB();e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");let n=new Uint8Array(e);for(let s=0;s<n.length;s++)n[s]=t[s];return(0,NH.wipe)(t),n}};Km.NodeRandomSource=U2});var cB=M(Wm=>{"use strict";Object.defineProperty(Wm,"__esModule",{value:!0});Wm.SystemRandomSource=void 0;var IH=iB(),RH=aB(),F2=class{constructor(){if(this.isAvailable=!1,this.name="",this._source=new IH.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new RH.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}};Wm.SystemRandomSource=F2});var uB=M(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});function MH(r,e){var t=r>>>16&65535,n=r&65535,s=e>>>16&65535,i=e&65535;return n*i+(t*i+n*s<<16>>>0)|0}un.mul=Math.imul||MH;function LH(r,e){return r+e|0}un.add=LH;function jH(r,e){return r-e|0}un.sub=jH;function UH(r,e){return r<<e|r>>>32-e}un.rotl=UH;function FH(r,e){return r<<32-e|r>>>e}un.rotr=FH;function DH(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}un.isInteger=Number.isInteger||DH;un.MAX_SAFE_INTEGER=9007199254740991;un.isSafeInteger=function(r){return un.isInteger(r)&&r>=-un.MAX_SAFE_INTEGER&&r<=un.MAX_SAFE_INTEGER}});var mB=M(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});var lB=uB();function HH(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}qe.readInt16BE=HH;function $H(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}qe.readUint16BE=$H;function qH(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}qe.readInt16LE=qH;function GH(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}qe.readUint16LE=GH;function fB(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>8,e[t+1]=r>>>0,e}qe.writeUint16BE=fB;qe.writeInt16BE=fB;function dB(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e}qe.writeUint16LE=dB;qe.writeInt16LE=dB;function D2(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}qe.readInt32BE=D2;function H2(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}qe.readUint32BE=H2;function $2(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}qe.readInt32LE=$2;function q2(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}qe.readUint32LE=q2;function Jm(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>24,e[t+1]=r>>>16,e[t+2]=r>>>8,e[t+3]=r>>>0,e}qe.writeUint32BE=Jm;qe.writeInt32BE=Jm;function Qm(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24,e}qe.writeUint32LE=Qm;qe.writeInt32LE=Qm;function zH(r,e){e===void 0&&(e=0);var t=D2(r,e),n=D2(r,e+4);return t*4294967296+n-(n>>31)*4294967296}qe.readInt64BE=zH;function VH(r,e){e===void 0&&(e=0);var t=H2(r,e),n=H2(r,e+4);return t*4294967296+n}qe.readUint64BE=VH;function KH(r,e){e===void 0&&(e=0);var t=$2(r,e),n=$2(r,e+4);return n*4294967296+t-(t>>31)*4294967296}qe.readInt64LE=KH;function WH(r,e){e===void 0&&(e=0);var t=q2(r,e),n=q2(r,e+4);return n*4294967296+t}qe.readUint64LE=WH;function pB(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Jm(r/4294967296>>>0,e,t),Jm(r>>>0,e,t+4),e}qe.writeUint64BE=pB;qe.writeInt64BE=pB;function hB(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Qm(r>>>0,e,t),Qm(r/4294967296>>>0,e,t+4),e}qe.writeUint64LE=hB;qe.writeInt64LE=hB;function JH(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,s=1,i=r/8+t-1;i>=t;i--)n+=e[i]*s,s*=256;return n}qe.readUintBE=JH;function QH(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,s=1,i=t;i<t+r/8;i++)n+=e[i]*s,s*=256;return n}qe.readUintLE=QH;function YH(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!lB.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var s=1,i=r/8+n-1;i>=n;i--)t[i]=e/s&255,s*=256;return t}qe.writeUintBE=YH;function ZH(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!lB.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var s=1,i=n;i<n+r/8;i++)t[i]=e/s&255,s*=256;return t}qe.writeUintLE=ZH;function XH(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}qe.readFloat32BE=XH;function e$(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}qe.readFloat32LE=e$;function t$(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}qe.readFloat64BE=t$;function r$(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}qe.readFloat64LE=r$;function n$(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r),e}qe.writeFloat32BE=n$;function s$(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r,!0),e}qe.writeFloat32LE=s$;function i$(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r),e}qe.writeFloat64BE=i$;function o$(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r,!0),e}qe.writeFloat64LE=o$});var yB=M(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.randomStringForEntropy=wr.randomString=wr.randomUint32=wr.randomBytes=wr.defaultRandomSource=void 0;var a$=cB(),c$=mB(),bB=j2();wr.defaultRandomSource=new a$.SystemRandomSource;function G2(r,e=wr.defaultRandomSource){return e.randomBytes(r)}wr.randomBytes=G2;function u$(r=wr.defaultRandomSource){let e=G2(4,r),t=(0,c$.readUint32LE)(e);return(0,bB.wipe)(e),t}wr.randomUint32=u$;var gB="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function xB(r,e=gB,t=wr.defaultRandomSource){if(e.length<2)throw new Error("randomString charset is too short");if(e.length>256)throw new Error("randomString charset is too long");let n="",s=e.length,i=256-256%s;for(;r>0;){let o=G2(Math.ceil(r*256/i),t);for(let a=0;a<o.length&&r>0;a++){let c=o[a];c<i&&(n+=e.charAt(c%s),r--)}(0,bB.wipe)(o)}return n}wr.randomString=xB;function l$(r,e=gB,t=wr.defaultRandomSource){let n=Math.ceil(r/(Math.log(e.length)/Math.LN2));return xB(n,e,t)}wr.randomStringForEntropy=l$});var z2=M($n=>{"use strict";var f$=$n&&$n.__awaiter||function(r,e,t,n){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{u(n.next(l))}catch(f){o(f)}}function c(l){try{u(n.throw(l))}catch(f){o(f)}}function u(l){l.done?i(l.value):s(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})};Object.defineProperty($n,"__esModule",{value:!0});$n.checkInvalidKeys=$n.isValidISO8601Date=$n.generateNonce=$n.checkContractWalletSignature=void 0;var d$=yB(),p$=S2(),h$=N2(),m$=["function isValidSignature(bytes32 _message, bytes _signature) public view returns (bytes4)"],b$="0x1626ba7e",wB=/^(?<date>[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]))[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(.[0-9]+)?(([Zz])|([+|-]([01][0-9]|2[0-3]):[0-5][0-9]))$/,g$=(r,e,t)=>f$(void 0,void 0,void 0,function*(){if(!t)return!1;let n=new p$.Contract(r.address,m$,t),s=(0,h$.hashMessage)(r.prepareMessage());return(yield n.isValidSignature(s,e))===b$});$n.checkContractWalletSignature=g$;var x$=()=>{let r=(0,d$.randomStringForEntropy)(96);if(!r||r.length<8)throw new Error("Error during nonce creation.");return r};$n.generateNonce=x$;var y$=r=>{let e=wB.exec(r);if(!r)return!1;let t=new Date(e.groups.date).toISOString(),n=wB.exec(t);return e.groups.date===n.groups.date};$n.isValidISO8601Date=y$;var w$=(r,e)=>{let t=[];return Object.keys(r).forEach(n=>{e.includes(n)||t.push(n)}),t};$n.checkInvalidKeys=w$});var vB=M(qn=>{"use strict";var A$=qn&&qn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),E$=qn&&qn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),v$=qn&&qn.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&A$(e,r,t);return E$(e,r),e},AB=qn&&qn.__awaiter||function(r,e,t,n){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{u(n.next(l))}catch(f){o(f)}}function c(l){try{u(n.throw(l))}catch(f){o(f)}}function u(l){l.done?i(l.value):s(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})};Object.defineProperty(qn,"__esModule",{value:!0});qn.SiweMessage=void 0;var V2=m3(),T$=v$(g3()),EB=N2(),it=R2(),Ro=z2(),K2=class{constructor(e){if(typeof e=="string"){let t=new V2.ParsedMessage(e);this.scheme=t.scheme,this.domain=t.domain,this.address=t.address,this.statement=t.statement,this.uri=t.uri,this.version=t.version,this.nonce=t.nonce,this.issuedAt=t.issuedAt,this.expirationTime=t.expirationTime,this.notBefore=t.notBefore,this.requestId=t.requestId,this.chainId=t.chainId,this.resources=t.resources}else this.scheme=e?.scheme,this.domain=e.domain,this.address=e.address,this.statement=e?.statement,this.uri=e.uri,this.version=e.version,this.chainId=e.chainId,this.nonce=e.nonce,this.issuedAt=e?.issuedAt,this.expirationTime=e?.expirationTime,this.notBefore=e?.notBefore,this.requestId=e?.requestId,this.resources=e?.resources,typeof this.chainId=="string"&&(this.chainId=(0,V2.parseIntegerNumber)(this.chainId));this.nonce=this.nonce||(0,Ro.generateNonce)(),this.validateMessage()}toMessage(){this.validateMessage();let t=`${this.scheme?`${this.scheme}://${this.domain}`:this.domain} wants you to sign in with your Ethereum account:`,n=`URI: ${this.uri}`,s=[t,this.address].join(`
|
|
761
761
|
`),i=`Version: ${this.version}`;this.nonce||(this.nonce=(0,Ro.generateNonce)());let o="Chain ID: "+this.chainId||"1",a=`Nonce: ${this.nonce}`,c=[n,i,o,a];if(this.issuedAt=this.issuedAt||new Date().toISOString(),c.push(`Issued At: ${this.issuedAt}`),this.expirationTime){let l=`Expiration Time: ${this.expirationTime}`;c.push(l)}this.notBefore&&c.push(`Not Before: ${this.notBefore}`),this.requestId&&c.push(`Request ID: ${this.requestId}`),this.resources&&c.push(["Resources:",...this.resources.map(l=>`- ${l}`)].join(`
|
|
762
762
|
`));let u=c.join(`
|
|
763
763
|
`);return s=[s,this.statement].join(`
|
|
764
764
|
|
|
765
765
|
`),this.statement&&(s+=`
|
|
766
766
|
`),[s,u].join(`
|
|
767
|
-
`)}prepareMessage(){let e;switch(this.version){case"1":{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}validate(e,t){return
|
|
768
|
-
`);super(i),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:"AbiTypeError"}),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=s,this.metaMessages=t.metaMessages,this.shortMessage=e}}});function Gn(r,e){return r.exec(e)?.groups}var W2,Q2,Xm,Md=se(()=>{W2=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Q2=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Xm=/^\(.+?\).*?$/});function eb(r){let e=r.type;if(_B.test(r.type)&&"components"in r){e="(";let t=r.components.length;for(let s=0;s<t;s++){let i=r.components[s];e+=eb(i),s<t-1&&(e+=", ")}return e+=`)${Gn(_B,r.type)?.array??""}`,eb({...r,type:e})}return"indexed"in r&&r.indexed&&(e=`${e} indexed`),r.name?`${e} ${r.name}`:e}var _B,CB=se(()=>{Md();_B=/^tuple(?<array>(\[(\d*)\])*)$/});function el(r){let e="",t=r.length;for(let n=0;n<t;n++){let s=r[n];e+=eb(s),n!==t-1&&(e+=", ")}return e}var NB=se(()=>{CB()});function Y2(r){return r.type==="function"?`function ${r.name}(${el(r.inputs)})${r.stateMutability&&r.stateMutability!=="nonpayable"?` ${r.stateMutability}`:""}${r.outputs.length?` returns (${el(r.outputs)})`:""}`:r.type==="event"?`event ${r.name}(${el(r.inputs)})`:r.type==="error"?`error ${r.name}(${el(r.inputs)})`:r.type==="constructor"?`constructor(${el(r.inputs)})${r.stateMutability==="payable"?" payable":""}`:r.type==="fallback"?"fallback()":"receive() external payable"}var IB=se(()=>{NB()});function MB(r){return RB.test(r)}function LB(r){return Gn(RB,r)}function UB(r){return jB.test(r)}function FB(r){return Gn(jB,r)}function HB(r){return DB.test(r)}function $B(r){return Gn(DB,r)}function tb(r){return qB.test(r)}function GB(r){return Gn(qB,r)}function VB(r){return zB.test(r)}function KB(r){return Gn(zB,r)}function JB(r){return N$.test(r)}function WB(r){return I$.test(r)}var RB,jB,DB,qB,zB,N$,I$,QB,rb,nb=se(()=>{Md();RB=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;jB=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;DB=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;qB=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;zB=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;N$=/^fallback\(\)$/;I$=/^receive\(\) external payable$/;QB=new Set(["indexed"]),rb=new Set(["calldata","memory","storage"])});var sb,ib,Z2=se(()=>{Xu();sb=class extends It{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}},ib=class extends It{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}});var ob,ab,cb,ub,lb,X2=se(()=>{Xu();ob=class extends It{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}},ab=class extends It{constructor({param:e,name:t}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}},cb=class extends It{constructor({param:e,type:t,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}},ub=class extends It{constructor({param:e,type:t,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}},lb=class extends It{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}});var Ni,fb,db,e6=se(()=>{Xu();Ni=class extends It{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}},fb=class extends It{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}},db=class extends It{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}});var pb,YB=se(()=>{Xu();pb=class extends It{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}});var hb,ZB=se(()=>{Xu();hb=class extends It{constructor({current:e,depth:t}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${t>0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}});function XB(r,e){return e?`${e}:${r}`:r}var mb,eS=se(()=>{mb=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]])});function tS(r,e={}){if(HB(r)){let t=$B(r);if(!t)throw new Ni({signature:r,type:"function"});let n=bs(t.parameters),s=[],i=n.length;for(let a=0;a<i;a++)s.push(Mo(n[a],{modifiers:rb,structs:e,type:"function"}));let o=[];if(t.returns){let a=bs(t.returns),c=a.length;for(let u=0;u<c;u++)o.push(Mo(a[u],{modifiers:rb,structs:e,type:"function"}))}return{name:t.name,type:"function",stateMutability:t.stateMutability??"nonpayable",inputs:s,outputs:o}}if(UB(r)){let t=FB(r);if(!t)throw new Ni({signature:r,type:"event"});let n=bs(t.parameters),s=[],i=n.length;for(let o=0;o<i;o++)s.push(Mo(n[o],{modifiers:QB,structs:e,type:"event"}));return{name:t.name,type:"event",inputs:s}}if(MB(r)){let t=LB(r);if(!t)throw new Ni({signature:r,type:"error"});let n=bs(t.parameters),s=[],i=n.length;for(let o=0;o<i;o++)s.push(Mo(n[o],{structs:e,type:"error"}));return{name:t.name,type:"error",inputs:s}}if(VB(r)){let t=KB(r);if(!t)throw new Ni({signature:r,type:"constructor"});let n=bs(t.parameters),s=[],i=n.length;for(let o=0;o<i;o++)s.push(Mo(n[o],{structs:e,type:"constructor"}));return{type:"constructor",stateMutability:t.stateMutability??"nonpayable",inputs:s}}if(JB(r))return{type:"fallback"};if(WB(r))return{type:"receive",stateMutability:"payable"};throw new fb({signature:r})}function Mo(r,e){let t=XB(r,e?.type);if(mb.has(t))return mb.get(t);let n=Xm.test(r),s=Gn(n?M$:R$,r);if(!s)throw new ob({param:r});if(s.name&&U$(s.name))throw new ab({param:r,name:s.name});let i=s.name?{name:s.name}:{},o=s.modifier==="indexed"?{indexed:!0}:{},a=e?.structs??{},c,u={};if(n){c="tuple";let f=bs(s.type),d=[],h=f.length;for(let b=0;b<h;b++)d.push(Mo(f[b],{structs:a}));u={components:d}}else if(s.type in a)c="tuple",u={components:a[s.type]};else if(L$.test(s.type))c=`${s.type}256`;else if(c=s.type,e?.type!=="struct"&&!t6(c))throw new ib({type:c});if(s.modifier){if(!e?.modifiers?.has?.(s.modifier))throw new cb({param:r,type:e?.type,modifier:s.modifier});if(rb.has(s.modifier)&&!F$(c,!!s.array))throw new ub({param:r,type:e?.type,modifier:s.modifier})}let l={type:`${c}${s.array??""}`,...i,...o,...u};return mb.set(t,l),l}function bs(r,e=[],t="",n=0){let s=r.trim().length;for(let i=0;i<s;i++){let o=r[i],a=r.slice(i+1);switch(o){case",":return n===0?bs(a,[...e,t.trim()]):bs(a,e,`${t}${o}`,n);case"(":return bs(a,e,`${t}${o}`,n+1);case")":return bs(a,e,`${t}${o}`,n-1);default:return bs(a,e,`${t}${o}`,n)}}if(t==="")return e;if(n!==0)throw new hb({current:t,depth:n});return e.push(t.trim()),e}function t6(r){return r==="address"||r==="bool"||r==="function"||r==="string"||W2.test(r)||Q2.test(r)}function U$(r){return r==="address"||r==="bool"||r==="function"||r==="string"||r==="tuple"||W2.test(r)||Q2.test(r)||j$.test(r)}function F$(r,e){return e||r==="bytes"||r==="string"||r==="tuple"}var R$,M$,L$,j$,r6=se(()=>{Md();Z2();X2();e6();ZB();eS();nb();R$=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,M$=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,L$=/^u?int$/;j$=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/});function rS(r){let e={},t=r.length;for(let o=0;o<t;o++){let a=r[o];if(!tb(a))continue;let c=GB(a);if(!c)throw new Ni({signature:a,type:"struct"});let u=c.properties.split(";"),l=[],f=u.length;for(let d=0;d<f;d++){let b=u[d].trim();if(!b)continue;let p=Mo(b,{type:"struct"});l.push(p)}if(!l.length)throw new db({signature:a});e[c.name]=l}let n={},s=Object.entries(e),i=s.length;for(let o=0;o<i;o++){let[a,c]=s[o];n[a]=nS(c,e)}return n}function nS(r,e,t=new Set){let n=[],s=r.length;for(let i=0;i<s;i++){let o=r[i];if(Xm.test(o.type))n.push(o);else{let c=Gn(D$,o.type);if(!c?.type)throw new lb({abiParameter:o});let{array:u,type:l}=c;if(l in e){if(t.has(l))throw new pb({type:l});n.push({...o,type:`tuple${u??""}`,components:nS(e[l]??[],e,new Set([...t,l]))})}else if(t6(l))n.push(o);else throw new sb({type:l})}}return n}var D$,sS=se(()=>{Md();Z2();X2();e6();YB();nb();r6();D$=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/});function bb(r){let e=rS(r),t=[],n=r.length;for(let s=0;s<n;s++){let i=r[s];tb(i)||t.push(tS(i,e))}return t}var iS=se(()=>{nb();sS();r6()});var n6=se(()=>{IB();iS()});function Rr(r,{includeName:e=!1}={}){if(r.type!=="function"&&r.type!=="event"&&r.type!=="error")throw new gb(r.type);return`${r.name}(${Ld(r.inputs,{includeName:e})})`}function Ld(r,{includeName:e=!1}={}){return r?r.map(t=>H$(t,{includeName:e})).join(e?", ":","):""}function H$(r,{includeName:e}){return r.type.startsWith("tuple")?`(${Ld(r.components,{includeName:e})})${r.type.slice(5)}`:r.type+(e&&r.name?` ${r.name}`:"")}var Wa=se(()=>{or()});function Ft(r,{strict:e=!0}={}){return!r||typeof r!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(r):r.startsWith("0x")}var gs=se(()=>{});function rt(r){return Ft(r,{strict:!1})?Math.ceil((r.length-2)/2):r.length}var Ks=se(()=>{gs()});var oS,aS=se(()=>{oS="2.15.1"});var cS,Qa,uS,jd=se(()=>{aS();cS=r=>r,Qa=r=>r,uS=()=>`viem@${oS}`});function lS(r,e){return e?.(r)?r:r&&typeof r=="object"&&"cause"in r?lS(r.cause,e):e?null:r}var z,We=se(()=>{jd();z=class extends Error{constructor(e,t={}){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:uS()});let n=t.cause instanceof z?t.cause.details:t.cause?.message?t.cause.message:t.details,s=t.cause instanceof z&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...s?[`Docs: ${t.docsBaseUrl??"https://viem.sh"}${s}${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join(`
|
|
769
|
-
`),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=s,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return
|
|
767
|
+
`)}prepareMessage(){let e;switch(this.version){case"1":{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}validate(e,t){return AB(this,void 0,void 0,function*(){return console.warn("validate() has been deprecated, please update your code to use verify(). validate() may be removed in future versions."),this.verify({signature:e},{provider:t,suppressExceptions:!1}).then(({data:n})=>n).catch(({error:n})=>{throw n})})}verify(e,t={suppressExceptions:!1}){return AB(this,void 0,void 0,function*(){return new Promise((n,s)=>{var i,o,a;let c=E=>t.suppressExceptions?n(E):s(E),u=(0,Ro.checkInvalidKeys)(e,it.VerifyParamsKeys);u.length>0&&c({success:!1,data:this,error:new Error(`${u.join(", ")} is/are not valid key(s) for VerifyParams.`)});let l=(0,Ro.checkInvalidKeys)(t,it.VerifyOptsKeys);u.length>0&&c({success:!1,data:this,error:new Error(`${l.join(", ")} is/are not valid key(s) for VerifyOpts.`)});let{signature:f,scheme:d,domain:h,nonce:b,time:p}=e;d&&d!==this.scheme&&c({success:!1,data:this,error:new it.SiweError(it.SiweErrorType.SCHEME_MISMATCH,d,this.scheme)}),h&&h!==this.domain&&c({success:!1,data:this,error:new it.SiweError(it.SiweErrorType.DOMAIN_MISMATCH,h,this.domain)}),b&&b!==this.nonce&&c({success:!1,data:this,error:new it.SiweError(it.SiweErrorType.NONCE_MISMATCH,b,this.nonce)});let g=new Date(p||new Date);if(this.expirationTime){let E=new Date(this.expirationTime);g.getTime()>=E.getTime()&&c({success:!1,data:this,error:new it.SiweError(it.SiweErrorType.EXPIRED_MESSAGE,`${g.toISOString()} < ${E.toISOString()}`,`${g.toISOString()} >= ${E.toISOString()}`)})}if(this.notBefore){let E=new Date(this.notBefore);g.getTime()<E.getTime()&&c({success:!1,data:this,error:new it.SiweError(it.SiweErrorType.NOT_YET_VALID_MESSAGE,`${g.toISOString()} >= ${E.toISOString()}`,`${g.toISOString()} < ${E.toISOString()}`)})}let m;try{m=this.prepareMessage()}catch(E){c({success:!1,data:this,error:E})}let y;try{y=(0,EB.verifyMessage)(m,f)}catch(E){console.error(E)}if(y===this.address)return n({success:!0,data:this});{let E=(0,Ro.checkContractWalletSignature)(this,f,t.provider).then(v=>v?{success:!0,data:this}:{success:!1,data:this,error:new it.SiweError(it.SiweErrorType.INVALID_SIGNATURE,y,`Resolved address to be ${this.address}`)}).catch(v=>({success:!1,data:this,error:v}));Promise.all([E,(a=(o=(i=t?.verificationFallback)===null||i===void 0?void 0:i.call(t,e,t,this,E))===null||o===void 0?void 0:o.then(v=>v))===null||a===void 0?void 0:a.catch(v=>v)]).then(([v,k])=>{if(k){if(k.success)return n(k);c(k)}else{if(v.success)return n(v);c(v)}})}})})}validateMessage(...e){var t;if(e.length>0)throw new it.SiweError(it.SiweErrorType.UNABLE_TO_PARSE,"Unexpected argument in the validateMessage function.");if(!this.domain||this.domain.length===0||!/[^#?]*/.test(this.domain))throw new it.SiweError(it.SiweErrorType.INVALID_DOMAIN,`${this.domain} to be a valid domain.`);if(!(0,V2.isEIP55Address)(this.address))throw new it.SiweError(it.SiweErrorType.INVALID_ADDRESS,(0,EB.getAddress)(this.address),this.address);if(!T$.isUri(this.uri))throw new it.SiweError(it.SiweErrorType.INVALID_URI,`${this.uri} to be a valid uri.`);if(this.version!=="1")throw new it.SiweError(it.SiweErrorType.INVALID_MESSAGE_VERSION,"1",this.version);let n=(t=this===null||this===void 0?void 0:this.nonce)===null||t===void 0?void 0:t.match(/[a-zA-Z0-9]{8,}/);if(!n||this.nonce.length<8||n[0]!==this.nonce)throw new it.SiweError(it.SiweErrorType.INVALID_NONCE,`Length > 8 (${n.length}). Alphanumeric.`,this.nonce);if(this.issuedAt&&!(0,Ro.isValidISO8601Date)(this.issuedAt))throw new Error(it.SiweErrorType.INVALID_TIME_FORMAT);if(this.expirationTime&&!(0,Ro.isValidISO8601Date)(this.expirationTime))throw new Error(it.SiweErrorType.INVALID_TIME_FORMAT);if(this.notBefore&&!(0,Ro.isValidISO8601Date)(this.notBefore))throw new Error(it.SiweErrorType.INVALID_TIME_FORMAT)}};qn.SiweMessage=K2});var Ym=M(Oi=>{"use strict";var P$=Oi&&Oi.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),W2=Oi&&Oi.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&P$(e,r,t)};Object.defineProperty(Oi,"__esModule",{value:!0});W2(vB(),Oi);W2(R2(),Oi);W2(z2(),Oi)});var OB,_B=se(()=>{OB="1.0.0"});var It,Xu=se(()=>{_B();It=class extends Error{constructor(e,t={}){let n=t.cause instanceof It?t.cause.details:t.cause?.message?t.cause.message:t.details,s=t.cause instanceof It&&t.cause.docsPath||t.docsPath,i=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${OB}`].join(`
|
|
768
|
+
`);super(i),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:"AbiTypeError"}),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=s,this.metaMessages=t.metaMessages,this.shortMessage=e}}});function Gn(r,e){return r.exec(e)?.groups}var J2,Q2,Xm,Md=se(()=>{J2=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Q2=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Xm=/^\(.+?\).*?$/});function eb(r){let e=r.type;if(CB.test(r.type)&&"components"in r){e="(";let t=r.components.length;for(let s=0;s<t;s++){let i=r.components[s];e+=eb(i),s<t-1&&(e+=", ")}return e+=`)${Gn(CB,r.type)?.array??""}`,eb({...r,type:e})}return"indexed"in r&&r.indexed&&(e=`${e} indexed`),r.name?`${e} ${r.name}`:e}var CB,NB=se(()=>{Md();CB=/^tuple(?<array>(\[(\d*)\])*)$/});function el(r){let e="",t=r.length;for(let n=0;n<t;n++){let s=r[n];e+=eb(s),n!==t-1&&(e+=", ")}return e}var IB=se(()=>{NB()});function Y2(r){return r.type==="function"?`function ${r.name}(${el(r.inputs)})${r.stateMutability&&r.stateMutability!=="nonpayable"?` ${r.stateMutability}`:""}${r.outputs.length?` returns (${el(r.outputs)})`:""}`:r.type==="event"?`event ${r.name}(${el(r.inputs)})`:r.type==="error"?`error ${r.name}(${el(r.inputs)})`:r.type==="constructor"?`constructor(${el(r.inputs)})${r.stateMutability==="payable"?" payable":""}`:r.type==="fallback"?"fallback()":"receive() external payable"}var RB=se(()=>{IB()});function LB(r){return MB.test(r)}function jB(r){return Gn(MB,r)}function FB(r){return UB.test(r)}function DB(r){return Gn(UB,r)}function $B(r){return HB.test(r)}function qB(r){return Gn(HB,r)}function tb(r){return GB.test(r)}function zB(r){return Gn(GB,r)}function KB(r){return VB.test(r)}function WB(r){return Gn(VB,r)}function JB(r){return N$.test(r)}function QB(r){return I$.test(r)}var MB,UB,HB,GB,VB,N$,I$,YB,rb,nb=se(()=>{Md();MB=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;UB=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;HB=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;GB=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;VB=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;N$=/^fallback\(\)$/;I$=/^receive\(\) external payable$/;YB=new Set(["indexed"]),rb=new Set(["calldata","memory","storage"])});var sb,ib,Z2=se(()=>{Xu();sb=class extends It{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}},ib=class extends It{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}});var ob,ab,cb,ub,lb,X2=se(()=>{Xu();ob=class extends It{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}},ab=class extends It{constructor({param:e,name:t}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}},cb=class extends It{constructor({param:e,type:t,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}},ub=class extends It{constructor({param:e,type:t,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}},lb=class extends It{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}});var Ni,fb,db,e6=se(()=>{Xu();Ni=class extends It{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}},fb=class extends It{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}},db=class extends It{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}});var pb,ZB=se(()=>{Xu();pb=class extends It{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}});var hb,XB=se(()=>{Xu();hb=class extends It{constructor({current:e,depth:t}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${t>0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}});function eS(r,e){return e?`${e}:${r}`:r}var mb,tS=se(()=>{mb=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]])});function rS(r,e={}){if($B(r)){let t=qB(r);if(!t)throw new Ni({signature:r,type:"function"});let n=bs(t.parameters),s=[],i=n.length;for(let a=0;a<i;a++)s.push(Mo(n[a],{modifiers:rb,structs:e,type:"function"}));let o=[];if(t.returns){let a=bs(t.returns),c=a.length;for(let u=0;u<c;u++)o.push(Mo(a[u],{modifiers:rb,structs:e,type:"function"}))}return{name:t.name,type:"function",stateMutability:t.stateMutability??"nonpayable",inputs:s,outputs:o}}if(FB(r)){let t=DB(r);if(!t)throw new Ni({signature:r,type:"event"});let n=bs(t.parameters),s=[],i=n.length;for(let o=0;o<i;o++)s.push(Mo(n[o],{modifiers:YB,structs:e,type:"event"}));return{name:t.name,type:"event",inputs:s}}if(LB(r)){let t=jB(r);if(!t)throw new Ni({signature:r,type:"error"});let n=bs(t.parameters),s=[],i=n.length;for(let o=0;o<i;o++)s.push(Mo(n[o],{structs:e,type:"error"}));return{name:t.name,type:"error",inputs:s}}if(KB(r)){let t=WB(r);if(!t)throw new Ni({signature:r,type:"constructor"});let n=bs(t.parameters),s=[],i=n.length;for(let o=0;o<i;o++)s.push(Mo(n[o],{structs:e,type:"constructor"}));return{type:"constructor",stateMutability:t.stateMutability??"nonpayable",inputs:s}}if(JB(r))return{type:"fallback"};if(QB(r))return{type:"receive",stateMutability:"payable"};throw new fb({signature:r})}function Mo(r,e){let t=eS(r,e?.type);if(mb.has(t))return mb.get(t);let n=Xm.test(r),s=Gn(n?M$:R$,r);if(!s)throw new ob({param:r});if(s.name&&U$(s.name))throw new ab({param:r,name:s.name});let i=s.name?{name:s.name}:{},o=s.modifier==="indexed"?{indexed:!0}:{},a=e?.structs??{},c,u={};if(n){c="tuple";let f=bs(s.type),d=[],h=f.length;for(let b=0;b<h;b++)d.push(Mo(f[b],{structs:a}));u={components:d}}else if(s.type in a)c="tuple",u={components:a[s.type]};else if(L$.test(s.type))c=`${s.type}256`;else if(c=s.type,e?.type!=="struct"&&!t6(c))throw new ib({type:c});if(s.modifier){if(!e?.modifiers?.has?.(s.modifier))throw new cb({param:r,type:e?.type,modifier:s.modifier});if(rb.has(s.modifier)&&!F$(c,!!s.array))throw new ub({param:r,type:e?.type,modifier:s.modifier})}let l={type:`${c}${s.array??""}`,...i,...o,...u};return mb.set(t,l),l}function bs(r,e=[],t="",n=0){let s=r.trim().length;for(let i=0;i<s;i++){let o=r[i],a=r.slice(i+1);switch(o){case",":return n===0?bs(a,[...e,t.trim()]):bs(a,e,`${t}${o}`,n);case"(":return bs(a,e,`${t}${o}`,n+1);case")":return bs(a,e,`${t}${o}`,n-1);default:return bs(a,e,`${t}${o}`,n)}}if(t==="")return e;if(n!==0)throw new hb({current:t,depth:n});return e.push(t.trim()),e}function t6(r){return r==="address"||r==="bool"||r==="function"||r==="string"||J2.test(r)||Q2.test(r)}function U$(r){return r==="address"||r==="bool"||r==="function"||r==="string"||r==="tuple"||J2.test(r)||Q2.test(r)||j$.test(r)}function F$(r,e){return e||r==="bytes"||r==="string"||r==="tuple"}var R$,M$,L$,j$,r6=se(()=>{Md();Z2();X2();e6();XB();tS();nb();R$=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,M$=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,L$=/^u?int$/;j$=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/});function nS(r){let e={},t=r.length;for(let o=0;o<t;o++){let a=r[o];if(!tb(a))continue;let c=zB(a);if(!c)throw new Ni({signature:a,type:"struct"});let u=c.properties.split(";"),l=[],f=u.length;for(let d=0;d<f;d++){let b=u[d].trim();if(!b)continue;let p=Mo(b,{type:"struct"});l.push(p)}if(!l.length)throw new db({signature:a});e[c.name]=l}let n={},s=Object.entries(e),i=s.length;for(let o=0;o<i;o++){let[a,c]=s[o];n[a]=sS(c,e)}return n}function sS(r,e,t=new Set){let n=[],s=r.length;for(let i=0;i<s;i++){let o=r[i];if(Xm.test(o.type))n.push(o);else{let c=Gn(D$,o.type);if(!c?.type)throw new lb({abiParameter:o});let{array:u,type:l}=c;if(l in e){if(t.has(l))throw new pb({type:l});n.push({...o,type:`tuple${u??""}`,components:sS(e[l]??[],e,new Set([...t,l]))})}else if(t6(l))n.push(o);else throw new sb({type:l})}}return n}var D$,iS=se(()=>{Md();Z2();X2();e6();ZB();nb();r6();D$=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/});function bb(r){let e=nS(r),t=[],n=r.length;for(let s=0;s<n;s++){let i=r[s];tb(i)||t.push(rS(i,e))}return t}var oS=se(()=>{nb();iS();r6()});var n6=se(()=>{RB();oS()});function Rr(r,{includeName:e=!1}={}){if(r.type!=="function"&&r.type!=="event"&&r.type!=="error")throw new gb(r.type);return`${r.name}(${Ld(r.inputs,{includeName:e})})`}function Ld(r,{includeName:e=!1}={}){return r?r.map(t=>H$(t,{includeName:e})).join(e?", ":","):""}function H$(r,{includeName:e}){return r.type.startsWith("tuple")?`(${Ld(r.components,{includeName:e})})${r.type.slice(5)}`:r.type+(e&&r.name?` ${r.name}`:"")}var Ja=se(()=>{or()});function Ft(r,{strict:e=!0}={}){return!r||typeof r!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(r):r.startsWith("0x")}var gs=se(()=>{});function rt(r){return Ft(r,{strict:!1})?Math.ceil((r.length-2)/2):r.length}var Ks=se(()=>{gs()});var aS,cS=se(()=>{aS="2.15.1"});var uS,Qa,lS,jd=se(()=>{cS();uS=r=>r,Qa=r=>r,lS=()=>`viem@${aS}`});function fS(r,e){return e?.(r)?r:r&&typeof r=="object"&&"cause"in r?fS(r.cause,e):e?null:r}var z,Je=se(()=>{jd();z=class extends Error{constructor(e,t={}){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:lS()});let n=t.cause instanceof z?t.cause.details:t.cause?.message?t.cause.message:t.details,s=t.cause instanceof z&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...s?[`Docs: ${t.docsBaseUrl??"https://viem.sh"}${s}${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join(`
|
|
769
|
+
`),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=s,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return fS(this,e)}}});var xb,Ud,tl,Ws,yb,wb,Ab,rl,Eb,nl,Fd,Lo,vb,Tb,Pb,xs,Js,kb,Bb,Sb,gb,or=se(()=>{Ja();Ks();Je();xb=class extends z{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
|
|
770
770
|
`),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}},Ud=class extends z{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
|
|
771
771
|
`),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}},tl=class extends z{constructor({data:e,params:t,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(`
|
|
772
|
-
`),{metaMessages:[`Params: (${Ld(t,{includeName:!0})})`,`Data: ${e} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=t,this.size=n}},
|
|
772
|
+
`),{metaMessages:[`Params: (${Ld(t,{includeName:!0})})`,`Data: ${e} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=t,this.size=n}},Ws=class extends z{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}},yb=class extends z{constructor({expectedLength:e,givenLength:t,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${t}`].join(`
|
|
773
773
|
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}},wb=class extends z{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${rt(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}},Ab=class extends z{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${t}`].join(`
|
|
774
774
|
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}},rl=class extends z{constructor(e,{docsPath:t}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`].join(`
|
|
775
775
|
`),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}},Eb=class extends z{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}},nl=class extends z{constructor(e,{docsPath:t}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join(`
|
|
@@ -777,29 +777,29 @@ HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
|
|
|
777
777
|
`),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}},Lo=class extends z{constructor(e,{docsPath:t}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
|
|
778
778
|
`),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}},vb=class extends z{constructor(e,{docsPath:t}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
|
|
779
779
|
`),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}},Tb=class extends z{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${Rr(e.abiItem)}\`, and`,`\`${t.type}\` in \`${Rr(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItemAmbiguityError"})}},Pb=class extends z{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}},xs=class extends z{constructor({abiItem:e,data:t,params:n,size:s}){super([`Data size of ${s} bytes is too small for non-indexed event parameters.`].join(`
|
|
780
|
-
`),{metaMessages:[`Params: (${Ld(n,{includeName:!0})})`,`Data: ${t} (${s} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=t,this.params=n,this.size=s}},
|
|
780
|
+
`),{metaMessages:[`Params: (${Ld(n,{includeName:!0})})`,`Data: ${t} (${s} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=t,this.params=n,this.size=s}},Js=class extends z{constructor({abiItem:e,param:t}){super([`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${Rr(e,{includeName:!0})}".`].join(`
|
|
781
781
|
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}},kb=class extends z{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
|
|
782
782
|
`),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}},Bb=class extends z{constructor(e,{docsPath:t}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
|
|
783
783
|
`),{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}},Sb=class extends z{constructor(e){super([`Value "${e}" is not a valid array.`].join(`
|
|
784
784
|
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}},gb=class extends z{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
|
|
785
|
-
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}});var Dd,Hd,$d,_b=se(()=>{We();Dd=class extends z{constructor({offset:e,position:t,size:n}){super(`Slice ${t==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}},Hd=class extends z{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}},$d=class extends z{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${t} ${n} long, but is ${e} ${n} long.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesLengthError"})}}});function jo(r,{dir:e,size:t=32}={}){return typeof r=="string"?Ii(r,{dir:e,size:t}):$$(r,{dir:e,size:t})}function Ii(r,{dir:e,size:t=32}={}){if(t===null)return r;let n=r.replace("0x","");if(n.length>t*2)throw new Hd({size:Math.ceil(n.length/2),targetSize:t,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](t*2,"0")}`}function $$(r,{dir:e,size:t=32}={}){if(t===null)return r;if(r.length>t)throw new Hd({size:r.length,targetSize:t,type:"bytes"});let n=new Uint8Array(t);for(let s=0;s<t;s++){let i=e==="right";n[i?s:t-s-1]=r[i?s:r.length-s-1]}return n}var Cb=se(()=>{_b()});var Nb,Ib,Rb,Mb=se(()=>{We();Nb=class extends z{constructor({max:e,min:t,signed:n,size:s,value:i}){super(`Number "${i}" is not in safe ${s?`${s*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}},Ib=class extends z{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesBooleanError"})}},Rb=class extends z{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:"SizeOverflowError"})}}});function Qs(r,{dir:e="left"}={}){let t=typeof r=="string"?r.replace("0x",""):r,n=0;for(let s=0;s<t.length-1&&t[e==="left"?s:t.length-s-1].toString()==="0";s++)n++;return t=e==="left"?t.slice(n):t.slice(0,t.length-n),typeof r=="string"?(t.length===1&&e==="right"&&(t=`${t}0`),`0x${t.length%2===1?`0${t}`:t}`):t}var qd=se(()=>{});function ln(r,{size:e}){if(rt(r)>e)throw new Rb({givenSize:rt(r),maxSize:e})}function dr(r,e={}){let{signed:t}=e;e.size&&ln(r,{size:e.size});let n=BigInt(r);if(!t)return n;let s=(r.length-2)/2,i=(1n<<BigInt(s)*8n-1n)-1n;return n<=i?n:n-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function ar(r,e={}){return Number(dr(r,e))}var Mr=se(()=>{Mb();Ks()});function Ce(r,e={}){return typeof r=="number"||typeof r=="bigint"?Ae(r,e):typeof r=="string"?Gd(r,e):typeof r=="boolean"?s6(r,e):tt(r,e)}function s6(r,e={}){let t=`0x${Number(r)}`;return typeof e.size=="number"?(ln(t,{size:e.size}),jo(t,{size:e.size})):t}function tt(r,e={}){let t="";for(let s=0;s<r.length;s++)t+=q$[r[s]];let n=`0x${t}`;return typeof e.size=="number"?(ln(n,{size:e.size}),jo(n,{dir:"right",size:e.size})):n}function Ae(r,e={}){let{signed:t,size:n}=e,s=BigInt(r),i;n?t?i=(1n<<BigInt(n)*8n-1n)-1n:i=2n**(BigInt(n)*8n)-1n:typeof r=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));let o=typeof i=="bigint"&&t?-i-1n:0;if(i&&s>i||s<o){let c=typeof r=="bigint"?"n":"";throw new Nb({max:i?`${i}${c}`:void 0,min:`${o}${c}`,signed:t,size:n,value:`${r}${c}`})}let a=`0x${(t&&s<0?(1n<<BigInt(n*8))+BigInt(s):s).toString(16)}`;return n?jo(a,{size:n}):a}function Gd(r,e={}){let t=G$.encode(r);return tt(t,e)}var q$,G$,De=se(()=>{Mb();Cb();Mr();q$=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));G$=new TextEncoder});function Lr(r,e={}){return typeof r=="number"||typeof r=="bigint"?K$(r,e):typeof r=="boolean"?V$(r,e):Ft(r)?fn(r,e):Qr(r,e)}function V$(r,e={}){let t=new Uint8Array(1);return t[0]=Number(r),typeof e.size=="number"?(ln(t,{size:e.size}),jo(t,{size:e.size})):t}function fS(r){if(r>=Ri.zero&&r<=Ri.nine)return r-Ri.zero;if(r>=Ri.A&&r<=Ri.F)return r-(Ri.A-10);if(r>=Ri.a&&r<=Ri.f)return r-(Ri.a-10)}function fn(r,e={}){let t=r;e.size&&(ln(t,{size:e.size}),t=jo(t,{dir:"right",size:e.size}));let n=t.slice(2);n.length%2&&(n=`0${n}`);let s=n.length/2,i=new Uint8Array(s);for(let o=0,a=0;o<s;o++){let c=fS(n.charCodeAt(a++)),u=fS(n.charCodeAt(a++));if(c===void 0||u===void 0)throw new z(`Invalid byte sequence ("${n[a-2]}${n[a-1]}" in "${n}").`);i[o]=c*16+u}return i}function K$(r,e){let t=Ae(r,e);return fn(t)}function Qr(r,e={}){let t=z$.encode(r);return typeof e.size=="number"?(ln(t,{size:e.size}),jo(t,{dir:"right",size:e.size})):t}var z$,Ri,Ar=se(()=>{We();gs();Cb();Mr();De();z$=new TextEncoder;Ri={zero:48,nine:57,A:65,F:70,a:97,f:102}});function zd(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function Vd(r,...e){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(r.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${r.length}`)}function dS(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");zd(r.outputLen),zd(r.blockLen)}function Mi(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function Lb(r,e){Vd(r);let t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}var jb=se(()=>{});function J$(r,e=!1){return e?{h:Number(r&Ub),l:Number(r>>pS&Ub)}:{h:Number(r>>pS&Ub)|0,l:Number(r&Ub)|0}}function hS(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let s=0;s<r.length;s++){let{h:i,l:o}=J$(r[s],e);[t[s],n[s]]=[i,o]}return[t,n]}var Ub,pS,mS,bS,gS,xS,yS=se(()=>{Ub=BigInt(4294967295),pS=BigInt(32);mS=(r,e,t)=>r<<t|e>>>32-t,bS=(r,e,t)=>e<<t|r>>>32-t,gS=(r,e,t)=>e<<t-32|r>>>64-t,xS=(r,e,t)=>r<<t-32|e>>>64-t});var Fb,wS=se(()=>{Fb=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});function Q$(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function Fo(r){if(typeof r=="string"&&(r=Q$(r)),!AS(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}function vS(...r){let e=new Uint8Array(r.reduce((n,s)=>n+s.length,0)),t=0;return r.forEach(n=>{if(!AS(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}function Hb(r){let e=n=>r().update(Fo(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}function TS(r){let e=(n,s)=>r(s).update(Fo(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}function PS(r=32){if(Fb&&typeof Fb.getRandomValues=="function")return Fb.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}var AS,ES,Db,ys,W$,Uo,rY,sl=se(()=>{wS();AS=r=>r instanceof Uint8Array,ES=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4)),Db=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),ys=(r,e)=>r<<32-e|r>>>e,W$=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!W$)throw new Error("Non little-endian hardware is not supported");Uo=class{clone(){return this._cloneInto()}},rY={}.toString});function sq(r,e=24){let t=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)t[o]=r[o]^r[o+10]^r[o+20]^r[o+30]^r[o+40];for(let o=0;o<10;o+=2){let a=(o+8)%10,c=(o+2)%10,u=t[c],l=t[c+1],f=kS(u,l,1)^t[a],d=BS(u,l,1)^t[a+1];for(let h=0;h<50;h+=10)r[o+h]^=f,r[o+h+1]^=d}let s=r[2],i=r[3];for(let o=0;o<24;o++){let a=OS[o],c=kS(s,i,a),u=BS(s,i,a),l=SS[o];s=r[l],i=r[l+1],r[l]=c,r[l+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)t[a]=r[o+a];for(let a=0;a<10;a++)r[o+a]^=~t[(a+2)%10]&t[(a+4)%10]}r[0]^=rq[n],r[1]^=nq[n]}t.fill(0)}var SS,OS,_S,Y$,Kd,Z$,X$,eq,tq,rq,nq,kS,BS,il,Do,aY,cY,uY,lY,fY,CS,dY,pY,NS,hY,mY,IS=se(()=>{jb();yS();sl();[SS,OS,_S]=[[],[],[]],Y$=BigInt(0),Kd=BigInt(1),Z$=BigInt(2),X$=BigInt(7),eq=BigInt(256),tq=BigInt(113);for(let r=0,e=Kd,t=1,n=0;r<24;r++){[t,n]=[n,(2*t+3*n)%5],SS.push(2*(5*n+t)),OS.push((r+1)*(r+2)/2%64);let s=Y$;for(let i=0;i<7;i++)e=(e<<Kd^(e>>X$)*tq)%eq,e&Z$&&(s^=Kd<<(Kd<<BigInt(i))-Kd);_S.push(s)}[rq,nq]=hS(_S,!0),kS=(r,e,t)=>t>32?gS(r,e,t):mS(r,e,t),BS=(r,e,t)=>t>32?xS(r,e,t):bS(r,e,t);il=class extends Uo{constructor(e,t,n,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,zd(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=ES(this.state)}keccak(){sq(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Mi(this);let{blockLen:t,state:n}=this;e=Fo(e);let s=e.length;for(let i=0;i<s;){let o=Math.min(t-this.pos,s-i);for(let a=0;a<o;a++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:s}=this;e[n]^=t,(t&128)!==0&&n===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){Mi(this,!1),Vd(e),this.finish();let t=this.state,{blockLen:n}=this;for(let s=0,i=e.length;s<i;){this.posOut>=n&&this.keccak();let o=Math.min(n-this.posOut,i-s);e.set(t.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return zd(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Lb(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:n,outputLen:s,rounds:i,enableXOF:o}=this;return e||(e=new il(t,n,s,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}},Do=(r,e,t)=>Hb(()=>new il(e,r,t)),aY=Do(6,144,224/8),cY=Do(6,136,256/8),uY=Do(6,104,384/8),lY=Do(6,72,512/8),fY=Do(1,144,224/8),CS=Do(1,136,256/8),dY=Do(1,104,384/8),pY=Do(1,72,512/8),NS=(r,e,t)=>TS((n={})=>new il(e,r,n.dkLen===void 0?t:n.dkLen,!0)),hY=NS(31,168,128/8),mY=NS(31,136,256/8)});function Bt(r,e){let t=e||"hex",n=CS(Ft(r,{strict:!1})?Lr(r):r);return t==="bytes"?n:Ce(n)}var Li=se(()=>{IS();gs();Ar();De()});function RS(r){return iq(r)}var iq,MS=se(()=>{Ar();Li();iq=r=>Bt(Lr(r))});function LS(r){let e=!0,t="",n=0,s="",i=!1;for(let o=0;o<r.length;o++){let a=r[o];if(["(",")",","].includes(a)&&(e=!0),a==="("&&n++,a===")"&&n--,!!e){if(n===0){if(a===" "&&["event","function",""].includes(s))s="";else if(s+=a,a===")"){i=!0;break}continue}if(a===" "){r[o-1]!==","&&t!==","&&t!==",("&&(t="",e=!1);continue}s+=a,t+=a}}if(!i)throw new z("Unable to normalize signature.");return s}var jS=se(()=>{We()});var US,FS=se(()=>{n6();jS();US=r=>{let e=(()=>typeof r=="string"?r:Y2(r))();return LS(e)}});function $b(r){return RS(US(r))}var i6=se(()=>{MS();FS()});var ol,qb=se(()=>{i6();ol=$b});var St,ji=se(()=>{We();St=class extends z{constructor({address:e}){super(`Address "${e}" 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"})}}});var Ho,Gb=se(()=>{Ho=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}set(e,t){return super.set(e,t),this.maxSize&&this.size>this.maxSize&&this.delete(this.keys().next().value),this}}});function zb(r,e){if(o6.has(`${r}.${e}`))return o6.get(`${r}.${e}`);let t=e?`${e}${r.toLowerCase()}`:r.substring(2).toLowerCase(),n=Bt(Qr(t),"bytes"),s=(e?t.substring(`${e}0x`.length):t).split("");for(let o=0;o<40;o+=2)n[o>>1]>>4>=8&&s[o]&&(s[o]=s[o].toUpperCase()),(n[o>>1]&15)>=8&&s[o+1]&&(s[o+1]=s[o+1].toUpperCase());let i=`0x${s.join("")}`;return o6.set(`${r}.${e}`,i),i}var o6,a6=se(()=>{Ar();Li();Gb();o6=new Ho(8192)});function Et(r,e){let{strict:t=!0}=e??{},n=`${r}.${t}`;if(c6.has(n))return c6.get(n);let s=(()=>oq.test(r)?r.toLowerCase()===r?!0:t?zb(r)===r:!0:!1)();return c6.set(n,s),s}var oq,c6,Ys=se(()=>{Gb();a6();oq=/^0x[a-fA-F0-9]{40}$/,c6=new Ho(8192)});function jr(r){return typeof r[0]=="string"?ws(r):aq(r)}function aq(r){let e=0;for(let s of r)e+=s.length;let t=new Uint8Array(e),n=0;for(let s of r)t.set(s,n),n+=s.length;return t}function ws(r){return`0x${r.reduce((e,t)=>e+t.replace("0x",""),"")}`}var Zs=se(()=>{});function Ui(r,e,t,{strict:n}={}){return Ft(r,{strict:!1})?cq(r,e,t,{strict:n}):u6(r,e,t,{strict:n})}function DS(r,e){if(typeof e=="number"&&e>0&&e>rt(r)-1)throw new Dd({offset:e,position:"start",size:rt(r)})}function HS(r,e,t){if(typeof e=="number"&&typeof t=="number"&&rt(r)!==t-e)throw new Dd({offset:t,position:"end",size:rt(r)})}function u6(r,e,t,{strict:n}={}){DS(r,e);let s=r.slice(e,t);return n&&HS(s,e,t),s}function cq(r,e,t,{strict:n}={}){DS(r,e);let s=`0x${r.replace("0x","").slice((e??0)*2,(t??r.length)*2)}`;return n&&HS(s,e,t),s}var al=se(()=>{_b();gs();Ks()});function As(r,e){if(r.length!==e.length)throw new Ab({expectedLength:r.length,givenLength:e.length});let t=uq({params:r,values:e}),n=f6(t);return n.length===0?"0x":n}function uq({params:r,values:e}){let t=[];for(let n=0;n<r.length;n++)t.push(l6({param:r[n],value:e[n]}));return t}function l6({param:r,value:e}){let t=Vb(r.type);if(t){let[n,s]=t;return fq(e,{length:n,param:{...r,type:s}})}if(r.type==="tuple")return bq(e,{param:r});if(r.type==="address")return lq(e);if(r.type==="bool")return pq(e);if(r.type.startsWith("uint")||r.type.startsWith("int")){let n=r.type.startsWith("int");return hq(e,{signed:n})}if(r.type.startsWith("bytes"))return dq(e,{param:r});if(r.type==="string")return mq(e);throw new kb(r.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function f6(r){let e=0;for(let i=0;i<r.length;i++){let{dynamic:o,encoded:a}=r[i];o?e+=32:e+=rt(a)}let t=[],n=[],s=0;for(let i=0;i<r.length;i++){let{dynamic:o,encoded:a}=r[i];o?(t.push(Ae(e+s,{size:32})),n.push(a),s+=rt(a)):t.push(a)}return jr([...t,...n])}function lq(r){if(!Et(r))throw new St({address:r});return{dynamic:!1,encoded:Ii(r.toLowerCase())}}function fq(r,{length:e,param:t}){let n=e===null;if(!Array.isArray(r))throw new Sb(r);if(!n&&r.length!==e)throw new yb({expectedLength:e,givenLength:r.length,type:`${t.type}[${e}]`});let s=!1,i=[];for(let o=0;o<r.length;o++){let a=l6({param:t,value:r[o]});a.dynamic&&(s=!0),i.push(a)}if(n||s){let o=f6(i);if(n){let a=Ae(i.length,{size:32});return{dynamic:!0,encoded:i.length>0?jr([a,o]):a}}if(s)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:jr(i.map(({encoded:o})=>o))}}function dq(r,{param:e}){let[,t]=e.type.split("bytes"),n=rt(r);if(!t){let s=r;return n%32!==0&&(s=Ii(s,{dir:"right",size:Math.ceil((r.length-2)/2/32)*32})),{dynamic:!0,encoded:jr([Ii(Ae(n,{size:32})),s])}}if(n!==Number.parseInt(t))throw new wb({expectedSize:Number.parseInt(t),value:r});return{dynamic:!1,encoded:Ii(r,{dir:"right"})}}function pq(r){if(typeof r!="boolean")throw new z(`Invalid boolean value: "${r}" (type: ${typeof r}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Ii(s6(r))}}function hq(r,{signed:e}){return{dynamic:!1,encoded:Ae(r,{size:32,signed:e})}}function mq(r){let e=Gd(r),t=Math.ceil(rt(e)/32),n=[];for(let s=0;s<t;s++)n.push(Ii(Ui(e,s*32,(s+1)*32),{dir:"right"}));return{dynamic:!0,encoded:jr([Ii(Ae(rt(e),{size:32})),...n])}}function bq(r,{param:e}){let t=!1,n=[];for(let s=0;s<e.components.length;s++){let i=e.components[s],o=Array.isArray(r)?s:i.name,a=l6({param:i,value:r[o]});n.push(a),a.dynamic&&(t=!0)}return{dynamic:t,encoded:t?f6(n):jr(n.map(({encoded:s})=>s))}}function Vb(r){let e=r.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}var Ya=se(()=>{or();ji();We();Ys();Zs();Cb();Ks();al();De()});var cl,Kb=se(()=>{al();i6();cl=r=>Ui($b(r),0,4)});function Xs(r){let{abi:e,args:t=[],name:n}=r,s=Ft(n,{strict:!1}),i=e.filter(a=>s?a.type==="function"?cl(a)===n:a.type==="event"?ol(a)===n:!1:"name"in a&&a.name===n);if(i.length===0)return;if(i.length===1)return i[0];let o;for(let a of i){if(!("inputs"in a))continue;if(!t||t.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==t.length)continue;if(t.every((u,l)=>{let f="inputs"in a&&a.inputs[l];return f?d6(u,f):!1})){if(o&&"inputs"in o&&o.inputs){let u=$S(a.inputs,o.inputs,t);if(u)throw new Tb({abiItem:a,type:u[0]},{abiItem:o,type:u[1]})}o=a}}return o||i[0]}function d6(r,e){let t=typeof r,n=e.type;switch(n){case"address":return Et(r,{strict:!1});case"bool":return t==="boolean";case"function":return t==="string";case"string":return t==="string";default:return n==="tuple"&&"components"in e?Object.values(e.components).every((s,i)=>d6(Object.values(r)[i],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?t==="number"||t==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?t==="string"||r instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(r)&&r.every(s=>d6(s,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function $S(r,e,t){for(let n in r){let s=r[n],i=e[n];if(s.type==="tuple"&&i.type==="tuple"&&"components"in s&&"components"in i)return $S(s.components,i.components,t[n]);let o=[s.type,i.type];if((()=>o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?Et(t[n],{strict:!1}):o.includes("address")&&o.includes("bytes")?Et(t[n],{strict:!1}):!1)())return o}}var ul=se(()=>{or();gs();Ys();qb();Kb()});function Er(r){return typeof r=="string"?{address:r,type:"json-rpc"}:r}var Fi=se(()=>{});function VS(r){let{abi:e,args:t,functionName:n}=r,s=e[0];if(n){let i=Xs({abi:e,args:t,name:n});if(!i)throw new Lo(n,{docsPath:zS});s=i}if(s.type!=="function")throw new Lo(void 0,{docsPath:zS});return{abi:[s],functionName:cl(Rr(s))}}var zS,KS=se(()=>{or();Kb();Wa();ul();zS="/docs/contract/encodeFunctionData"});function Yr(r){let{args:e}=r,{abi:t,functionName:n}=(()=>r.abi.length===1&&r.functionName?.startsWith("0x")?r:VS(r))(),s=t[0],i=n,o="inputs"in s&&s.inputs?As(s.inputs,e??[]):void 0;return ws([i,o??"0x"])}var qo=se(()=>{Zs();Ya();KS()});var Wb,JS,WS,Qb=se(()=>{Wb={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},JS={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},WS={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}});var Jd,ll,Yb,p6=se(()=>{We();Jd=class extends z{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}},ll=class extends z{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}},Yb=class extends z{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}}});function fl(r,{recursiveReadLimit:e=8192}={}){let t=Object.create(gq);return t.bytes=r,t.dataView=new DataView(r.buffer,r.byteOffset,r.byteLength),t.positionReadCount=new Map,t.recursiveReadLimit=e,t}var gq,Zb=se(()=>{p6();gq={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new Yb({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(r){if(r<0||r>this.bytes.length-1)throw new ll({length:this.bytes.length,position:r})},decrementPosition(r){if(r<0)throw new Jd({offset:r});let e=this.position-r;this.assertPosition(e),this.position=e},getReadCount(r){return this.positionReadCount.get(r||this.position)||0},incrementPosition(r){if(r<0)throw new Jd({offset:r});let e=this.position+r;this.assertPosition(e),this.position=e},inspectByte(r){let e=r??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(r,e){let t=e??this.position;return this.assertPosition(t+r-1),this.bytes.subarray(t,t+r)},inspectUint8(r){let e=r??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(r){let e=r??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(r){let e=r??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(r){let e=r??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(r){this.assertPosition(this.position),this.bytes[this.position]=r,this.position++},pushBytes(r){this.assertPosition(this.position+r.length-1),this.bytes.set(r,this.position),this.position+=r.length},pushUint8(r){this.assertPosition(this.position),this.bytes[this.position]=r,this.position++},pushUint16(r){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,r),this.position+=2},pushUint24(r){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,r>>8),this.dataView.setUint8(this.position+2,r&255),this.position+=3},pushUint32(r){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,r),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let r=this.inspectByte();return this.position++,r},readBytes(r,e){this.assertReadLimit(),this._touch();let t=this.inspectBytes(r);return this.position+=e??r,t},readUint8(){this.assertReadLimit(),this._touch();let r=this.inspectUint8();return this.position+=1,r},readUint16(){this.assertReadLimit(),this._touch();let r=this.inspectUint16();return this.position+=2,r},readUint24(){this.assertReadLimit(),this._touch();let r=this.inspectUint24();return this.position+=3,r},readUint32(){this.assertReadLimit(),this._touch();let r=this.inspectUint32();return this.position+=4,r},get remaining(){return this.bytes.length-this.position},setPosition(r){let e=this.position;return this.assertPosition(r),this.position=r,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let r=this.getReadCount();this.positionReadCount.set(this.position,r+1),r>0&&this.recursiveReadCount++}}});function QS(r,e={}){typeof e.size<"u"&&ln(r,{size:e.size});let t=tt(r,e);return dr(t,e)}function YS(r,e={}){let t=r;if(typeof e.size<"u"&&(ln(t,{size:e.size}),t=Qs(t)),t.length>1||t[0]>1)throw new Ib(t);return Boolean(t[0])}function ti(r,e={}){typeof e.size<"u"&&ln(r,{size:e.size});let t=tt(r,e);return ar(t,e)}function ZS(r,e={}){let t=r;return typeof e.size<"u"&&(ln(t,{size:e.size}),t=Qs(t,{dir:"right"})),new TextDecoder().decode(t)}var XS=se(()=>{Mb();qd();Mr();De()});function Za(r,e){let t=typeof e=="string"?fn(e):e,n=fl(t);if(rt(t)===0&&r.length>0)throw new Js;if(rt(e)&&rt(e)<32)throw new tl({data:typeof e=="string"?e:tt(e),params:r,size:rt(e)});let s=0,i=[];for(let o=0;o<r.length;++o){let a=r[o];n.setPosition(s);let[c,u]=dl(n,a,{staticPosition:0});s+=u,i.push(c)}return i}function dl(r,e,{staticPosition:t}){let n=Vb(e.type);if(n){let[s,i]=n;return yq(r,{...e,type:i},{length:s,staticPosition:t})}if(e.type==="tuple")return vq(r,e,{staticPosition:t});if(e.type==="address")return xq(r);if(e.type==="bool")return wq(r);if(e.type.startsWith("bytes"))return Aq(r,e,{staticPosition:t});if(e.type.startsWith("uint")||e.type.startsWith("int"))return Eq(r,e);if(e.type==="string")return Tq(r,{staticPosition:t});throw new Bb(e.type,{docsPath:"/docs/contract/decodeAbiParameters"})}function xq(r){let e=r.readBytes(32);return[zb(tt(u6(e,-20))),32]}function yq(r,e,{length:t,staticPosition:n}){if(!t){let o=ti(r.readBytes(h6)),a=n+o,c=a+e9;r.setPosition(a);let u=ti(r.readBytes(e9)),l=Wd(e),f=0,d=[];for(let h=0;h<u;++h){r.setPosition(c+(l?h*32:f));let[b,p]=dl(r,e,{staticPosition:c});f+=p,d.push(b)}return r.setPosition(n+32),[d,32]}if(Wd(e)){let o=ti(r.readBytes(h6)),a=n+o,c=[];for(let u=0;u<t;++u){r.setPosition(a+u*32);let[l]=dl(r,e,{staticPosition:a});c.push(l)}return r.setPosition(n+32),[c,32]}let s=0,i=[];for(let o=0;o<t;++o){let[a,c]=dl(r,e,{staticPosition:n+s});s+=c,i.push(a)}return[i,s]}function wq(r){return[YS(r.readBytes(32),{size:32}),32]}function Aq(r,e,{staticPosition:t}){let[n,s]=e.type.split("bytes");if(!s){let o=ti(r.readBytes(32));r.setPosition(t+o);let a=ti(r.readBytes(32));if(a===0)return r.setPosition(t+32),["0x",32];let c=r.readBytes(a);return r.setPosition(t+32),[tt(c),32]}return[tt(r.readBytes(Number.parseInt(s),32)),32]}function Eq(r,e){let t=e.type.startsWith("int"),n=Number.parseInt(e.type.split("int")[1]||"256"),s=r.readBytes(32);return[n>48?QS(s,{signed:t}):ti(s,{signed:t}),32]}function vq(r,e,{staticPosition:t}){let n=e.components.length===0||e.components.some(({name:o})=>!o),s=n?[]:{},i=0;if(Wd(e)){let o=ti(r.readBytes(h6)),a=t+o;for(let c=0;c<e.components.length;++c){let u=e.components[c];r.setPosition(a+i);let[l,f]=dl(r,u,{staticPosition:a});i+=f,s[n?c:u?.name]=l}return r.setPosition(t+32),[s,32]}for(let o=0;o<e.components.length;++o){let a=e.components[o],[c,u]=dl(r,a,{staticPosition:t});s[n?o:a?.name]=c,i+=u}return[s,i]}function Tq(r,{staticPosition:e}){let t=ti(r.readBytes(32)),n=e+t;r.setPosition(n);let s=ti(r.readBytes(32));if(s===0)return r.setPosition(e+32),["",32];let i=r.readBytes(s,32),o=ZS(Qs(i));return r.setPosition(e+32),[o,32]}function Wd(r){let{type:e}=r;if(e==="string"||e==="bytes"||e.endsWith("[]"))return!0;if(e==="tuple")return r.components?.some(Wd);let t=Vb(r.type);return!!(t&&Wd({...r,type:t[1]}))}var e9,h6,Xb=se(()=>{or();a6();Zb();Ks();al();qd();XS();Ar();De();Ya();e9=32,h6=32});function eg(r){let{abi:e,data:t}=r,n=Ui(t,0,4);if(n==="0x")throw new Js;let i=[...e||[],JS,WS].find(o=>o.type==="error"&&n===cl(Rr(o)));if(!i)throw new rl(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:i,args:"inputs"in i&&i.inputs&&i.inputs.length>0?Za(i.inputs,Ui(t,4)):void 0,errorName:i.name}}var m6=se(()=>{Qb();or();al();Kb();Xb();Wa()});var nt,dn=se(()=>{nt=(r,e,t)=>JSON.stringify(r,(n,s)=>{let i=typeof s=="bigint"?s.toString():s;return typeof e=="function"?e(n,i):i},t)});function b6({abiItem:r,args:e,includeFunctionName:t=!0,includeName:n=!1}){if("name"in r&&"inputs"in r&&!!r.inputs)return`${t?r.name:""}(${r.inputs.map((s,i)=>`${n&&s.name?`${s.name}: `:""}${typeof e[i]=="object"?nt(e[i]):e[i]}`).join(", ")})`}var t9=se(()=>{dn()});var r9,n9,g6=se(()=>{r9={gwei:9,wei:18},n9={ether:-9,wei:9}});function tg(r,e){let t=r.toString(),n=t.startsWith("-");n&&(t=t.slice(1)),t=t.padStart(e,"0");let[s,i]=[t.slice(0,t.length-e),t.slice(t.length-e)];return i=i.replace(/(0+)$/,""),`${n?"-":""}${s||"0"}${i?`.${i}`:""}`}var x6=se(()=>{});function rg(r,e="wei"){return tg(r,r9[e])}var y6=se(()=>{g6();x6()});function Ur(r,e="wei"){return tg(r,n9[e])}var Qd=se(()=>{g6();x6()});function s9(r){return r.reduce((e,{slot:t,value:n})=>`${e} ${t}: ${n}
|
|
786
|
-
`,"")}function
|
|
785
|
+
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}});var Dd,Hd,$d,_b=se(()=>{Je();Dd=class extends z{constructor({offset:e,position:t,size:n}){super(`Slice ${t==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}},Hd=class extends z{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}},$d=class extends z{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${t} ${n} long, but is ${e} ${n} long.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesLengthError"})}}});function jo(r,{dir:e,size:t=32}={}){return typeof r=="string"?Ii(r,{dir:e,size:t}):$$(r,{dir:e,size:t})}function Ii(r,{dir:e,size:t=32}={}){if(t===null)return r;let n=r.replace("0x","");if(n.length>t*2)throw new Hd({size:Math.ceil(n.length/2),targetSize:t,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](t*2,"0")}`}function $$(r,{dir:e,size:t=32}={}){if(t===null)return r;if(r.length>t)throw new Hd({size:r.length,targetSize:t,type:"bytes"});let n=new Uint8Array(t);for(let s=0;s<t;s++){let i=e==="right";n[i?s:t-s-1]=r[i?s:r.length-s-1]}return n}var Cb=se(()=>{_b()});var Nb,Ib,Rb,Mb=se(()=>{Je();Nb=class extends z{constructor({max:e,min:t,signed:n,size:s,value:i}){super(`Number "${i}" is not in safe ${s?`${s*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}},Ib=class extends z{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesBooleanError"})}},Rb=class extends z{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:"SizeOverflowError"})}}});function Qs(r,{dir:e="left"}={}){let t=typeof r=="string"?r.replace("0x",""):r,n=0;for(let s=0;s<t.length-1&&t[e==="left"?s:t.length-s-1].toString()==="0";s++)n++;return t=e==="left"?t.slice(n):t.slice(0,t.length-n),typeof r=="string"?(t.length===1&&e==="right"&&(t=`${t}0`),`0x${t.length%2===1?`0${t}`:t}`):t}var qd=se(()=>{});function ln(r,{size:e}){if(rt(r)>e)throw new Rb({givenSize:rt(r),maxSize:e})}function dr(r,e={}){let{signed:t}=e;e.size&&ln(r,{size:e.size});let n=BigInt(r);if(!t)return n;let s=(r.length-2)/2,i=(1n<<BigInt(s)*8n-1n)-1n;return n<=i?n:n-BigInt(`0x${"f".padStart(s*2,"f")}`)-1n}function ar(r,e={}){return Number(dr(r,e))}var Mr=se(()=>{Mb();Ks()});function Ce(r,e={}){return typeof r=="number"||typeof r=="bigint"?Ae(r,e):typeof r=="string"?Gd(r,e):typeof r=="boolean"?s6(r,e):tt(r,e)}function s6(r,e={}){let t=`0x${Number(r)}`;return typeof e.size=="number"?(ln(t,{size:e.size}),jo(t,{size:e.size})):t}function tt(r,e={}){let t="";for(let s=0;s<r.length;s++)t+=q$[r[s]];let n=`0x${t}`;return typeof e.size=="number"?(ln(n,{size:e.size}),jo(n,{dir:"right",size:e.size})):n}function Ae(r,e={}){let{signed:t,size:n}=e,s=BigInt(r),i;n?t?i=(1n<<BigInt(n)*8n-1n)-1n:i=2n**(BigInt(n)*8n)-1n:typeof r=="number"&&(i=BigInt(Number.MAX_SAFE_INTEGER));let o=typeof i=="bigint"&&t?-i-1n:0;if(i&&s>i||s<o){let c=typeof r=="bigint"?"n":"";throw new Nb({max:i?`${i}${c}`:void 0,min:`${o}${c}`,signed:t,size:n,value:`${r}${c}`})}let a=`0x${(t&&s<0?(1n<<BigInt(n*8))+BigInt(s):s).toString(16)}`;return n?jo(a,{size:n}):a}function Gd(r,e={}){let t=G$.encode(r);return tt(t,e)}var q$,G$,De=se(()=>{Mb();Cb();Mr();q$=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));G$=new TextEncoder});function Lr(r,e={}){return typeof r=="number"||typeof r=="bigint"?K$(r,e):typeof r=="boolean"?V$(r,e):Ft(r)?fn(r,e):Qr(r,e)}function V$(r,e={}){let t=new Uint8Array(1);return t[0]=Number(r),typeof e.size=="number"?(ln(t,{size:e.size}),jo(t,{size:e.size})):t}function dS(r){if(r>=Ri.zero&&r<=Ri.nine)return r-Ri.zero;if(r>=Ri.A&&r<=Ri.F)return r-(Ri.A-10);if(r>=Ri.a&&r<=Ri.f)return r-(Ri.a-10)}function fn(r,e={}){let t=r;e.size&&(ln(t,{size:e.size}),t=jo(t,{dir:"right",size:e.size}));let n=t.slice(2);n.length%2&&(n=`0${n}`);let s=n.length/2,i=new Uint8Array(s);for(let o=0,a=0;o<s;o++){let c=dS(n.charCodeAt(a++)),u=dS(n.charCodeAt(a++));if(c===void 0||u===void 0)throw new z(`Invalid byte sequence ("${n[a-2]}${n[a-1]}" in "${n}").`);i[o]=c*16+u}return i}function K$(r,e){let t=Ae(r,e);return fn(t)}function Qr(r,e={}){let t=z$.encode(r);return typeof e.size=="number"?(ln(t,{size:e.size}),jo(t,{dir:"right",size:e.size})):t}var z$,Ri,Ar=se(()=>{Je();gs();Cb();Mr();De();z$=new TextEncoder;Ri={zero:48,nine:57,A:65,F:70,a:97,f:102}});function zd(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function Vd(r,...e){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(r.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${r.length}`)}function pS(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");zd(r.outputLen),zd(r.blockLen)}function Mi(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function Lb(r,e){Vd(r);let t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}var jb=se(()=>{});function W$(r,e=!1){return e?{h:Number(r&Ub),l:Number(r>>hS&Ub)}:{h:Number(r>>hS&Ub)|0,l:Number(r&Ub)|0}}function mS(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let s=0;s<r.length;s++){let{h:i,l:o}=W$(r[s],e);[t[s],n[s]]=[i,o]}return[t,n]}var Ub,hS,bS,gS,xS,yS,wS=se(()=>{Ub=BigInt(4294967295),hS=BigInt(32);bS=(r,e,t)=>r<<t|e>>>32-t,gS=(r,e,t)=>e<<t|r>>>32-t,xS=(r,e,t)=>e<<t-32|r>>>64-t,yS=(r,e,t)=>r<<t-32|e>>>64-t});var Fb,AS=se(()=>{Fb=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});function Q$(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function Fo(r){if(typeof r=="string"&&(r=Q$(r)),!ES(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}function TS(...r){let e=new Uint8Array(r.reduce((n,s)=>n+s.length,0)),t=0;return r.forEach(n=>{if(!ES(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}function Hb(r){let e=n=>r().update(Fo(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}function PS(r){let e=(n,s)=>r(s).update(Fo(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}function kS(r=32){if(Fb&&typeof Fb.getRandomValues=="function")return Fb.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}var ES,vS,Db,ys,J$,Uo,rY,sl=se(()=>{AS();ES=r=>r instanceof Uint8Array,vS=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4)),Db=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),ys=(r,e)=>r<<32-e|r>>>e,J$=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!J$)throw new Error("Non little-endian hardware is not supported");Uo=class{clone(){return this._cloneInto()}},rY={}.toString});function sq(r,e=24){let t=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)t[o]=r[o]^r[o+10]^r[o+20]^r[o+30]^r[o+40];for(let o=0;o<10;o+=2){let a=(o+8)%10,c=(o+2)%10,u=t[c],l=t[c+1],f=BS(u,l,1)^t[a],d=SS(u,l,1)^t[a+1];for(let h=0;h<50;h+=10)r[o+h]^=f,r[o+h+1]^=d}let s=r[2],i=r[3];for(let o=0;o<24;o++){let a=_S[o],c=BS(s,i,a),u=SS(s,i,a),l=OS[o];s=r[l],i=r[l+1],r[l]=c,r[l+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)t[a]=r[o+a];for(let a=0;a<10;a++)r[o+a]^=~t[(a+2)%10]&t[(a+4)%10]}r[0]^=rq[n],r[1]^=nq[n]}t.fill(0)}var OS,_S,CS,Y$,Kd,Z$,X$,eq,tq,rq,nq,BS,SS,il,Do,aY,cY,uY,lY,fY,NS,dY,pY,IS,hY,mY,RS=se(()=>{jb();wS();sl();[OS,_S,CS]=[[],[],[]],Y$=BigInt(0),Kd=BigInt(1),Z$=BigInt(2),X$=BigInt(7),eq=BigInt(256),tq=BigInt(113);for(let r=0,e=Kd,t=1,n=0;r<24;r++){[t,n]=[n,(2*t+3*n)%5],OS.push(2*(5*n+t)),_S.push((r+1)*(r+2)/2%64);let s=Y$;for(let i=0;i<7;i++)e=(e<<Kd^(e>>X$)*tq)%eq,e&Z$&&(s^=Kd<<(Kd<<BigInt(i))-Kd);CS.push(s)}[rq,nq]=mS(CS,!0),BS=(r,e,t)=>t>32?xS(r,e,t):bS(r,e,t),SS=(r,e,t)=>t>32?yS(r,e,t):gS(r,e,t);il=class extends Uo{constructor(e,t,n,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,zd(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=vS(this.state)}keccak(){sq(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Mi(this);let{blockLen:t,state:n}=this;e=Fo(e);let s=e.length;for(let i=0;i<s;){let o=Math.min(t-this.pos,s-i);for(let a=0;a<o;a++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:s}=this;e[n]^=t,(t&128)!==0&&n===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){Mi(this,!1),Vd(e),this.finish();let t=this.state,{blockLen:n}=this;for(let s=0,i=e.length;s<i;){this.posOut>=n&&this.keccak();let o=Math.min(n-this.posOut,i-s);e.set(t.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return zd(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Lb(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:n,outputLen:s,rounds:i,enableXOF:o}=this;return e||(e=new il(t,n,s,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}},Do=(r,e,t)=>Hb(()=>new il(e,r,t)),aY=Do(6,144,224/8),cY=Do(6,136,256/8),uY=Do(6,104,384/8),lY=Do(6,72,512/8),fY=Do(1,144,224/8),NS=Do(1,136,256/8),dY=Do(1,104,384/8),pY=Do(1,72,512/8),IS=(r,e,t)=>PS((n={})=>new il(e,r,n.dkLen===void 0?t:n.dkLen,!0)),hY=IS(31,168,128/8),mY=IS(31,136,256/8)});function Bt(r,e){let t=e||"hex",n=NS(Ft(r,{strict:!1})?Lr(r):r);return t==="bytes"?n:Ce(n)}var Li=se(()=>{RS();gs();Ar();De()});function MS(r){return iq(r)}var iq,LS=se(()=>{Ar();Li();iq=r=>Bt(Lr(r))});function jS(r){let e=!0,t="",n=0,s="",i=!1;for(let o=0;o<r.length;o++){let a=r[o];if(["(",")",","].includes(a)&&(e=!0),a==="("&&n++,a===")"&&n--,!!e){if(n===0){if(a===" "&&["event","function",""].includes(s))s="";else if(s+=a,a===")"){i=!0;break}continue}if(a===" "){r[o-1]!==","&&t!==","&&t!==",("&&(t="",e=!1);continue}s+=a,t+=a}}if(!i)throw new z("Unable to normalize signature.");return s}var US=se(()=>{Je()});var FS,DS=se(()=>{n6();US();FS=r=>{let e=(()=>typeof r=="string"?r:Y2(r))();return jS(e)}});function $b(r){return MS(FS(r))}var i6=se(()=>{LS();DS()});var ol,qb=se(()=>{i6();ol=$b});var St,ji=se(()=>{Je();St=class extends z{constructor({address:e}){super(`Address "${e}" 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"})}}});var Ho,Gb=se(()=>{Ho=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}set(e,t){return super.set(e,t),this.maxSize&&this.size>this.maxSize&&this.delete(this.keys().next().value),this}}});function zb(r,e){if(o6.has(`${r}.${e}`))return o6.get(`${r}.${e}`);let t=e?`${e}${r.toLowerCase()}`:r.substring(2).toLowerCase(),n=Bt(Qr(t),"bytes"),s=(e?t.substring(`${e}0x`.length):t).split("");for(let o=0;o<40;o+=2)n[o>>1]>>4>=8&&s[o]&&(s[o]=s[o].toUpperCase()),(n[o>>1]&15)>=8&&s[o+1]&&(s[o+1]=s[o+1].toUpperCase());let i=`0x${s.join("")}`;return o6.set(`${r}.${e}`,i),i}var o6,a6=se(()=>{Ar();Li();Gb();o6=new Ho(8192)});function Et(r,e){let{strict:t=!0}=e??{},n=`${r}.${t}`;if(c6.has(n))return c6.get(n);let s=(()=>oq.test(r)?r.toLowerCase()===r?!0:t?zb(r)===r:!0:!1)();return c6.set(n,s),s}var oq,c6,Ys=se(()=>{Gb();a6();oq=/^0x[a-fA-F0-9]{40}$/,c6=new Ho(8192)});function jr(r){return typeof r[0]=="string"?ws(r):aq(r)}function aq(r){let e=0;for(let s of r)e+=s.length;let t=new Uint8Array(e),n=0;for(let s of r)t.set(s,n),n+=s.length;return t}function ws(r){return`0x${r.reduce((e,t)=>e+t.replace("0x",""),"")}`}var Zs=se(()=>{});function Ui(r,e,t,{strict:n}={}){return Ft(r,{strict:!1})?cq(r,e,t,{strict:n}):u6(r,e,t,{strict:n})}function HS(r,e){if(typeof e=="number"&&e>0&&e>rt(r)-1)throw new Dd({offset:e,position:"start",size:rt(r)})}function $S(r,e,t){if(typeof e=="number"&&typeof t=="number"&&rt(r)!==t-e)throw new Dd({offset:t,position:"end",size:rt(r)})}function u6(r,e,t,{strict:n}={}){HS(r,e);let s=r.slice(e,t);return n&&$S(s,e,t),s}function cq(r,e,t,{strict:n}={}){HS(r,e);let s=`0x${r.replace("0x","").slice((e??0)*2,(t??r.length)*2)}`;return n&&$S(s,e,t),s}var al=se(()=>{_b();gs();Ks()});function As(r,e){if(r.length!==e.length)throw new Ab({expectedLength:r.length,givenLength:e.length});let t=uq({params:r,values:e}),n=f6(t);return n.length===0?"0x":n}function uq({params:r,values:e}){let t=[];for(let n=0;n<r.length;n++)t.push(l6({param:r[n],value:e[n]}));return t}function l6({param:r,value:e}){let t=Vb(r.type);if(t){let[n,s]=t;return fq(e,{length:n,param:{...r,type:s}})}if(r.type==="tuple")return bq(e,{param:r});if(r.type==="address")return lq(e);if(r.type==="bool")return pq(e);if(r.type.startsWith("uint")||r.type.startsWith("int")){let n=r.type.startsWith("int");return hq(e,{signed:n})}if(r.type.startsWith("bytes"))return dq(e,{param:r});if(r.type==="string")return mq(e);throw new kb(r.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function f6(r){let e=0;for(let i=0;i<r.length;i++){let{dynamic:o,encoded:a}=r[i];o?e+=32:e+=rt(a)}let t=[],n=[],s=0;for(let i=0;i<r.length;i++){let{dynamic:o,encoded:a}=r[i];o?(t.push(Ae(e+s,{size:32})),n.push(a),s+=rt(a)):t.push(a)}return jr([...t,...n])}function lq(r){if(!Et(r))throw new St({address:r});return{dynamic:!1,encoded:Ii(r.toLowerCase())}}function fq(r,{length:e,param:t}){let n=e===null;if(!Array.isArray(r))throw new Sb(r);if(!n&&r.length!==e)throw new yb({expectedLength:e,givenLength:r.length,type:`${t.type}[${e}]`});let s=!1,i=[];for(let o=0;o<r.length;o++){let a=l6({param:t,value:r[o]});a.dynamic&&(s=!0),i.push(a)}if(n||s){let o=f6(i);if(n){let a=Ae(i.length,{size:32});return{dynamic:!0,encoded:i.length>0?jr([a,o]):a}}if(s)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:jr(i.map(({encoded:o})=>o))}}function dq(r,{param:e}){let[,t]=e.type.split("bytes"),n=rt(r);if(!t){let s=r;return n%32!==0&&(s=Ii(s,{dir:"right",size:Math.ceil((r.length-2)/2/32)*32})),{dynamic:!0,encoded:jr([Ii(Ae(n,{size:32})),s])}}if(n!==Number.parseInt(t))throw new wb({expectedSize:Number.parseInt(t),value:r});return{dynamic:!1,encoded:Ii(r,{dir:"right"})}}function pq(r){if(typeof r!="boolean")throw new z(`Invalid boolean value: "${r}" (type: ${typeof r}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Ii(s6(r))}}function hq(r,{signed:e}){return{dynamic:!1,encoded:Ae(r,{size:32,signed:e})}}function mq(r){let e=Gd(r),t=Math.ceil(rt(e)/32),n=[];for(let s=0;s<t;s++)n.push(Ii(Ui(e,s*32,(s+1)*32),{dir:"right"}));return{dynamic:!0,encoded:jr([Ii(Ae(rt(e),{size:32})),...n])}}function bq(r,{param:e}){let t=!1,n=[];for(let s=0;s<e.components.length;s++){let i=e.components[s],o=Array.isArray(r)?s:i.name,a=l6({param:i,value:r[o]});n.push(a),a.dynamic&&(t=!0)}return{dynamic:t,encoded:t?f6(n):jr(n.map(({encoded:s})=>s))}}function Vb(r){let e=r.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}var Ya=se(()=>{or();ji();Je();Ys();Zs();Cb();Ks();al();De()});var cl,Kb=se(()=>{al();i6();cl=r=>Ui($b(r),0,4)});function Xs(r){let{abi:e,args:t=[],name:n}=r,s=Ft(n,{strict:!1}),i=e.filter(a=>s?a.type==="function"?cl(a)===n:a.type==="event"?ol(a)===n:!1:"name"in a&&a.name===n);if(i.length===0)return;if(i.length===1)return i[0];let o;for(let a of i){if(!("inputs"in a))continue;if(!t||t.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==t.length)continue;if(t.every((u,l)=>{let f="inputs"in a&&a.inputs[l];return f?d6(u,f):!1})){if(o&&"inputs"in o&&o.inputs){let u=qS(a.inputs,o.inputs,t);if(u)throw new Tb({abiItem:a,type:u[0]},{abiItem:o,type:u[1]})}o=a}}return o||i[0]}function d6(r,e){let t=typeof r,n=e.type;switch(n){case"address":return Et(r,{strict:!1});case"bool":return t==="boolean";case"function":return t==="string";case"string":return t==="string";default:return n==="tuple"&&"components"in e?Object.values(e.components).every((s,i)=>d6(Object.values(r)[i],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?t==="number"||t==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?t==="string"||r instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(r)&&r.every(s=>d6(s,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function qS(r,e,t){for(let n in r){let s=r[n],i=e[n];if(s.type==="tuple"&&i.type==="tuple"&&"components"in s&&"components"in i)return qS(s.components,i.components,t[n]);let o=[s.type,i.type];if((()=>o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?Et(t[n],{strict:!1}):o.includes("address")&&o.includes("bytes")?Et(t[n],{strict:!1}):!1)())return o}}var ul=se(()=>{or();gs();Ys();qb();Kb()});function Er(r){return typeof r=="string"?{address:r,type:"json-rpc"}:r}var Fi=se(()=>{});function KS(r){let{abi:e,args:t,functionName:n}=r,s=e[0];if(n){let i=Xs({abi:e,args:t,name:n});if(!i)throw new Lo(n,{docsPath:VS});s=i}if(s.type!=="function")throw new Lo(void 0,{docsPath:VS});return{abi:[s],functionName:cl(Rr(s))}}var VS,WS=se(()=>{or();Kb();Ja();ul();VS="/docs/contract/encodeFunctionData"});function Yr(r){let{args:e}=r,{abi:t,functionName:n}=(()=>r.abi.length===1&&r.functionName?.startsWith("0x")?r:KS(r))(),s=t[0],i=n,o="inputs"in s&&s.inputs?As(s.inputs,e??[]):void 0;return ws([i,o??"0x"])}var qo=se(()=>{Zs();Ya();WS()});var Jb,JS,QS,Qb=se(()=>{Jb={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},JS={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},QS={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}});var Wd,ll,Yb,p6=se(()=>{Je();Wd=class extends z{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}},ll=class extends z{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}},Yb=class extends z{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}}});function fl(r,{recursiveReadLimit:e=8192}={}){let t=Object.create(gq);return t.bytes=r,t.dataView=new DataView(r.buffer,r.byteOffset,r.byteLength),t.positionReadCount=new Map,t.recursiveReadLimit=e,t}var gq,Zb=se(()=>{p6();gq={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new Yb({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(r){if(r<0||r>this.bytes.length-1)throw new ll({length:this.bytes.length,position:r})},decrementPosition(r){if(r<0)throw new Wd({offset:r});let e=this.position-r;this.assertPosition(e),this.position=e},getReadCount(r){return this.positionReadCount.get(r||this.position)||0},incrementPosition(r){if(r<0)throw new Wd({offset:r});let e=this.position+r;this.assertPosition(e),this.position=e},inspectByte(r){let e=r??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(r,e){let t=e??this.position;return this.assertPosition(t+r-1),this.bytes.subarray(t,t+r)},inspectUint8(r){let e=r??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(r){let e=r??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(r){let e=r??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(r){let e=r??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(r){this.assertPosition(this.position),this.bytes[this.position]=r,this.position++},pushBytes(r){this.assertPosition(this.position+r.length-1),this.bytes.set(r,this.position),this.position+=r.length},pushUint8(r){this.assertPosition(this.position),this.bytes[this.position]=r,this.position++},pushUint16(r){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,r),this.position+=2},pushUint24(r){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,r>>8),this.dataView.setUint8(this.position+2,r&255),this.position+=3},pushUint32(r){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,r),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let r=this.inspectByte();return this.position++,r},readBytes(r,e){this.assertReadLimit(),this._touch();let t=this.inspectBytes(r);return this.position+=e??r,t},readUint8(){this.assertReadLimit(),this._touch();let r=this.inspectUint8();return this.position+=1,r},readUint16(){this.assertReadLimit(),this._touch();let r=this.inspectUint16();return this.position+=2,r},readUint24(){this.assertReadLimit(),this._touch();let r=this.inspectUint24();return this.position+=3,r},readUint32(){this.assertReadLimit(),this._touch();let r=this.inspectUint32();return this.position+=4,r},get remaining(){return this.bytes.length-this.position},setPosition(r){let e=this.position;return this.assertPosition(r),this.position=r,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let r=this.getReadCount();this.positionReadCount.set(this.position,r+1),r>0&&this.recursiveReadCount++}}});function YS(r,e={}){typeof e.size<"u"&&ln(r,{size:e.size});let t=tt(r,e);return dr(t,e)}function ZS(r,e={}){let t=r;if(typeof e.size<"u"&&(ln(t,{size:e.size}),t=Qs(t)),t.length>1||t[0]>1)throw new Ib(t);return Boolean(t[0])}function ti(r,e={}){typeof e.size<"u"&&ln(r,{size:e.size});let t=tt(r,e);return ar(t,e)}function XS(r,e={}){let t=r;return typeof e.size<"u"&&(ln(t,{size:e.size}),t=Qs(t,{dir:"right"})),new TextDecoder().decode(t)}var e9=se(()=>{Mb();qd();Mr();De()});function Za(r,e){let t=typeof e=="string"?fn(e):e,n=fl(t);if(rt(t)===0&&r.length>0)throw new Ws;if(rt(e)&&rt(e)<32)throw new tl({data:typeof e=="string"?e:tt(e),params:r,size:rt(e)});let s=0,i=[];for(let o=0;o<r.length;++o){let a=r[o];n.setPosition(s);let[c,u]=dl(n,a,{staticPosition:0});s+=u,i.push(c)}return i}function dl(r,e,{staticPosition:t}){let n=Vb(e.type);if(n){let[s,i]=n;return yq(r,{...e,type:i},{length:s,staticPosition:t})}if(e.type==="tuple")return vq(r,e,{staticPosition:t});if(e.type==="address")return xq(r);if(e.type==="bool")return wq(r);if(e.type.startsWith("bytes"))return Aq(r,e,{staticPosition:t});if(e.type.startsWith("uint")||e.type.startsWith("int"))return Eq(r,e);if(e.type==="string")return Tq(r,{staticPosition:t});throw new Bb(e.type,{docsPath:"/docs/contract/decodeAbiParameters"})}function xq(r){let e=r.readBytes(32);return[zb(tt(u6(e,-20))),32]}function yq(r,e,{length:t,staticPosition:n}){if(!t){let o=ti(r.readBytes(h6)),a=n+o,c=a+t9;r.setPosition(a);let u=ti(r.readBytes(t9)),l=Jd(e),f=0,d=[];for(let h=0;h<u;++h){r.setPosition(c+(l?h*32:f));let[b,p]=dl(r,e,{staticPosition:c});f+=p,d.push(b)}return r.setPosition(n+32),[d,32]}if(Jd(e)){let o=ti(r.readBytes(h6)),a=n+o,c=[];for(let u=0;u<t;++u){r.setPosition(a+u*32);let[l]=dl(r,e,{staticPosition:a});c.push(l)}return r.setPosition(n+32),[c,32]}let s=0,i=[];for(let o=0;o<t;++o){let[a,c]=dl(r,e,{staticPosition:n+s});s+=c,i.push(a)}return[i,s]}function wq(r){return[ZS(r.readBytes(32),{size:32}),32]}function Aq(r,e,{staticPosition:t}){let[n,s]=e.type.split("bytes");if(!s){let o=ti(r.readBytes(32));r.setPosition(t+o);let a=ti(r.readBytes(32));if(a===0)return r.setPosition(t+32),["0x",32];let c=r.readBytes(a);return r.setPosition(t+32),[tt(c),32]}return[tt(r.readBytes(Number.parseInt(s),32)),32]}function Eq(r,e){let t=e.type.startsWith("int"),n=Number.parseInt(e.type.split("int")[1]||"256"),s=r.readBytes(32);return[n>48?YS(s,{signed:t}):ti(s,{signed:t}),32]}function vq(r,e,{staticPosition:t}){let n=e.components.length===0||e.components.some(({name:o})=>!o),s=n?[]:{},i=0;if(Jd(e)){let o=ti(r.readBytes(h6)),a=t+o;for(let c=0;c<e.components.length;++c){let u=e.components[c];r.setPosition(a+i);let[l,f]=dl(r,u,{staticPosition:a});i+=f,s[n?c:u?.name]=l}return r.setPosition(t+32),[s,32]}for(let o=0;o<e.components.length;++o){let a=e.components[o],[c,u]=dl(r,a,{staticPosition:t});s[n?o:a?.name]=c,i+=u}return[s,i]}function Tq(r,{staticPosition:e}){let t=ti(r.readBytes(32)),n=e+t;r.setPosition(n);let s=ti(r.readBytes(32));if(s===0)return r.setPosition(e+32),["",32];let i=r.readBytes(s,32),o=XS(Qs(i));return r.setPosition(e+32),[o,32]}function Jd(r){let{type:e}=r;if(e==="string"||e==="bytes"||e.endsWith("[]"))return!0;if(e==="tuple")return r.components?.some(Jd);let t=Vb(r.type);return!!(t&&Jd({...r,type:t[1]}))}var t9,h6,Xb=se(()=>{or();a6();Zb();Ks();al();qd();e9();Ar();De();Ya();t9=32,h6=32});function eg(r){let{abi:e,data:t}=r,n=Ui(t,0,4);if(n==="0x")throw new Ws;let i=[...e||[],JS,QS].find(o=>o.type==="error"&&n===cl(Rr(o)));if(!i)throw new rl(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:i,args:"inputs"in i&&i.inputs&&i.inputs.length>0?Za(i.inputs,Ui(t,4)):void 0,errorName:i.name}}var m6=se(()=>{Qb();or();al();Kb();Xb();Ja()});var nt,dn=se(()=>{nt=(r,e,t)=>JSON.stringify(r,(n,s)=>{let i=typeof s=="bigint"?s.toString():s;return typeof e=="function"?e(n,i):i},t)});function b6({abiItem:r,args:e,includeFunctionName:t=!0,includeName:n=!1}){if("name"in r&&"inputs"in r&&!!r.inputs)return`${t?r.name:""}(${r.inputs.map((s,i)=>`${n&&s.name?`${s.name}: `:""}${typeof e[i]=="object"?nt(e[i]):e[i]}`).join(", ")})`}var r9=se(()=>{dn()});var n9,s9,g6=se(()=>{n9={gwei:9,wei:18},s9={ether:-9,wei:9}});function tg(r,e){let t=r.toString(),n=t.startsWith("-");n&&(t=t.slice(1)),t=t.padStart(e,"0");let[s,i]=[t.slice(0,t.length-e),t.slice(t.length-e)];return i=i.replace(/(0+)$/,""),`${n?"-":""}${s||"0"}${i?`.${i}`:""}`}var x6=se(()=>{});function rg(r,e="wei"){return tg(r,n9[e])}var y6=se(()=>{g6();x6()});function Ur(r,e="wei"){return tg(r,s9[e])}var Qd=se(()=>{g6();x6()});function i9(r){return r.reduce((e,{slot:t,value:n})=>`${e} ${t}: ${n}
|
|
786
|
+
`,"")}function o9(r){return r.reduce((e,{address:t,...n})=>{let s=`${e} ${t}:
|
|
787
787
|
`;return n.nonce&&(s+=` nonce: ${n.nonce}
|
|
788
788
|
`),n.balance&&(s+=` balance: ${n.balance}
|
|
789
789
|
`),n.code&&(s+=` code: ${n.code}
|
|
790
790
|
`),n.state&&(s+=` state:
|
|
791
|
-
`,s+=
|
|
792
|
-
`,s+=
|
|
793
|
-
`).slice(0,-1)}var ng,sg,w6=se(()=>{
|
|
794
|
-
`)}var ig,og,ag,cg,pl,hl,Yd,ri=se(()=>{
|
|
795
|
-
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}},og=class extends z{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidLegacyVError"})}},ag=class extends z{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",ml(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}},cg=class extends z{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStorageKeySizeError"})}},pl=class extends z{constructor({blockHash:e,blockNumber:t,blockTag:n,hash:s,index:i}){let o="Transaction";n&&i!==void 0&&(o=`Transaction at block time "${n}" at index "${i}"`),e&&i!==void 0&&(o=`Transaction at block hash "${e}" at index "${i}"`),t&&i!==void 0&&(o=`Transaction at block number "${t}" at index "${i}"`),s&&(o=`Transaction with hash "${s}"`),super(`${o} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}},hl=class extends z{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}},Yd=class extends z{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}});var bl,ug,Xa,lg,fg,Go,ec=se(()=>{Fi();Qb();m6();
|
|
796
|
-
${
|
|
797
|
-
`):`The contract function "${n}" reverted.`,{cause:i,metaMessages:a}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o,this.reason=c,this.signature=u}},lg=class extends z{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}},fg=class extends z{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CounterfactualDeploymentFailedError"})}},Go=class extends z{constructor({data:e,message:t}){super(t||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}});var zn,gl,Zd,xl=se(()=>{dn();
|
|
798
|
-
`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}};Object.defineProperty(
|
|
799
|
-
`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}};Object.defineProperty(Vn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});Qo=class extends vr{constructor(e){super(e,{code:Qo.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}};Object.defineProperty(Qo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});Yo=class extends vr{constructor(e){super(e,{code:Yo.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}};Object.defineProperty(Yo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});Zo=class extends vr{constructor(e){super(e,{code:Zo.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}};Object.defineProperty(Zo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});Xo=class extends vr{constructor(e){super(e,{code:Xo.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}};Object.defineProperty(Xo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});Di=class extends vr{constructor(e){super(e,{code:Di.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}};Object.defineProperty(Di,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});ea=class extends vr{constructor(e){super(e,{code:ea.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}};Object.defineProperty(ea,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});Hi=class extends zo{constructor(e){super(e,{code:Hi.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}};Object.defineProperty(Hi,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});ta=class extends zo{constructor(e){super(e,{code:ta.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}};Object.defineProperty(ta,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});ra=class extends zo{constructor(e){super(e,{code:ra.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}};Object.defineProperty(ra,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});na=class extends zo{constructor(e){super(e,{code:na.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}};Object.defineProperty(na,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});sa=class extends zo{constructor(e){super(e,{code:sa.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}};Object.defineProperty(sa,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});ia=class extends zo{constructor(e){super(e,{code:ia.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}};Object.defineProperty(ia,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});dg=class extends vr{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}});var qi,Kn,yl,wl,Al,El,vl,Tl,Pl,kl,ni,oa,Bl=se(()=>{Qd();
|
|
791
|
+
`,s+=i9(n.state)),n.stateDiff&&(s+=` stateDiff:
|
|
792
|
+
`,s+=i9(n.stateDiff)),s},` State Override:
|
|
793
|
+
`).slice(0,-1)}var ng,sg,w6=se(()=>{Je();ng=class extends z{constructor({address:e}){super(`State for account "${e}" is set multiple times.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountStateConflictError"})}},sg=class extends z{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}}});function ml(r){let e=Object.entries(r).map(([n,s])=>s===void 0||s===!1?null:[n,s]).filter(Boolean),t=e.reduce((n,[s])=>Math.max(n,s.length),0);return e.map(([n,s])=>` ${`${n}:`.padEnd(t+1)} ${s}`).join(`
|
|
794
|
+
`)}var ig,og,ag,cg,pl,hl,Yd,ri=se(()=>{Je();ig=class extends z{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
|
|
795
|
+
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}},og=class extends z{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidLegacyVError"})}},ag=class extends z{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",ml(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}},cg=class extends z{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStorageKeySizeError"})}},pl=class extends z{constructor({blockHash:e,blockNumber:t,blockTag:n,hash:s,index:i}){let o="Transaction";n&&i!==void 0&&(o=`Transaction at block time "${n}" at index "${i}"`),e&&i!==void 0&&(o=`Transaction at block hash "${e}" at index "${i}"`),t&&i!==void 0&&(o=`Transaction at block number "${t}" at index "${i}"`),s&&(o=`Transaction with hash "${s}"`),super(`${o} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}},hl=class extends z{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}},Yd=class extends z{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}});var bl,ug,Xa,lg,fg,Go,ec=se(()=>{Fi();Qb();m6();Ja();r9();ul();y6();Qd();or();Je();w6();ri();jd();bl=class extends z{constructor(e,{account:t,docsPath:n,chain:s,data:i,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:l,to:f,value:d,stateOverride:h}){let b=t?Er(t):void 0,p=ml({from:b?.address,to:f,value:typeof d<"u"&&`${rg(d)} ${s?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:o,gasPrice:typeof a<"u"&&`${Ur(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Ur(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${Ur(u)} gwei`,nonce:l});h&&(p+=`
|
|
796
|
+
${o9(h)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",p].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=e}},ug=class extends z{constructor(e,{abi:t,args:n,contractAddress:s,docsPath:i,functionName:o,sender:a}){let c=Xs({abi:t,args:n,name:o}),u=c?b6({abiItem:c,args:n,includeFunctionName:!1,includeName:!1}):void 0,l=c?Rr(c,{includeName:!0}):void 0,f=ml({address:s&&uS(s),function:l,args:u&&u!=="()"&&`${[...Array(o?.length??0).keys()].map(()=>" ").join("")}${u}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:e,docsPath:i,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Contract Call:",f].filter(Boolean)}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{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,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=t,this.args=n,this.cause=e,this.contractAddress=s,this.functionName=o,this.sender=a}},Xa=class extends z{constructor({abi:e,data:t,functionName:n,message:s}){let i,o,a,c;if(t&&t!=="0x")try{o=eg({abi:e,data:t});let{abiItem:l,errorName:f,args:d}=o;if(f==="Error")c=d[0];else if(f==="Panic"){let[h]=d;c=Jb[h]}else{let h=l?Rr(l,{includeName:!0}):void 0,b=l&&d?b6({abiItem:l,args:d,includeFunctionName:!1,includeName:!1}):void 0;a=[h?`Error: ${h}`:"",b&&b!=="()"?` ${[...Array(f?.length??0).keys()].map(()=>" ").join("")}${b}`:""]}}catch(l){i=l}else s&&(c=s);let u;i instanceof rl&&(u=i.signature,a=[`Unable to decode signature "${u}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${u}.`]),super(c&&c!=="execution reverted"||u?[`The contract function "${n}" reverted with the following ${u?"signature":"reason"}:`,c||u].join(`
|
|
797
|
+
`):`The contract function "${n}" reverted.`,{cause:i,metaMessages:a}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o,this.reason=c,this.signature=u}},lg=class extends z{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}},fg=class extends z{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CounterfactualDeploymentFailedError"})}},Go=class extends z{constructor({data:e,message:t}){super(t||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}});var zn,gl,Zd,xl=se(()=>{dn();Je();jd();zn=class extends z{constructor({body:e,details:t,headers:n,status:s,url:i}){super("HTTP request failed.",{details:t,metaMessages:[s&&`Status: ${s}`,`URL: ${Qa(i)}`,e&&`Request body: ${nt(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=n,this.status=s,this.url=i}},gl=class extends z{constructor({body:e,error:t,url:n}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${Qa(n)}`,`Request body: ${nt(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code}},Zd=class extends z{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${Qa(t)}`,`Request body: ${nt(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}});var Pq,vr,zo,Vo,Ko,Wo,Jo,Es,Vn,Qo,Yo,Zo,Xo,Di,ea,Hi,ta,ra,na,sa,ia,dg,Xd=se(()=>{Je();xl();Pq=-1,vr=class extends z{constructor(e,{code:t,docsPath:n,metaMessages:s,shortMessage:i}){super(i,{cause:e,docsPath:n,metaMessages:s||e?.metaMessages}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof gl?e.code:t??Pq}},zo=class extends vr{constructor(e,t){super(e,t),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}},Vo=class extends vr{constructor(e){super(e,{code:Vo.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}};Object.defineProperty(Vo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});Ko=class extends vr{constructor(e){super(e,{code:Ko.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}};Object.defineProperty(Ko,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});Wo=class extends vr{constructor(e){super(e,{code:Wo.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}};Object.defineProperty(Wo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});Jo=class extends vr{constructor(e){super(e,{code:Jo.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
|
|
798
|
+
`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}};Object.defineProperty(Jo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});Es=class extends vr{constructor(e){super(e,{code:Es.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}};Object.defineProperty(Es,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});Vn=class extends vr{constructor(e){super(e,{code:Vn.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
|
|
799
|
+
`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}};Object.defineProperty(Vn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});Qo=class extends vr{constructor(e){super(e,{code:Qo.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}};Object.defineProperty(Qo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});Yo=class extends vr{constructor(e){super(e,{code:Yo.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}};Object.defineProperty(Yo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});Zo=class extends vr{constructor(e){super(e,{code:Zo.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}};Object.defineProperty(Zo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});Xo=class extends vr{constructor(e){super(e,{code:Xo.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}};Object.defineProperty(Xo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});Di=class extends vr{constructor(e){super(e,{code:Di.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}};Object.defineProperty(Di,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});ea=class extends vr{constructor(e){super(e,{code:ea.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}};Object.defineProperty(ea,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});Hi=class extends zo{constructor(e){super(e,{code:Hi.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}};Object.defineProperty(Hi,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});ta=class extends zo{constructor(e){super(e,{code:ta.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}};Object.defineProperty(ta,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});ra=class extends zo{constructor(e){super(e,{code:ra.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}};Object.defineProperty(ra,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});na=class extends zo{constructor(e){super(e,{code:na.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}};Object.defineProperty(na,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});sa=class extends zo{constructor(e){super(e,{code:sa.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}};Object.defineProperty(sa,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});ia=class extends zo{constructor(e){super(e,{code:ia.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}};Object.defineProperty(ia,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});dg=class extends vr{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}});var qi,Kn,yl,wl,Al,El,vl,Tl,Pl,kl,ni,oa,Bl=se(()=>{Qd();Je();qi=class extends z{constructor({cause:e,message:t}={}){let n=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}};Object.defineProperty(qi,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(qi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});Kn=class extends z{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${Ur(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}};Object.defineProperty(Kn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});yl=class extends z{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${Ur(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}};Object.defineProperty(yl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});wl=class extends z{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}};Object.defineProperty(wl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});Al=class extends z{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
|
|
800
800
|
`),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}};Object.defineProperty(Al,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});El=class extends z{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}};Object.defineProperty(El,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});vl=class extends z{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
|
|
801
801
|
`),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}};Object.defineProperty(vl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});Tl=class extends z{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}};Object.defineProperty(Tl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});Pl=class extends z{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}};Object.defineProperty(Pl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});kl=class extends z{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}};Object.defineProperty(kl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});ni=class extends z{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${Ur(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${Ur(n)} gwei`:""}).`].join(`
|
|
802
|
-
`),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}};Object.defineProperty(ni,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});oa=class extends z{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}});function hg(r,e){let t=(r.details||"").toLowerCase(),n=r instanceof z?r.walk(s=>s.code===qi.code):r;return n instanceof z?new qi({cause:r,message:n.details}):qi.nodeMessage.test(t)?new qi({cause:r,message:r.details}):Kn.nodeMessage.test(t)?new Kn({cause:r,maxFeePerGas:e?.maxFeePerGas}):yl.nodeMessage.test(t)?new yl({cause:r,maxFeePerGas:e?.maxFeePerGas}):wl.nodeMessage.test(t)?new wl({cause:r,nonce:e?.nonce}):Al.nodeMessage.test(t)?new Al({cause:r,nonce:e?.nonce}):El.nodeMessage.test(t)?new El({cause:r,nonce:e?.nonce}):vl.nodeMessage.test(t)?new vl({cause:r}):Tl.nodeMessage.test(t)?new Tl({cause:r,gas:e?.gas}):Pl.nodeMessage.test(t)?new Pl({cause:r,gas:e?.gas}):kl.nodeMessage.test(t)?new kl({cause:r}):ni.nodeMessage.test(t)?new ni({cause:r,maxFeePerGas:e?.maxFeePerGas,maxPriorityFeePerGas:e?.maxPriorityFeePerGas}):new oa({cause:r})}var A6=se(()=>{We();Bl()});function mg(r,{format:e}){if(!e)return{};let t={};function n(i){let o=Object.keys(i);for(let a of o)a in r&&(t[a]=r[a]),i[a]&&typeof i[a]=="object"&&!Array.isArray(i[a])&&n(i[a])}let s=e(r||{});return n(s),t}var E6=se(()=>{});function Sl(r,e){return({exclude:t,format:n})=>({exclude:t,format:s=>{let i=e(s);if(t)for(let o of t)delete i[o];return{...i,...n(s)}},type:r})}var bg=se(()=>{});function gg(r){let e={};return typeof r.accessList<"u"&&(e.accessList=r.accessList),typeof r.blobVersionedHashes<"u"&&(e.blobVersionedHashes=r.blobVersionedHashes),typeof r.blobs<"u"&&(typeof r.blobs[0]!="string"?e.blobs=r.blobs.map(t=>tt(t)):e.blobs=r.blobs),typeof r.data<"u"&&(e.data=r.data),typeof r.from<"u"&&(e.from=r.from),typeof r.gas<"u"&&(e.gas=Ae(r.gas)),typeof r.gasPrice<"u"&&(e.gasPrice=Ae(r.gasPrice)),typeof r.maxFeePerBlobGas<"u"&&(e.maxFeePerBlobGas=Ae(r.maxFeePerBlobGas)),typeof r.maxFeePerGas<"u"&&(e.maxFeePerGas=Ae(r.maxFeePerGas)),typeof r.maxPriorityFeePerGas<"u"&&(e.maxPriorityFeePerGas=Ae(r.maxPriorityFeePerGas)),typeof r.nonce<"u"&&(e.nonce=Ae(r.nonce)),typeof r.to<"u"&&(e.to=r.to),typeof r.type<"u"&&(e.type=Bq[r.type]),typeof r.value<"u"&&(e.value=Ae(r.value)),e}var Bq,v6=se(()=>{De();Bq={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"}});function a9(r){if(!(!r||r.length===0))return r.reduce((e,{slot:t,value:n})=>{if(t.length!==66)throw new $d({size:t.length,targetSize:66,type:"hex"});if(n.length!==66)throw new $d({size:n.length,targetSize:66,type:"hex"});return e[t]=n,e},{})}function Sq(r){let{balance:e,nonce:t,state:n,stateDiff:s,code:i}=r,o={};if(i!==void 0&&(o.code=i),e!==void 0&&(o.balance=Ae(e)),t!==void 0&&(o.nonce=Ae(t)),n!==void 0&&(o.state=a9(n)),s!==void 0){if(o.state)throw new sg;o.stateDiff=a9(s)}return o}function xg(r){if(!r)return;let e={};for(let{address:t,...n}of r){if(!Et(t,{strict:!1}))throw new St({address:t});if(e[t])throw new ng({address:t});e[t]=Sq(n)}return e}var T6=se(()=>{ji();_b();w6();Ys();De()});function Ol(r){let{account:e,gasPrice:t,maxFeePerGas:n,maxPriorityFeePerGas:s,to:i}=r,o=e?Er(e):void 0;if(o&&!Et(o.address))throw new St({address:o.address});if(i&&!Et(i))throw new St({address:i});if(typeof t<"u"&&(typeof n<"u"||typeof s<"u"))throw new ig;if(n&&n>2n**256n-1n)throw new Kn({maxFeePerGas:n});if(s&&n&&s>n)throw new ni({maxFeePerGas:n,maxPriorityFeePerGas:s})}var yg=se(()=>{Fi();ji();Bl();ri();Ys()});function Oq(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);let s=BigInt(32),i=BigInt(4294967295),o=Number(t>>s&i),a=Number(t&i),c=n?4:0,u=n?0:4;r.setUint32(e+c,o,n),r.setUint32(e+u,a,n)}var Tg,d9=se(()=>{jb();sl();Tg=class extends Uo{constructor(e,t,n,s){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Db(this.buffer)}update(e){Mi(this);let{view:t,buffer:n,blockLen:s}=this;e=Fo(e);let i=e.length;for(let o=0;o<i;){let a=Math.min(s-this.pos,i-o);if(a===s){let c=Db(e);for(;s<=i-o;o+=s)this.process(c,o);continue}n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Mi(this),Lb(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:s,isLE:i}=this,{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(n,0),o=0);for(let f=o;f<s;f++)t[f]=0;Oq(n,s-8,BigInt(this.length*8),i),this.process(n,0);let a=Db(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let u=c/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)a.setUint32(4*f,l[f],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:n,length:s,finished:i,destroyed:o,pos:a}=this;return e.length=s,e.pos=a,e.finished=i,e.destroyed=o,s%t&&e.buffer.set(n),e}}});var _q,Cq,Nq,ca,ua,B6,Pg,S6=se(()=>{d9();sl();_q=(r,e,t)=>r&e^~r&t,Cq=(r,e,t)=>r&e^r&t^e&t,Nq=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ca=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ua=new Uint32Array(64),B6=class extends Tg{constructor(){super(64,32,8,!1),this.A=ca[0]|0,this.B=ca[1]|0,this.C=ca[2]|0,this.D=ca[3]|0,this.E=ca[4]|0,this.F=ca[5]|0,this.G=ca[6]|0,this.H=ca[7]|0}get(){let{A:e,B:t,C:n,D:s,E:i,F:o,G:a,H:c}=this;return[e,t,n,s,i,o,a,c]}set(e,t,n,s,i,o,a,c){this.A=e|0,this.B=t|0,this.C=n|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,t){for(let f=0;f<16;f++,t+=4)ua[f]=e.getUint32(t,!1);for(let f=16;f<64;f++){let d=ua[f-15],h=ua[f-2],b=ys(d,7)^ys(d,18)^d>>>3,p=ys(h,17)^ys(h,19)^h>>>10;ua[f]=p+ua[f-7]+b+ua[f-16]|0}let{A:n,B:s,C:i,D:o,E:a,F:c,G:u,H:l}=this;for(let f=0;f<64;f++){let d=ys(a,6)^ys(a,11)^ys(a,25),h=l+d+_q(a,c,u)+Nq[f]+ua[f]|0,p=(ys(n,2)^ys(n,13)^ys(n,22))+Cq(n,s,i)|0;l=u,u=c,c=a,a=o+h|0,o=i,i=s,s=n,n=h+p|0}n=n+this.A|0,s=s+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(n,s,i,o,a,c,u,l)}roundClean(){ua.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},Pg=Hb(()=>new B6)});function Jn(r){let{abi:e,args:t,functionName:n,data:s}=r,i=e[0];if(n){let a=Xs({abi:e,args:t,name:n});if(!a)throw new Lo(n,{docsPath:O6});i=a}if(i.type!=="function")throw new Lo(void 0,{docsPath:O6});if(!i.outputs)throw new vb(i.name,{docsPath:O6});let o=Za(i.outputs,s);if(o&&o.length>1)return o;if(o&&o.length===1)return o[0]}var O6,rc=se(()=>{or();Xb();ul();O6="/docs/contract/decodeFunctionResult"});var t0,x9,Mg,y9,_6,C6,w9,nc=se(()=>{t0=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],x9=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],Mg=[...x9,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],y9=[...x9,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],_6=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],C6=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],w9=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}]});var A9,E9=se(()=>{A9="0x82ad56cb"});var v9,T9,P9,N6=se(()=>{v9="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",T9="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",P9="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572"});var sc,r0,Fl,Lg=se(()=>{We();sc=class extends z{constructor({blockNumber:e,chain:t,contract:n}){super(`Chain "${t.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}},r0=class extends z{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}},Fl=class extends z{constructor({chainId:e}){super(typeof e=="number"?`Chain ID "${e}" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidChainIdError"})}}});function n0(r){let{abi:e,args:t,bytecode:n}=r;if(!t||t.length===0)return n;let s=e.find(o=>"type"in o&&o.type==="constructor");if(!s)throw new xb({docsPath:I6});if(!("inputs"in s))throw new Ud({docsPath:I6});if(!s.inputs||s.inputs.length===0)throw new Ud({docsPath:I6});let i=As(s.inputs,t);return ws([n,i])}var I6,R6=se(()=>{or();Zs();Ya();I6="/docs/contract/encodeDeployData"});function Wn({blockNumber:r,chain:e,contract:t}){let n=e?.contracts?.[t];if(!n)throw new sc({chain:e,contract:{name:t}});if(r&&n.blockCreated&&n.blockCreated>r)throw new sc({blockNumber:r,chain:e,contract:{name:t,blockCreated:n.blockCreated}});return n.address}var ic=se(()=>{Lg()});function k9(r,{docsPath:e,...t}){let n=(()=>{let s=hg(r,t);return s instanceof oa?r:s})();return new bl(n,{docsPath:e,...t})}var B9=se(()=>{ec();Bl();A6()});function jg({fn:r,id:e,shouldSplitBatch:t,wait:n=0,sort:s}){let i=async()=>{let l=c();o();let f=l.map(({args:d})=>d);f.length!==0&&r(f).then(d=>{s&&Array.isArray(d)&&d.sort(s);for(let h=0;h<l.length;h++){let{pendingPromise:b}=l[h];b.resolve?.([d[h],d])}}).catch(d=>{for(let h=0;h<l.length;h++){let{pendingPromise:b}=l[h];b.reject?.(d)}})},o=()=>M6.delete(e),a=()=>c().map(({args:l})=>l),c=()=>M6.get(e)||[],u=l=>M6.set(e,[...c(),l]);return{flush:o,async schedule(l){let f={},d=new Promise((p,g)=>{f.resolve=p,f.reject=g});return t?.([...a(),l])&&i(),c().length>0?(u({args:l,pendingPromise:f}),d):(u({args:l,pendingPromise:f}),setTimeout(i,n),d)}}}var M6,L6=se(()=>{M6=new Map});var Ug,Fg,Dg,S9=se(()=>{dn();We();jd();Ug=class extends z{constructor({callbackSelector:e,cause:t,data:n,extraData:s,sender:i,urls:o}){super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],t.metaMessages?.length?"":[],"Offchain Gateway Call:",o&&[" Gateway URL(s):",...o.map(a=>` ${Qa(a)}`)],` Sender: ${i}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${s}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}},Fg=class extends z{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${Qa(t)}`,`Response: ${nt(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}},Dg=class extends z{constructor({sender:e,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}});function Hg(r,e){if(!Et(r,{strict:!1}))throw new St({address:r});if(!Et(e,{strict:!1}))throw new St({address:e});return r.toLowerCase()===e.toLowerCase()}var j6=se(()=>{ji();Ys()});var C9={};hx(C9,{ccipRequest:()=>_9,offchainLookup:()=>Uq,offchainLookupAbiItem:()=>O9,offchainLookupSignature:()=>jq});async function Uq(r,{blockNumber:e,blockTag:t,data:n,to:s}){let{args:i}=eg({data:n,abi:[O9]}),[o,a,c,u,l]=i,{ccipRead:f}=r,d=f&&typeof f?.request=="function"?f.request:_9;try{if(!Hg(s,o))throw new Dg({sender:o,to:s});let h=await d({data:c,sender:o,urls:a}),{data:b}=await si(r,{blockNumber:e,blockTag:t,data:jr([u,As([{type:"bytes"},{type:"bytes"}],[h,l])]),to:s});return b}catch(h){throw new Ug({callbackSelector:u,cause:h,data:n,extraData:l,sender:o,urls:a})}}async function _9({data:r,sender:e,urls:t}){let n=new Error("An unknown error occurred.");for(let s=0;s<t.length;s++){let i=t[s],o=i.includes("{data}")?"GET":"POST",a=o==="POST"?{data:r,sender:e}:void 0;try{let c=await fetch(i.replace("{sender}",e).replace("{data}",r),{body:JSON.stringify(a),method:o}),u;if(c.headers.get("Content-Type")?.startsWith("application/json")?u=(await c.json()).data:u=await c.text(),!c.ok){n=new zn({body:a,details:u?.error?nt(u.error):c.statusText,headers:c.headers,status:c.status,url:i});continue}if(!Ft(u)){n=new Fg({result:u,url:i});continue}return u}catch(c){n=new zn({body:a,details:c.message,url:i})}}throw n}var jq,O9,N9=se(()=>{Dl();S9();xl();m6();Ya();j6();Zs();gs();dn();jq="0x556f1830",O9={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]}});async function si(r,e){let{account:t=r.account,batch:n=Boolean(r.batch?.multicall),blockNumber:s,blockTag:i="latest",accessList:o,blobs:a,code:c,data:u,factory:l,factoryData:f,gas:d,gasPrice:h,maxFeePerBlobGas:b,maxFeePerGas:p,maxPriorityFeePerGas:g,nonce:m,to:y,value:E,stateOverride:v,...k}=e,w=t?Er(t):void 0;if(c&&(l||f))throw new z("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(c&&y)throw new z("Cannot provide both `code` & `to` as parameters.");let P=c&&u,B=l&&f&&y&&u,Z=P||B,_=(()=>P?Hq({code:c,data:u}):B?$q({data:u,factory:l,factoryData:f,to:y}):u)();try{Ol(e);let S=(s?Ae(s):void 0)||i,F=xg(v),G=r.chain?.formatters?.transactionRequest?.format,L=(G||gg)({...mg(k,{format:G}),from:w?.address,accessList:o,blobs:a,data:_,gas:d,gasPrice:h,maxFeePerBlobGas:b,maxFeePerGas:p,maxPriorityFeePerGas:g,nonce:m,to:Z?void 0:y,value:E});if(n&&Fq({request:L})&&!F)try{return await Dq(r,{...L,blockNumber:s,blockTag:i})}catch(oe){if(!(oe instanceof r0)&&!(oe instanceof sc))throw oe}let Y=await r.request({method:"eth_call",params:F?[L,S,F]:[L,S]});return Y==="0x"?{data:void 0}:{data:Y}}catch(O){let S=qq(O),{offchainLookup:F,offchainLookupSignature:G}=await Promise.resolve().then(()=>(N9(),C9));if(r.ccipRead!==!1&&S?.slice(0,10)===G&&y)return{data:await F(r,{data:S,to:y})};throw Z&&S?.slice(0,10)==="0x101bb98d"?new fg({factory:l}):k9(O,{...e,account:w,chain:r.chain})}}function Fq({request:r}){let{data:e,to:t,...n}=r;return!(!e||e.startsWith(A9)||!t||Object.values(n).filter(s=>typeof s<"u").length>0)}async function Dq(r,e){let{batchSize:t=1024,wait:n=0}=typeof r.batch?.multicall=="object"?r.batch.multicall:{},{blockNumber:s,blockTag:i="latest",data:o,multicallAddress:a,to:c}=e,u=a;if(!u){if(!r.chain)throw new r0;u=Wn({blockNumber:s,chain:r.chain,contract:"multicall3"})}let f=(s?Ae(s):void 0)||i,{schedule:d}=jg({id:`${r.uid}.${f}`,wait:n,shouldSplitBatch(p){return p.reduce((m,{data:y})=>m+(y.length-2),0)>t*2},fn:async p=>{let g=p.map(E=>({allowFailure:!0,callData:E.data,target:E.to})),m=Yr({abi:t0,args:[g],functionName:"aggregate3"}),y=await r.request({method:"eth_call",params:[{data:m,to:u},f]});return Jn({abi:t0,args:[g],functionName:"aggregate3",data:y||"0x"})}}),[{returnData:h,success:b}]=await d({data:o,to:c});if(!b)throw new Go({data:h});return h==="0x"?{data:void 0}:{data:h}}function Hq(r){let{code:e,data:t}=r;return n0({abi:bb(["constructor(bytes, bytes)"]),bytecode:v9,args:[e,t]})}function $q(r){let{data:e,factory:t,factoryData:n,to:s}=r;return n0({abi:bb(["constructor(address, bytes, address, bytes)"]),bytecode:T9,args:[s,e,t,n]})}function qq(r){if(!(r instanceof z))return;let e=r.walk();return typeof e?.data=="object"?e.data?.data:e.data}var Dl=se(()=>{n6();Fi();nc();E9();N6();We();Lg();ec();rc();R6();qo();ic();De();B9();E6();v6();L6();T6();yg()});var Y6={};hx(Y6,{bitGet:()=>yG,bitLen:()=>xG,bitMask:()=>a0,bitSet:()=>wG,bytesToHex:()=>oc,bytesToNumberBE:()=>Gi,bytesToNumberLE:()=>ix,concatBytes:()=>zl,createHmacDrbg:()=>Q6,ensureBytes:()=>pn,equalBytes:()=>W6,hexToBytes:()=>ac,hexToNumber:()=>J6,numberToBytesBE:()=>ma,numberToBytesLE:()=>ox,numberToHexUnpadded:()=>MO,numberToVarBytesBE:()=>bG,utf8ToBytes:()=>gG,validateObject:()=>ba});function oc(r){if(!sx(r))throw new Error("Uint8Array expected");let e="";for(let t=0;t<r.length;t++)e+=mG[r[t]];return e}function MO(r){let e=r.toString(16);return e.length&1?`0${e}`:e}function J6(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}function ac(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let e=r.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let t=new Uint8Array(e/2);for(let n=0;n<t.length;n++){let s=n*2,i=r.slice(s,s+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[n]=o}return t}function Gi(r){return J6(oc(r))}function ix(r){if(!sx(r))throw new Error("Uint8Array expected");return J6(oc(Uint8Array.from(r).reverse()))}function ma(r,e){return ac(r.toString(16).padStart(e*2,"0"))}function ox(r,e){return ma(r,e).reverse()}function bG(r){return ac(MO(r))}function pn(r,e,t){let n;if(typeof e=="string")try{n=ac(e)}catch(i){throw new Error(`${r} must be valid hex string, got "${e}". Cause: ${i}`)}else if(sx(e))n=Uint8Array.from(e);else throw new Error(`${r} must be hex string or Uint8Array`);let s=n.length;if(typeof t=="number"&&s!==t)throw new Error(`${r} expected ${t} bytes, got ${s}`);return n}function zl(...r){let e=new Uint8Array(r.reduce((n,s)=>n+s.length,0)),t=0;return r.forEach(n=>{if(!sx(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}function W6(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}function gG(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function xG(r){let e;for(e=0;r>RO;r>>=nx,e+=1);return e}function yG(r,e){return r>>BigInt(e)&nx}function Q6(r,e,t){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let n=K6(r),s=K6(r),i=0,o=()=>{n.fill(1),s.fill(0),i=0},a=(...f)=>t(s,n,...f),c=(f=K6())=>{s=a(IO([0]),f),n=a(),f.length!==0&&(s=a(IO([1]),f),n=a())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let f=0,d=[];for(;f<e;){n=a();let h=n.slice();d.push(h),f+=n.length}return zl(...d)};return(f,d)=>{o(),c(f);let h;for(;!(h=d(u()));)c();return o(),h}}function ba(r,e,t={}){let n=(s,i,o)=>{let a=AG[i];if(typeof a!="function")throw new Error(`Invalid validator "${i}", expected function`);let c=r[s];if(!(o&&c===void 0)&&!a(c,r))throw new Error(`Invalid param ${String(s)}=${c} (${typeof c}), expected ${i}`)};for(let[s,i]of Object.entries(e))n(s,i,!1);for(let[s,i]of Object.entries(t))n(s,i,!0);return r}var RO,nx,hG,sx,mG,wG,a0,K6,IO,AG,Vl=se(()=>{RO=BigInt(0),nx=BigInt(1),hG=BigInt(2),sx=r=>r instanceof Uint8Array,mG=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));wG=(r,e,t)=>r|(t?nx:RO)<<BigInt(e),a0=r=>(hG<<BigInt(r-1))-nx,K6=r=>new Uint8Array(r),IO=r=>Uint8Array.from(r);AG={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||r instanceof Uint8Array,isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)}});function Tr(r,e){let t=r%e;return t>=Zt?t:e+t}function PG(r,e,t){if(t<=Zt||e<Zt)throw new Error("Expected power/modulo > 0");if(t===Rt)return Zt;let n=Rt;for(;e>Zt;)e&Rt&&(n=n*r%t),r=r*r%t,e>>=Rt;return n}function hn(r,e,t){let n=r;for(;e-- >Zt;)n*=n,n%=t;return n}function ax(r,e){if(r===Zt||e<=Zt)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let t=Tr(r,e),n=e,s=Zt,i=Rt,o=Rt,a=Zt;for(;t!==Zt;){let u=n/t,l=n%t,f=s-o*u,d=i-a*u;n=t,t=l,s=o,i=a,o=f,a=d}if(n!==Rt)throw new Error("invert: does not exist");return Tr(s,e)}function kG(r){let e=(r-Rt)/cc,t,n,s;for(t=r-Rt,n=0;t%cc===Zt;t/=cc,n++);for(s=cc;s<r&&PG(s,e,r)!==r-Rt;s++);if(n===1){let o=(r+Rt)/Z6;return function(c,u){let l=c.pow(u,o);if(!c.eql(c.sqr(l),u))throw new Error("Cannot find square root");return l}}let i=(t+Rt)/cc;return function(a,c){if(a.pow(c,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let u=n,l=a.pow(a.mul(a.ONE,s),t),f=a.pow(c,i),d=a.pow(c,t);for(;!a.eql(d,a.ONE);){if(a.eql(d,a.ZERO))return a.ZERO;let h=1;for(let p=a.sqr(d);h<u&&!a.eql(p,a.ONE);h++)p=a.sqr(p);let b=a.pow(l,Rt<<BigInt(u-h-1));l=a.sqr(b),f=a.mul(f,b),d=a.mul(d,l),u=h}return f}}function BG(r){if(r%Z6===EG){let e=(r+Rt)/Z6;return function(n,s){let i=n.pow(s,e);if(!n.eql(n.sqr(i),s))throw new Error("Cannot find square root");return i}}if(r%UO===jO){let e=(r-jO)/UO;return function(n,s){let i=n.mul(s,cc),o=n.pow(i,e),a=n.mul(s,o),c=n.mul(n.mul(a,cc),o),u=n.mul(a,n.sub(c,n.ONE));if(!n.eql(n.sqr(u),s))throw new Error("Cannot find square root");return u}}return r%TG,kG(r)}function X6(r){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=SG.reduce((n,s)=>(n[s]="function",n),e);return ba(r,t)}function OG(r,e,t){if(t<Zt)throw new Error("Expected power > 0");if(t===Zt)return r.ONE;if(t===Rt)return e;let n=r.ONE,s=e;for(;t>Zt;)t&Rt&&(n=r.mul(n,s)),s=r.sqr(s),t>>=Rt;return n}function _G(r,e){let t=new Array(e.length),n=e.reduce((i,o,a)=>r.is0(o)?i:(t[a]=i,r.mul(i,o)),r.ONE),s=r.inv(n);return e.reduceRight((i,o,a)=>r.is0(o)?i:(t[a]=r.mul(i,t[a]),r.mul(i,o)),s),t}function eA(r,e){let t=e!==void 0?e:r.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}function FO(r,e,t=!1,n={}){if(r<=Zt)throw new Error(`Expected Field ORDER > 0, got ${r}`);let{nBitLength:s,nByteLength:i}=eA(r,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=BG(r),a=Object.freeze({ORDER:r,BITS:s,BYTES:i,MASK:a0(s),ZERO:Zt,ONE:Rt,create:c=>Tr(c,r),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Zt<=c&&c<r},is0:c=>c===Zt,isOdd:c=>(c&Rt)===Rt,neg:c=>Tr(-c,r),eql:(c,u)=>c===u,sqr:c=>Tr(c*c,r),add:(c,u)=>Tr(c+u,r),sub:(c,u)=>Tr(c-u,r),mul:(c,u)=>Tr(c*u,r),pow:(c,u)=>OG(a,c,u),div:(c,u)=>Tr(c*ax(u,r),r),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>ax(c,r),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>_G(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>t?ox(c,i):ma(c,i),fromBytes:c=>{if(c.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${c.length}`);return t?ix(c):Gi(c)}});return Object.freeze(a)}function DO(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let e=r.toString(2).length;return Math.ceil(e/8)}function tA(r){let e=DO(r);return e+Math.ceil(e/2)}function HO(r,e,t=!1){let n=r.length,s=DO(e),i=tA(e);if(n<16||n<i||n>1024)throw new Error(`expected ${i}-1024 bytes of input, got ${n}`);let o=t?Gi(r):ix(r),a=Tr(o,e-Rt)+Rt;return t?ox(a,s):ma(a,s)}var Zt,Rt,cc,EG,Z6,jO,UO,vG,TG,SG,cx=se(()=>{Vl();Zt=BigInt(0),Rt=BigInt(1),cc=BigInt(2),EG=BigInt(3),Z6=BigInt(4),jO=BigInt(5),UO=BigInt(8),vG=BigInt(9),TG=BigInt(16);SG=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function $O(r,e){let t=(s,i)=>{let o=i.negate();return s?o:i},n=s=>{let i=Math.ceil(e/s)+1,o=2**(s-1);return{windows:i,windowSize:o}};return{constTimeNegate:t,unsafeLadder(s,i){let o=r.ZERO,a=s;for(;i>NG;)i&rA&&(o=o.add(a)),a=a.double(),i>>=rA;return o},precomputeWindow(s,i){let{windows:o,windowSize:a}=n(i),c=[],u=s,l=u;for(let f=0;f<o;f++){l=u,c.push(l);for(let d=1;d<a;d++)l=l.add(u),c.push(l);u=l.double()}return c},wNAF(s,i,o){let{windows:a,windowSize:c}=n(s),u=r.ZERO,l=r.BASE,f=BigInt(2**s-1),d=2**s,h=BigInt(s);for(let b=0;b<a;b++){let p=b*c,g=Number(o&f);o>>=h,g>c&&(g-=d,o+=rA);let m=p,y=p+Math.abs(g)-1,E=b%2!==0,v=g<0;g===0?l=l.add(t(E,i[m])):u=u.add(t(v,i[y]))}return{p:u,f:l}},wNAFCached(s,i,o,a){let c=s._WINDOW_SIZE||1,u=i.get(s);return u||(u=this.precomputeWindow(s,c),c!==1&&i.set(s,a(u))),this.wNAF(c,u,o)}}}function nA(r){return X6(r.Fp),ba(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...eA(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}var NG,rA,qO=se(()=>{cx();Vl();NG=BigInt(0),rA=BigInt(1)});function IG(r){let e=nA(r);ba(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:t,Fp:n,a:s}=e;if(t){if(!n.eql(s,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}function LG(r){let e=IG(r),{Fp:t}=e,n=e.toBytes||((b,p,g)=>{let m=p.toAffine();return zl(Uint8Array.from([4]),t.toBytes(m.x),t.toBytes(m.y))}),s=e.fromBytes||(b=>{let p=b.subarray(1),g=t.fromBytes(p.subarray(0,t.BYTES)),m=t.fromBytes(p.subarray(t.BYTES,2*t.BYTES));return{x:g,y:m}});function i(b){let{a:p,b:g}=e,m=t.sqr(b),y=t.mul(m,b);return t.add(t.add(y,t.mul(b,p)),g)}if(!t.eql(t.sqr(e.Gy),i(e.Gx)))throw new Error("bad generator point: equation left != right");function o(b){return typeof b=="bigint"&&zi<b&&b<e.n}function a(b){if(!o(b))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(b){let{allowedPrivateKeyLengths:p,nByteLength:g,wrapPrivateKey:m,n:y}=e;if(p&&typeof b!="bigint"){if(b instanceof Uint8Array&&(b=oc(b)),typeof b!="string"||!p.includes(b.length))throw new Error("Invalid key");b=b.padStart(g*2,"0")}let E;try{E=typeof b=="bigint"?b:Gi(pn("private key",b,g))}catch{throw new Error(`private key must be ${g} bytes, hex or bigint, not ${typeof b}`)}return m&&(E=Tr(E,y)),a(E),E}let u=new Map;function l(b){if(!(b instanceof f))throw new Error("ProjectivePoint expected")}class f{constructor(p,g,m){if(this.px=p,this.py=g,this.pz=m,p==null||!t.isValid(p))throw new Error("x required");if(g==null||!t.isValid(g))throw new Error("y required");if(m==null||!t.isValid(m))throw new Error("z required")}static fromAffine(p){let{x:g,y:m}=p||{};if(!p||!t.isValid(g)||!t.isValid(m))throw new Error("invalid affine point");if(p instanceof f)throw new Error("projective point not allowed");let y=E=>t.eql(E,t.ZERO);return y(g)&&y(m)?f.ZERO:new f(g,m,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){let g=t.invertBatch(p.map(m=>m.pz));return p.map((m,y)=>m.toAffine(g[y])).map(f.fromAffine)}static fromHex(p){let g=f.fromAffine(s(pn("pointHex",p)));return g.assertValidity(),g}static fromPrivateKey(p){return f.BASE.multiply(c(p))}_setWindowSize(p){this._WINDOW_SIZE=p,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:p,y:g}=this.toAffine();if(!t.isValid(p)||!t.isValid(g))throw new Error("bad point: x or y not FE");let m=t.sqr(g),y=i(p);if(!t.eql(m,y))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:p}=this.toAffine();if(t.isOdd)return!t.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){l(p);let{px:g,py:m,pz:y}=this,{px:E,py:v,pz:k}=p,w=t.eql(t.mul(g,k),t.mul(E,y)),P=t.eql(t.mul(m,k),t.mul(v,y));return w&&P}negate(){return new f(this.px,t.neg(this.py),this.pz)}double(){let{a:p,b:g}=e,m=t.mul(g,GO),{px:y,py:E,pz:v}=this,k=t.ZERO,w=t.ZERO,P=t.ZERO,B=t.mul(y,y),Z=t.mul(E,E),_=t.mul(v,v),O=t.mul(y,E);return O=t.add(O,O),P=t.mul(y,v),P=t.add(P,P),k=t.mul(p,P),w=t.mul(m,_),w=t.add(k,w),k=t.sub(Z,w),w=t.add(Z,w),w=t.mul(k,w),k=t.mul(O,k),P=t.mul(m,P),_=t.mul(p,_),O=t.sub(B,_),O=t.mul(p,O),O=t.add(O,P),P=t.add(B,B),B=t.add(P,B),B=t.add(B,_),B=t.mul(B,O),w=t.add(w,B),_=t.mul(E,v),_=t.add(_,_),B=t.mul(_,O),k=t.sub(k,B),P=t.mul(_,Z),P=t.add(P,P),P=t.add(P,P),new f(k,w,P)}add(p){l(p);let{px:g,py:m,pz:y}=this,{px:E,py:v,pz:k}=p,w=t.ZERO,P=t.ZERO,B=t.ZERO,Z=e.a,_=t.mul(e.b,GO),O=t.mul(g,E),S=t.mul(m,v),F=t.mul(y,k),G=t.add(g,m),R=t.add(E,v);G=t.mul(G,R),R=t.add(O,S),G=t.sub(G,R),R=t.add(g,y);let L=t.add(E,k);return R=t.mul(R,L),L=t.add(O,F),R=t.sub(R,L),L=t.add(m,y),w=t.add(v,k),L=t.mul(L,w),w=t.add(S,F),L=t.sub(L,w),B=t.mul(Z,R),w=t.mul(_,F),B=t.add(w,B),w=t.sub(S,B),B=t.add(S,B),P=t.mul(w,B),S=t.add(O,O),S=t.add(S,O),F=t.mul(Z,F),R=t.mul(_,R),S=t.add(S,F),F=t.sub(O,F),F=t.mul(Z,F),R=t.add(R,F),O=t.mul(S,R),P=t.add(P,O),O=t.mul(L,R),w=t.mul(G,w),w=t.sub(w,O),O=t.mul(G,S),B=t.mul(L,B),B=t.add(B,O),new f(w,P,B)}subtract(p){return this.add(p.negate())}is0(){return this.equals(f.ZERO)}wNAF(p){return h.wNAFCached(this,u,p,g=>{let m=t.invertBatch(g.map(y=>y.pz));return g.map((y,E)=>y.toAffine(m[E])).map(f.fromAffine)})}multiplyUnsafe(p){let g=f.ZERO;if(p===zi)return g;if(a(p),p===Qn)return this;let{endo:m}=e;if(!m)return h.unsafeLadder(this,p);let{k1neg:y,k1:E,k2neg:v,k2:k}=m.splitScalar(p),w=g,P=g,B=this;for(;E>zi||k>zi;)E&Qn&&(w=w.add(B)),k&Qn&&(P=P.add(B)),B=B.double(),E>>=Qn,k>>=Qn;return y&&(w=w.negate()),v&&(P=P.negate()),P=new f(t.mul(P.px,m.beta),P.py,P.pz),w.add(P)}multiply(p){a(p);let g=p,m,y,{endo:E}=e;if(E){let{k1neg:v,k1:k,k2neg:w,k2:P}=E.splitScalar(g),{p:B,f:Z}=this.wNAF(k),{p:_,f:O}=this.wNAF(P);B=h.constTimeNegate(v,B),_=h.constTimeNegate(w,_),_=new f(t.mul(_.px,E.beta),_.py,_.pz),m=B.add(_),y=Z.add(O)}else{let{p:v,f:k}=this.wNAF(g);m=v,y=k}return f.normalizeZ([m,y])[0]}multiplyAndAddUnsafe(p,g,m){let y=f.BASE,E=(k,w)=>w===zi||w===Qn||!k.equals(y)?k.multiplyUnsafe(w):k.multiply(w),v=E(this,g).add(E(p,m));return v.is0()?void 0:v}toAffine(p){let{px:g,py:m,pz:y}=this,E=this.is0();p==null&&(p=E?t.ONE:t.inv(y));let v=t.mul(g,p),k=t.mul(m,p),w=t.mul(y,p);if(E)return{x:t.ZERO,y:t.ZERO};if(!t.eql(w,t.ONE))throw new Error("invZ was invalid");return{x:v,y:k}}isTorsionFree(){let{h:p,isTorsionFree:g}=e;if(p===Qn)return!0;if(g)return g(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:p,clearCofactor:g}=e;return p===Qn?this:g?g(f,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),n(f,this,p)}toHex(p=!0){return oc(this.toRawBytes(p))}}f.BASE=new f(e.Gx,e.Gy,t.ONE),f.ZERO=new f(t.ZERO,t.ONE,t.ZERO);let d=e.nBitLength,h=$O(f,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:i,isWithinCurveOrder:o}}function jG(r){let e=nA(r);return ba(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function zO(r){let e=jG(r),{Fp:t,n}=e,s=t.BYTES+1,i=2*t.BYTES+1;function o(R){return zi<R&&R<t.ORDER}function a(R){return Tr(R,n)}function c(R){return ax(R,n)}let{ProjectivePoint:u,normPrivateKeyToScalar:l,weierstrassEquation:f,isWithinCurveOrder:d}=LG({...e,toBytes(R,L,Y){let oe=L.toAffine(),fe=t.toBytes(oe.x),K=zl;return Y?K(Uint8Array.from([L.hasEvenY()?2:3]),fe):K(Uint8Array.from([4]),fe,t.toBytes(oe.y))},fromBytes(R){let L=R.length,Y=R[0],oe=R.subarray(1);if(L===s&&(Y===2||Y===3)){let fe=Gi(oe);if(!o(fe))throw new Error("Point is not on curve");let K=f(fe),ae=t.sqrt(K),q=(ae&Qn)===Qn;return(Y&1)===1!==q&&(ae=t.neg(ae)),{x:fe,y:ae}}else if(L===i&&Y===4){let fe=t.fromBytes(oe.subarray(0,t.BYTES)),K=t.fromBytes(oe.subarray(t.BYTES,2*t.BYTES));return{x:fe,y:K}}else throw new Error(`Point of length ${L} was invalid. Expected ${s} compressed bytes or ${i} uncompressed bytes`)}}),h=R=>oc(ma(R,e.nByteLength));function b(R){let L=n>>Qn;return R>L}function p(R){return b(R)?a(-R):R}let g=(R,L,Y)=>Gi(R.slice(L,Y));class m{constructor(L,Y,oe){this.r=L,this.s=Y,this.recovery=oe,this.assertValidity()}static fromCompact(L){let Y=e.nByteLength;return L=pn("compactSignature",L,Y*2),new m(g(L,0,Y),g(L,Y,2*Y))}static fromDER(L){let{r:Y,s:oe}=uc.toSig(pn("DER",L));return new m(Y,oe)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(L){return new m(this.r,this.s,L)}recoverPublicKey(L){let{r:Y,s:oe,recovery:fe}=this,K=P(pn("msgHash",L));if(fe==null||![0,1,2,3].includes(fe))throw new Error("recovery id invalid");let ae=fe===2||fe===3?Y+e.n:Y;if(ae>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");let q=(fe&1)===0?"02":"03",I=u.fromHex(q+h(ae)),ye=c(ae),st=a(-K*ye),Ke=a(oe*ye),Je=u.BASE.multiplyAndAddUnsafe(I,st,Ke);if(!Je)throw new Error("point at infinify");return Je.assertValidity(),Je}hasHighS(){return b(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return ac(this.toDERHex())}toDERHex(){return uc.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ac(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}let y={isValidPrivateKey(R){try{return l(R),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{let R=tA(e.n);return HO(e.randomBytes(R),e.n)},precompute(R=8,L=u.BASE){return L._setWindowSize(R),L.multiply(BigInt(3)),L}};function E(R,L=!0){return u.fromPrivateKey(R).toRawBytes(L)}function v(R){let L=R instanceof Uint8Array,Y=typeof R=="string",oe=(L||Y)&&R.length;return L?oe===s||oe===i:Y?oe===2*s||oe===2*i:R instanceof u}function k(R,L,Y=!0){if(v(R))throw new Error("first arg must be private key");if(!v(L))throw new Error("second arg must be public key");return u.fromHex(L).multiply(l(R)).toRawBytes(Y)}let w=e.bits2int||function(R){let L=Gi(R),Y=R.length*8-e.nBitLength;return Y>0?L>>BigInt(Y):L},P=e.bits2int_modN||function(R){return a(w(R))},B=a0(e.nBitLength);function Z(R){if(typeof R!="bigint")throw new Error("bigint expected");if(!(zi<=R&&R<B))throw new Error(`bigint expected < 2^${e.nBitLength}`);return ma(R,e.nByteLength)}function _(R,L,Y=O){if(["recovered","canonical"].some(j=>j in Y))throw new Error("sign() legacy options not supported");let{hash:oe,randomBytes:fe}=e,{lowS:K,prehash:ae,extraEntropy:q}=Y;K==null&&(K=!0),R=pn("msgHash",R),ae&&(R=pn("prehashed msgHash",oe(R)));let I=P(R),ye=l(L),st=[Z(ye),Z(I)];if(q!=null){let j=q===!0?fe(t.BYTES):q;st.push(pn("extraEntropy",j))}let Ke=zl(...st),Je=I;function D(j){let N=w(j);if(!d(N))return;let ee=c(N),ce=u.BASE.multiply(N).toAffine(),he=a(ce.x);if(he===zi)return;let xe=a(ee*a(Je+he*ye));if(xe===zi)return;let V=(ce.x===he?0:2)|Number(ce.y&Qn),te=xe;return K&&b(xe)&&(te=p(xe),V^=1),new m(he,te,V)}return{seed:Ke,k2sig:D}}let O={lowS:e.lowS,prehash:!1},S={lowS:e.lowS,prehash:!1};function F(R,L,Y=O){let{seed:oe,k2sig:fe}=_(R,L,Y),K=e;return Q6(K.hash.outputLen,K.nByteLength,K.hmac)(oe,fe)}u.BASE._setWindowSize(8);function G(R,L,Y,oe=S){let fe=R;if(L=pn("msgHash",L),Y=pn("publicKey",Y),"strict"in oe)throw new Error("options.strict was renamed to lowS");let{lowS:K,prehash:ae}=oe,q,I;try{if(typeof fe=="string"||fe instanceof Uint8Array)try{q=m.fromDER(fe)}catch(ce){if(!(ce instanceof uc.Err))throw ce;q=m.fromCompact(fe)}else if(typeof fe=="object"&&typeof fe.r=="bigint"&&typeof fe.s=="bigint"){let{r:ce,s:he}=fe;q=new m(ce,he)}else throw new Error("PARSE");I=u.fromHex(Y)}catch(ce){if(ce.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(K&&q.hasHighS())return!1;ae&&(L=e.hash(L));let{r:ye,s:st}=q,Ke=P(L),Je=c(st),D=a(Ke*Je),j=a(ye*Je),N=u.BASE.multiplyAndAddUnsafe(I,D,j)?.toAffine();return N?a(N.x)===ye:!1}return{CURVE:e,getPublicKey:E,getSharedSecret:k,sign:F,verify:G,ProjectivePoint:u,Signature:m,utils:y}}var RG,MG,uc,zi,Qn,eue,GO,tue,VO=se(()=>{cx();Vl();Vl();qO();({bytesToNumberBE:RG,hexToBytes:MG}=Y6),uc={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(r){let{Err:e}=uc;if(r.length<2||r[0]!==2)throw new e("Invalid signature integer tag");let t=r[1],n=r.subarray(2,t+2);if(!t||n.length!==t)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:RG(n),l:r.subarray(t+2)}},toSig(r){let{Err:e}=uc,t=typeof r=="string"?MG(r):r;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let n=t.length;if(n<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:s,l:i}=uc._parseInt(t.subarray(2)),{d:o,l:a}=uc._parseInt(i);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:s,s:o}},hexFromSig(r){let e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,t=u=>{let l=u.toString(16);return l.length&1?`0${l}`:l},n=e(t(r.s)),s=e(t(r.r)),i=n.length/2,o=s.length/2,a=t(i),c=t(o);return`30${t(o+i+4)}02${c}${s}02${a}${n}`}},zi=BigInt(0),Qn=BigInt(1),eue=BigInt(2),GO=BigInt(3),tue=BigInt(4)});var ux,sA,KO=se(()=>{jb();sl();ux=class extends Uo{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,dS(e);let n=Fo(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let s=this.blockLen,i=new Uint8Array(s);i.set(n.length>s?e.create().update(n).digest():n);for(let o=0;o<i.length;o++)i[o]^=54;this.iHash.update(i),this.oHash=e.create();for(let o=0;o<i.length;o++)i[o]^=106;this.oHash.update(i),i.fill(0)}update(e){return Mi(this),this.iHash.update(e),this}digestInto(e){Mi(this),Vd(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:n,finished:s,destroyed:i,blockLen:o,outputLen:a}=this;return e=e,e.finished=s,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},sA=(r,e,t)=>new ux(r,e).update(t).digest();sA.create=(r,e)=>new ux(r,e)});function UG(r){return{hash:r,hmac:(e,...t)=>sA(r,e,vS(...t)),randomBytes:PS}}function JO(r,e){let t=n=>zO({...r,...UG(n)});return Object.freeze({...t(e),create:t})}var WO=se(()=>{KO();sl();VO();});function DG(r){let e=ZO,t=BigInt(3),n=BigInt(6),s=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),u=r*r*r%e,l=u*u*r%e,f=hn(l,t,e)*l%e,d=hn(f,t,e)*l%e,h=hn(d,iA,e)*u%e,b=hn(h,s,e)*h%e,p=hn(b,i,e)*b%e,g=hn(p,a,e)*p%e,m=hn(g,c,e)*g%e,y=hn(m,a,e)*p%e,E=hn(y,t,e)*l%e,v=hn(E,o,e)*b%e,k=hn(v,n,e)*u%e,w=hn(k,iA,e);if(!oA.eql(oA.sqr(w),r))throw new Error("Cannot find square root");return w}var ZO,QO,FG,iA,YO,oA,aA,pue,hue,XO=se(()=>{S6();cx();WO();ZO=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),QO=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),FG=BigInt(1),iA=BigInt(2),YO=(r,e)=>(r+e/iA)/e;oA=FO(ZO,void 0,void 0,{sqrt:DG}),aA=JO({a:BigInt(0),b:BigInt(7),Fp:oA,n:QO,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let e=QO,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-FG*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=t,o=BigInt("0x100000000000000000000000000000000"),a=YO(i*r,e),c=YO(-n*r,e),u=Tr(r-a*t-c*s,e),l=Tr(-a*n-c*i,e),f=u>o,d=l>o;if(f&&(u=e-u),d&&(l=e-l),u>o||l>o)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:f,k1:u,k2neg:d,k2:l}}}},Pg),pue=BigInt(0),hue=aA.ProjectivePoint});var Rz={};hx(Rz,{FarcasterExtension:()=>dA});var dx=l0(wA());var WG=l0(Ym(),1);var k$={withStackTrace:!1},PB=(r,e,t=k$)=>{let n=e.isOk()?{type:"Ok",value:e.value}:{type:"Err",value:e.error},s=t.withStackTrace?new Error().stack:void 0;return{data:n,message:r,stack:s}};function Zm(r,e,t,n){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{u(n.next(l))}catch(f){o(f)}}function c(l){try{u(n.throw(l))}catch(f){o(f)}}function u(l){l.done?i(l.value):s(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})}function vB(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ja(r){return this instanceof Ja?(this.v=r,this):new Ja(r)}function B$(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),s,i=[];return s={},o("next"),o("throw"),o("return"),s[Symbol.asyncIterator]=function(){return this},s;function o(d){n[d]&&(s[d]=function(h){return new Promise(function(b,p){i.push([d,h,b,p])>1||a(d,h)})})}function a(d,h){try{c(n[d](h))}catch(b){f(i[0][3],b)}}function c(d){d.value instanceof Ja?Promise.resolve(d.value.v).then(u,l):f(i[0][2],d)}function u(d){a("next",d)}function l(d){a("throw",d)}function f(d,h){d(h),i.shift(),i.length&&a(i[0][0],i[0][1])}}function S$(r){var e,t;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,i){e[s]=r[s]?function(o){return(t=!t)?{value:Ja(r[s](o)),done:s==="return"}:i?i(o):o}:i}}function O$(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof vB=="function"?vB(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=r[i]&&function(o){return new Promise(function(a,c){o=r[i](o),s(a,c,o.done,o.value)})}}function s(i,o,a,c){Promise.resolve(c).then(function(u){i({value:u,done:a})},o)}}var bt=class{constructor(e){this._promise=e}static fromSafePromise(e){let t=e.then(n=>new _i(n));return new bt(t)}static fromPromise(e,t){let n=e.then(s=>new _i(s)).catch(s=>new Ci(t(s)));return new bt(n)}static fromThrowable(e,t){return(...n)=>new bt((()=>Zm(this,void 0,void 0,function*(){try{return new _i(yield e(...n))}catch(s){return new Ci(t?t(s):s)}}))())}static combine(e){return _$(e)}static combineWithAllErrors(e){return C$(e)}map(e){return new bt(this._promise.then(t=>Zm(this,void 0,void 0,function*(){return t.isErr()?new Ci(t.error):new _i(yield e(t.value))})))}mapErr(e){return new bt(this._promise.then(t=>Zm(this,void 0,void 0,function*(){return t.isOk()?new _i(t.value):new Ci(yield e(t.error))})))}andThen(e){return new bt(this._promise.then(t=>{if(t.isErr())return new Ci(t.error);let n=e(t.value);return n instanceof bt?n._promise:n}))}orElse(e){return new bt(this._promise.then(t=>Zm(this,void 0,void 0,function*(){return t.isErr()?e(t.error):new _i(t.value)})))}match(e,t){return this._promise.then(n=>n.match(e,t))}unwrapOr(e){return this._promise.then(t=>t.unwrapOr(e))}safeUnwrap(){return B$(this,arguments,function*(){return yield Ja(yield Ja(yield*S$(O$(yield Ja(this._promise.then(t=>t.safeUnwrap()))))))})}then(e,t){return this._promise.then(e,t)}};var TB=r=>new bt(Promise.resolve(new Ci(r))),gW=bt.fromPromise,xW=bt.fromSafePromise,yW=bt.fromThrowable,kB=r=>{let e=Pt([]);for(let t of r)if(t.isErr()){e=at(t.error);break}else e.map(n=>n.push(t.value));return e},_$=r=>bt.fromSafePromise(Promise.all(r)).andThen(kB),BB=r=>{let e=Pt([]);for(let t of r)t.isErr()&&e.isErr()?e.error.push(t.error):t.isErr()&&e.isOk()?e=at([t.error]):t.isOk()&&e.isOk()&&e.value.push(t.value);return e},C$=r=>bt.fromSafePromise(Promise.all(r)).andThen(BB),Rd;(function(r){function e(s,i){return(...o)=>{try{let a=s(...o);return Pt(a)}catch(a){return at(i?i(a):a)}}}r.fromThrowable=e;function t(s){return kB(s)}r.combine=t;function n(s){return BB(s)}r.combineWithAllErrors=n})(Rd||(Rd={}));var Pt=r=>new _i(r),at=r=>new Ci(r);var _i=class{constructor(e){this.value=e}isOk(){return!0}isErr(){return!this.isOk()}map(e){return Pt(e(this.value))}mapErr(e){return Pt(this.value)}andThen(e){return e(this.value)}orElse(e){return Pt(this.value)}asyncAndThen(e){return e(this.value)}asyncMap(e){return bt.fromSafePromise(e(this.value))}unwrapOr(e){return this.value}match(e,t){return e(this.value)}safeUnwrap(){let e=this.value;return function*(){return e}()}_unsafeUnwrap(e){return this.value}_unsafeUnwrapErr(e){throw PB("Called `_unsafeUnwrapErr` on an Ok",this,e)}},Ci=class{constructor(e){this.error=e}isOk(){return!1}isErr(){return!this.isOk()}map(e){return at(this.error)}mapErr(e){return at(e(this.error))}andThen(e){return at(this.error)}orElse(e){return e(this.error)}asyncAndThen(e){return TB(this.error)}asyncMap(e){return TB(this.error)}unwrapOr(e){return e}match(e,t){return t(this.error)}safeUnwrap(){let e=this.error;return function*(){throw yield at(e),new Error("Do not use this generator out of `safeTry`")}()}_unsafeUnwrap(e){throw PB("Called `_unsafeUnwrap` on an Err",this,e)}_unsafeUnwrapErr(e){return this.error}},wW=Rd.fromThrowable;var w_=l0(Ym(),1);var A_=l0(Ym(),1);function ge(r,e,t){return n=>r[e.name]?.(n)??r[t]?.(n)??e(r,n)}or();We();var Ob=class extends z{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}};Ar();Li();qb();Ya();Wa();ul();var qS="/docs/contract/encodeEventTopics";function ei(r){let{abi:e,eventName:t,args:n}=r,s=e[0];if(t){let c=Xs({abi:e,name:t});if(!c)throw new Fd(t,{docsPath:qS});s=c}if(s.type!=="event")throw new Fd(void 0,{docsPath:qS});let i=Rr(s),o=ol(i),a=[];if(n&&"inputs"in s){let c=s.inputs?.filter(l=>"indexed"in l&&l.indexed),u=Array.isArray(n)?n:Object.values(n).length>0?c?.map(l=>n[l.name])??[]:[];u.length>0&&(a=c?.map((l,f)=>Array.isArray(u[f])?u[f].map((d,h)=>GS({param:l,value:u[f][h]})):u[f]?GS({param:l,value:u[f]}):null)??[])}return[o,...a]}function GS({param:r,value:e}){if(r.type==="string"||r.type==="bytes")return Bt(Lr(e));if(r.type==="tuple"||r.type.match(/^(.*)\[(\d+)?\]$/))throw new Ob(r.type);return As([r],[e])}De();function $o(r,{method:e}){let t={};return r.transport.type==="fallback"&&r.transport.onResponse?.(({method:n,response:s,status:i,transport:o})=>{i==="success"&&e===n&&(t[s]=o.request)}),n=>t[n]||r.request}async function Jb(r,e){let{address:t,abi:n,args:s,eventName:i,fromBlock:o,strict:a,toBlock:c}=e,u=$o(r,{method:"eth_newFilter"}),l=i?ei({abi:n,args:s,eventName:i}):void 0,f=await r.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof o=="bigint"?Ae(o):o,toBlock:typeof c=="bigint"?Ae(c):c,topics:l}]});return{abi:n,args:s,eventName:i,id:f,request:u(f),strict:Boolean(a),type:"event"}}Fi();qo();or();We();ec();Xd();var kq=3;function $i(r,{abi:e,address:t,args:n,docsPath:s,functionName:i,sender:o}){let{code:a,data:c,message:u,shortMessage:l}=r instanceof Go?r:r instanceof z?r.walk(d=>"data"in d)||r.walk():{},f=(()=>r instanceof Js?new lg({functionName:i}):[kq,Es.code].includes(a)&&(c||u||l)?new Xa({abi:e,data:typeof c=="object"?c.data:c,functionName:i,message:l??u}):r)();return new ug(f,{abi:e,args:n,contractAddress:t,docsPath:s,functionName:i,sender:o})}Fi();De();y6();Qd();We();ri();var pg=class extends z{constructor(e,{account:t,docsPath:n,chain:s,data:i,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:l,to:f,value:d}){let h=ml({from:t?.address,to:f,value:typeof d<"u"&&`${rg(d)} ${s?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:o,gasPrice:typeof a<"u"&&`${Ur(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Ur(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${Ur(u)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",h].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=e}};Bl();A6();function o9(r,{docsPath:e,...t}){let n=(()=>{let s=hg(r,t);return s instanceof oa?r:s})();return new pg(n,{docsPath:e,...t})}E6();v6();T6();yg();Fi();Qd();We();var wg=class extends z{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}},aa=class extends z{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}},Ag=class extends z{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Ur(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}};Mr();We();var _l=class extends z{constructor({blockHash:e,blockNumber:t}){let n="Block";e&&(n=`Block at hash "${e}"`),t&&(n=`Block at number "${t}"`),super(`${n} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}};De();bg();Mr();bg();var P6={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function tc(r){let e={...r,blockHash:r.blockHash?r.blockHash:null,blockNumber:r.blockNumber?BigInt(r.blockNumber):null,chainId:r.chainId?ar(r.chainId):void 0,gas:r.gas?BigInt(r.gas):void 0,gasPrice:r.gasPrice?BigInt(r.gasPrice):void 0,maxFeePerBlobGas:r.maxFeePerBlobGas?BigInt(r.maxFeePerBlobGas):void 0,maxFeePerGas:r.maxFeePerGas?BigInt(r.maxFeePerGas):void 0,maxPriorityFeePerGas:r.maxPriorityFeePerGas?BigInt(r.maxPriorityFeePerGas):void 0,nonce:r.nonce?ar(r.nonce):void 0,to:r.to?r.to:null,transactionIndex:r.transactionIndex?Number(r.transactionIndex):null,type:r.type?P6[r.type]:void 0,typeHex:r.type?r.type:void 0,value:r.value?BigInt(r.value):void 0,v:r.v?BigInt(r.v):void 0};return e.yParity=(()=>{if(r.yParity)return Number(r.yParity);if(typeof e.v=="bigint"){if(e.v===0n||e.v===27n)return 0;if(e.v===1n||e.v===28n)return 1;if(e.v>=35n)return e.v%2n===0n?1:0}})(),e.type==="legacy"&&(delete e.accessList,delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas,delete e.yParity),e.type==="eip2930"&&(delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas),e.type==="eip1559"&&delete e.maxFeePerBlobGas,e}var c9=Sl("transaction",tc);function e0(r){let e=r.transactions?.map(t=>typeof t=="string"?t:tc(t));return{...r,baseFeePerGas:r.baseFeePerGas?BigInt(r.baseFeePerGas):null,blobGasUsed:r.blobGasUsed?BigInt(r.blobGasUsed):void 0,difficulty:r.difficulty?BigInt(r.difficulty):void 0,excessBlobGas:r.excessBlobGas?BigInt(r.excessBlobGas):void 0,gasLimit:r.gasLimit?BigInt(r.gasLimit):void 0,gasUsed:r.gasUsed?BigInt(r.gasUsed):void 0,hash:r.hash?r.hash:null,logsBloom:r.logsBloom?r.logsBloom:null,nonce:r.nonce?r.nonce:null,number:r.number?BigInt(r.number):null,size:r.size?BigInt(r.size):void 0,timestamp:r.timestamp?BigInt(r.timestamp):void 0,transactions:e,totalDifficulty:r.totalDifficulty?BigInt(r.totalDifficulty):null}}var u9=Sl("block",e0);async function Zr(r,{blockHash:e,blockNumber:t,blockTag:n,includeTransactions:s}={}){let i=n??"latest",o=s??!1,a=t!==void 0?Ae(t):void 0,c=null;if(e?c=await r.request({method:"eth_getBlockByHash",params:[e,o]},{dedupe:!0}):c=await r.request({method:"eth_getBlockByNumber",params:[a||i,o]},{dedupe:Boolean(a)}),!c)throw new _l({blockHash:e,blockNumber:t});return(r.chain?.formatters?.block?.format||e0)(c)}async function Cl(r){let e=await r.request({method:"eth_gasPrice"});return BigInt(e)}async function l9(r,e){return k6(r,e)}async function k6(r,e){let{block:t,chain:n=r.chain,request:s}=e||{};if(typeof n?.fees?.defaultPriorityFee=="function"){let i=t||await ge(r,Zr,"getBlock")({});return n.fees.defaultPriorityFee({block:i,client:r,request:s})}if(typeof n?.fees?.defaultPriorityFee<"u")return n?.fees?.defaultPriorityFee;try{let i=await r.request({method:"eth_maxPriorityFeePerGas"});return dr(i)}catch{let[i,o]=await Promise.all([t?Promise.resolve(t):ge(r,Zr,"getBlock")({}),ge(r,Cl,"getGasPrice")({})]);if(typeof i.baseFeePerGas!="bigint")throw new aa;let a=o-i.baseFeePerGas;return a<0n?0n:a}}async function f9(r,e){return Eg(r,e)}async function Eg(r,e){let{block:t,chain:n=r.chain,request:s,type:i="eip1559"}=e||{},o=await(async()=>typeof n?.fees?.baseFeeMultiplier=="function"?n.fees.baseFeeMultiplier({block:t,client:r,request:s}):n?.fees?.baseFeeMultiplier??1.2)();if(o<1)throw new wg;let a=o.toString().split(".")[1]?.length??0,c=10**a,u=d=>d*BigInt(Math.ceil(o*c))/BigInt(c),l=t||await ge(r,Zr,"getBlock")({});if(typeof n?.fees?.estimateFeesPerGas=="function"){let d=await n.fees.estimateFeesPerGas({block:t,client:r,multiply:u,request:s,type:i});if(d!==null)return d}if(i==="eip1559"){if(typeof l.baseFeePerGas!="bigint")throw new aa;let d=typeof s?.maxPriorityFeePerGas=="bigint"?s.maxPriorityFeePerGas:await k6(r,{block:l,chain:n,request:s}),h=u(l.baseFeePerGas);return{maxFeePerGas:s?.maxFeePerGas??h+d,maxPriorityFeePerGas:d}}return{gasPrice:s?.gasPrice??u(await ge(r,Cl,"getGasPrice")({}))}}Mr();De();async function vg(r,{address:e,blockTag:t="latest",blockNumber:n}){let s=await r.request({method:"eth_getTransactionCount",params:[e,n?Ae(n):t]},{dedupe:Boolean(n)});return ar(s)}Ar();De();function Nl(r){let{kzg:e}=r,t=r.to??(typeof r.blobs[0]=="string"?"hex":"bytes"),n=typeof r.blobs[0]=="string"?r.blobs.map(i=>fn(i)):r.blobs,s=[];for(let i of n)s.push(Uint8Array.from(e.blobToKzgCommitment(i)));return t==="bytes"?s:s.map(i=>tt(i))}Ar();De();function Il(r){let{kzg:e}=r,t=r.to??(typeof r.blobs[0]=="string"?"hex":"bytes"),n=typeof r.blobs[0]=="string"?r.blobs.map(o=>fn(o)):r.blobs,s=typeof r.commitments[0]=="string"?r.commitments.map(o=>fn(o)):r.commitments,i=[];for(let o=0;o<n.length;o++){let a=n[o],c=s[o];i.push(Uint8Array.from(e.computeBlobKzgProof(a,c)))}return t==="bytes"?i:i.map(o=>tt(o))}De();S6();gs();Ar();De();function p9(r,e){let t=e||"hex",n=Pg(Ft(r,{strict:!1})?Lr(r):r);return t==="bytes"?n:Ce(n)}function h9(r){let{commitment:e,version:t=1}=r,n=r.to??(typeof e=="string"?"hex":"bytes"),s=p9(e,"bytes");return s.set([t],0),n==="bytes"?s:tt(s)}function kg(r){let{commitments:e,version:t}=r,n=r.to??(typeof e[0]=="string"?"hex":"bytes"),s=[];for(let i of e)s.push(h9({commitment:i,to:n,version:t}));return s}We();var Bg=class extends z{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlobSizeTooLargeError"})}},Rl=class extends z{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}},Sg=class extends z{constructor({hash:e,size:t}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashSizeError"})}},Og=class extends z{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${1}`,`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}};Zb();Ks();Ar();De();function m9(r){let e=r.to??(typeof r.data=="string"?"hex":"bytes"),t=typeof r.data=="string"?fn(r.data):r.data,n=rt(t);if(!n)throw new Rl;if(n>761855)throw new Bg({maxSize:761855,size:n});let s=[],i=!0,o=0;for(;i;){let a=fl(new Uint8Array(131072)),c=0;for(;c<4096;){let u=t.slice(o,o+(32-1));if(a.pushByte(0),a.pushBytes(u),u.length<31){a.pushByte(128),i=!1;break}c++,o+=31}s.push(a)}return e==="bytes"?s.map(a=>a.bytes):s.map(a=>tt(a.bytes))}function _g(r){let{data:e,kzg:t,to:n}=r,s=r.blobs??m9({data:e,to:n}),i=r.commitments??Nl({blobs:s,kzg:t,to:n}),o=r.proofs??Il({blobs:s,commitments:i,kzg:t,to:n}),a=[];for(let c=0;c<s.length;c++)a.push({blob:s[c],commitment:i[c],proof:o[c]});return a}yg();ri();function Cg(r){if(r.type)return r.type;if(typeof r.blobs<"u"||typeof r.blobVersionedHashes<"u"||typeof r.maxFeePerBlobGas<"u"||typeof r.sidecars<"u")return"eip4844";if(typeof r.maxFeePerGas<"u"||typeof r.maxPriorityFeePerGas<"u")return"eip1559";if(typeof r.gasPrice<"u")return typeof r.accessList<"u"?"eip2930":"legacy";throw new ag({transaction:r})}Mr();async function Ng(r){let e=await r.request({method:"eth_chainId"},{dedupe:!0});return ar(e)}var Mq=["blobVersionedHashes","chainId","fees","gas","nonce","type"];async function Ig(r,e){let{account:t=r.account,blobs:n,chain:s,gas:i,kzg:o,nonce:a,parameters:c=Mq,type:u}=e,l=t?Er(t):void 0,f={...e,...l?{from:l?.address}:{}},d;async function h(){return d||(d=await ge(r,Zr,"getBlock")({blockTag:"latest"}),d)}let b;async function p(){return b||(s?s.id:typeof e.chainId<"u"?e.chainId:(b=await ge(r,Ng,"getChainId")({}),b))}if((c.includes("blobVersionedHashes")||c.includes("sidecars"))&&n&&o){let g=Nl({blobs:n,kzg:o});if(c.includes("blobVersionedHashes")){let m=kg({commitments:g,to:"hex"});f.blobVersionedHashes=m}if(c.includes("sidecars")){let m=Il({blobs:n,commitments:g,kzg:o}),y=_g({blobs:n,commitments:g,proofs:m,to:"hex"});f.sidecars=y}}if(c.includes("chainId")&&(f.chainId=await p()),c.includes("nonce")&&typeof a>"u"&&l)if(l.nonceManager){let g=await p();f.nonce=await l.nonceManager.consume({address:l.address,chainId:g,client:r})}else f.nonce=await ge(r,vg,"getTransactionCount")({address:l.address,blockTag:"pending"});if((c.includes("fees")||c.includes("type"))&&typeof u>"u")try{f.type=Cg(f)}catch{let g=await h();f.type=typeof g?.baseFeePerGas=="bigint"?"eip1559":"legacy"}if(c.includes("fees"))if(f.type!=="legacy"&&f.type!=="eip2930"){if(typeof f.maxFeePerGas>"u"||typeof f.maxPriorityFeePerGas>"u"){let g=await h(),{maxFeePerGas:m,maxPriorityFeePerGas:y}=await Eg(r,{block:g,chain:s,request:f});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas<y)throw new Ag({maxPriorityFeePerGas:y});f.maxPriorityFeePerGas=y,f.maxFeePerGas=m}}else{if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")throw new aa;let g=await h(),{gasPrice:m}=await Eg(r,{block:g,chain:s,request:f,type:"legacy"});f.gasPrice=m}return c.includes("gas")&&typeof i>"u"&&(f.gas=await ge(r,Ml,"estimateGas")({...f,account:l?{address:l.address,type:"json-rpc"}:void 0})),Ol(f),delete f.parameters,f}async function Ml(r,e){let t=e.account??r.account,n=t?Er(t):void 0;try{let{accessList:s,blobs:i,blobVersionedHashes:o,blockNumber:a,blockTag:c,data:u,gas:l,gasPrice:f,maxFeePerBlobGas:d,maxFeePerGas:h,maxPriorityFeePerGas:b,nonce:p,to:g,value:m,stateOverride:y,...E}=await Ig(r,{...e,parameters:n?.type==="local"?void 0:["blobVersionedHashes"]}),k=(a?Ae(a):void 0)||c,w=xg(y);Ol(e);let P=r.chain?.formatters?.transactionRequest?.format,Z=(P||gg)({...mg(E,{format:P}),from:n?.address,accessList:s,blobs:i,blobVersionedHashes:o,data:u,gas:l,gasPrice:f,maxFeePerBlobGas:d,maxFeePerGas:h,maxPriorityFeePerGas:b,nonce:p,to:g,value:m}),_=await r.request({method:"eth_estimateGas",params:w?[Z,k??"latest",w]:k?[Z,k]:[Z]});return BigInt(_)}catch(s){throw o9(s,{...e,account:n,chain:r.chain})}}async function b9(r,e){let{abi:t,address:n,args:s,functionName:i,...o}=e,a=Yr({abi:t,args:s,functionName:i});try{return await ge(r,Ml,"estimateGas")({data:a,to:n,...o})}catch(c){let u=o.account?Er(o.account):void 0;throw $i(c,{abi:t,address:n,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:i,sender:u?.address})}}ul();or();or();Ks();qb();p6();Xb();Wa();var g9="/docs/contract/decodeEventLog";function Ll(r){let{abi:e,data:t,strict:n,topics:s}=r,i=n??!0,[o,...a]=s;if(!o)throw new Eb({docsPath:g9});let c=e.find(p=>p.type==="event"&&o===ol(Rr(p)));if(!(c&&"name"in c)||c.type!=="event")throw new nl(o,{docsPath:g9});let{name:u,inputs:l}=c,f=l?.some(p=>!("name"in p&&p.name)),d=f?[]:{},h=l.filter(p=>"indexed"in p&&p.indexed);for(let p=0;p<h.length;p++){let g=h[p],m=a[p];if(!m)throw new Ws({abiItem:c,param:g});d[f?p:g.name||p]=Lq({param:g,value:m})}let b=l.filter(p=>!("indexed"in p&&p.indexed));if(b.length>0){if(t&&t!=="0x")try{let p=Za(b,t);if(p)if(f)d=[...d,...p];else for(let g=0;g<b.length;g++)d[b[g].name]=p[g]}catch(p){if(i)throw p instanceof tl||p instanceof ll?new xs({abiItem:c,data:t,params:b,size:rt(t)}):p}else if(i)throw new xs({abiItem:c,data:"0x",params:b,size:0})}return{eventName:u,args:Object.values(d).length>0?d:void 0}}function Lq({param:r,value:e}){return r.type==="string"||r.type==="bytes"||r.type==="tuple"||r.type.match(/^(.*)\[(\d+)?\]$/)?e:(Za([r],e)||[])[0]}function jl({abi:r,eventName:e,logs:t,strict:n=!0}){return t.map(s=>{try{let i=Ll({...s,abi:r,strict:n});return e&&!e.includes(i.eventName)?null:{...i,...s}}catch(i){let o,a;if(i instanceof nl)return null;if(i instanceof xs||i instanceof Ws){if(n)return null;o=i.abiItem.name,a=i.abiItem.inputs?.some(c=>!("name"in c&&c.name))}return{...s,args:a?[]:{},eventName:o}}}).filter(Boolean)}De();function Xr(r,{args:e,eventName:t}={}){return{...r,blockHash:r.blockHash?r.blockHash:null,blockNumber:r.blockNumber?BigInt(r.blockNumber):null,logIndex:r.logIndex?Number(r.logIndex):null,transactionHash:r.transactionHash?r.transactionHash:null,transactionIndex:r.transactionIndex?Number(r.transactionIndex):null,...t?{args:e,eventName:t}:{}}}async function Ul(r,{address:e,blockHash:t,fromBlock:n,toBlock:s,event:i,events:o,args:a,strict:c}={}){let u=c??!1,l=o??(i?[i]:void 0),f=[];l&&(f=[l.flatMap(b=>ei({abi:[b],eventName:b.name,args:a}))],i&&(f=f[0]));let d;t?d=await r.request({method:"eth_getLogs",params:[{address:e,topics:f,blockHash:t}]}):d=await r.request({method:"eth_getLogs",params:[{address:e,topics:f,fromBlock:typeof n=="bigint"?Ae(n):n,toBlock:typeof s=="bigint"?Ae(s):s}]});let h=d.map(b=>Xr(b));return l?jl({abi:l,logs:h,strict:u}):h}async function Rg(r,e){let{abi:t,address:n,args:s,blockHash:i,eventName:o,fromBlock:a,toBlock:c,strict:u}=e,l=o?Xs({abi:t,name:o}):void 0,f=l?void 0:t.filter(d=>d.type==="event");return ge(r,Ul,"getLogs")({address:n,args:s,blockHash:i,event:l,events:f,fromBlock:a,toBlock:c,strict:u})}rc();qo();Dl();async function pr(r,e){let{abi:t,address:n,args:s,functionName:i,...o}=e,a=Yr({abi:t,args:s,functionName:i});try{let{data:c}=await ge(r,si,"call")({...o,data:a,to:n});return Jn({abi:t,args:s,functionName:i,data:c||"0x"})}catch(c){throw $i(c,{abi:t,address:n,args:s,docsPath:"/docs/contract/readContract",functionName:i})}}Fi();rc();qo();Dl();async function I9(r,e){let{abi:t,address:n,args:s,dataSuffix:i,functionName:o,...a}=e,c=a.account?Er(a.account):r.account,u=Yr({abi:t,args:s,functionName:o});try{let{data:l}=await ge(r,si,"call")({batch:!1,data:`${u}${i?i.replace("0x",""):""}`,to:n,...a,account:c}),f=Jn({abi:t,args:s,functionName:o,data:l||"0x"}),d=t.filter(h=>"name"in h&&h.name===e.functionName);return{result:f,request:{abi:d,address:n,args:s,dataSuffix:i,functionName:o,...a,account:c}}}catch(l){throw $i(l,{abi:t,address:n,args:s,docsPath:"/docs/contract/simulateContract",functionName:o,sender:c?.address})}}or();Xd();var U6=new Map,R9=new Map,Gq=0;function en(r,e,t){let n=++Gq,s=()=>U6.get(r)||[],i=()=>{let l=s();U6.set(r,l.filter(f=>f.id!==n))},o=()=>{let l=R9.get(r);s().length===1&&l&&l(),i()},a=s();if(U6.set(r,[...a,{id:n,fns:e}]),a&&a.length>0)return o;let c={};for(let l in e)c[l]=(...f)=>{let d=s();if(d.length!==0)for(let h of d)h.fns[l]?.(...f)};let u=t(c);return typeof u=="function"&&R9.set(r,u),o}async function s0(r){return new Promise(e=>setTimeout(e,r))}function ii(r,{emitOnBegin:e,initialWaitTime:t,interval:n}){let s=!0,i=()=>s=!1;return(async()=>{let a;e&&(a=await r({unpoll:i}));let c=await t?.(a)??n;await s0(c);let u=async()=>{!s||(await r({unpoll:i}),await s0(n),u())};u()})(),i}dn();var zq=new Map,Vq=new Map;function M9(r){let e=(s,i)=>({clear:()=>i.delete(s),get:()=>i.get(s),set:o=>i.set(s,o)}),t=e(r,zq),n=e(r,Vq);return{clear:()=>{t.clear(),n.clear()},promise:t,response:n}}async function L9(r,{cacheKey:e,cacheTime:t=Number.POSITIVE_INFINITY}){let n=M9(e),s=n.response.get();if(s&&t>0&&new Date().getTime()-s.created.getTime()<t)return s.data;let i=n.promise.get();i||(i=r(),n.promise.set(i));try{let o=await i;return n.response.set({created:new Date,data:o}),o}finally{n.promise.clear()}}var Kq=r=>`blockNumber.${r}`;async function oi(r,{cacheTime:e=r.cacheTime}={}){let t=await L9(()=>r.request({method:"eth_blockNumber"}),{cacheKey:Kq(r.uid),cacheTime:e});return BigInt(t)}async function la(r,{filter:e}){let t="strict"in e&&e.strict,n=await e.request({method:"eth_getFilterChanges",params:[e.id]});if(typeof n[0]=="string")return n;let s=n.map(i=>Xr(i));return!("abi"in e)||!e.abi?s:jl({abi:e.abi,logs:s,strict:t})}async function fa(r,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function j9(r,e){let{abi:t,address:n,args:s,batch:i=!0,eventName:o,fromBlock:a,onError:c,onLogs:u,poll:l,pollingInterval:f=r.pollingInterval,strict:d}=e;return(()=>typeof l<"u"?l:typeof a=="bigint"?!0:!(r.transport.type==="webSocket"||r.transport.type==="fallback"&&r.transport.transports[0].config.type==="webSocket"))()?(()=>{let g=d??!1,m=nt(["watchContractEvent",n,s,i,r.uid,o,f,g,a]);return en(m,{onLogs:u,onError:c},y=>{let E;a!==void 0&&(E=a-1n);let v,k=!1,w=ii(async()=>{if(!k){try{v=await ge(r,Jb,"createContractEventFilter")({abi:t,address:n,args:s,eventName:o,strict:g,fromBlock:a})}catch{}k=!0;return}try{let P;if(v)P=await ge(r,la,"getFilterChanges")({filter:v});else{let B=await ge(r,oi,"getBlockNumber")({});E&&E!==B?P=await ge(r,Rg,"getContractEvents")({abi:t,address:n,args:s,eventName:o,fromBlock:E+1n,toBlock:B,strict:g}):P=[],E=B}if(P.length===0)return;if(i)y.onLogs(P);else for(let B of P)y.onLogs([B])}catch(P){v&&P instanceof Vn&&(k=!1),y.onError?.(P)}},{emitOnBegin:!0,interval:f});return async()=>{v&&await ge(r,fa,"uninstallFilter")({filter:v}),w()}})})():(()=>{let g=d??!1,m=nt(["watchContractEvent",n,s,i,r.uid,o,f,g]),y=!0,E=()=>y=!1;return en(m,{onLogs:u,onError:c},v=>((async()=>{try{let k=(()=>{if(r.transport.type==="fallback"){let B=r.transport.transports.find(Z=>Z.config.type==="webSocket");return B?B.value:r.transport}return r.transport})(),w=o?ei({abi:t,eventName:o,args:s}):[],{unsubscribe:P}=await k.subscribe({params:["logs",{address:n,topics:w}],onData(B){if(!y)return;let Z=B.result;try{let{eventName:_,args:O}=Ll({abi:t,data:Z.data,topics:Z.topics,strict:d}),S=Xr(Z,{args:O,eventName:_});v.onLogs([S])}catch(_){let O,S;if(_ instanceof xs||_ instanceof Ws){if(d)return;O=_.abiItem.name,S=_.abiItem.inputs?.some(G=>!("name"in G&&G.name))}let F=Xr(Z,{args:S?[]:{},eventName:O});v.onLogs([F])}},onError(B){v.onError?.(B)}});E=P,y||E()}catch(k){c?.(k)}})(),()=>E()))})()}async function U9(r,{serializedTransaction:e}){return r.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}We();var $g=class extends z{constructor({address:e}){super(`No EIP-712 domain found on contract "${e}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${e}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip712DomainNotFoundError"})}};async function F9(r,e){let{address:t,factory:n,factoryData:s}=e;try{let[i,o,a,c,u,l,f]=await ge(r,pr,"readContract")({abi:Jq,address:t,functionName:"eip712Domain",factory:n,factoryData:s});return{domain:{name:o,version:a,chainId:Number(c),verifyingContract:u,salt:l},extensions:f,fields:i}}catch(i){let o=i;throw o.name==="ContractFunctionExecutionError"&&o.cause.name==="ContractFunctionZeroDataError"?new $g({address:t}):o}}var Jq=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];Fi();var qg=256,Gg;function zg(r=11){if(!Gg||qg+r>256*2){Gg="",qg=0;for(let e=0;e<256;e++)Gg+=(256+Math.random()*256|0).toString(16).substring(1)}return Gg.substring(qg,qg+++r)}function D9(r){let{batch:e,cacheTime:t=r.pollingInterval??4e3,ccipRead:n,key:s="base",name:i="Base Client",pollingInterval:o=4e3,type:a="base"}=r,c=r.chain,u=r.account?Er(r.account):void 0,{config:l,request:f,value:d}=r.transport({chain:c,pollingInterval:o}),h={...l,...d},b={account:u,batch:e,cacheTime:t,ccipRead:n,chain:c,key:s,name:i,pollingInterval:o,request:f,transport:h,type:a,uid:zg()};function p(g){return m=>{let y=m(g);for(let v in b)delete y[v];let E={...g,...y};return Object.assign(E,{extend:p(E)})}}return Object.assign(b,{extend:p(b)})}We();xl();Xd();De();Li();Gb();var Vg=new Ho(8192);function H9(r,{enabled:e=!0,id:t}){if(!e||!t)return r();if(Vg.get(t))return Vg.get(t);let n=r().finally(()=>Vg.delete(t));return Vg.set(t,n),n}function i0(r,{delay:e=100,retryCount:t=2,shouldRetry:n=()=>!0}={}){return new Promise((s,i)=>{let o=async({count:a=0}={})=>{let c=async({error:u})=>{let l=typeof e=="function"?e({count:a,error:u}):e;l&&await s0(l),o({count:a+1})};try{let u=await r();s(u)}catch(u){if(a<t&&await n({count:a,error:u}))return c({error:u});i(u)}};o()})}dn();function $9(r,e={}){return async(t,n={})=>{let{dedupe:s=!1,retryDelay:i=150,retryCount:o=3,uid:a}={...e,...n},c=s?Bt(Gd(`${a}.${nt(t)}`)):void 0;return H9(()=>i0(async()=>{try{return await r(t)}catch(u){let l=u;switch(l.code){case Vo.code:throw new Vo(l);case Ko.code:throw new Ko(l);case Jo.code:throw new Jo(l);case Wo.code:throw new Wo(l);case Es.code:throw new Es(l);case Vn.code:throw new Vn(l);case Qo.code:throw new Qo(l);case Yo.code:throw new Yo(l);case Zo.code:throw new Zo(l);case Xo.code:throw new Xo(l);case Di.code:throw new Di(l);case ea.code:throw new ea(l);case Hi.code:throw new Hi(l);case ta.code:throw new ta(l);case ra.code:throw new ra(l);case na.code:throw new na(l);case sa.code:throw new sa(l);case ia.code:throw new ia(l);case 5e3:throw new Hi(l);default:throw u instanceof z?u:new dg(l)}}},{delay:({count:u,error:l})=>{if(l&&l instanceof zn){let f=l?.headers?.get("Retry-After");if(f?.match(/\d/))return Number.parseInt(f)*1e3}return~~(1<<u)*i},retryCount:o,shouldRetry:({error:u})=>Wq(u)}),{enabled:s,id:c})}}function Wq(r){return"code"in r&&typeof r.code=="number"?r.code===-1||r.code===Di.code||r.code===Es.code:r instanceof zn&&r.status?r.status===403||r.status===408||r.status===413||r.status===429||r.status===500||r.status===502||r.status===503||r.status===504:!0}function q9({key:r,name:e,request:t,retryCount:n=3,retryDelay:s=150,timeout:i,type:o},a){let c=zg();return{config:{key:r,name:e,request:t,retryCount:n,retryDelay:s,timeout:i,type:o},request:$9(t,{retryCount:n,retryDelay:s,uid:c}),value:a}}xl();We();var Kg=class extends z{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}};L6();xl();function G9(r,{errorInstance:e=new Error("timed out"),timeout:t,signal:n}){return new Promise((s,i)=>{(async()=>{let o;try{let a=new AbortController;t>0&&(o=setTimeout(()=>{n?a.abort():i(e)},t)),s(await r({signal:a?.signal||null}))}catch(a){a?.name==="AbortError"&&i(e),i(a)}finally{clearTimeout(o)}})()})}dn();function Qq(){return{current:0,take(){return this.current++},reset(){this.current=0}}}var F6=Qq();function z9(r,e={}){return{async request(t){let{body:n,onRequest:s=e.onRequest,onResponse:i=e.onResponse,timeout:o=e.timeout??1e4}=t,a={...e.fetchOptions??{},...t.fetchOptions??{}},{headers:c,method:u,signal:l}=a;try{let f=await G9(async({signal:h})=>{let b={...a,body:Array.isArray(n)?nt(n.map(m=>({jsonrpc:"2.0",id:m.id??F6.take(),...m}))):nt({jsonrpc:"2.0",id:n.id??F6.take(),...n}),headers:{...c,"Content-Type":"application/json"},method:u||"POST",signal:l||(o>0?h:null)},p=new Request(r,b);return s&&await s(p),await fetch(r,b)},{errorInstance:new Zd({body:n,url:r}),timeout:o,signal:!0});i&&await i(f);let d;if(f.headers.get("Content-Type")?.startsWith("application/json")?d=await f.json():(d=await f.text(),d=JSON.parse(d||"{}")),!f.ok)throw new zn({body:n,details:nt(d.error)||f.statusText,headers:f.headers,status:f.status,url:r});return d}catch(f){throw f instanceof zn||f instanceof Zd?f:new zn({body:n,details:f.message,url:r})}}}}function D6(r,e={}){let{batch:t,fetchOptions:n,key:s="http",name:i="HTTP JSON-RPC",onFetchRequest:o,onFetchResponse:a,retryDelay:c}=e;return({chain:u,retryCount:l,timeout:f})=>{let{batchSize:d=1e3,wait:h=0}=typeof t=="object"?t:{},b=e.retryCount??l,p=f??e.timeout??1e4,g=r||u?.rpcUrls.default.http[0];if(!g)throw new Kg;let m=z9(g,{fetchOptions:n,onRequest:o,onResponse:a,timeout:p});return q9({key:s,name:i,async request({method:y,params:E}){let v={method:y,params:E},{schedule:k}=jg({id:g,wait:h,shouldSplitBatch(Z){return Z.length>d},fn:Z=>m.request({body:Z}),sort:(Z,_)=>Z.id-_.id}),w=async Z=>t?k(Z):[await m.request({body:Z})],[{error:P,result:B}]=await w(v);if(P)throw new gl({body:v,error:P,url:g});return B},retryCount:b,retryDelay:c,timeout:p,type:"http"},{fetchOptions:n,url:g})}}nc();rc();qo();ic();qd();De();Qb();We();ec();function Hl(r,e){if(!(r instanceof z))return!1;let t=r.walk(n=>n instanceof Xa);return t instanceof Xa?!!(t.data?.errorName==="ResolverNotFound"||t.data?.errorName==="ResolverWildcardNotSupported"||t.data?.errorName==="ResolverNotContract"||t.data?.errorName==="ResolverError"||t.data?.errorName==="HttpError"||t.reason?.includes("Wildcard on non-extended resolvers is not supported")||e==="reverse"&&t.reason===Wb[50]):!1}Zs();Ar();De();Li();gs();function Jg(r){if(r.length!==66||r.indexOf("[")!==0||r.indexOf("]")!==65)return null;let e=`0x${r.slice(1,65)}`;return Ft(e)?e:null}function $l(r){let e=new Uint8Array(32).fill(0);if(!r)return tt(e);let t=r.split(".");for(let n=t.length-1;n>=0;n-=1){let s=Jg(t[n]),i=s?Lr(s):Bt(Qr(t[n]),"bytes");e=Bt(jr([e,i]),"bytes")}return tt(e)}Ar();function V9(r){return`[${r.slice(2)}]`}Ar();De();Li();function K9(r){let e=new Uint8Array(32).fill(0);return r?Jg(r)||Bt(Qr(r)):tt(e)}function da(r){let e=r.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);let t=new Uint8Array(Qr(e).byteLength+2),n=0,s=e.split(".");for(let i=0;i<s.length;i++){let o=Qr(s[i]);o.byteLength>255&&(o=Qr(V9(K9(s[i])))),t[n]=o.length,t.set(o,n+1),n+=o.length+1}return t.byteLength!==n+1?t.slice(0,n+1):t}async function J9(r,{blockNumber:e,blockTag:t,coinType:n,name:s,gatewayUrls:i,strict:o,universalResolverAddress:a}){let c=a;if(!c){if(!r.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=Wn({blockNumber:e,chain:r.chain,contract:"ensUniversalResolver"})}try{let u=Yr({abi:C6,functionName:"addr",...n!=null?{args:[$l(s),BigInt(n)]}:{args:[$l(s)]}}),l={address:c,abi:Mg,functionName:"resolve",args:[Ce(da(s)),u],blockNumber:e,blockTag:t},f=ge(r,pr,"readContract"),d=i?await f({...l,args:[...l.args,i]}):await f(l);if(d[0]==="0x")return null;let h=Jn({abi:C6,args:n!=null?[$l(s),BigInt(n)]:void 0,functionName:"addr",data:d[0]});return h==="0x"||Qs(h)==="0x00"?null:h}catch(u){if(o)throw u;if(Hl(u,"resolve"))return null;throw u}}We();var Wg=class extends z{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}},pa=class extends z{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}},ql=class extends z{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}},Qg=class extends z{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}};var Yq=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Zq=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,Xq=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,eG=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function tG(r){try{let e=await fetch(r,{method:"HEAD"});return e.status===200?e.headers.get("content-type")?.startsWith("image/"):!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(t=>{let n=new Image;n.onload=()=>{t(!0)},n.onerror=()=>{t(!1)},n.src=r})}}function W9(r,e){return r?r.endsWith("/")?r.slice(0,-1):r:e}function H6({uri:r,gatewayUrls:e}){let t=Xq.test(r);if(t)return{uri:r,isOnChain:!0,isEncoded:t};let n=W9(e?.ipfs,"https://ipfs.io"),s=W9(e?.arweave,"https://arweave.net"),i=r.match(Yq),{protocol:o,subpath:a,target:c,subtarget:u=""}=i?.groups||{},l=o==="ipns:/"||a==="ipns/",f=o==="ipfs:/"||a==="ipfs/"||Zq.test(r);if(r.startsWith("http")&&!l&&!f){let h=r;return e?.arweave&&(h=r.replace(/https:\/\/arweave.net/g,e?.arweave)),{uri:h,isOnChain:!1,isEncoded:!1}}if((l||f)&&c)return{uri:`${n}/${l?"ipns":"ipfs"}/${c}${u}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&c)return{uri:`${s}/${c}${u||""}`,isOnChain:!1,isEncoded:!1};let d=r.replace(eG,"");if(d.startsWith("<svg")&&(d=`data:image/svg+xml;base64,${btoa(d)}`),d.startsWith("data:")||d.startsWith("{"))return{uri:d,isOnChain:!0,isEncoded:!1};throw new ql({uri:r})}function $6(r){if(typeof r!="object"||!("image"in r)&&!("image_url"in r)&&!("image_data"in r))throw new Wg({data:r});return r.image||r.image_url||r.image_data}async function Q9({gatewayUrls:r,uri:e}){try{let t=await fetch(e).then(s=>s.json());return await Yg({gatewayUrls:r,uri:$6(t)})}catch{throw new ql({uri:e})}}async function Yg({gatewayUrls:r,uri:e}){let{uri:t,isOnChain:n}=H6({uri:e,gatewayUrls:r});if(n||await tG(t))return t;throw new ql({uri:e})}function Y9(r){let e=r;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));let[t,n,s]=e.split("/"),[i,o]=t.split(":"),[a,c]=n.split(":");if(!i||i.toLowerCase()!=="eip155")throw new pa({reason:"Only EIP-155 supported"});if(!o)throw new pa({reason:"Chain ID not found"});if(!c)throw new pa({reason:"Contract address not found"});if(!s)throw new pa({reason:"Token ID not found"});if(!a)throw new pa({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o),namespace:a.toLowerCase(),contractAddress:c,tokenID:s}}async function Z9(r,{nft:e}){if(e.namespace==="erc721")return pr(r,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return pr(r,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new Qg({namespace:e.namespace})}async function X9(r,{gatewayUrls:e,record:t}){return/eip155:/i.test(t)?rG(r,{gatewayUrls:e,record:t}):Yg({uri:t,gatewayUrls:e})}async function rG(r,{gatewayUrls:e,record:t}){let n=Y9(t),s=await Z9(r,{nft:n}),{uri:i,isOnChain:o,isEncoded:a}=H6({uri:s,gatewayUrls:e});if(o&&(i.includes("data:application/json;base64,")||i.startsWith("{"))){let u=a?atob(i.replace("data:application/json;base64,","")):i,l=JSON.parse(u);return Yg({uri:$6(l),gatewayUrls:e})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),Q9({gatewayUrls:e,uri:i.replace(/(?:0x)?{id}/,c)})}nc();rc();qo();ic();De();async function Zg(r,{blockNumber:e,blockTag:t,name:n,key:s,gatewayUrls:i,strict:o,universalResolverAddress:a}){let c=a;if(!c){if(!r.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=Wn({blockNumber:e,chain:r.chain,contract:"ensUniversalResolver"})}try{let u={address:c,abi:Mg,functionName:"resolve",args:[Ce(da(n)),Yr({abi:_6,functionName:"text",args:[$l(n),s]})],blockNumber:e,blockTag:t},l=ge(r,pr,"readContract"),f=i?await l({...u,args:[...u.args,i]}):await l(u);if(f[0]==="0x")return null;let d=Jn({abi:_6,functionName:"text",data:f[0]});return d===""?null:d}catch(u){if(o)throw u;if(Hl(u,"resolve"))return null;throw u}}async function eO(r,{blockNumber:e,blockTag:t,assetGatewayUrls:n,name:s,gatewayUrls:i,strict:o,universalResolverAddress:a}){let c=await ge(r,Zg,"getEnsText")({blockNumber:e,blockTag:t,key:"avatar",name:s,universalResolverAddress:a,gatewayUrls:i,strict:o});if(!c)return null;try{return await X9(r,{record:c,gatewayUrls:n})}catch{return null}}nc();ic();De();async function tO(r,{address:e,blockNumber:t,blockTag:n,gatewayUrls:s,strict:i,universalResolverAddress:o}){let a=o;if(!a){if(!r.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=Wn({blockNumber:t,chain:r.chain,contract:"ensUniversalResolver"})}let c=`${e.toLowerCase().substring(2)}.addr.reverse`;try{let u={address:a,abi:y9,functionName:"reverse",args:[Ce(da(c))],blockNumber:t,blockTag:n},l=ge(r,pr,"readContract"),[f,d]=s?await l({...u,args:[...u.args,s]}):await l(u);return e.toLowerCase()!==d.toLowerCase()?null:f}catch(u){if(i)throw u;if(Hl(u,"reverse"))return null;throw u}}ic();De();async function rO(r,{blockNumber:e,blockTag:t,name:n,universalResolverAddress:s}){let i=s;if(!i){if(!r.chain)throw new Error("client chain not configured. universalResolverAddress is required.");i=Wn({blockNumber:e,chain:r.chain,contract:"ensUniversalResolver"})}let[o]=await ge(r,pr,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Ce(da(n))],blockNumber:e,blockTag:t});return o}Dl();async function nO(r){let e=$o(r,{method:"eth_newBlockFilter"}),t=await r.request({method:"eth_newBlockFilter"});return{id:t,request:e(t),type:"block"}}De();async function Xg(r,{address:e,args:t,event:n,events:s,fromBlock:i,strict:o,toBlock:a}={}){let c=s??(n?[n]:void 0),u=$o(r,{method:"eth_newFilter"}),l=[];c&&(l=[c.flatMap(d=>ei({abi:[d],eventName:d.name,args:t}))],n&&(l=l[0]));let f=await r.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof i=="bigint"?Ae(i):i,toBlock:typeof a=="bigint"?Ae(a):a,...l.length?{topics:l}:{}}]});return{abi:c,args:t,eventName:n?n.name:void 0,fromBlock:i,id:f,request:u(f),strict:Boolean(o),toBlock:a,type:"event"}}async function ex(r){let e=$o(r,{method:"eth_newPendingTransactionFilter"}),t=await r.request({method:"eth_newPendingTransactionFilter"});return{id:t,request:e(t),type:"transaction"}}De();async function sO(r,{address:e,blockNumber:t,blockTag:n="latest"}){let s=t?Ae(t):void 0,i=await r.request({method:"eth_getBalance",params:[e,s||n]});return BigInt(i)}async function iO(r){let e=await r.request({method:"eth_blobBaseFee"});return BigInt(e)}Mr();De();async function oO(r,{blockHash:e,blockNumber:t,blockTag:n="latest"}={}){let s=t!==void 0?Ae(t):void 0,i;return e?i=await r.request({method:"eth_getBlockTransactionCountByHash",params:[e]},{dedupe:!0}):i=await r.request({method:"eth_getBlockTransactionCountByNumber",params:[s||n]},{dedupe:Boolean(s)}),ar(i)}De();async function q6(r,{address:e,blockNumber:t,blockTag:n="latest"}){let s=t!==void 0?Ae(t):void 0,i=await r.request({method:"eth_getCode",params:[e,s||n]},{dedupe:Boolean(s)});if(i!=="0x")return i}De();function aO(r){return{baseFeePerGas:r.baseFeePerGas.map(e=>BigInt(e)),gasUsedRatio:r.gasUsedRatio,oldestBlock:BigInt(r.oldestBlock),reward:r.reward?.map(e=>e.map(t=>BigInt(t)))}}async function cO(r,{blockCount:e,blockNumber:t,blockTag:n="latest",rewardPercentiles:s}){let i=t?Ae(t):void 0,o=await r.request({method:"eth_feeHistory",params:[Ae(e),i||n,s]},{dedupe:Boolean(i)});return aO(o)}async function uO(r,{filter:e}){let t=e.strict??!1,s=(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(i=>Xr(i));return e.abi?jl({abi:e.abi,logs:s,strict:t}):s}De();function lO(r){return{formatters:void 0,fees:void 0,serializers:void 0,...r}}var fO=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,dO=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;or();ji();Ys();Ks();De();Ya();Zs();De();Li();function pO(r){let{domain:e={},message:t,primaryType:n}=r,s={EIP712Domain:yO({domain:e}),...r.types};xO({domain:e,message:t,primaryType:n,types:s});let i=["0x1901"];return e&&i.push(nG({domain:e,types:s})),n!=="EIP712Domain"&&i.push(hO({data:t,primaryType:n,types:s})),Bt(jr(i))}function nG({domain:r,types:e}){return hO({data:r,primaryType:"EIP712Domain",types:e})}function hO({data:r,primaryType:e,types:t}){let n=mO({data:r,primaryType:e,types:t});return Bt(n)}function mO({data:r,primaryType:e,types:t}){let n=[{type:"bytes32"}],s=[sG({primaryType:e,types:t})];for(let i of t[e]){let[o,a]=gO({types:t,name:i.name,type:i.type,value:r[i.name]});n.push(o),s.push(a)}return As(n,s)}function sG({primaryType:r,types:e}){let t=Ce(iG({primaryType:r,types:e}));return Bt(t)}function iG({primaryType:r,types:e}){let t="",n=bO({primaryType:r,types:e});n.delete(r);let s=[r,...Array.from(n).sort()];for(let i of s)t+=`${i}(${e[i].map(({name:o,type:a})=>`${a} ${o}`).join(",")})`;return t}function bO({primaryType:r,types:e},t=new Set){let s=r.match(/^\w*/u)?.[0];if(t.has(s)||e[s]===void 0)return t;t.add(s);for(let i of e[s])bO({primaryType:i.type,types:e},t);return t}function gO({types:r,name:e,type:t,value:n}){if(r[t]!==void 0)return[{type:"bytes32"},Bt(mO({data:n,primaryType:t,types:r}))];if(t==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},Bt(n)];if(t==="string")return[{type:"bytes32"},Bt(Ce(n))];if(t.lastIndexOf("]")===t.length-1){let s=t.slice(0,t.lastIndexOf("[")),i=n.map(o=>gO({name:e,type:s,types:r,value:o}));return[{type:"bytes32"},Bt(As(i.map(([o])=>o),i.map(([,o])=>o)))]}return[{type:t},n]}function xO(r){let{domain:e,message:t,primaryType:n,types:s}=r,i=(o,a)=>{for(let c of o){let{name:u,type:l}=c,f=a[u],d=l.match(dO);if(d&&(typeof f=="number"||typeof f=="bigint")){let[p,g,m]=d;Ae(f,{signed:g==="int",size:Number.parseInt(m)/8})}if(l==="address"&&typeof f=="string"&&!Et(f))throw new St({address:f});let h=l.match(fO);if(h){let[p,g]=h;if(g&&rt(f)!==Number.parseInt(g))throw new Pb({expectedSize:Number.parseInt(g),givenSize:rt(f)})}let b=s[l];b&&i(b,f)}};s.EIP712Domain&&e&&i(s.EIP712Domain,e),n!=="EIP712Domain"&&i(s[n],t)}function yO({domain:r}){return[typeof r?.name=="string"&&{name:"name",type:"string"},r?.version&&{name:"version",type:"string"},typeof r?.chainId=="number"&&{name:"chainId",type:"uint256"},r?.verifyingContract&&{name:"verifyingContract",type:"address"},r?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}We();Zb();Ar();De();function ha(r,e="hex"){let t=wO(r),n=fl(new Uint8Array(t.length));return t.encode(n),e==="hex"?tt(n.bytes):n.bytes}function wO(r){return Array.isArray(r)?oG(r.map(e=>wO(e))):aG(r)}function oG(r){let e=r.reduce((s,i)=>s+i.length,0),t=AO(e);return{length:(()=>e<=55?1+e:1+t+e)(),encode(s){e<=55?s.pushByte(192+e):(s.pushByte(192+55+t),t===1?s.pushUint8(e):t===2?s.pushUint16(e):t===3?s.pushUint24(e):s.pushUint32(e));for(let{encode:i}of r)i(s)}}}function aG(r){let e=typeof r=="string"?fn(r):r,t=AO(e.length);return{length:(()=>e.length===1&&e[0]<128?1:e.length<=55?1+e.length:1+t+e.length)(),encode(s){e.length===1&&e[0]<128?s.pushBytes(e):e.length<=55?(s.pushByte(128+e.length),s.pushBytes(e)):(s.pushByte(128+55+t),t===1?s.pushUint8(e.length):t===2?s.pushUint16(e.length):t===3?s.pushUint24(e.length):s.pushUint32(e.length),s.pushBytes(e))}}}function AO(r){if(r<2**8)return 1;if(r<2**16)return 2;if(r<2**24)return 3;if(r<2**32)return 4;throw new z("Length is too large.")}Mr();bg();var cG={"0x0":"reverted","0x1":"success"};function G6(r){let e={...r,blockNumber:r.blockNumber?BigInt(r.blockNumber):null,contractAddress:r.contractAddress?r.contractAddress:null,cumulativeGasUsed:r.cumulativeGasUsed?BigInt(r.cumulativeGasUsed):null,effectiveGasPrice:r.effectiveGasPrice?BigInt(r.effectiveGasPrice):null,gasUsed:r.gasUsed?BigInt(r.gasUsed):null,logs:r.logs?r.logs.map(t=>Xr(t)):null,to:r.to?r.to:null,transactionIndex:r.transactionIndex?ar(r.transactionIndex):null,status:r.status?cG[r.status]:null,type:r.type?P6[r.type]||r.type:null};return r.blobGasPrice&&(e.blobGasPrice=BigInt(r.blobGasPrice)),r.blobGasUsed&&(e.blobGasUsed=BigInt(r.blobGasUsed)),e}var EO=Sl("transactionReceipt",G6);Mr();var vO=`Ethereum Signed Message:
|
|
803
|
-
`;Zs();Ar();Li();function tx(r,e){let t=(()=>typeof r=="string"?Qr(r):r.raw instanceof Uint8Array?r.raw:Lr(r.raw))(),n=Qr(`${vO}${t.length}`);return Bt(jr([n,t]),e)}ji();We();Lg();Bl();Ys();Ks();al();Mr();function TO(r){let{blobVersionedHashes:e}=r;if(e){if(e.length===0)throw new Rl;for(let t of e){let n=rt(t),s=ar(Ui(t,0,1));if(n!==32)throw new Sg({hash:t,size:n});if(s!==1)throw new Og({hash:t,version:s})}}z6(r)}function z6(r){let{chainId:e,maxPriorityFeePerGas:t,maxFeePerGas:n,to:s}=r;if(e<=0)throw new Fl({chainId:e});if(s&&!Et(s))throw new St({address:s});if(n&&n>2n**256n-1n)throw new Kn({maxFeePerGas:n});if(t&&n&&t>n)throw new ni({maxFeePerGas:n,maxPriorityFeePerGas:t})}function PO(r){let{chainId:e,maxPriorityFeePerGas:t,gasPrice:n,maxFeePerGas:s,to:i}=r;if(e<=0)throw new Fl({chainId:e});if(i&&!Et(i))throw new St({address:i});if(t||s)throw new z("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>2n**256n-1n)throw new Kn({maxFeePerGas:n})}function kO(r){let{chainId:e,maxPriorityFeePerGas:t,gasPrice:n,maxFeePerGas:s,to:i,accessList:o}=r;if(i&&!Et(i))throw new St({address:i});if(typeof e<"u"&&e<=0)throw new Fl({chainId:e});if(t||s)throw new z("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>2n**256n-1n)throw new Kn({maxFeePerGas:n});if(o)throw new z("`accessList` is not a valid Legacy Transaction attribute.")}ri();Zs();qd();De();ji();ri();Ys();function rx(r){if(!r||r.length===0)return[];let e=[];for(let t=0;t<r.length;t++){let{address:n,storageKeys:s}=r[t];for(let i=0;i<s.length;i++)if(s[i].length-2!==64)throw new cg({storageKey:s[i]});if(!Et(n,{strict:!1}))throw new St({address:n});e.push([n,s])}return e}function BO(r,e){let t=Cg(r);return t==="eip1559"?lG(r,e):t==="eip2930"?fG(r,e):t==="eip4844"?uG(r,e):dG(r,e)}function uG(r,e){let{chainId:t,gas:n,nonce:s,to:i,value:o,maxFeePerBlobGas:a,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:l,data:f}=r;TO(r);let d=r.blobVersionedHashes,h=r.sidecars;if(r.blobs&&(typeof d>"u"||typeof h>"u")){let E=typeof r.blobs[0]=="string"?r.blobs:r.blobs.map(w=>tt(w)),v=r.kzg,k=Nl({blobs:E,kzg:v});if(typeof d>"u"&&(d=kg({commitments:k})),typeof h>"u"){let w=Il({blobs:E,commitments:k,kzg:v});h=_g({blobs:E,commitments:k,proofs:w})}}let b=rx(l),p=[Ce(t),s?Ce(s):"0x",u?Ce(u):"0x",c?Ce(c):"0x",n?Ce(n):"0x",i??"0x",o?Ce(o):"0x",f??"0x",b,a?Ce(a):"0x",d??[],...V6(r,e)],g=[],m=[],y=[];if(h)for(let E=0;E<h.length;E++){let{blob:v,commitment:k,proof:w}=h[E];g.push(v),m.push(k),y.push(w)}return ws(["0x03",h?ha([p,g,m,y]):ha(p)])}function lG(r,e){let{chainId:t,gas:n,nonce:s,to:i,value:o,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:u,data:l}=r;z6(r);let f=rx(u),d=[Ce(t),s?Ce(s):"0x",c?Ce(c):"0x",a?Ce(a):"0x",n?Ce(n):"0x",i??"0x",o?Ce(o):"0x",l??"0x",f,...V6(r,e)];return ws(["0x02",ha(d)])}function fG(r,e){let{chainId:t,gas:n,data:s,nonce:i,to:o,value:a,accessList:c,gasPrice:u}=r;PO(r);let l=rx(c),f=[Ce(t),i?Ce(i):"0x",u?Ce(u):"0x",n?Ce(n):"0x",o??"0x",a?Ce(a):"0x",s??"0x",l,...V6(r,e)];return ws(["0x01",ha(f)])}function dG(r,e){let{chainId:t=0,gas:n,data:s,nonce:i,to:o,value:a,gasPrice:c}=r;kO(r);let u=[i?Ce(i):"0x",c?Ce(c):"0x",n?Ce(n):"0x",o??"0x",a?Ce(a):"0x",s??"0x"];if(e){let l=(()=>{if(e.v>=35n)return(e.v-35n)/2n>0?e.v:27n+(e.v===35n?0n:1n);if(t>0)return BigInt(t*2)+BigInt(35n+e.v-27n);let f=27n+(e.v===27n?0n:1n);if(e.v!==f)throw new og({v:e.v});return f})();u=[...u,Ce(l),e.r,e.s]}else t>0&&(u=[...u,Ce(t),"0x","0x"]);return ha(u)}function V6(r,e){let t=e??r,{v:n,yParity:s}=t;if(typeof t.r>"u")return[];if(typeof t.s>"u")return[];if(typeof n>"u"&&typeof s>"u")return[];let i=Qs(t.r),o=Qs(t.s);return[(()=>typeof s=="number"?s?Ce(1):"0x":n===0n?"0x":n===1n?Ce(1):n===27n?"0x":Ce(1))(),i==="0x00"?"0x":i,o==="0x00"?"0x":o]}function pG(r){return r.map(e=>({...e,value:BigInt(e.value)}))}function SO(r){return{...r,balance:r.balance?BigInt(r.balance):void 0,nonce:r.nonce?ar(r.nonce):void 0,storageProof:r.storageProof?pG(r.storageProof):void 0}}async function OO(r,{address:e,blockNumber:t,blockTag:n,storageKeys:s}){let i=n??"latest",o=t!==void 0?Ae(t):void 0,a=await r.request({method:"eth_getProof",params:[e,s,o||i]});return SO(a)}De();async function _O(r,{address:e,blockNumber:t,blockTag:n="latest",slot:s}){let i=t!==void 0?Ae(t):void 0;return await r.request({method:"eth_getStorageAt",params:[e,s,i||n]})}ri();De();async function Gl(r,{blockHash:e,blockNumber:t,blockTag:n,hash:s,index:i}){let o=n||"latest",a=t!==void 0?Ae(t):void 0,c=null;if(s?c=await r.request({method:"eth_getTransactionByHash",params:[s]},{dedupe:!0}):e?c=await r.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,Ae(i)]},{dedupe:!0}):(a||o)&&(c=await r.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[a||o,Ae(i)]},{dedupe:Boolean(a)})),!c)throw new pl({blockHash:e,blockNumber:t,blockTag:o,hash:s,index:i});return(r.chain?.formatters?.transaction?.format||tc)(c)}async function CO(r,{hash:e,transactionReceipt:t}){let[n,s]=await Promise.all([ge(r,oi,"getBlockNumber")({}),e?ge(r,Gl,"getTransaction")({hash:e}):void 0]),i=t?.blockNumber||s?.blockNumber;return i?n-i+1n:0n}ri();async function o0(r,{hash:e}){let t=await r.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!t)throw new hl({hash:e});return(r.chain?.formatters?.transactionReceipt?.format||G6)(t)}nc();or();We();ec();rc();qo();ic();async function NO(r,e){let{allowFailure:t=!0,batchSize:n,blockNumber:s,blockTag:i,multicallAddress:o,stateOverride:a}=e,c=e.contracts,u=n??(typeof r.batch?.multicall=="object"&&r.batch.multicall.batchSize||1024),l=o;if(!l){if(!r.chain)throw new Error("client chain not configured. multicallAddress is required.");l=Wn({blockNumber:s,chain:r.chain,contract:"multicall3"})}let f=[[]],d=0,h=0;for(let g=0;g<c.length;g++){let{abi:m,address:y,args:E,functionName:v}=c[g];try{let k=Yr({abi:m,args:E,functionName:v});h+=(k.length-2)/2,u>0&&h>u&&f[d].length>0&&(d++,h=(k.length-2)/2,f[d]=[]),f[d]=[...f[d],{allowFailure:!0,callData:k,target:y}]}catch(k){let w=$i(k,{abi:m,address:y,args:E,docsPath:"/docs/contract/multicall",functionName:v});if(!t)throw w;f[d]=[...f[d],{allowFailure:!0,callData:"0x",target:y}]}}let b=await Promise.allSettled(f.map(g=>ge(r,pr,"readContract")({abi:t0,address:l,args:[g],blockNumber:s,blockTag:i,functionName:"aggregate3",stateOverride:a}))),p=[];for(let g=0;g<b.length;g++){let m=b[g];if(m.status==="rejected"){if(!t)throw m.reason;for(let E=0;E<f[g].length;E++)p.push({status:"failure",error:m.reason,result:void 0});continue}let y=m.value;for(let E=0;E<y.length;E++){let{returnData:v,success:k}=y[E],{callData:w}=f[g][E],{abi:P,address:B,functionName:Z,args:_}=c[p.length];try{if(w==="0x")throw new Js;if(!k)throw new Go({data:v});let O=Jn({abi:P,args:_,data:v,functionName:Z});p.push(t?{result:O,status:"success"}:O)}catch(O){let S=$i(O,{abi:P,address:B,args:_,docsPath:"/docs/contract/multicall",functionName:Z});if(!t)throw S;p.push({error:S,result:void 0,status:"failure"})}}}if(p.length!==c.length)throw new z("multicall results mismatch");return p}nc();N6();ec();R6();Vl();Ar();gs();function LO(r,e){let t=Ft(r)?Lr(r):r,n=Ft(e)?Lr(e):e;return W6(t,n)}gs();De();XO();Mr();function e_({r,s:e,v:t,yParity:n}){let s=(()=>{if(n===0||n===1)return n;if(t&&(t===27n||t===28n||t>=35n))return t%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})();return`0x${new aA.Signature(dr(r),dr(e)).toCompactHex()}${s===0?"1b":"1c"}`}Dl();async function Kl(r,{address:e,hash:t,signature:n,...s}){let i=(()=>Ft(n)?n:typeof n=="object"&&"r"in n&&"s"in n?e_(n):tt(n))();try{let{data:o}=await ge(r,si,"call")({data:n0({abi:w9,args:[e,t,i],bytecode:P9}),...s});return LO(o??"0x0","0x1")}catch(o){if(o instanceof bl)return!1;throw o}}async function t_(r,{address:e,message:t,signature:n,...s}){let i=tx(t);return Kl(r,{address:e,hash:i,signature:n,...s})}async function r_(r,e){let{address:t,signature:n,message:s,primaryType:i,types:o,domain:a,...c}=e,u=pO({message:s,primaryType:i,types:o,domain:a});return Kl(r,{address:t,hash:u,signature:n,...c})}ri();dn();Mr();dn();function lx(r,{emitOnBegin:e=!1,emitMissed:t=!1,onBlockNumber:n,onError:s,poll:i,pollingInterval:o=r.pollingInterval}){let a=(()=>typeof i<"u"?i:!(r.transport.type==="webSocket"||r.transport.type==="fallback"&&r.transport.transports[0].config.type==="webSocket"))(),c;return a?(()=>{let f=nt(["watchBlockNumber",r.uid,e,t,o]);return en(f,{onBlockNumber:n,onError:s},d=>ii(async()=>{try{let h=await ge(r,oi,"getBlockNumber")({cacheTime:0});if(c){if(h===c)return;if(h-c>1&&t)for(let b=c+1n;b<h;b++)d.onBlockNumber(b,c),c=b}(!c||h>c)&&(d.onBlockNumber(h,c),c=h)}catch(h){d.onError?.(h)}},{emitOnBegin:e,interval:o}))})():(()=>{let f=nt(["watchBlockNumber",r.uid,e,t]);return en(f,{onBlockNumber:n,onError:s},d=>{let h=!0,b=()=>h=!1;return(async()=>{try{let p=(()=>{if(r.transport.type==="fallback"){let m=r.transport.transports.find(y=>y.config.type==="webSocket");return m?m.value:r.transport}return r.transport})(),{unsubscribe:g}=await p.subscribe({params:["newHeads"],onData(m){if(!h)return;let y=dr(m.result?.number);d.onBlockNumber(y,c),c=y},onError(m){d.onError?.(m)}});b=g,h||b()}catch(p){s?.(p)}})(),()=>b()})})()}async function n_(r,{confirmations:e=1,hash:t,onReplaced:n,pollingInterval:s=r.pollingInterval,retryCount:i=6,retryDelay:o=({count:c})=>~~(1<<c)*200,timeout:a}){let c=nt(["waitForTransactionReceipt",r.uid,t]),u=0,l,f,d,h=!1;return new Promise((b,p)=>{a&&setTimeout(()=>p(new Yd({hash:t})),a);let g=en(c,{onReplaced:n,resolve:b,reject:p},m=>{let y=ge(r,lx,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:s,async onBlockNumber(E){let v=w=>{y(),w(),g()},k=E;if(!h){u>i&&v(()=>m.reject(new Yd({hash:t})));try{if(d){if(e>1&&(!d.blockNumber||k-d.blockNumber+1n<e))return;v(()=>m.resolve(d));return}if(l||(h=!0,await i0(async()=>{l=await ge(r,Gl,"getTransaction")({hash:t}),l.blockNumber&&(k=l.blockNumber)},{delay:o,retryCount:i}),h=!1),d=await ge(r,o0,"getTransactionReceipt")({hash:t}),e>1&&(!d.blockNumber||k-d.blockNumber+1n<e))return;v(()=>m.resolve(d))}catch(w){if(w instanceof pl||w instanceof hl){if(!l){h=!1;return}try{f=l,h=!0;let P=await i0(()=>ge(r,Zr,"getBlock")({blockNumber:k,includeTransactions:!0}),{delay:o,retryCount:i,shouldRetry:({error:_})=>_ instanceof _l});h=!1;let B=P.transactions.find(({from:_,nonce:O})=>_===f.from&&O===f.nonce);if(!B||(d=await ge(r,o0,"getTransactionReceipt")({hash:B.hash}),e>1&&(!d.blockNumber||k-d.blockNumber+1n<e)))return;let Z="replaced";B.to===f.to&&B.value===f.value?Z="repriced":B.from===B.to&&B.value===0n&&(Z="cancelled"),v(()=>{m.onReplaced?.({reason:Z,replacedTransaction:f,transaction:B,transactionReceipt:d}),m.resolve(d)})}catch(P){v(()=>m.reject(P))}}else v(()=>m.reject(w))}finally{u++}}}})})})}dn();function s_(r,{blockTag:e="latest",emitMissed:t=!1,emitOnBegin:n=!1,onBlock:s,onError:i,includeTransactions:o,poll:a,pollingInterval:c=r.pollingInterval}){let u=(()=>typeof a<"u"?a:!(r.transport.type==="webSocket"||r.transport.type==="fallback"&&r.transport.transports[0].config.type==="webSocket"))(),l=o??!1,f;return u?(()=>{let b=nt(["watchBlocks",r.uid,e,t,n,l,c]);return en(b,{onBlock:s,onError:i},p=>ii(async()=>{try{let g=await ge(r,Zr,"getBlock")({blockTag:e,includeTransactions:l});if(g.number&&f?.number){if(g.number===f.number)return;if(g.number-f.number>1&&t)for(let m=f?.number+1n;m<g.number;m++){let y=await ge(r,Zr,"getBlock")({blockNumber:m,includeTransactions:l});p.onBlock(y,f),f=y}}(!f?.number||e==="pending"&&!g?.number||g.number&&g.number>f.number)&&(p.onBlock(g,f),f=g)}catch(g){p.onError?.(g)}},{emitOnBegin:n,interval:c}))})():(()=>{let b=!0,p=()=>b=!1;return(async()=>{try{let g=(()=>{if(r.transport.type==="fallback"){let y=r.transport.transports.find(E=>E.config.type==="webSocket");return y?y.value:r.transport}return r.transport})(),{unsubscribe:m}=await g.subscribe({params:["newHeads"],onData(y){if(!b)return;let v=(r.chain?.formatters?.block?.format||e0)(y.result);s(v,f),f=v},onError(y){i?.(y)}});p=m,b||p()}catch(g){i?.(g)}})(),()=>p()})()}dn();or();Xd();function i_(r,{address:e,args:t,batch:n=!0,event:s,events:i,fromBlock:o,onError:a,onLogs:c,poll:u,pollingInterval:l=r.pollingInterval,strict:f}){let d=(()=>typeof u<"u"?u:typeof o=="bigint"?!0:!(r.transport.type==="webSocket"||r.transport.type==="fallback"&&r.transport.transports[0].config.type==="webSocket"))(),h=f??!1;return d?(()=>{let g=nt(["watchEvent",e,t,n,r.uid,s,l,o]);return en(g,{onLogs:c,onError:a},m=>{let y;o!==void 0&&(y=o-1n);let E,v=!1,k=ii(async()=>{if(!v){try{E=await ge(r,Xg,"createEventFilter")({address:e,args:t,event:s,events:i,strict:h,fromBlock:o})}catch{}v=!0;return}try{let w;if(E)w=await ge(r,la,"getFilterChanges")({filter:E});else{let P=await ge(r,oi,"getBlockNumber")({});y&&y!==P?w=await ge(r,Ul,"getLogs")({address:e,args:t,event:s,events:i,fromBlock:y+1n,toBlock:P}):w=[],y=P}if(w.length===0)return;if(n)m.onLogs(w);else for(let P of w)m.onLogs([P])}catch(w){E&&w instanceof Vn&&(v=!1),m.onError?.(w)}},{emitOnBegin:!0,interval:l});return async()=>{E&&await ge(r,fa,"uninstallFilter")({filter:E}),k()}})})():(()=>{let g=!0,m=()=>g=!1;return(async()=>{try{let y=(()=>{if(r.transport.type==="fallback"){let w=r.transport.transports.find(P=>P.config.type==="webSocket");return w?w.value:r.transport}return r.transport})(),E=i??(s?[s]:void 0),v=[];E&&(v=[E.flatMap(w=>ei({abi:[w],eventName:w.name,args:t}))],s&&(v=v[0]));let{unsubscribe:k}=await y.subscribe({params:["logs",{address:e,topics:v}],onData(w){if(!g)return;let P=w.result;try{let{eventName:B,args:Z}=Ll({abi:E??[],data:P.data,topics:P.topics,strict:h}),_=Xr(P,{args:Z,eventName:B});c([_])}catch(B){let Z,_;if(B instanceof xs||B instanceof Ws){if(f)return;Z=B.abiItem.name,_=B.abiItem.inputs?.some(S=>!("name"in S&&S.name))}let O=Xr(P,{args:_?[]:{},eventName:Z});c([O])}},onError(w){a?.(w)}});m=k,g||m()}catch(y){a?.(y)}})(),()=>m()})()}dn();function o_(r,{batch:e=!0,onError:t,onTransactions:n,poll:s,pollingInterval:i=r.pollingInterval}){return(typeof s<"u"?s:r.transport.type!=="webSocket")?(()=>{let u=nt(["watchPendingTransactions",r.uid,e,i]);return en(u,{onTransactions:n,onError:t},l=>{let f,d=ii(async()=>{try{if(!f)try{f=await ge(r,ex,"createPendingTransactionFilter")({});return}catch(b){throw d(),b}let h=await ge(r,la,"getFilterChanges")({filter:f});if(h.length===0)return;if(e)l.onTransactions(h);else for(let b of h)l.onTransactions([b])}catch(h){l.onError?.(h)}},{emitOnBegin:!0,interval:i});return async()=>{f&&await ge(r,fa,"uninstallFilter")({filter:f}),d()}})})():(()=>{let u=!0,l=()=>u=!1;return(async()=>{try{let{unsubscribe:f}=await r.transport.subscribe({params:["newPendingTransactions"],onData(d){if(!u)return;let h=d.result;n([h])},onError(d){t?.(d)}});l=f,u||l()}catch(f){t?.(f)}})(),()=>l()})()}function a_(r){let{scheme:e,statement:t,...n}=r.match(HG)?.groups??{},{chainId:s,expirationTime:i,issuedAt:o,notBefore:a,requestId:c,...u}=r.match($G)?.groups??{},l=r.split("Resources:")[1]?.split(`
|
|
804
|
-
- `).slice(1);return{...n,...u,...s?{chainId:Number(s)}:{},...i?{expirationTime:new Date(i)}:{},...o?{issuedAt:new Date(o)}:{},...a?{notBefore:new Date(a)}:{},...c?{requestId:c}:{},...l?{resources:l}:{},...e?{scheme:e}:{},...t?{statement:t}:{}}}var HG=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,$G=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;j6();function c_(r){let{address:e,domain:t,message:n,nonce:s,scheme:i,time:o=new Date}=r;if(t&&n.domain!==t||s&&n.nonce!==s||i&&n.scheme!==i||n.expirationTime&&o>=n.expirationTime||n.notBefore&&o<n.notBefore)return!1;try{if(!n.address||e&&!Hg(n.address,e))return!1}catch{return!1}return!0}async function u_(r,e){let{address:t,domain:n,message:s,nonce:i,scheme:o,signature:a,time:c=new Date,...u}=e,l=a_(s);if(!l.address||!c_({address:t,domain:n,message:l,nonce:i,scheme:o,time:c}))return!1;let d=tx(s);return Kl(r,{address:l.address,hash:d,signature:a,...u})}function l_(r){return{call:e=>si(r,e),createBlockFilter:()=>nO(r),createContractEventFilter:e=>Jb(r,e),createEventFilter:e=>Xg(r,e),createPendingTransactionFilter:()=>ex(r),estimateContractGas:e=>b9(r,e),estimateGas:e=>Ml(r,e),getBalance:e=>sO(r,e),getBlobBaseFee:()=>iO(r),getBlock:e=>Zr(r,e),getBlockNumber:e=>oi(r,e),getBlockTransactionCount:e=>oO(r,e),getBytecode:e=>q6(r,e),getChainId:()=>Ng(r),getCode:e=>q6(r,e),getContractEvents:e=>Rg(r,e),getEip712Domain:e=>F9(r,e),getEnsAddress:e=>J9(r,e),getEnsAvatar:e=>eO(r,e),getEnsName:e=>tO(r,e),getEnsResolver:e=>rO(r,e),getEnsText:e=>Zg(r,e),getFeeHistory:e=>cO(r,e),estimateFeesPerGas:e=>f9(r,e),getFilterChanges:e=>la(r,e),getFilterLogs:e=>uO(r,e),getGasPrice:()=>Cl(r),getLogs:e=>Ul(r,e),getProof:e=>OO(r,e),estimateMaxPriorityFeePerGas:e=>l9(r,e),getStorageAt:e=>_O(r,e),getTransaction:e=>Gl(r,e),getTransactionConfirmations:e=>CO(r,e),getTransactionCount:e=>vg(r,e),getTransactionReceipt:e=>o0(r,e),multicall:e=>NO(r,e),prepareTransactionRequest:e=>Ig(r,e),readContract:e=>pr(r,e),sendRawTransaction:e=>U9(r,e),simulateContract:e=>I9(r,e),verifyMessage:e=>t_(r,e),verifySiweMessage:e=>u_(r,e),verifyTypedData:e=>r_(r,e),uninstallFilter:e=>fa(r,e),waitForTransactionReceipt:e=>n_(r,e),watchBlocks:e=>s_(r,e),watchBlockNumber:e=>lx(r,e),watchContractEvent:e=>j9(r,e),watchEvent:e=>i_(r,e),watchPendingTransactions:e=>o_(r,e)}}function cA(r){let{key:e="public",name:t="Public Client"}=r;return D9({...r,key:e,name:t,type:"publicClient"}).extend(l_)}var f_={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}};Mr();var d_={block:u9({format(r){return{transactions:r.transactions?.map(t=>{if(typeof t=="string")return t;let n=tc(t);return n.typeHex==="0x7e"&&(n.isSystemTx=t.isSystemTx,n.mint=t.mint?dr(t.mint):void 0,n.sourceHash=t.sourceHash,n.type="deposit"),n}),stateRoot:r.stateRoot}}}),transaction:c9({format(r){let e={};return r.type==="0x7e"&&(e.isSystemTx=r.isSystemTx,e.mint=r.mint?dr(r.mint):void 0,e.sourceHash=r.sourceHash,e.type="deposit"),e}}),transactionReceipt:EO({format(r){return{l1GasPrice:r.l1GasPrice?dr(r.l1GasPrice):null,l1GasUsed:r.l1GasUsed?dr(r.l1GasUsed):null,l1Fee:r.l1Fee?dr(r.l1Fee):null,l1FeeScalar:r.l1FeeScalar?Number(r.l1FeeScalar):null}}})};ji();Ys();Zs();De();function qG(r,e){return zG(r)?GG(r):BO(r,e)}var p_={transaction:qG};function GG(r){VG(r);let{sourceHash:e,data:t,from:n,gas:s,isSystemTx:i,mint:o,to:a,value:c}=r,u=[e,n,a??"0x",o?Ce(o):"0x",c?Ce(c):"0x",s?Ce(s):"0x",i?"0x1":"0x",t??"0x"];return ws(["0x7e",ha(u)])}function zG(r){return r.type==="deposit"||typeof r.sourceHash<"u"}function VG(r){let{from:e,to:t}=r;if(e&&!Et(e))throw new St({address:e});if(t&&!Et(t))throw new St({address:t})}var uA={contracts:f_,formatters:d_,serializers:p_};var c0=1,lA=lO({...uA,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...uA.contracts,disputeGameFactory:{[c0]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[c0]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[c0]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[c0]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:c0});var KG=Object.defineProperty,JG=(r,e,t)=>e in r?KG(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,h_=(r,e,t)=>(JG(r,typeof e!="symbol"?e+"":e,t),t),cr=class extends Error{constructor(r,e){let t;typeof e=="string"?t={message:e}:e instanceof Error?t={cause:e,message:e.message}:t=e,t.message||(t.message=t.cause?.message||""),super(t.message,{cause:t.cause}),h_(this,"errCode"),h_(this,"presentable",!1),this.name="AuthClientError",this.errCode=r}},fx=r=>r.isErr()?{error:r.error,isError:!0}:{...r.value,isError:!1},QG={interval:1e3,timeout:1e4,successCode:200,onResponse:()=>{}},g_=async(r,e,t)=>bt.fromPromise(fetch(x_(r,e),{headers:y_(t)}),n=>new cr("unknown",n)).andThen(n=>bt.fromPromise(n.json(),s=>new cr("unknown",s)).andThen(s=>Pt({response:n,data:s}))),YG=async(r,e,t,n)=>bt.fromPromise(fetch(x_(r,e),{method:"POST",body:JSON.stringify(t),headers:y_(n)}),s=>new cr("unknown",s)).andThen(s=>bt.fromPromise(s.json(),i=>new cr("unknown",i)).andThen(i=>Pt({response:s,data:i}))),ZG=async(r,e,t,n)=>{let{timeout:s,interval:i,successCode:o,onResponse:a}={...QG,...t},c=Date.now()+s;for(;Date.now()<c;){let u=await g_(r,e,n);if(u.isOk()){let{response:l}=u.value;if(l.status===o)return Pt(u.value);a(u.value),await new Promise(f=>setTimeout(f,i))}else return at(u.error)}return at(new cr("unavailable",`Polling timed out after ${s}ms`))},x_=(r,e)=>`${r.config.relay}/${r.config.version}/${e}`,y_=r=>{let e={...r?.headers};return r?.authToken&&(e.Authorization=`Bearer ${r.authToken}`),{...e,"Content-Type":"application/json"}},XG="channel",ez=async(r,{...e})=>{let t=await YG(r,XG,e);return fx(t)},tz="channel/status",rz=async(r,{channelToken:e})=>{let t=await g_(r,tz,{authToken:e});return fx(t)},m_="Farcaster Auth",b_=10,fA=/^farcaster:\/\/fid\/([1-9]\d*)\/?$/,nz=r=>Rd.fromThrowable(()=>new A_.SiweMessage(r),e=>new cr("bad_request.validation_failure",e))().andThen(oz).andThen(az).andThen(cz),sz=r=>{let e=iz(r);return e.isErr()?at(e.error):Pt({fid:e.value})},iz=r=>{let e=(r.resources??[]).find(n=>fA.test(n));if(!e)return at(new cr("bad_request.validation_failure","No fid resource provided"));let t=parseInt(e.match(fA)?.[1]??"");return isNaN(t)?at(new cr("bad_request.validation_failure","Invalid fid")):Pt(t)},oz=r=>r.statement===m_||r.statement==="Farcaster Connect"?Pt(r):at(new cr("bad_request.validation_failure",`Statement must be '${m_}'`)),az=r=>r.chainId!==b_?at(new cr("bad_request.validation_failure",`Chain ID must be ${b_}`)):Pt(r),cz=r=>{let e=(r.resources??[]).filter(t=>fA.test(t));return e.length===0?at(new cr("bad_request.validation_failure","No fid resource provided")):e.length>1?at(new cr("bad_request.validation_failure","Multiple fid resources provided")):Pt(r)},uz=r=>Promise.reject(new Error("Not implemented: Must provide an fid verifier")),lz=async(r,e,t,n,s={getFid:uz})=>{let{getFid:i,provider:o}=s,a=nz(t).andThen(d=>fz(d,r)).andThen(d=>dz(d,e));if(a.isErr())return at(a.error);let c=(await pz(a.value,n,o)).andThen(mz);if(c.isErr())return at(c.error);if(!c.value.success){let d=c.value.error?.type??"Failed to verify SIWE message";return at(new cr("unauthorized",d))}let u=await hz(c.value,i);if(u.isErr())return at(u.error);if(!u.value.success){let d=c.value.error?.type??"Failed to validate fid owner";return at(new cr("unauthorized",d))}let{error:l,...f}=u.value;return Pt(f)},fz=(r,e)=>r.nonce!==e?at(new cr("unauthorized","Invalid nonce")):Pt(r),dz=(r,e)=>r.domain!==e?at(new cr("unauthorized","Invalid domain")):Pt(r),pz=async(r,e,t)=>bt.fromPromise(r.verify({signature:e},{provider:t,suppressExceptions:!0}),n=>new cr("unauthorized",n)),hz=async(r,e)=>{let t=r.data.address;return bt.fromPromise(e(t),n=>new cr("unavailable",n)).andThen(n=>(n!==BigInt(r.fid)&&(r.success=!1,r.error=new w_.SiweError(`Invalid resource: signer ${t} does not own fid ${r.fid}.`,r.fid.toString(),n.toString())),Pt(r)))},mz=r=>sz(r.data).andThen(e=>Pt({...e,...r})),bz=async(r,{nonce:e,domain:t,message:n,signature:s},i)=>{let o=await lz(e,t,n,s,{getFid:r.ethereum.getFid,provider:i});return fx(o)},gz="channel/status",xz=()=>{},yz=async(r,e)=>{let t=await ZG(r,gz,{timeout:e?.timeout??3e5,interval:e?.interval??1e3,onResponse:e?.onResponse??xz},{authToken:e.channelToken});return fx(t)};var wz={relay:"https://relay.farcaster.xyz",version:"v1"},Az=({ethereum:r,...e})=>({config:{...wz,...e},ethereum:r}),E_=(r,e)=>{let t=Az(r);return{...t,createChannel:n=>ez(t,n),status:n=>rz(t,n),watchStatus:n=>yz(t,n),verifySignInMessage:n=>bz(t,n,e)}};var Ez=[{inputs:[{internalType:"address",name:"_migrator",type:"address"},{internalType:"address",name:"_initialOwner",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"AlreadyMigrated",type:"error"},{inputs:[],name:"GatewayFrozen",type:"error"},{inputs:[],name:"HasId",type:"error"},{inputs:[],name:"HasNoId",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"currentNonce",type:"uint256"}],name:"InvalidAccountNonce",type:"error"},{inputs:[],name:"InvalidShortString",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"OnlyGuardian",type:"error"},{inputs:[],name:"OnlyMigrator",type:"error"},{inputs:[],name:"PermissionRevoked",type:"error"},{inputs:[],name:"SignatureExpired",type:"error"},{inputs:[{internalType:"string",name:"str",type:"string"}],name:"StringTooLong",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"guardian",type:"address"}],name:"Add",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"fid",type:"uint256"}],name:"AdminReset",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"id",type:"uint256"},{indexed:!0,internalType:"address",name:"recovery",type:"address"}],name:"ChangeRecoveryAddress",type:"event"},{anonymous:!1,inputs:[],name:"EIP712DomainChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"idGateway",type:"address"}],name:"FreezeIdGateway",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"migratedAt",type:"uint256"}],name:"Migrated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferStarted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Paused",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"Recover",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"address",name:"recovery",type:"address"}],name:"Register",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"guardian",type:"address"}],name:"Remove",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"oldCounter",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newCounter",type:"uint256"}],name:"SetIdCounter",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldIdGateway",type:"address"},{indexed:!1,internalType:"address",name:"newIdGateway",type:"address"}],name:"SetIdGateway",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldMigrator",type:"address"},{indexed:!1,internalType:"address",name:"newMigrator",type:"address"}],name:"SetMigrator",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Unpaused",type:"event"},{inputs:[],name:"CHANGE_RECOVERY_ADDRESS_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"TRANSFER_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"VERSION",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"acceptOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"guardian",type:"address"}],name:"addGuardian",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"uint24",name:"fid",type:"uint24"},{internalType:"address",name:"custody",type:"address"},{internalType:"address",name:"recovery",type:"address"}],internalType:"struct IIdRegistry.BulkRegisterData[]",name:"ids",type:"tuple[]"}],name:"bulkRegisterIds",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"uint24",name:"fid",type:"uint24"},{internalType:"address",name:"custody",type:"address"}],internalType:"struct IIdRegistry.BulkRegisterDefaultRecoveryData[]",name:"ids",type:"tuple[]"},{internalType:"address",name:"recovery",type:"address"}],name:"bulkRegisterIdsWithDefaultRecovery",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint24[]",name:"ids",type:"uint24[]"}],name:"bulkResetIds",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"recovery",type:"address"}],name:"changeRecoveryAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"recovery",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bytes",name:"sig",type:"bytes"}],name:"changeRecoveryAddressFor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"fid",type:"uint256"}],name:"custodyOf",outputs:[{internalType:"address",name:"custody",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"domainSeparatorV4",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{internalType:"bytes1",name:"fields",type:"bytes1"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256[]",name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"freezeIdGateway",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"gatewayFrozen",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"gracePeriod",outputs:[{internalType:"uint24",name:"",type:"uint24"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"guardian",type:"address"}],name:"guardians",outputs:[{internalType:"bool",name:"isGuardian",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"structHash",type:"bytes32"}],name:"hashTypedDataV4",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"idCounter",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"idGateway",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"idOf",outputs:[{internalType:"uint256",name:"fid",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"isMigrated",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"migrate",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"migratedAt",outputs:[{internalType:"uint40",name:"",type:"uint40"}],stateMutability:"view",type:"function"},{inputs:[],name:"migrator",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"pause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"pendingOwner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bytes",name:"sig",type:"bytes"}],name:"recover",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"recoveryDeadline",type:"uint256"},{internalType:"bytes",name:"recoverySig",type:"bytes"},{internalType:"uint256",name:"toDeadline",type:"uint256"},{internalType:"bytes",name:"toSig",type:"bytes"}],name:"recoverFor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"fid",type:"uint256"}],name:"recoveryOf",outputs:[{internalType:"address",name:"recovery",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"address",name:"recovery",type:"address"}],name:"register",outputs:[{internalType:"uint256",name:"fid",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"guardian",type:"address"}],name:"removeGuardian",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_counter",type:"uint256"}],name:"setIdCounter",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_idGateway",type:"address"}],name:"setIdGateway",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_migrator",type:"address"}],name:"setMigrator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bytes",name:"sig",type:"bytes"}],name:"transfer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"address",name:"recovery",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bytes",name:"sig",type:"bytes"}],name:"transferAndChangeRecovery",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"address",name:"recovery",type:"address"},{internalType:"uint256",name:"fromDeadline",type:"uint256"},{internalType:"bytes",name:"fromSig",type:"bytes"},{internalType:"uint256",name:"toDeadline",type:"uint256"},{internalType:"bytes",name:"toSig",type:"bytes"}],name:"transferAndChangeRecoveryFor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"fromDeadline",type:"uint256"},{internalType:"bytes",name:"fromSig",type:"bytes"},{internalType:"uint256",name:"toDeadline",type:"uint256"},{internalType:"bytes",name:"toSig",type:"bytes"}],name:"transferFor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"unpause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"useNonce",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"custodyAddress",type:"address"},{internalType:"uint256",name:"fid",type:"uint256"},{internalType:"bytes32",name:"digest",type:"bytes32"},{internalType:"bytes",name:"sig",type:"bytes"}],name:"verifyFidSignature",outputs:[{internalType:"bool",name:"isValid",type:"bool"}],stateMutability:"view",type:"function"}],vz="0x00000000Fc6c5F01Fc30151999387Bb99A9f489b",v_=r=>{let e=cA({chain:lA,transport:D6(r?.rpcUrl)});return{getFid:async n=>e.readContract({address:vz,abi:Ez,functionName:"idOf",args:[n]})}};function Tz(){return typeof navigator!="undefined"&&/android/i.test(navigator.userAgent)}function Pz(){return typeof navigator!="undefined"&&/iPhone|iPod/.test(navigator.userAgent)}function kz(){return typeof navigator!="undefined"&&(/iPad/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function Bz(){return Pz()||kz()}function T_(){return Tz()||Bz()}var P_={CHANNEL:"channel",DONE:"done",ERROR:"error"},Sz=r=>typeof r=="function",Oz=r=>typeof r=="function",_z="https://relay.farcaster.xyz",Cz="https://example.com/login",Nz=6e4,Iz=500,dA=class extends dx.Extension.Internal{constructor(){super(...arguments);this.name="farcaster";this.config={};this.login=({showUI:t})=>{let n=E_({relay:_z,ethereum:v_()}),s=n.createChannel({siweUri:Cz,domain:window.location.host}),i=s.then(({data:u})=>n.watchStatus({channelToken:u.channelToken,timeout:Nz,interval:Iz}).then(l=>{if(l.isError)throw l.error;return l})),o,a,c={on:(u,l)=>(u==="channel"&&bx(this,null,function*(){let{data:f}=yield s;!Sz(l)||(l(f),a=f.channelToken,T_()&&(console.info("Info: showUI parameter is ignored on mobile, open URL directly"),window.open(f.url,"_blank")),o=this.utils.createJsonRpcRequestPayload("farcaster_show_QR",[{data:bA({showUI:t},f)}]),this.request(o))}),u===P_.DONE&&bx(this,null,function*(){let{data:f}=yield i;f.state==="completed"&&(this.createIntermediaryEvent(dx.FarcasterLoginEventEmit.SuccessSignIn,o.id)({channel_token:a,message:f.message,signature:f.signature,fid:f.fid,username:f.username}),Oz(l)&&l(f))}),u===P_.ERROR&&i.catch(f=>{l(f)}),c)};return c}}};return C_(Rz);})();
|
|
802
|
+
`),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}};Object.defineProperty(ni,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});oa=class extends z{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}});function hg(r,e){let t=(r.details||"").toLowerCase(),n=r instanceof z?r.walk(s=>s.code===qi.code):r;return n instanceof z?new qi({cause:r,message:n.details}):qi.nodeMessage.test(t)?new qi({cause:r,message:r.details}):Kn.nodeMessage.test(t)?new Kn({cause:r,maxFeePerGas:e?.maxFeePerGas}):yl.nodeMessage.test(t)?new yl({cause:r,maxFeePerGas:e?.maxFeePerGas}):wl.nodeMessage.test(t)?new wl({cause:r,nonce:e?.nonce}):Al.nodeMessage.test(t)?new Al({cause:r,nonce:e?.nonce}):El.nodeMessage.test(t)?new El({cause:r,nonce:e?.nonce}):vl.nodeMessage.test(t)?new vl({cause:r}):Tl.nodeMessage.test(t)?new Tl({cause:r,gas:e?.gas}):Pl.nodeMessage.test(t)?new Pl({cause:r,gas:e?.gas}):kl.nodeMessage.test(t)?new kl({cause:r}):ni.nodeMessage.test(t)?new ni({cause:r,maxFeePerGas:e?.maxFeePerGas,maxPriorityFeePerGas:e?.maxPriorityFeePerGas}):new oa({cause:r})}var A6=se(()=>{Je();Bl()});function mg(r,{format:e}){if(!e)return{};let t={};function n(i){let o=Object.keys(i);for(let a of o)a in r&&(t[a]=r[a]),i[a]&&typeof i[a]=="object"&&!Array.isArray(i[a])&&n(i[a])}let s=e(r||{});return n(s),t}var E6=se(()=>{});function Sl(r,e){return({exclude:t,format:n})=>({exclude:t,format:s=>{let i=e(s);if(t)for(let o of t)delete i[o];return{...i,...n(s)}},type:r})}var bg=se(()=>{});function gg(r){let e={};return typeof r.accessList<"u"&&(e.accessList=r.accessList),typeof r.blobVersionedHashes<"u"&&(e.blobVersionedHashes=r.blobVersionedHashes),typeof r.blobs<"u"&&(typeof r.blobs[0]!="string"?e.blobs=r.blobs.map(t=>tt(t)):e.blobs=r.blobs),typeof r.data<"u"&&(e.data=r.data),typeof r.from<"u"&&(e.from=r.from),typeof r.gas<"u"&&(e.gas=Ae(r.gas)),typeof r.gasPrice<"u"&&(e.gasPrice=Ae(r.gasPrice)),typeof r.maxFeePerBlobGas<"u"&&(e.maxFeePerBlobGas=Ae(r.maxFeePerBlobGas)),typeof r.maxFeePerGas<"u"&&(e.maxFeePerGas=Ae(r.maxFeePerGas)),typeof r.maxPriorityFeePerGas<"u"&&(e.maxPriorityFeePerGas=Ae(r.maxPriorityFeePerGas)),typeof r.nonce<"u"&&(e.nonce=Ae(r.nonce)),typeof r.to<"u"&&(e.to=r.to),typeof r.type<"u"&&(e.type=Bq[r.type]),typeof r.value<"u"&&(e.value=Ae(r.value)),e}var Bq,v6=se(()=>{De();Bq={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"}});function c9(r){if(!(!r||r.length===0))return r.reduce((e,{slot:t,value:n})=>{if(t.length!==66)throw new $d({size:t.length,targetSize:66,type:"hex"});if(n.length!==66)throw new $d({size:n.length,targetSize:66,type:"hex"});return e[t]=n,e},{})}function Sq(r){let{balance:e,nonce:t,state:n,stateDiff:s,code:i}=r,o={};if(i!==void 0&&(o.code=i),e!==void 0&&(o.balance=Ae(e)),t!==void 0&&(o.nonce=Ae(t)),n!==void 0&&(o.state=c9(n)),s!==void 0){if(o.state)throw new sg;o.stateDiff=c9(s)}return o}function xg(r){if(!r)return;let e={};for(let{address:t,...n}of r){if(!Et(t,{strict:!1}))throw new St({address:t});if(e[t])throw new ng({address:t});e[t]=Sq(n)}return e}var T6=se(()=>{ji();_b();w6();Ys();De()});function Ol(r){let{account:e,gasPrice:t,maxFeePerGas:n,maxPriorityFeePerGas:s,to:i}=r,o=e?Er(e):void 0;if(o&&!Et(o.address))throw new St({address:o.address});if(i&&!Et(i))throw new St({address:i});if(typeof t<"u"&&(typeof n<"u"||typeof s<"u"))throw new ig;if(n&&n>2n**256n-1n)throw new Kn({maxFeePerGas:n});if(s&&n&&s>n)throw new ni({maxFeePerGas:n,maxPriorityFeePerGas:s})}var yg=se(()=>{Fi();ji();Bl();ri();Ys()});function Oq(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);let s=BigInt(32),i=BigInt(4294967295),o=Number(t>>s&i),a=Number(t&i),c=n?4:0,u=n?0:4;r.setUint32(e+c,o,n),r.setUint32(e+u,a,n)}var Tg,p9=se(()=>{jb();sl();Tg=class extends Uo{constructor(e,t,n,s){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Db(this.buffer)}update(e){Mi(this);let{view:t,buffer:n,blockLen:s}=this;e=Fo(e);let i=e.length;for(let o=0;o<i;){let a=Math.min(s-this.pos,i-o);if(a===s){let c=Db(e);for(;s<=i-o;o+=s)this.process(c,o);continue}n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Mi(this),Lb(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:s,isLE:i}=this,{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(n,0),o=0);for(let f=o;f<s;f++)t[f]=0;Oq(n,s-8,BigInt(this.length*8),i),this.process(n,0);let a=Db(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let u=c/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)a.setUint32(4*f,l[f],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:n,length:s,finished:i,destroyed:o,pos:a}=this;return e.length=s,e.pos=a,e.finished=i,e.destroyed=o,s%t&&e.buffer.set(n),e}}});var _q,Cq,Nq,ca,ua,B6,Pg,S6=se(()=>{p9();sl();_q=(r,e,t)=>r&e^~r&t,Cq=(r,e,t)=>r&e^r&t^e&t,Nq=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ca=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ua=new Uint32Array(64),B6=class extends Tg{constructor(){super(64,32,8,!1),this.A=ca[0]|0,this.B=ca[1]|0,this.C=ca[2]|0,this.D=ca[3]|0,this.E=ca[4]|0,this.F=ca[5]|0,this.G=ca[6]|0,this.H=ca[7]|0}get(){let{A:e,B:t,C:n,D:s,E:i,F:o,G:a,H:c}=this;return[e,t,n,s,i,o,a,c]}set(e,t,n,s,i,o,a,c){this.A=e|0,this.B=t|0,this.C=n|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,t){for(let f=0;f<16;f++,t+=4)ua[f]=e.getUint32(t,!1);for(let f=16;f<64;f++){let d=ua[f-15],h=ua[f-2],b=ys(d,7)^ys(d,18)^d>>>3,p=ys(h,17)^ys(h,19)^h>>>10;ua[f]=p+ua[f-7]+b+ua[f-16]|0}let{A:n,B:s,C:i,D:o,E:a,F:c,G:u,H:l}=this;for(let f=0;f<64;f++){let d=ys(a,6)^ys(a,11)^ys(a,25),h=l+d+_q(a,c,u)+Nq[f]+ua[f]|0,p=(ys(n,2)^ys(n,13)^ys(n,22))+Cq(n,s,i)|0;l=u,u=c,c=a,a=o+h|0,o=i,i=s,s=n,n=h+p|0}n=n+this.A|0,s=s+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(n,s,i,o,a,c,u,l)}roundClean(){ua.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},Pg=Hb(()=>new B6)});function Wn(r){let{abi:e,args:t,functionName:n,data:s}=r,i=e[0];if(n){let a=Xs({abi:e,args:t,name:n});if(!a)throw new Lo(n,{docsPath:O6});i=a}if(i.type!=="function")throw new Lo(void 0,{docsPath:O6});if(!i.outputs)throw new vb(i.name,{docsPath:O6});let o=Za(i.outputs,s);if(o&&o.length>1)return o;if(o&&o.length===1)return o[0]}var O6,rc=se(()=>{or();Xb();ul();O6="/docs/contract/decodeFunctionResult"});var t0,y9,Mg,w9,_6,C6,A9,nc=se(()=>{t0=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],y9=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],Mg=[...y9,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],w9=[...y9,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],_6=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],C6=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],A9=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}]});var E9,v9=se(()=>{E9="0x82ad56cb"});var T9,P9,k9,N6=se(()=>{T9="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",P9="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",k9="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572"});var sc,r0,Fl,Lg=se(()=>{Je();sc=class extends z{constructor({blockNumber:e,chain:t,contract:n}){super(`Chain "${t.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}},r0=class extends z{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}},Fl=class extends z{constructor({chainId:e}){super(typeof e=="number"?`Chain ID "${e}" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidChainIdError"})}}});function n0(r){let{abi:e,args:t,bytecode:n}=r;if(!t||t.length===0)return n;let s=e.find(o=>"type"in o&&o.type==="constructor");if(!s)throw new xb({docsPath:I6});if(!("inputs"in s))throw new Ud({docsPath:I6});if(!s.inputs||s.inputs.length===0)throw new Ud({docsPath:I6});let i=As(s.inputs,t);return ws([n,i])}var I6,R6=se(()=>{or();Zs();Ya();I6="/docs/contract/encodeDeployData"});function Jn({blockNumber:r,chain:e,contract:t}){let n=e?.contracts?.[t];if(!n)throw new sc({chain:e,contract:{name:t}});if(r&&n.blockCreated&&n.blockCreated>r)throw new sc({blockNumber:r,chain:e,contract:{name:t,blockCreated:n.blockCreated}});return n.address}var ic=se(()=>{Lg()});function B9(r,{docsPath:e,...t}){let n=(()=>{let s=hg(r,t);return s instanceof oa?r:s})();return new bl(n,{docsPath:e,...t})}var S9=se(()=>{ec();Bl();A6()});function jg({fn:r,id:e,shouldSplitBatch:t,wait:n=0,sort:s}){let i=async()=>{let l=c();o();let f=l.map(({args:d})=>d);f.length!==0&&r(f).then(d=>{s&&Array.isArray(d)&&d.sort(s);for(let h=0;h<l.length;h++){let{pendingPromise:b}=l[h];b.resolve?.([d[h],d])}}).catch(d=>{for(let h=0;h<l.length;h++){let{pendingPromise:b}=l[h];b.reject?.(d)}})},o=()=>M6.delete(e),a=()=>c().map(({args:l})=>l),c=()=>M6.get(e)||[],u=l=>M6.set(e,[...c(),l]);return{flush:o,async schedule(l){let f={},d=new Promise((p,g)=>{f.resolve=p,f.reject=g});return t?.([...a(),l])&&i(),c().length>0?(u({args:l,pendingPromise:f}),d):(u({args:l,pendingPromise:f}),setTimeout(i,n),d)}}}var M6,L6=se(()=>{M6=new Map});var Ug,Fg,Dg,O9=se(()=>{dn();Je();jd();Ug=class extends z{constructor({callbackSelector:e,cause:t,data:n,extraData:s,sender:i,urls:o}){super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],t.metaMessages?.length?"":[],"Offchain Gateway Call:",o&&[" Gateway URL(s):",...o.map(a=>` ${Qa(a)}`)],` Sender: ${i}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${s}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}},Fg=class extends z{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${Qa(t)}`,`Response: ${nt(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}},Dg=class extends z{constructor({sender:e,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}});function Hg(r,e){if(!Et(r,{strict:!1}))throw new St({address:r});if(!Et(e,{strict:!1}))throw new St({address:e});return r.toLowerCase()===e.toLowerCase()}var j6=se(()=>{ji();Ys()});var N9={};hx(N9,{ccipRequest:()=>C9,offchainLookup:()=>Uq,offchainLookupAbiItem:()=>_9,offchainLookupSignature:()=>jq});async function Uq(r,{blockNumber:e,blockTag:t,data:n,to:s}){let{args:i}=eg({data:n,abi:[_9]}),[o,a,c,u,l]=i,{ccipRead:f}=r,d=f&&typeof f?.request=="function"?f.request:C9;try{if(!Hg(s,o))throw new Dg({sender:o,to:s});let h=await d({data:c,sender:o,urls:a}),{data:b}=await si(r,{blockNumber:e,blockTag:t,data:jr([u,As([{type:"bytes"},{type:"bytes"}],[h,l])]),to:s});return b}catch(h){throw new Ug({callbackSelector:u,cause:h,data:n,extraData:l,sender:o,urls:a})}}async function C9({data:r,sender:e,urls:t}){let n=new Error("An unknown error occurred.");for(let s=0;s<t.length;s++){let i=t[s],o=i.includes("{data}")?"GET":"POST",a=o==="POST"?{data:r,sender:e}:void 0;try{let c=await fetch(i.replace("{sender}",e).replace("{data}",r),{body:JSON.stringify(a),method:o}),u;if(c.headers.get("Content-Type")?.startsWith("application/json")?u=(await c.json()).data:u=await c.text(),!c.ok){n=new zn({body:a,details:u?.error?nt(u.error):c.statusText,headers:c.headers,status:c.status,url:i});continue}if(!Ft(u)){n=new Fg({result:u,url:i});continue}return u}catch(c){n=new zn({body:a,details:c.message,url:i})}}throw n}var jq,_9,I9=se(()=>{Dl();O9();xl();m6();Ya();j6();Zs();gs();dn();jq="0x556f1830",_9={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]}});async function si(r,e){let{account:t=r.account,batch:n=Boolean(r.batch?.multicall),blockNumber:s,blockTag:i="latest",accessList:o,blobs:a,code:c,data:u,factory:l,factoryData:f,gas:d,gasPrice:h,maxFeePerBlobGas:b,maxFeePerGas:p,maxPriorityFeePerGas:g,nonce:m,to:y,value:E,stateOverride:v,...k}=e,w=t?Er(t):void 0;if(c&&(l||f))throw new z("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(c&&y)throw new z("Cannot provide both `code` & `to` as parameters.");let P=c&&u,B=l&&f&&y&&u,Z=P||B,_=(()=>P?Hq({code:c,data:u}):B?$q({data:u,factory:l,factoryData:f,to:y}):u)();try{Ol(e);let S=(s?Ae(s):void 0)||i,F=xg(v),G=r.chain?.formatters?.transactionRequest?.format,L=(G||gg)({...mg(k,{format:G}),from:w?.address,accessList:o,blobs:a,data:_,gas:d,gasPrice:h,maxFeePerBlobGas:b,maxFeePerGas:p,maxPriorityFeePerGas:g,nonce:m,to:Z?void 0:y,value:E});if(n&&Fq({request:L})&&!F)try{return await Dq(r,{...L,blockNumber:s,blockTag:i})}catch(oe){if(!(oe instanceof r0)&&!(oe instanceof sc))throw oe}let Y=await r.request({method:"eth_call",params:F?[L,S,F]:[L,S]});return Y==="0x"?{data:void 0}:{data:Y}}catch(O){let S=qq(O),{offchainLookup:F,offchainLookupSignature:G}=await Promise.resolve().then(()=>(I9(),N9));if(r.ccipRead!==!1&&S?.slice(0,10)===G&&y)return{data:await F(r,{data:S,to:y})};throw Z&&S?.slice(0,10)==="0x101bb98d"?new fg({factory:l}):B9(O,{...e,account:w,chain:r.chain})}}function Fq({request:r}){let{data:e,to:t,...n}=r;return!(!e||e.startsWith(E9)||!t||Object.values(n).filter(s=>typeof s<"u").length>0)}async function Dq(r,e){let{batchSize:t=1024,wait:n=0}=typeof r.batch?.multicall=="object"?r.batch.multicall:{},{blockNumber:s,blockTag:i="latest",data:o,multicallAddress:a,to:c}=e,u=a;if(!u){if(!r.chain)throw new r0;u=Jn({blockNumber:s,chain:r.chain,contract:"multicall3"})}let f=(s?Ae(s):void 0)||i,{schedule:d}=jg({id:`${r.uid}.${f}`,wait:n,shouldSplitBatch(p){return p.reduce((m,{data:y})=>m+(y.length-2),0)>t*2},fn:async p=>{let g=p.map(E=>({allowFailure:!0,callData:E.data,target:E.to})),m=Yr({abi:t0,args:[g],functionName:"aggregate3"}),y=await r.request({method:"eth_call",params:[{data:m,to:u},f]});return Wn({abi:t0,args:[g],functionName:"aggregate3",data:y||"0x"})}}),[{returnData:h,success:b}]=await d({data:o,to:c});if(!b)throw new Go({data:h});return h==="0x"?{data:void 0}:{data:h}}function Hq(r){let{code:e,data:t}=r;return n0({abi:bb(["constructor(bytes, bytes)"]),bytecode:T9,args:[e,t]})}function $q(r){let{data:e,factory:t,factoryData:n,to:s}=r;return n0({abi:bb(["constructor(address, bytes, address, bytes)"]),bytecode:P9,args:[s,e,t,n]})}function qq(r){if(!(r instanceof z))return;let e=r.walk();return typeof e?.data=="object"?e.data?.data:e.data}var Dl=se(()=>{n6();Fi();nc();v9();N6();Je();Lg();ec();rc();R6();qo();ic();De();S9();E6();v6();L6();T6();yg()});var Y6={};hx(Y6,{bitGet:()=>yG,bitLen:()=>xG,bitMask:()=>a0,bitSet:()=>wG,bytesToHex:()=>oc,bytesToNumberBE:()=>Gi,bytesToNumberLE:()=>ix,concatBytes:()=>zl,createHmacDrbg:()=>Q6,ensureBytes:()=>pn,equalBytes:()=>J6,hexToBytes:()=>ac,hexToNumber:()=>W6,numberToBytesBE:()=>ma,numberToBytesLE:()=>ox,numberToHexUnpadded:()=>LO,numberToVarBytesBE:()=>bG,utf8ToBytes:()=>gG,validateObject:()=>ba});function oc(r){if(!sx(r))throw new Error("Uint8Array expected");let e="";for(let t=0;t<r.length;t++)e+=mG[r[t]];return e}function LO(r){let e=r.toString(16);return e.length&1?`0${e}`:e}function W6(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}function ac(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let e=r.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let t=new Uint8Array(e/2);for(let n=0;n<t.length;n++){let s=n*2,i=r.slice(s,s+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[n]=o}return t}function Gi(r){return W6(oc(r))}function ix(r){if(!sx(r))throw new Error("Uint8Array expected");return W6(oc(Uint8Array.from(r).reverse()))}function ma(r,e){return ac(r.toString(16).padStart(e*2,"0"))}function ox(r,e){return ma(r,e).reverse()}function bG(r){return ac(LO(r))}function pn(r,e,t){let n;if(typeof e=="string")try{n=ac(e)}catch(i){throw new Error(`${r} must be valid hex string, got "${e}". Cause: ${i}`)}else if(sx(e))n=Uint8Array.from(e);else throw new Error(`${r} must be hex string or Uint8Array`);let s=n.length;if(typeof t=="number"&&s!==t)throw new Error(`${r} expected ${t} bytes, got ${s}`);return n}function zl(...r){let e=new Uint8Array(r.reduce((n,s)=>n+s.length,0)),t=0;return r.forEach(n=>{if(!sx(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}function J6(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}function gG(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function xG(r){let e;for(e=0;r>MO;r>>=nx,e+=1);return e}function yG(r,e){return r>>BigInt(e)&nx}function Q6(r,e,t){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let n=K6(r),s=K6(r),i=0,o=()=>{n.fill(1),s.fill(0),i=0},a=(...f)=>t(s,n,...f),c=(f=K6())=>{s=a(RO([0]),f),n=a(),f.length!==0&&(s=a(RO([1]),f),n=a())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let f=0,d=[];for(;f<e;){n=a();let h=n.slice();d.push(h),f+=n.length}return zl(...d)};return(f,d)=>{o(),c(f);let h;for(;!(h=d(u()));)c();return o(),h}}function ba(r,e,t={}){let n=(s,i,o)=>{let a=AG[i];if(typeof a!="function")throw new Error(`Invalid validator "${i}", expected function`);let c=r[s];if(!(o&&c===void 0)&&!a(c,r))throw new Error(`Invalid param ${String(s)}=${c} (${typeof c}), expected ${i}`)};for(let[s,i]of Object.entries(e))n(s,i,!1);for(let[s,i]of Object.entries(t))n(s,i,!0);return r}var MO,nx,hG,sx,mG,wG,a0,K6,RO,AG,Vl=se(()=>{MO=BigInt(0),nx=BigInt(1),hG=BigInt(2),sx=r=>r instanceof Uint8Array,mG=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));wG=(r,e,t)=>r|(t?nx:MO)<<BigInt(e),a0=r=>(hG<<BigInt(r-1))-nx,K6=r=>new Uint8Array(r),RO=r=>Uint8Array.from(r);AG={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||r instanceof Uint8Array,isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)}});function Tr(r,e){let t=r%e;return t>=Zt?t:e+t}function PG(r,e,t){if(t<=Zt||e<Zt)throw new Error("Expected power/modulo > 0");if(t===Rt)return Zt;let n=Rt;for(;e>Zt;)e&Rt&&(n=n*r%t),r=r*r%t,e>>=Rt;return n}function hn(r,e,t){let n=r;for(;e-- >Zt;)n*=n,n%=t;return n}function ax(r,e){if(r===Zt||e<=Zt)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let t=Tr(r,e),n=e,s=Zt,i=Rt,o=Rt,a=Zt;for(;t!==Zt;){let u=n/t,l=n%t,f=s-o*u,d=i-a*u;n=t,t=l,s=o,i=a,o=f,a=d}if(n!==Rt)throw new Error("invert: does not exist");return Tr(s,e)}function kG(r){let e=(r-Rt)/cc,t,n,s;for(t=r-Rt,n=0;t%cc===Zt;t/=cc,n++);for(s=cc;s<r&&PG(s,e,r)!==r-Rt;s++);if(n===1){let o=(r+Rt)/Z6;return function(c,u){let l=c.pow(u,o);if(!c.eql(c.sqr(l),u))throw new Error("Cannot find square root");return l}}let i=(t+Rt)/cc;return function(a,c){if(a.pow(c,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let u=n,l=a.pow(a.mul(a.ONE,s),t),f=a.pow(c,i),d=a.pow(c,t);for(;!a.eql(d,a.ONE);){if(a.eql(d,a.ZERO))return a.ZERO;let h=1;for(let p=a.sqr(d);h<u&&!a.eql(p,a.ONE);h++)p=a.sqr(p);let b=a.pow(l,Rt<<BigInt(u-h-1));l=a.sqr(b),f=a.mul(f,b),d=a.mul(d,l),u=h}return f}}function BG(r){if(r%Z6===EG){let e=(r+Rt)/Z6;return function(n,s){let i=n.pow(s,e);if(!n.eql(n.sqr(i),s))throw new Error("Cannot find square root");return i}}if(r%FO===UO){let e=(r-UO)/FO;return function(n,s){let i=n.mul(s,cc),o=n.pow(i,e),a=n.mul(s,o),c=n.mul(n.mul(a,cc),o),u=n.mul(a,n.sub(c,n.ONE));if(!n.eql(n.sqr(u),s))throw new Error("Cannot find square root");return u}}return r%TG,kG(r)}function X6(r){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=SG.reduce((n,s)=>(n[s]="function",n),e);return ba(r,t)}function OG(r,e,t){if(t<Zt)throw new Error("Expected power > 0");if(t===Zt)return r.ONE;if(t===Rt)return e;let n=r.ONE,s=e;for(;t>Zt;)t&Rt&&(n=r.mul(n,s)),s=r.sqr(s),t>>=Rt;return n}function _G(r,e){let t=new Array(e.length),n=e.reduce((i,o,a)=>r.is0(o)?i:(t[a]=i,r.mul(i,o)),r.ONE),s=r.inv(n);return e.reduceRight((i,o,a)=>r.is0(o)?i:(t[a]=r.mul(i,t[a]),r.mul(i,o)),s),t}function eA(r,e){let t=e!==void 0?e:r.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}function DO(r,e,t=!1,n={}){if(r<=Zt)throw new Error(`Expected Field ORDER > 0, got ${r}`);let{nBitLength:s,nByteLength:i}=eA(r,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=BG(r),a=Object.freeze({ORDER:r,BITS:s,BYTES:i,MASK:a0(s),ZERO:Zt,ONE:Rt,create:c=>Tr(c,r),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return Zt<=c&&c<r},is0:c=>c===Zt,isOdd:c=>(c&Rt)===Rt,neg:c=>Tr(-c,r),eql:(c,u)=>c===u,sqr:c=>Tr(c*c,r),add:(c,u)=>Tr(c+u,r),sub:(c,u)=>Tr(c-u,r),mul:(c,u)=>Tr(c*u,r),pow:(c,u)=>OG(a,c,u),div:(c,u)=>Tr(c*ax(u,r),r),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>ax(c,r),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>_G(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>t?ox(c,i):ma(c,i),fromBytes:c=>{if(c.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${c.length}`);return t?ix(c):Gi(c)}});return Object.freeze(a)}function HO(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let e=r.toString(2).length;return Math.ceil(e/8)}function tA(r){let e=HO(r);return e+Math.ceil(e/2)}function $O(r,e,t=!1){let n=r.length,s=HO(e),i=tA(e);if(n<16||n<i||n>1024)throw new Error(`expected ${i}-1024 bytes of input, got ${n}`);let o=t?Gi(r):ix(r),a=Tr(o,e-Rt)+Rt;return t?ox(a,s):ma(a,s)}var Zt,Rt,cc,EG,Z6,UO,FO,vG,TG,SG,cx=se(()=>{Vl();Zt=BigInt(0),Rt=BigInt(1),cc=BigInt(2),EG=BigInt(3),Z6=BigInt(4),UO=BigInt(5),FO=BigInt(8),vG=BigInt(9),TG=BigInt(16);SG=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function qO(r,e){let t=(s,i)=>{let o=i.negate();return s?o:i},n=s=>{let i=Math.ceil(e/s)+1,o=2**(s-1);return{windows:i,windowSize:o}};return{constTimeNegate:t,unsafeLadder(s,i){let o=r.ZERO,a=s;for(;i>NG;)i&rA&&(o=o.add(a)),a=a.double(),i>>=rA;return o},precomputeWindow(s,i){let{windows:o,windowSize:a}=n(i),c=[],u=s,l=u;for(let f=0;f<o;f++){l=u,c.push(l);for(let d=1;d<a;d++)l=l.add(u),c.push(l);u=l.double()}return c},wNAF(s,i,o){let{windows:a,windowSize:c}=n(s),u=r.ZERO,l=r.BASE,f=BigInt(2**s-1),d=2**s,h=BigInt(s);for(let b=0;b<a;b++){let p=b*c,g=Number(o&f);o>>=h,g>c&&(g-=d,o+=rA);let m=p,y=p+Math.abs(g)-1,E=b%2!==0,v=g<0;g===0?l=l.add(t(E,i[m])):u=u.add(t(v,i[y]))}return{p:u,f:l}},wNAFCached(s,i,o,a){let c=s._WINDOW_SIZE||1,u=i.get(s);return u||(u=this.precomputeWindow(s,c),c!==1&&i.set(s,a(u))),this.wNAF(c,u,o)}}}function nA(r){return X6(r.Fp),ba(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...eA(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}var NG,rA,GO=se(()=>{cx();Vl();NG=BigInt(0),rA=BigInt(1)});function IG(r){let e=nA(r);ba(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:t,Fp:n,a:s}=e;if(t){if(!n.eql(s,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}function LG(r){let e=IG(r),{Fp:t}=e,n=e.toBytes||((b,p,g)=>{let m=p.toAffine();return zl(Uint8Array.from([4]),t.toBytes(m.x),t.toBytes(m.y))}),s=e.fromBytes||(b=>{let p=b.subarray(1),g=t.fromBytes(p.subarray(0,t.BYTES)),m=t.fromBytes(p.subarray(t.BYTES,2*t.BYTES));return{x:g,y:m}});function i(b){let{a:p,b:g}=e,m=t.sqr(b),y=t.mul(m,b);return t.add(t.add(y,t.mul(b,p)),g)}if(!t.eql(t.sqr(e.Gy),i(e.Gx)))throw new Error("bad generator point: equation left != right");function o(b){return typeof b=="bigint"&&zi<b&&b<e.n}function a(b){if(!o(b))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(b){let{allowedPrivateKeyLengths:p,nByteLength:g,wrapPrivateKey:m,n:y}=e;if(p&&typeof b!="bigint"){if(b instanceof Uint8Array&&(b=oc(b)),typeof b!="string"||!p.includes(b.length))throw new Error("Invalid key");b=b.padStart(g*2,"0")}let E;try{E=typeof b=="bigint"?b:Gi(pn("private key",b,g))}catch{throw new Error(`private key must be ${g} bytes, hex or bigint, not ${typeof b}`)}return m&&(E=Tr(E,y)),a(E),E}let u=new Map;function l(b){if(!(b instanceof f))throw new Error("ProjectivePoint expected")}class f{constructor(p,g,m){if(this.px=p,this.py=g,this.pz=m,p==null||!t.isValid(p))throw new Error("x required");if(g==null||!t.isValid(g))throw new Error("y required");if(m==null||!t.isValid(m))throw new Error("z required")}static fromAffine(p){let{x:g,y:m}=p||{};if(!p||!t.isValid(g)||!t.isValid(m))throw new Error("invalid affine point");if(p instanceof f)throw new Error("projective point not allowed");let y=E=>t.eql(E,t.ZERO);return y(g)&&y(m)?f.ZERO:new f(g,m,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){let g=t.invertBatch(p.map(m=>m.pz));return p.map((m,y)=>m.toAffine(g[y])).map(f.fromAffine)}static fromHex(p){let g=f.fromAffine(s(pn("pointHex",p)));return g.assertValidity(),g}static fromPrivateKey(p){return f.BASE.multiply(c(p))}_setWindowSize(p){this._WINDOW_SIZE=p,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:p,y:g}=this.toAffine();if(!t.isValid(p)||!t.isValid(g))throw new Error("bad point: x or y not FE");let m=t.sqr(g),y=i(p);if(!t.eql(m,y))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:p}=this.toAffine();if(t.isOdd)return!t.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){l(p);let{px:g,py:m,pz:y}=this,{px:E,py:v,pz:k}=p,w=t.eql(t.mul(g,k),t.mul(E,y)),P=t.eql(t.mul(m,k),t.mul(v,y));return w&&P}negate(){return new f(this.px,t.neg(this.py),this.pz)}double(){let{a:p,b:g}=e,m=t.mul(g,zO),{px:y,py:E,pz:v}=this,k=t.ZERO,w=t.ZERO,P=t.ZERO,B=t.mul(y,y),Z=t.mul(E,E),_=t.mul(v,v),O=t.mul(y,E);return O=t.add(O,O),P=t.mul(y,v),P=t.add(P,P),k=t.mul(p,P),w=t.mul(m,_),w=t.add(k,w),k=t.sub(Z,w),w=t.add(Z,w),w=t.mul(k,w),k=t.mul(O,k),P=t.mul(m,P),_=t.mul(p,_),O=t.sub(B,_),O=t.mul(p,O),O=t.add(O,P),P=t.add(B,B),B=t.add(P,B),B=t.add(B,_),B=t.mul(B,O),w=t.add(w,B),_=t.mul(E,v),_=t.add(_,_),B=t.mul(_,O),k=t.sub(k,B),P=t.mul(_,Z),P=t.add(P,P),P=t.add(P,P),new f(k,w,P)}add(p){l(p);let{px:g,py:m,pz:y}=this,{px:E,py:v,pz:k}=p,w=t.ZERO,P=t.ZERO,B=t.ZERO,Z=e.a,_=t.mul(e.b,zO),O=t.mul(g,E),S=t.mul(m,v),F=t.mul(y,k),G=t.add(g,m),R=t.add(E,v);G=t.mul(G,R),R=t.add(O,S),G=t.sub(G,R),R=t.add(g,y);let L=t.add(E,k);return R=t.mul(R,L),L=t.add(O,F),R=t.sub(R,L),L=t.add(m,y),w=t.add(v,k),L=t.mul(L,w),w=t.add(S,F),L=t.sub(L,w),B=t.mul(Z,R),w=t.mul(_,F),B=t.add(w,B),w=t.sub(S,B),B=t.add(S,B),P=t.mul(w,B),S=t.add(O,O),S=t.add(S,O),F=t.mul(Z,F),R=t.mul(_,R),S=t.add(S,F),F=t.sub(O,F),F=t.mul(Z,F),R=t.add(R,F),O=t.mul(S,R),P=t.add(P,O),O=t.mul(L,R),w=t.mul(G,w),w=t.sub(w,O),O=t.mul(G,S),B=t.mul(L,B),B=t.add(B,O),new f(w,P,B)}subtract(p){return this.add(p.negate())}is0(){return this.equals(f.ZERO)}wNAF(p){return h.wNAFCached(this,u,p,g=>{let m=t.invertBatch(g.map(y=>y.pz));return g.map((y,E)=>y.toAffine(m[E])).map(f.fromAffine)})}multiplyUnsafe(p){let g=f.ZERO;if(p===zi)return g;if(a(p),p===Qn)return this;let{endo:m}=e;if(!m)return h.unsafeLadder(this,p);let{k1neg:y,k1:E,k2neg:v,k2:k}=m.splitScalar(p),w=g,P=g,B=this;for(;E>zi||k>zi;)E&Qn&&(w=w.add(B)),k&Qn&&(P=P.add(B)),B=B.double(),E>>=Qn,k>>=Qn;return y&&(w=w.negate()),v&&(P=P.negate()),P=new f(t.mul(P.px,m.beta),P.py,P.pz),w.add(P)}multiply(p){a(p);let g=p,m,y,{endo:E}=e;if(E){let{k1neg:v,k1:k,k2neg:w,k2:P}=E.splitScalar(g),{p:B,f:Z}=this.wNAF(k),{p:_,f:O}=this.wNAF(P);B=h.constTimeNegate(v,B),_=h.constTimeNegate(w,_),_=new f(t.mul(_.px,E.beta),_.py,_.pz),m=B.add(_),y=Z.add(O)}else{let{p:v,f:k}=this.wNAF(g);m=v,y=k}return f.normalizeZ([m,y])[0]}multiplyAndAddUnsafe(p,g,m){let y=f.BASE,E=(k,w)=>w===zi||w===Qn||!k.equals(y)?k.multiplyUnsafe(w):k.multiply(w),v=E(this,g).add(E(p,m));return v.is0()?void 0:v}toAffine(p){let{px:g,py:m,pz:y}=this,E=this.is0();p==null&&(p=E?t.ONE:t.inv(y));let v=t.mul(g,p),k=t.mul(m,p),w=t.mul(y,p);if(E)return{x:t.ZERO,y:t.ZERO};if(!t.eql(w,t.ONE))throw new Error("invZ was invalid");return{x:v,y:k}}isTorsionFree(){let{h:p,isTorsionFree:g}=e;if(p===Qn)return!0;if(g)return g(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:p,clearCofactor:g}=e;return p===Qn?this:g?g(f,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),n(f,this,p)}toHex(p=!0){return oc(this.toRawBytes(p))}}f.BASE=new f(e.Gx,e.Gy,t.ONE),f.ZERO=new f(t.ZERO,t.ONE,t.ZERO);let d=e.nBitLength,h=qO(f,e.endo?Math.ceil(d/2):d);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:i,isWithinCurveOrder:o}}function jG(r){let e=nA(r);return ba(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function VO(r){let e=jG(r),{Fp:t,n}=e,s=t.BYTES+1,i=2*t.BYTES+1;function o(R){return zi<R&&R<t.ORDER}function a(R){return Tr(R,n)}function c(R){return ax(R,n)}let{ProjectivePoint:u,normPrivateKeyToScalar:l,weierstrassEquation:f,isWithinCurveOrder:d}=LG({...e,toBytes(R,L,Y){let oe=L.toAffine(),fe=t.toBytes(oe.x),K=zl;return Y?K(Uint8Array.from([L.hasEvenY()?2:3]),fe):K(Uint8Array.from([4]),fe,t.toBytes(oe.y))},fromBytes(R){let L=R.length,Y=R[0],oe=R.subarray(1);if(L===s&&(Y===2||Y===3)){let fe=Gi(oe);if(!o(fe))throw new Error("Point is not on curve");let K=f(fe),ae=t.sqrt(K),q=(ae&Qn)===Qn;return(Y&1)===1!==q&&(ae=t.neg(ae)),{x:fe,y:ae}}else if(L===i&&Y===4){let fe=t.fromBytes(oe.subarray(0,t.BYTES)),K=t.fromBytes(oe.subarray(t.BYTES,2*t.BYTES));return{x:fe,y:K}}else throw new Error(`Point of length ${L} was invalid. Expected ${s} compressed bytes or ${i} uncompressed bytes`)}}),h=R=>oc(ma(R,e.nByteLength));function b(R){let L=n>>Qn;return R>L}function p(R){return b(R)?a(-R):R}let g=(R,L,Y)=>Gi(R.slice(L,Y));class m{constructor(L,Y,oe){this.r=L,this.s=Y,this.recovery=oe,this.assertValidity()}static fromCompact(L){let Y=e.nByteLength;return L=pn("compactSignature",L,Y*2),new m(g(L,0,Y),g(L,Y,2*Y))}static fromDER(L){let{r:Y,s:oe}=uc.toSig(pn("DER",L));return new m(Y,oe)}assertValidity(){if(!d(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!d(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(L){return new m(this.r,this.s,L)}recoverPublicKey(L){let{r:Y,s:oe,recovery:fe}=this,K=P(pn("msgHash",L));if(fe==null||![0,1,2,3].includes(fe))throw new Error("recovery id invalid");let ae=fe===2||fe===3?Y+e.n:Y;if(ae>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");let q=(fe&1)===0?"02":"03",I=u.fromHex(q+h(ae)),ye=c(ae),st=a(-K*ye),Ke=a(oe*ye),We=u.BASE.multiplyAndAddUnsafe(I,st,Ke);if(!We)throw new Error("point at infinify");return We.assertValidity(),We}hasHighS(){return b(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return ac(this.toDERHex())}toDERHex(){return uc.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ac(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}let y={isValidPrivateKey(R){try{return l(R),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{let R=tA(e.n);return $O(e.randomBytes(R),e.n)},precompute(R=8,L=u.BASE){return L._setWindowSize(R),L.multiply(BigInt(3)),L}};function E(R,L=!0){return u.fromPrivateKey(R).toRawBytes(L)}function v(R){let L=R instanceof Uint8Array,Y=typeof R=="string",oe=(L||Y)&&R.length;return L?oe===s||oe===i:Y?oe===2*s||oe===2*i:R instanceof u}function k(R,L,Y=!0){if(v(R))throw new Error("first arg must be private key");if(!v(L))throw new Error("second arg must be public key");return u.fromHex(L).multiply(l(R)).toRawBytes(Y)}let w=e.bits2int||function(R){let L=Gi(R),Y=R.length*8-e.nBitLength;return Y>0?L>>BigInt(Y):L},P=e.bits2int_modN||function(R){return a(w(R))},B=a0(e.nBitLength);function Z(R){if(typeof R!="bigint")throw new Error("bigint expected");if(!(zi<=R&&R<B))throw new Error(`bigint expected < 2^${e.nBitLength}`);return ma(R,e.nByteLength)}function _(R,L,Y=O){if(["recovered","canonical"].some(j=>j in Y))throw new Error("sign() legacy options not supported");let{hash:oe,randomBytes:fe}=e,{lowS:K,prehash:ae,extraEntropy:q}=Y;K==null&&(K=!0),R=pn("msgHash",R),ae&&(R=pn("prehashed msgHash",oe(R)));let I=P(R),ye=l(L),st=[Z(ye),Z(I)];if(q!=null){let j=q===!0?fe(t.BYTES):q;st.push(pn("extraEntropy",j))}let Ke=zl(...st),We=I;function D(j){let N=w(j);if(!d(N))return;let ee=c(N),ce=u.BASE.multiply(N).toAffine(),he=a(ce.x);if(he===zi)return;let xe=a(ee*a(We+he*ye));if(xe===zi)return;let V=(ce.x===he?0:2)|Number(ce.y&Qn),te=xe;return K&&b(xe)&&(te=p(xe),V^=1),new m(he,te,V)}return{seed:Ke,k2sig:D}}let O={lowS:e.lowS,prehash:!1},S={lowS:e.lowS,prehash:!1};function F(R,L,Y=O){let{seed:oe,k2sig:fe}=_(R,L,Y),K=e;return Q6(K.hash.outputLen,K.nByteLength,K.hmac)(oe,fe)}u.BASE._setWindowSize(8);function G(R,L,Y,oe=S){let fe=R;if(L=pn("msgHash",L),Y=pn("publicKey",Y),"strict"in oe)throw new Error("options.strict was renamed to lowS");let{lowS:K,prehash:ae}=oe,q,I;try{if(typeof fe=="string"||fe instanceof Uint8Array)try{q=m.fromDER(fe)}catch(ce){if(!(ce instanceof uc.Err))throw ce;q=m.fromCompact(fe)}else if(typeof fe=="object"&&typeof fe.r=="bigint"&&typeof fe.s=="bigint"){let{r:ce,s:he}=fe;q=new m(ce,he)}else throw new Error("PARSE");I=u.fromHex(Y)}catch(ce){if(ce.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(K&&q.hasHighS())return!1;ae&&(L=e.hash(L));let{r:ye,s:st}=q,Ke=P(L),We=c(st),D=a(Ke*We),j=a(ye*We),N=u.BASE.multiplyAndAddUnsafe(I,D,j)?.toAffine();return N?a(N.x)===ye:!1}return{CURVE:e,getPublicKey:E,getSharedSecret:k,sign:F,verify:G,ProjectivePoint:u,Signature:m,utils:y}}var RG,MG,uc,zi,Qn,eue,zO,tue,KO=se(()=>{cx();Vl();Vl();GO();({bytesToNumberBE:RG,hexToBytes:MG}=Y6),uc={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(r){let{Err:e}=uc;if(r.length<2||r[0]!==2)throw new e("Invalid signature integer tag");let t=r[1],n=r.subarray(2,t+2);if(!t||n.length!==t)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:RG(n),l:r.subarray(t+2)}},toSig(r){let{Err:e}=uc,t=typeof r=="string"?MG(r):r;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let n=t.length;if(n<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:s,l:i}=uc._parseInt(t.subarray(2)),{d:o,l:a}=uc._parseInt(i);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:s,s:o}},hexFromSig(r){let e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,t=u=>{let l=u.toString(16);return l.length&1?`0${l}`:l},n=e(t(r.s)),s=e(t(r.r)),i=n.length/2,o=s.length/2,a=t(i),c=t(o);return`30${t(o+i+4)}02${c}${s}02${a}${n}`}},zi=BigInt(0),Qn=BigInt(1),eue=BigInt(2),zO=BigInt(3),tue=BigInt(4)});var ux,sA,WO=se(()=>{jb();sl();ux=class extends Uo{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,pS(e);let n=Fo(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let s=this.blockLen,i=new Uint8Array(s);i.set(n.length>s?e.create().update(n).digest():n);for(let o=0;o<i.length;o++)i[o]^=54;this.iHash.update(i),this.oHash=e.create();for(let o=0;o<i.length;o++)i[o]^=106;this.oHash.update(i),i.fill(0)}update(e){return Mi(this),this.iHash.update(e),this}digestInto(e){Mi(this),Vd(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:n,finished:s,destroyed:i,blockLen:o,outputLen:a}=this;return e=e,e.finished=s,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},sA=(r,e,t)=>new ux(r,e).update(t).digest();sA.create=(r,e)=>new ux(r,e)});function UG(r){return{hash:r,hmac:(e,...t)=>sA(r,e,TS(...t)),randomBytes:kS}}function JO(r,e){let t=n=>VO({...r,...UG(n)});return Object.freeze({...t(e),create:t})}var QO=se(()=>{WO();sl();KO();});function DG(r){let e=XO,t=BigInt(3),n=BigInt(6),s=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),u=r*r*r%e,l=u*u*r%e,f=hn(l,t,e)*l%e,d=hn(f,t,e)*l%e,h=hn(d,iA,e)*u%e,b=hn(h,s,e)*h%e,p=hn(b,i,e)*b%e,g=hn(p,a,e)*p%e,m=hn(g,c,e)*g%e,y=hn(m,a,e)*p%e,E=hn(y,t,e)*l%e,v=hn(E,o,e)*b%e,k=hn(v,n,e)*u%e,w=hn(k,iA,e);if(!oA.eql(oA.sqr(w),r))throw new Error("Cannot find square root");return w}var XO,YO,FG,iA,ZO,oA,aA,pue,hue,e_=se(()=>{S6();cx();QO();XO=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),YO=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),FG=BigInt(1),iA=BigInt(2),ZO=(r,e)=>(r+e/iA)/e;oA=DO(XO,void 0,void 0,{sqrt:DG}),aA=JO({a:BigInt(0),b:BigInt(7),Fp:oA,n:YO,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let e=YO,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-FG*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=t,o=BigInt("0x100000000000000000000000000000000"),a=ZO(i*r,e),c=ZO(-n*r,e),u=Tr(r-a*t-c*s,e),l=Tr(-a*n-c*i,e),f=u>o,d=l>o;if(f&&(u=e-u),d&&(l=e-l),u>o||l>o)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:f,k1:u,k2neg:d,k2:l}}}},Pg),pue=BigInt(0),hue=aA.ProjectivePoint});var Rz={};hx(Rz,{FarcasterExtension:()=>pA});var dx=l0(AA());var JG=l0(Ym(),1);var k$={withStackTrace:!1},kB=(r,e,t=k$)=>{let n=e.isOk()?{type:"Ok",value:e.value}:{type:"Err",value:e.error},s=t.withStackTrace?new Error().stack:void 0;return{data:n,message:r,stack:s}};function Zm(r,e,t,n){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{u(n.next(l))}catch(f){o(f)}}function c(l){try{u(n.throw(l))}catch(f){o(f)}}function u(l){l.done?i(l.value):s(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})}function TB(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Wa(r){return this instanceof Wa?(this.v=r,this):new Wa(r)}function B$(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),s,i=[];return s={},o("next"),o("throw"),o("return"),s[Symbol.asyncIterator]=function(){return this},s;function o(d){n[d]&&(s[d]=function(h){return new Promise(function(b,p){i.push([d,h,b,p])>1||a(d,h)})})}function a(d,h){try{c(n[d](h))}catch(b){f(i[0][3],b)}}function c(d){d.value instanceof Wa?Promise.resolve(d.value.v).then(u,l):f(i[0][2],d)}function u(d){a("next",d)}function l(d){a("throw",d)}function f(d,h){d(h),i.shift(),i.length&&a(i[0][0],i[0][1])}}function S$(r){var e,t;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,i){e[s]=r[s]?function(o){return(t=!t)?{value:Wa(r[s](o)),done:s==="return"}:i?i(o):o}:i}}function O$(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof TB=="function"?TB(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=r[i]&&function(o){return new Promise(function(a,c){o=r[i](o),s(a,c,o.done,o.value)})}}function s(i,o,a,c){Promise.resolve(c).then(function(u){i({value:u,done:a})},o)}}var bt=class{constructor(e){this._promise=e}static fromSafePromise(e){let t=e.then(n=>new _i(n));return new bt(t)}static fromPromise(e,t){let n=e.then(s=>new _i(s)).catch(s=>new Ci(t(s)));return new bt(n)}static fromThrowable(e,t){return(...n)=>new bt((()=>Zm(this,void 0,void 0,function*(){try{return new _i(yield e(...n))}catch(s){return new Ci(t?t(s):s)}}))())}static combine(e){return _$(e)}static combineWithAllErrors(e){return C$(e)}map(e){return new bt(this._promise.then(t=>Zm(this,void 0,void 0,function*(){return t.isErr()?new Ci(t.error):new _i(yield e(t.value))})))}mapErr(e){return new bt(this._promise.then(t=>Zm(this,void 0,void 0,function*(){return t.isOk()?new _i(t.value):new Ci(yield e(t.error))})))}andThen(e){return new bt(this._promise.then(t=>{if(t.isErr())return new Ci(t.error);let n=e(t.value);return n instanceof bt?n._promise:n}))}orElse(e){return new bt(this._promise.then(t=>Zm(this,void 0,void 0,function*(){return t.isErr()?e(t.error):new _i(t.value)})))}match(e,t){return this._promise.then(n=>n.match(e,t))}unwrapOr(e){return this._promise.then(t=>t.unwrapOr(e))}safeUnwrap(){return B$(this,arguments,function*(){return yield Wa(yield Wa(yield*S$(O$(yield Wa(this._promise.then(t=>t.safeUnwrap()))))))})}then(e,t){return this._promise.then(e,t)}};var PB=r=>new bt(Promise.resolve(new Ci(r))),gJ=bt.fromPromise,xJ=bt.fromSafePromise,yJ=bt.fromThrowable,BB=r=>{let e=Pt([]);for(let t of r)if(t.isErr()){e=at(t.error);break}else e.map(n=>n.push(t.value));return e},_$=r=>bt.fromSafePromise(Promise.all(r)).andThen(BB),SB=r=>{let e=Pt([]);for(let t of r)t.isErr()&&e.isErr()?e.error.push(t.error):t.isErr()&&e.isOk()?e=at([t.error]):t.isOk()&&e.isOk()&&e.value.push(t.value);return e},C$=r=>bt.fromSafePromise(Promise.all(r)).andThen(SB),Rd;(function(r){function e(s,i){return(...o)=>{try{let a=s(...o);return Pt(a)}catch(a){return at(i?i(a):a)}}}r.fromThrowable=e;function t(s){return BB(s)}r.combine=t;function n(s){return SB(s)}r.combineWithAllErrors=n})(Rd||(Rd={}));var Pt=r=>new _i(r),at=r=>new Ci(r);var _i=class{constructor(e){this.value=e}isOk(){return!0}isErr(){return!this.isOk()}map(e){return Pt(e(this.value))}mapErr(e){return Pt(this.value)}andThen(e){return e(this.value)}orElse(e){return Pt(this.value)}asyncAndThen(e){return e(this.value)}asyncMap(e){return bt.fromSafePromise(e(this.value))}unwrapOr(e){return this.value}match(e,t){return e(this.value)}safeUnwrap(){let e=this.value;return function*(){return e}()}_unsafeUnwrap(e){return this.value}_unsafeUnwrapErr(e){throw kB("Called `_unsafeUnwrapErr` on an Ok",this,e)}},Ci=class{constructor(e){this.error=e}isOk(){return!1}isErr(){return!this.isOk()}map(e){return at(this.error)}mapErr(e){return at(e(this.error))}andThen(e){return at(this.error)}orElse(e){return e(this.error)}asyncAndThen(e){return PB(this.error)}asyncMap(e){return PB(this.error)}unwrapOr(e){return e}match(e,t){return t(this.error)}safeUnwrap(){let e=this.error;return function*(){throw yield at(e),new Error("Do not use this generator out of `safeTry`")}()}_unsafeUnwrap(e){throw kB("Called `_unsafeUnwrap` on an Err",this,e)}_unsafeUnwrapErr(e){return this.error}},wJ=Rd.fromThrowable;var A_=l0(Ym(),1);var E_=l0(Ym(),1);function ge(r,e,t){return n=>r[e.name]?.(n)??r[t]?.(n)??e(r,n)}or();Je();var Ob=class extends z{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}};Ar();Li();qb();Ya();Ja();ul();var GS="/docs/contract/encodeEventTopics";function ei(r){let{abi:e,eventName:t,args:n}=r,s=e[0];if(t){let c=Xs({abi:e,name:t});if(!c)throw new Fd(t,{docsPath:GS});s=c}if(s.type!=="event")throw new Fd(void 0,{docsPath:GS});let i=Rr(s),o=ol(i),a=[];if(n&&"inputs"in s){let c=s.inputs?.filter(l=>"indexed"in l&&l.indexed),u=Array.isArray(n)?n:Object.values(n).length>0?c?.map(l=>n[l.name])??[]:[];u.length>0&&(a=c?.map((l,f)=>Array.isArray(u[f])?u[f].map((d,h)=>zS({param:l,value:u[f][h]})):u[f]?zS({param:l,value:u[f]}):null)??[])}return[o,...a]}function zS({param:r,value:e}){if(r.type==="string"||r.type==="bytes")return Bt(Lr(e));if(r.type==="tuple"||r.type.match(/^(.*)\[(\d+)?\]$/))throw new Ob(r.type);return As([r],[e])}De();function $o(r,{method:e}){let t={};return r.transport.type==="fallback"&&r.transport.onResponse?.(({method:n,response:s,status:i,transport:o})=>{i==="success"&&e===n&&(t[s]=o.request)}),n=>t[n]||r.request}async function Wb(r,e){let{address:t,abi:n,args:s,eventName:i,fromBlock:o,strict:a,toBlock:c}=e,u=$o(r,{method:"eth_newFilter"}),l=i?ei({abi:n,args:s,eventName:i}):void 0,f=await r.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof o=="bigint"?Ae(o):o,toBlock:typeof c=="bigint"?Ae(c):c,topics:l}]});return{abi:n,args:s,eventName:i,id:f,request:u(f),strict:Boolean(a),type:"event"}}Fi();qo();or();Je();ec();Xd();var kq=3;function $i(r,{abi:e,address:t,args:n,docsPath:s,functionName:i,sender:o}){let{code:a,data:c,message:u,shortMessage:l}=r instanceof Go?r:r instanceof z?r.walk(d=>"data"in d)||r.walk():{},f=(()=>r instanceof Ws?new lg({functionName:i}):[kq,Es.code].includes(a)&&(c||u||l)?new Xa({abi:e,data:typeof c=="object"?c.data:c,functionName:i,message:l??u}):r)();return new ug(f,{abi:e,args:n,contractAddress:t,docsPath:s,functionName:i,sender:o})}Fi();De();y6();Qd();Je();ri();var pg=class extends z{constructor(e,{account:t,docsPath:n,chain:s,data:i,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:u,nonce:l,to:f,value:d}){let h=ml({from:t?.address,to:f,value:typeof d<"u"&&`${rg(d)} ${s?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:o,gasPrice:typeof a<"u"&&`${Ur(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Ur(c)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${Ur(u)} gwei`,nonce:l});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",h].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=e}};Bl();A6();function a9(r,{docsPath:e,...t}){let n=(()=>{let s=hg(r,t);return s instanceof oa?r:s})();return new pg(n,{docsPath:e,...t})}E6();v6();T6();yg();Fi();Qd();Je();var wg=class extends z{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}},aa=class extends z{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}},Ag=class extends z{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Ur(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}};Mr();Je();var _l=class extends z{constructor({blockHash:e,blockNumber:t}){let n="Block";e&&(n=`Block at hash "${e}"`),t&&(n=`Block at number "${t}"`),super(`${n} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}};De();bg();Mr();bg();var P6={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function tc(r){let e={...r,blockHash:r.blockHash?r.blockHash:null,blockNumber:r.blockNumber?BigInt(r.blockNumber):null,chainId:r.chainId?ar(r.chainId):void 0,gas:r.gas?BigInt(r.gas):void 0,gasPrice:r.gasPrice?BigInt(r.gasPrice):void 0,maxFeePerBlobGas:r.maxFeePerBlobGas?BigInt(r.maxFeePerBlobGas):void 0,maxFeePerGas:r.maxFeePerGas?BigInt(r.maxFeePerGas):void 0,maxPriorityFeePerGas:r.maxPriorityFeePerGas?BigInt(r.maxPriorityFeePerGas):void 0,nonce:r.nonce?ar(r.nonce):void 0,to:r.to?r.to:null,transactionIndex:r.transactionIndex?Number(r.transactionIndex):null,type:r.type?P6[r.type]:void 0,typeHex:r.type?r.type:void 0,value:r.value?BigInt(r.value):void 0,v:r.v?BigInt(r.v):void 0};return e.yParity=(()=>{if(r.yParity)return Number(r.yParity);if(typeof e.v=="bigint"){if(e.v===0n||e.v===27n)return 0;if(e.v===1n||e.v===28n)return 1;if(e.v>=35n)return e.v%2n===0n?1:0}})(),e.type==="legacy"&&(delete e.accessList,delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas,delete e.yParity),e.type==="eip2930"&&(delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas),e.type==="eip1559"&&delete e.maxFeePerBlobGas,e}var u9=Sl("transaction",tc);function e0(r){let e=r.transactions?.map(t=>typeof t=="string"?t:tc(t));return{...r,baseFeePerGas:r.baseFeePerGas?BigInt(r.baseFeePerGas):null,blobGasUsed:r.blobGasUsed?BigInt(r.blobGasUsed):void 0,difficulty:r.difficulty?BigInt(r.difficulty):void 0,excessBlobGas:r.excessBlobGas?BigInt(r.excessBlobGas):void 0,gasLimit:r.gasLimit?BigInt(r.gasLimit):void 0,gasUsed:r.gasUsed?BigInt(r.gasUsed):void 0,hash:r.hash?r.hash:null,logsBloom:r.logsBloom?r.logsBloom:null,nonce:r.nonce?r.nonce:null,number:r.number?BigInt(r.number):null,size:r.size?BigInt(r.size):void 0,timestamp:r.timestamp?BigInt(r.timestamp):void 0,transactions:e,totalDifficulty:r.totalDifficulty?BigInt(r.totalDifficulty):null}}var l9=Sl("block",e0);async function Zr(r,{blockHash:e,blockNumber:t,blockTag:n,includeTransactions:s}={}){let i=n??"latest",o=s??!1,a=t!==void 0?Ae(t):void 0,c=null;if(e?c=await r.request({method:"eth_getBlockByHash",params:[e,o]},{dedupe:!0}):c=await r.request({method:"eth_getBlockByNumber",params:[a||i,o]},{dedupe:Boolean(a)}),!c)throw new _l({blockHash:e,blockNumber:t});return(r.chain?.formatters?.block?.format||e0)(c)}async function Cl(r){let e=await r.request({method:"eth_gasPrice"});return BigInt(e)}async function f9(r,e){return k6(r,e)}async function k6(r,e){let{block:t,chain:n=r.chain,request:s}=e||{};if(typeof n?.fees?.defaultPriorityFee=="function"){let i=t||await ge(r,Zr,"getBlock")({});return n.fees.defaultPriorityFee({block:i,client:r,request:s})}if(typeof n?.fees?.defaultPriorityFee<"u")return n?.fees?.defaultPriorityFee;try{let i=await r.request({method:"eth_maxPriorityFeePerGas"});return dr(i)}catch{let[i,o]=await Promise.all([t?Promise.resolve(t):ge(r,Zr,"getBlock")({}),ge(r,Cl,"getGasPrice")({})]);if(typeof i.baseFeePerGas!="bigint")throw new aa;let a=o-i.baseFeePerGas;return a<0n?0n:a}}async function d9(r,e){return Eg(r,e)}async function Eg(r,e){let{block:t,chain:n=r.chain,request:s,type:i="eip1559"}=e||{},o=await(async()=>typeof n?.fees?.baseFeeMultiplier=="function"?n.fees.baseFeeMultiplier({block:t,client:r,request:s}):n?.fees?.baseFeeMultiplier??1.2)();if(o<1)throw new wg;let a=o.toString().split(".")[1]?.length??0,c=10**a,u=d=>d*BigInt(Math.ceil(o*c))/BigInt(c),l=t||await ge(r,Zr,"getBlock")({});if(typeof n?.fees?.estimateFeesPerGas=="function"){let d=await n.fees.estimateFeesPerGas({block:t,client:r,multiply:u,request:s,type:i});if(d!==null)return d}if(i==="eip1559"){if(typeof l.baseFeePerGas!="bigint")throw new aa;let d=typeof s?.maxPriorityFeePerGas=="bigint"?s.maxPriorityFeePerGas:await k6(r,{block:l,chain:n,request:s}),h=u(l.baseFeePerGas);return{maxFeePerGas:s?.maxFeePerGas??h+d,maxPriorityFeePerGas:d}}return{gasPrice:s?.gasPrice??u(await ge(r,Cl,"getGasPrice")({}))}}Mr();De();async function vg(r,{address:e,blockTag:t="latest",blockNumber:n}){let s=await r.request({method:"eth_getTransactionCount",params:[e,n?Ae(n):t]},{dedupe:Boolean(n)});return ar(s)}Ar();De();function Nl(r){let{kzg:e}=r,t=r.to??(typeof r.blobs[0]=="string"?"hex":"bytes"),n=typeof r.blobs[0]=="string"?r.blobs.map(i=>fn(i)):r.blobs,s=[];for(let i of n)s.push(Uint8Array.from(e.blobToKzgCommitment(i)));return t==="bytes"?s:s.map(i=>tt(i))}Ar();De();function Il(r){let{kzg:e}=r,t=r.to??(typeof r.blobs[0]=="string"?"hex":"bytes"),n=typeof r.blobs[0]=="string"?r.blobs.map(o=>fn(o)):r.blobs,s=typeof r.commitments[0]=="string"?r.commitments.map(o=>fn(o)):r.commitments,i=[];for(let o=0;o<n.length;o++){let a=n[o],c=s[o];i.push(Uint8Array.from(e.computeBlobKzgProof(a,c)))}return t==="bytes"?i:i.map(o=>tt(o))}De();S6();gs();Ar();De();function h9(r,e){let t=e||"hex",n=Pg(Ft(r,{strict:!1})?Lr(r):r);return t==="bytes"?n:Ce(n)}function m9(r){let{commitment:e,version:t=1}=r,n=r.to??(typeof e=="string"?"hex":"bytes"),s=h9(e,"bytes");return s.set([t],0),n==="bytes"?s:tt(s)}function kg(r){let{commitments:e,version:t}=r,n=r.to??(typeof e[0]=="string"?"hex":"bytes"),s=[];for(let i of e)s.push(m9({commitment:i,to:n,version:t}));return s}Je();var Bg=class extends z{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlobSizeTooLargeError"})}},Rl=class extends z{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}},Sg=class extends z{constructor({hash:e,size:t}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashSizeError"})}},Og=class extends z{constructor({hash:e,version:t}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${1}`,`Received: ${t}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}};Zb();Ks();Ar();De();function b9(r){let e=r.to??(typeof r.data=="string"?"hex":"bytes"),t=typeof r.data=="string"?fn(r.data):r.data,n=rt(t);if(!n)throw new Rl;if(n>761855)throw new Bg({maxSize:761855,size:n});let s=[],i=!0,o=0;for(;i;){let a=fl(new Uint8Array(131072)),c=0;for(;c<4096;){let u=t.slice(o,o+(32-1));if(a.pushByte(0),a.pushBytes(u),u.length<31){a.pushByte(128),i=!1;break}c++,o+=31}s.push(a)}return e==="bytes"?s.map(a=>a.bytes):s.map(a=>tt(a.bytes))}function _g(r){let{data:e,kzg:t,to:n}=r,s=r.blobs??b9({data:e,to:n}),i=r.commitments??Nl({blobs:s,kzg:t,to:n}),o=r.proofs??Il({blobs:s,commitments:i,kzg:t,to:n}),a=[];for(let c=0;c<s.length;c++)a.push({blob:s[c],commitment:i[c],proof:o[c]});return a}yg();ri();function Cg(r){if(r.type)return r.type;if(typeof r.blobs<"u"||typeof r.blobVersionedHashes<"u"||typeof r.maxFeePerBlobGas<"u"||typeof r.sidecars<"u")return"eip4844";if(typeof r.maxFeePerGas<"u"||typeof r.maxPriorityFeePerGas<"u")return"eip1559";if(typeof r.gasPrice<"u")return typeof r.accessList<"u"?"eip2930":"legacy";throw new ag({transaction:r})}Mr();async function Ng(r){let e=await r.request({method:"eth_chainId"},{dedupe:!0});return ar(e)}var Mq=["blobVersionedHashes","chainId","fees","gas","nonce","type"];async function Ig(r,e){let{account:t=r.account,blobs:n,chain:s,gas:i,kzg:o,nonce:a,parameters:c=Mq,type:u}=e,l=t?Er(t):void 0,f={...e,...l?{from:l?.address}:{}},d;async function h(){return d||(d=await ge(r,Zr,"getBlock")({blockTag:"latest"}),d)}let b;async function p(){return b||(s?s.id:typeof e.chainId<"u"?e.chainId:(b=await ge(r,Ng,"getChainId")({}),b))}if((c.includes("blobVersionedHashes")||c.includes("sidecars"))&&n&&o){let g=Nl({blobs:n,kzg:o});if(c.includes("blobVersionedHashes")){let m=kg({commitments:g,to:"hex"});f.blobVersionedHashes=m}if(c.includes("sidecars")){let m=Il({blobs:n,commitments:g,kzg:o}),y=_g({blobs:n,commitments:g,proofs:m,to:"hex"});f.sidecars=y}}if(c.includes("chainId")&&(f.chainId=await p()),c.includes("nonce")&&typeof a>"u"&&l)if(l.nonceManager){let g=await p();f.nonce=await l.nonceManager.consume({address:l.address,chainId:g,client:r})}else f.nonce=await ge(r,vg,"getTransactionCount")({address:l.address,blockTag:"pending"});if((c.includes("fees")||c.includes("type"))&&typeof u>"u")try{f.type=Cg(f)}catch{let g=await h();f.type=typeof g?.baseFeePerGas=="bigint"?"eip1559":"legacy"}if(c.includes("fees"))if(f.type!=="legacy"&&f.type!=="eip2930"){if(typeof f.maxFeePerGas>"u"||typeof f.maxPriorityFeePerGas>"u"){let g=await h(),{maxFeePerGas:m,maxPriorityFeePerGas:y}=await Eg(r,{block:g,chain:s,request:f});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas<y)throw new Ag({maxPriorityFeePerGas:y});f.maxPriorityFeePerGas=y,f.maxFeePerGas=m}}else{if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")throw new aa;let g=await h(),{gasPrice:m}=await Eg(r,{block:g,chain:s,request:f,type:"legacy"});f.gasPrice=m}return c.includes("gas")&&typeof i>"u"&&(f.gas=await ge(r,Ml,"estimateGas")({...f,account:l?{address:l.address,type:"json-rpc"}:void 0})),Ol(f),delete f.parameters,f}async function Ml(r,e){let t=e.account??r.account,n=t?Er(t):void 0;try{let{accessList:s,blobs:i,blobVersionedHashes:o,blockNumber:a,blockTag:c,data:u,gas:l,gasPrice:f,maxFeePerBlobGas:d,maxFeePerGas:h,maxPriorityFeePerGas:b,nonce:p,to:g,value:m,stateOverride:y,...E}=await Ig(r,{...e,parameters:n?.type==="local"?void 0:["blobVersionedHashes"]}),k=(a?Ae(a):void 0)||c,w=xg(y);Ol(e);let P=r.chain?.formatters?.transactionRequest?.format,Z=(P||gg)({...mg(E,{format:P}),from:n?.address,accessList:s,blobs:i,blobVersionedHashes:o,data:u,gas:l,gasPrice:f,maxFeePerBlobGas:d,maxFeePerGas:h,maxPriorityFeePerGas:b,nonce:p,to:g,value:m}),_=await r.request({method:"eth_estimateGas",params:w?[Z,k??"latest",w]:k?[Z,k]:[Z]});return BigInt(_)}catch(s){throw a9(s,{...e,account:n,chain:r.chain})}}async function g9(r,e){let{abi:t,address:n,args:s,functionName:i,...o}=e,a=Yr({abi:t,args:s,functionName:i});try{return await ge(r,Ml,"estimateGas")({data:a,to:n,...o})}catch(c){let u=o.account?Er(o.account):void 0;throw $i(c,{abi:t,address:n,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:i,sender:u?.address})}}ul();or();or();Ks();qb();p6();Xb();Ja();var x9="/docs/contract/decodeEventLog";function Ll(r){let{abi:e,data:t,strict:n,topics:s}=r,i=n??!0,[o,...a]=s;if(!o)throw new Eb({docsPath:x9});let c=e.find(p=>p.type==="event"&&o===ol(Rr(p)));if(!(c&&"name"in c)||c.type!=="event")throw new nl(o,{docsPath:x9});let{name:u,inputs:l}=c,f=l?.some(p=>!("name"in p&&p.name)),d=f?[]:{},h=l.filter(p=>"indexed"in p&&p.indexed);for(let p=0;p<h.length;p++){let g=h[p],m=a[p];if(!m)throw new Js({abiItem:c,param:g});d[f?p:g.name||p]=Lq({param:g,value:m})}let b=l.filter(p=>!("indexed"in p&&p.indexed));if(b.length>0){if(t&&t!=="0x")try{let p=Za(b,t);if(p)if(f)d=[...d,...p];else for(let g=0;g<b.length;g++)d[b[g].name]=p[g]}catch(p){if(i)throw p instanceof tl||p instanceof ll?new xs({abiItem:c,data:t,params:b,size:rt(t)}):p}else if(i)throw new xs({abiItem:c,data:"0x",params:b,size:0})}return{eventName:u,args:Object.values(d).length>0?d:void 0}}function Lq({param:r,value:e}){return r.type==="string"||r.type==="bytes"||r.type==="tuple"||r.type.match(/^(.*)\[(\d+)?\]$/)?e:(Za([r],e)||[])[0]}function jl({abi:r,eventName:e,logs:t,strict:n=!0}){return t.map(s=>{try{let i=Ll({...s,abi:r,strict:n});return e&&!e.includes(i.eventName)?null:{...i,...s}}catch(i){let o,a;if(i instanceof nl)return null;if(i instanceof xs||i instanceof Js){if(n)return null;o=i.abiItem.name,a=i.abiItem.inputs?.some(c=>!("name"in c&&c.name))}return{...s,args:a?[]:{},eventName:o}}}).filter(Boolean)}De();function Xr(r,{args:e,eventName:t}={}){return{...r,blockHash:r.blockHash?r.blockHash:null,blockNumber:r.blockNumber?BigInt(r.blockNumber):null,logIndex:r.logIndex?Number(r.logIndex):null,transactionHash:r.transactionHash?r.transactionHash:null,transactionIndex:r.transactionIndex?Number(r.transactionIndex):null,...t?{args:e,eventName:t}:{}}}async function Ul(r,{address:e,blockHash:t,fromBlock:n,toBlock:s,event:i,events:o,args:a,strict:c}={}){let u=c??!1,l=o??(i?[i]:void 0),f=[];l&&(f=[l.flatMap(b=>ei({abi:[b],eventName:b.name,args:a}))],i&&(f=f[0]));let d;t?d=await r.request({method:"eth_getLogs",params:[{address:e,topics:f,blockHash:t}]}):d=await r.request({method:"eth_getLogs",params:[{address:e,topics:f,fromBlock:typeof n=="bigint"?Ae(n):n,toBlock:typeof s=="bigint"?Ae(s):s}]});let h=d.map(b=>Xr(b));return l?jl({abi:l,logs:h,strict:u}):h}async function Rg(r,e){let{abi:t,address:n,args:s,blockHash:i,eventName:o,fromBlock:a,toBlock:c,strict:u}=e,l=o?Xs({abi:t,name:o}):void 0,f=l?void 0:t.filter(d=>d.type==="event");return ge(r,Ul,"getLogs")({address:n,args:s,blockHash:i,event:l,events:f,fromBlock:a,toBlock:c,strict:u})}rc();qo();Dl();async function pr(r,e){let{abi:t,address:n,args:s,functionName:i,...o}=e,a=Yr({abi:t,args:s,functionName:i});try{let{data:c}=await ge(r,si,"call")({...o,data:a,to:n});return Wn({abi:t,args:s,functionName:i,data:c||"0x"})}catch(c){throw $i(c,{abi:t,address:n,args:s,docsPath:"/docs/contract/readContract",functionName:i})}}Fi();rc();qo();Dl();async function R9(r,e){let{abi:t,address:n,args:s,dataSuffix:i,functionName:o,...a}=e,c=a.account?Er(a.account):r.account,u=Yr({abi:t,args:s,functionName:o});try{let{data:l}=await ge(r,si,"call")({batch:!1,data:`${u}${i?i.replace("0x",""):""}`,to:n,...a,account:c}),f=Wn({abi:t,args:s,functionName:o,data:l||"0x"}),d=t.filter(h=>"name"in h&&h.name===e.functionName);return{result:f,request:{abi:d,address:n,args:s,dataSuffix:i,functionName:o,...a,account:c}}}catch(l){throw $i(l,{abi:t,address:n,args:s,docsPath:"/docs/contract/simulateContract",functionName:o,sender:c?.address})}}or();Xd();var U6=new Map,M9=new Map,Gq=0;function en(r,e,t){let n=++Gq,s=()=>U6.get(r)||[],i=()=>{let l=s();U6.set(r,l.filter(f=>f.id!==n))},o=()=>{let l=M9.get(r);s().length===1&&l&&l(),i()},a=s();if(U6.set(r,[...a,{id:n,fns:e}]),a&&a.length>0)return o;let c={};for(let l in e)c[l]=(...f)=>{let d=s();if(d.length!==0)for(let h of d)h.fns[l]?.(...f)};let u=t(c);return typeof u=="function"&&M9.set(r,u),o}async function s0(r){return new Promise(e=>setTimeout(e,r))}function ii(r,{emitOnBegin:e,initialWaitTime:t,interval:n}){let s=!0,i=()=>s=!1;return(async()=>{let a;e&&(a=await r({unpoll:i}));let c=await t?.(a)??n;await s0(c);let u=async()=>{!s||(await r({unpoll:i}),await s0(n),u())};u()})(),i}dn();var zq=new Map,Vq=new Map;function L9(r){let e=(s,i)=>({clear:()=>i.delete(s),get:()=>i.get(s),set:o=>i.set(s,o)}),t=e(r,zq),n=e(r,Vq);return{clear:()=>{t.clear(),n.clear()},promise:t,response:n}}async function j9(r,{cacheKey:e,cacheTime:t=Number.POSITIVE_INFINITY}){let n=L9(e),s=n.response.get();if(s&&t>0&&new Date().getTime()-s.created.getTime()<t)return s.data;let i=n.promise.get();i||(i=r(),n.promise.set(i));try{let o=await i;return n.response.set({created:new Date,data:o}),o}finally{n.promise.clear()}}var Kq=r=>`blockNumber.${r}`;async function oi(r,{cacheTime:e=r.cacheTime}={}){let t=await j9(()=>r.request({method:"eth_blockNumber"}),{cacheKey:Kq(r.uid),cacheTime:e});return BigInt(t)}async function la(r,{filter:e}){let t="strict"in e&&e.strict,n=await e.request({method:"eth_getFilterChanges",params:[e.id]});if(typeof n[0]=="string")return n;let s=n.map(i=>Xr(i));return!("abi"in e)||!e.abi?s:jl({abi:e.abi,logs:s,strict:t})}async function fa(r,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function U9(r,e){let{abi:t,address:n,args:s,batch:i=!0,eventName:o,fromBlock:a,onError:c,onLogs:u,poll:l,pollingInterval:f=r.pollingInterval,strict:d}=e;return(()=>typeof l<"u"?l:typeof a=="bigint"?!0:!(r.transport.type==="webSocket"||r.transport.type==="fallback"&&r.transport.transports[0].config.type==="webSocket"))()?(()=>{let g=d??!1,m=nt(["watchContractEvent",n,s,i,r.uid,o,f,g,a]);return en(m,{onLogs:u,onError:c},y=>{let E;a!==void 0&&(E=a-1n);let v,k=!1,w=ii(async()=>{if(!k){try{v=await ge(r,Wb,"createContractEventFilter")({abi:t,address:n,args:s,eventName:o,strict:g,fromBlock:a})}catch{}k=!0;return}try{let P;if(v)P=await ge(r,la,"getFilterChanges")({filter:v});else{let B=await ge(r,oi,"getBlockNumber")({});E&&E!==B?P=await ge(r,Rg,"getContractEvents")({abi:t,address:n,args:s,eventName:o,fromBlock:E+1n,toBlock:B,strict:g}):P=[],E=B}if(P.length===0)return;if(i)y.onLogs(P);else for(let B of P)y.onLogs([B])}catch(P){v&&P instanceof Vn&&(k=!1),y.onError?.(P)}},{emitOnBegin:!0,interval:f});return async()=>{v&&await ge(r,fa,"uninstallFilter")({filter:v}),w()}})})():(()=>{let g=d??!1,m=nt(["watchContractEvent",n,s,i,r.uid,o,f,g]),y=!0,E=()=>y=!1;return en(m,{onLogs:u,onError:c},v=>((async()=>{try{let k=(()=>{if(r.transport.type==="fallback"){let B=r.transport.transports.find(Z=>Z.config.type==="webSocket");return B?B.value:r.transport}return r.transport})(),w=o?ei({abi:t,eventName:o,args:s}):[],{unsubscribe:P}=await k.subscribe({params:["logs",{address:n,topics:w}],onData(B){if(!y)return;let Z=B.result;try{let{eventName:_,args:O}=Ll({abi:t,data:Z.data,topics:Z.topics,strict:d}),S=Xr(Z,{args:O,eventName:_});v.onLogs([S])}catch(_){let O,S;if(_ instanceof xs||_ instanceof Js){if(d)return;O=_.abiItem.name,S=_.abiItem.inputs?.some(G=>!("name"in G&&G.name))}let F=Xr(Z,{args:S?[]:{},eventName:O});v.onLogs([F])}},onError(B){v.onError?.(B)}});E=P,y||E()}catch(k){c?.(k)}})(),()=>E()))})()}async function F9(r,{serializedTransaction:e}){return r.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}Je();var $g=class extends z{constructor({address:e}){super(`No EIP-712 domain found on contract "${e}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${e}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip712DomainNotFoundError"})}};async function D9(r,e){let{address:t,factory:n,factoryData:s}=e;try{let[i,o,a,c,u,l,f]=await ge(r,pr,"readContract")({abi:Wq,address:t,functionName:"eip712Domain",factory:n,factoryData:s});return{domain:{name:o,version:a,chainId:Number(c),verifyingContract:u,salt:l},extensions:f,fields:i}}catch(i){let o=i;throw o.name==="ContractFunctionExecutionError"&&o.cause.name==="ContractFunctionZeroDataError"?new $g({address:t}):o}}var Wq=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];Fi();var qg=256,Gg;function zg(r=11){if(!Gg||qg+r>256*2){Gg="",qg=0;for(let e=0;e<256;e++)Gg+=(256+Math.random()*256|0).toString(16).substring(1)}return Gg.substring(qg,qg+++r)}function H9(r){let{batch:e,cacheTime:t=r.pollingInterval??4e3,ccipRead:n,key:s="base",name:i="Base Client",pollingInterval:o=4e3,type:a="base"}=r,c=r.chain,u=r.account?Er(r.account):void 0,{config:l,request:f,value:d}=r.transport({chain:c,pollingInterval:o}),h={...l,...d},b={account:u,batch:e,cacheTime:t,ccipRead:n,chain:c,key:s,name:i,pollingInterval:o,request:f,transport:h,type:a,uid:zg()};function p(g){return m=>{let y=m(g);for(let v in b)delete y[v];let E={...g,...y};return Object.assign(E,{extend:p(E)})}}return Object.assign(b,{extend:p(b)})}Je();xl();Xd();De();Li();Gb();var Vg=new Ho(8192);function $9(r,{enabled:e=!0,id:t}){if(!e||!t)return r();if(Vg.get(t))return Vg.get(t);let n=r().finally(()=>Vg.delete(t));return Vg.set(t,n),n}function i0(r,{delay:e=100,retryCount:t=2,shouldRetry:n=()=>!0}={}){return new Promise((s,i)=>{let o=async({count:a=0}={})=>{let c=async({error:u})=>{let l=typeof e=="function"?e({count:a,error:u}):e;l&&await s0(l),o({count:a+1})};try{let u=await r();s(u)}catch(u){if(a<t&&await n({count:a,error:u}))return c({error:u});i(u)}};o()})}dn();function q9(r,e={}){return async(t,n={})=>{let{dedupe:s=!1,retryDelay:i=150,retryCount:o=3,uid:a}={...e,...n},c=s?Bt(Gd(`${a}.${nt(t)}`)):void 0;return $9(()=>i0(async()=>{try{return await r(t)}catch(u){let l=u;switch(l.code){case Vo.code:throw new Vo(l);case Ko.code:throw new Ko(l);case Wo.code:throw new Wo(l);case Jo.code:throw new Jo(l);case Es.code:throw new Es(l);case Vn.code:throw new Vn(l);case Qo.code:throw new Qo(l);case Yo.code:throw new Yo(l);case Zo.code:throw new Zo(l);case Xo.code:throw new Xo(l);case Di.code:throw new Di(l);case ea.code:throw new ea(l);case Hi.code:throw new Hi(l);case ta.code:throw new ta(l);case ra.code:throw new ra(l);case na.code:throw new na(l);case sa.code:throw new sa(l);case ia.code:throw new ia(l);case 5e3:throw new Hi(l);default:throw u instanceof z?u:new dg(l)}}},{delay:({count:u,error:l})=>{if(l&&l instanceof zn){let f=l?.headers?.get("Retry-After");if(f?.match(/\d/))return Number.parseInt(f)*1e3}return~~(1<<u)*i},retryCount:o,shouldRetry:({error:u})=>Jq(u)}),{enabled:s,id:c})}}function Jq(r){return"code"in r&&typeof r.code=="number"?r.code===-1||r.code===Di.code||r.code===Es.code:r instanceof zn&&r.status?r.status===403||r.status===408||r.status===413||r.status===429||r.status===500||r.status===502||r.status===503||r.status===504:!0}function G9({key:r,name:e,request:t,retryCount:n=3,retryDelay:s=150,timeout:i,type:o},a){let c=zg();return{config:{key:r,name:e,request:t,retryCount:n,retryDelay:s,timeout:i,type:o},request:q9(t,{retryCount:n,retryDelay:s,uid:c}),value:a}}xl();Je();var Kg=class extends z{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}};L6();xl();function z9(r,{errorInstance:e=new Error("timed out"),timeout:t,signal:n}){return new Promise((s,i)=>{(async()=>{let o;try{let a=new AbortController;t>0&&(o=setTimeout(()=>{n?a.abort():i(e)},t)),s(await r({signal:a?.signal||null}))}catch(a){a?.name==="AbortError"&&i(e),i(a)}finally{clearTimeout(o)}})()})}dn();function Qq(){return{current:0,take(){return this.current++},reset(){this.current=0}}}var F6=Qq();function V9(r,e={}){return{async request(t){let{body:n,onRequest:s=e.onRequest,onResponse:i=e.onResponse,timeout:o=e.timeout??1e4}=t,a={...e.fetchOptions??{},...t.fetchOptions??{}},{headers:c,method:u,signal:l}=a;try{let f=await z9(async({signal:h})=>{let b={...a,body:Array.isArray(n)?nt(n.map(m=>({jsonrpc:"2.0",id:m.id??F6.take(),...m}))):nt({jsonrpc:"2.0",id:n.id??F6.take(),...n}),headers:{...c,"Content-Type":"application/json"},method:u||"POST",signal:l||(o>0?h:null)},p=new Request(r,b);return s&&await s(p),await fetch(r,b)},{errorInstance:new Zd({body:n,url:r}),timeout:o,signal:!0});i&&await i(f);let d;if(f.headers.get("Content-Type")?.startsWith("application/json")?d=await f.json():(d=await f.text(),d=JSON.parse(d||"{}")),!f.ok)throw new zn({body:n,details:nt(d.error)||f.statusText,headers:f.headers,status:f.status,url:r});return d}catch(f){throw f instanceof zn||f instanceof Zd?f:new zn({body:n,details:f.message,url:r})}}}}function D6(r,e={}){let{batch:t,fetchOptions:n,key:s="http",name:i="HTTP JSON-RPC",onFetchRequest:o,onFetchResponse:a,retryDelay:c}=e;return({chain:u,retryCount:l,timeout:f})=>{let{batchSize:d=1e3,wait:h=0}=typeof t=="object"?t:{},b=e.retryCount??l,p=f??e.timeout??1e4,g=r||u?.rpcUrls.default.http[0];if(!g)throw new Kg;let m=V9(g,{fetchOptions:n,onRequest:o,onResponse:a,timeout:p});return G9({key:s,name:i,async request({method:y,params:E}){let v={method:y,params:E},{schedule:k}=jg({id:g,wait:h,shouldSplitBatch(Z){return Z.length>d},fn:Z=>m.request({body:Z}),sort:(Z,_)=>Z.id-_.id}),w=async Z=>t?k(Z):[await m.request({body:Z})],[{error:P,result:B}]=await w(v);if(P)throw new gl({body:v,error:P,url:g});return B},retryCount:b,retryDelay:c,timeout:p,type:"http"},{fetchOptions:n,url:g})}}nc();rc();qo();ic();qd();De();Qb();Je();ec();function Hl(r,e){if(!(r instanceof z))return!1;let t=r.walk(n=>n instanceof Xa);return t instanceof Xa?!!(t.data?.errorName==="ResolverNotFound"||t.data?.errorName==="ResolverWildcardNotSupported"||t.data?.errorName==="ResolverNotContract"||t.data?.errorName==="ResolverError"||t.data?.errorName==="HttpError"||t.reason?.includes("Wildcard on non-extended resolvers is not supported")||e==="reverse"&&t.reason===Jb[50]):!1}Zs();Ar();De();Li();gs();function Wg(r){if(r.length!==66||r.indexOf("[")!==0||r.indexOf("]")!==65)return null;let e=`0x${r.slice(1,65)}`;return Ft(e)?e:null}function $l(r){let e=new Uint8Array(32).fill(0);if(!r)return tt(e);let t=r.split(".");for(let n=t.length-1;n>=0;n-=1){let s=Wg(t[n]),i=s?Lr(s):Bt(Qr(t[n]),"bytes");e=Bt(jr([e,i]),"bytes")}return tt(e)}Ar();function K9(r){return`[${r.slice(2)}]`}Ar();De();Li();function W9(r){let e=new Uint8Array(32).fill(0);return r?Wg(r)||Bt(Qr(r)):tt(e)}function da(r){let e=r.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);let t=new Uint8Array(Qr(e).byteLength+2),n=0,s=e.split(".");for(let i=0;i<s.length;i++){let o=Qr(s[i]);o.byteLength>255&&(o=Qr(K9(W9(s[i])))),t[n]=o.length,t.set(o,n+1),n+=o.length+1}return t.byteLength!==n+1?t.slice(0,n+1):t}async function J9(r,{blockNumber:e,blockTag:t,coinType:n,name:s,gatewayUrls:i,strict:o,universalResolverAddress:a}){let c=a;if(!c){if(!r.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=Jn({blockNumber:e,chain:r.chain,contract:"ensUniversalResolver"})}try{let u=Yr({abi:C6,functionName:"addr",...n!=null?{args:[$l(s),BigInt(n)]}:{args:[$l(s)]}}),l={address:c,abi:Mg,functionName:"resolve",args:[Ce(da(s)),u],blockNumber:e,blockTag:t},f=ge(r,pr,"readContract"),d=i?await f({...l,args:[...l.args,i]}):await f(l);if(d[0]==="0x")return null;let h=Wn({abi:C6,args:n!=null?[$l(s),BigInt(n)]:void 0,functionName:"addr",data:d[0]});return h==="0x"||Qs(h)==="0x00"?null:h}catch(u){if(o)throw u;if(Hl(u,"resolve"))return null;throw u}}Je();var Jg=class extends z{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}},pa=class extends z{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}},ql=class extends z{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}},Qg=class extends z{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}};var Yq=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Zq=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,Xq=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,eG=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function tG(r){try{let e=await fetch(r,{method:"HEAD"});return e.status===200?e.headers.get("content-type")?.startsWith("image/"):!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(t=>{let n=new Image;n.onload=()=>{t(!0)},n.onerror=()=>{t(!1)},n.src=r})}}function Q9(r,e){return r?r.endsWith("/")?r.slice(0,-1):r:e}function H6({uri:r,gatewayUrls:e}){let t=Xq.test(r);if(t)return{uri:r,isOnChain:!0,isEncoded:t};let n=Q9(e?.ipfs,"https://ipfs.io"),s=Q9(e?.arweave,"https://arweave.net"),i=r.match(Yq),{protocol:o,subpath:a,target:c,subtarget:u=""}=i?.groups||{},l=o==="ipns:/"||a==="ipns/",f=o==="ipfs:/"||a==="ipfs/"||Zq.test(r);if(r.startsWith("http")&&!l&&!f){let h=r;return e?.arweave&&(h=r.replace(/https:\/\/arweave.net/g,e?.arweave)),{uri:h,isOnChain:!1,isEncoded:!1}}if((l||f)&&c)return{uri:`${n}/${l?"ipns":"ipfs"}/${c}${u}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&c)return{uri:`${s}/${c}${u||""}`,isOnChain:!1,isEncoded:!1};let d=r.replace(eG,"");if(d.startsWith("<svg")&&(d=`data:image/svg+xml;base64,${btoa(d)}`),d.startsWith("data:")||d.startsWith("{"))return{uri:d,isOnChain:!0,isEncoded:!1};throw new ql({uri:r})}function $6(r){if(typeof r!="object"||!("image"in r)&&!("image_url"in r)&&!("image_data"in r))throw new Jg({data:r});return r.image||r.image_url||r.image_data}async function Y9({gatewayUrls:r,uri:e}){try{let t=await fetch(e).then(s=>s.json());return await Yg({gatewayUrls:r,uri:$6(t)})}catch{throw new ql({uri:e})}}async function Yg({gatewayUrls:r,uri:e}){let{uri:t,isOnChain:n}=H6({uri:e,gatewayUrls:r});if(n||await tG(t))return t;throw new ql({uri:e})}function Z9(r){let e=r;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));let[t,n,s]=e.split("/"),[i,o]=t.split(":"),[a,c]=n.split(":");if(!i||i.toLowerCase()!=="eip155")throw new pa({reason:"Only EIP-155 supported"});if(!o)throw new pa({reason:"Chain ID not found"});if(!c)throw new pa({reason:"Contract address not found"});if(!s)throw new pa({reason:"Token ID not found"});if(!a)throw new pa({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o),namespace:a.toLowerCase(),contractAddress:c,tokenID:s}}async function X9(r,{nft:e}){if(e.namespace==="erc721")return pr(r,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return pr(r,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new Qg({namespace:e.namespace})}async function eO(r,{gatewayUrls:e,record:t}){return/eip155:/i.test(t)?rG(r,{gatewayUrls:e,record:t}):Yg({uri:t,gatewayUrls:e})}async function rG(r,{gatewayUrls:e,record:t}){let n=Z9(t),s=await X9(r,{nft:n}),{uri:i,isOnChain:o,isEncoded:a}=H6({uri:s,gatewayUrls:e});if(o&&(i.includes("data:application/json;base64,")||i.startsWith("{"))){let u=a?atob(i.replace("data:application/json;base64,","")):i,l=JSON.parse(u);return Yg({uri:$6(l),gatewayUrls:e})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),Y9({gatewayUrls:e,uri:i.replace(/(?:0x)?{id}/,c)})}nc();rc();qo();ic();De();async function Zg(r,{blockNumber:e,blockTag:t,name:n,key:s,gatewayUrls:i,strict:o,universalResolverAddress:a}){let c=a;if(!c){if(!r.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=Jn({blockNumber:e,chain:r.chain,contract:"ensUniversalResolver"})}try{let u={address:c,abi:Mg,functionName:"resolve",args:[Ce(da(n)),Yr({abi:_6,functionName:"text",args:[$l(n),s]})],blockNumber:e,blockTag:t},l=ge(r,pr,"readContract"),f=i?await l({...u,args:[...u.args,i]}):await l(u);if(f[0]==="0x")return null;let d=Wn({abi:_6,functionName:"text",data:f[0]});return d===""?null:d}catch(u){if(o)throw u;if(Hl(u,"resolve"))return null;throw u}}async function tO(r,{blockNumber:e,blockTag:t,assetGatewayUrls:n,name:s,gatewayUrls:i,strict:o,universalResolverAddress:a}){let c=await ge(r,Zg,"getEnsText")({blockNumber:e,blockTag:t,key:"avatar",name:s,universalResolverAddress:a,gatewayUrls:i,strict:o});if(!c)return null;try{return await eO(r,{record:c,gatewayUrls:n})}catch{return null}}nc();ic();De();async function rO(r,{address:e,blockNumber:t,blockTag:n,gatewayUrls:s,strict:i,universalResolverAddress:o}){let a=o;if(!a){if(!r.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=Jn({blockNumber:t,chain:r.chain,contract:"ensUniversalResolver"})}let c=`${e.toLowerCase().substring(2)}.addr.reverse`;try{let u={address:a,abi:w9,functionName:"reverse",args:[Ce(da(c))],blockNumber:t,blockTag:n},l=ge(r,pr,"readContract"),[f,d]=s?await l({...u,args:[...u.args,s]}):await l(u);return e.toLowerCase()!==d.toLowerCase()?null:f}catch(u){if(i)throw u;if(Hl(u,"reverse"))return null;throw u}}ic();De();async function nO(r,{blockNumber:e,blockTag:t,name:n,universalResolverAddress:s}){let i=s;if(!i){if(!r.chain)throw new Error("client chain not configured. universalResolverAddress is required.");i=Jn({blockNumber:e,chain:r.chain,contract:"ensUniversalResolver"})}let[o]=await ge(r,pr,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Ce(da(n))],blockNumber:e,blockTag:t});return o}Dl();async function sO(r){let e=$o(r,{method:"eth_newBlockFilter"}),t=await r.request({method:"eth_newBlockFilter"});return{id:t,request:e(t),type:"block"}}De();async function Xg(r,{address:e,args:t,event:n,events:s,fromBlock:i,strict:o,toBlock:a}={}){let c=s??(n?[n]:void 0),u=$o(r,{method:"eth_newFilter"}),l=[];c&&(l=[c.flatMap(d=>ei({abi:[d],eventName:d.name,args:t}))],n&&(l=l[0]));let f=await r.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof i=="bigint"?Ae(i):i,toBlock:typeof a=="bigint"?Ae(a):a,...l.length?{topics:l}:{}}]});return{abi:c,args:t,eventName:n?n.name:void 0,fromBlock:i,id:f,request:u(f),strict:Boolean(o),toBlock:a,type:"event"}}async function ex(r){let e=$o(r,{method:"eth_newPendingTransactionFilter"}),t=await r.request({method:"eth_newPendingTransactionFilter"});return{id:t,request:e(t),type:"transaction"}}De();async function iO(r,{address:e,blockNumber:t,blockTag:n="latest"}){let s=t?Ae(t):void 0,i=await r.request({method:"eth_getBalance",params:[e,s||n]});return BigInt(i)}async function oO(r){let e=await r.request({method:"eth_blobBaseFee"});return BigInt(e)}Mr();De();async function aO(r,{blockHash:e,blockNumber:t,blockTag:n="latest"}={}){let s=t!==void 0?Ae(t):void 0,i;return e?i=await r.request({method:"eth_getBlockTransactionCountByHash",params:[e]},{dedupe:!0}):i=await r.request({method:"eth_getBlockTransactionCountByNumber",params:[s||n]},{dedupe:Boolean(s)}),ar(i)}De();async function q6(r,{address:e,blockNumber:t,blockTag:n="latest"}){let s=t!==void 0?Ae(t):void 0,i=await r.request({method:"eth_getCode",params:[e,s||n]},{dedupe:Boolean(s)});if(i!=="0x")return i}De();function cO(r){return{baseFeePerGas:r.baseFeePerGas.map(e=>BigInt(e)),gasUsedRatio:r.gasUsedRatio,oldestBlock:BigInt(r.oldestBlock),reward:r.reward?.map(e=>e.map(t=>BigInt(t)))}}async function uO(r,{blockCount:e,blockNumber:t,blockTag:n="latest",rewardPercentiles:s}){let i=t?Ae(t):void 0,o=await r.request({method:"eth_feeHistory",params:[Ae(e),i||n,s]},{dedupe:Boolean(i)});return cO(o)}async function lO(r,{filter:e}){let t=e.strict??!1,s=(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(i=>Xr(i));return e.abi?jl({abi:e.abi,logs:s,strict:t}):s}De();function fO(r){return{formatters:void 0,fees:void 0,serializers:void 0,...r}}var dO=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,pO=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;or();ji();Ys();Ks();De();Ya();Zs();De();Li();function hO(r){let{domain:e={},message:t,primaryType:n}=r,s={EIP712Domain:wO({domain:e}),...r.types};yO({domain:e,message:t,primaryType:n,types:s});let i=["0x1901"];return e&&i.push(nG({domain:e,types:s})),n!=="EIP712Domain"&&i.push(mO({data:t,primaryType:n,types:s})),Bt(jr(i))}function nG({domain:r,types:e}){return mO({data:r,primaryType:"EIP712Domain",types:e})}function mO({data:r,primaryType:e,types:t}){let n=bO({data:r,primaryType:e,types:t});return Bt(n)}function bO({data:r,primaryType:e,types:t}){let n=[{type:"bytes32"}],s=[sG({primaryType:e,types:t})];for(let i of t[e]){let[o,a]=xO({types:t,name:i.name,type:i.type,value:r[i.name]});n.push(o),s.push(a)}return As(n,s)}function sG({primaryType:r,types:e}){let t=Ce(iG({primaryType:r,types:e}));return Bt(t)}function iG({primaryType:r,types:e}){let t="",n=gO({primaryType:r,types:e});n.delete(r);let s=[r,...Array.from(n).sort()];for(let i of s)t+=`${i}(${e[i].map(({name:o,type:a})=>`${a} ${o}`).join(",")})`;return t}function gO({primaryType:r,types:e},t=new Set){let s=r.match(/^\w*/u)?.[0];if(t.has(s)||e[s]===void 0)return t;t.add(s);for(let i of e[s])gO({primaryType:i.type,types:e},t);return t}function xO({types:r,name:e,type:t,value:n}){if(r[t]!==void 0)return[{type:"bytes32"},Bt(bO({data:n,primaryType:t,types:r}))];if(t==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},Bt(n)];if(t==="string")return[{type:"bytes32"},Bt(Ce(n))];if(t.lastIndexOf("]")===t.length-1){let s=t.slice(0,t.lastIndexOf("[")),i=n.map(o=>xO({name:e,type:s,types:r,value:o}));return[{type:"bytes32"},Bt(As(i.map(([o])=>o),i.map(([,o])=>o)))]}return[{type:t},n]}function yO(r){let{domain:e,message:t,primaryType:n,types:s}=r,i=(o,a)=>{for(let c of o){let{name:u,type:l}=c,f=a[u],d=l.match(pO);if(d&&(typeof f=="number"||typeof f=="bigint")){let[p,g,m]=d;Ae(f,{signed:g==="int",size:Number.parseInt(m)/8})}if(l==="address"&&typeof f=="string"&&!Et(f))throw new St({address:f});let h=l.match(dO);if(h){let[p,g]=h;if(g&&rt(f)!==Number.parseInt(g))throw new Pb({expectedSize:Number.parseInt(g),givenSize:rt(f)})}let b=s[l];b&&i(b,f)}};s.EIP712Domain&&e&&i(s.EIP712Domain,e),n!=="EIP712Domain"&&i(s[n],t)}function wO({domain:r}){return[typeof r?.name=="string"&&{name:"name",type:"string"},r?.version&&{name:"version",type:"string"},typeof r?.chainId=="number"&&{name:"chainId",type:"uint256"},r?.verifyingContract&&{name:"verifyingContract",type:"address"},r?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}Je();Zb();Ar();De();function ha(r,e="hex"){let t=AO(r),n=fl(new Uint8Array(t.length));return t.encode(n),e==="hex"?tt(n.bytes):n.bytes}function AO(r){return Array.isArray(r)?oG(r.map(e=>AO(e))):aG(r)}function oG(r){let e=r.reduce((s,i)=>s+i.length,0),t=EO(e);return{length:(()=>e<=55?1+e:1+t+e)(),encode(s){e<=55?s.pushByte(192+e):(s.pushByte(192+55+t),t===1?s.pushUint8(e):t===2?s.pushUint16(e):t===3?s.pushUint24(e):s.pushUint32(e));for(let{encode:i}of r)i(s)}}}function aG(r){let e=typeof r=="string"?fn(r):r,t=EO(e.length);return{length:(()=>e.length===1&&e[0]<128?1:e.length<=55?1+e.length:1+t+e.length)(),encode(s){e.length===1&&e[0]<128?s.pushBytes(e):e.length<=55?(s.pushByte(128+e.length),s.pushBytes(e)):(s.pushByte(128+55+t),t===1?s.pushUint8(e.length):t===2?s.pushUint16(e.length):t===3?s.pushUint24(e.length):s.pushUint32(e.length),s.pushBytes(e))}}}function EO(r){if(r<2**8)return 1;if(r<2**16)return 2;if(r<2**24)return 3;if(r<2**32)return 4;throw new z("Length is too large.")}Mr();bg();var cG={"0x0":"reverted","0x1":"success"};function G6(r){let e={...r,blockNumber:r.blockNumber?BigInt(r.blockNumber):null,contractAddress:r.contractAddress?r.contractAddress:null,cumulativeGasUsed:r.cumulativeGasUsed?BigInt(r.cumulativeGasUsed):null,effectiveGasPrice:r.effectiveGasPrice?BigInt(r.effectiveGasPrice):null,gasUsed:r.gasUsed?BigInt(r.gasUsed):null,logs:r.logs?r.logs.map(t=>Xr(t)):null,to:r.to?r.to:null,transactionIndex:r.transactionIndex?ar(r.transactionIndex):null,status:r.status?cG[r.status]:null,type:r.type?P6[r.type]||r.type:null};return r.blobGasPrice&&(e.blobGasPrice=BigInt(r.blobGasPrice)),r.blobGasUsed&&(e.blobGasUsed=BigInt(r.blobGasUsed)),e}var vO=Sl("transactionReceipt",G6);Mr();var TO=`Ethereum Signed Message:
|
|
803
|
+
`;Zs();Ar();Li();function tx(r,e){let t=(()=>typeof r=="string"?Qr(r):r.raw instanceof Uint8Array?r.raw:Lr(r.raw))(),n=Qr(`${TO}${t.length}`);return Bt(jr([n,t]),e)}ji();Je();Lg();Bl();Ys();Ks();al();Mr();function PO(r){let{blobVersionedHashes:e}=r;if(e){if(e.length===0)throw new Rl;for(let t of e){let n=rt(t),s=ar(Ui(t,0,1));if(n!==32)throw new Sg({hash:t,size:n});if(s!==1)throw new Og({hash:t,version:s})}}z6(r)}function z6(r){let{chainId:e,maxPriorityFeePerGas:t,maxFeePerGas:n,to:s}=r;if(e<=0)throw new Fl({chainId:e});if(s&&!Et(s))throw new St({address:s});if(n&&n>2n**256n-1n)throw new Kn({maxFeePerGas:n});if(t&&n&&t>n)throw new ni({maxFeePerGas:n,maxPriorityFeePerGas:t})}function kO(r){let{chainId:e,maxPriorityFeePerGas:t,gasPrice:n,maxFeePerGas:s,to:i}=r;if(e<=0)throw new Fl({chainId:e});if(i&&!Et(i))throw new St({address:i});if(t||s)throw new z("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>2n**256n-1n)throw new Kn({maxFeePerGas:n})}function BO(r){let{chainId:e,maxPriorityFeePerGas:t,gasPrice:n,maxFeePerGas:s,to:i,accessList:o}=r;if(i&&!Et(i))throw new St({address:i});if(typeof e<"u"&&e<=0)throw new Fl({chainId:e});if(t||s)throw new z("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>2n**256n-1n)throw new Kn({maxFeePerGas:n});if(o)throw new z("`accessList` is not a valid Legacy Transaction attribute.")}ri();Zs();qd();De();ji();ri();Ys();function rx(r){if(!r||r.length===0)return[];let e=[];for(let t=0;t<r.length;t++){let{address:n,storageKeys:s}=r[t];for(let i=0;i<s.length;i++)if(s[i].length-2!==64)throw new cg({storageKey:s[i]});if(!Et(n,{strict:!1}))throw new St({address:n});e.push([n,s])}return e}function SO(r,e){let t=Cg(r);return t==="eip1559"?lG(r,e):t==="eip2930"?fG(r,e):t==="eip4844"?uG(r,e):dG(r,e)}function uG(r,e){let{chainId:t,gas:n,nonce:s,to:i,value:o,maxFeePerBlobGas:a,maxFeePerGas:c,maxPriorityFeePerGas:u,accessList:l,data:f}=r;PO(r);let d=r.blobVersionedHashes,h=r.sidecars;if(r.blobs&&(typeof d>"u"||typeof h>"u")){let E=typeof r.blobs[0]=="string"?r.blobs:r.blobs.map(w=>tt(w)),v=r.kzg,k=Nl({blobs:E,kzg:v});if(typeof d>"u"&&(d=kg({commitments:k})),typeof h>"u"){let w=Il({blobs:E,commitments:k,kzg:v});h=_g({blobs:E,commitments:k,proofs:w})}}let b=rx(l),p=[Ce(t),s?Ce(s):"0x",u?Ce(u):"0x",c?Ce(c):"0x",n?Ce(n):"0x",i??"0x",o?Ce(o):"0x",f??"0x",b,a?Ce(a):"0x",d??[],...V6(r,e)],g=[],m=[],y=[];if(h)for(let E=0;E<h.length;E++){let{blob:v,commitment:k,proof:w}=h[E];g.push(v),m.push(k),y.push(w)}return ws(["0x03",h?ha([p,g,m,y]):ha(p)])}function lG(r,e){let{chainId:t,gas:n,nonce:s,to:i,value:o,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:u,data:l}=r;z6(r);let f=rx(u),d=[Ce(t),s?Ce(s):"0x",c?Ce(c):"0x",a?Ce(a):"0x",n?Ce(n):"0x",i??"0x",o?Ce(o):"0x",l??"0x",f,...V6(r,e)];return ws(["0x02",ha(d)])}function fG(r,e){let{chainId:t,gas:n,data:s,nonce:i,to:o,value:a,accessList:c,gasPrice:u}=r;kO(r);let l=rx(c),f=[Ce(t),i?Ce(i):"0x",u?Ce(u):"0x",n?Ce(n):"0x",o??"0x",a?Ce(a):"0x",s??"0x",l,...V6(r,e)];return ws(["0x01",ha(f)])}function dG(r,e){let{chainId:t=0,gas:n,data:s,nonce:i,to:o,value:a,gasPrice:c}=r;BO(r);let u=[i?Ce(i):"0x",c?Ce(c):"0x",n?Ce(n):"0x",o??"0x",a?Ce(a):"0x",s??"0x"];if(e){let l=(()=>{if(e.v>=35n)return(e.v-35n)/2n>0?e.v:27n+(e.v===35n?0n:1n);if(t>0)return BigInt(t*2)+BigInt(35n+e.v-27n);let f=27n+(e.v===27n?0n:1n);if(e.v!==f)throw new og({v:e.v});return f})();u=[...u,Ce(l),e.r,e.s]}else t>0&&(u=[...u,Ce(t),"0x","0x"]);return ha(u)}function V6(r,e){let t=e??r,{v:n,yParity:s}=t;if(typeof t.r>"u")return[];if(typeof t.s>"u")return[];if(typeof n>"u"&&typeof s>"u")return[];let i=Qs(t.r),o=Qs(t.s);return[(()=>typeof s=="number"?s?Ce(1):"0x":n===0n?"0x":n===1n?Ce(1):n===27n?"0x":Ce(1))(),i==="0x00"?"0x":i,o==="0x00"?"0x":o]}function pG(r){return r.map(e=>({...e,value:BigInt(e.value)}))}function OO(r){return{...r,balance:r.balance?BigInt(r.balance):void 0,nonce:r.nonce?ar(r.nonce):void 0,storageProof:r.storageProof?pG(r.storageProof):void 0}}async function _O(r,{address:e,blockNumber:t,blockTag:n,storageKeys:s}){let i=n??"latest",o=t!==void 0?Ae(t):void 0,a=await r.request({method:"eth_getProof",params:[e,s,o||i]});return OO(a)}De();async function CO(r,{address:e,blockNumber:t,blockTag:n="latest",slot:s}){let i=t!==void 0?Ae(t):void 0;return await r.request({method:"eth_getStorageAt",params:[e,s,i||n]})}ri();De();async function Gl(r,{blockHash:e,blockNumber:t,blockTag:n,hash:s,index:i}){let o=n||"latest",a=t!==void 0?Ae(t):void 0,c=null;if(s?c=await r.request({method:"eth_getTransactionByHash",params:[s]},{dedupe:!0}):e?c=await r.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,Ae(i)]},{dedupe:!0}):(a||o)&&(c=await r.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[a||o,Ae(i)]},{dedupe:Boolean(a)})),!c)throw new pl({blockHash:e,blockNumber:t,blockTag:o,hash:s,index:i});return(r.chain?.formatters?.transaction?.format||tc)(c)}async function NO(r,{hash:e,transactionReceipt:t}){let[n,s]=await Promise.all([ge(r,oi,"getBlockNumber")({}),e?ge(r,Gl,"getTransaction")({hash:e}):void 0]),i=t?.blockNumber||s?.blockNumber;return i?n-i+1n:0n}ri();async function o0(r,{hash:e}){let t=await r.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!t)throw new hl({hash:e});return(r.chain?.formatters?.transactionReceipt?.format||G6)(t)}nc();or();Je();ec();rc();qo();ic();async function IO(r,e){let{allowFailure:t=!0,batchSize:n,blockNumber:s,blockTag:i,multicallAddress:o,stateOverride:a}=e,c=e.contracts,u=n??(typeof r.batch?.multicall=="object"&&r.batch.multicall.batchSize||1024),l=o;if(!l){if(!r.chain)throw new Error("client chain not configured. multicallAddress is required.");l=Jn({blockNumber:s,chain:r.chain,contract:"multicall3"})}let f=[[]],d=0,h=0;for(let g=0;g<c.length;g++){let{abi:m,address:y,args:E,functionName:v}=c[g];try{let k=Yr({abi:m,args:E,functionName:v});h+=(k.length-2)/2,u>0&&h>u&&f[d].length>0&&(d++,h=(k.length-2)/2,f[d]=[]),f[d]=[...f[d],{allowFailure:!0,callData:k,target:y}]}catch(k){let w=$i(k,{abi:m,address:y,args:E,docsPath:"/docs/contract/multicall",functionName:v});if(!t)throw w;f[d]=[...f[d],{allowFailure:!0,callData:"0x",target:y}]}}let b=await Promise.allSettled(f.map(g=>ge(r,pr,"readContract")({abi:t0,address:l,args:[g],blockNumber:s,blockTag:i,functionName:"aggregate3",stateOverride:a}))),p=[];for(let g=0;g<b.length;g++){let m=b[g];if(m.status==="rejected"){if(!t)throw m.reason;for(let E=0;E<f[g].length;E++)p.push({status:"failure",error:m.reason,result:void 0});continue}let y=m.value;for(let E=0;E<y.length;E++){let{returnData:v,success:k}=y[E],{callData:w}=f[g][E],{abi:P,address:B,functionName:Z,args:_}=c[p.length];try{if(w==="0x")throw new Ws;if(!k)throw new Go({data:v});let O=Wn({abi:P,args:_,data:v,functionName:Z});p.push(t?{result:O,status:"success"}:O)}catch(O){let S=$i(O,{abi:P,address:B,args:_,docsPath:"/docs/contract/multicall",functionName:Z});if(!t)throw S;p.push({error:S,result:void 0,status:"failure"})}}}if(p.length!==c.length)throw new z("multicall results mismatch");return p}nc();N6();ec();R6();Vl();Ar();gs();function jO(r,e){let t=Ft(r)?Lr(r):r,n=Ft(e)?Lr(e):e;return J6(t,n)}gs();De();e_();Mr();function t_({r,s:e,v:t,yParity:n}){let s=(()=>{if(n===0||n===1)return n;if(t&&(t===27n||t===28n||t>=35n))return t%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})();return`0x${new aA.Signature(dr(r),dr(e)).toCompactHex()}${s===0?"1b":"1c"}`}Dl();async function Kl(r,{address:e,hash:t,signature:n,...s}){let i=(()=>Ft(n)?n:typeof n=="object"&&"r"in n&&"s"in n?t_(n):tt(n))();try{let{data:o}=await ge(r,si,"call")({data:n0({abi:A9,args:[e,t,i],bytecode:k9}),...s});return jO(o??"0x0","0x1")}catch(o){if(o instanceof bl)return!1;throw o}}async function r_(r,{address:e,message:t,signature:n,...s}){let i=tx(t);return Kl(r,{address:e,hash:i,signature:n,...s})}async function n_(r,e){let{address:t,signature:n,message:s,primaryType:i,types:o,domain:a,...c}=e,u=hO({message:s,primaryType:i,types:o,domain:a});return Kl(r,{address:t,hash:u,signature:n,...c})}ri();dn();Mr();dn();function lx(r,{emitOnBegin:e=!1,emitMissed:t=!1,onBlockNumber:n,onError:s,poll:i,pollingInterval:o=r.pollingInterval}){let a=(()=>typeof i<"u"?i:!(r.transport.type==="webSocket"||r.transport.type==="fallback"&&r.transport.transports[0].config.type==="webSocket"))(),c;return a?(()=>{let f=nt(["watchBlockNumber",r.uid,e,t,o]);return en(f,{onBlockNumber:n,onError:s},d=>ii(async()=>{try{let h=await ge(r,oi,"getBlockNumber")({cacheTime:0});if(c){if(h===c)return;if(h-c>1&&t)for(let b=c+1n;b<h;b++)d.onBlockNumber(b,c),c=b}(!c||h>c)&&(d.onBlockNumber(h,c),c=h)}catch(h){d.onError?.(h)}},{emitOnBegin:e,interval:o}))})():(()=>{let f=nt(["watchBlockNumber",r.uid,e,t]);return en(f,{onBlockNumber:n,onError:s},d=>{let h=!0,b=()=>h=!1;return(async()=>{try{let p=(()=>{if(r.transport.type==="fallback"){let m=r.transport.transports.find(y=>y.config.type==="webSocket");return m?m.value:r.transport}return r.transport})(),{unsubscribe:g}=await p.subscribe({params:["newHeads"],onData(m){if(!h)return;let y=dr(m.result?.number);d.onBlockNumber(y,c),c=y},onError(m){d.onError?.(m)}});b=g,h||b()}catch(p){s?.(p)}})(),()=>b()})})()}async function s_(r,{confirmations:e=1,hash:t,onReplaced:n,pollingInterval:s=r.pollingInterval,retryCount:i=6,retryDelay:o=({count:c})=>~~(1<<c)*200,timeout:a}){let c=nt(["waitForTransactionReceipt",r.uid,t]),u=0,l,f,d,h=!1;return new Promise((b,p)=>{a&&setTimeout(()=>p(new Yd({hash:t})),a);let g=en(c,{onReplaced:n,resolve:b,reject:p},m=>{let y=ge(r,lx,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:s,async onBlockNumber(E){let v=w=>{y(),w(),g()},k=E;if(!h){u>i&&v(()=>m.reject(new Yd({hash:t})));try{if(d){if(e>1&&(!d.blockNumber||k-d.blockNumber+1n<e))return;v(()=>m.resolve(d));return}if(l||(h=!0,await i0(async()=>{l=await ge(r,Gl,"getTransaction")({hash:t}),l.blockNumber&&(k=l.blockNumber)},{delay:o,retryCount:i}),h=!1),d=await ge(r,o0,"getTransactionReceipt")({hash:t}),e>1&&(!d.blockNumber||k-d.blockNumber+1n<e))return;v(()=>m.resolve(d))}catch(w){if(w instanceof pl||w instanceof hl){if(!l){h=!1;return}try{f=l,h=!0;let P=await i0(()=>ge(r,Zr,"getBlock")({blockNumber:k,includeTransactions:!0}),{delay:o,retryCount:i,shouldRetry:({error:_})=>_ instanceof _l});h=!1;let B=P.transactions.find(({from:_,nonce:O})=>_===f.from&&O===f.nonce);if(!B||(d=await ge(r,o0,"getTransactionReceipt")({hash:B.hash}),e>1&&(!d.blockNumber||k-d.blockNumber+1n<e)))return;let Z="replaced";B.to===f.to&&B.value===f.value?Z="repriced":B.from===B.to&&B.value===0n&&(Z="cancelled"),v(()=>{m.onReplaced?.({reason:Z,replacedTransaction:f,transaction:B,transactionReceipt:d}),m.resolve(d)})}catch(P){v(()=>m.reject(P))}}else v(()=>m.reject(w))}finally{u++}}}})})})}dn();function i_(r,{blockTag:e="latest",emitMissed:t=!1,emitOnBegin:n=!1,onBlock:s,onError:i,includeTransactions:o,poll:a,pollingInterval:c=r.pollingInterval}){let u=(()=>typeof a<"u"?a:!(r.transport.type==="webSocket"||r.transport.type==="fallback"&&r.transport.transports[0].config.type==="webSocket"))(),l=o??!1,f;return u?(()=>{let b=nt(["watchBlocks",r.uid,e,t,n,l,c]);return en(b,{onBlock:s,onError:i},p=>ii(async()=>{try{let g=await ge(r,Zr,"getBlock")({blockTag:e,includeTransactions:l});if(g.number&&f?.number){if(g.number===f.number)return;if(g.number-f.number>1&&t)for(let m=f?.number+1n;m<g.number;m++){let y=await ge(r,Zr,"getBlock")({blockNumber:m,includeTransactions:l});p.onBlock(y,f),f=y}}(!f?.number||e==="pending"&&!g?.number||g.number&&g.number>f.number)&&(p.onBlock(g,f),f=g)}catch(g){p.onError?.(g)}},{emitOnBegin:n,interval:c}))})():(()=>{let b=!0,p=()=>b=!1;return(async()=>{try{let g=(()=>{if(r.transport.type==="fallback"){let y=r.transport.transports.find(E=>E.config.type==="webSocket");return y?y.value:r.transport}return r.transport})(),{unsubscribe:m}=await g.subscribe({params:["newHeads"],onData(y){if(!b)return;let v=(r.chain?.formatters?.block?.format||e0)(y.result);s(v,f),f=v},onError(y){i?.(y)}});p=m,b||p()}catch(g){i?.(g)}})(),()=>p()})()}dn();or();Xd();function o_(r,{address:e,args:t,batch:n=!0,event:s,events:i,fromBlock:o,onError:a,onLogs:c,poll:u,pollingInterval:l=r.pollingInterval,strict:f}){let d=(()=>typeof u<"u"?u:typeof o=="bigint"?!0:!(r.transport.type==="webSocket"||r.transport.type==="fallback"&&r.transport.transports[0].config.type==="webSocket"))(),h=f??!1;return d?(()=>{let g=nt(["watchEvent",e,t,n,r.uid,s,l,o]);return en(g,{onLogs:c,onError:a},m=>{let y;o!==void 0&&(y=o-1n);let E,v=!1,k=ii(async()=>{if(!v){try{E=await ge(r,Xg,"createEventFilter")({address:e,args:t,event:s,events:i,strict:h,fromBlock:o})}catch{}v=!0;return}try{let w;if(E)w=await ge(r,la,"getFilterChanges")({filter:E});else{let P=await ge(r,oi,"getBlockNumber")({});y&&y!==P?w=await ge(r,Ul,"getLogs")({address:e,args:t,event:s,events:i,fromBlock:y+1n,toBlock:P}):w=[],y=P}if(w.length===0)return;if(n)m.onLogs(w);else for(let P of w)m.onLogs([P])}catch(w){E&&w instanceof Vn&&(v=!1),m.onError?.(w)}},{emitOnBegin:!0,interval:l});return async()=>{E&&await ge(r,fa,"uninstallFilter")({filter:E}),k()}})})():(()=>{let g=!0,m=()=>g=!1;return(async()=>{try{let y=(()=>{if(r.transport.type==="fallback"){let w=r.transport.transports.find(P=>P.config.type==="webSocket");return w?w.value:r.transport}return r.transport})(),E=i??(s?[s]:void 0),v=[];E&&(v=[E.flatMap(w=>ei({abi:[w],eventName:w.name,args:t}))],s&&(v=v[0]));let{unsubscribe:k}=await y.subscribe({params:["logs",{address:e,topics:v}],onData(w){if(!g)return;let P=w.result;try{let{eventName:B,args:Z}=Ll({abi:E??[],data:P.data,topics:P.topics,strict:h}),_=Xr(P,{args:Z,eventName:B});c([_])}catch(B){let Z,_;if(B instanceof xs||B instanceof Js){if(f)return;Z=B.abiItem.name,_=B.abiItem.inputs?.some(S=>!("name"in S&&S.name))}let O=Xr(P,{args:_?[]:{},eventName:Z});c([O])}},onError(w){a?.(w)}});m=k,g||m()}catch(y){a?.(y)}})(),()=>m()})()}dn();function a_(r,{batch:e=!0,onError:t,onTransactions:n,poll:s,pollingInterval:i=r.pollingInterval}){return(typeof s<"u"?s:r.transport.type!=="webSocket")?(()=>{let u=nt(["watchPendingTransactions",r.uid,e,i]);return en(u,{onTransactions:n,onError:t},l=>{let f,d=ii(async()=>{try{if(!f)try{f=await ge(r,ex,"createPendingTransactionFilter")({});return}catch(b){throw d(),b}let h=await ge(r,la,"getFilterChanges")({filter:f});if(h.length===0)return;if(e)l.onTransactions(h);else for(let b of h)l.onTransactions([b])}catch(h){l.onError?.(h)}},{emitOnBegin:!0,interval:i});return async()=>{f&&await ge(r,fa,"uninstallFilter")({filter:f}),d()}})})():(()=>{let u=!0,l=()=>u=!1;return(async()=>{try{let{unsubscribe:f}=await r.transport.subscribe({params:["newPendingTransactions"],onData(d){if(!u)return;let h=d.result;n([h])},onError(d){t?.(d)}});l=f,u||l()}catch(f){t?.(f)}})(),()=>l()})()}function c_(r){let{scheme:e,statement:t,...n}=r.match(HG)?.groups??{},{chainId:s,expirationTime:i,issuedAt:o,notBefore:a,requestId:c,...u}=r.match($G)?.groups??{},l=r.split("Resources:")[1]?.split(`
|
|
804
|
+
- `).slice(1);return{...n,...u,...s?{chainId:Number(s)}:{},...i?{expirationTime:new Date(i)}:{},...o?{issuedAt:new Date(o)}:{},...a?{notBefore:new Date(a)}:{},...c?{requestId:c}:{},...l?{resources:l}:{},...e?{scheme:e}:{},...t?{statement:t}:{}}}var HG=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,$G=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;j6();function u_(r){let{address:e,domain:t,message:n,nonce:s,scheme:i,time:o=new Date}=r;if(t&&n.domain!==t||s&&n.nonce!==s||i&&n.scheme!==i||n.expirationTime&&o>=n.expirationTime||n.notBefore&&o<n.notBefore)return!1;try{if(!n.address||e&&!Hg(n.address,e))return!1}catch{return!1}return!0}async function l_(r,e){let{address:t,domain:n,message:s,nonce:i,scheme:o,signature:a,time:c=new Date,...u}=e,l=c_(s);if(!l.address||!u_({address:t,domain:n,message:l,nonce:i,scheme:o,time:c}))return!1;let d=tx(s);return Kl(r,{address:l.address,hash:d,signature:a,...u})}function f_(r){return{call:e=>si(r,e),createBlockFilter:()=>sO(r),createContractEventFilter:e=>Wb(r,e),createEventFilter:e=>Xg(r,e),createPendingTransactionFilter:()=>ex(r),estimateContractGas:e=>g9(r,e),estimateGas:e=>Ml(r,e),getBalance:e=>iO(r,e),getBlobBaseFee:()=>oO(r),getBlock:e=>Zr(r,e),getBlockNumber:e=>oi(r,e),getBlockTransactionCount:e=>aO(r,e),getBytecode:e=>q6(r,e),getChainId:()=>Ng(r),getCode:e=>q6(r,e),getContractEvents:e=>Rg(r,e),getEip712Domain:e=>D9(r,e),getEnsAddress:e=>J9(r,e),getEnsAvatar:e=>tO(r,e),getEnsName:e=>rO(r,e),getEnsResolver:e=>nO(r,e),getEnsText:e=>Zg(r,e),getFeeHistory:e=>uO(r,e),estimateFeesPerGas:e=>d9(r,e),getFilterChanges:e=>la(r,e),getFilterLogs:e=>lO(r,e),getGasPrice:()=>Cl(r),getLogs:e=>Ul(r,e),getProof:e=>_O(r,e),estimateMaxPriorityFeePerGas:e=>f9(r,e),getStorageAt:e=>CO(r,e),getTransaction:e=>Gl(r,e),getTransactionConfirmations:e=>NO(r,e),getTransactionCount:e=>vg(r,e),getTransactionReceipt:e=>o0(r,e),multicall:e=>IO(r,e),prepareTransactionRequest:e=>Ig(r,e),readContract:e=>pr(r,e),sendRawTransaction:e=>F9(r,e),simulateContract:e=>R9(r,e),verifyMessage:e=>r_(r,e),verifySiweMessage:e=>l_(r,e),verifyTypedData:e=>n_(r,e),uninstallFilter:e=>fa(r,e),waitForTransactionReceipt:e=>s_(r,e),watchBlocks:e=>i_(r,e),watchBlockNumber:e=>lx(r,e),watchContractEvent:e=>U9(r,e),watchEvent:e=>o_(r,e),watchPendingTransactions:e=>a_(r,e)}}function cA(r){let{key:e="public",name:t="Public Client"}=r;return H9({...r,key:e,name:t,type:"publicClient"}).extend(f_)}var d_={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}};Mr();var p_={block:l9({format(r){return{transactions:r.transactions?.map(t=>{if(typeof t=="string")return t;let n=tc(t);return n.typeHex==="0x7e"&&(n.isSystemTx=t.isSystemTx,n.mint=t.mint?dr(t.mint):void 0,n.sourceHash=t.sourceHash,n.type="deposit"),n}),stateRoot:r.stateRoot}}}),transaction:u9({format(r){let e={};return r.type==="0x7e"&&(e.isSystemTx=r.isSystemTx,e.mint=r.mint?dr(r.mint):void 0,e.sourceHash=r.sourceHash,e.type="deposit"),e}}),transactionReceipt:vO({format(r){return{l1GasPrice:r.l1GasPrice?dr(r.l1GasPrice):null,l1GasUsed:r.l1GasUsed?dr(r.l1GasUsed):null,l1Fee:r.l1Fee?dr(r.l1Fee):null,l1FeeScalar:r.l1FeeScalar?Number(r.l1FeeScalar):null}}})};ji();Ys();Zs();De();function qG(r,e){return zG(r)?GG(r):SO(r,e)}var h_={transaction:qG};function GG(r){VG(r);let{sourceHash:e,data:t,from:n,gas:s,isSystemTx:i,mint:o,to:a,value:c}=r,u=[e,n,a??"0x",o?Ce(o):"0x",c?Ce(c):"0x",s?Ce(s):"0x",i?"0x1":"0x",t??"0x"];return ws(["0x7e",ha(u)])}function zG(r){return r.type==="deposit"||typeof r.sourceHash<"u"}function VG(r){let{from:e,to:t}=r;if(e&&!Et(e))throw new St({address:e});if(t&&!Et(t))throw new St({address:t})}var uA={contracts:d_,formatters:p_,serializers:h_};var c0=1,lA=fO({...uA,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...uA.contracts,disputeGameFactory:{[c0]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[c0]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[c0]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[c0]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:c0});var KG=Object.defineProperty,WG=(r,e,t)=>e in r?KG(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,m_=(r,e,t)=>(WG(r,typeof e!="symbol"?e+"":e,t),t),cr=class extends Error{constructor(r,e){let t;typeof e=="string"?t={message:e}:e instanceof Error?t={cause:e,message:e.message}:t=e,t.message||(t.message=t.cause?.message||""),super(t.message,{cause:t.cause}),m_(this,"errCode"),m_(this,"presentable",!1),this.name="AuthClientError",this.errCode=r}},fx=r=>r.isErr()?{error:r.error,isError:!0}:{...r.value,isError:!1},QG={interval:1e3,timeout:1e4,successCode:200,onResponse:()=>{}},x_=async(r,e,t)=>bt.fromPromise(fetch(y_(r,e),{headers:w_(t)}),n=>new cr("unknown",n)).andThen(n=>bt.fromPromise(n.json(),s=>new cr("unknown",s)).andThen(s=>Pt({response:n,data:s}))),YG=async(r,e,t,n)=>bt.fromPromise(fetch(y_(r,e),{method:"POST",body:JSON.stringify(t),headers:w_(n)}),s=>new cr("unknown",s)).andThen(s=>bt.fromPromise(s.json(),i=>new cr("unknown",i)).andThen(i=>Pt({response:s,data:i}))),ZG=async(r,e,t,n)=>{let{timeout:s,interval:i,successCode:o,onResponse:a}={...QG,...t},c=Date.now()+s;for(;Date.now()<c;){let u=await x_(r,e,n);if(u.isOk()){let{response:l}=u.value;if(l.status===o)return Pt(u.value);a(u.value),await new Promise(f=>setTimeout(f,i))}else return at(u.error)}return at(new cr("unavailable",`Polling timed out after ${s}ms`))},y_=(r,e)=>`${r.config.relay}/${r.config.version}/${e}`,w_=r=>{let e={...r?.headers};return r?.authToken&&(e.Authorization=`Bearer ${r.authToken}`),{...e,"Content-Type":"application/json"}},XG="channel",ez=async(r,{...e})=>{let t=await YG(r,XG,e);return fx(t)},tz="channel/status",rz=async(r,{channelToken:e})=>{let t=await x_(r,tz,{authToken:e});return fx(t)},b_="Farcaster Auth",g_=10,fA=/^farcaster:\/\/fid\/([1-9]\d*)\/?$/,nz=r=>Rd.fromThrowable(()=>new E_.SiweMessage(r),e=>new cr("bad_request.validation_failure",e))().andThen(oz).andThen(az).andThen(cz),sz=r=>{let e=iz(r);return e.isErr()?at(e.error):Pt({fid:e.value})},iz=r=>{let e=(r.resources??[]).find(n=>fA.test(n));if(!e)return at(new cr("bad_request.validation_failure","No fid resource provided"));let t=parseInt(e.match(fA)?.[1]??"");return isNaN(t)?at(new cr("bad_request.validation_failure","Invalid fid")):Pt(t)},oz=r=>r.statement===b_||r.statement==="Farcaster Connect"?Pt(r):at(new cr("bad_request.validation_failure",`Statement must be '${b_}'`)),az=r=>r.chainId!==g_?at(new cr("bad_request.validation_failure",`Chain ID must be ${g_}`)):Pt(r),cz=r=>{let e=(r.resources??[]).filter(t=>fA.test(t));return e.length===0?at(new cr("bad_request.validation_failure","No fid resource provided")):e.length>1?at(new cr("bad_request.validation_failure","Multiple fid resources provided")):Pt(r)},uz=r=>Promise.reject(new Error("Not implemented: Must provide an fid verifier")),lz=async(r,e,t,n,s={getFid:uz})=>{let{getFid:i,provider:o}=s,a=nz(t).andThen(d=>fz(d,r)).andThen(d=>dz(d,e));if(a.isErr())return at(a.error);let c=(await pz(a.value,n,o)).andThen(mz);if(c.isErr())return at(c.error);if(!c.value.success){let d=c.value.error?.type??"Failed to verify SIWE message";return at(new cr("unauthorized",d))}let u=await hz(c.value,i);if(u.isErr())return at(u.error);if(!u.value.success){let d=c.value.error?.type??"Failed to validate fid owner";return at(new cr("unauthorized",d))}let{error:l,...f}=u.value;return Pt(f)},fz=(r,e)=>r.nonce!==e?at(new cr("unauthorized","Invalid nonce")):Pt(r),dz=(r,e)=>r.domain!==e?at(new cr("unauthorized","Invalid domain")):Pt(r),pz=async(r,e,t)=>bt.fromPromise(r.verify({signature:e},{provider:t,suppressExceptions:!0}),n=>new cr("unauthorized",n)),hz=async(r,e)=>{let t=r.data.address;return bt.fromPromise(e(t),n=>new cr("unavailable",n)).andThen(n=>(n!==BigInt(r.fid)&&(r.success=!1,r.error=new A_.SiweError(`Invalid resource: signer ${t} does not own fid ${r.fid}.`,r.fid.toString(),n.toString())),Pt(r)))},mz=r=>sz(r.data).andThen(e=>Pt({...e,...r})),bz=async(r,{nonce:e,domain:t,message:n,signature:s},i)=>{let o=await lz(e,t,n,s,{getFid:r.ethereum.getFid,provider:i});return fx(o)},gz="channel/status",xz=()=>{},yz=async(r,e)=>{let t=await ZG(r,gz,{timeout:e?.timeout??3e5,interval:e?.interval??1e3,onResponse:e?.onResponse??xz},{authToken:e.channelToken});return fx(t)};var wz={relay:"https://relay.farcaster.xyz",version:"v1"},Az=({ethereum:r,...e})=>({config:{...wz,...e},ethereum:r}),v_=(r,e)=>{let t=Az(r);return{...t,createChannel:n=>ez(t,n),status:n=>rz(t,n),watchStatus:n=>yz(t,n),verifySignInMessage:n=>bz(t,n,e)}};var Ez=[{inputs:[{internalType:"address",name:"_migrator",type:"address"},{internalType:"address",name:"_initialOwner",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"AlreadyMigrated",type:"error"},{inputs:[],name:"GatewayFrozen",type:"error"},{inputs:[],name:"HasId",type:"error"},{inputs:[],name:"HasNoId",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"currentNonce",type:"uint256"}],name:"InvalidAccountNonce",type:"error"},{inputs:[],name:"InvalidShortString",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"OnlyGuardian",type:"error"},{inputs:[],name:"OnlyMigrator",type:"error"},{inputs:[],name:"PermissionRevoked",type:"error"},{inputs:[],name:"SignatureExpired",type:"error"},{inputs:[{internalType:"string",name:"str",type:"string"}],name:"StringTooLong",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"guardian",type:"address"}],name:"Add",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"fid",type:"uint256"}],name:"AdminReset",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"id",type:"uint256"},{indexed:!0,internalType:"address",name:"recovery",type:"address"}],name:"ChangeRecoveryAddress",type:"event"},{anonymous:!1,inputs:[],name:"EIP712DomainChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"idGateway",type:"address"}],name:"FreezeIdGateway",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"migratedAt",type:"uint256"}],name:"Migrated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferStarted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Paused",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"Recover",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"address",name:"recovery",type:"address"}],name:"Register",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"guardian",type:"address"}],name:"Remove",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"oldCounter",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newCounter",type:"uint256"}],name:"SetIdCounter",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldIdGateway",type:"address"},{indexed:!1,internalType:"address",name:"newIdGateway",type:"address"}],name:"SetIdGateway",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldMigrator",type:"address"},{indexed:!1,internalType:"address",name:"newMigrator",type:"address"}],name:"SetMigrator",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Unpaused",type:"event"},{inputs:[],name:"CHANGE_RECOVERY_ADDRESS_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"TRANSFER_AND_CHANGE_RECOVERY_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"TRANSFER_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"VERSION",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"acceptOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"guardian",type:"address"}],name:"addGuardian",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"uint24",name:"fid",type:"uint24"},{internalType:"address",name:"custody",type:"address"},{internalType:"address",name:"recovery",type:"address"}],internalType:"struct IIdRegistry.BulkRegisterData[]",name:"ids",type:"tuple[]"}],name:"bulkRegisterIds",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"uint24",name:"fid",type:"uint24"},{internalType:"address",name:"custody",type:"address"}],internalType:"struct IIdRegistry.BulkRegisterDefaultRecoveryData[]",name:"ids",type:"tuple[]"},{internalType:"address",name:"recovery",type:"address"}],name:"bulkRegisterIdsWithDefaultRecovery",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint24[]",name:"ids",type:"uint24[]"}],name:"bulkResetIds",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"recovery",type:"address"}],name:"changeRecoveryAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"recovery",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bytes",name:"sig",type:"bytes"}],name:"changeRecoveryAddressFor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"fid",type:"uint256"}],name:"custodyOf",outputs:[{internalType:"address",name:"custody",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"domainSeparatorV4",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{internalType:"bytes1",name:"fields",type:"bytes1"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256[]",name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"freezeIdGateway",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"gatewayFrozen",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"gracePeriod",outputs:[{internalType:"uint24",name:"",type:"uint24"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"guardian",type:"address"}],name:"guardians",outputs:[{internalType:"bool",name:"isGuardian",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"structHash",type:"bytes32"}],name:"hashTypedDataV4",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"idCounter",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"idGateway",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"idOf",outputs:[{internalType:"uint256",name:"fid",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"isMigrated",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"migrate",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"migratedAt",outputs:[{internalType:"uint40",name:"",type:"uint40"}],stateMutability:"view",type:"function"},{inputs:[],name:"migrator",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"pause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"pendingOwner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bytes",name:"sig",type:"bytes"}],name:"recover",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"recoveryDeadline",type:"uint256"},{internalType:"bytes",name:"recoverySig",type:"bytes"},{internalType:"uint256",name:"toDeadline",type:"uint256"},{internalType:"bytes",name:"toSig",type:"bytes"}],name:"recoverFor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"fid",type:"uint256"}],name:"recoveryOf",outputs:[{internalType:"address",name:"recovery",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"address",name:"recovery",type:"address"}],name:"register",outputs:[{internalType:"uint256",name:"fid",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"guardian",type:"address"}],name:"removeGuardian",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_counter",type:"uint256"}],name:"setIdCounter",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_idGateway",type:"address"}],name:"setIdGateway",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_migrator",type:"address"}],name:"setMigrator",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bytes",name:"sig",type:"bytes"}],name:"transfer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"address",name:"recovery",type:"address"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bytes",name:"sig",type:"bytes"}],name:"transferAndChangeRecovery",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"address",name:"recovery",type:"address"},{internalType:"uint256",name:"fromDeadline",type:"uint256"},{internalType:"bytes",name:"fromSig",type:"bytes"},{internalType:"uint256",name:"toDeadline",type:"uint256"},{internalType:"bytes",name:"toSig",type:"bytes"}],name:"transferAndChangeRecoveryFor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"fromDeadline",type:"uint256"},{internalType:"bytes",name:"fromSig",type:"bytes"},{internalType:"uint256",name:"toDeadline",type:"uint256"},{internalType:"bytes",name:"toSig",type:"bytes"}],name:"transferFor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"unpause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"useNonce",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"custodyAddress",type:"address"},{internalType:"uint256",name:"fid",type:"uint256"},{internalType:"bytes32",name:"digest",type:"bytes32"},{internalType:"bytes",name:"sig",type:"bytes"}],name:"verifyFidSignature",outputs:[{internalType:"bool",name:"isValid",type:"bool"}],stateMutability:"view",type:"function"}],vz="0x00000000Fc6c5F01Fc30151999387Bb99A9f489b",T_=r=>{let e=cA({chain:lA,transport:D6(r?.rpcUrl)});return{getFid:async n=>e.readContract({address:vz,abi:Ez,functionName:"idOf",args:[n]})}};function Tz(){return typeof navigator!="undefined"&&/android/i.test(navigator.userAgent)}function Pz(){return typeof navigator!="undefined"&&/iPhone|iPod/.test(navigator.userAgent)}function kz(){return typeof navigator!="undefined"&&(/iPad/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function Bz(){return Pz()||kz()}function dA(){return Tz()||Bz()}var P_={CHANNEL:"channel",DONE:"done",ERROR:"error"},Sz=r=>typeof r=="function",Oz=r=>typeof r=="function",_z="https://relay.farcaster.xyz",Cz="https://example.com/login",Nz=6e4,Iz=500,pA=class extends dx.Extension.Internal{constructor(){super(...arguments);this.name="farcaster";this.config={};this.login=({showUI:t})=>{let n=v_({relay:_z,ethereum:T_()}),s=n.createChannel({siweUri:Cz,domain:window.location.host}),i=s.then(({data:f})=>n.watchStatus({channelToken:f.channelToken,timeout:Nz,interval:Iz}).then(d=>{if(d.isError)throw d.error;return d})),o=null,a,c,u;dA()&&(console.info("Info: showUI parameter is ignored on mobile, open URL directly"),o=window.open());let l={on:(f,d)=>(f==="channel"&&bx(this,null,function*(){let{data:h}=yield s;!Sz(d)||(d(h),u=h.channelToken,dA()&&(o==null||o.location.assign(h.url)),a=this.utils.createJsonRpcRequestPayload("farcaster_show_QR",[{data:gA({showUI:t},h)}]),c=this.request(a))}),f===P_.DONE&&bx(this,null,function*(){let{data:h}=yield i;h.state==="completed"&&(this.createIntermediaryEvent(dx.FarcasterLoginEventEmit.SuccessSignIn,a.id)({channel_token:u,message:h.message,signature:h.signature,fid:h.fid,username:h.username}),yield c,Oz(d)&&(o==null||o.close(),d(h)))}),f===P_.ERROR&&i.catch(h=>{o==null||o.close(),d(h)}),l)};return l}}};return C_(Rz);})();
|
|
805
805
|
if (MagicFarcasterExtension && MagicFarcasterExtension.default != null) { MagicFarcasterExtension = Object.assign(MagicFarcasterExtension.default, MagicFarcasterExtension); delete MagicFarcasterExtension.default; }
|