PageSourceSearch

https://fhepayroll.netlify.app/assets/index-Dhluypqn.js

js fhepayroll.netlify.app collected 2026-10-03 10:44:06 UTC 639,918 bytes, 47 lines download raw bytes

1import{r as Yv,n as Jv}from"./index-DUmKJXH-.js";import{r as Xv}from"./index-My90LZL7.js";import{r as Qv}from"./events-DQ172AOg.js";function $v(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function e6(){if(typeof WebSocket<"u")return WebSocket;if(typeof global.WebSocket<"u")return global.WebSocket;if(typeof window.WebSocket<"u")return window.WebSocket;if(typeof self.WebSocket<"u")return self.WebSocket;throw new Error("`WebSocket` is not supported in this environment")}const t6=e6(),r6=Object.freeze(Object.defineProperty({__proto__:null,WebSocket:t6},Symbol.toStringTag,{value:"Module"}));var Od={},Un={},Ft={},sn={},Or={},zn={},Dn={},A0;function Ap(){if(A0)return Dn;A0=1,Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.getSDKVersion=void 0;const e=()=>"9.1.0";return Dn.getSDKVersion=e,Dn}var Gn={},T0;function n6(){if(T0)return Gn;T0=1,Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.generateRequestId=void 0;const e=r=>r.toString(16).padStart(2,"0"),t=r=>{const s=new Uint8Array(r/2);return window.crypto.getRandomValues(s),Array.from(s,e).join("")},n=()=>typeof window<"u"?t(10):new Date().getTime().toString(36);return Gn.generateRequestId=n,Gn}var S0;function Tp(){if(S0)return zn;S0=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.MessageFormatter=void 0;const e=Ap(),t=n6();class n{}return zn.MessageFormatter=n,n.makeRequest=(r,s)=>({id:(0,t.generateRequestId)(),method:r,params:s,env:{sdkVersion:(0,e.getSDKVersion)()}}),n.makeResponse=(r,s,a)=>({id:r,success:!0,version:a,data:s}),n.makeErrorResponse=(r,s,a)=>({id:r,success:!1,error:s,version:a}),zn}var Cr={},I0;function Jr(){if(I0)return Cr;I0=1,Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.RestrictedMethods=Cr.Methods=void 0;var e;(function(n){n.sendTransactions="sendTransactions",n.rpcCall="rpcCall",n.getChainInfo="getChainInfo",n.getSafeInfo="getSafeInfo",n.getTxBySafeTxHash="getTxBySafeTxHash",n.getSafeBalances="getSafeBalances",n.signMessage="signMessage",n.signTypedMessage="signTypedMessage",n.getEnvironmentInfo="getEnvironmentInfo",n.getOffChainSignature="getOffChainSignature",n.requestAddressBook="requestAddressBook",n.wallet_getPermissions="wallet_getPermissions",n.wallet_requestPermissions="wallet_requestPermissions"})(e||(Cr.Methods=e={}));var t;return(function(n){n.requestAddressBook="requestAddressBook"})(t||(Cr.RestrictedMethods=t={})),Cr}var B0;function o6(){return B0||(B0=1,(function(e){var t=Or&&Or.__createBinding||(Object.create?(function(a,o,c,u){u===void 0&&(u=c);var d=Object.getOwnPropertyDescriptor(o,c);(!d||("get"in d?!o.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return o[c]}}),Object.defineProperty(a,u,d)}):(function(a,o,c,u){u===void 0&&(u=c),a[u]=o[c]})),n=Or&&Or.__exportStar||function(a,o){for(var c in a)c!=="default"&&!Object.prototype.hasOwnProperty.call(o,c)&&t(o,a,c)};Object.defineProperty(e,"__esModule",{value:!0});const r=Tp();class s{constructor(o=null,c=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer=typeof window>"u",this.isValidMessage=({origin:u,data:d,source:l})=>{const f=!d,b=!this.isServer&&l===window.parent,T=typeof d.version<"u"&&parseInt(d.version.split(".")[0]),v=typeof T=="number"&&T>=1;let p=!0;return Array.isArray(this.allowedOrigins)&&(p=this.allowedOrigins.find(O=>O.test(u))!==void 0),!f&&b&&v&&p},this.logIncomingMessage=u=>{console.info(`Safe Apps SDK v1: A message was received from origin ${u.origin}. `,u.data)},this.onParentMessage=u=>{this.isValidMessage(u)&&(this.debugMode&&this.logIncomingMessage(u),this.handleIncomingMessage(u.data))},this.handleIncomingMessage=u=>{const{id:d}=u,l=this.callbacks.get(d);l&&(l(u),this.callbacks.delete(d))},this.send=(u,d)=>{const l=r.MessageFormatter.makeRequest(u,d);if(this.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(l,"*"),new Promise((f,b)=>{this.callbacks.set(l.id,T=>{if(!T.success){b(new Error(T.error));return}f(T)})})},this.allowedOrigins=o,this.debugMode=c,this.isServer||window.addEventListener("message",this.onParentMessage)}}e.default=s,n(Jr(),e)})(Or)),Or}var Vn={},qr={},Wn={},x0;function i6(){if(x0)return Wn;x0=1,Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.isObjectEIP712TypedData=void 0;const e=t=>typeof t=="object"&&t!=null&&"domain"in t&&"types"in t&&"message"in t;return Wn.isObjectEIP712TypedData=e,Wn}var Cd={},R0;function s6(){return R0||(R0=1,Object.defineProperty(Cd,"__esModule",{value:!0})),Cd}var qd={},O0;function a6(){return O0||(O0=1,(function(e){Object.defineProperty(e,"__esMo
1dule",{value:!0}),e.TransferDirection=e.TransactionStatus=e.TokenType=e.Operation=void 0;var t=Xv();Object.defineProperty(e,"Operation",{enumerable:!0,get:function(){return t.Operation}}),Object.defineProperty(e,"TokenType",{enumerable:!0,get:function(){return t.TokenType}}),Object.defineProperty(e,"TransactionStatus",{enumerable:!0,get:function(){return t.TransactionStatus}}),Object.defineProperty(e,"TransferDirection",{enumerable:!0,get:function(){return t.TransferDirection}})})(qd)),qd}var Hd={},C0;function c6(){return C0||(C0=1,Object.defineProperty(Hd,"__esModule",{value:!0}),Jr()),Hd}var q0;function mf(){return q0||(q0=1,(function(e){var t=qr&&qr.__createBinding||(Object.create?(function(r,s,a,o){o===void 0&&(o=a);var c=Object.getOwnPropertyDescriptor(s,a);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[a]}}),Object.defineProperty(r,o,c)}):(function(r,s,a,o){o===void 0&&(o=a),r[o]=s[a]})),n=qr&&qr.__exportStar||function(r,s){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(s,a)&&t(s,r,a)};Object.defineProperty(e,"__esModule",{value:!0}),n(i6(),e),n(s6(),e),n(a6(),e),n(c6(),e)})(qr)),qr}var H0;function u6(){if(H0)return Vn;H0=1,Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.TXs=void 0;const e=Jr(),t=mf();class n{constructor(s){this.communicator=s}async getBySafeTxHash(s){if(!s)throw new Error("Invalid safeTxHash");return(await this.communicator.send(e.Methods.getTxBySafeTxHash,{safeTxHash:s})).data}async signMessage(s){const a={message:s};return(await this.communicator.send(e.Methods.signMessage,a)).data}async signTypedMessage(s){if(!(0,t.isObjectEIP712TypedData)(s))throw new Error("Invalid typed data");return(await this.communicator.send(e.Methods.signTypedMessage,{typedData:s})).data}async send({txs:s,params:a}){if(!s||!s.length)throw new Error("No transactions were passed");const o={txs:s,params:a};return(await this.communicator.send(e.Methods.sendTransactions,o)).data}}return Vn.TXs=n,Vn}var Kn={},Zn={},M0;function hf(){return M0||(M0=1,Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.RPC_CALLS=void 0,Zn.RPC_CALLS={eth_call:"eth_call",eth_gasPrice:"eth_gasPrice",eth_getLogs:"eth_getLogs",eth_getBalance:"eth_getBalance",eth_getCode:"eth_getCode",eth_getBlockByHash:"eth_getBlockByHash",eth_getBlockByNumber:"eth_getBlockByNumber",eth_getStorageAt:"eth_getStorageAt",eth_getTransactionByHash:"eth_getTransactionByHash",eth_getTransactionReceipt:"eth_getTransactionReceipt",eth_getTransactionCount:"eth_getTransactionCount",eth_estimateGas:"eth_estimateGas",safe_setSettings:"safe_setSettings"}),Zn}var k0;function d6(){if(k0)return Kn;k0=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.Eth=void 0;const e=hf(),t=Jr(),n={defaultBlockParam:(s="latest")=>s,returnFullTxObjectParam:(s=!1)=>s,blockNumberToHex:s=>Number.isInteger(s)?`0x${s.toString(16)}`:s};class r{constructor(a){this.communicator=a,this.call=this.buildRequest({call:e.RPC_CALLS.eth_call,formatters:[null,n.defaultBlockParam]}),this.getBalance=this.buildRequest({call:e.RPC_CALLS.eth_getBalance,formatters:[null,n.defaultBlockParam]}),this.getCode=this.buildRequest({call:e.RPC_CALLS.eth_getCode,formatters:[null,n.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:e.RPC_CALLS.eth_getStorageAt,formatters:[null,n.blockNumberToHex,n.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:e.RPC_CALLS.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:e.RPC_CALLS.eth_getBlockByHash,formatters:[null,n.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:e.RPC_CALLS.eth_getBlockByNumber,formatters:[n.blockNumberToHex,n.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:e.RPC_CALLS.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:e.RPC_CALLS.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:e.RPC_CALLS.eth_getTransactionCount,formatters:[null,n.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:e.RPC_CALLS.eth_gasPrice}),this.getEstimateGas=o=>this.buildRequest({call:e.RPC_CALLS.eth_estimateGas})([o]),this.setSafeSettings=this.buildRequest({call:e.RPC_CALLS.safe_setSettings})}buildRequest(a){const{call:o,formatters:c}=a;return async u=>
1{c&&Array.isArray(u)&&c.forEach((f,b)=>{f&&(u[b]=f(u[b]))});const d={call:o,params:u||[]};return(await this.communicator.send(t.Methods.rpcCall,d)).data}}}return Kn.Eth=r,Kn}var Lt={},Md={},kd={},Yn={},Jn={},N0;function f6(){return N0||(N0=1,Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.version=void 0,Jn.version="1.2.3"),Jn}var F0;function Sn(){if(F0)return Yn;F0=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.BaseError=void 0;const e=f6();class t extends Error{constructor(r,s={}){const a=s.cause instanceof t?s.cause.details:s.cause?.message?s.cause.message:s.details,o=s.cause instanceof t&&s.cause.docsPath||s.docsPath,c=[r||"An error occurred.","",...s.metaMessages?[...s.metaMessages,""]:[],...o?[`Docs: https://abitype.dev${o}`]:[],...a?[`Details: ${a}`]:[],`Version: abitype@${e.version}`].join(`
2`);super(c),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"}),s.cause&&(this.cause=s.cause),this.details=a,this.docsPath=o,this.metaMessages=s.metaMessages,this.shortMessage=r}}return Yn.BaseError=t,Yn}var Ai={},L0;function l6(){if(L0)return Ai;L0=1,Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.narrow=e;function e(t){return t}return Ai}var Ti={},Si={},Ii={},Bi={},qt={},U0;function Nu(){if(U0)return qt;U0=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.isTupleRegex=qt.integerRegex=qt.bytesRegex=void 0,qt.execTyped=e;function e(t,n){return t.exec(n)?.groups}return qt.bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,qt.integerRegex=/^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)?$/,qt.isTupleRegex=/^\(.+?\).*?$/,qt}var z0;function Sp(){if(z0)return Bi;z0=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.formatAbiParameter=n;const e=Nu(),t=/^tuple(?<array>(\[(\d*)\])*)$/;function n(r){let s=r.type;if(t.test(r.type)&&"components"in r){s="(";const a=r.components.length;for(let c=0;c<a;c++){const u=r.components[c];s+=n(u),c<a-1&&(s+=", ")}const o=(0,e.execTyped)(t,r.type);return s+=`)${o?.array||""}`,n({...r,type:s})}return"indexed"in r&&r.indexed&&(s=`${s} indexed`),r.name?`${s} ${r.name}`:s}return Bi}var D0;function Ip(){if(D0)return Ii;D0=1,Object.defineProperty(Ii,"__esModule",{value:!0}),Ii.formatAbiParameters=t;const e=Sp();function t(n){let r="";const s=n.length;for(let a=0;a<s;a++){const o=n[a];r+=(0,e.formatAbiParameter)(o),a!==s-1&&(r+=", ")}return r}return Ii}var G0;function Bp(){if(G0)return Si;G0=1,Object.defineProperty(Si,"__esModule",{value:!0}),Si.formatAbiItem=t;const e=Ip();function t(n){return n.type==="function"?`function ${n.name}(${(0,e.formatAbiParameters)(n.inputs)})${n.stateMutability&&n.stateMutability!=="nonpayable"?` ${n.stateMutability}`:""}${n.outputs?.length?` returns (${(0,e.formatAbiParameters)(n.outputs)})`:""}`:n.type==="event"?`event ${n.name}(${(0,e.formatAbiParameters)(n.inputs)})`:n.type==="error"?`error ${n.name}(${(0,e.formatAbiParameters)(n.inputs)})`:n.type==="constructor"?`constructor(${(0,e.formatAbiParameters)(n.inputs)})${n.stateMutability==="payable"?" payable":""}`:n.type==="fallback"?`fallback() external${n.stateMutability==="payable"?" payable":""}`:"receive() external payable"}return Si}var V0;function b6(){if(V0)return Ti;V0=1,Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.formatAbi=t;const e=Bp();function t(n){const r=[],s=n.length;for(let a=0;a<s;a++){const o=n[a],c=(0,e.formatAbiItem)(o);r.push(c)}return r}return Ti}var xi={},ke={},W0;function In(){if(W0)return ke;W0=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.functionModifiers=ke.eventModifiers=ke.modifiers=void 0,ke.isErrorSignature=n,ke.execErrorSignature=r,ke.isEventSignature=a,ke.execEventSignature=o,ke.isFunctionSignature=u,ke.execFunctionSignature=d,ke.isStructSignature=f,ke.execStructSignature=b,ke.isConstructorSignature=v,ke.execConstructorSignature=p,ke.isFallbackSignature=I,ke.execFallbackSignature=h,ke.isReceiveSignature=i;const e=Nu(),t=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function n(g){return t.test(g)}function r(g){return(0,e.execTyped)(t,g)}const s=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function a(g){return s.test(g)}function o(g){return(0,e.execTyped)(s,g)}const c=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function u(g){return c.test(g)}function d(g){return(0,e.execTyped)(c,g)}const l=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function f(g){return l.test(g)}function b(g){return(0,e.execTyped)(l,g)}const T=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function v(g){return T.test(g)}function p(g){return(0,e.execTyped)(T,g)}const O=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function I(g){return O.test(g)}function h(g){return(0,e.execTyped)(O,g)}const j=/^receive\(\) external payable$/;function i(g){return j.test(g)}return ke.modifiers=new Set(["memory","indexed","storage","calldata"]),ke.eventModifiers=new Set(["indexed"]),ke.functionModifiers=new Set(["calldata","memory","storage"]),ke}var Ri={},Ut={},K0;function Fu(){if(K0)return Ut;
2K0=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.UnknownSolidityTypeError=Ut.UnknownTypeError=Ut.InvalidAbiItemError=void 0;const e=Sn();class t extends e.BaseError{constructor({signature:a}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(a,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}Ut.InvalidAbiItemError=t;class n extends e.BaseError{constructor({type:a}){super("Unknown type.",{metaMessages:[`Type "${a}" 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"})}}Ut.UnknownTypeError=n;class r extends e.BaseError{constructor({type:a}){super("Unknown type.",{metaMessages:[`Type "${a}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}return Ut.UnknownSolidityTypeError=r,Ut}var Ge={},Z0;function Wo(){if(Z0)return Ge;Z0=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.InvalidAbiTypeParameterError=Ge.InvalidFunctionModifierError=Ge.InvalidModifierError=Ge.SolidityProtectedKeywordError=Ge.InvalidParameterError=Ge.InvalidAbiParametersError=Ge.InvalidAbiParameterError=void 0;const e=Sn();class t extends e.BaseError{constructor({param:d}){super("Failed to parse ABI parameter.",{details:`parseAbiParameter(${JSON.stringify(d,null,2)})`,docsPath:"/api/human#parseabiparameter-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParameterError"})}}Ge.InvalidAbiParameterError=t;class n extends e.BaseError{constructor({params:d}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(d,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}Ge.InvalidAbiParametersError=n;class r extends e.BaseError{constructor({param:d}){super("Invalid ABI parameter.",{details:d}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}Ge.InvalidParameterError=r;class s extends e.BaseError{constructor({param:d,name:l}){super("Invalid ABI parameter.",{details:d,metaMessages:[`"${l}" 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"})}}Ge.SolidityProtectedKeywordError=s;class a extends e.BaseError{constructor({param:d,type:l,modifier:f}){super("Invalid ABI parameter.",{details:d,metaMessages:[`Modifier "${f}" not allowed${l?` in "${l}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}Ge.InvalidModifierError=a;class o extends e.BaseError{constructor({param:d,type:l,modifier:f}){super("Invalid ABI parameter.",{details:d,metaMessages:[`Modifier "${f}" not allowed${l?` in "${l}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${f}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}Ge.InvalidFunctionModifierError=o;class c extends e.BaseError{constructor({abiParameter:d}){super("Invalid ABI parameter.",{details:JSON.stringify(d,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}return Ge.InvalidAbiTypeParameterError=c,Ge}var zt={},Y0;function yf(){if(Y0)return zt;Y0=1,Object.defineProperty(zt,"__esModule",{value:!0}),zt.InvalidStructSignatureError=zt.UnknownSignatureError=zt.InvalidSignatureError=void 0;const e=Sn();class t extends e.BaseError{constructor({signature:a,type:o}){super(`Invalid ${o} signature.`,{details:a}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}zt.InvalidSignatureError=t;class n extends e.BaseError{constructor({signature:a}){super("Unknown signature.",{details:a}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}zt.UnknownSignatureError=n;class r extends e.BaseError{constructor({signature:a}){super("Invalid struct signature.",{details:a,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}return zt.InvalidStructSignatureError=r,zt}var Xn={},J0;function xp(){if(J0)return Xn;J0=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.CircularReferenceError=void 0;const e=Sn();class t extends e.BaseError{constructor({type:r}){super("Circular reference detected.",{metaMessages:[`Struct "${r}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}return Xn.CircularReferenceError=t,Xn}var it={},Qn={},X0;function Rp(){if(X0)return Qn;X0=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.InvalidParenthesisError=void 0;const e=Sn();class t extends e.BaseError{constructor({current:r,depth:s}){super("Unbalanced parentheses.",{metaMessages:[`"${r.trim()}" has too many ${s>0?"opening":"closing"} parentheses.`],details:`Depth "${s}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}return Qn.InvalidParenthesisError=t,Qn}var an={},Q0;function m6(){if(Q0)return an;Q0=1,Object.defineProperty(an,"__esModule",{value:!0}),an.parameterCache=void 0,an.getParameterCacheKey=e;function e(t,n,r){let s="";if(r)for(const a of Object.entries(r)){if(!a)continue;let o="";for(const c of a[1])o+=`[${c.type}${c.name?`:${c.name}`:""}]`;s+=`(${a[0]}{${o}})`}return n?`${n}:${t}${s}`:`${t}${s}`}return an.parameterCache=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}]]),an}var $0;function Tn(){if($0)return it;
2$0=1,Object.defineProperty(it,"__esModule",{value:!0}),it.parseSignature=c,it.parseFunctionSignature=u,it.parseEventSignature=d,it.parseErrorSignature=l,it.parseConstructorSignature=f,it.parseFallbackSignature=b,it.parseAbiParameter=O,it.splitParameters=I,it.isSolidityType=h,it.isSolidityKeyword=i,it.isValidDataLocation=g;const e=Nu(),t=Fu(),n=Wo(),r=yf(),s=Rp(),a=m6(),o=In();function c(_,E={}){if((0,o.isFunctionSignature)(_))return u(_,E);if((0,o.isEventSignature)(_))return d(_,E);if((0,o.isErrorSignature)(_))return l(_,E);if((0,o.isConstructorSignature)(_))return f(_,E);if((0,o.isFallbackSignature)(_))return b(_);if((0,o.isReceiveSignature)(_))return{type:"receive",stateMutability:"payable"};throw new r.UnknownSignatureError({signature:_})}function u(_,E={}){const R=(0,o.execFunctionSignature)(_);if(!R)throw new r.InvalidSignatureError({signature:_,type:"function"});const w=I(R.parameters),y=[],x=w.length;for(let B=0;B<x;B++)y.push(O(w[B],{modifiers:o.functionModifiers,structs:E,type:"function"}));const C=[];if(R.returns){const B=I(R.returns),H=B.length;for(let F=0;F<H;F++)C.push(O(B[F],{modifiers:o.functionModifiers,structs:E,type:"function"}))}return{name:R.name,type:"function",stateMutability:R.stateMutability??"nonpayable",inputs:y,outputs:C}}function d(_,E={}){const R=(0,o.execEventSignature)(_);if(!R)throw new r.InvalidSignatureError({signature:_,type:"event"});const w=I(R.parameters),y=[],x=w.length;for(let C=0;C<x;C++)y.push(O(w[C],{modifiers:o.eventModifiers,structs:E,type:"event"}));return{name:R.name,type:"event",inputs:y}}function l(_,E={}){const R=(0,o.execErrorSignature)(_);if(!R)throw new r.InvalidSignatureError({signature:_,type:"error"});const w=I(R.parameters),y=[],x=w.length;for(let C=0;C<x;C++)y.push(O(w[C],{structs:E,type:"error"}));return{name:R.name,type:"error",inputs:y}}function f(_,E={}){const R=(0,o.execConstructorSignature)(_);if(!R)throw new r.InvalidSignatureError({signature:_,type:"constructor"});const w=I(R.parameters),y=[],x=w.length;for(let C=0;C<x;C++)y.push(O(w[C],{structs:E,type:"constructor"}));return{type:"constructor",stateMutability:R.stateMutability??"nonpayable",inputs:y}}function b(_){const E=(0,o.execFallbackSignature)(_);if(!E)throw new r.InvalidSignatureError({signature:_,type:"fallback"});return{type:"fallback",stateMutability:E.stateMutability??"nonpayable"}}const T=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,v=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,p=/^u?int$/;function O(_,E){const R=(0,a.getParameterCacheKey)(_,E?.type,E?.structs);if(a.parameterCache.has(R))return a.parameterCache.get(R);const w=e.isTupleRegex.test(_),y=(0,e.execTyped)(w?v:T,_);if(!y)throw new n.InvalidParameterError({param:_});if(y.name&&i(y.name))throw new n.SolidityProtectedKeywordError({param:_,name:y.name});const x=y.name?{name:y.name}:{},C=y.modifier==="indexed"?{indexed:!0}:{},B=E?.structs??{};let H,F={};if(w){H="tuple";const m=I(y.type),M=[],A=m.length;for(let P=0;P<A;P++)M.push(O(m[P],{structs:B}));F={components:M}}else if(y.type in B)H="tuple",F={components:B[y.type]};else if(p.test(y.type))H=`${y.type}256`;else if(y.type==="address payable")H="address";else if(H=y.type,E?.type!=="struct"&&!h(H))throw new t.UnknownSolidityTypeError({type:H});if(y.modifier){if(!E?.modifiers?.has?.(y.modifier))throw new n.InvalidModifierError({param:_,type:E?.type,modifier:y.modifier});if(o.functionModifiers.has(y.modifier)&&!g(H,!!y.array))throw new n.InvalidFunctionModifierError({param:_,type:E?.type,modifier:y.modifier})}const k={type:`${H}${y.array??""}`,...x,...C,...F};return a.parameterCache.set(R,k),k}function I(_,E=[],R="",w=0){const y=_.trim().length;for(let x=0;x<y;x++){const C=_[x],B=_.slice(x+1);switch(C){case",":return w===0?I(B,[...E,R.trim()]):I(B,E,`${R}${C}`,w);case"(":return I(B,E,`${R}${C}`,w+1);case")":return I(B,E,`${R}${C}`,w-1);default:return I(B,E,`${R}${C}`,w)}}if(R==="")return E;if(w!==0)throw new s.InvalidParenthesisError({current:R,depth:w});return E.push(R.trim()),E}function h(_){return _==="address"||_==="bool"||_==="function"||_==="string"||e.bytesRegex.test(_)||e.integerRegex.test(_)}const 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 i(_){return _==="address"||_==="bool"||_==="function"||_==="string"||_==="tuple"||e.bytesRegex.test(_)||e.integerRegex.test(_)||j.test(_)}function g(_,E){return E||_==="bytes"||_==="string"||_==="tuple"}return it}var el;
2function Lu(){if(el)return Ri;el=1,Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.parseStructs=c;const e=Nu(),t=Fu(),n=Wo(),r=yf(),s=xp(),a=In(),o=Tn();function c(l){const f={},b=l.length;for(let O=0;O<b;O++){const I=l[O];if(!(0,a.isStructSignature)(I))continue;const h=(0,a.execStructSignature)(I);if(!h)throw new r.InvalidSignatureError({signature:I,type:"struct"});const j=h.properties.split(";"),i=[],g=j.length;for(let _=0;_<g;_++){const R=j[_].trim();if(!R)continue;const w=(0,o.parseAbiParameter)(R,{type:"struct"});i.push(w)}if(!i.length)throw new r.InvalidStructSignatureError({signature:I});f[h.name]=i}const T={},v=Object.entries(f),p=v.length;for(let O=0;O<p;O++){const[I,h]=v[O];T[I]=d(h,f)}return T}const u=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function d(l=[],f={},b=new Set){const T=[],v=l.length;for(let p=0;p<v;p++){const O=l[p];if(e.isTupleRegex.test(O.type))T.push(O);else{const h=(0,e.execTyped)(u,O.type);if(!h?.type)throw new n.InvalidAbiTypeParameterError({abiParameter:O});const{array:j,type:i}=h;if(i in f){if(b.has(i))throw new s.CircularReferenceError({type:i});T.push({...O,type:`tuple${j??""}`,components:d(f[i],f,new Set([...b,i]))})}else if((0,o.isSolidityType)(i))T.push(O);else throw new t.UnknownTypeError({type:i})}}return T}return Ri}var tl;function h6(){if(tl)return xi;tl=1,Object.defineProperty(xi,"__esModule",{value:!0}),xi.parseAbi=r;const e=In(),t=Lu(),n=Tn();function r(s){const a=(0,t.parseStructs)(s),o=[],c=s.length;for(let u=0;u<c;u++){const d=s[u];(0,e.isStructSignature)(d)||o.push((0,n.parseSignature)(d,a))}return o}return xi}var Oi={},rl;function y6(){if(rl)return Oi;rl=1,Object.defineProperty(Oi,"__esModule",{value:!0}),Oi.parseAbiItem=s;const e=Fu(),t=In(),n=Lu(),r=Tn();function s(a){let o;if(typeof a=="string")o=(0,r.parseSignature)(a);else{const c=(0,n.parseStructs)(a),u=a.length;for(let d=0;d<u;d++){const l=a[d];if(!(0,t.isStructSignature)(l)){o=(0,r.parseSignature)(l,c);break}}}if(!o)throw new e.InvalidAbiItemError({signature:a});return o}return Oi}var Ci={},nl;function g6(){if(nl)return Ci;nl=1,Object.defineProperty(Ci,"__esModule",{value:!0}),Ci.parseAbiParameter=s;const e=Wo(),t=In(),n=Lu(),r=Tn();function s(a){let o;if(typeof a=="string")o=(0,r.parseAbiParameter)(a,{modifiers:t.modifiers});else{const c=(0,n.parseStructs)(a),u=a.length;for(let d=0;d<u;d++){const l=a[d];if(!(0,t.isStructSignature)(l)){o=(0,r.parseAbiParameter)(l,{modifiers:t.modifiers,structs:c});break}}}if(!o)throw new e.InvalidAbiParameterError({param:a});return o}return Ci}var qi={},ol;function p6(){if(ol)return qi;ol=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.parseAbiParameters=a;const e=Wo(),t=In(),n=Lu(),r=Tn(),s=Tn();function a(o){const c=[];if(typeof o=="string"){const u=(0,r.splitParameters)(o),d=u.length;for(let l=0;l<d;l++)c.push((0,s.parseAbiParameter)(u[l],{modifiers:t.modifiers}))}else{const u=(0,n.parseStructs)(o),d=o.length;for(let l=0;l<d;l++){const f=o[l];if((0,t.isStructSignature)(f))continue;const b=(0,r.splitParameters)(f),T=b.length;for(let v=0;v<T;v++)c.push((0,s.parseAbiParameter)(b[v],{modifiers:t.modifiers,structs:u}))}}if(c.length===0)throw new e.InvalidAbiParametersError({params:o});return c}return qi}var il;function mr(){return il||(il=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CircularReferenceError=e.InvalidParenthesisError=e.UnknownSignatureError=e.InvalidSignatureError=e.InvalidStructSignatureError=e.InvalidAbiParameterError=e.InvalidAbiParametersError=e.InvalidParameterError=e.SolidityProtectedKeywordError=e.InvalidModifierError=e.InvalidFunctionModifierError=e.InvalidAbiTypeParameterError=e.UnknownSolidityTypeError=e.InvalidAbiItemError=e.UnknownTypeError=e.parseAbiParameters=e.parseAbiParameter=e.parseAbiItem=e.parseAbi=e.formatAbiParameters=e.formatAbiParameter=e.formatAbiItem=e.formatAbi=e.narrow=e.BaseError=void 0;var t=Sn();Object.defineProperty(e,"BaseError",{enumerable:!0,get:function(){return t.BaseError}});var n=l6();Object.defineProperty(e,"narrow",{enumerable:!0,get:function(){return n.narrow}});var r=b6();Object.defineProperty(e,"formatAbi",{enumerable:!0,get:function(){return r.formatAbi}});var s=Bp();Object.defineProperty(e,"formatAbiItem",{enumerable:!0,get:function(){return s.formatAbiItem}});var a=Sp();Object.defineProperty(e,"formatAbiParameter",{enumerable:!0,get:function(){return a.formatAbiParameter}});var o=Ip();Object.defineProperty(e,"formatAbiParameters",{enumerable:!0,get:function(){return o.formatAbiParameters}});var c=h6();Object.defineProperty(e,"parseAbi",{enumerable:!0,get:function(){return c.parseAbi}});var u=y6();Object.defineProperty(e,"parseAbiItem",{enumerable:!0,get:function(){return u.parseAbiItem}});var d=g6();Object.defineProperty(e,"parseAbiParameter",{enumerable:!0,get:function(){return d.parseAbiParameter}});var l=p6();Object.defineProperty(e,"parseAbiParameters",{enumerable:!0,get:function(){return l.parseAbiParameters}});var f=Fu();Object.defineProperty(e,"UnknownTypeError",{enumerable:!0,get:function(){return f.UnknownTypeError}}),Object.defineProperty(e,"InvalidAbiItemError",{enumerable:!0,get:function(){return f.InvalidAbiItemError}}),Object.defineProperty(e,"UnknownSolidityTypeError",{enumerable:!0,get:function(){return f.UnknownSolidityTypeError}});var b=Wo();Object.defineProperty(e,"InvalidAbiTypeParameterError",{enumerable:!0,get:function(){return b.InvalidAbiTypeParameterError}}),Object.defineProperty(e,"InvalidFunctionModifierError",{enumerable:!0,get:function(){return b.InvalidFunctionModifierError}}),Object.defineProperty(e,"InvalidModifierError",{enumerable:!0,get:function(){return b.InvalidModifierError}}),Object.defineProperty(e,"SolidityProtectedKeywordError",{enumerable:!0,get:function(){return b.SolidityProtectedKeywordError}}),Object.defineProperty(e,"InvalidParameterError",{enumerable:!0,get:function(){return b.InvalidParameterError}}),Object.defineProperty(e,"InvalidAbiParametersError",{enumerable:!0,get:function(){return b.InvalidAbiParametersError}}),Object.defineProperty(e,"InvalidAbiParameterError",{enumerable:!0,get:function(){return b.InvalidAbiParameterError}});var T=yf();Object.defineProperty(e,"InvalidStructSignatureError",{enumerable:!0,get:function(){return T.InvalidStructSignatureError}}),Object.defineProperty(e,"InvalidSignatureError",{enumerable:!0,get:function(){return T.InvalidSignatureError}}),Object.defineProperty(e,"UnknownSignatureError",{enumerable:!0,get:function(){return T.UnknownSignatureError}});var v=Rp();Object.defineProperty(e,"InvalidParenthesisError",{enumerable:!0,get:function(){return v.InvalidParenthesisError}});var p=xp();Object.defineProperty(e,"CircularReferenceError",{enumerable:!0,get:function(){return p.CircularReferenceError}})})(kd)),kd}var cn={},Hi={},sl;function ge(){if(sl)return Hi;sl=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.getAction=e;function e(t,n,r){const s=t[n.name];if(typeof s=="function")return s;const a=t[r];return typeof a=="function"?a:o=>n(t,o)}return Hi}var Mi={},ki={},ce={},$n={},al;function $t(){if(al)return $n;al=1,Object.defineProperty($n,"__esModule",{value:!0}),$n.formatAbiItem=t,$n.formatAbiParams=n;const e=qe();function t(s,{includeName:a=!1}={}){if(s.type!=="function"&&s.type!=="event"&&s.type!=="error")throw new e.InvalidDefinitionTypeError(s.type);return`${s.name}(${n(s.inputs,{includeName:a})})`}function n(s,{includeName:a=!1}={}){return s?s.map(o=>r(o,{includeName:a})).join(a?", ":","):""}function r(s,{includeName:a}){return s.type.startsWith("tuple")?`(${n(s.components,{includeName:a})})${s.type.slice(5)}`:s.type+(a&&s.name?` ${s.name}`:"")}return $n}var Ni={},Fi={},cl;function nt(){if(cl)return Fi;cl=1,Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.isHex=e;function e(t,{strict:n=!0}={}){return!t||typeof t!="string"?!1:n?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}return Fi}var ul;function at(){if(ul)return Ni;ul=1,Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.size=t;const e=nt();function t(n){return(0,e.isHex)(n,{strict:!1})?Math.ceil((n.length-2)/2):n.length}return Ni}var un={},eo={},dl;function _6(){return dl||(dl=1,Object.defineProperty(eo,"__esModule",{value:!0}),eo.version=void 0,eo.version="2.46.1"),eo}var fl;function fe(){if(fl)return un;fl=1,Object.defineProperty(un,"__esModule",{value:!0}),un.BaseError=void 0,un.setErrorConfig=n;const e=_6();let t={getDocsUrl:({docsBaseUrl:a,docsPath:o="",docsSlug:c})=>o?`${a??"https://viem.sh"}${o}${c?`#${c}`:""}
2`:void 0,version:`viem@${e.version}`};function n(a){t=a}class r extends Error{constructor(o,c={}){const u=c.cause instanceof r?c.cause.details:c.cause?.message?c.cause.message:c.details,d=c.cause instanceof r&&c.cause.docsPath||c.docsPath,l=t.getDocsUrl?.({...c,docsPath:d}),f=[o||"An error occurred.","",...c.metaMessages?[...c.metaMessages,""]:[],...l?[`Docs: ${l}`]:[],...u?[`Details: ${u}`]:[],...t.version?[`Version: ${t.version}`]:[]].join(`
3`);super(f,c.cause?{cause:c.cause}:void 0),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,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=u,this.docsPath=d,this.metaMessages=c.metaMessages,this.name=c.name??this.name,this.shortMessage=o,this.version=e.version}walk(o){return s(this,o)}}un.BaseError=r;function s(a,o){return o?.(a)?a:a&&typeof a=="object"&&"cause"in a&&a.cause!==void 0?s(a.cause,o):o?null:a}return un}var ll;function qe(){if(ll)return ce;ll=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.UnsupportedPackedAbiType=ce.InvalidDefinitionTypeError=ce.InvalidArrayError=ce.InvalidAbiDecodingTypeError=ce.InvalidAbiEncodingTypeError=ce.DecodeLogTopicsMismatch=ce.DecodeLogDataMismatch=ce.BytesSizeMismatchError=ce.AbiItemAmbiguityError=ce.AbiFunctionSignatureNotFoundError=ce.AbiFunctionOutputsNotFoundError=ce.AbiFunctionNotFoundError=ce.AbiEventNotFoundError=ce.AbiEventSignatureNotFoundError=ce.AbiEventSignatureEmptyTopicsError=ce.AbiErrorSignatureNotFoundError=ce.AbiErrorNotFoundError=ce.AbiErrorInputsNotFoundError=ce.AbiEncodingLengthMismatchError=ce.AbiEncodingBytesSizeMismatchError=ce.AbiEncodingArrayLengthMismatchError=ce.AbiDecodingZeroDataError=ce.AbiDecodingDataSizeTooSmallError=ce.AbiDecodingDataSizeInvalidError=ce.AbiConstructorParamsNotFoundError=ce.AbiConstructorNotFoundError=void 0;const e=$t(),t=at(),n=fe();class r extends n.BaseError{constructor({docsPath:H}){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(`
4`),{docsPath:H,name:"AbiConstructorNotFoundError"})}}ce.AbiConstructorNotFoundError=r;class s extends n.BaseError{constructor({docsPath:H}){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(`
5`),{docsPath:H,name:"AbiConstructorParamsNotFoundError"})}}ce.AbiConstructorParamsNotFoundError=s;class a extends n.BaseError{constructor({data:H,size:F}){super([`Data size of ${F}
5 bytes is invalid.`,"Size must be in increments of 32 bytes (size % 32 === 0)."].join(`
6`),{metaMessages:[`Data: ${H} (${F} bytes)`],name:"AbiDecodingDataSizeInvalidError"})}}ce.AbiDecodingDataSizeInvalidError=a;class o extends n.BaseError{constructor({data:H,params:F,size:k}){super([`Data size of ${k} bytes is too small for given parameters.`].join(`
7`),{metaMessages:[`Params: (${(0,e.formatAbiParams)(F,{includeName:!0})})`,`Data:   ${H} (${k} bytes)`],name:"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=H,this.params=F,this.size=k}}ce.AbiDecodingDataSizeTooSmallError=o;class c extends n.BaseError{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}ce.AbiDecodingZeroDataError=c;class u extends n.BaseError{constructor({expectedLength:H,givenLength:F,type:k}){super([`ABI encoding array length mismatch for type ${k}.`,`Expected length: ${H}`,`Given length: ${F}`].join(`
8`),{name:"AbiEncodingArrayLengthMismatchError"})}}ce.AbiEncodingArrayLengthMismatchError=u;class d extends n.BaseError{constructor({expectedSize:H,value:F}){super(`Size of bytes "${F}" (bytes${(0,t.size)(F)}) does not match expected size (bytes${H}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}ce.AbiEncodingBytesSizeMismatchError=d;class l extends n.BaseError{constructor({expectedLength:H,givenLength:F}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${H}`,`Given length (values): ${F}`].join(`
9`),{name:"AbiEncodingLengthMismatchError"})}}ce.AbiEncodingLengthMismatchError=l;class f extends n.BaseError{constructor(H,{docsPath:F}){super([`Arguments (\`args\`) were provided to "${H}", but "${H}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(`
10`),{docsPath:F,name:"AbiErrorInputsNotFoundError"})}}ce.AbiErrorInputsNotFoundError=f;class b extends n.BaseError{constructor(H,{docsPath:F}={}){super([`Error ${H?`"${H}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(`
11`),{docsPath:F,name:"AbiErrorNotFoundError"})}}ce.AbiErrorNotFoundError=b;class T extends n.BaseError{constructor(H,{docsPath:F}){super([`Encoded error signature "${H}" 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://4byte.sourcify.dev/?q=${H}.`].join(`
12`),{docsPath:F,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=H}}ce.AbiErrorSignatureNotFoundError=T;class v extends n.BaseError{constructor({docsPath:H}){super("Cannot extract event signature from empty topics.",{docsPath:H,name:"AbiEventSignatureEmptyTopicsError"})}}ce.AbiEventSignatureEmptyTopicsError=v;class p extends n.BaseError{constructor(H,{docsPath:F}){super([`Encoded event signature "${H}" 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://4byte.sourcify.dev/?q=${H}.`].join(`
13`),{docsPath:F,name:"AbiEventSignatureNotFoundError"})}}ce.AbiEventSignatureNotFoundError=p;class O extends n.BaseError{constructor(H,{docsPath:F}={}){super([`Event ${H?`"${H}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(`
14`),{docsPath:F,name:"AbiEventNotFoundError"})}}ce.AbiEventNotFoundError=O;class I extends n.BaseError{constructor(H,{docsPath:F}={}){super([`Function ${H?`"${H}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
15`),{docsPath:F,name:"AbiFunctionNotFoundError"})}}ce.AbiFunctionNotFoundError=I;class h extends n.BaseError{constructor(H,{docsPath:F}){super([`Function "${H}" 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(`
16`),{docsPath:F,name:"AbiFunctionOutputsNotFoundError"})}}ce.AbiFunctionOutputsNotFoundError=h;
16class j extends n.BaseError{constructor(H,{docsPath:F}){super([`Encoded function signature "${H}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${H}.`].join(`
17`),{docsPath:F,name:"AbiFunctionSignatureNotFoundError"})}}ce.AbiFunctionSignatureNotFoundError=j;class i extends n.BaseError{constructor(H,F){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${H.type}\` in \`${(0,e.formatAbiItem)(H.abiItem)}\`, and`,`\`${F.type}\` in \`${(0,e.formatAbiItem)(F.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}ce.AbiItemAmbiguityError=i;class g extends n.BaseError{constructor({expectedSize:H,givenSize:F}){super(`Expected bytes${H}, got bytes${F}.`,{name:"BytesSizeMismatchError"})}}ce.BytesSizeMismatchError=g;class _ extends n.BaseError{constructor({abiItem:H,data:F,params:k,size:m}){super([`Data size of ${m} bytes is too small for non-indexed event parameters.`].join(`
18`),{metaMessages:[`Params: (${(0,e.formatAbiParams)(k,{includeName:!0})})`,`Data:   ${F} (${m} bytes)`],name:"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=H,this.data=F,this.params=k,this.size=m}}ce.DecodeLogDataMismatch=_;class E extends n.BaseError{constructor({abiItem:H,param:F}){super([`Expected a topic for indexed event parameter${F.name?` "${F.name}"`:""} on event "${(0,e.formatAbiItem)(H,{includeName:!0})}".`].join(`
19`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=H}}ce.DecodeLogTopicsMismatch=E;class R extends n.BaseError{constructor(H,{docsPath:F}){super([`Type "${H}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
20`),{docsPath:F,name:"InvalidAbiEncodingType"})}}ce.InvalidAbiEncodingTypeError=R;class w extends n.BaseError{constructor(H,{docsPath:F}){super([`Type "${H}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
21`),{docsPath:F,name:"InvalidAbiDecodingType"})}}ce.InvalidAbiDecodingTypeError=w;class y extends n.BaseError{constructor(H){super([`Value "${H}" is not a valid array.`].join(`
22`),{name:"InvalidArrayError"})}}ce.InvalidArrayError=y;class x extends n.BaseError{constructor(H){super([`"${H}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
23`),{name:"InvalidDefinitionTypeError"})}}ce.InvalidDefinitionTypeError=x;class C extends n.BaseError{constructor(H){super(`Type "${H}" is not supported for packed encoding.`,{name:"UnsupportedPackedAbiType"})}}return ce.UnsupportedPackedAbiType=C,ce}var to={},bl;function Op(){if(bl)return to;bl=1,Object.defineProperty(to,"__esModule",{value:!0}),to.FilterTypeNotSupportedError=void 0;const e=fe();class t extends e.BaseError{constructor(r){super(`Filter type "${r}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}return to.FilterTypeNotSupportedError=t,to}var ir={},dn={},Dt={},ml;
23function Uu(){if(ml)return Dt;ml=1,Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.InvalidBytesLengthError=Dt.SizeExceedsPaddingSizeError=Dt.SliceOffsetOutOfBoundsError=void 0;const e=fe();class t extends e.BaseError{constructor({offset:a,position:o,size:c}){super(`Slice ${o==="start"?"starting":"ending"} at offset "${a}" is out-of-bounds (size: ${c}).`,{name:"SliceOffsetOutOfBoundsError"})}}Dt.SliceOffsetOutOfBoundsError=t;class n extends e.BaseError{constructor({size:a,targetSize:o,type:c}){super(`${c.charAt(0).toUpperCase()}${c.slice(1).toLowerCase()} size (${a}) exceeds padding size (${o}).`,{name:"SizeExceedsPaddingSizeError"})}}Dt.SizeExceedsPaddingSizeError=n;class r extends e.BaseError{constructor({size:a,targetSize:o,type:c}){super(`${c.charAt(0).toUpperCase()}${c.slice(1).toLowerCase()} is expected to be ${o} ${c} long, but is ${a} ${c} long.`,{name:"InvalidBytesLengthError"})}}return Dt.InvalidBytesLengthError=r,Dt}var hl;function hr(){if(hl)return dn;hl=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.pad=t,dn.padHex=n,dn.padBytes=r;const e=Uu();function t(s,{dir:a,size:o=32}={}){return typeof s=="string"?n(s,{dir:a,size:o}):r(s,{dir:a,size:o})}function n(s,{dir:a,size:o=32}={}){if(o===null)return s;const c=s.replace("0x","");if(c.length>o*2)throw new e.SizeExceedsPaddingSizeError({size:Math.ceil(c.length/2),targetSize:o,type:"hex"});return`0x${c[a==="right"?"padEnd":"padStart"](o*2,"0")}`}function r(s,{dir:a,size:o=32}={}){if(o===null)return s;if(s.length>o)throw new e.SizeExceedsPaddingSizeError({size:s.length,targetSize:o,type:"bytes"});const c=new Uint8Array(o);for(let u=0;u<o;u++){const d=a==="right";c[d?u:o-u-1]=s[d?u:s.length-u-1]}return c}return dn}var Gt={},ft={},yl;function Bn(){if(yl)return ft;yl=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.SizeOverflowError=ft.InvalidHexValueError=ft.InvalidHexBooleanError=ft.InvalidBytesBooleanError=ft.IntegerOutOfRangeError=void 0;const e=fe();class t extends e.BaseError{constructor({max:c,min:u,signed:d,size:l,value:f}){super(`Number "${f}" is not in safe ${l?`${l*8}-bit ${d?"signed":"unsigned"} `:""}integer range ${c?`(${u} to ${c})`:`(above ${u})`}`,{name:"IntegerOutOfRangeError"})}}ft.IntegerOutOfRangeError=t;class n extends e.BaseError{constructor(c){super(`Bytes value "${c}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}ft.InvalidBytesBooleanError=n;class r extends e.BaseError{constructor(c){super(`Hex value "${c}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}ft.InvalidHexBooleanError=r;class s extends e.BaseError{constructor(c){super(`Hex value "${c}" is an odd length (${c.length}). It must be an even length.`,{name:"InvalidHexValueError"})}}ft.InvalidHexValueError=s;class a extends e.BaseError{constructor({givenSize:c,maxSize:u}){super(`Size cannot exceed ${u} bytes. Given size: ${c} bytes.`,{name:"SizeOverflowError"})}}return ft.SizeOverflowError=a,ft}var Li={},gl;function er(){if(gl)return Li;gl=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.trim=e;function e(t,{dir:n="left"}={}){let r=typeof t=="string"?t.replace("0x",""):t,s=0;for(let a=0;a<r.length-1&&r[n==="left"?a:r.length-a-1].toString()==="0";a++)s++;return r=n==="left"?r.slice(s):r.slice(0,r.length-s),typeof t=="string"?(r.length===1&&n==="right"&&(r=`${r}0`),`0x${r.length%2===1?`0${r}`:r}`):r}return Li}var pl;function Ne(){if(pl)return Gt;pl=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.assertSize=s,Gt.fromHex=a,Gt.hexToBigInt=o,Gt.hexToBool=c,Gt.hexToNumber=u,Gt.hexToString=d;const e=Bn(),t=at(),n=er(),r=Pe();function s(l,{size:f}){if((0,t.size)(l)>f)throw new e.SizeOverflowError({givenSize:(0,t.size)(l),maxSize:f})}function a(l,f){const b=typeof f=="string"?{to:f}:f,T=b.to;return T==="number"?u(l,b):T==="bigint"?o(l,b):T==="string"?d(l,b):T==="boolean"?c(l,b):(0,r.hexToBytes)(l,b)}function o(l,f={}){const{signed:b}=f;f.size&&s(l,{size:f.size});const T=BigInt(l);if(!b)return T;const v=(l.length-2)/2,p=(1n<<BigInt(v)*8n-1n)-1n;return T<=p?T:T-BigInt(`0x${"f".padStart(v*2,"f")}`)-1n}function c(l,f={}){let b=l;if(f.size&&(s(b,{size:f.size}),b=(0,n.trim)(b)),(0,n.trim)(b)==="0x00")return!1;if((0,n.trim)(b)==="0x01")return!0;throw new e.InvalidHexBooleanError(b)}function u(l,f={}){const b=o(l,f),T=Number(b);if(!Number.isSafeInteger(T))throw new e.IntegerOutOfRangeError({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:f.signed,size:f.size,value:`${b}n`});return T}function d(l,f={}){let b=(0,r.hexToBytes)(l);return f.size&&(s(b,{size:f.size}),b=(0,n.trim)(b,{dir:"right"})),new TextDecoder().decode(b)}return Gt}var sr={},_l;function ie(){if(_l)return sr;
23_l=1,Object.defineProperty(sr,"__esModule",{value:!0}),sr.toHex=s,sr.boolToHex=a,sr.bytesToHex=o,sr.numberToHex=c,sr.stringToHex=d;const e=Bn(),t=hr(),n=Ne(),r=Array.from({length:256},(l,f)=>f.toString(16).padStart(2,"0"));function s(l,f={}){return typeof l=="number"||typeof l=="bigint"?c(l,f):typeof l=="string"?d(l,f):typeof l=="boolean"?a(l,f):o(l,f)}function a(l,f={}){const b=`0x${Number(l)}`;return typeof f.size=="number"?((0,n.assertSize)(b,{size:f.size}),(0,t.pad)(b,{size:f.size})):b}function o(l,f={}){let b="";for(let v=0;v<l.length;v++)b+=r[l[v]];const T=`0x${b}`;return typeof f.size=="number"?((0,n.assertSize)(T,{size:f.size}),(0,t.pad)(T,{dir:"right",size:f.size})):T}function c(l,f={}){const{signed:b,size:T}=f,v=BigInt(l);let p;T?b?p=(1n<<BigInt(T)*8n-1n)-1n:p=2n**(BigInt(T)*8n)-1n:typeof l=="number"&&(p=BigInt(Number.MAX_SAFE_INTEGER));const O=typeof p=="bigint"&&b?-p-1n:0;if(p&&v>p||v<O){const h=typeof l=="bigint"?"n":"";throw new e.IntegerOutOfRangeError({max:p?`${p}${h}`:void 0,min:`${O}${h}`,signed:b,size:T,value:`${l}${h}`})}const I=`0x${(b&&v<0?(1n<<BigInt(T*8))+BigInt(v):v).toString(16)}`;return T?(0,t.pad)(I,{size:T}):I}const u=new TextEncoder;function d(l,f={}){const b=u.encode(l);return o(b,f)}return sr}var vl;function Pe(){if(vl)return ir;vl=1,Object.defineProperty(ir,"__esModule",{value:!0}),ir.toBytes=o,ir.boolToBytes=c,ir.hexToBytes=l,ir.numberToBytes=f,ir.stringToBytes=b;const e=fe(),t=nt(),n=hr(),r=Ne(),s=ie(),a=new TextEncoder;function o(T,v={}){return typeof T=="number"||typeof T=="bigint"?f(T,v):typeof T=="boolean"?c(T,v):(0,t.isHex)(T)?l(T,v):b(T,v)}function c(T,v={}){const p=new Uint8Array(1);return p[0]=Number(T),typeof v.size=="number"?((0,r.assertSize)(p,{size:v.size}),(0,n.pad)(p,{size:v.size})):p}const u={zero:48,nine:57,A:65,F:70,a:97,f:102};function d(T){if(T>=u.zero&&T<=u.nine)return T-u.zero;if(T>=u.A&&T<=u.F)return T-(u.A-10);if(T>=u.a&&T<=u.f)return T-(u.a-10)}function l(T,v={}){let p=T;v.size&&((0,r.assertSize)(p,{size:v.size}),p=(0,n.pad)(p,{dir:"right",size:v.size}));let O=p.slice(2);O.length%2&&(O=`0${O}`);const I=O.length/2,h=new Uint8Array(I);for(let j=0,i=0;j<I;j++){const g=d(O.charCodeAt(i++)),_=d(O.charCodeAt(i++));if(g===void 0||_===void 0)throw new e.BaseError(`Invalid byte sequence ("${O[i-2]}${O[i-1]}" in "${O}").`);h[j]=g*16+_}return h}function f(T,v){const p=(0,s.numberToHex)(T,v);return l(p)}function b(T,v={}){const p=a.encode(T);return typeof v.size=="number"?((0,r.assertSize)(p,{size:v.size}),(0,n.pad)(p,{dir:"right",size:v.size})):p}return ir}var Ui={},Se={},ue={},El;function Cp(){if(El)return ue;El=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.toBig=ue.shrSL=ue.shrSH=ue.rotrSL=ue.rotrSH=ue.rotrBL=ue.rotrBH=ue.rotr32L=ue.rotr32H=ue.rotlSL=ue.rotlSH=ue.rotlBL=ue.rotlBH=ue.add5L=ue.add5H=ue.add4L=ue.add4H=ue.add3L=ue.add3H=void 0,ue.add=I,ue.fromBig=n,ue.split=r;const e=BigInt(2**32-1),t=BigInt(32);function n(w,y=!1){return y?{h:Number(w&e),l:Number(w>>t&e)}:{h:Number(w>>t&e)|0,l:Number(w&e)|0}}function r(w,y=!1){const x=w.length;let C=new Uint32Array(x),B=new Uint32Array(x);for(let H=0;H<x;H++){const{h:F,l:k}=n(w[H],y);[C[H],B[H]]=[F,k]}return[C,B]}const s=(w,y)=>BigInt(w>>>0)<<t|BigInt(y>>>0);ue.toBig=s;const a=(w,y,x)=>w>>>x;ue.shrSH=a;const o=(w,y,x)=>w<<32-x|y>>>x;ue.shrSL=o;const c=(w,y,x)=>w>>>x|y<<32-x;ue.rotrSH=c;const u=(w,y,x)=>w<<32-x|y>>>x;ue.rotrSL=u;const d=(w,y,x)=>w<<64-x|y>>>x-32;ue.rotrBH=d;const l=(w,y,x)=>w>>>x-32|y<<64-x;ue.rotrBL=l;const f=(w,y)=>y;ue.rotr32H=f;const b=(w,y)=>w;ue.rotr32L=b;const T=(w,y,x)=>w<<x|y>>>32-x;ue.rotlSH=T;const v=(w,y,x)=>y<<x|w>>>32-x;ue.rotlSL=v;const p=(w,y,x)=>y<<x-32|w>>>64-x;ue.rotlBH=p;const O=(w,y,x)=>w<<x-32|y>>>64-x;ue.rotlBL=O;function I(w,y,x,C){const B=(y>>>0)+(C>>>0);return{h:w+x+(B/2**32|0)|0,l:B|0}}const h=(w,y,x)=>(w>>>0)+(y>>>0)+(x>>>0);ue.add3L=h;const j=(w,y,x,C)=>y+x+C+(w/2**32|0)|0;ue.add3H=j;const i=(w,y,x,C)=>(w>>>0)+(y>>>0)+(x>>>0)+(C>>>0);ue.add4L=i;const g=(w,y,x,C,B)=>y+x+C+B+(w/2**32|0)|0;ue.add4H=g;const _=(w,y,x,C,B)=>(w>>>0)+(y>>>0)+(x>>>0)+(C>>>0)+(B>>>0);ue.add5L=_;const E=(w,y,x,C,B,H)=>y+x+C+B+H+(w/2**32|0)|0;ue.add5H=E;const R={fromBig:n,split:r,toBig:s,shrSH:a,shrSL:o,rotrSH:c,rotrSL:u,rotrBH:d,rotrBL:l,rotr32H:f,rotr32L:b,rotlSH:T,rotlSL:v,rotlBH:p,rotlBL:O,add:I,add3L:h,add3H:j,add4L:i,add4H:g,add5H:E,add5L:_};return ue.default=R,ue}var Nd={},ro={},wl;function v6(){return wl||(wl=1,Object.defineProperty(ro,"__esModule",{value:!0}),ro.crypto=void 0,ro.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),ro}var jl;function yr(){return jl||(jl=1,(function(e){Object.defineProperty(e,"__esMo
23dule",{value:!0}),e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.Hash=e.nextTick=e.swap32IfBE=e.byteSwapIfBE=e.swap8IfBE=e.isLE=void 0,e.isBytes=n,e.anumber=r,e.abytes=s,e.ahash=a,e.aexists=o,e.aoutput=c,e.u8=u,e.u32=d,e.clean=l,e.createView=f,e.rotr=b,e.rotl=T,e.byteSwap=v,e.byteSwap32=p,e.bytesToHex=h,e.hexToBytes=g,e.asyncLoop=E,e.utf8ToBytes=R,e.bytesToUtf8=w,e.toBytes=y,e.kdfInputToBytes=x,e.concatBytes=C,e.checkOpts=B,e.createHasher=F,e.createOptHasher=k,e.createXOFer=m,e.randomBytes=M;const t=v6();function n(A){return A instanceof Uint8Array||ArrayBuffer.isView(A)&&A.constructor.name==="Uint8Array"}function r(A){if(!Number.isSafeInteger(A)||A<0)throw new Error("positive integer expected, got "+A)}function s(A,...P){if(!n(A))throw new Error("Uint8Array expected");if(P.length>0&&!P.includes(A.length))throw new Error("Uint8Array expected of length "+P+", got length="+A.length)}function a(A){if(typeof A!="function"||typeof A.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");r(A.outputLen),r(A.blockLen)}function o(A,P=!0){if(A.destroyed)throw new Error("Hash instance has been destroyed");if(P&&A.finished)throw new Error("Hash#digest() has already been called")}function c(A,P){s(A);const S=P.outputLen;if(A.length<S)throw new Error("digestInto() expects output buffer of length at least "+S)}function u(A){return new Uint8Array(A.buffer,A.byteOffset,A.byteLength)}function d(A){return new Uint32Array(A.buffer,A.byteOffset,Math.floor(A.byteLength/4))}function l(...A){for(let P=0;P<A.length;P++)A[P].fill(0)}function f(A){return new DataView(A.buffer,A.byteOffset,A.byteLength)}function b(A,P){return A<<32-P|A>>>P}function T(A,P){return A<<P|A>>>32-P>>>0}e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function v(A){return A<<24&4278190080|A<<8&16711680|A>>>8&65280|A>>>24&255}e.swap8IfBE=e.isLE?A=>A:A=>v(A),e.byteSwapIfBE=e.swap8IfBE;function p(A){for(let P=0;P<A.length;P++)A[P]=v(A[P]);return A}e.swap32IfBE=e.isLE?A=>A:p;const O=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",I=Array.from({length:256},(A,P)=>P.toString(16).padStart(2,"0"));function h(A){if(s(A),O)return A.toHex();let P="";for(let S=0;S<A.length;S++)P+=I[A[S]];return P}const j={_0:48,_9:57,A:65,F:70,a:97,f:102};function i(A){if(A>=j._0&&A<=j._9)return A-j._0;if(A>=j.A&&A<=j.F)return A-(j.A-10);if(A>=j.a&&A<=j.f)return A-(j.a-10)}function g(A){if(typeof A!="string")throw new Error("hex string expected, got "+typeof A);if(O)return Uint8Array.fromHex(A);const P=A.length,S=P/2;if(P%2)throw new Error("hex string expected, got unpadded hex of length "+P);const q=new Uint8Array(S);for(let N=0,U=0;N<S;N++,U+=2){const L=i(A.charCodeAt(U)),z=i(A.charCodeAt(U+1));if(L===void 0||z===void 0){const D=A[U]+A[U+1];throw new Error('hex string expected, got non-hex character "'+D+'" at index '+U)}q[N]=L*16+z}return q}const _=async()=>{};e.nextTick=_;async function E(A,P,S){let q=Date.now();for(let N=0;N<A;N++){S(N);const U=Date.now()-q;U>=0&&U<P||(await(0,e.nextTick)(),q+=U)}}function R(A){if(typeof A!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(A))}function w(A){return new TextDecoder().decode(A)}function y(A){return typeof A=="string"&&(A=R(A)),s(A),A}function x(A){return typeof A=="string"&&(A=R(A)),s(A),A}function C(...A){let P=0;for(let q=0;q<A.length;q++){const N=A[q];s(N),P+=N.length}const S=new Uint8Array(P);for(let q=0,N=0;q<A.length;q++){const U=A[q];S.set(U,N),N+=U.length}return S}function B(A,P){if(P!==void 0&&{}.toString.call(P)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(A,P)}class H{}e.Hash=H;function F(A){const P=q=>A().update(y(q)).digest(),S=A();return P.outputLen=S.outputLen,P.blockLen=S.blockLen,P.create=()=>A(),P}function k(A){const P=(q,N)=>A(N).update(y(q)).digest(),S=A({});return P.outputLen=S.outputLen,P.blockLen=S.blockLen,P.create=q=>A(q),P}function m(A){const P=(q,N)=>A(N).update(y(q)).digest(),S=A({});return P.outputLen=S.outputLen,P.blockLen=S.blockLen,P.create=q=>A(q),P}e.wrapConstructor=F,e.wrapConstructorWithOpts=k,e.wrapXOFConstructorWithOpts=m;function M(A=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(A));if(t.crypto&&typeof t.crypto.randomBytes=="function")return Uint8Array.from(t.crypto.randomBytes(A));throw new Error("crypto.getRandomValues must be defined")}})(Nd)),Nd}var Pl;function E6(){if(Pl)return Se;
23Pl=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.shake256=Se.shake128=Se.keccak_512=Se.keccak_384=Se.keccak_256=Se.keccak_224=Se.sha3_512=Se.sha3_384=Se.sha3_256=Se.sha3_224=Se.Keccak=void 0,Se.keccakP=O;const e=Cp(),t=yr(),n=BigInt(0),r=BigInt(1),s=BigInt(2),a=BigInt(7),o=BigInt(256),c=BigInt(113),u=[],d=[],l=[];for(let i=0,g=r,_=1,E=0;i<24;i++){[_,E]=[E,(2*_+3*E)%5],u.push(2*(5*E+_)),d.push((i+1)*(i+2)/2%64);let R=n;for(let w=0;w<7;w++)g=(g<<r^(g>>a)*c)%o,g&s&&(R^=r<<(r<<BigInt(w))-r);l.push(R)}const f=(0,e.split)(l,!0),b=f[0],T=f[1],v=(i,g,_)=>_>32?(0,e.rotlBH)(i,g,_):(0,e.rotlSH)(i,g,_),p=(i,g,_)=>_>32?(0,e.rotlBL)(i,g,_):(0,e.rotlSL)(i,g,_);function O(i,g=24){const _=new Uint32Array(10);for(let E=24-g;E<24;E++){for(let y=0;y<10;y++)_[y]=i[y]^i[y+10]^i[y+20]^i[y+30]^i[y+40];for(let y=0;y<10;y+=2){const x=(y+8)%10,C=(y+2)%10,B=_[C],H=_[C+1],F=v(B,H,1)^_[x],k=p(B,H,1)^_[x+1];for(let m=0;m<50;m+=10)i[y+m]^=F,i[y+m+1]^=k}let R=i[2],w=i[3];for(let y=0;y<24;y++){const x=d[y],C=v(R,w,x),B=p(R,w,x),H=u[y];R=i[H],w=i[H+1],i[H]=C,i[H+1]=B}for(let y=0;y<50;y+=10){for(let x=0;x<10;x++)_[x]=i[y+x];for(let x=0;x<10;x++)i[y+x]^=~_[(x+2)%10]&_[(x+4)%10]}i[0]^=b[E],i[1]^=T[E]}(0,t.clean)(_)}class I extends t.Hash{constructor(g,_,E,R=!1,w=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=g,this.suffix=_,this.outputLen=E,this.enableXOF=R,this.rounds=w,(0,t.anumber)(E),!(0<g&&g<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,t.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,t.swap32IfBE)(this.state32),O(this.state32,this.rounds),(0,t.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(g){(0,t.aexists)(this),g=(0,t.toBytes)(g),(0,t.abytes)(g);const{blockLen:_,state:E}=this,R=g.length;for(let w=0;w<R;){const y=Math.min(_-this.pos,R-w);for(let x=0;x<y;x++)E[this.pos++]^=g[w++];this.pos===_&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:g,suffix:_,pos:E,blockLen:R}=this;g[E]^=_,(_&128)!==0&&E===R-1&&this.keccak(),g[R-1]^=128,this.keccak()}writeInto(g){(0,t.aexists)(this,!1),(0,t.abytes)(g),this.finish();const _=this.state,{blockLen:E}=this;for(let R=0,w=g.length;R<w;){this.posOut>=E&&this.keccak();const y=Math.min(E-this.posOut,w-R);g.set(_.subarray(this.posOut,this.posOut+y),R),this.posOut+=y,R+=y}return g}xofInto(g){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(g)}xof(g){return(0,t.anumber)(g),this.xofInto(new Uint8Array(g))}digestInto(g){if((0,t.aoutput)(g,this),this.finished)throw new Error("digest() was already called");return this.writeInto(g),this.destroy(),g}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,t.clean)(this.state)}_cloneInto(g){const{blockLen:_,suffix:E,outputLen:R,rounds:w,enableXOF:y}=this;return g||(g=new I(_,E,R,y,w)),g.state32.set(this.state32),g.pos=this.pos,g.posOut=this.posOut,g.finished=this.finished,g.rounds=w,g.suffix=E,g.outputLen=R,g.enableXOF=y,g.destroyed=this.destroyed,g}}Se.Keccak=I;const h=(i,g,_)=>(0,t.createHasher)(()=>new I(g,i,_));Se.sha3_224=h(6,144,224/8),Se.sha3_256=h(6,136,256/8),Se.sha3_384=h(6,104,384/8),Se.sha3_512=h(6,72,512/8),Se.keccak_224=h(1,144,224/8),Se.keccak_256=h(1,136,256/8),Se.keccak_384=h(1,104,384/8),Se.keccak_512=h(1,72,512/8);const j=(i,g,_)=>(0,t.createXOFer)((E={})=>new I(g,i,E.dkLen===void 0?_:E.dkLen,!0));return Se.shake128=j(31,168,128/8),Se.shake256=j(31,136,256/8),Se}var Al;function ct(){if(Al)return Ui;Al=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.keccak256=s;const e=E6(),t=nt(),n=Pe(),r=ie();function s(a,o){const c=o||"hex",u=(0,e.keccak_256)((0,t.isHex)(a,{strict:!1})?(0,n.toBytes)(a):a);return c==="bytes"?u:(0,r.toHex)(u)}return Ui}var no={},zi={},Di={},Tl;function w6(){if(Tl)return Di;Tl=1,Object.defineProperty(Di,"__esModule",{value:!0}),Di.hashSignature=r;const e=Pe(),t=ct(),n=s=>(0,t.keccak256)((0,e.toBytes)(s));function r(s){return n(s)}return Di}var oo={},Gi={},Sl;function j6(){if(Sl)return Gi;Sl=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.normalizeSignature=t;
23const e=fe();function t(n){let r=!0,s="",a=0,o="",c=!1;for(let u=0;u<n.length;u++){const d=n[u];if(["(",")",","].includes(d)&&(r=!0),d==="("&&a++,d===")"&&a--,!!r){if(a===0){if(d===" "&&["event","function",""].includes(o))o="";else if(o+=d,d===")"){c=!0;break}continue}if(d===" "){n[u-1]!==","&&s!==","&&s!==",("&&(s="",r=!1);continue}o+=d,s+=d}}if(!c)throw new e.BaseError("Unable to normalize signature.");return o}return Gi}var Il;function gf(){if(Il)return oo;Il=1,Object.defineProperty(oo,"__esModule",{value:!0}),oo.toSignature=void 0;const e=mr(),t=j6(),n=r=>{const s=typeof r=="string"?r:(0,e.formatAbiItem)(r);return(0,t.normalizeSignature)(s)};return oo.toSignature=n,oo}var Bl;function zu(){if(Bl)return zi;Bl=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.toSignatureHash=n;const e=w6(),t=gf();function n(r){return(0,e.hashSignature)((0,t.toSignature)(r))}return zi}var xl;function xn(){if(xl)return no;xl=1,Object.defineProperty(no,"__esModule",{value:!0}),no.toEventSelector=void 0;const e=zu();return no.toEventSelector=e.toSignatureHash,no}var io={},so={},Rl;function St(){if(Rl)return so;Rl=1,Object.defineProperty(so,"__esModule",{value:!0}),so.InvalidAddressError=void 0;const e=fe();class t extends e.BaseError{constructor({address:r}){super(`Address "${r}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}return so.InvalidAddressError=t,so}var Fd={},ao={},Ol;function Xr(){if(Ol)return ao;Ol=1,Object.defineProperty(ao,"__esModule",{value:!0}),ao.LruMap=void 0;class e extends Map{constructor(n){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=n}get(n){const r=super.get(n);return super.has(n)&&r!==void 0&&(this.delete(n),super.set(n,r)),r}set(n,r){if(super.set(n,r),this.maxSize&&this.size>this.maxSize){const s=this.keys().next().value;s&&this.delete(s)}return this}}return ao.LruMap=e,ao}var co={},Cl;function yt(){if(Cl)return co;Cl=1,Object.defineProperty(co,"__esModule",{value:!0}),co.checksumAddress=o,co.getAddress=c;const e=St(),t=Pe(),n=ct(),r=Xr(),s=ut(),a=new r.LruMap(8192);function o(u,d){if(a.has(`${u}.${d}`))return a.get(`${u}.${d}`);const l=d?`${d}${u.toLowerCase()}`:u.substring(2).toLowerCase(),f=(0,n.keccak256)((0,t.stringToBytes)(l),"bytes"),b=(d?l.substring(`${d}0x`.length):l).split("");for(let v=0;v<40;v+=2)f[v>>1]>>4>=8&&b[v]&&(b[v]=b[v].toUpperCase()),(f[v>>1]&15)>=8&&b[v+1]&&(b[v+1]=b[v+1].toUpperCase());const T=`0x${b.join("")}`;return a.set(`${u}.${d}`,T),T}function c(u,d){if(!(0,s.isAddress)(u,{strict:!1}))throw new e.InvalidAddressError({address:u});return o(u,d)}return co}var ql;function ut(){return ql||(ql=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isAddressCache=void 0,e.isAddress=s;const t=Xr(),n=yt(),r=/^0x[a-fA-F0-9]{40}$/;e.isAddressCache=new t.LruMap(8192);function s(a,o){const{strict:c=!0}=o??{},u=`${a}.${c}`;if(e.isAddressCache.has(u))return e.isAddressCache.get(u);const d=r.test(a)?a.toLowerCase()===a?!0:c?(0,n.checksumAddress)(a)===a:!0:!1;return e.isAddressCache.set(u,d),d}})(Fd)),Fd}var fn={},Hl;function Le(){if(Hl)return fn;Hl=1,Object.defineProperty(fn,"__esModule",{value:!0}),fn.concat=e,fn.concatBytes=t,fn.concatHex=n;function e(r){return typeof r[0]=="string"?n(r):t(r)}function t(r){let s=0;for(const c of r)s+=c.length;const a=new Uint8Array(s);let o=0;for(const c of r)a.set(c,o),o+=c.length;return a}function n(r){return`0x${r.reduce((s,a)=>s+a.replace("0x",""),"")}`}return fn}var ln={},Ml;function vt(){if(Ml)return ln;Ml=1,Object.defineProperty(ln,"__esModule",{value:!0}),ln.slice=r,ln.sliceBytes=o,ln.sliceHex=c;const e=Uu(),t=nt(),n=at();function r(u,d,l,{strict:f}={}){return(0,t.isHex)(u,{strict:!1})?c(u,d,l,{strict:f}):o(u,d,l,{strict:f})}function s(u,d){if(typeof d=="number"&&d>0&&d>(0,n.size)(u)-1)throw new e.SliceOffsetOutOfBoundsError({offset:d,position:"start",size:(0,n.size)(u)})}function a(u,d,l){if(typeof d=="number"&&typeof l=="number"&&(0,n.size)(u)!==l-d)throw new e.SliceOffsetOutOfBoundsError({offset:l,position:"end",size:(0,n.size)(u)})}
23function o(u,d,l,{strict:f}={}){s(u,d);const b=u.slice(d,l);return f&&a(b,d,l),b}function c(u,d,l,{strict:f}={}){s(u,d);const b=`0x${u.replace("0x","").slice((d??0)*2,(l??u.length)*2)}`;return f&&a(b,d,l),b}return ln}var Vt={},kl;function Du(){return kl||(kl=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.integerRegex=Vt.bytesRegex=Vt.arrayRegex=void 0,Vt.arrayRegex=/^(.*)\[([0-9]*)\]$/,Vt.bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Vt.integerRegex=/^(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)?$/),Vt}var Nl;function It(){if(Nl)return io;Nl=1,Object.defineProperty(io,"__esModule",{value:!0}),io.encodeAbiParameters=f,io.getArrayComponents=_;const e=qe(),t=St(),n=fe(),r=Bn(),s=ut(),a=Le(),o=hr(),c=at(),u=vt(),d=ie(),l=Du();function f(E,R){if(E.length!==R.length)throw new e.AbiEncodingLengthMismatchError({expectedLength:E.length,givenLength:R.length});const w=b({params:E,values:R}),y=v(w);return y.length===0?"0x":y}function b({params:E,values:R}){const w=[];for(let y=0;y<E.length;y++)w.push(T({param:E[y],value:R[y]}));return w}function T({param:E,value:R}){const w=_(E.type);if(w){const[y,x]=w;return O(R,{length:y,param:{...E,type:x}})}if(E.type==="tuple")return g(R,{param:E});if(E.type==="address")return p(R);if(E.type==="bool")return h(R);if(E.type.startsWith("uint")||E.type.startsWith("int")){const y=E.type.startsWith("int"),[,,x="256"]=l.integerRegex.exec(E.type)??[];return j(R,{signed:y,size:Number(x)})}if(E.type.startsWith("bytes"))return I(R,{param:E});if(E.type==="string")return i(R);throw new e.InvalidAbiEncodingTypeError(E.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function v(E){let R=0;for(let C=0;C<E.length;C++){const{dynamic:B,encoded:H}=E[C];B?R+=32:R+=(0,c.size)(H)}const w=[],y=[];let x=0;for(let C=0;C<E.length;C++){const{dynamic:B,encoded:H}=E[C];B?(w.push((0,d.numberToHex)(R+x,{size:32})),y.push(H),x+=(0,c.size)(H)):w.push(H)}return(0,a.concat)([...w,...y])}function p(E){if(!(0,s.isAddress)(E))throw new t.InvalidAddressError({address:E});return{dynamic:!1,encoded:(0,o.padHex)(E.toLowerCase())}}function O(E,{length:R,param:w}){const y=R===null;if(!Array.isArray(E))throw new e.InvalidArrayError(E);if(!y&&E.length!==R)throw new e.AbiEncodingArrayLengthMismatchError({expectedLength:R,givenLength:E.length,type:`${w.type}[${R}]`});let x=!1;const C=[];for(let B=0;B<E.length;B++){const H=T({param:w,value:E[B]});H.dynamic&&(x=!0),C.push(H)}if(y||x){const B=v(C);if(y){const H=(0,d.numberToHex)(C.length,{size:32});return{dynamic:!0,encoded:C.length>0?(0,a.concat)([H,B]):H}}if(x)return{dynamic:!0,encoded:B}}return{dynamic:!1,encoded:(0,a.concat)(C.map(({encoded:B})=>B))}}function I(E,{param:R}){const[,w]=R.type.split("bytes"),y=(0,c.size)(E);if(!w){let x=E;return y%32!==0&&(x=(0,o.padHex)(x,{dir:"right",size:Math.ceil((E.length-2)/2/32)*32})),{dynamic:!0,encoded:(0,a.concat)([(0,o.padHex)((0,d.numberToHex)(y,{size:32})),x])}}if(y!==Number.parseInt(w,10))throw new e.AbiEncodingBytesSizeMismatchError({expectedSize:Number.parseInt(w,10),value:E});return{dynamic:!1,encoded:(0,o.padHex)(E,{dir:"right"})}}function h(E){if(typeof E!="boolean")throw new n.BaseError(`Invalid boolean value: "${E}" (type: ${typeof E}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:(0,o.padHex)((0,d.boolToHex)(E))}}function j(E,{signed:R,size:w=256}){if(typeof w=="number"){const y=2n**(BigInt(w)-(R?1n:0n))-1n,x=R?-y-1n:0n;if(E>y||E<x)throw new r.IntegerOutOfRangeError({max:y.toString(),min:x.toString(),signed:R,size:w/8,value:E.toString()})}return{dynamic:!1,encoded:(0,d.numberToHex)(E,{size:32,signed:R})}}function i(E){const R=(0,d.stringToHex)(E),w=Math.ceil((0,c.size)(R)/32),y=[];for(let x=0;x<w;x++)y.push((0,o.padHex)((0,u.slice)(R,x*32,(x+1)*32),{dir:"right"}));return{dynamic:!0,encoded:(0,a.concat)([(0,o.padHex)((0,d.numberToHex)((0,c.size)(R),{size:32})),...y])}}function g(E,{param:R}){let w=!1;const y=[];for(let x=0;x<R.components.length;x++){const C=R.components[x],B=Array.isArray(E)?x:C.name,H=T({param:C,value:E[B]});y.push(H),H.dynamic&&(w=!0)}return{dynamic:w,encoded:w?v(y):(0,a.concat)(y.map(({encoded:x})=>x))}}function _(E){const R=E.match(/^(.*)\[(\d+)?\]$/);return R?[R[2]?Number(R[2]):null,R[1]]:void 0}return io}var bn={},uo={},Fl;function Qr(){if(Fl)return uo;Fl=1,Object.defineProperty(uo,"__esModule",{value:!0}),uo.toFunctionSelector=void 0;const e=vt(),t=zu(),n=r=>(0,e.slice)((0,t.toSignatureHash)(r),0,4);return uo.toFunctionSelector=n,uo}var Ll;function tr(){if(Ll)return bn;Ll=1,Object.defineProperty(bn,"__esModule",{value:!0}),bn.getAbiItem=a,bn.isArgOfType=o,bn.getAmbiguousTypes=c;const e=qe(),t=nt(),n=ut(),r=xn(),s=Qr();function a(u){const{abi:d,args:l=[],name:f}=u,b=(0,t.isHex)(f,{strict:!1}),T=d.filter(p=>b?p.type==="function"?(0,s.toFunctionSelector)(p)===f:p.type==="event"?(0,r.toEventSelector)(p)===f:!1:"name"in p&&p.name===f);if(T.length===0)return;if(T.length===1)return T[0];let v;for(const p of T){if(!("inputs"in p))continue;if(!l||l.length===0){if(!p.inputs||p.inputs.length===0)return p;continue}if(!p.inputs||p.inputs.length===0||p.inputs.length!==l.length)continue;if(l.every((I,h)=>
23{const j="inputs"in p&&p.inputs[h];return j?o(I,j):!1})){if(v&&"inputs"in v&&v.inputs){const I=c(p.inputs,v.inputs,l);if(I)throw new e.AbiItemAmbiguityError({abiItem:p,type:I[0]},{abiItem:v,type:I[1]})}v=p}}return v||T[0]}function o(u,d){const l=typeof u,f=d.type;switch(f){case"address":return(0,n.isAddress)(u,{strict:!1});case"bool":return l==="boolean";case"function":return l==="string";case"string":return l==="string";default:return f==="tuple"&&"components"in d?Object.values(d.components).every((b,T)=>l==="object"&&o(Object.values(u)[T],b)):/^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(f)?l==="number"||l==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(f)?l==="string"||u instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(f)?Array.isArray(u)&&u.every(b=>o(b,{...d,type:f.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function c(u,d,l){for(const f in u){const b=u[f],T=d[f];if(b.type==="tuple"&&T.type==="tuple"&&"components"in b&&"components"in T)return c(b.components,T.components,l[f]);const v=[b.type,T.type];if(v.includes("address")&&v.includes("bytes20")?!0:v.includes("address")&&v.includes("string")?(0,n.isAddress)(l[f],{strict:!1}):v.includes("address")&&v.includes("bytes")?(0,n.isAddress)(l[f],{strict:!1}):!1)return v}}return bn}var Ul;function $r(){if(Ul)return ki;Ul=1,Object.defineProperty(ki,"__esModule",{value:!0}),ki.encodeEventTopics=d;const e=qe(),t=Op(),n=Pe(),r=ct(),s=xn(),a=It(),o=$t(),c=tr(),u="/docs/contract/encodeEventTopics";function d(f){const{abi:b,eventName:T,args:v}=f;let p=b[0];if(T){const j=(0,c.getAbiItem)({abi:b,name:T});if(!j)throw new e.AbiEventNotFoundError(T,{docsPath:u});p=j}if(p.type!=="event")throw new e.AbiEventNotFoundError(void 0,{docsPath:u});const O=(0,o.formatAbiItem)(p),I=(0,s.toEventSelector)(O);let h=[];if(v&&"inputs"in p){const j=p.inputs?.filter(g=>"indexed"in g&&g.indexed),i=Array.isArray(v)?v:Object.values(v).length>0?j?.map(g=>v[g.name])??[]:[];i.length>0&&(h=j?.map((g,_)=>Array.isArray(i[_])?i[_].map((E,R)=>l({param:g,value:i[_][R]})):typeof i[_]<"u"&&i[_]!==null?l({param:g,value:i[_]}):null)??[])}return[I,...h]}function l({param:f,value:b}){if(f.type==="string"||f.type==="bytes")return(0,r.keccak256)((0,n.toBytes)(b));if(f.type==="tuple"||f.type.match(/^(.*)\[(\d+)?\]$/))throw new t.FilterTypeNotSupportedError(f.type);return(0,a.encodeAbiParameters)([f],[b])}return ki}var Vi={},zl;function Gu(){if(zl)return Vi;zl=1,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.createFilterRequestScope=e;function e(t,{method:n}){const r={};return t.transport.type==="fallback"&&t.transport.onResponse?.(({method:s,response:a,status:o,transport:c})=>{o==="success"&&n===s&&(r[a]=c.request)}),(s=>r[s]||t.request)}return Vi}var Dl;function pf(){if(Dl)return Mi;Dl=1,Object.defineProperty(Mi,"__esModule",{value:!0}),Mi.createContractEventFilter=r;const e=$r(),t=ie(),n=Gu();async function r(s,a){const{address:o,abi:c,args:u,eventName:d,fromBlock:l,strict:f,toBlock:b}=a,T=(0,n.createFilterRequestScope)(s,{method:"eth_newFilter"}),v=d?(0,e.encodeEventTopics)({abi:c,args:u,eventName:d}):void 0,p=await s.request({method:"eth_newFilter",params:[{address:o,fromBlock:typeof l=="bigint"?(0,t.numberToHex)(l):l,toBlock:typeof b=="bigint"?(0,t.numberToHex)(b):b,topics:v}]});return{abi:c,args:u,eventName:d,id:p,request:T(p),strict:!!f,type:"event"}}return Mi}var Wi={},Ki={},Gl;function He(){if(Gl)return Ki;Gl=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.parseAccount=e;function e(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}return Ki}var Zi={},Yi={},Vl;function qp(){if(Vl)return Yi;Vl=1,Object.defineProperty(Yi,"__esModule",{value:!0}),Yi.prepareEncodeFunctionData=a;const e=qe(),t=Qr(),n=$t(),r=tr(),s="/docs/contract/encodeFunctionData";function a(o){const{abi:c,args:u,functionName:d}=o;let l=c[0];if(d){const f=(0,r.getAbiItem)({abi:c,args:u,name:d});if(!f)throw new e.AbiFunctionNotFoundError(d,{docsPath:s});l=f}if(l.type!=="function")throw new e.AbiFunctionNotFoundError(void 0,{docsPath:s});return{abi:[l],functionName:(0,t.toFunctionSelector)((0,n.formatAbiItem)(l))}}return Yi}var Wl;function ot(){if(Wl)return Zi;Wl=1,Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.encodeFunctionData=r;const e=Le(),t=It(),n=qp();function r(s){const{args:a}=s,{abi:o,functionName:c}=s.abi.length===1&&s.functionName?.startsWith("0x")?s:(0,n.prepareEncodeFunctionData)(s),u=o[0],d=c,l="inputs"in u&&u.inputs?(0,t.encodeAbiParameters)(u.inputs,a??[]):void 0;return(0,e.concatHex)([d,l??"0x"])}return Zi}var Ji={},Qe={},Wt={},Kl;
23function _f(){return Kl||(Kl=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.solidityPanic=Wt.solidityError=Wt.panicReasons=void 0,Wt.panicReasons={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."},Wt.solidityError={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Wt.solidityPanic={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}),Wt}var Xi={},Qi={},$i={},Kt={},Zl;function Hp(){if(Zl)return Kt;Zl=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.RecursiveReadLimitExceededError=Kt.PositionOutOfBoundsError=Kt.NegativeOffsetError=void 0;const e=fe();class t extends e.BaseError{constructor({offset:a}){super(`Offset \`${a}\` cannot be negative.`,{name:"NegativeOffsetError"})}}Kt.NegativeOffsetError=t;class n extends e.BaseError{constructor({length:a,position:o}){super(`Position \`${o}\` is out of bounds (\`0 < position < ${a}\`).`,{name:"PositionOutOfBoundsError"})}}Kt.PositionOutOfBoundsError=n;class r extends e.BaseError{constructor({count:a,limit:o}){super(`Recursive read limit of \`${o}\` exceeded (recursive read count: \`${a}\`).`,{name:"RecursiveReadLimitExceededError"})}}return Kt.RecursiveReadLimitExceededError=r,Kt}var Yl;function Ko(){if(Yl)return $i;Yl=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.createCursor=n;const e=Hp(),t={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 e.RecursiveReadLimitExceededError({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(r){if(r<0||r>this.bytes.length-1)throw new e.PositionOutOfBoundsError({length:this.bytes.length,position:r})},decrementPosition(r){if(r<0)throw new e.NegativeOffsetError({offset:r});const s=this.position-r;this.assertPosition(s),this.position=s},getReadCount(r){return this.positionReadCount.get(r||this.position)||0},incrementPosition(r){if(r<0)throw new e.NegativeOffsetError({offset:r});const s=this.position+r;this.assertPosition(s),this.position=s},inspectByte(r){const s=r??this.position;return this.assertPosition(s),this.bytes[s]},inspectBytes(r,s){const a=s??this.position;return this.assertPosition(a+r-1),this.bytes.subarray(a,a+r)},inspectUint8(r){const s=r??this.position;return this.assertPosition(s),this.bytes[s]},inspectUint16(r){const s=r??this.position;return this.assertPosition(s+1),this.dataView.getUint16(s)},inspectUint24(r){const s=r??this.position;return this.assertPosition(s+2),(this.dataView.getUint16(s)<<8)+this.dataView.getUint8(s+2)},inspectUint32(r){const s=r??this.position;return this.assertPosition(s+3),this.dataView.getUint32(s)},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();const r=this.inspectByte();return this.position++,r},readBytes(r,s){this.assertReadLimit(),this._touch();const a=this.inspectBytes(r);return this.position+=s??r,a},readUint8(){this.assertReadLimit(),this._touch();const r=this.inspectUint8();return this.position+=1,r},readUint16(){this.assertReadLimit(),this._touch();const r=this.inspectUint16();return this.position+=2,r},readUint24(){this.assertReadLimit(),this._touch();const r=this.inspectUint24();return this.position+=3,r},readUint32(){this.assertReadLimit(),this._touch();const r=this.inspectUint32();return this.position+=4,r},get remaining(){return this.bytes.length-this.position},setPosition(r){const s=this.position;return this.assertPosition(r),this.position=r,()=>this.position=s},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const r=this.getReadCount();this.positionReadCount.set(this.position,r+1),r>0&&this.recursiveReadCount++}};function n(r,{recursiveReadLimit:s=8192}={}){const a=Object.create(t);return a.bytes=r,a.dataView=new DataView(r.buffer??r,r.byteOffset,r.byteLength),a.positionReadCount=new Map,a.recursiveReadLimit=s,a}return $i}var ar={},Jl;function vf(){if(Jl)return ar;
23Jl=1,Object.defineProperty(ar,"__esModule",{value:!0}),ar.fromBytes=s,ar.bytesToBigInt=a,ar.bytesToBool=o,ar.bytesToNumber=c,ar.bytesToString=u;const e=Bn(),t=er(),n=Ne(),r=ie();function s(d,l){const f=typeof l=="string"?{to:l}:l,b=f.to;return b==="number"?c(d,f):b==="bigint"?a(d,f):b==="boolean"?o(d,f):b==="string"?u(d,f):(0,r.bytesToHex)(d,f)}function a(d,l={}){typeof l.size<"u"&&(0,n.assertSize)(d,{size:l.size});const f=(0,r.bytesToHex)(d,l);return(0,n.hexToBigInt)(f,l)}function o(d,l={}){let f=d;if(typeof l.size<"u"&&((0,n.assertSize)(f,{size:l.size}),f=(0,t.trim)(f)),f.length>1||f[0]>1)throw new e.InvalidBytesBooleanError(f);return!!f[0]}function c(d,l={}){typeof l.size<"u"&&(0,n.assertSize)(d,{size:l.size});const f=(0,r.bytesToHex)(d,l);return(0,n.hexToNumber)(f,l)}function u(d,l={}){let f=d;return typeof l.size<"u"&&((0,n.assertSize)(f,{size:l.size}),f=(0,t.trim)(f,{dir:"right"})),new TextDecoder().decode(f)}return ar}var Xl;function gr(){if(Xl)return Qi;Xl=1,Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.decodeAbiParameters=l;const e=qe(),t=yt(),n=Ko(),r=at(),s=vt(),a=er(),o=vf(),c=Pe(),u=ie(),d=It();function l(_,E){const R=typeof E=="string"?(0,c.hexToBytes)(E):E,w=(0,n.createCursor)(R);if((0,r.size)(R)===0&&_.length>0)throw new e.AbiDecodingZeroDataError;if((0,r.size)(E)&&(0,r.size)(E)<32)throw new e.AbiDecodingDataSizeTooSmallError({data:typeof E=="string"?E:(0,u.bytesToHex)(E),params:_,size:(0,r.size)(E)});let y=0;const x=[];for(let C=0;C<_.length;++C){const B=_[C];w.setPosition(y);const[H,F]=f(w,B,{staticPosition:0});y+=F,x.push(H)}return x}function f(_,E,{staticPosition:R}){const w=(0,d.getArrayComponents)(E.type);if(w){const[y,x]=w;return p(_,{...E,type:x},{length:y,staticPosition:R})}if(E.type==="tuple")return j(_,E,{staticPosition:R});if(E.type==="address")return v(_);if(E.type==="bool")return O(_);if(E.type.startsWith("bytes"))return I(_,E,{staticPosition:R});if(E.type.startsWith("uint")||E.type.startsWith("int"))return h(_,E);if(E.type==="string")return i(_,{staticPosition:R});throw new e.InvalidAbiDecodingTypeError(E.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const b=32,T=32;function v(_){const E=_.readBytes(32);return[(0,t.checksumAddress)((0,u.bytesToHex)((0,s.sliceBytes)(E,-20))),32]}function p(_,E,{length:R,staticPosition:w}){if(!R){const C=(0,o.bytesToNumber)(_.readBytes(T)),B=w+C,H=B+b;_.setPosition(B);const F=(0,o.bytesToNumber)(_.readBytes(b)),k=g(E);let m=0;const M=[];for(let A=0;A<F;++A){_.setPosition(H+(k?A*32:m));const[P,S]=f(_,E,{staticPosition:H});m+=S,M.push(P)}return _.setPosition(w+32),[M,32]}if(g(E)){const C=(0,o.bytesToNumber)(_.readBytes(T)),B=w+C,H=[];for(let F=0;F<R;++F){_.setPosition(B+F*32);const[k]=f(_,E,{staticPosition:B});H.push(k)}return _.setPosition(w+32),[H,32]}let y=0;const x=[];for(let C=0;C<R;++C){const[B,H]=f(_,E,{staticPosition:w+y});y+=H,x.push(B)}return[x,y]}function O(_){return[(0,o.bytesToBool)(_.readBytes(32),{size:32}),32]}function I(_,E,{staticPosition:R}){const[w,y]=E.type.split("bytes");if(!y){const C=(0,o.bytesToNumber)(_.readBytes(32));_.setPosition(R+C);const B=(0,o.bytesToNumber)(_.readBytes(32));if(B===0)return _.setPosition(R+32),["0x",32];const H=_.readBytes(B);return _.setPosition(R+32),[(0,u.bytesToHex)(H),32]}return[(0,u.bytesToHex)(_.readBytes(Number.parseInt(y,10),32)),32]}function h(_,E){const R=E.type.startsWith("int"),w=Number.parseInt(E.type.split("int")[1]||"256",10),y=_.readBytes(32);return[w>48?(0,o.bytesToBigInt)(y,{signed:R}):(0,o.bytesToNumber)(y,{signed:R}),32]}function j(_,E,{staticPosition:R}){const w=E.components.length===0||E.components.some(({name:C})=>!C),y=w?[]:{};let x=0;if(g(E)){const C=(0,o.bytesToNumber)(_.readBytes(T)),B=R+C;for(let H=0;H<E.components.length;++H){const F=E.components[H];_.setPosition(B+x);const[k,m]=f(_,F,{staticPosition:B});x+=m,y[w?H:F?.name]=k}return _.setPosition(R+32),[y,32]}for(let C=0;C<E.components.length;++C){const B=E.components[C],[H,F]=f(_,B,{staticPosition:R});y[w?C:B?.name]=H,x+=F}return[y,x]}function i(_,{staticPosition:E}){const R=(0,o.bytesToNumber)(_.readBytes(32)),w=E+R;_.setPosition(w);const y=(0,o.bytesToNumber)(_.readBytes(32));if(y===0)return _.setPosition(E+32),["",32];const x=_.readBytes(y,32),C=(0,o.bytesToString)((0,a.trim)(x));return _.setPosition(E+32),[C,32]}function g(_){const{type:E}=_;if(E==="string"||E==="bytes"||E.endsWith("[]"))return!0;
23if(E==="tuple")return _.components?.some(g);const R=(0,d.getArrayComponents)(_.type);return!!(R&&g({..._,type:R[1]}))}return Qi}var Ql;function Vu(){if(Ql)return Xi;Ql=1,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.decodeErrorResult=o;const e=_f(),t=qe(),n=vt(),r=Qr(),s=gr(),a=$t();function o(c){const{abi:u,data:d}=c,l=(0,n.slice)(d,0,4);if(l==="0x")throw new t.AbiDecodingZeroDataError;const b=[...u||[],e.solidityError,e.solidityPanic].find(T=>T.type==="error"&&l===(0,r.toFunctionSelector)((0,a.formatAbiItem)(T)));if(!b)throw new t.AbiErrorSignatureNotFoundError(l,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:b,args:"inputs"in b&&b.inputs&&b.inputs.length>0?(0,s.decodeAbiParameters)(b.inputs,(0,n.slice)(d,4)):void 0,errorName:b.name}}return Xi}var es={},fo={},$l;function Ve(){if($l)return fo;$l=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.stringify=void 0;const e=(t,n,r)=>JSON.stringify(t,(s,a)=>{const o=typeof a=="bigint"?a.toString():a;return typeof n=="function"?n(s,o):o},r);return fo.stringify=e,fo}var eb;function Mp(){if(eb)return es;eb=1,Object.defineProperty(es,"__esModule",{value:!0}),es.formatAbiItemWithArgs=t;const e=Ve();function t({abiItem:n,args:r,includeFunctionName:s=!0,includeName:a=!1}){if("name"in n&&"inputs"in n&&n.inputs)return`${s?n.name:""}(${n.inputs.map((o,c)=>`${a&&o.name?`${o.name}: `:""}${typeof r[c]=="object"?(0,e.stringify)(r[c]):r[c]}`).join(", ")})`}return es}var ts={},Zt={},tb;function Zo(){return tb||(tb=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.weiUnits=Zt.gweiUnits=Zt.etherUnits=void 0,Zt.etherUnits={gwei:9,wei:18},Zt.gweiUnits={ether:-9,wei:9},Zt.weiUnits={ether:-18,gwei:-9}),Zt}var rs={},rb;function Wu(){if(rb)return rs;rb=1,Object.defineProperty(rs,"__esModule",{value:!0}),rs.formatUnits=e;function e(t,n){let r=t.toString();const s=r.startsWith("-");s&&(r=r.slice(1)),r=r.padStart(n,"0");let[a,o]=[r.slice(0,r.length-n),r.slice(r.length-n)];return o=o.replace(/(0+)$/,""),`${s?"-":""}${a||"0"}${o?`.${o}`:""}`}return rs}var nb;function Yo(){if(nb)return ts;nb=1,Object.defineProperty(ts,"__esModule",{value:!0}),ts.formatEther=n;const e=Zo(),t=Wu();function n(r,s="wei"){return(0,t.formatUnits)(r,e.etherUnits[s])}return ts}var ns={},ob;function en(){if(ob)return ns;ob=1,Object.defineProperty(ns,"__esModule",{value:!0}),ns.formatGwei=n;const e=Zo(),t=Wu();function n(r,s="wei"){return(0,t.formatUnits)(r,e.gweiUnits[s])}return ns}var Yt={},ib;function Ef(){if(ib)return Yt;ib=1,Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.StateAssignmentConflictError=Yt.AccountStateConflictError=void 0,Yt.prettyStateMapping=r,Yt.prettyStateOverride=s;const e=fe();class t extends e.BaseError{constructor({address:o}){super(`State for account "${o}" is set multiple times.`,{name:"AccountStateConflictError"})}}Yt.AccountStateConflictError=t;class n extends e.BaseError{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}Yt.StateAssignmentConflictError=n;function r(a){return a.reduce((o,{slot:c,value:u})=>`${o}        ${c}: ${u}
24`,"")}function s(a){return a.reduce((o,{address:c,...u})=>{let d=`${o}    ${c}:
25`;return u.nonce&&(d+=`      nonce: ${u.nonce}
26`),u.balance&&(d+=`      balance: ${u.balance}
27`),u.code&&(d+=`      code: ${u.code}
28`),u.state&&(d+=`      state:
29`,d+=r(u.state)),u.stateDiff&&(d+=`      stateDiff:
30`,d+=r(u.stateDiff)),d},`  State Override:
31`).slice(0,-1)}return Yt}var Ie={},sb;function dt(){if(sb)return Ie;sb=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.WaitForTransactionReceiptTimeoutError=Ie.TransactionReceiptRevertedError=Ie.TransactionReceiptNotFoundError=Ie.TransactionNotFoundError=Ie.TransactionExecutionError=Ie.InvalidStorageKeySizeError=Ie.InvalidSerializedTransactionError=Ie.InvalidSerializedTransactionTypeError=Ie.InvalidSerializableTransactionError=Ie.InvalidLegacyVError=Ie.FeeConflictError=void 0,Ie.prettyPrint=r;const e=Yo(),t=en(),n=fe();function r(p){const O=Object.entries(p).map(([h,j])=>j===void 0||j===!1?null:[h,j]).filter(Boolean),I=O.reduce((h,[j])=>Math.max(h,j.length),0);return O.map(([h,j])=>`  ${`${h}:`.padEnd(I+1)}  ${j}`).join(`
32`)}class s extends n.BaseError{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
33`),{name:"FeeConflictError"})}}Ie.FeeConflictError=s;class a extends n.BaseError{constructor({v:O}){super(`Invalid \`v\` value "${O}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}Ie.InvalidLegacyVError=a;class o extends n.BaseError{constructor({transaction:O}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",r(O),"}","","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","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}Ie.InvalidSerializableTransactionError=o;class c extends n.BaseError{constructor({serializedType:O}){super(`Serialized transaction type "${O}
33" is invalid.`,{name:"InvalidSerializedTransactionType"}),Object.defineProperty(this,"serializedType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.serializedType=O}}Ie.InvalidSerializedTransactionTypeError=c;class u extends n.BaseError{constructor({attributes:O,serializedTransaction:I,type:h}){const j=Object.entries(O).map(([i,g])=>typeof g>"u"?i:void 0).filter(Boolean);super(`Invalid serialized transaction of type "${h}" was provided.`,{metaMessages:[`Serialized Transaction: "${I}"`,j.length>0?`Missing Attributes: ${j.join(", ")}`:""].filter(Boolean),name:"InvalidSerializedTransactionError"}),Object.defineProperty(this,"serializedTransaction",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.serializedTransaction=I,this.type=h}}Ie.InvalidSerializedTransactionError=u;class d extends n.BaseError{constructor({storageKey:O}){super(`Size for storage key "${O}" is invalid. Expected 32 bytes. Got ${Math.floor((O.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}Ie.InvalidStorageKeySizeError=d;class l extends n.BaseError{constructor(O,{account:I,docsPath:h,chain:j,data:i,gas:g,gasPrice:_,maxFeePerGas:E,maxPriorityFeePerGas:R,nonce:w,to:y,value:x}){const C=r({chain:j&&`${j?.name} (id: ${j?.id})`,from:I?.address,to:y,value:typeof x<"u"&&`${(0,e.formatEther)(x)} ${j?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:g,gasPrice:typeof _<"u"&&`${(0,t.formatGwei)(_)} gwei`,maxFeePerGas:typeof E<"u"&&`${(0,t.formatGwei)(E)} gwei`,maxPriorityFeePerGas:typeof R<"u"&&`${(0,t.formatGwei)(R)} gwei`,nonce:w});super(O.shortMessage,{cause:O,docsPath:h,metaMessages:[...O.metaMessages?[...O.metaMessages," "]:[],"Request Arguments:",C].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=O}}Ie.TransactionExecutionError=l;class f extends n.BaseError{constructor({blockHash:O,blockNumber:I,blockTag:h,hash:j,index:i}){let g="Transaction";h&&i!==void 0&&(g=`Transaction at block time "${h}" at index "${i}"`),O&&i!==void 0&&(g=`Transaction at block hash "${O}" at index "${i}"`),I&&i!==void 0&&(g=`Transaction at block number "${I}" at index "${i}"`),j&&(g=`Transaction with hash "${j}"`),super(`${g} could not be found.`,{name:"TransactionNotFoundError"})}}Ie.TransactionNotFoundError=f;class b extends n.BaseError{constructor({hash:O}){super(`Transaction receipt with hash "${O}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}Ie.TransactionReceiptNotFoundError=b;class T extends n.BaseError{constructor({receipt:O}){super(`Transaction with hash "${O.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=O}}Ie.TransactionReceiptRevertedError=T;class v extends n.BaseError{constructor({hash:O}){super(`Timed out while waiting for transaction with hash "${O}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}return Ie.WaitForTransactionReceiptTimeoutError=v,Ie}var Hr={},ab;function wf(){if(ab)return Hr;ab=1,Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.getUrl=Hr.getContractAddress=void 0;const e=n=>n;Hr.getContractAddress=e;const t=n=>n;return Hr.getUrl=t,Hr}var cb;function pr(){if(cb)return Qe;cb=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.RawContractError=Qe.CounterfactualDeploymentFailedError=Qe.ContractFunctionZeroDataError=Qe.ContractFunctionRevertedError=Qe.ContractFunctionExecutionError=Qe.CallExecutionError=void 0;const e=He(),t=_f(),n=Vu(),r=$t(),s=Mp(),a=tr(),o=Yo(),c=en(),u=qe(),d=fe(),l=Ef(
33),f=dt(),b=wf();class T extends d.BaseError{constructor(i,{account:g,docsPath:_,chain:E,data:R,gas:w,gasPrice:y,maxFeePerGas:x,maxPriorityFeePerGas:C,nonce:B,to:H,value:F,stateOverride:k}){const m=g?(0,e.parseAccount)(g):void 0;let M=(0,f.prettyPrint)({from:m?.address,to:H,value:typeof F<"u"&&`${(0,o.formatEther)(F)} ${E?.nativeCurrency?.symbol||"ETH"}`,data:R,gas:w,gasPrice:typeof y<"u"&&`${(0,c.formatGwei)(y)} gwei`,maxFeePerGas:typeof x<"u"&&`${(0,c.formatGwei)(x)} gwei`,maxPriorityFeePerGas:typeof C<"u"&&`${(0,c.formatGwei)(C)} gwei`,nonce:B});k&&(M+=`
34${(0,l.prettyStateOverride)(k)}`),super(i.shortMessage,{cause:i,docsPath:_,metaMessages:[...i.metaMessages?[...i.metaMessages," "]:[],"Raw Call Arguments:",M].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=i}}Qe.CallExecutionError=T;class v extends d.BaseError{constructor(i,{abi:g,args:_,contractAddress:E,docsPath:R,functionName:w,sender:y}){const x=(0,a.getAbiItem)({abi:g,args:_,name:w}),C=x?(0,s.formatAbiItemWithArgs)({abiItem:x,args:_,includeFunctionName:!1,includeName:!1}):void 0,B=x?(0,r.formatAbiItem)(x,{includeName:!0}):void 0,H=(0,f.prettyPrint)({address:E&&(0,b.getContractAddress)(E),function:B,args:C&&C!=="()"&&`${[...Array(w?.length??0).keys()].map(()=>" ").join("")}${C}`,sender:y});super(i.shortMessage||`An unknown error occurred while executing the contract function "${w}".`,{cause:i,docsPath:R,metaMessages:[...i.metaMessages?[...i.metaMessages," "]:[],H&&"Contract Call:",H].filter(Boolean),name:"ContractFunctionExecutionError"}),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}),this.abi=g,this.args=_,this.cause=i,this.contractAddress=E,this.functionName=w,this.sender=y}}Qe.ContractFunctionExecutionError=v;class p extends d.BaseError{constructor({abi:i,data:g,functionName:_,message:E}){let R,w,y,x;if(g&&g!=="0x")try{w=(0,n.decodeErrorResult)({abi:i,data:g});const{abiItem:B,errorName:H,args:F}=w;if(H==="Error")x=F[0];else if(H==="Panic"){const[k]=F;x=t.panicReasons[k]}else{const k=B?(0,r.formatAbiItem)(B,{includeName:!0}):void 0,m=B&&F?(0,s.formatAbiItemWithArgs)({abiItem:B,args:F,includeFunctionName:!1,includeName:!1}):void 0;y=[k?`Error: ${k}`:"",m&&m!=="()"?`       ${[...Array(H?.length??0).keys()].map(()=>" ").join("")}${m}`:""]}}catch(B){R=B}else E&&(x=E);let C;R instanceof u.AbiErrorSignatureNotFoundError&&(C=R.signature,y=[`Unable to decode signature "${C}" 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://4byte.sourcify.dev/?q=${C}.`]),super(x&&x!=="execution reverted"||C?[`The contract function "${_}" reverted with the following ${C?"signature":"reason"}:`,x||C].join(`
35`):`The contract function "${_}" reverted.`,{cause:R,metaMessages:y,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{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=w,this.raw=g,this.reason=x,this.signature=C}}Qe.ContractFunctionRevertedError=p;class O extends d.BaseError{constructor({functionName:i}){super(`The contract function "${i}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",`  - The contract does not have the function "${i}",`,"  - The parameters passed to the contract function may be invalid, or","  - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}Qe.ContractFunctionZeroDataError=O;class I extends d.BaseError{constructor({factory:i}){super(`Deployment for counterfactual contract call failed${i?` for factory "${i}".`:""}`,{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."],name:"CounterfactualDeploymentFailedError"})}}Qe.CounterfactualDeploymentFailedError=I;class h extends d.BaseError{constructor({data:i,message:g}){super(g||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=i}}return Qe.RawContractError=h,Qe}var lt={},ub;function Bt(){if(ub)return lt;
35ub=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.TimeoutError=lt.SocketClosedError=lt.RpcRequestError=lt.WebSocketRequestError=lt.HttpRequestError=void 0;const e=Ve(),t=fe(),n=wf();class r extends t.BaseError{constructor({body:d,cause:l,details:f,headers:b,status:T,url:v}){super("HTTP request failed.",{cause:l,details:f,metaMessages:[T&&`Status: ${T}`,`URL: ${(0,n.getUrl)(v)}`,d&&`Request body: ${(0,e.stringify)(d)}`].filter(Boolean),name:"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=d,this.headers=b,this.status=T,this.url=v}}lt.HttpRequestError=r;class s extends t.BaseError{constructor({body:d,cause:l,details:f,url:b}){super("WebSocket request failed.",{cause:l,details:f,metaMessages:[`URL: ${(0,n.getUrl)(b)}`,d&&`Request body: ${(0,e.stringify)(d)}`].filter(Boolean),name:"WebSocketRequestError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=b}}lt.WebSocketRequestError=s;class a extends t.BaseError{constructor({body:d,error:l,url:f}){super("RPC Request failed.",{cause:l,details:l.message,metaMessages:[`URL: ${(0,n.getUrl)(f)}`,`Request body: ${(0,e.stringify)(d)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{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,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=l.code,this.data=l.data,this.url=f}}lt.RpcRequestError=a;class o extends t.BaseError{constructor({url:d}={}){super("The socket has been closed.",{metaMessages:[d&&`URL: ${(0,n.getUrl)(d)}`].filter(Boolean),name:"SocketClosedError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=d}}lt.SocketClosedError=o;class c extends t.BaseError{constructor({body:d,url:l}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${(0,n.getUrl)(l)}`,`Request body: ${(0,e.stringify)(d)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=l}}return lt.TimeoutError=c,lt}var ae={},db;function _r(){if(db)return ae;db=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.UnknownRpcError=ae.WalletConnectSessionSettlementError=ae.AtomicityNotSupportedError=ae.AtomicReadyWalletRejectedUpgradeError=ae.BundleTooLargeError=ae.UnknownBundleIdError=ae.DuplicateIdError=ae.UnsupportedChainIdError=ae.UnsupportedNonOptionalCapabilityError=ae.SwitchChainError=ae.ChainDisconnectedError=ae.ProviderDisconnectedError=ae.UnsupportedProviderMethodError=ae.UnauthorizedProviderError=ae.UserRejectedRequestError=ae.JsonRpcVersionUnsupportedError=ae.LimitExceededRpcError=ae.MethodNotSupportedRpcError=ae.TransactionRejectedRpcError=ae.ResourceUnavailableRpcError=ae.ResourceNotFoundRpcError=ae.InvalidInputRpcError=ae.InternalRpcError=ae.InvalidParamsRpcError=ae.MethodNotFoundRpcError=ae.InvalidRequestRpcError=ae.ParseRpcError=ae.ProviderRpcError=ae.RpcError=void 0;const e=fe(),t=Bt(),n=-1;class r extends e.BaseError{constructor(m,{code:M,docsPath:A,metaMessages:P,name:S,shortMessage:q}){super(q,{cause:m,docsPath:A,metaMessages:P||m?.metaMessages,name:S||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=S||m.name,this.code=m instanceof t.RpcRequestError?m.code:M??n}}ae.RpcError=r;class s extends r{constructor(m,M){super(m,M),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=M.data}}ae.ProviderRpcError=s;class a extends r{constructor(m){super(m,{code:a.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}ae.ParseRpcError=a,Object.defineProperty(a,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class o extends r{constructor(m){super(m,{code:o.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}ae.InvalidRequestRpcError=o,Object.defineProperty(o,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class c extends r{constructor(m,{method:M}={}){super(m,{code:c.code,name:"MethodNotFoundRpcError",shortMessage:`The method${M?` "${M}
35"`:""} does not exist / is not available.`})}}ae.MethodNotFoundRpcError=c,Object.defineProperty(c,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class u extends r{constructor(m){super(m,{code:u.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
36`)})}}ae.InvalidParamsRpcError=u,Object.defineProperty(u,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class d extends r{constructor(m){super(m,{code:d.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}ae.InternalRpcError=d,Object.defineProperty(d,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class l extends r{constructor(m){super(m,{code:l.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
37`)})}}ae.InvalidInputRpcError=l,Object.defineProperty(l,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class f extends r{constructor(m){super(m,{code:f.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}ae.ResourceNotFoundRpcError=f,Object.defineProperty(f,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class b extends r{constructor(m){super(m,{code:b.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}ae.ResourceUnavailableRpcError=b,Object.defineProperty(b,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class T extends r{constructor(m){super(m,{code:T.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}ae.TransactionRejectedRpcError=T,Object.defineProperty(T,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class v extends r{constructor(m,{method:M}={}){super(m,{code:v.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${M?` "${M}"`:""} is not supported.`})}}ae.MethodNotSupportedRpcError=v,Object.defineProperty(v,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class p extends r{constructor(m){super(m,{code:p.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}ae.LimitExceededRpcError=p,Object.defineProperty(p,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class O extends r{constructor(m){super(m,{code:O.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}ae.JsonRpcVersionUnsupportedError=O,Object.defineProperty(O,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class I extends s{constructor(m){super(m,{code:I.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}ae.UserRejectedRequestError=I,Object.defineProperty(I,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class h extends s{constructor(m){super(m,{code:h.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}ae.UnauthorizedProviderError=h,Object.defineProperty(h,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class j extends s{constructor(m,{method:M}={}){super(m,{code:j.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${M?` " ${M}"`:""}.`})}}ae.UnsupportedProviderMethodError=j,Object.defineProperty(j,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class i extends s{constructor(m){super(m,{code:i.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}ae.ProviderDisconnectedError=i,Object.defineProperty(i,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class g extends s{constructor(m){super(m,{code:g.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}ae.ChainDisconnectedError=g,Object.defineProperty(g,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class _ extends s{constructor(m){super(m,{code:_.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}ae.SwitchChainError=_,Object.defineProperty(_,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class E extends s{constructor(m){super(m,{code:E.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}ae.UnsupportedNonOptionalCapabilityError=E,Object.defineProperty(E,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class R extends s{constructor(m){super(m,{code:R.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}ae.UnsupportedChainIdError=R,Object.defineProperty(R,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class w extends s{constructor(m){super(m,{code:w.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}ae.DuplicateIdError=w,Object.defineProperty(w,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class y extends s{constructor(m){super(m,{code:y.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}ae.UnknownBundleIdError=y,Object.defineProperty(y,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class x extends s{constructor(m){super(m,{code:x.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}ae.BundleTooLargeError=x,Object.defineProperty(x,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class C extends s{constructor(m){super(m,{code:C.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}ae.AtomicReadyWalletRejectedUpgradeError=C,Object.defineProperty(C,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750}
37);class B extends s{constructor(m){super(m,{code:B.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}ae.AtomicityNotSupportedError=B,Object.defineProperty(B,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class H extends s{constructor(m){super(m,{code:H.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}}ae.WalletConnectSessionSettlementError=H,Object.defineProperty(H,"code",{enumerable:!0,configurable:!0,writable:!0,value:7e3});class F extends r{constructor(m){super(m,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}return ae.UnknownRpcError=F,ae}var fb;function vr(){if(fb)return Ji;fb=1,Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.getContractError=o;const e=qe(),t=fe(),n=pr(),r=Bt(),s=_r(),a=3;function o(c,{abi:u,address:d,args:l,docsPath:f,functionName:b,sender:T}){const v=c instanceof n.RawContractError?c:c instanceof t.BaseError?c.walk(g=>"data"in g)||c.walk():{},{code:p,data:O,details:I,message:h,shortMessage:j}=v,i=c instanceof e.AbiDecodingZeroDataError?new n.ContractFunctionZeroDataError({functionName:b}):[a,s.InternalRpcError.code].includes(p)&&(O||I||h||j)||p===s.InvalidInputRpcError.code&&I==="execution reverted"&&O?new n.ContractFunctionRevertedError({abi:u,data:typeof O=="object"?O.data:O,functionName:b,message:v instanceof r.RpcRequestError?I:j??h}):c;return new n.ContractFunctionExecutionError(i,{abi:u,args:l,contractAddress:d,docsPath:f,functionName:b,sender:T})}return Ji}var os={},is={},ss={},as={},lb;function kp(){if(lb)return as;lb=1,Object.defineProperty(as,"__esModule",{value:!0}),as.publicKeyToAddress=n;const e=yt(),t=ct();function n(r){const s=(0,t.keccak256)(`0x${r.substring(4)}`).substring(26);return(0,e.checksumAddress)(`0x${s}`)}return as}var cs={},Ld={},Ee={},Ye={},bb;function Np(){if(bb)return Ye;bb=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.SHA512_IV=Ye.SHA384_IV=Ye.SHA224_IV=Ye.SHA256_IV=Ye.HashMD=void 0,Ye.setBigUint64=t,Ye.Chi=n,Ye.Maj=r;const e=yr();function t(a,o,c,u){if(typeof a.setBigUint64=="function")return a.setBigUint64(o,c,u);const d=BigInt(32),l=BigInt(4294967295),f=Number(c>>d&l),b=Number(c&l),T=u?4:0,v=u?0:4;a.setUint32(o+T,f,u),a.setUint32(o+v,b,u)}function n(a,o,c){return a&o^~a&c}function r(a,o,c){return a&o^a&c^o&c}class s extends e.Hash{constructor(o,c,u,d){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=o,this.outputLen=c,this.padOffset=u,this.isLE=d,this.buffer=new Uint8Array(o),this.view=(0,e.createView)(this.buffer)}update(o){(0,e.aexists)(this),o=(0,e.toBytes)(o),(0,e.abytes)(o);const{view:c,buffer:u,blockLen:d}=this,l=o.length;for(let f=0;f<l;){const b=Math.min(d-this.pos,l-f);if(b===d){const T=(0,e.createView)(o);for(;d<=l-f;f+=d)this.process(T,f);continue}u.set(o.subarray(f,f+b),this.pos),this.pos+=b,f+=b,this.pos===d&&(this.process(c,0),this.pos=0)}return this.length+=o.length,this.roundClean(),this}digestInto(o){(0,e.aexists)(this),(0,e.aoutput)(o,this),this.finished=!0;const{buffer:c,view:u,blockLen:d,isLE:l}=this;let{pos:f}=this;c[f++]=128,(0,e.clean)(this.buffer.subarray(f)),this.padOffset>d-f&&(this.process(u,0),f=0);for(let O=f;O<d;O++)c[O]=0;t(u,d-8,BigInt(this.length*8),l),this.process(u,0);const b=(0,e.createView)(o),T=this.outputLen;if(T%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const v=T/4,p=this.get();if(v>p.length)throw new Error("_sha2: outputLen bigger than state");for(let O=0;O<v;O++)b.setUint32(4*O,p[O],l)}digest(){const{buffer:o,outputLen:c}=this;this.digestInto(o);const u=o.slice(0,c);return this.destroy(),u}_cloneInto(o){o||(o=new this.constructor),o.set(...this.get());const{blockLen:c,buffer:u,length:d,finished:l,destroyed:f,pos:b}=this;return o.destroyed=f,o.finished=l,o.length=d,o.pos=b,d%c&&o.buffer.set(u),o}clone(){return this._cloneInto()}}return Ye.HashMD=s,Ye.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ye.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),Ye.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Ye.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),Ye}var mb;function Fp(){if(mb)return Ee;
37mb=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.sha512_224=Ee.sha512_256=Ee.sha384=Ee.sha512=Ee.sha224=Ee.sha256=Ee.SHA512_256=Ee.SHA512_224=Ee.SHA384=Ee.SHA512=Ee.SHA224=Ee.SHA256=void 0;const e=Np(),t=Cp(),n=yr(),r=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),s=new Uint32Array(64);class a extends e.HashMD{constructor(j=32){super(64,j,8,!1),this.A=e.SHA256_IV[0]|0,this.B=e.SHA256_IV[1]|0,this.C=e.SHA256_IV[2]|0,this.D=e.SHA256_IV[3]|0,this.E=e.SHA256_IV[4]|0,this.F=e.SHA256_IV[5]|0,this.G=e.SHA256_IV[6]|0,this.H=e.SHA256_IV[7]|0}get(){const{A:j,B:i,C:g,D:_,E,F:R,G:w,H:y}=this;return[j,i,g,_,E,R,w,y]}set(j,i,g,_,E,R,w,y){this.A=j|0,this.B=i|0,this.C=g|0,this.D=_|0,this.E=E|0,this.F=R|0,this.G=w|0,this.H=y|0}process(j,i){for(let B=0;B<16;B++,i+=4)s[B]=j.getUint32(i,!1);for(let B=16;B<64;B++){const H=s[B-15],F=s[B-2],k=(0,n.rotr)(H,7)^(0,n.rotr)(H,18)^H>>>3,m=(0,n.rotr)(F,17)^(0,n.rotr)(F,19)^F>>>10;s[B]=m+s[B-7]+k+s[B-16]|0}let{A:g,B:_,C:E,D:R,E:w,F:y,G:x,H:C}=this;for(let B=0;B<64;B++){const H=(0,n.rotr)(w,6)^(0,n.rotr)(w,11)^(0,n.rotr)(w,25),F=C+H+(0,e.Chi)(w,y,x)+r[B]+s[B]|0,m=((0,n.rotr)(g,2)^(0,n.rotr)(g,13)^(0,n.rotr)(g,22))+(0,e.Maj)(g,_,E)|0;C=x,x=y,y=w,w=R+F|0,R=E,E=_,_=g,g=F+m|0}g=g+this.A|0,_=_+this.B|0,E=E+this.C|0,R=R+this.D|0,w=w+this.E|0,y=y+this.F|0,x=x+this.G|0,C=C+this.H|0,this.set(g,_,E,R,w,y,x,C)}roundClean(){(0,n.clean)(s)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,n.clean)(this.buffer)}}Ee.SHA256=a;class o extends a{constructor(){super(28),this.A=e.SHA224_IV[0]|0,this.B=e.SHA224_IV[1]|0,this.C=e.SHA224_IV[2]|0,this.D=e.SHA224_IV[3]|0,this.E=e.SHA224_IV[4]|0,this.F=e.SHA224_IV[5]|0,this.G=e.SHA224_IV[6]|0,this.H=e.SHA224_IV[7]|0}}Ee.SHA224=o;const c=t.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","0xf40e3585
375771202a","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(h=>BigInt(h))),u=c[0],d=c[1],l=new Uint32Array(80),f=new Uint32Array(80);class b extends e.HashMD{constructor(j=64){super(128,j,16,!1),this.Ah=e.SHA512_IV[0]|0,this.Al=e.SHA512_IV[1]|0,this.Bh=e.SHA512_IV[2]|0,this.Bl=e.SHA512_IV[3]|0,this.Ch=e.SHA512_IV[4]|0,this.Cl=e.SHA512_IV[5]|0,this.Dh=e.SHA512_IV[6]|0,this.Dl=e.SHA512_IV[7]|0,this.Eh=e.SHA512_IV[8]|0,this.El=e.SHA512_IV[9]|0,this.Fh=e.SHA512_IV[10]|0,this.Fl=e.SHA512_IV[11]|0,this.Gh=e.SHA512_IV[12]|0,this.Gl=e.SHA512_IV[13]|0,this.Hh=e.SHA512_IV[14]|0,this.Hl=e.SHA512_IV[15]|0}get(){const{Ah:j,Al:i,Bh:g,Bl:_,Ch:E,Cl:R,Dh:w,Dl:y,Eh:x,El:C,Fh:B,Fl:H,Gh:F,Gl:k,Hh:m,Hl:M}=this;return[j,i,g,_,E,R,w,y,x,C,B,H,F,k,m,M]}set(j,i,g,_,E,R,w,y,x,C,B,H,F,k,m,M){this.Ah=j|0,this.Al=i|0,this.Bh=g|0,this.Bl=_|0,this.Ch=E|0,this.Cl=R|0,this.Dh=w|0,this.Dl=y|0,this.Eh=x|0,this.El=C|0,this.Fh=B|0,this.Fl=H|0,this.Gh=F|0,this.Gl=k|0,this.Hh=m|0,this.Hl=M|0}process(j,i){for(let S=0;S<16;S++,i+=4)l[S]=j.getUint32(i),f[S]=j.getUint32(i+=4);for(let S=16;S<80;S++){const q=l[S-15]|0,N=f[S-15]|0,U=t.rotrSH(q,N,1)^t.rotrSH(q,N,8)^t.shrSH(q,N,7),L=t.rotrSL(q,N,1)^t.rotrSL(q,N,8)^t.shrSL(q,N,7),z=l[S-2]|0,D=f[S-2]|0,X=t.rotrSH(z,D,19)^t.rotrBH(z,D,61)^t.shrSH(z,D,6),W=t.rotrSL(z,D,19)^t.rotrBL(z,D,61)^t.shrSL(z,D,6),Z=t.add4L(L,W,f[S-7],f[S-16]),J=t.add4H(Z,U,X,l[S-7],l[S-16]);l[S]=J|0,f[S]=Z|0}let{Ah:g,Al:_,Bh:E,Bl:R,Ch:w,Cl:y,Dh:x,Dl:C,Eh:B,El:H,Fh:F,Fl:k,Gh:m,Gl:M,Hh:A,Hl:P}=this;for(let S=0;S<80;S++){const q=t.rotrSH(B,H,14)^t.rotrSH(B,H,18)^t.rotrBH(B,H,41),N=t.rotrSL(B,H,14)^t.rotrSL(B,H,18)^t.rotrBL(B,H,41),U=B&F^~B&m,L=H&k^~H&M,z=t.add5L(P,N,L,d[S],f[S]),D=t.add5H(z,A,q,U,u[S],l[S]),X=z|0,W=t.rotrSH(g,_,28)^t.rotrBH(g,_,34)^t.rotrBH(g,_,39),Z=t.rotrSL(g,_,28)^t.rotrBL(g,_,34)^t.rotrBL(g,_,39),J=g&E^g&w^E&w,oe=_&R^_&y^R&y;A=m|0,P=M|0,m=F|0,M=k|0,F=B|0,k=H|0,{h:B,l:H}=t.add(x|0,C|0,D|0,X|0),x=w|0,C=y|0,w=E|0,y=R|0,E=g|0,R=_|0;const K=t.add3L(X,Z,oe);g=t.add3H(K,D,W,J),_=K|0}({h:g,l:_}=t.add(this.Ah|0,this.Al|0,g|0,_|0)),{h:E,l:R}=t.add(this.Bh|0,this.Bl|0,E|0,R|0),{h:w,l:y}=t.add(this.Ch|0,this.Cl|0,w|0,y|0),{h:x,l:C}=t.add(this.Dh|0,this.Dl|0,x|0,C|0),{h:B,l:H}=t.add(this.Eh|0,this.El|0,B|0,H|0),{h:F,l:k}=t.add(this.Fh|0,this.Fl|0,F|0,k|0),{h:m,l:M}=t.add(this.Gh|0,this.Gl|0,m|0,M|0),{h:A,l:P}=t.add(this.Hh|0,this.Hl|0,A|0,P|0),this.set(g,_,E,R,w,y,x,C,B,H,F,k,m,M,A,P)}roundClean(){(0,n.clean)(l,f)}destroy(){(0,n.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}Ee.SHA512=b;class T extends b{constructor(){super(48),this.Ah=e.SHA384_IV[0]|0,this.Al=e.SHA384_IV[1]|0,this.Bh=e.SHA384_IV[2]|0,this.Bl=e.SHA384_IV[3]|0,this.Ch=e.SHA384_IV[4]|0,this.Cl=e.SHA384_IV[5]|0,this.Dh=e.SHA384_IV[6]|0,this.Dl=e.SHA384_IV[7]|0,this.Eh=e.SHA384_IV[8]|0,this.El=e.SHA384_IV[9]|0,this.Fh=e.SHA384_IV[10]|0,this.Fl=e.SHA384_IV[11]|0,this.Gh=e.SHA384_IV[12]|0,this.Gl=e.SHA384_IV[13]|0,this.Hh=e.SHA384_IV[14]|0,this.Hl=e.SHA384_IV[15]|0}}Ee.SHA384=T;const v=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),p=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class O extends b{constructor(){super(28),this.Ah=v[0]|0,this.Al=v[1]|0,this.Bh=v[2]|0,this.Bl=v[3]|0,this.Ch=v[4]|0,this.Cl=v[5]|0,this.Dh=v[6]|0,this.Dl=v[7]|0,this.Eh=v[8]|0,this.El=v[9]|0,this.Fh=v[10]|0,this.Fl=v[11]|0,this.Gh=v[12]|0,this.Gl=v[13]|0,this.Hh=v[14]|0,this.Hl=v[15]|0}}Ee.SHA512_224=O;class I extends b{constructor(){super(32),this.Ah=p[0]|0,this.Al=p[1]|0,this.Bh=p[2]|0,this.Bl=p[3]|0,this.Ch=p[4]|0,this.Cl=p[5]|0,this.Dh=p[6]|0,this.Dl=p[7]|0,this.Eh=p[8]|0,this.El=p[9]|0,this.Fh=p[10]|0,this.Fl=p[11]|0,this.Gh=p[12]|0,this.Gl=p[13]|0,this.Hh=p[14]|0,this.Hl=p[15]|0}}return Ee.SHA512_256=I,Ee.sha256=(0,n.createHasher)(()=>new a),Ee.sha224=(0,n.createHasher)(()=>new o),Ee.sha512=(0,n.createHasher)(()=>new b),Ee.sha384=(0,n.createHasher)(()=>new T),Ee.sha512_256=(0,n.createHasher)(()=>new I),Ee.sha512_224=(0,n.createHasher)(()=>new O),Ee}var lo={},Ud={},hb;function P6(){return hb||(hb=1,(function(e){Object.defineProperty(e,"__esMo
37dule",{value:!0}),e.hmac=e.HMAC=void 0;const t=yr();class n extends t.Hash{constructor(a,o){super(),this.finished=!1,this.destroyed=!1,(0,t.ahash)(a);const c=(0,t.toBytes)(o);if(this.iHash=a.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;const u=this.blockLen,d=new Uint8Array(u);d.set(c.length>u?a.create().update(c).digest():c);for(let l=0;l<d.length;l++)d[l]^=54;this.iHash.update(d),this.oHash=a.create();for(let l=0;l<d.length;l++)d[l]^=106;this.oHash.update(d),(0,t.clean)(d)}update(a){return(0,t.aexists)(this),this.iHash.update(a),this}digestInto(a){(0,t.aexists)(this),(0,t.abytes)(a,this.outputLen),this.finished=!0,this.iHash.digestInto(a),this.oHash.update(a),this.oHash.digestInto(a),this.destroy()}digest(){const a=new Uint8Array(this.oHash.outputLen);return this.digestInto(a),a}_cloneInto(a){a||(a=Object.create(Object.getPrototypeOf(this),{}));const{oHash:o,iHash:c,finished:u,destroyed:d,blockLen:l,outputLen:f}=this;return a=a,a.finished=u,a.destroyed=d,a.blockLen=l,a.outputLen=f,a.oHash=o._cloneInto(a.oHash),a.iHash=c._cloneInto(a.iHash),a}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=n;const r=(s,a,o)=>new n(s,a).update(o).digest();e.hmac=r,e.hmac.create=(s,a)=>new n(s,a)})(Ud)),Ud}var zd={},Mr={},xe={},pe={},yb;function Jo(){if(yb)return pe;yb=1;Object.defineProperty(pe,"__esModule",{value:!0}),pe.notImplemented=pe.bitMask=void 0,pe.isBytes=n,pe.abytes=r,pe.abool=s,pe.numberToHexUnpadded=a,pe.hexToNumber=o,pe.bytesToHex=d,pe.hexToBytes=b,pe.bytesToNumberBE=T,pe.bytesToNumberLE=v,pe.numberToBytesBE=p,pe.numberToBytesLE=O,pe.numberToVarBytesBE=I,pe.ensureBytes=h,pe.concatBytes=j,pe.equalBytes=i,pe.utf8ToBytes=g,pe.inRange=E,pe.aInRange=R,pe.bitLen=w,pe.bitGet=y,pe.bitSet=x,pe.createHmacDrbg=F,pe.validateObject=m,pe.memoized=A;const e=BigInt(0),t=BigInt(1);function n(P){return P instanceof Uint8Array||ArrayBuffer.isView(P)&&P.constructor.name==="Uint8Array"}function r(P){if(!n(P))throw new Error("Uint8Array expected")}function s(P,S){if(typeof S!="boolean")throw new Error(P+" boolean expected, got "+S)}function a(P){const S=P.toString(16);return S.length&1?"0"+S:S}function o(P){if(typeof P!="string")throw new Error("hex string expected, got "+typeof P);return P===""?e:BigInt("0x"+P)}const c=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",u=Array.from({length:256},(P,S)=>S.toString(16).padStart(2,"0"));function d(P){if(r(P),c)return P.toHex();let S="";for(let q=0;q<P.length;q++)S+=u[P[q]];return S}const l={_0:48,_9:57,A:65,F:70,a:97,f:102};function f(P){if(P>=l._0&&P<=l._9)return P-l._0;if(P>=l.A&&P<=l.F)return P-(l.A-10);if(P>=l.a&&P<=l.f)return P-(l.a-10)}function b(P){if(typeof P!="string")throw new Error("hex string expected, got "+typeof P);if(c)return Uint8Array.fromHex(P);const S=P.length,q=S/2;if(S%2)throw new Error("hex string expected, got unpadded hex of length "+S);const N=new Uint8Array(q);for(let U=0,L=0;U<q;U++,L+=2){const z=f(P.charCodeAt(L)),D=f(P.charCodeAt(L+1));if(z===void 0||D===void 0){const X=P[L]+P[L+1];throw new Error('hex string expected, got non-hex character "'+X+'" at index '+L)}N[U]=z*16+D}return N}function T(P){return o(d(P))}function v(P){return r(P),o(d(Uint8Array.from(P).reverse()))}function p(P,S){return b(P.toString(16).padStart(S*2,"0"))}function O(P,S){return p(P,S).reverse()}function I(P){return b(a(P))}function h(P,S,q){let N;if(typeof S=="string")try{N=b(S)}catch(L){throw new Error(P+" must be hex string or Uint8Array, cause: "+L)}else if(n(S))N=Uint8Array.from(S);else throw new Error(P+" must be hex string or Uint8Array");const U=N.length;if(typeof q=="number"&&U!==q)throw new Error(P+" of length "+q+" expected, got "+U);return N}function j(...P){let S=0;for(let N=0;N<P.length;N++){const U=P[N];r(U),S+=U.length}const q=new Uint8Array(S);for(let N=0,U=0;N<P.length;N++){const L=P[N];q.set(L,U),U+=L.length}return q}function i(P,S){if(P.length!==S.length)return!1;let q=0;for(let N=0;N<P.length;N++)q|=P[N]^S[N];return q===0}function g(P){if(typeof P!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(P))}const _=P=>typeof P=="bigint"&&e<=P;function E(P,S,q){return _(P)&&_(S)&&_(q)&&S<=P&&P<q}function R(P,S,q,N){if(!E(S,q,N))throw new Error("expected valid "+P+": "+q+" <= n < "+N+", got "+S)}function w(P){let S;for(S=0;P>e;P>>=t,S+=1);return S}function y(P,S){return P>>BigInt(S)&t}function x(P,S,q){return P|(q?t:e)<<BigInt(S)}const C=P=>(t<<BigInt(P))-t;pe.bitMask=C;const B=P=>new Uint8Array(P),H=P=>Uint8Array.from(P);function F(P,S,q){if(typeof P!="number"||P<2)throw new Error("hashLen must be a number");if(typeof S!="number"||S<2)throw new Error("qByteLen must be a number");if(typeof q!="function")throw new Error("hmacFn must be a function");let N=B(P),U=B(P),L=0;const z=()=>{N.fill(1),U.fill(0),L=0},D=(...J)=>q(U,N,...J),X=(J=B(0))=>{U=D(H([0]),J),N=D(),J.length!==0&&(U=D(H([1]),J),N=D())},W=()=>{if(L++>=1e3)throw new Error("drbg: tried 1000 values");let J=0;const oe=[];for(;J<S;){N=D();const K=N.slice();oe.push(K),J+=N.length}return j(...oe)};return(J,oe)=>
37{z(),X(J);let K;for(;!(K=oe(W()));)X();return z(),K}}const k={bigint:P=>typeof P=="bigint",function:P=>typeof P=="function",boolean:P=>typeof P=="boolean",string:P=>typeof P=="string",stringOrUint8Array:P=>typeof P=="string"||n(P),isSafeInteger:P=>Number.isSafeInteger(P),array:P=>Array.isArray(P),field:(P,S)=>S.Fp.isValid(P),hash:P=>typeof P=="function"&&Number.isSafeInteger(P.outputLen)};function m(P,S,q={}){const N=(U,L,z)=>{const D=k[L];if(typeof D!="function")throw new Error("invalid validator function");const X=P[U];if(!(z&&X===void 0)&&!D(X,P))throw new Error("param "+String(U)+" is invalid. Expected "+L+", got "+X)};for(const[U,L]of Object.entries(S))N(U,L,!1);for(const[U,L]of Object.entries(q))N(U,L,!0);return P}const M=()=>{throw new Error("not implemented")};pe.notImplemented=M;function A(P){const S=new WeakMap;return(q,...N)=>{const U=S.get(q);if(U!==void 0)return U;const L=P(q,...N);return S.set(q,L),L}}return pe}var gb;function Ku(){if(gb)return xe;gb=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.isNegativeLE=void 0,xe.mod=d,xe.pow=l,xe.pow2=f,xe.invert=b,xe.tonelliShanks=p,xe.FpSqrt=O,xe.validateField=j,xe.FpPow=i,xe.FpInvertBatch=g,xe.FpDiv=_,xe.FpLegendre=E,xe.FpIsSquare=R,xe.nLength=w,xe.Field=y,xe.FpSqrtOdd=x,xe.FpSqrtEven=C,xe.hashToPrivateScalar=B,xe.getFieldBytesLength=H,xe.getMinHashLength=F,xe.mapHashToField=k;const e=yr(),t=Jo(),n=BigInt(0),r=BigInt(1),s=BigInt(2),a=BigInt(3),o=BigInt(4),c=BigInt(5),u=BigInt(8);function d(m,M){const A=m%M;return A>=n?A:M+A}function l(m,M,A){return i(y(A),m,M)}function f(m,M,A){let P=m;for(;M-- >n;)P*=P,P%=A;return P}function b(m,M){if(m===n)throw new Error("invert: expected non-zero number");if(M<=n)throw new Error("invert: expected positive modulus, got "+M);let A=d(m,M),P=M,S=n,q=r;for(;A!==n;){const U=P/A,L=P%A,z=S-q*U;P=A,A=L,S=q,q=z}if(P!==r)throw new Error("invert: does not exist");return d(S,M)}function T(m,M){const A=(m.ORDER+r)/o,P=m.pow(M,A);if(!m.eql(m.sqr(P),M))throw new Error("Cannot find square root");return P}function v(m,M){const A=(m.ORDER-c)/u,P=m.mul(M,s),S=m.pow(P,A),q=m.mul(M,S),N=m.mul(m.mul(q,s),S),U=m.mul(q,m.sub(N,m.ONE));if(!m.eql(m.sqr(U),M))throw new Error("Cannot find square root");return U}function p(m){if(m<BigInt(3))throw new Error("sqrt is not defined for small field");let M=m-r,A=0;for(;M%s===n;)M/=s,A++;let P=s;const S=y(m);for(;E(S,P)===1;)if(P++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(A===1)return T;let q=S.pow(P,M);const N=(M+r)/s;return function(L,z){if(L.is0(z))return z;if(E(L,z)!==1)throw new Error("Cannot find square root");let D=A,X=L.mul(L.ONE,q),W=L.pow(z,M),Z=L.pow(z,N);for(;!L.eql(W,L.ONE);){if(L.is0(W))return L.ZERO;let J=1,oe=L.sqr(W);for(;!L.eql(oe,L.ONE);)if(J++,oe=L.sqr(oe),J===D)throw new Error("Cannot find square root");const K=r<<BigInt(D-J-1),Y=L.pow(X,K);D=J,X=L.sqr(Y),W=L.mul(W,X),Z=L.mul(Z,Y)}return Z}}function O(m){return m%o===a?T:m%u===c?v:p(m)}const I=(m,M)=>(d(m,M)&r)===r;xe.isNegativeLE=I;const h=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function j(m){const M={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},A=h.reduce((P,S)=>(P[S]="function",P),M);return(0,t.validateObject)(m,A)}function i(m,M,A){if(A<n)throw new Error("invalid exponent, negatives unsupported");if(A===n)return m.ONE;if(A===r)return M;let P=m.ONE,S=M;for(;A>n;)A&r&&(P=m.mul(P,S)),S=m.sqr(S),A>>=r;return P}function g(m,M,A=!1){const P=new Array(M.length).fill(A?m.ZERO:void 0),S=M.reduce((N,U,L)=>m.is0(U)?N:(P[L]=N,m.mul(N,U)),m.ONE),q=m.inv(S);return M.reduceRight((N,U,L)=>m.is0(U)?N:(P[L]=m.mul(N,P[L]),m.mul(N,U)),q),P}function _(m,M,A){return m.mul(M,typeof A=="bigint"?b(A,m.ORDER):m.inv(A))}function E(m,M){const A=(m.ORDER-r)/s,P=m.pow(M,A),S=m.eql(P,m.ONE),q=m.eql(P,m.ZERO),N=m.eql(P,m.neg(m.ONE));if(!S&&!q&&!N)throw new Error("invalid Legendre symbol result");return S?1:q?0:-1}function R(m,M){return E(m,M)===1}function w(m,M){M!==void 0&&(0,e.anumber)(M);const A=M!==void 0?M:m.toString(2).length,P=Math.ceil(A/8);return{nBitLength:A,nByteLength:P}}function y(m,M,A=!1,P={}){if(m<=n)throw new Error("invalid field: expected ORDER > 0, got "+m);const{nBitLength:S,nByteLength:q}=w(m,M);if(q>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let N;const U=Object.freeze({ORDER:m,isLE:A,BITS:S,BYTES:q,MASK:(0,t.bitMask)(S),ZERO:n,ONE:r,create:L=>d(L,m),isValid:L=>{if(typeof L!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof L);return n<=L&&L<m},is0:L=>
37L===n,isOdd:L=>(L&r)===r,neg:L=>d(-L,m),eql:(L,z)=>L===z,sqr:L=>d(L*L,m),add:(L,z)=>d(L+z,m),sub:(L,z)=>d(L-z,m),mul:(L,z)=>d(L*z,m),pow:(L,z)=>i(U,L,z),div:(L,z)=>d(L*b(z,m),m),sqrN:L=>L*L,addN:(L,z)=>L+z,subN:(L,z)=>L-z,mulN:(L,z)=>L*z,inv:L=>b(L,m),sqrt:P.sqrt||(L=>(N||(N=O(m)),N(U,L))),toBytes:L=>A?(0,t.numberToBytesLE)(L,q):(0,t.numberToBytesBE)(L,q),fromBytes:L=>{if(L.length!==q)throw new Error("Field.fromBytes: expected "+q+" bytes, got "+L.length);return A?(0,t.bytesToNumberLE)(L):(0,t.bytesToNumberBE)(L)},invertBatch:L=>g(U,L),cmov:(L,z,D)=>D?z:L});return Object.freeze(U)}function x(m,M){if(!m.isOdd)throw new Error("Field doesn't have isOdd");const A=m.sqrt(M);return m.isOdd(A)?A:m.neg(A)}function C(m,M){if(!m.isOdd)throw new Error("Field doesn't have isOdd");const A=m.sqrt(M);return m.isOdd(A)?m.neg(A):A}function B(m,M,A=!1){m=(0,t.ensureBytes)("privateHash",m);const P=m.length,S=w(M).nByteLength+8;if(S<24||P<S||P>1024)throw new Error("hashToPrivateScalar: expected "+S+"-1024 bytes of input, got "+P);const q=A?(0,t.bytesToNumberLE)(m):(0,t.bytesToNumberBE)(m);return d(q,M-r)+r}function H(m){if(typeof m!="bigint")throw new Error("field order must be bigint");const M=m.toString(2).length;return Math.ceil(M/8)}function F(m){const M=H(m);return M+Math.ceil(M/2)}function k(m,M,A=!1){const P=m.length,S=H(M),q=F(M);if(P<16||P<q||P>1024)throw new Error("expected "+q+"-1024 bytes of input, got "+P);const N=A?(0,t.bytesToNumberLE)(m):(0,t.bytesToNumberBE)(m),U=d(N,M-r)+r;return A?(0,t.numberToBytesLE)(U,S):(0,t.numberToBytesBE)(U,S)}return xe}var pb;function A6(){if(pb)return Mr;pb=1,Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.wNAF=T,Mr.pippenger=v,Mr.precomputeMSMUnsafe=p,Mr.validateBasic=O;const e=Ku(),t=Jo(),n=BigInt(0),r=BigInt(1);function s(I,h){const j=h.negate();return I?j:h}function a(I,h){if(!Number.isSafeInteger(I)||I<=0||I>h)throw new Error("invalid window size, expected [1.."+h+"], got W="+I)}function o(I,h){a(I,h);const j=Math.ceil(h/I)+1,i=2**(I-1),g=2**I,_=(0,t.bitMask)(I),E=BigInt(I);return{windows:j,windowSize:i,mask:_,maxNumber:g,shiftBy:E}}function c(I,h,j){const{windowSize:i,mask:g,maxNumber:_,shiftBy:E}=j;let R=Number(I&g),w=I>>E;R>i&&(R-=_,w+=r);const y=h*i,x=y+Math.abs(R)-1,C=R===0,B=R<0,H=h%2!==0;return{nextN:w,offset:x,isZero:C,isNeg:B,isNegF:H,offsetF:y}}function u(I,h){if(!Array.isArray(I))throw new Error("array expected");I.forEach((j,i)=>{if(!(j instanceof h))throw new Error("invalid point at index "+i)})}function d(I,h){if(!Array.isArray(I))throw new Error("array of scalars expected");I.forEach((j,i)=>{if(!h.isValid(j))throw new Error("invalid scalar at index "+i)})}const l=new WeakMap,f=new WeakMap;function b(I){return f.get(I)||1}function T(I,h){return{constTimeNegate:s,hasPrecomputes(j){return b(j)!==1},unsafeLadder(j,i,g=I.ZERO){let _=j;for(;i>n;)i&r&&(g=g.add(_)),_=_.double(),i>>=r;return g},precomputeWindow(j,i){const{windows:g,windowSize:_}=o(i,h),E=[];let R=j,w=R;for(let y=0;y<g;y++){w=R,E.push(w);for(let x=1;x<_;x++)w=w.add(R),E.push(w);R=w.double()}return E},wNAF(j,i,g){let _=I.ZERO,E=I.BASE;const R=o(j,h);for(let w=0;w<R.windows;w++){const{nextN:y,offset:x,isZero:C,isNeg:B,isNegF:H,offsetF:F}=c(g,w,R);g=y,C?E=E.add(s(H,i[F])):_=_.add(s(B,i[x]))}return{p:_,f:E}},wNAFUnsafe(j,i,g,_=I.ZERO){const E=o(j,h);for(let R=0;R<E.windows&&g!==n;R++){const{nextN:w,offset:y,isZero:x,isNeg:C}=c(g,R,E);if(g=w,!x){const B=i[y];_=_.add(C?B.negate():B)}}return _},getPrecomputes(j,i,g){let _=l.get(i);return _||(_=this.precomputeWindow(i,j),j!==1&&l.set(i,g(_))),_},wNAFCached(j,i,g){const _=b(j);
37return this.wNAF(_,this.getPrecomputes(_,j,g),i)},wNAFCachedUnsafe(j,i,g,_){const E=b(j);return E===1?this.unsafeLadder(j,i,_):this.wNAFUnsafe(E,this.getPrecomputes(E,j,g),i,_)},setWindowSize(j,i){a(i,h),f.set(j,i),l.delete(j)}}}function v(I,h,j,i){u(j,I),d(i,h);const g=j.length,_=i.length;if(g!==_)throw new Error("arrays of points and scalars must have equal length");const E=I.ZERO,R=(0,t.bitLen)(BigInt(g));let w=1;R>12?w=R-3:R>4?w=R-2:R>0&&(w=2);const y=(0,t.bitMask)(w),x=new Array(Number(y)+1).fill(E),C=Math.floor((h.BITS-1)/w)*w;let B=E;for(let H=C;H>=0;H-=w){x.fill(E);for(let k=0;k<_;k++){const m=i[k],M=Number(m>>BigInt(H)&y);x[M]=x[M].add(j[k])}let F=E;for(let k=x.length-1,m=E;k>0;k--)m=m.add(x[k]),F=F.add(m);if(B=B.add(F),H!==0)for(let k=0;k<w;k++)B=B.double()}return B}function p(I,h,j,i){a(i,h.BITS),u(j,I);const g=I.ZERO,_=2**i-1,E=Math.ceil(h.BITS/i),R=(0,t.bitMask)(i),w=j.map(y=>{const x=[];for(let C=0,B=y;C<_;C++)x.push(B),B=B.add(y);return x});return y=>{if(d(y,h),y.length>j.length)throw new Error("array of scalars must be smaller than array of points");let x=g;for(let C=0;C<E;C++){if(x!==g)for(let H=0;H<i;H++)x=x.double();const B=BigInt(E*i-(C+1)*i);for(let H=0;H<y.length;H++){const F=y[H],k=Number(F>>B&R);k&&(x=x.add(w[H][k-1]))}}return x}}function O(I){return(0,e.validateField)(I.Fp),(0,t.validateObject)(I,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,e.nLength)(I.n,I.nBitLength),...I,p:I.Fp.ORDER})}return Mr}var _b;function Lp(){return _b||(_b=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DER=e.DERErr=void 0,e.weierstrassPoints=T,e.weierstrass=p,e.SWUFpSqrtRatio=O,e.mapToCurveSimpleSWU=I;const t=A6(),n=Ku(),r=Jo();function s(h){h.lowS!==void 0&&(0,r.abool)("lowS",h.lowS),h.prehash!==void 0&&(0,r.abool)("prehash",h.prehash)}function a(h){const j=(0,t.validateBasic)(h);(0,r.validateObject)(j,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:i,Fp:g,a:_}=j;if(i){if(!g.eql(_,g.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof i!="object"||typeof i.beta!="bigint"||typeof i.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...j})}class o extends Error{constructor(j=""){super(j)}}e.DERErr=o,e.DER={Err:o,_tlv:{encode:(h,j)=>{const{Err:i}=e.DER;if(h<0||h>256)throw new i("tlv.encode: wrong tag");if(j.length&1)throw new i("tlv.encode: unpadded data");const g=j.length/2,_=(0,r.numberToHexUnpadded)(g);if(_.length/2&128)throw new i("tlv.encode: long form length too big");const E=g>127?(0,r.numberToHexUnpadded)(_.length/2|128):"";return(0,r.numberToHexUnpadded)(h)+E+_+j},decode(h,j){const{Err:i}=e.DER;let g=0;if(h<0||h>256)throw new i("tlv.encode: wrong tag");if(j.length<2||j[g++]!==h)throw new i("tlv.decode: wrong tlv");const _=j[g++],E=!!(_&128);let R=0;if(!E)R=_;else{const y=_&127;
37if(!y)throw new i("tlv.decode(long): indefinite length not supported");if(y>4)throw new i("tlv.decode(long): byte length is too big");const x=j.subarray(g,g+y);if(x.length!==y)throw new i("tlv.decode: length bytes not complete");if(x[0]===0)throw new i("tlv.decode(long): zero leftmost byte");for(const C of x)R=R<<8|C;if(g+=y,R<128)throw new i("tlv.decode(long): not minimal encoding")}const w=j.subarray(g,g+R);if(w.length!==R)throw new i("tlv.decode: wrong value length");return{v:w,l:j.subarray(g+R)}}},_int:{encode(h){const{Err:j}=e.DER;if(h<u)throw new j("integer: negative integers are not allowed");let i=(0,r.numberToHexUnpadded)(h);if(Number.parseInt(i[0],16)&8&&(i="00"+i),i.length&1)throw new j("unexpected DER parsing assertion: unpadded hex");return i},decode(h){const{Err:j}=e.DER;if(h[0]&128)throw new j("invalid signature integer: negative");if(h[0]===0&&!(h[1]&128))throw new j("invalid signature integer: unnecessary leading zero");return(0,r.bytesToNumberBE)(h)}},toSig(h){const{Err:j,_int:i,_tlv:g}=e.DER,_=(0,r.ensureBytes)("signature",h),{v:E,l:R}=g.decode(48,_);if(R.length)throw new j("invalid signature: left bytes after parsing");const{v:w,l:y}=g.decode(2,E),{v:x,l:C}=g.decode(2,y);if(C.length)throw new j("invalid signature: left bytes after parsing");return{r:i.decode(w),s:i.decode(x)}},hexFromSig(h){const{_tlv:j,_int:i}=e.DER,g=j.encode(2,i.encode(h.r)),_=j.encode(2,i.encode(h.s)),E=g+_;return j.encode(48,E)}};function c(h,j){return(0,r.bytesToHex)((0,r.numberToBytesBE)(h,j))}const u=BigInt(0),d=BigInt(1),l=BigInt(2),f=BigInt(3),b=BigInt(4);function T(h){const j=a(h),{Fp:i}=j,g=(0,n.Field)(j.n,j.nBitLength),_=j.toBytes||((S,q,N)=>{const U=q.toAffine();return(0,r.concatBytes)(Uint8Array.from([4]),i.toBytes(U.x),i.toBytes(U.y))}),E=j.fromBytes||(S=>{const q=S.subarray(1),N=i.fromBytes(q.subarray(0,i.BYTES)),U=i.fromBytes(q.subarray(i.BYTES,2*i.BYTES));return{x:N,y:U}});function R(S){const{a:q,b:N}=j,U=i.sqr(S),L=i.mul(U,S);return i.add(i.add(L,i.mul(S,q)),N)}function w(S,q){const N=i.sqr(q),U=R(S);return i.eql(N,U)}if(!w(j.Gx,j.Gy))throw new Error("bad curve params: generator point");const y=i.mul(i.pow(j.a,f),b),x=i.mul(i.sqr(j.b),BigInt(27));if(i.is0(i.add(y,x)))throw new Error("bad curve params: a or b");function C(S){return(0,r.inRange)(S,d,j.n)}function B(S){const{allowedPrivateKeyLengths:q,nByteLength:N,wrapPrivateKey:U,n:L}=j;if(q&&typeof S!="bigint"){if((0,r.isBytes)(S)&&(S=(0,r.bytesToHex)(S)),typeof S!="string"||!q.includes(S.length))throw new Error("invalid private key");S=S.padStart(N*2,"0")}let z;try{z=typeof S=="bigint"?S:(0,r.bytesToNumberBE)((0,r.ensureBytes)("private key",S,N))}catch{throw new Error("invalid private key, expected hex or "+N+" bytes, got "+typeof S)}return U&&(z=(0,n.mod)(z,L)),(0,r.aInRange)("private key",z,d,L),z}function H(S){if(!(S instanceof m))throw new Error("ProjectivePoint expected")}const F=(0,r.memoized)((S,q)=>{const{px:N,py:U,pz:L}=S;if(i.eql(L,i.ONE))return{x:N,y:U};const z=S.is0();q==null&&(q=z?i.ONE:i.inv(L));const D=i.mul(N,q),X=i.mul(U,q),W=i.mul(L,q);if(z)return{x:i.ZERO,y:i.ZERO};if(!i.eql(W,i.ONE))throw new Error("invZ was invalid");return{x:D,y:X}}),k=(0,r.memoized)(S=>{if(S.is0()){if(j.allowInfinityPoint&&!i.is0(S.py))return;throw new Error("bad point: ZERO")}const{x:q,y:N}=S.toAffine();if(!i.isValid(q)||!i.isValid(N))throw new Error("bad point: x or y not FE");if(!w(q,N))throw new Error("bad point: equation left != right");if(!S.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class m{constructor(q,N,U){if(q==null||!i.isValid(q))throw new Error("x required");if(N==null||!i.isValid(N)||i.is0(N))throw new Error("y required");if(U==null||!i.isValid(U))throw new Error("z required");this.px=q,this.py=N,this.pz=U,Object.freeze(this)}static fromAffine(q){const{x:N,y:U}=q||{};if(!q||!i.isValid(N)||!i.isValid(U))throw new Error("invalid affine point");if(q instanceof m)throw new Error("projective point not allowed");const L=z=>i.eql(z,i.ZERO);return L(N)&&L(U)?m.ZERO:new m(N,U,i.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(q){const N=(0,n.FpInvertBatch)(i,q.map(U=>U.pz));return q.map((U,L)=>U.toAffine(N[L])).map(m.fromAffine)}static fromHex(q){const N=m.fromAffine(E((0,r.ensureBytes)("pointHex",q)));return N.assertValidity(),N}static fromPrivateKey(q){return m.BASE.multiply(B(q))}static msm(q,N){return(0,t.pippenger)(m,g,q,N)}_setWindowSize(q){P.setWindowSize(this,q)}assertValidity(){k(this)}hasEvenY(){const{y:q}=this.toAffine();if(i.isOdd)return!i.isOdd(q);throw new Error("Field doesn't support isOdd")}equals(q){H(q);const{px:N,py:U,pz:L}=this,{px:z,py:D,pz:X}=q,W=i.eql(i.mul(N,X),i.mul(z,L)),Z=i.eql(i.mul(U,X),i.mul(D,L));return W&&Z}negate(){return new m(this.px,i.neg(this.py),this.pz)}double(){const{a:q,b:N}=j,U=i.mul(N,f),{px:L,py:z,pz:D}=this;let X=i.ZERO,W=i.ZERO,Z=i.ZERO,J=i.mul(L,L),oe=i.mul(z,z),K=i.mul(D,D),Y=i.mul(L,z);return Y=i.add(Y,Y),Z=i.mul(L,D),Z=i.add(Z,Z),X=i.mul(q,Z),W=i.mul(U,K),W=i.add(X,W),X=i.sub(oe,W),W=i.add(oe,W),W=i.mul(X,W),X=i.mul(Y,X),Z=i.mul(U,Z),K=i.mul(q,K),Y=i.sub(J,K),Y=i.mul(q,Y),Y=i.add(Y,Z),Z=i.add(J,J),J=i.add(Z,J),J=i.add(J,K),J=i.mul(J,Y),W=i.add(W,J),K=i.mul(z,D),K=i.add(K,K),J=i.mul(K,Y),X=i.sub(X,J),Z=i.mul(K,oe),Z=i.add(Z,Z),Z=i.add(Z,Z),new m(X,W,Z)}add(q){H(q);const{px:N,py:U,pz:L}=this,{px:z,py:D,pz:X}=q;let W=i.ZERO,Z=i.ZERO,J=i.ZERO;const oe=j.a,K=i.mul(j.b,f);let Y=i.mul(N,z),$=i.mul(U,D),re=i.mul(L,X),ee=i.add(N,U),ne=i.add(z,D);ee=i.mul(ee,ne),ne=i.add(Y,$),ee=i.sub(ee,ne),ne=i.add(N,L);let se=i.add(z,X);return ne=i.mul(ne,se),se=i.add(Y,re),ne=i.sub(ne,se),se=i.add(U,L),W=i.add(D,X),se=i.mul(se,W),W=i.add($,re),se=i.sub(se,W),J=i.mul(oe,ne),W=i.mul(K,re),J=i.add(W,J),W=i.sub($,J),J=i.add($,J),Z=i.mul(W,J),$=i.add(Y,Y),$=i.add($,Y),re=i.mul(oe,re),ne=i.mul(K,ne),$=i.add($,re),re=i.sub(Y,re),re=i.mul(oe,re),ne=i.add(ne,re),Y=i.mul($,ne),Z=i.add(Z,Y),Y=i.mul(se,ne),W=i.mul(ee,W),W=i.sub(W,Y),Y=i.mul(ee,$),J=i.mul(se,J),J=i.add(J,Y),new m(W,Z,J)}subtract(q){return this.add(q.negate())}is0(){return this.equals(m.ZERO)}wNAF(q){return P.wNAFCached(this,q,m.normalizeZ)}
37multiplyUnsafe(q){const{endo:N,n:U}=j;(0,r.aInRange)("scalar",q,u,U);const L=m.ZERO;if(q===u)return L;if(this.is0()||q===d)return this;if(!N||P.hasPrecomputes(this))return P.wNAFCachedUnsafe(this,q,m.normalizeZ);let{k1neg:z,k1:D,k2neg:X,k2:W}=N.splitScalar(q),Z=L,J=L,oe=this;for(;D>u||W>u;)D&d&&(Z=Z.add(oe)),W&d&&(J=J.add(oe)),oe=oe.double(),D>>=d,W>>=d;return z&&(Z=Z.negate()),X&&(J=J.negate()),J=new m(i.mul(J.px,N.beta),J.py,J.pz),Z.add(J)}multiply(q){const{endo:N,n:U}=j;(0,r.aInRange)("scalar",q,d,U);let L,z;if(N){const{k1neg:D,k1:X,k2neg:W,k2:Z}=N.splitScalar(q);let{p:J,f:oe}=this.wNAF(X),{p:K,f:Y}=this.wNAF(Z);J=P.constTimeNegate(D,J),K=P.constTimeNegate(W,K),K=new m(i.mul(K.px,N.beta),K.py,K.pz),L=J.add(K),z=oe.add(Y)}else{const{p:D,f:X}=this.wNAF(q);L=D,z=X}return m.normalizeZ([L,z])[0]}multiplyAndAddUnsafe(q,N,U){const L=m.BASE,z=(X,W)=>W===u||W===d||!X.equals(L)?X.multiplyUnsafe(W):X.multiply(W),D=z(this,N).add(z(q,U));return D.is0()?void 0:D}toAffine(q){return F(this,q)}isTorsionFree(){const{h:q,isTorsionFree:N}=j;if(q===d)return!0;if(N)return N(m,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:q,clearCofactor:N}=j;return q===d?this:N?N(m,this):this.multiplyUnsafe(j.h)}toRawBytes(q=!0){return(0,r.abool)("isCompressed",q),this.assertValidity(),_(m,this,q)}toHex(q=!0){return(0,r.abool)("isCompressed",q),(0,r.bytesToHex)(this.toRawBytes(q))}}m.BASE=new m(j.Gx,j.Gy,i.ONE),m.ZERO=new m(i.ZERO,i.ONE,i.ZERO);const{endo:M,nBitLength:A}=j,P=(0,t.wNAF)(m,M?Math.ceil(A/2):A);return{CURVE:j,ProjectivePoint:m,normPrivateKeyToScalar:B,weierstrassEquation:R,isWithinCurveOrder:C}}function v(h){const j=(0,t.validateBasic)(h);return(0,r.validateObject)(j,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...j})}function p(h){const j=v(h),{Fp:i,n:g,nByteLength:_,nBitLength:E}=j,R=i.BYTES+1,w=2*i.BYTES+1;function y(K){return(0,n.mod)(K,g)}function x(K){return(0,n.invert)(K,g)}const{ProjectivePoint:C,normPrivateKeyToScalar:B,weierstrassEquation:H,isWithinCurveOrder:F}=T({...j,toBytes(K,Y,$){const re=Y.toAffine(),ee=i.toBytes(re.x),ne=r.concatBytes;return(0,r.abool)("isCompressed",$),$?ne(Uint8Array.from([Y.hasEvenY()?2:3]),ee):ne(Uint8Array.from([4]),ee,i.toBytes(re.y))},fromBytes(K){const Y=K.length,$=K[0],re=K.subarray(1);if(Y===R&&($===2||$===3)){const ee=(0,r.bytesToNumberBE)(re);if(!(0,r.inRange)(ee,d,i.ORDER))throw new Error("Point is not on curve");const ne=H(ee);let se;try{se=i.sqrt(ne)}catch(be){const me=be instanceof Error?": "+be.message:"";throw new Error("Point is not on curve"+me)}const te=(se&d)===d;return($&1)===1!==te&&(se=i.neg(se)),{x:ee,y:se}}else if(Y===w&&$===4){const ee=i.fromBytes(re.subarray(0,i.BYTES)),ne=i.fromBytes(re.subarray(i.BYTES,2*i.BYTES));return{x:ee,y:ne}}else{const ee=R,ne=w;throw new Error("invalid Point, expected length of "+ee+", or uncompressed "+ne+", got "+Y)}}});function k(K){const Y=g>>d;return K>Y}function m(K){return k(K)?y(-K):K}const M=(K,Y,$)=>(0,r.bytesToNumberBE)(K.slice(Y,$));class A{constructor(Y,$,re){(0,r.aInRange)("r",Y,d,g),(0,r.aInRange)("s",$,d,g),this.r=Y,this.s=$,re!=null&&(this.recovery=re),Object.freeze(this)}static fromCompact(Y){const $=_;return Y=(0,r.ensureBytes)("compactSignature",Y,$*2),new A(M(Y,0,$),M(Y,$,2*$))}static fromDER(Y){const{r:$,s:re}=e.DER.toSig((0,r.ensureBytes)("DER",Y));return new A($,re)}assertValidity(){}addRecoveryBit(Y){return new A(this.r,this.s,Y)}recoverPublicKey(Y){const{r:$,s:re,recovery:ee}=this,ne=L((0,r.ensureBytes)("msgHash",Y));if(ee==null||![0,1,2,3].includes(ee))throw new Error("recovery id invalid");const se=ee===2||ee===3?$+j.n:$;if(se>=i.ORDER)throw new Error("recovery id 2 or 3 invalid");const te=(ee&1)===0?"02":"03",Q=C.fromHex(te+c(se,i.BYTES)),be=x(se),me=y(-ne*be),ze=y(re*be),Ae=C.BASE.multiplyAndAddUnsafe(Q,me,ze);if(!Ae)throw new Error("point at infinify");return Ae.assertValidity(),Ae}hasHighS(){return k(this.s)}normalizeS(){return this.hasHighS()?new A(this.r,y(-this.s),this.recovery):this}toDERRawBytes(){return(0,r.hexToBytes)(this.toDERHex())}toDERHex(){return e.DER.hexFromSig(this)}toCompactRawBytes(){return(0,r.hexToBytes)(this.toCompactHex())}toCompactHex(){const Y=_;return c(this.r,Y)+c(this.s,Y)}}const P={isValidPrivateKey(K){try{return B(K),!0}catch{return!1}},normPrivateKeyToScalar:B,randomPrivateKey:()=>{const K=(0,n.getMinHashLength)(j.n);return(0,n.mapHashToField)(j.randomBytes(K),j.n)},precompute(K=8,Y=C.BASE){return Y._setWindowSize(K),Y.multiply(BigInt(3)),Y}};function S(K,Y=!0){return C.fromPrivateKey(K).toRawBytes(Y)}function q(K){if(typeof K=="bigint")return!1;if(K instanceof C)return!0;const $=(0,r.ensureBytes)("key",K).length,re=i.BYTES,ee=re+1,ne=2*re+1;if(!(j.allowedPrivateKeyLengths||_===ee))return $===ee||$===ne}function N(K,Y,$=!0){if(q(K)===!0)throw new Error("first arg must be private key");if(q(Y)===!1)throw new Error("second arg must be public key");return C.fromHex(Y).multiply(B(K)).toRawBytes($)}const U=j.bits2int||function(K){if(K.length>8192)throw new Error("input is too large");
37const Y=(0,r.bytesToNumberBE)(K),$=K.length*8-E;return $>0?Y>>BigInt($):Y},L=j.bits2int_modN||function(K){return y(U(K))},z=(0,r.bitMask)(E);function D(K){return(0,r.aInRange)("num < 2^"+E,K,u,z),(0,r.numberToBytesBE)(K,_)}function X(K,Y,$=W){if(["recovered","canonical"].some(Me=>Me in $))throw new Error("sign() legacy options not supported");const{hash:re,randomBytes:ee}=j;let{lowS:ne,prehash:se,extraEntropy:te}=$;ne==null&&(ne=!0),K=(0,r.ensureBytes)("msgHash",K),s($),se&&(K=(0,r.ensureBytes)("prehashed msgHash",re(K)));const Q=L(K),be=B(Y),me=[D(be),D(Q)];if(te!=null&&te!==!1){const Me=te===!0?ee(i.BYTES):te;me.push((0,r.ensureBytes)("extraEntropy",Me))}const ze=(0,r.concatBytes)(...me),Ae=Q;function Xe(Me){const Te=U(Me);if(!F(Te))return;const pt=x(Te),Ke=C.BASE.multiply(Te).toAffine(),Ue=y(Ke.x);if(Ue===u)return;const Ze=y(pt*y(Ae+Ue*be));if(Ze===u)return;let De=(Ke.x===Ue?0:2)|Number(Ke.y&d),Ct=Ze;return ne&&k(Ze)&&(Ct=m(Ze),De^=1),new A(Ue,Ct,De)}return{seed:ze,k2sig:Xe}}const W={lowS:j.lowS,prehash:!1},Z={lowS:j.lowS,prehash:!1};function J(K,Y,$=W){const{seed:re,k2sig:ee}=X(K,Y,$),ne=j;return(0,r.createHmacDrbg)(ne.hash.outputLen,ne.nByteLength,ne.hmac)(re,ee)}C.BASE._setWindowSize(8);function oe(K,Y,$,re=Z){const ee=K;Y=(0,r.ensureBytes)("msgHash",Y),$=(0,r.ensureBytes)("publicKey",$);const{lowS:ne,prehash:se,format:te}=re;if(s(re),"strict"in re)throw new Error("options.strict was renamed to lowS");if(te!==void 0&&te!=="compact"&&te!=="der")throw new Error("format must be compact or der");const Q=typeof ee=="string"||(0,r.isBytes)(ee),be=!Q&&!te&&typeof ee=="object"&&ee!==null&&typeof ee.r=="bigint"&&typeof ee.s=="bigint";if(!Q&&!be)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let me,ze;try{if(be&&(me=new A(ee.r,ee.s)),Q){try{te!=="compact"&&(me=A.fromDER(ee))}catch(De){if(!(De instanceof e.DER.Err))throw De}!me&&te!=="der"&&(me=A.fromCompact(ee))}ze=C.fromHex($)}catch{return!1}if(!me||ne&&me.hasHighS())return!1;se&&(Y=j.hash(Y));const{r:Ae,s:Xe}=me,Me=L(Y),Te=x(Xe),pt=y(Me*Te),Ke=y(Ae*Te),Ue=C.BASE.multiplyAndAddUnsafe(ze,pt,Ke)?.toAffine();return Ue?y(Ue.x)===Ae:!1}return{CURVE:j,getPublicKey:S,getSharedSecret:N,sign:J,verify:oe,ProjectivePoint:C,Signature:A,utils:P}}function O(h,j){const i=h.ORDER;let g=u;for(let k=i-d;k%l===u;k/=l)g+=d;const _=g,E=l<<_-d-d,R=E*l,w=(i-d)/R,y=(w-d)/l,x=R-d,C=E,B=h.pow(j,w),H=h.pow(j,(w+d)/l);let F=(k,m)=>{let M=B,A=h.pow(m,x),P=h.sqr(A);P=h.mul(P,m);let S=h.mul(k,P);S=h.pow(S,y),S=h.mul(S,A),A=h.mul(S,m),P=h.mul(S,k);let q=h.mul(P,A);S=h.pow(q,C);let N=h.eql(S,h.ONE);A=h.mul(P,H),S=h.mul(q,M),P=h.cmov(A,P,N),q=h.cmov(S,q,N);for(let U=_;U>d;U--){let L=U-l;L=l<<L-d;let z=h.pow(q,L);const D=h.eql(z,h.ONE);A=h.mul(P,M),M=h.mul(M,M),z=h.mul(q,M),P=h.cmov(A,P,D),q=h.cmov(z,q,D)}return{isValid:N,value:P}};if(h.ORDER%b===f){const k=(h.ORDER-f)/b,m=h.sqrt(h.neg(j));F=(M,A)=>{let P=h.sqr(A);const S=h.mul(M,A);P=h.mul(P,S);let q=h.pow(P,k);q=h.mul(q,S);const N=h.mul(q,m),U=h.mul(h.sqr(q),A),L=h.eql(U,M);let z=h.cmov(N,q,L);return{isValid:L,value:z}}}return F}function I(h,j){if((0,n.validateField)(h),!h.isValid(j.A)||!h.isValid(j.B)||!h.isValid(j.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const i=O(h,j.Z);if(!h.isOdd)throw new Error("Fp.isOdd is not implemented!");return g=>{let _,E,R,w,y,x,C,B;_=h.sqr(g),_=h.mul(_,j.Z),E=h.sqr(_),E=h.add(E,_),R=h.add(E,h.ONE),R=h.mul(R,j.B),w=h.cmov(j.Z,h.neg(E),!h.eql(E,h.ZERO)),w=h.mul(w,j.A),E=h.sqr(R),x=h.sqr(w),y=h.mul(x,j.A),E=h.add(E,y),E=h.mul(E,R),x=h.mul(x,w),y=h.mul(x,j.B),E=h.add(E,y),C=h.mul(_,R);const{isValid:H,value:F}=i(E,x);B=h.mul(_,g),B=h.mul(B,F),C=h.cmov(C,R,H),B=h.cmov(B,F,H);const k=h.isOdd(g)===h.isOdd(B);B=h.cmov(h.neg(B),B,k);const m=(0,n.FpInvertBatch)(h,[w],!0)[0];return C=h.mul(C,m),{x:C,y:B}}}})(zd)),zd}var vb;function T6(){if(vb)return lo;vb=1,Object.defineProperty(lo,"__esModule",{value:!0}),lo.getHash=r,lo.createCurve=s;const e=P6(),t=yr(),n=Lp();function r(a){return{hash:a,hmac:(o,...c)=>(0,e.hmac)(a,o,(0,t.concatBytes)(...c)),randomBytes:t.randomBytes}}function s(a,o){const c=u=>(0,n.weierstrass)({...a,...r(u)});return{...c(o),create:c}}return lo}var cr={},Eb;function S6(){if(Eb)return cr;
37Eb=1,Object.defineProperty(cr,"__esModule",{value:!0}),cr.expand_message_xmd=o,cr.expand_message_xof=c,cr.hash_to_field=u,cr.isogenyMap=d,cr.createHasher=l;const e=Ku(),t=Jo(),n=t.bytesToNumberBE;function r(f,b){if(a(f),a(b),f<0||f>=1<<8*b)throw new Error("invalid I2OSP input: "+f);const T=Array.from({length:b}).fill(0);for(let v=b-1;v>=0;v--)T[v]=f&255,f>>>=8;return new Uint8Array(T)}function s(f,b){const T=new Uint8Array(f.length);for(let v=0;v<f.length;v++)T[v]=f[v]^b[v];return T}function a(f){if(!Number.isSafeInteger(f))throw new Error("number expected")}function o(f,b,T,v){(0,t.abytes)(f),(0,t.abytes)(b),a(T),b.length>255&&(b=v((0,t.concatBytes)((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-"),b)));const{outputLen:p,blockLen:O}=v,I=Math.ceil(T/p);if(T>65535||I>255)throw new Error("expand_message_xmd: invalid lenInBytes");const h=(0,t.concatBytes)(b,r(b.length,1)),j=r(0,O),i=r(T,2),g=new Array(I),_=v((0,t.concatBytes)(j,f,i,r(0,1),h));g[0]=v((0,t.concatBytes)(_,r(1,1),h));for(let R=1;R<=I;R++){const w=[s(_,g[R-1]),r(R+1,1),h];g[R]=v((0,t.concatBytes)(...w))}return(0,t.concatBytes)(...g).slice(0,T)}function c(f,b,T,v,p){if((0,t.abytes)(f),(0,t.abytes)(b),a(T),b.length>255){const O=Math.ceil(2*v/8);b=p.create({dkLen:O}).update((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(b).digest()}if(T>65535||b.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return p.create({dkLen:T}).update(f).update(r(T,2)).update(b).update(r(b.length,1)).digest()}function u(f,b,T){(0,t.validateObject)(T,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:v,k:p,m:O,hash:I,expand:h,DST:j}=T;(0,t.abytes)(f),a(b);const i=typeof j=="string"?(0,t.utf8ToBytes)(j):j,g=v.toString(2).length,_=Math.ceil((g+p)/8),E=b*O*_;let R;if(h==="xmd")R=o(f,i,E,I);else if(h==="xof")R=c(f,i,E,p,I);else if(h==="_internal_pass")R=f;else throw new Error('expand must be "xmd" or "xof"');const w=new Array(b);for(let y=0;y<b;y++){const x=new Array(O);for(let C=0;C<O;C++){const B=_*(C+y*O),H=R.subarray(B,B+_);x[C]=(0,e.mod)(n(H),v)}w[y]=x}return w}function d(f,b){const T=b.map(v=>Array.from(v).reverse());return(v,p)=>{const[O,I,h,j]=T.map(_=>_.reduce((E,R)=>f.add(f.mul(E,v),R))),[i,g]=(0,e.FpInvertBatch)(f,[I,j],!0);return v=f.mul(O,i),p=f.mul(p,f.mul(h,g)),{x:v,y:p}}}function l(f,b,T){if(typeof b!="function")throw new Error("mapToCurve() must be defined");function v(O){return f.fromAffine(b(O))}function p(O){const I=O.clearCofactor();return I.equals(f.ZERO)?f.ZERO:(I.assertValidity(),I)}return{defaults:T,hashToCurve(O,I){const h=u(O,2,{...T,DST:T.DST,...I}),j=v(h[0]),i=v(h[1]);return p(j.add(i))},encodeToCurve(O,I){const h=u(O,1,{...T,DST:T.encodeDST,...I});return p(v(h[0]))},mapToCurve(O){if(!Array.isArray(O))throw new Error("expected array of bigints");for(const I of O)if(typeof I!="bigint")throw new Error("expected array of bigints");return p(v(O))}}}return cr}var wb;function Xo(){return wb||(wb=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.secp256k1_hasher=e.schnorr=e.secp256k1=void 0;const t=Fp(),n=yr(),r=T6(),s=S6(),a=Ku(),o=Jo(),c=Lp(),u=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),d=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),l=BigInt(0),f=BigInt(1),b=BigInt(2),T=(m,M)=>(m+M/b)/M;function v(m){const M=u,A=BigInt(3),P=BigInt(6),S=BigInt(11),q=BigInt(22),N=BigInt(23),U=BigInt(44),L=BigInt(88),z=m*m*m%M,D=z*z*m%M,X=(0,a.pow2)(D,A,M)*D%M,W=(0,a.pow2)(X,A,M)*D%M,Z=(0,a.pow2)(W,b,M)*z%M,J=(0,a.pow2)(Z,S,M)*Z%M,oe=(0,a.pow2)(J,q,M)*J%M,K=(0,a.pow2)(oe,U,M)*oe%M,Y=(0,a.pow2)(K,L,M)*K%M,$=(0,a.pow2)(Y,U,M)*oe%M,re=(0,a.pow2)($,A,M)*D%M,ee=(0,a.pow2)(re,N,M)*J%M,ne=(0,a.pow2)(ee,P,M)*z%M,se=(0,a.pow2)(ne,b,M);if(!p.eql(p.sqr(se),m))throw new Error("Cannot find square root");return se}const p=(0,a.Field)(u,void 0,void 0,{sqrt:v});e.secp256k1=(0,r.createCurve)({a:l,b:BigInt(7),Fp:p,n:d,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:m=>{const M=d,A=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),P=-f*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),S=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),q=A,N=BigInt("0x100000000000000000000000000000000"),U=T(q*m,M),L=T(-P*m,M);let z=(0,a.mod)(m-U*A-L*S,M),D=(0,a.mod)(-U*P-L*q,M);const X=z>N,W=D>N;if(X&&(z=M-z),W&&(D=M-D),z>N||D>N)throw new Error("splitScalar: Endomorphism failed, k="+m);return{k1neg:X,k1:z,k2neg:W,k2:D}}}},t.sha256);const O={};function I(m,...M){let A=O[m];if(A===void 0){const P=(0,t.sha256)(Uint8Array.from(m,S=>S.charCodeAt(0)));A=(0,o.concatBytes)(P,P),O[m]=A}return(0,t.sha256)((0,o.concatBytes)(A,...M))}const h=m=>m.toRawBytes(!0).slice(1),j=m=>(0,o.numberToBytesBE)(m,32),i=m=>(0,a.mod)(m,u),g=m=>(0,a.mod)(m,d),_=e.secp256k1.ProjectivePoint,E=(m,M,A)=>_.BASE.multiplyAndAddUnsafe(m,M,A);function R(m){let M=e.secp256k1.utils.normPrivateKeyToScalar(m),A=_.fromPrivateKey(M);return{scalar:A.hasEvenY()?M:g(-M),bytes:h(A)}}function w(m){(0,o.aInRange)("x",m,f,u);const M=i(m*m),A=i(M*m+BigInt(7));let P=v(A);P%b!==l&&(P=i(-P));const S=new _(m,P,f);return S.assertValidity(),S}const y=o.bytesToNumberBE;function x(...m){return g(y(I("BIP0340/challenge",...m)))}function C(m){return R(m).bytes}function B(m,M,A=(0,n.randomBytes)(32)){const P=(0,o.ensureBytes)("message",m),{bytes:S,scalar:q}=R(M),N=(0,o.ensureBytes)("auxRand",A,32),U=j(q^y(I("BIP0340/aux",N))),L=I("BIP0340/nonce",U,S,P),z=g(y(L));if(z===l)throw new Error("sign failed: k is zero");const{bytes:D,scalar:X}=R(z),W=x(D,S,P),Z=new Uint8Array(64);if(Z.set(D,0),Z.set(j(g(X+W*q)),32),!H(Z,P,S))throw new Error("sign: Invalid signature produced");return Z}function H(m,M,A){const P=(0,o.ensureBytes)("signature",m,64),S=(0,o.ensureBytes)("message",M),q=(0,o.ensureBytes)("publicKey",A,32);try{const N=w(y(q)),U=y(P.subarray(0,32));if(!(0,o.inRange)(U,f,u))return!1;const L=y(P.subarray(32,64));if(!(0,o.inRange)(L,f,d))return!1;const z=x(j(U),h(N),S),D=E(N,L,g(-z));return!(!D||!D.hasEvenY()||D.toAffine().x!==U)}catch{return!1}}e.schnorr={getPublicKey:C,sign:B,verify:H,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:w,pointToBytes:h,numberToBytesBE:o.numberToBytesBE,bytesToNumberBE:o.bytesToNumberBE,taggedHash:I,mod:a.mod}};const F=(0,s.isogenyMap)(p,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a4
3713deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(m=>m.map(M=>BigInt(M)))),k=(0,c.mapToCurveSimpleSWU)(p,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:p.create(BigInt("-11"))});e.secp256k1_hasher=(0,s.createHasher)(e.secp256k1.ProjectivePoint,m=>{const{x:M,y:A}=k(p.create(m[0]));return F(M,A)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:p.ORDER,m:1,k:128,expand:"xmd",hash:t.sha256}),e.hashToCurve=e.secp256k1_hasher.hashToCurve,e.encodeToCurve=e.secp256k1_hasher.encodeToCurve})(Ld)),Ld}var jb;function jf(){if(jb)return cs;jb=1,Object.defineProperty(cs,"__esModule",{value:!0}),cs.recoverPublicKey=s;const e=nt(),t=at(),n=Ne(),r=ie();async function s({hash:o,signature:c}){const u=(0,e.isHex)(o)?o:(0,r.toHex)(o),{secp256k1:d}=await Promise.resolve().then(()=>Xo());return`0x${(()=>{if(typeof c=="object"&&"r"in c&&"s"in c){const{r:p,s:O,v:I,yParity:h}=c,j=Number(h??I),i=a(j);return new d.Signature((0,n.hexToBigInt)(p),(0,n.hexToBigInt)(O)).addRecoveryBit(i)}const b=(0,e.isHex)(c)?c:(0,r.toHex)(c);if((0,t.size)(b)!==65)throw new Error("invalid signature length");const T=(0,n.hexToNumber)(`0x${b.slice(130)}`),v=a(T);return d.Signature.fromCompact(b.substring(2,130)).addRecoveryBit(v)})().recoverPublicKey(u.substring(2)).toHex(!1)}`}function a(o){if(o===0||o===1)return o;if(o===27)return 0;if(o===28)return 1;throw new Error("Invalid yParityOrV value")}return cs}var Pb;function Er(){if(Pb)return ss;Pb=1,Object.defineProperty(ss,"__esModule",{value:!0}),ss.recoverAddress=n;const e=kp(),t=jf();async function n({hash:r,signature:s}){return(0,e.publicKeyToAddress)(await(0,t.recoverPublicKey)({hash:r,signature:s}))}return ss}var us={},mn={},Ab;function Qo(){if(Ab)return mn;Ab=1,Object.defineProperty(mn,"__esModule",{value:!0}),mn.toRlp=s,mn.bytesToRlp=a,mn.hexToRlp=o;const e=fe(),t=Ko(),n=Pe(),r=ie();function s(f,b="hex"){const T=c(f),v=(0,t.createCursor)(new Uint8Array(T.length));return T.encode(v),b==="hex"?(0,r.bytesToHex)(v.bytes):v.bytes}function a(f,b="bytes"){return s(f,b)}function o(f,b="hex"){return s(f,b)}function c(f){return Array.isArray(f)?u(f.map(b=>c(b))):d(f)}function u(f){const b=f.reduce((p,O)=>p+O.length,0),T=l(b);return{length:b<=55?1+b:1+T+b,encode(p){b<=55?p.pushByte(192+b):(p.pushByte(247+T),T===1?p.pushUint8(b):T===2?p.pushUint16(b):T===3?p.pushUint24(b):p.pushUint32(b));for(const{encode:O}of f)O(p)}}}function d(f){const b=typeof f=="string"?(0,n.hexToBytes)(f):f,T=l(b.length);return{length:b.length===1&&b[0]<128?1:b.length<=55?1+b.length:1+T+b.length,encode(p){b.length===1&&b[0]<128?p.pushBytes(b):b.length<=55?(p.pushByte(128+b.length),p.pushBytes(b)):(p.pushByte(183+T),T===1?p.pushUint8(b.length):T===2?p.pushUint16(b.length):T===3?p.pushUint24(b.length):p.pushUint32(b.length),p.pushBytes(b))}}}function l(f){if(f<2**8)return 1;if(f<2**16)return 2;if(f<2**24)return 3;if(f<2**32)return 4;throw new e.BaseError("Length is too large.")}return mn}var Tb;function Up(){if(Tb)return us;Tb=1,Object.defineProperty(us,"__esModule",{value:!0}),us.hashAuthorization=a;const e=Le(),t=Pe(),n=ie(),r=Qo(),s=ct();function a(o){const{chainId:c,nonce:u,to:d}=o,l=o.contractAddress??o.address,f=(0,s.keccak256)((0,e.concatHex)(["0x05",(0,r.toRlp)([c?(0,n.numberToHex)(c):"0x",l,u?(0,n.numberToHex)(u):"0x"])]));return d==="bytes"?(0,t.hexToBytes)(f):f}return us}var Sb;function $o(){if(Sb)return is;Sb=1,Object.defineProperty(is,"__esModule",{value:!0}),is.recoverAuthorizationAddress=n;const e=Er(),t=Up();async function n(r){const{authorization:s,signature:a}=r;return(0,e.recoverAddress)({hash:(0,t.hashAuthorization)(s),signature:a??s})}return is}var ds={},bo={},Ib;function zp(){if(Ib)return bo;Ib=1,Object.defineProperty(bo,"__esModule",{value:!0}),bo.EstimateGasExecutionError=void 0;const e=Yo(),t=en(),n=fe(),r=dt();class s extends n.BaseError{constructor(o,{account:c,docsPath:u,chain:d,data:l,gas:f,gasPrice:b,maxFeePerGas:T,maxPriorityFeePerGas:v,nonce:p,to:O,value:I}){const h=(0,r.prettyPrint)({from:c?.address,to:O,value:typeof I<"u"&&`${(0,e.formatEther)(I)} ${d?.nativeCurrency?.symbol||"ETH"}`,data:l,gas:f,gasPrice:typeof b<"u"&&`${(0,t.formatGwei)(b)} gwei`,maxFeePerGas:typeof T<"u"&&`${(0,t.formatGwei)(T)} gwei`,maxPriorityFeePerGas:typeof v<"u"&&`${(0,t.formatGwei)(v)} gwei`,nonce:p});super(o.shortMessage,{cause:o,docsPath:u,metaMessages:[...o.metaMessages?[...o.metaMessages," "]:[],"Estimate Gas Arguments:",h].filter(
37Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=o}}return bo.EstimateGasExecutionError=s,bo}var we={},Bb;function rr(){if(Bb)return we;Bb=1,Object.defineProperty(we,"__esModule",{value:!0}),we.UnknownNodeError=we.TipAboveFeeCapError=we.TransactionTypeNotSupportedError=we.IntrinsicGasTooLowError=we.IntrinsicGasTooHighError=we.InsufficientFundsError=we.NonceMaxValueError=we.NonceTooLowError=we.NonceTooHighError=we.FeeCapTooLowError=we.FeeCapTooHighError=we.ExecutionRevertedError=void 0;const e=en(),t=fe();class n extends t.BaseError{constructor({cause:p,message:O}={}){const I=O?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${I?`with reason: ${I}`:"for an unknown reason"}.`,{cause:p,name:"ExecutionRevertedError"})}}we.ExecutionRevertedError=n,Object.defineProperty(n,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(n,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class r extends t.BaseError{constructor({cause:p,maxFeePerGas:O}={}){super(`The fee cap (\`maxFeePerGas\`${O?` = ${(0,e.formatGwei)(O)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:p,name:"FeeCapTooHighError"})}}we.FeeCapTooHighError=r,Object.defineProperty(r,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class s extends t.BaseError{constructor({cause:p,maxFeePerGas:O}={}){super(`The fee cap (\`maxFeePerGas\`${O?` = ${(0,e.formatGwei)(O)}`:""} gwei) cannot be lower than the block base fee.`,{cause:p,name:"FeeCapTooLowError"})}}we.FeeCapTooLowError=s,Object.defineProperty(s,"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/});class a extends t.BaseError{constructor({cause:p,nonce:O}={}){super(`Nonce provided for the transaction ${O?`(${O}) `:""}is higher than the next one expected.`,{cause:p,name:"NonceTooHighError"})}}we.NonceTooHighError=a,Object.defineProperty(a,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class o extends t.BaseError{constructor({cause:p,nonce:O}={}){super([`Nonce provided for the transaction ${O?`(${O}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
38`),{cause:p,name:"NonceTooLowError"})}}we.NonceTooLowError=o,Object.defineProperty(o,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class c extends t.BaseError{constructor({cause:p,nonce:O}={}){super(`Nonce provided for the transaction ${O?`(${O}) `:""}exceeds the maximum allowed nonce.`,{cause:p,name:"NonceMaxValueError"})}}we.NonceMaxValueError=c,Object.defineProperty(c,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class u extends t.BaseError{constructor({cause:p}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
39`),{cause:p,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."],name:"InsufficientFundsError"})}}we.InsufficientFundsError=u,Object.defineProperty(u,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class d extends t.BaseError{constructor({cause:p,gas:O}={}){super(`The amount of gas ${O?`(${O}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:p,name:"IntrinsicGasTooHighError"})}}we.IntrinsicGasTooHighError=d,Object.defineProperty(d,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class l extends t.BaseError{constructor({cause:p,gas:O}={}){super(`The amount of gas ${O?`(${O}) `:""}provided for the transaction is too low.`,{cause:p,name:"IntrinsicGasTooLowError"})}}we.IntrinsicGasTooLowError=l,Object.defineProperty(l,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class f extends t.BaseError{constructor({cause:p}){super("The transaction type is not supported for this chain.",{cause:p,name:"TransactionTypeNotSupportedError"})}}
39we.TransactionTypeNotSupportedError=f,Object.defineProperty(f,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class b extends t.BaseError{constructor({cause:p,maxPriorityFeePerGas:O,maxFeePerGas:I}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${O?` = ${(0,e.formatGwei)(O)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${I?` = ${(0,e.formatGwei)(I)} gwei`:""}).`].join(`
40`),{cause:p,name:"TipAboveFeeCapError"})}}we.TipAboveFeeCapError=b,Object.defineProperty(b,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class T extends t.BaseError{constructor({cause:p}){super(`An error occurred while executing: ${p?.shortMessage}`,{cause:p,name:"UnknownNodeError"})}}return we.UnknownNodeError=T,we}var mo={},xb;function ei(){if(xb)return mo;xb=1,Object.defineProperty(mo,"__esModule",{value:!0}),mo.containsNodeError=s,mo.getNodeError=a;const e=fe(),t=rr(),n=Bt(),r=_r();function s(o){return o instanceof r.TransactionRejectedRpcError||o instanceof r.InvalidInputRpcError||o instanceof n.RpcRequestError&&o.code===t.ExecutionRevertedError.code}function a(o,c){const u=(o.details||"").toLowerCase(),d=o instanceof e.BaseError?o.walk(l=>l?.code===t.ExecutionRevertedError.code):o;return d instanceof e.BaseError?new t.ExecutionRevertedError({cause:o,message:d.details}):t.ExecutionRevertedError.nodeMessage.test(u)?new t.ExecutionRevertedError({cause:o,message:o.details}):t.FeeCapTooHighError.nodeMessage.test(u)?new t.FeeCapTooHighError({cause:o,maxFeePerGas:c?.maxFeePerGas}):t.FeeCapTooLowError.nodeMessage.test(u)?new t.FeeCapTooLowError({cause:o,maxFeePerGas:c?.maxFeePerGas}):t.NonceTooHighError.nodeMessage.test(u)?new t.NonceTooHighError({cause:o,nonce:c?.nonce}):t.NonceTooLowError.nodeMessage.test(u)?new t.NonceTooLowError({cause:o,nonce:c?.nonce}):t.NonceMaxValueError.nodeMessage.test(u)?new t.NonceMaxValueError({cause:o,nonce:c?.nonce}):t.InsufficientFundsError.nodeMessage.test(u)?new t.InsufficientFundsError({cause:o}):t.IntrinsicGasTooHighError.nodeMessage.test(u)?new t.IntrinsicGasTooHighError({cause:o,gas:c?.gas}):t.IntrinsicGasTooLowError.nodeMessage.test(u)?new t.IntrinsicGasTooLowError({cause:o,gas:c?.gas}):t.TransactionTypeNotSupportedError.nodeMessage.test(u)?new t.TransactionTypeNotSupportedError({cause:o}):t.TipAboveFeeCapError.nodeMessage.test(u)?new t.TipAboveFeeCapError({cause:o,maxFeePerGas:c?.maxFeePerGas,maxPriorityFeePerGas:c?.maxPriorityFeePerGas}):new t.UnknownNodeError({cause:o})}return mo}var Rb;function Dp(){if(Rb)return ds;Rb=1,Object.defineProperty(ds,"__esModule",{value:!0}),ds.getEstimateGasError=r;const e=zp(),t=rr(),n=ei();function r(s,{docsPath:a,...o}){const c=(()=>{const u=(0,n.getNodeError)(s,o);return u instanceof t.UnknownNodeError?s:u})();return new e.EstimateGasExecutionError(c,{docsPath:a,...o})}return ds}var fs={},Ob;function wr(){if(Ob)return fs;Ob=1,Object.defineProperty(fs,"__esModule",{value:!0}),fs.extract=e;function e(t,{format:n}){if(!n)return{};const r={};function s(o){const c=Object.keys(o);for(const u of c)u in t&&(r[u]=t[u]),o[u]&&typeof o[u]=="object"&&!Array.isArray(o[u])&&s(o[u])}const a=n(t||{});return s(a),r}return fs}var Dd={},ls={},Cb;function ti(){if(Cb)return ls;Cb=1,Object.defineProperty(ls,"__esModule",{value:!0}),ls.defineFormatter=e;function e(t,n){return({exclude:r,format:s})=>({exclude:r,format:(a,o)=>{const c=n(a,o);if(r)for(const u of r)delete c[u];return{...c,...s(a,o)}},type:t})}return ls}var qb;function xt(){return qb||(qb=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.defineTransactionRequest=e.rpcTransactionType=void 0,e.formatTransactionRequest=r;const t=ie(),n=ti();e.rpcTransactionType={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function r(a,o){const c={};return typeof a.authorizationList<"u"&&(c.authorizationList=s(a.authorizationList)),typeof a.accessList<"u"&&(c.accessList=a.accessList),typeof a.blobVersionedHashes<"u"&&(c.blobVersionedHashes=a.blobVersionedHashes),typeof a.blobs<"u"&&(typeof a.blobs[0]!="str
40ing"?c.blobs=a.blobs.map(u=>(0,t.bytesToHex)(u)):c.blobs=a.blobs),typeof a.data<"u"&&(c.data=a.data),a.account&&(c.from=a.account.address),typeof a.from<"u"&&(c.from=a.from),typeof a.gas<"u"&&(c.gas=(0,t.numberToHex)(a.gas)),typeof a.gasPrice<"u"&&(c.gasPrice=(0,t.numberToHex)(a.gasPrice)),typeof a.maxFeePerBlobGas<"u"&&(c.maxFeePerBlobGas=(0,t.numberToHex)(a.maxFeePerBlobGas)),typeof a.maxFeePerGas<"u"&&(c.maxFeePerGas=(0,t.numberToHex)(a.maxFeePerGas)),typeof a.maxPriorityFeePerGas<"u"&&(c.maxPriorityFeePerGas=(0,t.numberToHex)(a.maxPriorityFeePerGas)),typeof a.nonce<"u"&&(c.nonce=(0,t.numberToHex)(a.nonce)),typeof a.to<"u"&&(c.to=a.to),typeof a.type<"u"&&(c.type=e.rpcTransactionType[a.type]),typeof a.value<"u"&&(c.value=(0,t.numberToHex)(a.value)),c}e.defineTransactionRequest=(0,n.defineFormatter)("transactionRequest",r);function s(a){return a.map(o=>({address:o.address,r:o.r?(0,t.numberToHex)(BigInt(o.r)):o.r,s:o.s?(0,t.numberToHex)(BigInt(o.s)):o.s,chainId:(0,t.numberToHex)(o.chainId),nonce:(0,t.numberToHex)(o.nonce),...typeof o.yParity<"u"?{yParity:(0,t.numberToHex)(o.yParity)}:{},...typeof o.v<"u"&&typeof o.yParity>"u"?{v:(0,t.numberToHex)(o.v)}:{}}))}})(Dd)),Dd}var hn={},Hb;function Pf(){if(Hb)return hn;Hb=1,Object.defineProperty(hn,"__esModule",{value:!0}),hn.serializeStateMapping=a,hn.serializeAccountStateOverride=o,hn.serializeStateOverride=c;const e=St(),t=Uu(),n=Ef(),r=ut(),s=ie();function a(u){if(!(!u||u.length===0))return u.reduce((d,{slot:l,value:f})=>{if(l.length!==66)throw new t.InvalidBytesLengthError({size:l.length,targetSize:66,type:"hex"});if(f.length!==66)throw new t.InvalidBytesLengthError({size:f.length,targetSize:66,type:"hex"});return d[l]=f,d},{})}function o(u){const{balance:d,nonce:l,state:f,stateDiff:b,code:T}=u,v={};if(T!==void 0&&(v.code=T),d!==void 0&&(v.balance=(0,s.numberToHex)(d)),l!==void 0&&(v.nonce=(0,s.numberToHex)(l)),f!==void 0&&(v.state=a(f)),b!==void 0){if(v.state)throw new n.StateAssignmentConflictError;v.stateDiff=a(b)}return v}function c(u){if(!u)return;const d={};for(const{address:l,...f}of u){if(!(0,r.isAddress)(l,{strict:!1}))throw new e.InvalidAddressError({address:l});if(d[l])throw new n.AccountStateConflictError({address:l});d[l]=o(f)}return d}return hn}var bs={},V={},Mb;function Af(){return Mb||(Mb=1,Object.defineProperty(V,"__esModule",{value:!0}),V.minInt144=V.minInt136=V.minInt128=V.minInt120=V.minInt112=V.minInt104=V.minInt96=V.minInt88=V.minInt80=V.minInt72=V.minInt64=V.minInt56=V.minInt48=V.minInt40=V.minInt32=V.minInt24=V.minInt16=V.minInt8=V.maxInt256=V.maxInt248=V.maxInt240=V.maxInt232=V.maxInt224=V.maxInt216=V.maxInt208=V.maxInt200=V.maxInt192=V.maxInt184=V.maxInt176=V.maxInt168=V.maxInt160=V.maxInt152=V.maxInt144=V.maxInt136=V.maxInt128=V.maxInt120=V.maxInt112=V.maxInt104=V.maxInt96=V.maxInt88=V.maxInt80=V.maxInt72=V.maxInt64=V.maxInt56=V.maxInt48=V.maxInt40=V.maxInt32=V.maxInt24=V.maxInt16=V.maxInt8=void 0,V.maxUint256=V.maxUint248=V.maxUint240=V.maxUint232=V.maxUint224=V.maxUint216=V.maxUint208=V.maxUint200=V.maxUint192=V.maxUint184=V.maxUint176=V.maxUint168=V.maxUint160=V.maxUint152=V.maxUint144=V.maxUint136=V.maxUint128=V.maxUint120=V.maxUint112=V.maxUint104=V.maxUint96=V.maxUint88=V.maxUint80=V.maxUint72=V.maxUint64=V.maxUint56=V.maxUint48=V.maxUint40=V.maxUint32=V.maxUint24=V.maxUint16=V.maxUint8=V.minInt256=V.minInt248=V.minInt240=V.minInt232=V.minInt224=V.minInt216=V.minInt208=V.minInt200=V.minInt192=V.minInt184=V.minInt176=V.minInt168=V.minInt160=V.minInt152=void 0,V.maxInt8=2n**(8n-1n)-1n,V.maxInt16=2n**(16n-1n)-1n,V.maxInt24=2n**(24n-1n)-1n,V.maxInt32=2n**(32n-1n)-1n,V.maxInt40=2n**(40n-1n)-1n,V.maxInt48=2n**(48n-1n)-1n,V.maxInt56=2n**(56n-1n)-1n,V.maxInt64=2n**(64n-1n)-1n,V.maxInt72=2n**(72n-1n)-1n,V.maxInt80=2n**(80n-1n)-1n,V.maxInt88=2n**(88n-1n)-1n,V.maxInt96=2n**(96n-1n)-1n,V.maxInt104=2n**(104n-1n)-1n,V.maxInt112=2n**(112n-1n)-1n,V.maxInt120=2n**(120n-1n)-1n,V.maxInt128=2n**(128n-1n)-1n,V.maxInt136=2n**(136n-1n)-1n,V.maxInt144=2n**(144n-1n)-1n,V.maxInt152=2n**(152n-1n)-1n,V.maxInt160=2n**(160n-1n)-1n,V.maxInt168=2n**(168n-1n)-1n,V.maxInt176=2n**(176n-1n)-1n,V.maxInt184=2n**(184n-1n)-1n,V.maxInt192=2n**(192n-1n)-1n,V.maxInt200=2n**(200n-1n)-1n,V.maxInt208=2n**(208n-1n)-1n,V.maxInt216=2n**(216n-1n)-1n,V.maxInt224=2n**(224n-1n)-1n,V.maxInt232=2n**(232n-1n)-1n,V.maxInt240=2n**(240n-1n)-1n,V.maxInt248=2n**(248n-1n)-1n,V.maxInt256=2n**(256n-1n)-1n,V.minInt8=-(2n**(8n-1n)),V.minInt16=-(2n**(16n-1n)),V.minInt24=-(2n**(24n-1n)),V.minInt32=-(2n**(32n-1n)),V.minInt40=-(2n**(40n-1n)),V.minInt48=-(2n**(48n-1n)),V.minInt56=-(2n**(56n-1n)),V.minInt64=-(2n**(64n-1n)),V.minInt72=-(2n**(72n-1n)),V.minInt80=-(2n**(80n-1n)),V.minInt88=-(2n**(88n-1n)),V.minInt96=-(2n**(96n-1n)),V.minInt104=-(2n**(104n-1n)),V.minInt112=-(2n**(112n-1n)),V.minInt120=-(2n**(120n-1n)),V.minInt128=-(2n**(128n-1n)),V.minInt136=-(2n**(136n-1n)),V.minInt144=-(2n**(144n-1n)),V.minInt152=-(2n**(152n-1n)),V.minInt160=-(2n**(160n-1n)),V.minInt168=-(2n**(168
40n-1n)),V.minInt176=-(2n**(176n-1n)),V.minInt184=-(2n**(184n-1n)),V.minInt192=-(2n**(192n-1n)),V.minInt200=-(2n**(200n-1n)),V.minInt208=-(2n**(208n-1n)),V.minInt216=-(2n**(216n-1n)),V.minInt224=-(2n**(224n-1n)),V.minInt232=-(2n**(232n-1n)),V.minInt240=-(2n**(240n-1n)),V.minInt248=-(2n**(248n-1n)),V.minInt256=-(2n**(256n-1n)),V.maxUint8=2n**8n-1n,V.maxUint16=2n**16n-1n,V.maxUint24=2n**24n-1n,V.maxUint32=2n**32n-1n,V.maxUint40=2n**40n-1n,V.maxUint48=2n**48n-1n,V.maxUint56=2n**56n-1n,V.maxUint64=2n**64n-1n,V.maxUint72=2n**72n-1n,V.maxUint80=2n**80n-1n,V.maxUint88=2n**88n-1n,V.maxUint96=2n**96n-1n,V.maxUint104=2n**104n-1n,V.maxUint112=2n**112n-1n,V.maxUint120=2n**120n-1n,V.maxUint128=2n**128n-1n,V.maxUint136=2n**136n-1n,V.maxUint144=2n**144n-1n,V.maxUint152=2n**152n-1n,V.maxUint160=2n**160n-1n,V.maxUint168=2n**168n-1n,V.maxUint176=2n**176n-1n,V.maxUint184=2n**184n-1n,V.maxUint192=2n**192n-1n,V.maxUint200=2n**200n-1n,V.maxUint208=2n**208n-1n,V.maxUint216=2n**216n-1n,V.maxUint224=2n**224n-1n,V.maxUint232=2n**232n-1n,V.maxUint240=2n**240n-1n,V.maxUint248=2n**248n-1n,V.maxUint256=2n**256n-1n),V}var kb;function Rt(){if(kb)return bs;kb=1,Object.defineProperty(bs,"__esModule",{value:!0}),bs.assertRequest=a;const e=He(),t=Af(),n=St(),r=rr(),s=ut();function a(o){const{account:c,maxFeePerGas:u,maxPriorityFeePerGas:d,to:l}=o,f=c?(0,e.parseAccount)(c):void 0;if(f&&!(0,s.isAddress)(f.address))throw new n.InvalidAddressError({address:f.address});if(l&&!(0,s.isAddress)(l))throw new n.InvalidAddressError({address:l});if(u&&u>t.maxUint256)throw new r.FeeCapTooHighError({maxFeePerGas:u});if(d&&u&&d>u)throw new r.TipAboveFeeCapError({maxFeePerGas:u,maxPriorityFeePerGas:d})}return bs}var Gd={},ho={},Jt={},Nb;function ri(){if(Nb)return Jt;Nb=1,Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.MaxFeePerGasTooLowError=Jt.Eip1559FeesNotSupportedError=Jt.BaseFeeScalarError=void 0;const e=en(),t=fe();class n extends t.BaseError{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}Jt.BaseFeeScalarError=n;class r extends t.BaseError{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}Jt.Eip1559FeesNotSupportedError=r;class s extends t.BaseError{constructor({maxPriorityFeePerGas:o}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${(0,e.formatGwei)(o)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}return Jt.MaxFeePerGasTooLowError=s,Jt}var yo={},ms={},go={},Fb;function Tf(){if(Fb)return go;Fb=1,Object.defineProperty(go,"__esModule",{value:!0}),go.BlockNotFoundError=void 0;const e=fe();class t extends e.BaseError{constructor({blockHash:r,blockNumber:s}){let a="Block";r&&(a=`Block at hash "${r}"`),s&&(a=`Block at number "${s}"`),super(`${a} could not be found.`,{name:"BlockNotFoundError"})}}return go.BlockNotFoundError=t,go}var yn={},Vd={},Lb;function Rn(){return Lb||(Lb=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.defineTransaction=e.transactionType=void 0,e.formatTransaction=r;const t=Ne(),n=ti();e.transactionType={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function r(a,o){const c={...a,blockHash:a.blockHash?a.blockHash:null,blockNumber:a.blockNumber?BigInt(a.blockNumber):null,chainId:a.chainId?(0,t.hexToNumber)(a.chainId):void 0,gas:a.gas?BigInt(a.gas):void 0,gasPrice:a.gasPrice?BigInt(a.gasPrice):void 0,maxFeePerBlobGas:a.maxFeePerBlobGas?BigInt(a.maxFeePerBlobGas):void 0,maxFeePerGas:a.maxFeePerGas?BigInt(a.maxFeePerGas):void 0,maxPriorityFeePerGas:a.maxPriorityFeePerGas?BigInt(a.maxPriorityFeePerGas):void 0,nonce:a.nonce?(0,t.hexToNumber)(a.nonce):void 0,to:a.to?a.to:null,transactionIndex:a.transactionIndex?Number(a.transactionIndex):null,type:a.type?e.transactionType[a.type]:void 0,typeHex:a.type?a.type:void 0,value:a.value?BigInt(a.value):void 0,v:a.v?BigInt(a.v):void 0};return a.authorizationList&&(c.authorizationList=s(a.authorizationList)),c.yParity=(()=>{if(a.yParity)return Number(a.yParity);if(typeof c.v=="bigint"){if(c.v===0n||c.v===27n)return 0;if(c.v===1n||c.v===28n)return 1;if(c.v>=35n)return c.v%2n===0n?1:0}})(),c.type==="legacy"&&(delete c.accessList,delete c.maxFeePerBlobGas,delete c.maxFeePerGas,delete c.maxPriorityFeePerGas,delete c.yParity),c.type==="eip2930"&&(delete c.maxFeePerBlobGas,delete c.maxFeePerGas,delete c.maxPriorityFeePerGas),c.type==="eip1559"&&delete c.maxFeePerBlobGas,c}e.defineTransaction=(0,n.defineFormatter)("transaction",r);function s(a){return a.map(o=>({address:o.address,chainId:Number(o.chainId),nonce:Number(o.nonce),r:o.r,s:o.s,yParity:Number(o.yParity)}))}})(Vd)),Vd}var Ub;function Zu(){if(Ub)return yn;Ub=1,Object.defineProperty(yn,"__esModule",{value:!0}),yn.defineBlock=void 0,yn.formatBlock=n;const e=ti(),t=Rn();function n(r,s){const a=(r.transactions??[]).map(o=>
40typeof o=="string"?o:(0,t.formatTransaction)(o));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:a,totalDifficulty:r.totalDifficulty?BigInt(r.totalDifficulty):null}}return yn.defineBlock=(0,e.defineFormatter)("block",n),yn}var zb;function tn(){if(zb)return ms;zb=1,Object.defineProperty(ms,"__esModule",{value:!0}),ms.getBlock=r;const e=Tf(),t=ie(),n=Zu();async function r(s,{blockHash:a,blockNumber:o,blockTag:c=s.experimental_blockTag??"latest",includeTransactions:u}={}){const d=u??!1,l=o!==void 0?(0,t.numberToHex)(o):void 0;let f=null;if(a?f=await s.request({method:"eth_getBlockByHash",params:[a,d]},{dedupe:!0}):f=await s.request({method:"eth_getBlockByNumber",params:[l||c,d]},{dedupe:!!l}),!f)throw new e.BlockNotFoundError({blockHash:a,blockNumber:o});return(s.chain?.formatters?.block?.format||n.formatBlock)(f,"getBlock")}return ms}var hs={},Db;function Sf(){if(Db)return hs;Db=1,Object.defineProperty(hs,"__esModule",{value:!0}),hs.getGasPrice=e;async function e(t){const n=await t.request({method:"eth_gasPrice"});return BigInt(n)}return hs}var Gb;function Gp(){if(Gb)return yo;Gb=1,Object.defineProperty(yo,"__esModule",{value:!0}),yo.estimateMaxPriorityFeePerGas=a,yo.internal_estimateMaxPriorityFeePerGas=o;const e=ri(),t=Ne(),n=ge(),r=tn(),s=Sf();async function a(c,u){return o(c,u)}async function o(c,u){const{block:d,chain:l=c.chain,request:f}=u||{};try{const b=l?.fees?.maxPriorityFeePerGas??l?.fees?.defaultPriorityFee;if(typeof b=="function"){const v=d||await(0,n.getAction)(c,r.getBlock,"getBlock")({}),p=await b({block:v,client:c,request:f});if(p===null)throw new Error;return p}if(typeof b<"u")return b;const T=await c.request({method:"eth_maxPriorityFeePerGas"});return(0,t.hexToBigInt)(T)}catch{const[b,T]=await Promise.all([d?Promise.resolve(d):(0,n.getAction)(c,r.getBlock,"getBlock")({}),(0,n.getAction)(c,s.getGasPrice,"getGasPrice")({})]);if(typeof b.baseFeePerGas!="bigint")throw new e.Eip1559FeesNotSupportedError;const v=T-b.baseFeePerGas;return v<0n?0n:v}}return yo}var Vb;function Vp(){if(Vb)return ho;Vb=1,Object.defineProperty(ho,"__esModule",{value:!0}),ho.estimateFeesPerGas=a,ho.internal_estimateFeesPerGas=o;const e=ri(),t=ge(),n=Gp(),r=tn(),s=Sf();async function a(c,u){return o(c,u)}async function o(c,u){const{block:d,chain:l=c.chain,request:f,type:b="eip1559"}=u||{},T=await(async()=>typeof l?.fees?.baseFeeMultiplier=="function"?l.fees.baseFeeMultiplier({block:d,client:c,request:f}):l?.fees?.baseFeeMultiplier??1.2)();if(T<1)throw new e.BaseFeeScalarError;const p=10**(T.toString().split(".")[1]?.length??0),O=j=>j*BigInt(Math.ceil(T*p))/BigInt(p),I=d||await(0,t.getAction)(c,r.getBlock,"getBlock")({});if(typeof l?.fees?.estimateFeesPerGas=="function"){const j=await l.fees.estimateFeesPerGas({block:d,client:c,multiply:O,request:f,type:b});if(j!==null)return j}if(b==="eip1559"){if(typeof I.baseFeePerGas!="bigint")throw new e.Eip1559FeesNotSupportedError;const j=typeof f?.maxPriorityFeePerGas=="bigint"?f.maxPriorityFeePerGas:await(0,n.internal_estimateMaxPriorityFeePerGas)(c,{block:I,chain:l,request:f}),i=O(I.baseFeePerGas);return{maxFeePerGas:f?.maxFeePerGas??i+j,maxPriorityFeePerGas:j}}return{gasPrice:f?.gasPrice??O(await(0,t.getAction)(c,s.getGasPrice,"getGasPrice")({}))}}return ho}var ys={},Wb;function Yu(){if(Wb)return ys;Wb=1,Object.defineProperty(ys,"__esModule",{value:!0}),ys.getTransactionCount=n;const e=Ne(),t=ie();async function n(r,{address:s,blockTag:a="latest",blockNumber:o}){const c=await r.request({method:"eth_getTransactionCount",params:[s,typeof o=="bigint"?(0,t.numberToHex)(o):a]},{dedupe:!!o});return(0,e.hexToNumber)(c)}return ys}var gs={},Kb;function Ju(){if(Kb)return gs;Kb=1,Object.defineProperty(gs,"__esModule",{value:!0}),gs.blobsToCommitments=n;const e=Pe(),t=ie();function n(r){const{kzg:s}
40=r,a=r.to??(typeof r.blobs[0]=="string"?"hex":"bytes"),o=typeof r.blobs[0]=="string"?r.blobs.map(u=>(0,e.hexToBytes)(u)):r.blobs,c=[];for(const u of o)c.push(Uint8Array.from(s.blobToKzgCommitment(u)));return a==="bytes"?c:c.map(u=>(0,t.bytesToHex)(u))}return gs}var ps={},Zb;function Xu(){if(Zb)return ps;Zb=1,Object.defineProperty(ps,"__esModule",{value:!0}),ps.blobsToProofs=n;const e=Pe(),t=ie();function n(r){const{kzg:s}=r,a=r.to??(typeof r.blobs[0]=="string"?"hex":"bytes"),o=typeof r.blobs[0]=="string"?r.blobs.map(d=>(0,e.hexToBytes)(d)):r.blobs,c=typeof r.commitments[0]=="string"?r.commitments.map(d=>(0,e.hexToBytes)(d)):r.commitments,u=[];for(let d=0;d<o.length;d++){const l=o[d],f=c[d];u.push(Uint8Array.from(s.computeBlobKzgProof(l,f)))}return a==="bytes"?u:u.map(d=>(0,t.bytesToHex)(d))}return ps}var _s={},vs={},Es={},Et={},Yb;function I6(){if(Yb)return Et;Yb=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.sha224=Et.SHA224=Et.sha256=Et.SHA256=void 0;const e=Fp();return Et.SHA256=e.SHA256,Et.sha256=e.sha256,Et.SHA224=e.SHA224,Et.sha224=e.sha224,Et}var Jb;function If(){if(Jb)return Es;Jb=1,Object.defineProperty(Es,"__esModule",{value:!0}),Es.sha256=s;const e=I6(),t=nt(),n=Pe(),r=ie();function s(a,o){const c=o||"hex",u=(0,e.sha256)((0,t.isHex)(a,{strict:!1})?(0,n.toBytes)(a):a);return c==="bytes"?u:(0,r.toHex)(u)}return Es}var Xb;function Bf(){if(Xb)return vs;Xb=1,Object.defineProperty(vs,"__esModule",{value:!0}),vs.commitmentToVersionedHash=n;const e=ie(),t=If();function n(r){const{commitment:s,version:a=1}=r,o=r.to??(typeof s=="string"?"hex":"bytes"),c=(0,t.sha256)(s,"bytes");return c.set([a],0),o==="bytes"?c:(0,e.bytesToHex)(c)}return vs}var Qb;function xf(){if(Qb)return _s;Qb=1,Object.defineProperty(_s,"__esModule",{value:!0}),_s.commitmentsToVersionedHashes=t;const e=Bf();function t(n){const{commitments:r,version:s}=n,a=n.to??(typeof r[0]=="string"?"hex":"bytes"),o=[];for(const c of r)o.push((0,e.commitmentToVersionedHash)({commitment:c,to:a,version:s}));return o}return _s}var ws={},js={},Wd={},$b;function B6(){return $b||($b=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.maxBytesPerTransaction=e.bytesPerBlob=e.fieldElementsPerBlob=e.bytesPerFieldElement=void 0;const t=6;e.bytesPerFieldElement=32,e.fieldElementsPerBlob=4096,e.bytesPerBlob=e.bytesPerFieldElement*e.fieldElementsPerBlob,e.maxBytesPerTransaction=e.bytesPerBlob*t-1-1*e.fieldElementsPerBlob*t})(Wd)),Wd}var wt={},po={},em;function Wp(){return em||(em=1,Object.defineProperty(po,"__esModule",{value:!0}),po.versionedHashVersionKzg=void 0,po.versionedHashVersionKzg=1),po}var tm;function Kp(){if(tm)return wt;tm=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.InvalidVersionedHashVersionError=wt.InvalidVersionedHashSizeError=wt.EmptyBlobError=wt.BlobSizeTooLargeError=void 0;const e=Wp(),t=fe();class n extends t.BaseError{constructor({maxSize:c,size:u}){super("Blob size is too large.",{metaMessages:[`Max: ${c} bytes`,`Given: ${u} bytes`],name:"BlobSizeTooLargeError"})}}wt.BlobSizeTooLargeError=n;class r extends t.BaseError{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}wt.EmptyBlobError=r;class s extends t.BaseError{constructor({hash:c,size:u}){super(`Versioned hash "${c}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${u}`],name:"InvalidVersionedHashSizeError"})}}wt.InvalidVersionedHashSizeError=s;class a extends t.BaseError{constructor({hash:c,version:u}){super(`Versioned hash "${c}" version is invalid.`,{metaMessages:[`Expected: ${e.versionedHashVersionKzg}`,`Received: ${u}`],name:"InvalidVersionedHashVersionError"})}}return wt.InvalidVersionedHashVersionError=a,wt}var rm;function Zp(){if(rm)return js;rm=1,Object.defineProperty(js,"__esModule",{value:!0}),js.toBlobs=o;const e=B6(),t=Kp(),n=Ko(),r=at(),s=Pe(),a=ie();
40function o(c){const u=c.to??(typeof c.data=="string"?"hex":"bytes"),d=typeof c.data=="string"?(0,s.hexToBytes)(c.data):c.data,l=(0,r.size)(d);if(!l)throw new t.EmptyBlobError;if(l>e.maxBytesPerTransaction)throw new t.BlobSizeTooLargeError({maxSize:e.maxBytesPerTransaction,size:l});const f=[];let b=!0,T=0;for(;b;){const v=(0,n.createCursor)(new Uint8Array(e.bytesPerBlob));let p=0;for(;p<e.fieldElementsPerBlob;){const O=d.slice(T,T+(e.bytesPerFieldElement-1));if(v.pushByte(0),v.pushBytes(O),O.length<31){v.pushByte(128),b=!1;break}p++,T+=31}f.push(v)}return u==="bytes"?f.map(v=>v.bytes):f.map(v=>(0,a.bytesToHex)(v.bytes))}return js}var nm;function Qu(){if(nm)return ws;nm=1,Object.defineProperty(ws,"__esModule",{value:!0}),ws.toBlobSidecars=r;const e=Ju(),t=Xu(),n=Zp();function r(s){const{data:a,kzg:o,to:c}=s,u=s.blobs??(0,n.toBlobs)({data:a,to:c}),d=s.commitments??(0,e.blobsToCommitments)({blobs:u,kzg:o,to:c}),l=s.proofs??(0,t.blobsToProofs)({blobs:u,commitments:d,kzg:o,to:c}),f=[];for(let b=0;b<u.length;b++)f.push({blob:u[b],commitment:d[b],proof:l[b]});return f}return ws}var Ps={},om;function $u(){if(om)return Ps;om=1,Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.getTransactionType=t;const e=dt();function t(n){if(n.type)return n.type;if(typeof n.authorizationList<"u")return"eip7702";if(typeof n.blobs<"u"||typeof n.blobVersionedHashes<"u"||typeof n.maxFeePerBlobGas<"u"||typeof n.sidecars<"u")return"eip4844";if(typeof n.maxFeePerGas<"u"||typeof n.maxPriorityFeePerGas<"u")return"eip1559";if(typeof n.gasPrice<"u")return typeof n.accessList<"u"?"eip2930":"legacy";throw new e.InvalidSerializableTransactionError({transaction:n})}return Ps}var As={},Ts={},im;function ni(){if(im)return Ts;im=1,Object.defineProperty(Ts,"__esModule",{value:!0}),Ts.getTransactionError=r;const e=rr(),t=dt(),n=ei();function r(s,{docsPath:a,...o}){const c=(()=>{const u=(0,n.getNodeError)(s,o);return u instanceof e.UnknownNodeError?s:u})();return new t.TransactionExecutionError(c,{docsPath:a,...o})}return Ts}var Ss={},sm;function jr(){if(sm)return Ss;sm=1,Object.defineProperty(Ss,"__esModule",{value:!0}),Ss.getChainId=t;const e=Ne();async function t(n){const r=await n.request({method:"eth_chainId"},{dedupe:!0});return(0,e.hexToNumber)(r)}return Ss}var am;function Rf(){if(am)return As;am=1,Object.defineProperty(As,"__esModule",{value:!0}),As.fillTransaction=l;const e=He(),t=ri(),n=ni(),r=wr(),s=Rn(),a=xt(),o=ge(),c=Rt(),u=tn(),d=jr();async function l(f,b){const{account:T=f.account,accessList:v,authorizationList:p,chain:O=f.chain,blobVersionedHashes:I,blobs:h,data:j,gas:i,gasPrice:g,maxFeePerBlobGas:_,maxFeePerGas:E,maxPriorityFeePerGas:R,nonce:w,nonceManager:y,to:x,type:C,value:B,...H}=b,F=await(async()=>{if(!T||!y||typeof w<"u")return w;const A=(0,e.parseAccount)(T),P=O?O.id:await(0,o.getAction)(f,d.getChainId,"getChainId")({});return await y.consume({address:A.address,chainId:P,client:f})})();(0,c.assertRequest)(b);const k=O?.formatters?.transactionRequest?.format,M=(k||a.formatTransactionRequest)({...(0,r.extract)(H,{format:k}),account:T?(0,e.parseAccount)(T):void 0,accessList:v,authorizationList:p,blobs:h,blobVersionedHashes:I,data:j,gas:i,gasPrice:g,maxFeePerBlobGas:_,maxFeePerGas:E,maxPriorityFeePerGas:R,nonce:F,to:x,type:C,value:B},"fillTransaction");try{const A=await f.request({method:"eth_fillTransaction",params:[M]}),S=(O?.formatters?.transaction?.format||s.formatTransaction)(A.tx);delete S.blockHash,delete S.blockNumber,delete S.r,delete S.s,delete S.transactionIndex,delete S.v,delete S.yParity,S.data=S.input,S.gas&&(S.gas=b.gas??S.gas),S.gasPrice&&(S.gasPrice=b.gasPrice??S.gasPrice),S.maxFeePerBlobGas&&(S.maxFeePerBlobGas=b.maxFeePerBlobGas??S.maxFeePerBlobGas),S.maxFeePerGas&&(S.maxFeePerGas=b.maxFeePerGas??S.maxFeePerGas),S.maxPriorityFeePerGas&&(S.maxPriorityFeePerGas=b.maxPriorityFeePerGas??S.maxPriorityFeePerGas),S.nonce&&(S.nonce=b.nonce??S.nonce);const q=await(async()=>{if(typeof O?.fees?.baseFeeMultiplier=="function"){const z=await(0,o.getAction)(f,u.getBlock,"getBlock")({});return O.fees.baseFeeMultiplier({block:z,client:f,request:b})}return O?.fees?.baseFeeMultiplier??1.2})();if(q<1)throw new t.BaseFeeScalarError;
40const U=10**(q.toString().split(".")[1]?.length??0),L=z=>z*BigInt(Math.ceil(q*U))/BigInt(U);return S.maxFeePerGas&&!b.maxFeePerGas&&(S.maxFeePerGas=L(S.maxFeePerGas)),S.gasPrice&&!b.gasPrice&&(S.gasPrice=L(S.gasPrice)),{raw:A.raw,transaction:{from:M.from,...S}}}catch(A){throw(0,n.getTransactionError)(A,{...b,chain:f.chain})}}return As}var cm;function oi(){return cm||(cm=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.supportsFillTransaction=e.eip1559NetworkCache=e.defaultParameters=void 0,e.prepareTransactionRequest=I;const t=He(),n=Vp(),r=Of(),s=tn(),a=Yu(),o=ri(),c=Ju(),u=Xu(),d=xf(),l=Qu(),f=ge(),b=Xr(),T=Rt(),v=$u(),p=Rf(),O=jr();e.defaultParameters=["blobVersionedHashes","chainId","fees","gas","nonce","type"],e.eip1559NetworkCache=new Map,e.supportsFillTransaction=new b.LruMap(128);async function I(h,j){let i=j;i.account??=h.account,i.parameters??=e.defaultParameters;const{account:g,chain:_=h.chain,nonceManager:E,parameters:R}=i,w=(()=>{if(typeof _?.prepareTransactionRequest=="function")return{fn:_.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(_?.prepareTransactionRequest))return{fn:_.prepareTransactionRequest[0],runAt:_.prepareTransactionRequest[1].runAt}})();let y;async function x(){return y||(typeof i.chainId<"u"?i.chainId:_?_.id:(y=await(0,f.getAction)(h,O.getChainId,"getChainId")({}),y))}const C=g&&(0,t.parseAccount)(g);let B=i.nonce;if(R.includes("nonce")&&typeof B>"u"&&C&&E){const q=await x();B=await E.consume({address:C.address,chainId:q,client:h})}w?.fn&&w.runAt?.includes("beforeFillTransaction")&&(i=await w.fn({...i,chain:_},{phase:"beforeFillTransaction"}),B??=i.nonce);const F=((R.includes("blobVersionedHashes")||R.includes("sidecars"))&&i.kzg&&i.blobs||e.supportsFillTransaction.get(h.uid)===!1||!["fees","gas"].some(N=>R.includes(N))?!1:!!(R.includes("chainId")&&typeof i.chainId!="number"||R.includes("nonce")&&typeof B!="number"||R.includes("fees")&&typeof i.gasPrice!="bigint"&&(typeof i.maxFeePerGas!="bigint"||typeof i.maxPriorityFeePerGas!="bigint")||R.includes("gas")&&typeof i.gas!="bigint"))?await(0,f.getAction)(h,p.fillTransaction,"fillTransaction")({...i,nonce:B}).then(q=>{const{chainId:N,from:U,gas:L,gasPrice:z,nonce:D,maxFeePerBlobGas:X,maxFeePerGas:W,maxPriorityFeePerGas:Z,type:J,...oe}=q.transaction;return e.supportsFillTransaction.set(h.uid,!0),{...i,...U?{from:U}:{},...J?{type:J}:{},...typeof N<"u"?{chainId:N}:{},...typeof L<"u"?{gas:L}:{},...typeof z<"u"?{gasPrice:z}:{},...typeof D<"u"?{nonce:D}:{},...typeof X<"u"?{maxFeePerBlobGas:X}:{},...typeof W<"u"?{maxFeePerGas:W}:{},...typeof Z<"u"?{maxPriorityFeePerGas:Z}:{},..."nonceKey"in oe&&typeof oe.nonceKey<"u"?{nonceKey:oe.nonceKey}:{}}}).catch(q=>{const N=q;return N.name!=="TransactionExecutionError"||N.walk?.(L=>{const z=L;return z.name==="MethodNotFoundRpcError"||z.name==="MethodNotSupportedRpcError"})&&e.supportsFillTransaction.set(h.uid,!1),i}):i;B??=F.nonce,i={...F,...C?{from:C?.address}:{},...B?{nonce:B}:{}};const{blobs:k,gas:m,kzg:M,type:A}=i;w?.fn&&w.runAt?.includes("beforeFillParameters")&&(i=await w.fn({...i,chain:_},{phase:"beforeFillParameters"}));let P;async function S(){return P||(P=await(0,f.getAction)(h,s.getBlock,"getBlock")({blockTag:"latest"}),P)}if(R.includes("nonce")&&typeof B>"u"&&C&&!E&&(i.nonce=await(0,f.getAction)(h,a.getTransactionCount,"getTransactionCount")({address:C.address,blockTag:"pending"})),(R.includes("blobVersionedHashes")||R.includes("sidecars"))&&k&&M){const q=(0,c.blobsToCommitments)({blobs:k,kzg:M});if(R.includes("blobVersionedHashes")){const N=(0,d.commitmentsToVersionedHashes)({commitments:q,to:"hex"});i.blobVersionedHashes=N}if(R.includes("sidecars")){const N=(0,u.blobsToProofs)({blobs:k,commitments:q,kzg:M}),U=(0,l.toBlobSidecars)({blobs:k,commitments:q,proofs:N,to:"hex"});i.sidecars=U}}if(R.includes("chainId")&&(i.chainId=await x()),(R.includes("fees")||R.includes("type"))&&typeof A>"u")try{i.type=(0,v.getTransactionType)(i)}catch{let q=e.eip1559NetworkCache.get(h.uid);typeof q>"u"&&(q=typeof(await S())?.baseFeePerGas=="bigint",e.eip1559NetworkCache.set(h.uid,q)),i.type=q?"eip1559":"legacy"}if(R.includes("fees"))if(i.type!=="legacy"&&i.type!=="eip2930"){if(typeof i.maxFeePerGas>"u"||typeof i.maxPriorityFeePerGas>"u"){const q=await S(),{maxFeePerGas:N,maxPriorityFeePerGas:U}=await(0,n.internal_estimateFeesPerGas)(h,{block:q,chain:_,request:i});if(typeof i.maxPriorityFeePerGas>"u"&&i.maxFeePerGas&&i.maxFeePerGas<U)throw new o.MaxFeePerGasTooLowError({maxPriorityFeePerGas:U});i.maxPriorityFeePerGas=U,i.maxFeePerGas=N}}else{if(typeof i.maxFeePerGas<"u"||typeof i.maxPriorityFeePerGas<"u")throw new o.Eip1559FeesNotSupportedError;if(typeof i.gasPrice>"u"){const q=await S(),{gasPrice:N}=await(0,n.internal_estimateFeesPerGas)(h,{block:q,chain:_,request:i,type:"legacy"});i.gasPrice=N}}return R.includes("gas")&&typeof m>"u"&&(i.gas=await(0,f.getAction)(h,r.estimateGas,"estimateGas")({...i,account:C,prepare:C?.type==="local"?[]:["blobVersionedHashes"]})),w?.fn&&w.runAt?.includes("afterFillParameters")&&(i=await w.fn({...i,chain:_},{phase:"afterFillParameters"})),(0,T.assertRequest)(i),delete i.parameters,i}})(Gd)),Gd}var um;function Of(){if(um)return os;um=1,Object.defineProperty(os,"__esModule",{value:!0}),os.estimateGas=l;const e=He(),t=fe(),n=$o(),r=ie(),s=Dp(),a=wr(),o=xt(),c=Pf(),u=Rt(),d=oi();async function l(f,b){const{account:T=f.account,prepare:v=!0}=b,p=T?(0,e.parseAccount)(T):void 0,O=(()=>
40{if(Array.isArray(v))return v;if(p?.type!=="local")return["blobVersionedHashes"]})();try{const I=await(async()=>{if(b.to)return b.to;if(b.authorizationList&&b.authorizationList.length>0)return await(0,n.recoverAuthorizationAddress)({authorization:b.authorizationList[0]}).catch(()=>{throw new t.BaseError("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:h,authorizationList:j,blobs:i,blobVersionedHashes:g,blockNumber:_,blockTag:E,data:R,gas:w,gasPrice:y,maxFeePerBlobGas:x,maxFeePerGas:C,maxPriorityFeePerGas:B,nonce:H,value:F,stateOverride:k,...m}=v?await(0,d.prepareTransactionRequest)(f,{...b,parameters:O,to:I}):b;if(w&&b.gas!==w)return w;const A=(typeof _=="bigint"?(0,r.numberToHex)(_):void 0)||E,P=(0,c.serializeStateOverride)(k);(0,u.assertRequest)(b);const S=f.chain?.formatters?.transactionRequest?.format,N=(S||o.formatTransactionRequest)({...(0,a.extract)(m,{format:S}),account:p,accessList:h,authorizationList:j,blobs:i,blobVersionedHashes:g,data:R,gasPrice:y,maxFeePerBlobGas:x,maxFeePerGas:C,maxPriorityFeePerGas:B,nonce:H,to:I,value:F},"estimateGas");return BigInt(await f.request({method:"eth_estimateGas",params:P?[N,A??f.experimental_blockTag??"latest",P]:A?[N,A]:[N]}))}catch(I){throw(0,s.getEstimateGasError)(I,{...b,account:p,chain:f.chain})}}return os}var dm;function Yp(){if(dm)return Wi;dm=1,Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.estimateContractGas=a;const e=He(),t=ot(),n=vr(),r=ge(),s=Of();async function a(o,c){const{abi:u,address:d,args:l,functionName:f,dataSuffix:b=typeof o.dataSuffix=="string"?o.dataSuffix:o.dataSuffix?.value,...T}=c,v=(0,t.encodeFunctionData)({abi:u,args:l,functionName:f});try{return await(0,r.getAction)(o,s.estimateGas,"estimateGas")({data:`${v}${b?b.replace("0x",""):""}`,to:d,...T})}catch(p){const O=T.account?(0,e.parseAccount)(T.account):void 0;throw(0,n.getContractError)(p,{abi:u,address:d,args:l,docsPath:"/docs/contract/estimateContractGas",functionName:f,sender:O?.address})}}return Wi}var Is={},Bs={},xs={},Rs={},fm;function Ot(){if(fm)return Rs;fm=1,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.isAddressEqual=n;const e=St(),t=ut();function n(r,s){if(!(0,t.isAddress)(r,{strict:!1}))throw new e.InvalidAddressError({address:r});if(!(0,t.isAddress)(s,{strict:!1}))throw new e.InvalidAddressError({address:s});return r.toLowerCase()===s.toLowerCase()}return Rs}var Os={},lm;function ii(){if(lm)return Os;lm=1,Object.defineProperty(Os,"__esModule",{value:!0}),Os.decodeEventLog=c;const e=qe(),t=Hp(),n=at(),r=xn(),s=gr(),a=$t(),o="/docs/contract/decodeEventLog";function c(d){const{abi:l,data:f,strict:b,topics:T}=d,v=b??!0,[p,...O]=T;if(!p)throw new e.AbiEventSignatureEmptyTopicsError({docsPath:o});const I=l.find(y=>y.type==="event"&&p===(0,r.toEventSelector)((0,a.formatAbiItem)(y)));if(!(I&&"name"in I)||I.type!=="event")throw new e.AbiEventSignatureNotFoundError(p,{docsPath:o});const{name:h,inputs:j}=I,i=j?.some(y=>!("name"in y&&y.name)),g=i?[]:{},_=j.map((y,x)=>[y,x]).filter(([y])=>"indexed"in y&&y.indexed),E=[];for(let y=0;y<_.length;y++){const[x,C]=_[y],B=O[y];if(!B){if(v)throw new e.DecodeLogTopicsMismatch({abiItem:I,param:x});E.push([x,C]);continue}g[i?C:x.name||C]=u({param:x,value:B})}const R=j.filter(y=>!("indexed"in y&&y.indexed)),w=v?R:[...E.map(([y])=>y),...R];if(w.length>0){if(f&&f!=="0x")try{const y=(0,s.decodeAbiParameters)(w,f);if(y){let x=0;if(!v)for(const[C,B]of E)g[i?B:C.name||B]=y[x++];if(i)for(let C=0;C<j.length;C++)g[C]===void 0&&x<y.length&&(g[C]=y[x++]);else for(let C=0;C<R.length;C++)g[R[C].name]=y[x++]}}catch(y){if(v)throw y instanceof e.AbiDecodingDataSizeTooSmallError||y instanceof t.PositionOutOfBoundsError?new e.DecodeLogDataMismatch({abiItem:I,data:f,params:w,size:(0,n.size)(f)}):y}else if(v)throw new e.DecodeLogDataMismatch({abiItem:I,data:"0x",params:w,size:0})}return{eventName:h,args:Object.values(g).length>0?g:void 0}}function u({param:d,value:l}){return d.type==="string"||d.type==="bytes"||d.type==="tuple"||d.type.match(/^(.*)\[(\d+)?\]$/)?l:((0,s.decodeAbiParameters)([d],l)||[])[0]}return Os}var bm;function si(){if(bm)return xs;bm=1,Object.defineProperty(xs,"__esModule",{value:!0}),xs.parseEventLogs=a;const e=Ot(),t=Pe(),n=ct(),r=xn(),s=ii();function a(c){const{abi:u,args:d,logs:l,strict:f=!0}=c,b=(()=>
40{if(c.eventName)return Array.isArray(c.eventName)?c.eventName:[c.eventName]})(),T=u.filter(v=>v.type==="event").map(v=>({abi:v,selector:(0,r.toEventSelector)(v)}));return l.map(v=>{const p=T.filter(h=>v.topics[0]===h.selector);if(p.length===0)return null;let O,I;for(const h of p)try{O=(0,s.decodeEventLog)({...v,abi:[h.abi],strict:!0}),I=h;break}catch{}if(!O&&!f){I=p[0];try{O=(0,s.decodeEventLog)({data:v.data,topics:v.topics,abi:[I.abi],strict:!1})}catch{const h=I.abi.inputs?.some(j=>!("name"in j&&j.name));return{...v,args:h?[]:{},eventName:I.abi.name}}}return!O||!I||b&&!b.includes(O.eventName)||!o({args:O.args,inputs:I.abi.inputs,matchArgs:d})?null:{...O,...v}}).filter(Boolean)}function o(c){const{args:u,inputs:d,matchArgs:l}=c;if(!l)return!0;if(!u)return!1;function f(b,T,v){try{return b.type==="address"?(0,e.isAddressEqual)(T,v):b.type==="string"||b.type==="bytes"?(0,n.keccak256)((0,t.toBytes)(T))===v:T===v}catch{return!1}}return Array.isArray(u)&&Array.isArray(l)?l.every((b,T)=>{if(b==null)return!0;const v=d[T];return v?(Array.isArray(b)?b:[b]).some(O=>f(v,O,u[T])):!1}):typeof u=="object"&&!Array.isArray(u)&&typeof l=="object"&&!Array.isArray(l)?Object.entries(l).every(([b,T])=>{if(T==null)return!0;const v=d.find(O=>O.name===b);return v?(Array.isArray(T)?T:[T]).some(O=>f(v,O,u[b])):!1}):!1}return xs}var Cs={},mm;function nr(){if(mm)return Cs;mm=1,Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.formatLog=e;function e(t,{args:n,eventName:r}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,blockTimestamp:t.blockTimestamp?BigInt(t.blockTimestamp):t.blockTimestamp===null?null:void 0,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...r?{args:n,eventName:r}:{}}}return Cs}var hm;function Cf(){if(hm)return Bs;hm=1,Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.getLogs=s;const e=$r(),t=si(),n=ie(),r=nr();async function s(a,{address:o,blockHash:c,fromBlock:u,toBlock:d,event:l,events:f,args:b,strict:T}={}){const v=T??!1,p=f??(l?[l]:void 0);let O=[];p&&(O=[p.flatMap(i=>(0,e.encodeEventTopics)({abi:[i],eventName:i.name,args:f?void 0:b}))],l&&(O=O[0]));let I;c?I=await a.request({method:"eth_getLogs",params:[{address:o,topics:O,blockHash:c}]}):I=await a.request({method:"eth_getLogs",params:[{address:o,topics:O,fromBlock:typeof u=="bigint"?(0,n.numberToHex)(u):u,toBlock:typeof d=="bigint"?(0,n.numberToHex)(d):d}]});const h=I.map(j=>(0,r.formatLog)(j));return p?(0,t.parseEventLogs)({abi:p,args:b,logs:h,strict:v}):h}return Bs}var ym;function qf(){if(ym)return Is;ym=1,Object.defineProperty(Is,"__esModule",{value:!0}),Is.getContractEvents=r;const e=tr(),t=ge(),n=Cf();async function r(s,a){const{abi:o,address:c,args:u,blockHash:d,eventName:l,fromBlock:f,toBlock:b,strict:T}=a,v=l?(0,e.getAbiItem)({abi:o,name:l}):void 0,p=v?void 0:o.filter(O=>O.type==="event");return(0,t.getAction)(s,n.getLogs,"getLogs")({address:c,args:u,blockHash:d,event:v,events:p,fromBlock:f,toBlock:b,strict:T})}return Is}var qs={},Hs={},gm;function Mt(){if(gm)return Hs;gm=1,Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.decodeFunctionResult=s;const e=qe(),t=gr(),n=tr(),r="/docs/contract/decodeFunctionResult";function s(a){const{abi:o,args:c,functionName:u,data:d}=a;let l=o[0];if(u){const b=(0,n.getAbiItem)({abi:o,args:c,name:u});if(!b)throw new e.AbiFunctionNotFoundError(u,{docsPath:r});l=b}if(l.type!=="function")throw new e.AbiFunctionNotFoundError(void 0,{docsPath:r});if(!l.outputs)throw new e.AbiFunctionOutputsNotFoundError(l.name,{docsPath:r});const f=(0,t.decodeAbiParameters)(l.outputs,d);if(f&&f.length>1)return f;if(f&&f.length===1)return f[0]}return Hs}var _o={},vo={},le={},_e={},pm;function rn(){if(pm)return _e;pm=1;
vendor: 4,076 bytes, line 40
40Object.defineProperty(_e,"__esModule",{value:!0}),_e.notImplemented=_e.bitMask=void 0,_e.isBytes=n,_e.abytes=r,_e.abool=s,_e.numberToHexUnpadded=a,_e.hexToNumber=o,_e.bytesToHex=d,_e.hexToBytes=b,_e.bytesToNumberBE=T,_e.bytesToNumberLE=v,_e.numberToBytesBE=p,_e.numberToBytesLE=O,_e.numberToVarBytesBE=I,_e.ensureBytes=h,_e.concatBytes=j,_e.equalBytes=i,_e.utf8ToBytes=g,_e.inRange=E,_e.aInRange=R,_e.bitLen=w,_e.bitGet=y,_e.bitSet=x,_e.createHmacDrbg=F,_e.validateObject=m,_e.memoized=A;const e=BigInt(0),t=BigInt(1);function n(P){return P instanceof Uint8Array||ArrayBuffer.isView(P)&&P.constructor.name==="Uint8Array"}function r(P){if(!n(P))throw new Error("Uint8Array expected")}function s(P,S){if(typeof S!="boolean")throw new Error(P+" boolean expected, got "+S)}function a(P){const S=P.toString(16);return S.length&1?"0"+S:S}function o(P){if(typeof P!="string")throw new Error("hex string expected, got "+typeof P);return P===""?e:BigInt("0x"+P)}const c=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",u=Array.from({length:256},(P,S)=>S.toString(16).padStart(2,"0"));function d(P){if(r(P),c)return P.toHex();let S="";for(let q=0;q<P.length;q++)S+=u[P[q]];return S}const l={_0:48,_9:57,A:65,F:70,a:97,f:102};function f(P){if(P>=l._0&&P<=l._9)return P-l._0;if(P>=l.A&&P<=l.F)return P-(l.A-10);if(P>=l.a&&P<=l.f)return P-(l.a-10)}function b(P){if(typeof P!="string")throw new Error("hex string expected, got "+typeof P);if(c)return Uint8Array.fromHex(P);const S=P.length,q=S/2;if(S%2)throw new Error("hex string expected, got unpadded hex of length "+S);const N=new Uint8Array(q);for(let U=0,L=0;U<q;U++,L+=2){const z=f(P.charCodeAt(L)),D=f(P.charCodeAt(L+1));if(z===void 0||D===void 0){const X=P[L]+P[L+1];throw new Error('hex string expected, got non-hex character "'+X+'" at index '+L)}N[U]=z*16+D}return N}function T(P){return o(d(P))}function v(P){return r(P),o(d(Uint8Array.from(P).reverse()))}function p(P,S){return b(P.toString(16).padStart(S*2,"0"))}function O(P,S){return p(P,S).reverse()}function I(P){return b(a(P))}function h(P,S,q){let N;if(typeof S=="string")try{N=b(S)}catch(L){throw new Error(P+" must be hex string or Uint8Array, cause: "+L)}else if(n(S))N=Uint8Array.from(S);else throw new Error(P+" must be hex string or Uint8Array");const U=N.length;if(typeof q=="number"&&U!==q)throw new Error(P+" of length "+q+" expected, got "+U);return N}function j(...P){let S=0;for(let N=0;N<P.length;N++){const U=P[N];r(U),S+=U.length}const q=new Uint8Array(S);for(let N=0,U=0;N<P.length;N++){const L=P[N];q.set(L,U),U+=L.length}return q}function i(P,S){if(P.length!==S.length)return!1;let q=0;for(let N=0;N<P.length;N++)q|=P[N]^S[N];return q===0}function g(P){if(typeof P!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(P))}const _=P=>typeof P=="bigint"&&e<=P;function E(P,S,q){return _(P)&&_(S)&&_(q)&&S<=P&&P<q}function R(P,S,q,N){if(!E(S,q,N))throw new Error("expected valid "+P+": "+q+" <= n < "+N+", got "+S)}function w(P){let S;for(S=0;P>e;P>>=t,S+=1);return S}function y(P,S){return P>>BigInt(S)&t}function x(P,S,q){return P|(q?t:e)<<BigInt(S)}const C=P=>(t<<BigInt(P))-t;_e.bitMask=C;const B=P=>new Uint8Array(P),H=P=>Uint8Array.from(P);function F(P,S,q){if(typeof P!="number"||P<2)throw new Error("hashLen must be a number");if(typeof S!="number"||S<2)throw new Error("qByteLen must be a number");if(typeof q!="function")throw new Error("hmacFn must be a function");let N=B(P),U=B(P),L=0;const z=()=>{N.fill(1),U.fill(0),L=0},D=(...J)=>q(U,N,...J),X=(J=B(0))=>{U=D(H([0]),J),N=D(),J.length!==0&&(U=D(H([1]),J),N=D())},W=()=>{if(L++>=1e3)throw new Error("drbg: tried 1000 values");let J=0;const oe=[];for(;J<S;){N=D();const K=N.slice();oe.push(K),J+=N.length}return j(...oe)};return(J,oe)=>{z(),X(J);let K;for(;!(K=oe(W()));)X();return z(),K}}const k={bigint:P=>typeof P=="bigint",function:P=>typeof P=="function",boolean:P=>typeof P=="boolean",string:P=>typeof P=="string",stringOrUint8Array:P=>typeof P=="string"||n(P),isSafeInteger:P=>Number.isSafeInteger(P),array:P=>
40Array.isArray(P),field:(P,S)=>S.Fp.isValid(P),hash:P=>typeof P=="function"&&Number.isSafeInteger(P.outputLen)};function m(P,S,q={}){const N=(U,L,z)=>{const D=k[L];if(typeof D!="function")throw new Error("invalid validator function");const X=P[U];if(!(z&&X===void 0)&&!D(X,P))throw new Error("param "+String(U)+" is invalid. Expected "+L+", got "+X)};for(const[U,L]of Object.entries(S))N(U,L,!1);for(const[U,L]of Object.entries(q))N(U,L,!0);return P}const M=()=>{throw new Error("not implemented")};_e.notImplemented=M;function A(P){const S=new WeakMap;return(q,...N)=>{const U=S.get(q);if(U!==void 0)return U;const L=P(q,...N);return S.set(q,L),L}}return _e}var he={},Eo={},gn={},wo={},_m;function x6(){return _m||(_m=1,Object.defineProperty(wo,"__esModule",{value:!0}),wo.version=void 0,wo.version="0.1.1"),wo}var vm;function R6(){if(vm)return gn;vm=1,Object.defineProperty(gn,"__esModule",{value:!0}),gn.getUrl=t,gn.getVersion=n,gn.prettyPrint=r;const e=x6();function t(s){return s}function n(){return e.version}function r(s){if(!s)return"";const a=Object.entries(s).map(([c,u])=>u===void 0||u===!1?null:[c,u]).filter(Boolean),o=a.reduce((c,[u])=>Math.max(c,u.length),0);return a.map(([c,u])=>`  ${`${c}:`.padEnd(o+1)}  ${u}`).join(`
41`)}return gn}var Em;function gt(){if(Em)return Eo;Em=1,Object.defineProperty(Eo,"__esModule",{value:!0}),Eo.BaseError=void 0;const e=R6();class t extends Error{static setStaticOptions(s){t.prototype.docsOrigin=s.docsOrigin,t.prototype.showVersion=s.showVersion,t.prototype.version=s.version}constructor(s,a={}){const o=(()=>{if(a.cause instanceof t){if(a.cause.details)return a.cause.details;if(a.cause.shortMessage)return a.cause.shortMessage}return a.cause&&"details"in a.cause&&typeof a.cause.details=="string"?a.cause.details:a.cause?.message?a.cause.message:a.details})(),c=a.cause instanceof t&&a.cause.docsPath||a.docsPath,u=a.docsOrigin??t.prototype.docsOrigin,d=`${u}${c??""}`,l=!!(a.version??t.prototype.showVersion),f=a.version??t.prototype.version,b=[s||"An error occurred.",...a.metaMessages?["",...a.metaMessages]:[],...o||c||l?["",o?`Details: ${o}`:void 0,c?`See: ${d}`:void 0,l?`Version: ${f}`:void 0]:[]].filter(T=>typeof T=="string").join(`
42`);super(b,a.cause?{cause:a.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=a.cause,this.details=o,this.docs=d,this.docsOrigin=u,this.docsPath=c,this.shortMessage=s,this.showVersion=l,this.version=f}walk(s){return n(this,s)}}Eo.BaseError=t,Object.defineProperty(t,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${(0,e.getVersion)()}`}}),t.setStaticOptions(t.defaultStaticOptions);function n(r,s){return s?.(r)?r:r&&typeof r=="object"&&"cause"in r&&r.cause?n(r.cause,s):s?null:r}return Eo}var Kd={},wm;function Jp(){return wm||(wm=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.charCodeMap=void 0,e.assertSize=n,e.assertStartOffset=r,e.assertEndOffset=s,e.charCodeToBase16=a,e.pad=o,e.trim=c;const t=kt();function n(u,d){if(t.size(u)>d)throw new t.SizeOverflowError({givenSize:t.size(u),maxSize:d})}function r(u,d){if(typeof d=="number"&&d>0&&d>t.size(u)-1)throw new t.SliceOffsetOutOfBoundsError({offset:d,position:"start",size:t.size(u)})}function s(u,d,l){if(typeof d=="number"&&typeof l=="number"&&t.size(u)!==l-d)throw new t.SliceOffsetOutOfBoundsError({offset:l,position:"end",size:t.size(u)})}e.charCodeMap={zero:48,nine:57,A:65,F:70,a:97,f:102};function a(u){if(u>=e.charCodeMap.zero&&u<=e.charCodeMap.nine)return u-e.charCodeMap.zero;if(u>=e.charCodeMap.A&&u<=e.charCodeMap.F)return u-(e.charCodeMap.A-10);if(u>=e.charCodeMap.a&&u<=e.charCodeMap.f)return u-(e.charCodeMap.a-10)}function o(u,d={}){const{dir:l,size:f=32}=d;if(f===0)return u;if(u.length>f)throw new t.SizeExceedsPaddingSizeError({size:u.length,targetSize:f,type:"Bytes"});const b=new Uint8Array(f);for(let T=0;T<f;T++){const v=l==="right";b[v?T:f-T-1]=u[v?T:u.length-T-1]}return b}function c(u,d={}){const{dir:l="left"}=d;let f=u,b=0;for(let T=0;T<f.length-1&&f[l==="left"?T:f.length-T-1].toString()==="0";T++)b++;return f=l==="left"?f.slice(b):f.slice(0,f.length-b),f}})(Kd)),Kd}var ur={},jm;function Xp(){if(jm)return ur;
42jm=1,Object.defineProperty(ur,"__esModule",{value:!0}),ur.assertSize=t,ur.assertStartOffset=n,ur.assertEndOffset=r,ur.pad=s,ur.trim=a;const e=We();function t(o,c){if(e.size(o)>c)throw new e.SizeOverflowError({givenSize:e.size(o),maxSize:c})}function n(o,c){if(typeof c=="number"&&c>0&&c>e.size(o)-1)throw new e.SliceOffsetOutOfBoundsError({offset:c,position:"start",size:e.size(o)})}function r(o,c,u){if(typeof c=="number"&&typeof u=="number"&&e.size(o)!==u-c)throw new e.SliceOffsetOutOfBoundsError({offset:u,position:"end",size:e.size(o)})}function s(o,c={}){const{dir:u,size:d=32}=c;if(d===0)return o;const l=o.replace("0x","");if(l.length>d*2)throw new e.SizeExceedsPaddingSizeError({size:Math.ceil(l.length/2),targetSize:d,type:"Hex"});return`0x${l[u==="right"?"padEnd":"padStart"](d*2,"0")}`}function a(o,c={}){const{dir:u="left"}=c;let d=o.replace("0x",""),l=0;for(let f=0;f<d.length-1&&d[u==="left"?f:d.length-f-1].toString()==="0";f++)l++;return d=u==="left"?d.slice(l):d.slice(0,d.length-l),d==="0"?"0x":u==="right"&&d.length%2===1?`0x${d}0`:`0x${d}`}return ur}var jo={},Pm;function ed(){if(Pm)return jo;Pm=1,Object.defineProperty(jo,"__esModule",{value:!0}),jo.parse=t,jo.stringify=n;const e="#__bigint";function t(r,s){return JSON.parse(r,(a,o)=>{const c=o;return typeof c=="string"&&c.endsWith(e)?BigInt(c.slice(0,-e.length)):typeof s=="function"?s(a,c):c})}function n(r,s,a){return JSON.stringify(r,(o,c)=>typeof s=="function"?s(o,c):typeof c=="bigint"?c.toString()+e:c,a)}return jo}var Am;function kt(){if(Am)return he;Am=1,Object.defineProperty(he,"__esModule",{value:!0}),he.SizeExceedsPaddingSizeError=he.SliceOffsetOutOfBoundsError=he.SizeOverflowError=he.InvalidBytesTypeError=he.InvalidBytesBooleanError=void 0,he.assert=u,he.concat=d,he.from=l,he.fromArray=f,he.fromBoolean=b,he.fromHex=T,he.fromNumber=v,he.fromString=p,he.isEqual=O,he.padLeft=I,he.padRight=h,he.random=j,he.size=i,he.slice=g,he.toBigInt=_,he.toBoolean=E,he.toHex=R,he.toNumber=w,he.toString=y,he.trimLeft=x,he.trimRight=C,he.validate=B;const e=rn(),t=gt(),n=We(),r=Jp(),s=Xp(),a=ed(),o=new TextDecoder,c=new TextEncoder;function u(A){if(!(A instanceof Uint8Array)){if(!A)throw new F(A);if(typeof A!="object")throw new F(A);if(!("BYTES_PER_ELEMENT"in A))throw new F(A);if(A.BYTES_PER_ELEMENT!==1||A.constructor.name!=="Uint8Array")throw new F(A)}}function d(...A){let P=0;for(const q of A)P+=q.length;const S=new Uint8Array(P);for(let q=0,N=0;q<A.length;q++){const U=A[q];S.set(U,N),N+=U.length}return S}function l(A){return A instanceof Uint8Array?A:typeof A=="string"?T(A):f(A)}function f(A){return A instanceof Uint8Array?A:new Uint8Array(A)}function b(A,P={}){const{size:S}=P,q=new Uint8Array(1);return q[0]=Number(A),typeof S=="number"?(r.assertSize(q,S),I(q,S)):q}function T(A,P={}){const{size:S}=P;let q=A;S&&(s.assertSize(A,S),q=n.padRight(A,S));let N=q.slice(2);N.length%2&&(N=`0${N}`);const U=N.length/2,L=new Uint8Array(U);for(let z=0,D=0;z<U;z++){const X=r.charCodeToBase16(N.charCodeAt(D++)),W=r.charCodeToBase16(N.charCodeAt(D++));if(X===void 0||W===void 0)throw new t.BaseError(`Invalid byte sequence ("${N[D-2]}${N[D-1]}" in "${N}").`);L[z]=X<<4|W}return L}function v(A,P){const S=n.fromNumber(A,P);return T(S)}function p(A,P={}){const{size:S}=P,q=c.encode(A);return typeof S=="number"?(r.assertSize(q,S),h(q,S)):q}function O(A,P){return(0,e.equalBytes)(A,P)}function I(A,P){return r.pad(A,{dir:"left",size:P})}function h(A,P){return r.pad(A,{dir:"right",size:P})}function j(A){return crypto.getRandomValues(new Uint8Array(A))}function i(A){return A.length}function g(A,P,S,q={}){const{strict:N}=q;r.assertStartOffset(A,P);const U=A.slice(P,S);return N&&r.assertEndOffset(U,P,S),U}function _(A,P={}){const{size:S}=P;typeof S<"u"&&r.assertSize(A,S);const q=n.fromBytes(A,P);return n.toBigInt(q,P)}function E(A,P={}){const{size:S}=P;let q=A;if(typeof S<"u"&&(r.assertSize(q,S),q=x(q)),q.length>1||q[0]>1)throw new H(q);return!!q[0]}function R(A,P={}){return n.fromBytes(A,P)}function w(A,P={}){const{size:S}=P;typeof S<"u"&&r.assertSize(A,S);const q=n.fromBytes(A,P);return n.toNumber(q,P)}function y(A,P={}){const{size:S}=P;let q=A;return typeof S<"u"&&(r.assertSize(q,S),q=C(q)),o.decode(q)}function x(A){return r.trim(A,{dir:"left"})}function C(A){return r.trim(A,{dir:"right"})}function B(A){try{return u(A),!0}catch{return!1}}class H extends t.BaseError{constructor(P){super(`Bytes value \`${P}\` is not a valid boolean.`,{metaMessages:["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:"Bytes.InvalidBytesBooleanError"})}}he.InvalidBytesBooleanError=H;class F extends t.BaseError{constructor(P){super(`Value \`${typeof P=="object"?a.stringify(P):P}\` of type \`${typeof P}
42\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}}he.InvalidBytesTypeError=F;class k extends t.BaseError{constructor({givenSize:P,maxSize:S}){super(`Size cannot exceed \`${S}\` bytes. Given size: \`${P}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}he.SizeOverflowError=k;class m extends t.BaseError{constructor({offset:P,position:S,size:q}){super(`Slice ${S==="start"?"starting":"ending"} at offset \`${P}\` is out-of-bounds (size: \`${q}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SliceOffsetOutOfBoundsError"})}}he.SliceOffsetOutOfBoundsError=m;class M extends t.BaseError{constructor({size:P,targetSize:S,type:q}){super(`${q.charAt(0).toUpperCase()}${q.slice(1).toLowerCase()} size (\`${P}\`) exceeds padding size (\`${S}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}return he.SizeExceedsPaddingSizeError=M,he}var Tm;function We(){if(Tm)return le;
42Tm=1,Object.defineProperty(le,"__esModule",{value:!0}),le.SizeExceedsPaddingSizeError=le.SliceOffsetOutOfBoundsError=le.SizeOverflowError=le.InvalidLengthError=le.InvalidHexValueError=le.InvalidHexTypeError=le.InvalidHexBooleanError=le.IntegerOutOfRangeError=void 0,le.assert=u,le.concat=d,le.from=l,le.fromBoolean=f,le.fromBytes=b,le.fromNumber=T,le.fromString=v,le.isEqual=p,le.padLeft=O,le.padRight=I,le.random=h,le.slice=j,le.size=i,le.trimLeft=g,le.trimRight=_,le.toBigInt=E,le.toBoolean=R,le.toBytes=w,le.toNumber=y,le.toString=x,le.validate=C;const e=rn(),t=kt(),n=gt(),r=Jp(),s=Xp(),a=ed(),o=new TextEncoder,c=Array.from({length:256},(S,q)=>q.toString(16).padStart(2,"0"));function u(S,q={}){const{strict:N=!1}=q;if(!S)throw new F(S);if(typeof S!="string")throw new F(S);if(N&&!/^0x[0-9a-fA-F]*$/.test(S))throw new k(S);if(!S.startsWith("0x"))throw new k(S)}function d(...S){return`0x${S.reduce((q,N)=>q+N.replace("0x",""),"")}`}function l(S){return S instanceof Uint8Array?b(S):Array.isArray(S)?b(new Uint8Array(S)):S}function f(S,q={}){const N=`0x${Number(S)}`;return typeof q.size=="number"?(s.assertSize(N,q.size),O(N,q.size)):N}function b(S,q={}){let N="";for(let L=0;L<S.length;L++)N+=c[S[L]];const U=`0x${N}`;return typeof q.size=="number"?(s.assertSize(U,q.size),I(U,q.size)):U}function T(S,q={}){const{signed:N,size:U}=q,L=BigInt(S);let z;U?N?z=(1n<<BigInt(U)*8n-1n)-1n:z=2n**(BigInt(U)*8n)-1n:typeof S=="number"&&(z=BigInt(Number.MAX_SAFE_INTEGER));const D=typeof z=="bigint"&&N?-z-1n:0;if(z&&L>z||L<D){const Z=typeof S=="bigint"?"n":"";throw new B({max:z?`${z}${Z}`:void 0,min:`${D}${Z}`,signed:N,size:U,value:`${S}${Z}`})}const W=`0x${(N&&L<0?BigInt.asUintN(U*8,BigInt(L)):L).toString(16)}`;return U?O(W,U):W}function v(S,q={}){return b(o.encode(S),q)}function p(S,q){return(0,e.equalBytes)(t.fromHex(S),t.fromHex(q))}function O(S,q){return s.pad(S,{dir:"left",size:q})}function I(S,q){return s.pad(S,{dir:"right",size:q})}function h(S){return b(t.random(S))}function j(S,q,N,U={}){const{strict:L}=U;s.assertStartOffset(S,q);const z=`0x${S.replace("0x","").slice((q??0)*2,(N??S.length)*2)}`;return L&&s.assertEndOffset(z,q,N),z}function i(S){return Math.ceil((S.length-2)/2)}function g(S){return s.trim(S,{dir:"left"})}function _(S){return s.trim(S,{dir:"right"})}function E(S,q={}){const{signed:N}=q;q.size&&s.assertSize(S,q.size);const U=BigInt(S);if(!N)return U;const L=(S.length-2)/2,z=(1n<<BigInt(L)*8n)-1n,D=z>>1n;return U<=D?U:U-z-1n}function R(S,q={}){q.size&&s.assertSize(S,q.size);const N=g(S);if(N==="0x")return!1;if(N==="0x1")return!0;throw new H(S)}function w(S,q={}){return t.fromHex(S,q)}function y(S,q={}){const{signed:N,size:U}=q;return Number(!N&&!U?S:E(S,q))}function x(S,q={}){const{size:N}=q;let U=t.fromHex(S);return N&&(r.assertSize(U,N),U=t.trimRight(U)),new TextDecoder().decode(U)}function C(S,q={}){const{strict:N=!1}=q;try{return u(S,{strict:N}),!0}catch{return!1}}class B extends n.BaseError{constructor({max:q,min:N,signed:U,size:L,value:z}){super(`Number \`${z}\` is not in safe${L?` ${L*8}-bit`:""}${U?" signed":" unsigned"} integer range ${q?`(\`${N}\` to \`${q}\`)`:`(above \`${N}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}le.IntegerOutOfRangeError=B;class H extends n.BaseError{constructor(q){super(`Hex value \`"${q}"\` is not a valid boolean.`,{metaMessages:['The hex value must be `"0x0"` (false) or `"0x1"` (true).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexBooleanError"})}}le.InvalidHexBooleanError=H;class F extends n.BaseError{constructor(q){super(`Value \`${typeof q=="object"?a.stringify(q):q}\` of type \`${typeof q}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}le.InvalidHexTypeError=F;class k extends n.BaseError{constructor(q){super(`Value \`${q}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}le.InvalidHexValueError=k;class m extends n.BaseError{constructor(q){super(`Hex value \`"${q}"\` is an odd length (${q.length-2} nibbles).`,{metaMessages:["It must be an even length."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidLengthError"})}}le.InvalidLengthError=m;class M extends n.BaseError{constructor({givenSize:q,maxSize:N}
42){super(`Size cannot exceed \`${N}\` bytes. Given size: \`${q}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}le.SizeOverflowError=M;class A extends n.BaseError{constructor({offset:q,position:N,size:U}){super(`Slice ${N==="start"?"starting":"ending"} at offset \`${q}\` is out-of-bounds (size: \`${U}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}le.SliceOffsetOutOfBoundsError=A;class P extends n.BaseError{constructor({size:q,targetSize:N,type:U}){super(`${U.charAt(0).toUpperCase()}${U.slice(1).toLowerCase()} size (\`${q}\`) exceeds padding size (\`${N}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}return le.SizeExceedsPaddingSizeError=P,le}var Po={},Sm;function O6(){if(Sm)return Po;Sm=1,Object.defineProperty(Po,"__esModule",{value:!0}),Po.fromRpc=t,Po.toRpc=n;const e=We();function t(r){return{...r,amount:BigInt(r.amount),index:Number(r.index),validatorIndex:Number(r.validatorIndex)}}function n(r){return{address:r.address,amount:e.fromNumber(r.amount),index:e.fromNumber(r.index),validatorIndex:e.fromNumber(r.validatorIndex)}}return Po}var Im;function Qp(){if(Im)return vo;Im=1,Object.defineProperty(vo,"__esModule",{value:!0}),vo.fromRpc=n,vo.toRpc=r;const e=We(),t=O6();function n(s){return{...s.baseFeePerGas&&{baseFeePerGas:BigInt(s.baseFeePerGas)},...s.blobBaseFee&&{blobBaseFee:BigInt(s.blobBaseFee)},...s.feeRecipient&&{feeRecipient:s.feeRecipient},...s.gasLimit&&{gasLimit:BigInt(s.gasLimit)},...s.number&&{number:BigInt(s.number)},...s.prevRandao&&{prevRandao:BigInt(s.prevRandao)},...s.time&&{time:BigInt(s.time)},...s.withdrawals&&{withdrawals:s.withdrawals.map(t.fromRpc)}}}function r(s){return{...typeof s.baseFeePerGas=="bigint"&&{baseFeePerGas:e.fromNumber(s.baseFeePerGas)},...typeof s.blobBaseFee=="bigint"&&{blobBaseFee:e.fromNumber(s.blobBaseFee)},...typeof s.feeRecipient=="string"&&{feeRecipient:s.feeRecipient},...typeof s.gasLimit=="bigint"&&{gasLimit:e.fromNumber(s.gasLimit)},...typeof s.number=="bigint"&&{number:e.fromNumber(s.number)},...typeof s.prevRandao=="bigint"&&{prevRandao:e.fromNumber(s.prevRandao)},...typeof s.time=="bigint"&&{time:e.fromNumber(s.time)},...s.withdrawals&&{withdrawals:s.withdrawals.map(t.toRpc)}}}return vo}var ve={},Bm;function or(){if(Bm)return ve;
42Bm=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.erc4626Abi=ve.erc721Abi=ve.erc1155Abi=ve.erc20Abi_bytes32=ve.erc20Abi=ve.erc6492SignatureValidatorAbi=ve.erc1271Abi=ve.addressResolverAbi=ve.textResolverAbi=ve.universalResolverReverseAbi=ve.universalResolverResolveAbi=ve.batchGatewayAbi=ve.multicall3Abi=void 0,ve.multicall3Abi=[{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"},{inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],ve.batchGatewayAbi=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}];const e=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}];return ve.universalResolverResolveAbi=[...e,{name:"resolveWithGateways",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"}]}],ve.universalResolverReverseAbi=[...e,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],ve.textResolverAbi=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],ve.addressResolverAbi=[{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"}]}],ve.erc1271Abi=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],ve.erc6492SignatureValidatorAbi=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],ve.erc20Abi=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}
42],ve.erc20Abi_bytes32=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],ve.erc1155Abi=[{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ERC1155InsufficientBalance",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ERC1155InvalidApprover",type:"error"},{inputs:[{internalType:"uint256",name:"idsLength",type:"uint256"},{internalType:"uint256",name:"valuesLength",type:"uint256"}],name:"ERC1155InvalidArrayLength",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"}],name:"ERC1155InvalidOperator",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"ERC1155InvalidReceiver",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"ERC1155InvalidSender",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"owner",type:"address"}],name:"ERC1155MissingApprovalForAll",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}
42],ve.erc721Abi=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"event",name:"ApprovalForAll",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"operator",type:"address"},{indexed:!1,name:"approved",type:"bool"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"payable",inputs:[{name:"spender",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"getApproved",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{type:"address"}]},{type:"function",name:"isApprovedForAll",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"operator",type:"address"}],outputs:[{type:"bool"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"ownerOf",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"owner",type:"address"}]},{type:"function",name:"safeTransferFrom",stateMutability:"payable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"safeTransferFrom",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"id",type:"uint256"},{name:"data",type:"bytes"}],outputs:[]},{type:"function",name:"setApprovalForAll",stateMutability:"nonpayable",inputs:[{name:"operator",type:"address"},{name:"approved",type:"bool"}],outputs:[]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"index",type:"uint256"}],outputs:[{type:"uint256"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"index",type:"uint256"}],outputs:[{name:"tokenId",type:"uint256"}]},{type:"function",name:"tokenURI",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transferFrom",stateMutability:"payable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]}],ve.erc4626Abi=[{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"receiver",type:"address"},{indexed:!1,name:"assets",type:"uint256"},{indexed:!1,name:"shares",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"receiver",type:"address"},{indexed:!0,name:"owner",type:"address"},{indexed:!1,name:"assets",type:"uint256"},{indexed:!1,name:"shares",type:"uint256"}],name:"Withdraw",type:"event"},{inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],name:"allowance",outputs:[{type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],name:"approve",outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"asset",outputs:[{name:"assetTokenAddress",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{name:"account",type:"address"}],name:"balanceOf",outputs:[{type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"convertToAssets",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"convertToShares",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"},{name:"receiver",type:"address"}],name:"deposit",outputs:[{name:"shares",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"caller",type:"address"}],name:"maxDeposit",outputs:[{name:"maxAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"caller",type:"address"}],name:"maxMint",outputs:[{name:"maxShares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"owner",type:"address"}],name:"maxRedeem",outputs:[{name:"maxShares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"owner",type:"address"}],name:"maxWithdraw",outputs:[{name:"maxAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"},{name:"receiver",type:"address"}],name:"mint",outputs:[{name:"assets",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"previewDeposit",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"previewMint",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"previewRedeem",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"previewWithdraw",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"},{name:"receiver",type:"address"},{name:"owner",type:"address"}],name:"redeem",outputs:[{name:"assets",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"totalAssets",outputs:[{name:"totalManagedAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],name:"transfer",outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"assets",type:"uint256"},{name:"receiver",type:"address"},{name:"owner",type:"address"}],name:"withdraw",outputs:[{name:"shares",type:"uint256"}],stateMutability:"nonpayable",type:"function"}],ve}var Ao={},xm;function C6(){return xm||(xm=1,Object.defineProperty(Ao,"__esModule",{value:!0}),Ao.aggregate3Signature=void 0,Ao.aggregate3Signature="0x82ad56cb"),Ao}var jt={},Rm;
42function ai(){return Rm||(Rm=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.multicall3Bytecode=jt.erc6492SignatureValidatorByteCode=jt.deploylessCallViaFactoryBytecode=jt.deploylessCallViaBytecodeBytecode=void 0,jt.deploylessCallViaBytecodeBytecode="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",jt.deploylessCallViaFactoryBytecode="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",jt.erc6492SignatureValidatorByteCode="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b8152
4260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848
42603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",jt.multicall3Bytecode="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9
42150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033"),jt}var bt={},Om;function ci(){if(Om)return bt;Om=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.InvalidChainIdError=bt.ClientChainNotConfiguredError=bt.ChainNotFoundError=bt.ChainMismatchError=bt.ChainDoesNotSupportContract=void 0;const e=fe();class t extends e.BaseError{constructor({blockNumber:c,chain:u,contract:d}){super(`Chain "${u.name}" does not support contract "${d.name}".`,{metaMessages:["This could be due to any of the following:",...c&&d.blockCreated&&d.blockCreated>c?[`- The contract "${d.name}" was not deployed until block ${d.blockCreated} (current block ${c}).`]:[`- The chain does not have the contract "${d.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}bt.ChainDoesNotSupportContract=t;class n extends e.BaseError{constructor({chain:c,currentChainId:u}){super(`The current chain of the wallet (id: ${u}) does not match the target chain for the transaction (id: ${c.id} – ${c.name}).`,{metaMessages:[`Current Chain ID:  ${u}`,`Expected Chain ID: ${c.id} – ${c.name}`],name:"ChainMismatchError"})}}bt.ChainMismatchError=n;class r extends e.BaseError{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
43`),{name:"ChainNotFoundError"})}}bt.ChainNotFoundError=r;class s extends e.BaseError{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}bt.ClientChainNotConfiguredError=s;class a extends e.BaseError{constructor({chainId:c}){super(typeof c=="number"?`Chain ID "${c}
43" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}return bt.InvalidChainIdError=a,bt}var Ms={},Cm;function ui(){if(Cm)return Ms;Cm=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.encodeDeployData=s;const e=qe(),t=Le(),n=It(),r="/docs/contract/encodeDeployData";function s(a){const{abi:o,args:c,bytecode:u}=a;if(!c||c.length===0)return u;const d=o.find(f=>"type"in f&&f.type==="constructor");if(!d)throw new e.AbiConstructorNotFoundError({docsPath:r});if(!("inputs"in d))throw new e.AbiConstructorParamsNotFoundError({docsPath:r});if(!d.inputs||d.inputs.length===0)throw new e.AbiConstructorParamsNotFoundError({docsPath:r});const l=(0,n.encodeAbiParameters)(d.inputs,c);return(0,t.concatHex)([u,l])}return Ms}var ks={},qm;function Pr(){if(qm)return ks;qm=1,Object.defineProperty(ks,"__esModule",{value:!0}),ks.getChainContractAddress=t;const e=ci();function t({blockNumber:n,chain:r,contract:s}){const a=r?.contracts?.[s];if(!a)throw new e.ChainDoesNotSupportContract({chain:r,contract:{name:s}});if(n&&a.blockCreated&&a.blockCreated>n)throw new e.ChainDoesNotSupportContract({blockNumber:n,chain:r,contract:{name:s,blockCreated:a.blockCreated}});return a.address}return ks}var Ns={},Hm;function Hf(){if(Hm)return Ns;Hm=1,Object.defineProperty(Ns,"__esModule",{value:!0}),Ns.getCallError=r;const e=pr(),t=rr(),n=ei();function r(s,{docsPath:a,...o}){const c=(()=>{const u=(0,n.getNodeError)(s,o);return u instanceof t.UnknownNodeError?s:u})();return new e.CallExecutionError(c,{docsPath:a,...o})}return Ns}var Fs={},Ls={},Mm;function Mf(){if(Mm)return Ls;Mm=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.withResolvers=e;function e(){let t=()=>{},n=()=>{};return{promise:new Promise((s,a)=>{t=s,n=a}),resolve:t,reject:n}}return Ls}var km;function kf(){if(km)return Fs;km=1,Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.createBatchScheduler=n;const e=Mf(),t=new Map;function n({fn:r,id:s,shouldSplitBatch:a,wait:o=0,sort:c}){const u=async()=>{const T=f();d();const v=T.map(({args:p})=>p);v.length!==0&&r(v).then(p=>{c&&Array.isArray(p)&&p.sort(c);for(let O=0;O<T.length;O++){const{resolve:I}=T[O];I?.([p[O],p])}}).catch(p=>{for(let O=0;O<T.length;O++){const{reject:I}=T[O];I?.(p)}})},d=()=>t.delete(s),l=()=>f().map(({args:T})=>T),f=()=>t.get(s)||[],b=T=>t.set(s,[...f(),T]);return{flush:d,async schedule(T){const{promise:v,resolve:p,reject:O}=(0,e.withResolvers)();return a?.([...l(),T])&&u(),f().length>0?(b({args:T,resolve:p,reject:O}),v):(b({args:T,resolve:p,reject:O}),setTimeout(u,o),v)}}}return Fs}var Zd={},Xt={},Nm;function q6(){if(Nm)return Xt;Nm=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.OffchainLookupSenderMismatchError=Xt.OffchainLookupResponseMalformedError=Xt.OffchainLookupError=void 0;const e=Ve(),t=fe(),n=wf();class r extends t.BaseError{constructor({callbackSelector:c,cause:u,data:d,extraData:l,sender:f,urls:b}){super(u.shortMessage||"An error occurred while fetching for an offchain result.",{cause:u,metaMessages:[...u.metaMessages||[],u.metaMessages?.length?"":[],"Offchain Gateway Call:",b&&["  Gateway URL(s):",...b.map(T=>`    ${(0,n.getUrl)(T)}`)],`  Sender: ${f}`,`  Data: ${d}`,`  Callback selector: ${c}`,`  Extra data: ${l}`].flat(),name:"OffchainLookupError"})}}Xt.OffchainLookupError=r;class s extends t.BaseError{constructor({result:c,url:u}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${(0,n.getUrl)(u)}`,`Response: ${(0,e.stringify)(c)}`],name:"OffchainLookupResponseMalformedError"})}}Xt.OffchainLookupResponseMalformedError=s;class a extends t.BaseError{constructor({sender:c,to:u}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${u}`,`OffchainLookup sender address: ${c}`],name:"OffchainLookupSenderMismatchError"})}}return Xt.OffchainLookupSenderMismatchError=a,Xt}var Yd={},Us={},Fm;function Nf(){if(Fm)return Us;Fm=1,Object.defineProperty(Us,"__esModule",{value:!0}),Us.decodeFunctionData=a;const e=qe(),t=vt(),n=Qr(),r=gr(),s=$t();function a(o){const{abi:c,data:u}=o,d=(0,t.slice)(u,0,4),l=c.find(f=>f.type==="function"&&d===(0,n.toFunctionSelector)((0,s.formatAbiItem)(f)));if(!l)throw new e.AbiFunctionSignatureNotFoundError(d,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:l.name,args:"inputs"in l&&l.inputs&&l.inputs.length>0?(0,r.decodeAbiParameters)(l.inputs,(0,t.slice)(u,4)):void 0}}return Us}var zs={},Lm;function Ff(){if(Lm)return zs;Lm=1,Object.defineProperty(zs,"__esModule",{value:!0}),zs.encodeErrorResult=c;const e=qe(),t=Le(),n=Qr(),r=It(),s=$t(),a=tr(),o="/docs/contract/encodeErrorResult";function c(u){const{abi:d,errorName:l,args:f}=u;let b=d[0];if(l){const O=(0,a.getAbiItem)({abi:d,args:f,name:l});if(!O)throw new e.AbiErrorNotFoundError(l,{docsPath:o});b=O}if(b.type!=="error")throw new e.AbiErrorNotFoundError(void 0,{docsPath:o});const T=(0,s.formatAbiItem)(b),v=(0,n.toFunctionSelector)(T);let p="0x";if(f&&f.length>0){if(!b.inputs)throw new e.AbiErrorInputsNotFoundError(b.name,{docsPath:o});p=(0,r.encodeAbiParameters)(b.inputs,f)}return(0,t.concatHex)([v,p])}return zs}var Ds={},Um;function Lf(){if(Um)return Ds;Um=1,Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.encodeFunctionResult=s;const e=qe(),t=It(),n=tr(),r="/docs/contract/encodeFunctionResult";function s(a){const{abi:o,functionName:c,result:u}=a;let d=o[0];if(c){const f=(0,n.getAbiItem)({abi:o,name:c});if(!f)throw new e.AbiFunctionNotFoundError(c,{docsPath:r});d=f}if(d.type!=="function")throw new e.AbiFunctionNotFoundError(void 0,{docsPath:r});if(!d.outputs)throw new e.AbiFunctionOutputsNotFoundError(d.name,{docsPath:r});const l=(()=>
43{if(d.outputs.length===0)return[];if(d.outputs.length===1)return[u];if(Array.isArray(u))return u;throw new e.InvalidArrayError(u)})();return(0,t.encodeAbiParameters)(d.outputs,l)}return Ds}var zm;function td(){return zm||(zm=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.localBatchGatewayUrl=void 0,e.localBatchGatewayRequest=o;const t=or(),n=_f(),r=Nf(),s=Ff(),a=Lf();e.localBatchGatewayUrl="x-batch-gateway:true";async function o(u){const{data:d,ccipRequest:l}=u,{args:[f]}=(0,r.decodeFunctionData)({abi:t.batchGatewayAbi,data:d}),b=[],T=[];return await Promise.all(f.map(async(v,p)=>{try{T[p]=v.urls.includes(e.localBatchGatewayUrl)?await o({data:v.data,ccipRequest:l}):await l(v),b[p]=!1}catch(O){b[p]=!0,T[p]=c(O)}})),(0,a.encodeFunctionResult)({abi:t.batchGatewayAbi,functionName:"query",result:[b,T]})}function c(u){return u.name==="HttpRequestError"&&u.status?(0,s.encodeErrorResult)({abi:t.batchGatewayAbi,errorName:"HttpError",args:[u.status,u.shortMessage]}):(0,s.encodeErrorResult)({abi:[n.solidityError],errorName:"Error",args:["shortMessage"in u?u.shortMessage:u.message]})}})(Yd)),Yd}var Dm;function Uf(){return Dm||(Dm=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.offchainLookupAbiItem=e.offchainLookupSignature=void 0,e.offchainLookup=f,e.ccipRequest=b;const t=On(),n=q6(),r=Bt(),s=Vu(),a=It(),o=Ot(),c=Le(),u=nt(),d=td(),l=Ve();e.offchainLookupSignature="0x556f1830",e.offchainLookupAbiItem={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 f(T,{blockNumber:v,blockTag:p,data:O,to:I}){const{args:h}=(0,s.decodeErrorResult)({data:O,abi:[e.offchainLookupAbiItem]}),[j,i,g,_,E]=h,{ccipRead:R}=T,w=R&&typeof R?.request=="function"?R.request:b;try{if(!(0,o.isAddressEqual)(I,j))throw new n.OffchainLookupSenderMismatchError({sender:j,to:I});const y=i.includes(d.localBatchGatewayUrl)?await(0,d.localBatchGatewayRequest)({data:g,ccipRequest:w}):await w({data:g,sender:j,urls:i}),{data:x}=await(0,t.call)(T,{blockNumber:v,blockTag:p,data:(0,c.concat)([_,(0,a.encodeAbiParameters)([{type:"bytes"},{type:"bytes"}],[y,E])]),to:I});return x}catch(y){throw new n.OffchainLookupError({callbackSelector:_,cause:y,data:O,extraData:E,sender:j,urls:i})}}async function b({data:T,sender:v,urls:p}){let O=new Error("An unknown error occurred.");for(let I=0;I<p.length;I++){const h=p[I],j=h.includes("{data}")?"GET":"POST",i=j==="POST"?{data:T,sender:v}:void 0,g=j==="POST"?{"Content-Type":"application/json"}:{};try{const _=await fetch(h.replace("{sender}",v.toLowerCase()).replace("{data}",T),{body:JSON.stringify(i),headers:g,method:j});let E;if(_.headers.get("Content-Type")?.startsWith("application/json")?E=(await _.json()).data:E=await _.text(),!_.ok){O=new r.HttpRequestError({body:i,details:E?.error?(0,l.stringify)(E.error):_.statusText,headers:_.headers,status:_.status,url:h});continue}if(!(0,u.isHex)(E)){O=new n.OffchainLookupResponseMalformedError({result:E,url:h});continue}return E}catch(_){O=new r.HttpRequestError({body:i,details:_.message,url:h})}}throw O}})(Zd)),Zd}var Gm;function On(){if(Gm)return _o;Gm=1,Object.defineProperty(_o,"__esModule",{value:!0}),_o.call=i,_o.getRevertErrorData=w;const e=mr(),t=Qp(),n=He(),r=or(),s=C6(),a=ai(),o=fe(),c=ci(),u=pr(),d=Mt(),l=ui(),f=ot(),b=Pr(),T=ie(),v=Hf(),p=wr(),O=xt(),I=kf(),h=Pf(),j=Rt();async function i(y,x){const{account:C=y.account,authorizationList:B,batch:H=!!y.batch?.multicall,blockNumber:F,blockTag:k=y.experimental_blockTag??"latest",accessList:m,blobs:M,blockOverrides:A,code:P,data:S,factory:q,factoryData:N,gas:U,gasPrice:L,maxFeePerBlobGas:z,maxFeePerGas:D,maxPriorityFeePerGas:X,nonce:W,to:Z,value:J,stateOverride:oe,...K}=x,Y=C?(0,n.parseAccount)(C):void 0;if(P&&(q||N))throw new o.BaseError("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(P&&Z)throw new o.BaseError("Cannot provide both `code` & `to` as parameters.");const $=P&&S,re=q&&N&&Z&&S,ee=$||re,ne=$?E({code:P,data:S}):re?R({data:S,factory:q,factoryData:N,to:Z}):S;try{(0,j.assertRequest)(x);
43const te=(typeof F=="bigint"?(0,T.numberToHex)(F):void 0)||k,Q=A?t.toRpc(A):void 0,be=(0,h.serializeStateOverride)(oe),me=y.chain?.formatters?.transactionRequest?.format,Ae=(me||O.formatTransactionRequest)({...(0,p.extract)(K,{format:me}),accessList:m,account:Y,authorizationList:B,blobs:M,data:ne,gas:U,gasPrice:L,maxFeePerBlobGas:z,maxFeePerGas:D,maxPriorityFeePerGas:X,nonce:W,to:ee?void 0:Z,value:J},"call");if(H&&g({request:Ae})&&!be&&!Q)try{return await _(y,{...Ae,blockNumber:F,blockTag:k})}catch(Te){if(!(Te instanceof c.ClientChainNotConfiguredError)&&!(Te instanceof c.ChainDoesNotSupportContract))throw Te}const Xe=(()=>{const Te=[Ae,te];return be&&Q?[...Te,be,Q]:be?[...Te,be]:Q?[...Te,{},Q]:Te})(),Me=await y.request({method:"eth_call",params:Xe});return Me==="0x"?{data:void 0}:{data:Me}}catch(se){const te=w(se),{offchainLookup:Q,offchainLookupSignature:be}=await Promise.resolve().then(()=>Uf());if(y.ccipRead!==!1&&te?.slice(0,10)===be&&Z)return{data:await Q(y,{data:te,to:Z})};throw ee&&te?.slice(0,10)==="0x101bb98d"?new u.CounterfactualDeploymentFailedError({factory:q}):(0,v.getCallError)(se,{...x,account:Y,chain:y.chain})}}function g({request:y}){const{data:x,to:C,...B}=y;return!(!x||x.startsWith(s.aggregate3Signature)||!C||Object.values(B).filter(H=>typeof H<"u").length>0)}async function _(y,x){const{batchSize:C=1024,deployless:B=!1,wait:H=0}=typeof y.batch?.multicall=="object"?y.batch.multicall:{},{blockNumber:F,blockTag:k=y.experimental_blockTag??"latest",data:m,to:M}=x,A=(()=>{if(B)return null;if(x.multicallAddress)return x.multicallAddress;if(y.chain)return(0,b.getChainContractAddress)({blockNumber:F,chain:y.chain,contract:"multicall3"});throw new c.ClientChainNotConfiguredError})(),S=(typeof F=="bigint"?(0,T.numberToHex)(F):void 0)||k,{schedule:q}=(0,I.createBatchScheduler)({id:`${y.uid}.${S}`,wait:H,shouldSplitBatch(L){return L.reduce((D,{data:X})=>D+(X.length-2),0)>C*2},fn:async L=>{const z=L.map(W=>({allowFailure:!0,callData:W.data,target:W.to})),D=(0,f.encodeFunctionData)({abi:r.multicall3Abi,args:[z],functionName:"aggregate3"}),X=await y.request({method:"eth_call",params:[{...A===null?{data:E({code:a.multicall3Bytecode,data:D})}:{to:A,data:D}},S]});return(0,d.decodeFunctionResult)({abi:r.multicall3Abi,args:[z],functionName:"aggregate3",data:X||"0x"})}}),[{returnData:N,success:U}]=await q({data:m,to:M});if(!U)throw new u.RawContractError({data:N});return N==="0x"?{data:void 0}:{data:N}}function E(y){const{code:x,data:C}=y;return(0,l.encodeDeployData)({abi:(0,e.parseAbi)(["constructor(bytes, bytes)"]),bytecode:a.deploylessCallViaBytecodeBytecode,args:[x,C]})}function R(y){const{data:x,factory:C,factoryData:B,to:H}=y;return(0,l.encodeDeployData)({abi:(0,e.parseAbi)(["constructor(address, bytes, address, bytes)"]),bytecode:a.deploylessCallViaFactoryBytecode,args:[H,x,C,B]})}function w(y){if(!(y instanceof o.BaseError))return;const x=y.walk();return typeof x?.data=="object"?x.data?.data:x.data}return _o}var Vm;function Nt(){if(Vm)return qs;Vm=1,Object.defineProperty(qs,"__esModule",{value:!0}),qs.readContract=a;const e=Mt(),t=ot(),n=vr(),r=ge(),s=On();async function a(o,c){const{abi:u,address:d,args:l,functionName:f,...b}=c,T=(0,t.encodeFunctionData)({abi:u,args:l,functionName:f});try{const{data:v}=await(0,r.getAction)(o,s.call,"call")({...b,data:T,to:d});return(0,e.decodeFunctionResult)({abi:u,args:l,functionName:f,data:v||"0x"})}catch(v){throw(0,n.getContractError)(v,{abi:u,address:d,args:l,docsPath:"/docs/contract/readContract",functionName:f})}}return qs}var Gs={},Wm;function $p(){if(Wm)return Gs;Wm=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.simulateContract=o;const e=He(),t=Mt(),n=ot(),r=vr(),s=ge(),a=On();async function o(c,u){const{abi:d,address:l,args:f,functionName:b,dataSuffix:T=typeof c.dataSuffix=="string"?c.dataSuffix:c.dataSuffix?.value,...v}=u,p=v.account?(0,e.parseAccount)(v.account):c.account,O=(0,n.encodeFunctionData)({abi:d,args:f,functionName:b});try{const{data:I}=await(0,s.getAction)(c,a.call,"call")({batch:!1,data:`${O}${T?T.replace("0x",""):""}`,to:l,...v,account:p}),h=(0,t.decodeFunctionResult)({abi:d,args:f,functionName:b,data:I||"0x"}),j=d.filter(i=>"name"in i&&i.name===u.functionName);return{result:h,request:{abi:j,address:l,args:f,dataSuffix:T,functionName:b,...v,account:p}}}catch(I){throw(0,r.getContractError)(I,{abi:d,address:l,args:f,docsPath:"/docs/contract/simulateContract",functionName:b,sender:p?.address})}}return Gs}var Vs={},Jd={},Km;function nn(){return Km||(Km=1,(function(e){Object.defineProperty(e,"__esMo
43dule",{value:!0}),e.cleanupCache=e.listenersCache=void 0,e.observe=n,e.listenersCache=new Map,e.cleanupCache=new Map;let t=0;function n(r,s,a){const o=++t,c=()=>e.listenersCache.get(r)||[],u=()=>{const T=c();e.listenersCache.set(r,T.filter(v=>v.id!==o))},d=()=>{const T=c();if(!T.some(p=>p.id===o))return;const v=e.cleanupCache.get(r);if(T.length===1&&v){const p=v();p instanceof Promise&&p.catch(()=>{})}u()},l=c();if(e.listenersCache.set(r,[...l,{id:o,fns:s}]),l&&l.length>0)return d;const f={};for(const T in s)f[T]=((...v)=>{const p=c();if(p.length!==0)for(const O of p)O.fns[T]?.(...v)});const b=a(f);return typeof b=="function"&&e.cleanupCache.set(r,b),d}})(Jd)),Jd}var Ws={},Ks={},Zm;function zf(){if(Zm)return Ks;Zm=1,Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.wait=e;async function e(t){return new Promise(n=>setTimeout(n,t))}return Ks}var Ym;function Cn(){if(Ym)return Ws;Ym=1,Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.poll=t;const e=zf();function t(n,{emitOnBegin:r,initialWaitTime:s,interval:a}){let o=!0;const c=()=>o=!1;return(async()=>{let d;r&&(d=await n({unpoll:c}));const l=await s?.(d)??a;await(0,e.wait)(l);const f=async()=>{o&&(await n({unpoll:c}),await(0,e.wait)(a),f())};f()})(),c}return Ws}var To={},Xd={},Jm;function e_(){return Jm||(Jm=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.responseCache=e.promiseCache=void 0,e.getCache=t,e.withCache=n,e.promiseCache=new Map,e.responseCache=new Map;function t(r){const s=(c,u)=>({clear:()=>u.delete(c),get:()=>u.get(c),set:d=>u.set(c,d)}),a=s(r,e.promiseCache),o=s(r,e.responseCache);return{clear:()=>{a.clear(),o.clear()},promise:a,response:o}}async function n(r,{cacheKey:s,cacheTime:a=Number.POSITIVE_INFINITY}){const o=t(s),c=o.response.get();if(c&&a>0&&Date.now()-c.created.getTime()<a)return c.data;let u=o.promise.get();u||(u=r(),o.promise.set(u));try{const d=await u;return o.response.set({created:new Date,data:d}),d}finally{o.promise.clear()}}})(Xd)),Xd}var Xm;function di(){if(Xm)return To;Xm=1,Object.defineProperty(To,"__esModule",{value:!0}),To.getBlockNumberCache=n,To.getBlockNumber=r;const e=e_(),t=s=>`blockNumber.${s}`;function n(s){return(0,e.getCache)(t(s))}async function r(s,{cacheTime:a=s.cacheTime}={}){const o=await(0,e.withCache)(()=>s.request({method:"eth_blockNumber"}),{cacheKey:t(s.uid),cacheTime:a});return BigInt(o)}return To}var Zs={},Qm;function rd(){if(Qm)return Zs;Qm=1,Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.getFilterChanges=n;const e=si(),t=nr();async function n(r,{filter:s}){const a="strict"in s&&s.strict,o=await s.request({method:"eth_getFilterChanges",params:[s.id]});if(typeof o[0]=="string")return o;const c=o.map(u=>(0,t.formatLog)(u));return!("abi"in s)||!s.abi?c:(0,e.parseEventLogs)({abi:s.abi,logs:c,strict:a})}return Zs}var Ys={},$m;
43function nd(){if($m)return Ys;$m=1,Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.uninstallFilter=e;async function e(t,{filter:n}){return n.request({method:"eth_uninstallFilter",params:[n.id]})}return Ys}var eh;function t_(){if(eh)return Vs;eh=1,Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.watchContractEvent=v;const e=qe(),t=_r(),n=ii(),r=$r(),s=nr(),a=ge(),o=nn(),c=Cn(),u=Ve(),d=pf(),l=di(),f=qf(),b=rd(),T=nd();function v(p,O){const{abi:I,address:h,args:j,batch:i=!0,eventName:g,fromBlock:_,onError:E,onLogs:R,poll:w,pollingInterval:y=p.pollingInterval,strict:x}=O;return(typeof w<"u"?w:typeof _=="bigint"?!0:!(p.transport.type==="webSocket"||p.transport.type==="ipc"||p.transport.type==="fallback"&&(p.transport.transports[0].config.type==="webSocket"||p.transport.transports[0].config.type==="ipc")))?(()=>{const F=x??!1,k=(0,u.stringify)(["watchContractEvent",h,j,i,p.uid,g,y,F,_]);return(0,o.observe)(k,{onLogs:R,onError:E},m=>{let M;_!==void 0&&(M=_-1n);let A,P=!1;const S=(0,c.poll)(async()=>{if(!P){try{A=await(0,a.getAction)(p,d.createContractEventFilter,"createContractEventFilter")({abi:I,address:h,args:j,eventName:g,strict:F,fromBlock:_})}catch{}P=!0;return}try{let q;if(A)q=await(0,a.getAction)(p,b.getFilterChanges,"getFilterChanges")({filter:A});else{const N=await(0,a.getAction)(p,l.getBlockNumber,"getBlockNumber")({});M&&M<N?q=await(0,a.getAction)(p,f.getContractEvents,"getContractEvents")({abi:I,address:h,args:j,eventName:g,fromBlock:M+1n,toBlock:N,strict:F}):q=[],M=N}if(q.length===0)return;if(i)m.onLogs(q);else for(const N of q)m.onLogs([N])}catch(q){A&&q instanceof t.InvalidInputRpcError&&(P=!1),m.onError?.(q)}},{emitOnBegin:!0,interval:y});return async()=>{A&&await(0,a.getAction)(p,T.uninstallFilter,"uninstallFilter")({filter:A}),S()}})})():(()=>{const F=x??!1,k=(0,u.stringify)(["watchContractEvent",h,j,i,p.uid,g,y,F]);let m=!0,M=()=>m=!1;return(0,o.observe)(k,{onLogs:R,onError:E},A=>((async()=>{try{const P=(()=>{if(p.transport.type==="fallback"){const N=p.transport.transports.find(U=>U.config.type==="webSocket"||U.config.type==="ipc");return N?N.value:p.transport}return p.transport})(),S=g?(0,r.encodeEventTopics)({abi:I,eventName:g,args:j}):[],{unsubscribe:q}=await P.subscribe({params:["logs",{address:h,topics:S}],onData(N){if(!m)return;const U=N.result;try{const{eventName:L,args:z}=(0,n.decodeEventLog)({abi:I,data:U.data,topics:U.topics,strict:x}),D=(0,s.formatLog)(U,{args:z,eventName:L});A.onLogs([D])}catch(L){let z,D;if(L instanceof e.DecodeLogDataMismatch||L instanceof e.DecodeLogTopicsMismatch){if(x)return;z=L.abiItem.name,D=L.abiItem.inputs?.some(W=>!("name"in W&&W.name))}const X=(0,s.formatLog)(U,{args:D?[]:{},eventName:z});A.onLogs([X])}},onError(N){A.onError?.(N)}});M=q,m||M()}catch(P){E?.(P)}})(),()=>M()))})()}return Vs}var So={},kr={},th;function Ar(){if(th)return kr;th=1,Object.defineProperty(kr,"__esModule",{value:!0}),kr.AccountTypeNotSupportedError=kr.AccountNotFoundError=void 0;const e=fe();class t extends e.BaseError{constructor({docsPath:s}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
44`),{docsPath:s,docsSlug:"account",name:"AccountNotFoundError"})}}kr.AccountNotFoundError=t;class n extends e.BaseError{constructor({docsPath:s,metaMessages:a,type:o}){super(`Account type "${o}" is not supported.`,{docsPath:s,metaMessages:a,name:"AccountTypeNotSupportedError"})}}return kr.AccountTypeNotSupportedError=n,kr}var Js={},Xs={},rh;function fi(){if(rh)return Xs;rh=1,Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.assertCurrentChain=t;const e=ci();function t({chain:n,currentChainId:r}){if(!n)throw new e.ChainNotFoundError;if(r!==n.id)throw new e.ChainMismatchError({chain:n,currentChainId:r})}return Xs}var Qs={},nh;function Df(){if(nh)return Qs;nh=1,Object.defineProperty(Qs,"__esModule",{value:!0}),Qs.sendRawTransaction=e;async function e(t,{serializedTransaction:n}){return t.request({method:"eth_sendRawTransaction",params:[n]},{retryCount:0})}return Qs}var oh;function od(){if(oh)return Js;oh=1,Object.defineProperty(Js,"__esModule",{value:!0}),Js.sendTransaction=O;
44const e=He(),t=Ar(),n=fe(),r=$o(),s=fi(),a=Le(),o=ni(),c=wr(),u=xt(),d=ge(),l=Xr(),f=Rt(),b=jr(),T=oi(),v=Df(),p=new l.LruMap(128);async function O(I,h){const{account:j=I.account,assertChainId:i=!0,chain:g=I.chain,accessList:_,authorizationList:E,blobs:R,data:w,dataSuffix:y=typeof I.dataSuffix=="string"?I.dataSuffix:I.dataSuffix?.value,gas:x,gasPrice:C,maxFeePerBlobGas:B,maxFeePerGas:H,maxPriorityFeePerGas:F,nonce:k,type:m,value:M,...A}=h;if(typeof j>"u")throw new t.AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransaction"});const P=j?(0,e.parseAccount)(j):null;try{(0,f.assertRequest)(h);const S=await(async()=>{if(h.to)return h.to;if(h.to!==null&&E&&E.length>0)return await(0,r.recoverAuthorizationAddress)({authorization:E[0]}).catch(()=>{throw new n.BaseError("`to` is required. Could not infer from `authorizationList`.")})})();if(P?.type==="json-rpc"||P===null){let q;g!==null&&(q=await(0,d.getAction)(I,b.getChainId,"getChainId")({}),i&&(0,s.assertCurrentChain)({currentChainId:q,chain:g}));const N=I.chain?.formatters?.transactionRequest?.format,L=(N||u.formatTransactionRequest)({...(0,c.extract)(A,{format:N}),accessList:_,account:P,authorizationList:E,blobs:R,chainId:q,data:w&&(0,a.concat)([w,y??"0x"]),gas:x,gasPrice:C,maxFeePerBlobGas:B,maxFeePerGas:H,maxPriorityFeePerGas:F,nonce:k,to:S,type:m,value:M},"sendTransaction"),z=p.get(I.uid),D=z?"wallet_sendTransaction":"eth_sendTransaction";try{return await I.request({method:D,params:[L]},{retryCount:0})}catch(X){if(z===!1)throw X;const W=X;if(W.name==="InvalidInputRpcError"||W.name==="InvalidParamsRpcError"||W.name==="MethodNotFoundRpcError"||W.name==="MethodNotSupportedRpcError")return await I.request({method:"wallet_sendTransaction",params:[L]},{retryCount:0}).then(Z=>(p.set(I.uid,!0),Z)).catch(Z=>{const J=Z;throw J.name==="MethodNotFoundRpcError"||J.name==="MethodNotSupportedRpcError"?(p.set(I.uid,!1),W):J});throw W}}if(P?.type==="local"){const q=await(0,d.getAction)(I,T.prepareTransactionRequest,"prepareTransactionRequest")({account:P,accessList:_,authorizationList:E,blobs:R,chain:g,data:w&&(0,a.concat)([w,y??"0x"]),gas:x,gasPrice:C,maxFeePerBlobGas:B,maxFeePerGas:H,maxPriorityFeePerGas:F,nonce:k,nonceManager:P.nonceManager,parameters:[...T.defaultParameters,"sidecars"],type:m,value:M,...A,to:S}),N=g?.serializers?.transaction,U=await P.signTransaction(q,{serializer:N});return await(0,d.getAction)(I,v.sendRawTransaction,"sendRawTransaction")({serializedTransaction:U})}throw P?.type==="smart"?new t.AccountTypeNotSupportedError({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new t.AccountTypeNotSupportedError({docsPath:"/docs/actions/wallet/sendTransaction",type:P?.type})}catch(S){throw S instanceof t.AccountTypeNotSupportedError?S:(0,o.getTransactionError)(S,{...h,account:P,chain:h.chain||void 0})}}return Js}var ih;function Gf(){if(ih)return So;ih=1,Object.defineProperty(So,"__esModule",{value:!0}),So.writeContract=o;const e=He(),t=Ar(),n=ot(),r=vr(),s=ge(),a=od();async function o(c,u){return o.internal(c,a.sendTransaction,"sendTransaction",u)}return(function(c){async function u(d,l,f,b){const{abi:T,account:v=d.account,address:p,args:O,functionName:I,...h}=b;if(typeof v>"u")throw new t.AccountNotFoundError({docsPath:"/docs/contract/writeContract"});const j=v?(0,e.parseAccount)(v):null,i=(0,n.encodeFunctionData)({abi:T,args:O,functionName:I});try{return await(0,s.getAction)(d,l,f)({data:i,to:p,account:j,...h})}catch(g){throw(0,r.getContractError)(g,{abi:T,address:p,args:O,docsPath:"/docs/contract/writeContract",functionName:I,sender:j?.address})}}c.internal=u})(o||(So.writeContract=o={})),So}var sh;function H6(){if(sh)return cn;sh=1,Object.defineProperty(cn,"__esModule",{value:!0}),cn.getContract=u,cn.getFunctionParameters=d,cn.getEventParameters=l;const e=ge(),t=pf(),n=Yp(),r=qf(),s=Nt(),a=$p(),o=t_(),c=Gf();function u({abi:f,address:b,client:T}){const v=T,[p,O]=v?"public"in v&&"wallet"in v?[v.public,v.wallet]:"public"in v?[v.public,void 0]:"wallet"in v?[void 0,v.wallet]:[v,v]:[void 0,void 0],I=p!=null,h=O!=null,j={};let i=!1,g=!1,_=!1;for(const E of f)if(E.type==="function"?E.stateMutability==="view"||E.stateMutability==="pure"?i=!0:g=!0:E.type==="event"&&(_=!0),i&&g&&_)break;return I&&(i&&(j.read=new Proxy({},{get(E,R){return(...w)=>{const{args:y,options:x}=d(w);return(0,e.getAction)(p,s.readContract,"readContract")({abi:f,address:b,functionName:R,args:y,...x})}}})),g&&(j.simulate=new Proxy({},{get(E,R){return(...w)=>{const{args:y,options:x}=d(w);return(0,e.getAction)(p,a.simulateContract,"simulateContract")({abi:f,address:b,functionName:R,args:y,...x})}}})),_&&(j.createEventFilter=new Proxy({},{get(E,R){return(...w)=>{const y=f.find(B=>B.type==="event"&&B.name===R),{args:x,options:C}=l(w,y);return(0,e.getAction)(p,t.createContractEventFilter,"createContractEventFilter")({abi:f,address:b,eventName:R,args:x,...C})}}}),j.getEvents=new Proxy({},{get(E,R){return(...w)=>{const y=f.find(B=>B.type==="event"&&B.name===R),{args:x,options:C}=l(w,y);return(0,e.getAction)(p,r.getContractEvents,"getContractEvents")({abi:f,address:b,eventName:R,args:x,...C})}}}),j.watchEvent=new Proxy({},{get(E,R){return(...w)=>{const y=f.find(B=>B.type==="event"&&B.name===R),{args:x,options:C}=l(w,y);return(0,e.getAction)(p,o.watchContractEvent,"watchContractEvent")({abi:f,address:b,eventName:R,args:x,...C})}}}))),h&&g&&(j.write=new Proxy({},{get(E,R){return(...w)=>{const{args:y,options:x}=d(w);return(0,e.getAction)(O,c.writeContract,"writeContract")({abi:f,address:b,functionName:R,args:y,...x})}}})),(I||h)&&g&&(j.estimateGas=new Proxy({},{get(E,R){return(...w)=>{const{args:y,options:x}=d(w),C=p??O;return(0,e.getAction)(C,n.estimateContractGas,"estimateContractGas")({abi:f,address:b,functionName:R,args:y,...x,account:x.account??O.account})}}})),j.address=b,j.abi=f,j}function d(f){const b=f.length&&Array.isArray(f[0]),T=b?f[0]:[],v=(b?f[1]:f[0])??{};return{args:T,options:v}}function l(f,b){let T=!1;Array.isArray(f[0])?T=!0:f.length===1?T=b.inputs.some(O=>O.indexed):f.length===2&&(T=!0);const v=T?f[0]:void 0,p=(T?f[1]:f[0])??{};return{args:v,options:p}}return cn}var pn={},Io={},ah;function r_(){if(ah)return Io;ah=1,Object.defineProperty(Io,"__esModule",{value:!0}),Io.BundleFailedError=void 0;const e=fe();class t extends e.BaseError{constructor(r){super(`Call bundle failed with status: ${r.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=r}}return Io.BundleFailedError=t,Io}var $s={},ch;function id(){if(ch)return $s;ch=1,Object.defineProperty($s,"__esModule",{value:!0}),$s.withRetry=t;const e=zf();function t(n,{delay:r=100,retryCount:s=2,shouldRetry:a=()=>!0}={}){return new Promise((o,c)=>{const u=async({count:d=0}={})=>{const l=async({error:f})=>{const b=typeof r=="function"?r({count:d,error:f}):r;b&&await(0,e.wait)(b),u({count:d+1})};try{const f=await n();o(f)}catch(f){if(d<s&&await a({count:d,error:f}))return l({error:f});c(f)}};u()})}return $s}var ea={},Qd={},uh;function li(){return uh||(uh=1,(function(e){Object.defineProperty(e,"__esMo
44dule",{value:!0}),e.defineTransactionReceipt=e.receiptStatuses=void 0,e.formatTransactionReceipt=a;const t=Ne(),n=ti(),r=nr(),s=Rn();e.receiptStatuses={"0x0":"reverted","0x1":"success"};function a(o,c){const u={...o,blockNumber:o.blockNumber?BigInt(o.blockNumber):null,contractAddress:o.contractAddress?o.contractAddress:null,cumulativeGasUsed:o.cumulativeGasUsed?BigInt(o.cumulativeGasUsed):null,effectiveGasPrice:o.effectiveGasPrice?BigInt(o.effectiveGasPrice):null,gasUsed:o.gasUsed?BigInt(o.gasUsed):null,logs:o.logs?o.logs.map(d=>(0,r.formatLog)(d)):null,to:o.to?o.to:null,transactionIndex:o.transactionIndex?(0,t.hexToNumber)(o.transactionIndex):null,status:o.status?e.receiptStatuses[o.status]:null,type:o.type?s.transactionType[o.type]||o.type:null};return o.blobGasPrice&&(u.blobGasPrice=BigInt(o.blobGasPrice)),o.blobGasUsed&&(u.blobGasUsed=BigInt(o.blobGasUsed)),u}e.defineTransactionReceipt=(0,n.defineFormatter)("transactionReceipt",a)})(Qd)),Qd}var $d={},dh;function Vf(){return dh||(dh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fallbackTransactionErrorMagicIdentifier=e.fallbackMagicIdentifier=void 0,e.sendCalls=l;const t=He(),n=fe(),r=_r(),s=ot(),a=Le(),o=Ne(),c=ie(),u=ni(),d=od();e.fallbackMagicIdentifier="0x5792579257925792579257925792579257925792579257925792579257925792",e.fallbackTransactionErrorMagicIdentifier=(0,c.numberToHex)(0,{size:32});async function l(f,b){const{account:T=f.account,chain:v=f.chain,experimental_fallback:p,experimental_fallbackDelay:O=32,forceAtomic:I=!1,id:h,version:j="2.0.0"}=b,i=T?(0,t.parseAccount)(T):null;let g=b.capabilities;f.dataSuffix&&!b.capabilities?.dataSuffix&&(typeof f.dataSuffix=="string"?g={...b.capabilities,dataSuffix:{value:f.dataSuffix,optional:!0}}:g={...b.capabilities,dataSuffix:{value:f.dataSuffix.value,...f.dataSuffix.required?{}:{optional:!0}}});const _=b.calls.map(E=>{const R=E,w=R.abi?(0,s.encodeFunctionData)({abi:R.abi,functionName:R.functionName,args:R.args}):R.data;return{data:R.dataSuffix&&w?(0,a.concat)([w,R.dataSuffix]):w,to:R.to,value:R.value?(0,c.numberToHex)(R.value):void 0}});try{const E=await f.request({method:"wallet_sendCalls",params:[{atomicRequired:I,calls:_,capabilities:g,chainId:(0,c.numberToHex)(v.id),from:i?.address,id:h,version:j}]},{retryCount:0});return typeof E=="string"?{id:E}:E}catch(E){const R=E;if(p&&(R.name==="MethodNotFoundRpcError"||R.name==="MethodNotSupportedRpcError"||R.name==="UnknownRpcError"||R.details.toLowerCase().includes("does not exist / is not available")||R.details.toLowerCase().includes("missing or invalid. request()")||R.details.toLowerCase().includes("did not match any variant of untagged enum")||R.details.toLowerCase().includes("account upgraded to unsupported contract")||R.details.toLowerCase().includes("eip-7702 not supported")||R.details.toLowerCase().includes("unsupported wc_ method")||R.details.toLowerCase().includes("feature toggled misconfigured")||R.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(g&&Object.values(g).some(B=>!B.optional)){const B="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new r.UnsupportedNonOptionalCapabilityError(new n.BaseError(B,{details:B}))}if(I&&_.length>1){const C="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new r.AtomicityNotSupportedError(new n.BaseError(C,{details:C}))}const w=[];for(const C of _){const B=(0,d.sendTransaction)(f,{account:i,chain:v,data:C.data,to:C.to,value:C.value?(0,o.hexToBigInt)(C.value):void 0});w.push(B),O>0&&await new Promise(H=>setTimeout(H,O))}const y=await Promise.allSettled(w);if(y.every(C=>C.status==="rejected"))throw y[0].reason;const x=y.map(C=>C.status==="fulfilled"?C.value:e.fallbackTransactionErrorMagicIdentifier);return{id:(0,a.concat)([...x,(0,c.numberToHex)(v.id,{size:32}),e.fallbackMagicIdentifier])}}throw(0,u.getTransactionError)(E,{...b,account:i,chain:b.chain})}}})($d)),$d}var fh;function n_(){if(fh)return ea;fh=1,Object.defineProperty(ea,"__esModule",{value:!0}),ea.getCallsStatus=a;const e=vt(),t=er(),n=Ne(),r=li(),s=Vf();async function a(o,c){async function u(O){if(O.endsWith(s.fallbackMagicIdentifier.slice(2))){const h=(0,t.trim)((0,e.sliceHex)(O,-64,-32)),j=(0,e.sliceHex)(O,0,-64).slice(2).match(/.{1,64}/g),i=await Promise.all(j.map(_=>s.fallbackTransactionErrorMagicIdentifier.slice(2)!==_?o.request({method:"eth_getTransactionReceipt",params:[`0x${_}`]},{dedupe:!0}):void 0)),g=i.some(_=>_===null)?100:i.every(_=>_?.status==="0x1")?200:i.every(_=>_?.status==="0x0")?500:600;return{atomic:!1,chainId:(0,n.hexToNumber)(h),receipts:i.filter(
44Boolean),status:g,version:"2.0.0"}}return o.request({method:"wallet_getCallsStatus",params:[O]})}const{atomic:d=!1,chainId:l,receipts:f,version:b="2.0.0",...T}=await u(c.id),[v,p]=(()=>{const O=T.status;return O>=100&&O<200?["pending",O]:O>=200&&O<300?["success",O]:O>=300&&O<700?["failure",O]:O==="CONFIRMED"?["success",200]:O==="PENDING"?["pending",100]:[void 0,O]})();return{...T,atomic:d,chainId:l?(0,n.hexToNumber)(l):void 0,receipts:f?.map(O=>({...O,blockNumber:(0,n.hexToBigInt)(O.blockNumber),gasUsed:(0,n.hexToBigInt)(O.gasUsed),status:r.receiptStatuses[O.status]}))??[],statusCode:p,status:v,version:b}}return ea}var lh;function Wf(){if(lh)return pn;lh=1,Object.defineProperty(pn,"__esModule",{value:!0}),pn.WaitForCallsStatusTimeoutError=void 0,pn.waitForCallsStatus=d;const e=fe(),t=r_(),n=ge(),r=nn(),s=Cn(),a=Mf(),o=id(),c=Ve(),u=n_();async function d(f,b){const{id:T,pollingInterval:v=f.pollingInterval,status:p=({statusCode:y})=>y===200||y>=300,retryCount:O=4,retryDelay:I=({count:y})=>~~(1<<y)*200,timeout:h=6e4,throwOnFailure:j=!1}=b,i=(0,c.stringify)(["waitForCallsStatus",f.uid,T]),{promise:g,resolve:_,reject:E}=(0,a.withResolvers)();let R;const w=(0,r.observe)(i,{resolve:_,reject:E},y=>{const x=(0,s.poll)(async()=>{const C=B=>{clearTimeout(R),x(),B(),w()};try{const B=await(0,o.withRetry)(async()=>{const H=await(0,n.getAction)(f,u.getCallsStatus,"getCallsStatus")({id:T});if(j&&H.status==="failure")throw new t.BundleFailedError(H);return H},{retryCount:O,delay:I});if(!p(B))return;C(()=>y.resolve(B))}catch(B){C(()=>y.reject(B))}},{interval:v,emitOnBegin:!0});return x});return R=h?setTimeout(()=>{w(),clearTimeout(R),E(new l({id:T}))},h):void 0,await g}class l extends e.BaseError{constructor({id:b}){super(`Timed out while waiting for call bundle with id "${b}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}return pn.WaitForCallsStatusTimeoutError=l,pn}var Bo={},ta={},bh;function o_(){if(bh)return ta;bh=1,Object.defineProperty(ta,"__esModule",{value:!0}),ta.uid=r;const e=256;let t=e,n;function r(s=11){if(!n||t+s>e*2){n="",t=0;for(let a=0;a<e;a++)n+=(256+Math.random()*256|0).toString(16).substring(1)}return n.substring(t,t+++s)}return ta}var mh;
44function sd(){if(mh)return Bo;mh=1,Object.defineProperty(Bo,"__esModule",{value:!0}),Bo.createClient=n,Bo.rpcSchema=r;const e=He(),t=o_();function n(s){const{batch:a,chain:o,ccipRead:c,dataSuffix:u,key:d="base",name:l="Base Client",type:f="base"}=s,b=s.experimental_blockTag??(typeof o?.experimental_preconfirmationTime=="number"?"pending":void 0),T=o?.blockTime??12e3,v=Math.min(Math.max(Math.floor(T/2),500),4e3),p=s.pollingInterval??v,O=s.cacheTime??p,I=s.account?(0,e.parseAccount)(s.account):void 0,{config:h,request:j,value:i}=s.transport({account:I,chain:o,pollingInterval:p}),g={...h,...i},_={account:I,batch:a,cacheTime:O,ccipRead:c,chain:o,dataSuffix:u,key:d,name:l,pollingInterval:p,request:j,transport:g,type:f,uid:(0,t.uid)(),...b?{experimental_blockTag:b}:{}};function E(R){return w=>{const y=w(R);for(const C in _)delete y[C];const x={...R,...y};return Object.assign(x,{extend:E(x)})}}return Object.assign(_,{extend:E(_)})}function r(){return null}return Bo}var ra={},na={},oa={},ia={},hh;function Kf(){if(hh)return ia;hh=1,Object.defineProperty(ia,"__esModule",{value:!0}),ia.isNullUniversalResolverError=n;const e=fe(),t=pr();function n(r){if(!(r instanceof e.BaseError))return!1;const s=r.walk(a=>a instanceof t.ContractFunctionRevertedError);return s instanceof t.ContractFunctionRevertedError?s.data?.errorName==="HttpError"||s.data?.errorName==="ResolverError"||s.data?.errorName==="ResolverNotContract"||s.data?.errorName==="ResolverNotFound"||s.data?.errorName==="ReverseAddressMismatch"||s.data?.errorName==="UnsupportedResolverProfile":!1}return ia}var sa={},aa={},yh;function i_(){if(yh)return aa;yh=1,Object.defineProperty(aa,"__esModule",{value:!0}),aa.encodedLabelToLabelhash=t;const e=nt();function t(n){if(n.length!==66||n.indexOf("[")!==0||n.indexOf("]")!==65)return null;const r=`0x${n.slice(1,65)}`;return(0,e.isHex)(r)?r:null}return aa}var gh;function Zf(){if(gh)return sa;gh=1,Object.defineProperty(sa,"__esModule",{value:!0}),sa.namehash=a;const e=Le(),t=Pe(),n=ie(),r=ct(),s=i_();function a(o){let c=new Uint8Array(32).fill(0);if(!o)return(0,n.bytesToHex)(c);const u=o.split(".");for(let d=u.length-1;d>=0;d-=1){const l=(0,s.encodedLabelToLabelhash)(u[d]),f=l?(0,t.toBytes)(l):(0,r.keccak256)((0,t.stringToBytes)(u[d]),"bytes");c=(0,r.keccak256)((0,e.concat)([c,f]),"bytes")}return(0,n.bytesToHex)(c)}return sa}var ca={},ua={},ph;function M6(){if(ph)return ua;ph=1,Object.defineProperty(ua,"__esModule",{value:!0}),ua.encodeLabelhash=e;function e(t){return`[${t.slice(2)}]`}return ua}var da={},_h;function s_(){if(_h)return da;_h=1,Object.defineProperty(da,"__esModule",{value:!0}),da.labelhash=s;const e=Pe(),t=ie(),n=ct(),r=i_();function s(a){const o=new Uint8Array(32).fill(0);return a?(0,r.encodedLabelToLabelhash)(a)||(0,n.keccak256)((0,e.stringToBytes)(a)):(0,t.bytesToHex)(o)}return da}var vh;function Yf(){if(vh)return ca;vh=1,Object.defineProperty(ca,"__esModule",{value:!0}),ca.packetToBytes=r;const e=Pe(),t=M6(),n=s_();function r(s){const a=s.replace(/^\.|\.$/gm,"");if(a.length===0)return new Uint8Array(1);const o=new Uint8Array((0,e.stringToBytes)(a).byteLength+2);let c=0;const u=a.split(".");for(let d=0;d<u.length;d++){let l=(0,e.stringToBytes)(u[d]);l.byteLength>255&&(l=(0,e.stringToBytes)((0,t.encodeLabelhash)((0,n.labelhash)(u[d])))),o[c]=l.length,o.set(l,c+1),c+=l.length+1}return o.byteLength!==c+1?o.slice(0,c+1):o}return ca}var Eh;function k6(){if(Eh)return oa;Eh=1,Object.defineProperty(oa,"__esModule",{value:!0}),oa.getEnsAddress=b;const e=or(),t=Mt(),n=ot(),r=Pr(),s=er(),a=ie(),o=Kf(),c=td(),u=Zf(),d=Yf(),l=ge(),f=Nt();async function b(T,v){const{blockNumber:p,blockTag:O,coinType:I,name:h,gatewayUrls:j,strict:i}=v,{chain:g}=T,_=(()=>{if(v.universalResolverAddress)return v.universalResolverAddress;if(!g)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,r.getChainContractAddress)({blockNumber:p,chain:g,contract:"ensUniversalResolver"})})(),E=g?.ensTlds;if(E&&!E.some(w=>h.endsWith(w)))return null;const R=I!=null?[(0,u.namehash)(h),BigInt(I)]:[(0,u.namehash)(h)];try{const w=(0,n.encodeFunctionData)({abi:e.addressResolverAbi,functionName:"addr",args:R}),y={address:_,abi:e.universalResolverResolveAbi,functionName:"resolveWithGateways",args:[(0,a.toHex)((0,d.packetToBytes)(h)),w,j??[c.localBatchGatewayUrl]],blockNumber:p,blockTag:O},C=await(0,l.getAction)(T,f.readContract,"readContract")(y);if(C[0]==="0x")return null;const B=(0,t.decodeFunctionResult)({abi:e.addressResolverAbi,args:R,functionName:"addr",data:C[0]});return B==="0x"||(0,s.trim)(B)==="0x00"?null:B}catch(w){if(i)throw w;if((0,o.isNullUniversalResolverError)(w))return null;throw w}}return oa}var fa={},la={},Pt={},mt={},wh;
44function Jf(){if(wh)return mt;wh=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.EnsInvalidChainIdError=mt.EnsAvatarUnsupportedNamespaceError=mt.EnsAvatarUriResolutionError=mt.EnsAvatarInvalidNftUriError=mt.EnsAvatarInvalidMetadataError=void 0;const e=fe();class t extends e.BaseError{constructor({data:c}){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(c)}`],name:"EnsAvatarInvalidMetadataError"})}}mt.EnsAvatarInvalidMetadataError=t;class n extends e.BaseError{constructor({reason:c}){super(`ENS NFT avatar URI is invalid. ${c}`,{name:"EnsAvatarInvalidNftUriError"})}}mt.EnsAvatarInvalidNftUriError=n;class r extends e.BaseError{constructor({uri:c}){super(`Unable to resolve ENS avatar URI "${c}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}mt.EnsAvatarUriResolutionError=r;class s extends e.BaseError{constructor({namespace:c}){super(`ENS NFT avatar namespace "${c}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}mt.EnsAvatarUnsupportedNamespaceError=s;class a extends e.BaseError{constructor({chainId:c}){super(`Invalid ENSIP-11 chainId: ${c}. Must be between 0 and 0x7fffffff, or 1.`,{name:"EnsInvalidChainIdError"})}}return mt.EnsInvalidChainIdError=a,mt}var jh;function N6(){if(jh)return Pt;jh=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.isImageUri=o,Pt.getGateway=c,Pt.resolveAvatarUri=u,Pt.getJsonImage=d,Pt.getMetadataAvatarUri=l,Pt.parseAvatarUri=f,Pt.parseNftUri=b,Pt.getNftTokenUri=T;const e=Nt(),t=Jf(),n=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,r=/^(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>\/.*)?$/,s=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,a=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function o(v){try{const p=await fetch(v,{method:"HEAD"});return p.status===200?p.headers.get("content-type")?.startsWith("image/"):!1}catch(p){return typeof p=="object"&&typeof p.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(O=>{const I=new Image;I.onload=()=>{O(!0)},I.onerror=()=>{O(!1)},I.src=v})}}function c(v,p){return v?v.endsWith("/")?v.slice(0,-1):v:p}function u({uri:v,gatewayUrls:p}){const O=s.test(v);if(O)return{uri:v,isOnChain:!0,isEncoded:O};const I=c(p?.ipfs,"https://ipfs.io"),h=c(p?.arweave,"https://arweave.net"),j=v.match(n),{protocol:i,subpath:g,target:_,subtarget:E=""}=j?.groups||{},R=i==="ipns:/"||g==="ipns/",w=i==="ipfs:/"||g==="ipfs/"||r.test(v);if(v.startsWith("http")&&!R&&!w){let x=v;return p?.arweave&&(x=v.replace(/https:\/\/arweave.net/g,p?.arweave)),{uri:x,isOnChain:!1,isEncoded:!1}}if((R||w)&&_)return{uri:`${I}/${R?"ipns":"ipfs"}/${_}${E}`,isOnChain:!1,isEncoded:!1};if(i==="ar:/"&&_)return{uri:`${h}/${_}${E||""}`,isOnChain:!1,isEncoded:!1};let y=v.replace(a,"");if(y.startsWith("<svg")&&(y=`data:image/svg+xml;base64,${btoa(y)}`),y.startsWith("data:")||y.startsWith("{"))return{uri:y,isOnChain:!0,isEncoded:!1};throw new t.EnsAvatarUriResolutionError({uri:v})}function d(v){if(typeof v!="object"||!("image"in v)&&!("image_url"in v)&&!("image_data"in v))throw new t.EnsAvatarInvalidMetadataError({data:v});return v.image||v.image_url||v.image_data}async function l({gatewayUrls:v,uri:p}){try{const O=await fetch(p).then(h=>h.json());return await f({gatewayUrls:v,uri:d(O)})}catch{throw new t.EnsAvatarUriResolutionError({uri:p})}}async function f({gatewayUrls:v,uri:p}){const{uri:O,isOnChain:I}=u({uri:p,gatewayUrls:v});if(I||await o(O))return O;throw new t.EnsAvatarUriResolutionError({uri:p})}function b(v){let p=v;p.startsWith("did:nft:")&&(p=p.replace("did:nft:","").replace(/_/g,"/"));const[O,I,h]=p.split("/"),[j,i]=O.split(":"),[g,_]=I.split(":");if(!j||j.toLowerCase()!=="eip155")throw new t.EnsAvatarInvalidNftUriError({reason:"Only EIP-155 supported"});if(!i)throw new t.EnsAvatarInvalidNftUriError({reason:"Chain ID not found"});if(!_)throw new t.EnsAvatarInvalidNftUriError({reason:"Contract address not found"});if(!h)throw new t.EnsAvatarInvalidNftUriError({reason:"Token ID not found"});if(!g)throw new t.EnsAvatarInvalidNftUriError({reason:"ERC namespace not found"});return{chainID:Number.parseInt(i,10),namespace:g.toLowerCase(),contractAddress:_,tokenID:h}}async function T(v,{nft:p}){if(p.namespace==="erc721")return(0,e.readContract)(v,{address:p.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(p.tokenID)]});if(p.namespace==="erc1155")return(0,e.readContract)(v,{address:p.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(p.tokenID)]});throw new t.EnsAvatarUnsupportedNamespaceError({namespace:p.namespace})}return Pt}var Ph;function F6(){if(Ph)return la;Ph=1,Object.defineProperty(la,"__esModule",{value:!0}),la.parseAvatarRecord=t;const e=N6();async function t(r,{gatewayUrls:s,record:a}){return/eip155:/i.test(a)?n(r,{gatewayUrls:s,record:a}):(0,e.parseAvatarUri)({uri:a,gatewayUrls:s})}async function n(r,{gatewayUrls:s,record:a}){const o=(0,e.parseNftUri)(a),c=await(0,e.getNftTokenUri)(r,{nft:o}),{uri:u,isOnChain:d,isEncoded:l}=(0,e.resolveAvatarUri)({uri:c,gatewayUrls:s});if(d&&(u.includes("data:application/json;base64,")||u.startsWith("{"))){const b=l?atob(u.replace("data:application/json;base64,","")):u,T=JSON.parse(b);return(0,e.parseAvatarUri)({uri:(0,e.getJsonImage)(T),gatewayUrls:s})}let f=o.tokenID;return o.namespace==="erc1155"&&(f=f.replace("0x","").padStart(64,"0")),(0,e.getMetadataAvatarUri)({gatewayUrls:s,uri:u.replace(/(?:0x)?{id}/,f)})}return la}var ba={},Ah;function a_(){if(Ah)return ba;Ah=1,Object.defineProperty(ba,"__esModule",{value:!0}),ba.getEnsText=f;const e=or(),t=Mt(),n=ot(),r=Pr(),s=ie(),a=Kf(),o=td(),c=Zf(),u=Yf(),d=ge(),l=Nt();async function f(b,T){const{blockNumber:v,blockTag:p,key:O,name:I,gatewayUrls:h,strict:j}=T,{chain:i}=b,g=(()=>
44{if(T.universalResolverAddress)return T.universalResolverAddress;if(!i)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,r.getChainContractAddress)({blockNumber:v,chain:i,contract:"ensUniversalResolver"})})(),_=i?.ensTlds;if(_&&!_.some(E=>I.endsWith(E)))return null;try{const E={address:g,abi:e.universalResolverResolveAbi,args:[(0,s.toHex)((0,u.packetToBytes)(I)),(0,n.encodeFunctionData)({abi:e.textResolverAbi,functionName:"text",args:[(0,c.namehash)(I),O]}),h??[o.localBatchGatewayUrl]],functionName:"resolveWithGateways",blockNumber:v,blockTag:p},w=await(0,d.getAction)(b,l.readContract,"readContract")(E);if(w[0]==="0x")return null;const y=(0,t.decodeFunctionResult)({abi:e.textResolverAbi,functionName:"text",data:w[0]});return y===""?null:y}catch(E){if(j)throw E;if((0,a.isNullUniversalResolverError)(E))return null;throw E}}return ba}var Th;function L6(){if(Th)return fa;Th=1,Object.defineProperty(fa,"__esModule",{value:!0}),fa.getEnsAvatar=r;const e=F6(),t=ge(),n=a_();async function r(s,{blockNumber:a,blockTag:o,assetGatewayUrls:c,name:u,gatewayUrls:d,str
44ict:l,universalResolverAddress:f}){const b=await(0,t.getAction)(s,n.getEnsText,"getEnsText")({blockNumber:a,blockTag:o,key:"avatar",name:u,universalResolverAddress:f,gatewayUrls:d,strict:l});if(!b)return null;try{return await(0,e.parseAvatarRecord)(s,{record:b,gatewayUrls:c})}catch{return null}}return fa}var ma={},Sh;function U6(){if(Sh)return ma;Sh=1,Object.defineProperty(ma,"__esModule",{value:!0}),ma.getEnsName=o;const e=or(),t=Pr(),n=Kf(),r=td(),s=ge(),a=Nt();async function o(c,u){const{address:d,blockNumber:l,blockTag:f,coinType:b=60n,gatewayUrls:T,strict:v}=u,{chain:p}=c,O=(()=>{if(u.universalResolverAddress)return u.universalResolverAddress;if(!p)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,t.getChainContractAddress)({blockNumber:l,chain:p,contract:"ensUniversalResolver"})})();try{const I={address:O,abi:e.universalResolverReverseAbi,args:[d,b,T??[r.localBatchGatewayUrl]],functionName:"reverseWithGateways",blockNumber:l,blockTag:f},h=(0,s.getAction)(c,a.readContract,"readContract"),[j]=await h(I);return j||null}catch(I){if(v)throw I;if((0,n.isNullUniversalResolverError)(I))return null;throw I}}return ma}var ha={},Ih;function z6(){if(Ih)return ha;Ih=1,Object.defineProperty(ha,"__esModule",{value:!0}),ha.getEnsResolver=a;const e=Pr(),t=ie(),n=Yf(),r=ge(),s=Nt();async function a(o,c){const{blockNumber:u,blockTag:d,name:l}=c,{chain:f}=o,b=(()=>{if(c.universalResolverAddress)return c.universalResolverAddress;if(!f)throw new Error("client chain not configured. universalResolverAddress is required.");return(0,e.getChainContractAddress)({blockNumber:u,chain:f,contract:"ensUniversalResolver"})})(),T=f?.ensTlds;if(T&&!T.some(p=>l.endsWith(p)))throw new Error(`${l} is not a valid ENS TLD (${T?.join(", ")}) for chain "${f.name}" (id: ${f.id}).`);const[v]=await(0,r.getAction)(o,s.readContract,"readContract")({address:b,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[(0,t.toHex)((0,n.packetToBytes)(l))],blockNumber:u,blockTag:d});return v}return ha}var ya={},Bh;function c_(){if(Bh)return ya;Bh=1,Object.defineProperty(ya,"__esModule",{value:!0}),ya.createAccessList=o;const e=He(),t=ie(),n=Hf(),r=wr(),s=xt(),a=Rt();async function o(c,u){const{account:d=c.account,blockNumber:l,blockTag:f="latest",blobs:b,data:T,gas:v,gasPrice:p,maxFeePerBlobGas:O,maxFeePerGas:I,maxPriorityFeePerGas:h,to:j,value:i,...g}=u,_=d?(0,e.parseAccount)(d):void 0;try{(0,a.assertRequest)(u);const R=(typeof l=="bigint"?(0,t.numberToHex)(l):void 0)||f,w=c.chain?.formatters?.transactionRequest?.format,x=(w||s.formatTransactionRequest)({...(0,r.extract)(g,{format:w}),account:_,blobs:b,data:T,gas:v,gasPrice:p,maxFeePerBlobGas:O,maxFeePerGas:I,maxPriorityFeePerGas:h,to:j,value:i},"createAccessList"),C=await c.request({method:"eth_createAccessList",params:[x,R]});return{accessList:C.accessList,gasUsed:BigInt(C.gasUsed)}}catch(E){throw(0,n.getCallError)(E,{...u,account:_,chain:c.chain})}}return ya}var ga={},xh;function D6(){if(xh)return ga;xh=1,Object.defineProperty(ga,"__esModule",{value:!0}),ga.createBlockFilter=t;const e=Gu();async function t(n){const r=(0,e.createFilterRequestScope)(n,{method:"eth_newBlockFilter"}),s=await n.request({method:"eth_newBlockFilter"});return{id:s,request:r(s),type:"block"}}return ga}var pa={},Rh;function u_(){if(Rh)return pa;Rh=1,Object.defineProperty(pa,"__esModule",{value:!0}),pa.createEventFilter=r;const e=$r(),t=ie(),n=Gu();async function r(s,{address:a,args:o,event:c,events:u,fromBlock:d,strict:l,toBlock:f}={}){const b=u??(c?[c]:void 0),T=(0,n.createFilterRequestScope)(s,{method:"eth_newFilter"});let v=[];b&&(v=[b.flatMap(I=>(0,e.encodeEventTopics)({abi:[I],eventName:I.name,args:o}))],c&&(v=v[0]));const p=await s.request({method:"eth_newFilter",params:[{address:a,fromBlock:typeof d=="bigint"?(0,t.numberToHex)(d):d,toBlock:typeof f=="bigint"?(0,t.numberToHex)(f):f,...v.length?{topics:v}:{}}]});return{abi:b,args:o,eventName:c?c.name:void 0,fromBlock:d,id:p,request:T(p),strict:!!l,toBlock:f,type:"event"}}return pa}var _a={},Oh;function d_(){if(Oh)return _a;Oh=1,Object.defineProperty(_a,"__esModule",{value:!0}),_a.createPendingTransactionFilter=t;const e=Gu();async function t(n){const r=(0,e.createFilterRequestScope)(n,{method:"eth_newPendingTransactionFilter"}),s=await n.request({method:"eth_newPendingTransactionFilter"});return{id:s,request:r(s),type:"transaction"}}return _a}var va={},Ch;function G6(){if(Ch)return va;Ch=1,Object.defineProperty(va,"__esModule",{value:!0}),va.getBalance=o;const e=or(),t=Mt(),n=ot(),r=ie(),s=ge(),a=On();async function o(c,{address:u,blockNumber:d,blockTag:l=c.experimental_blockTag??"latest"}){if(c.batch?.multicall&&c.chain?.contracts?.multicall3){const T=c.chain.contracts.multicall3.address,v=(0,n.encodeFunctionData)({abi:e.multicall3Abi,functionName:"getEthBalance",args:[u]}),{data:p}=await(0,s.getAction)(c,a.call,"call")({to:T,data:v,blockNumber:d,blockTag:l});return(0,t.decodeFunctionResult)({abi:e.multicall3Abi,functionName:"getEthBalance",args:[u],data:p||"0x"})}const f=typeof d=="bigint"?(0,r.numberToHex)(d):void 0,b=await c.request({method:"eth_getBalance",params:[u,f||l]});return BigInt(b)}return va}var Ea={},qh;function V6(){if(qh)return Ea;qh=1,Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.getBlobBaseFee=e;async function e(t){const n=await t.request({method:"eth_blobBaseFee"});return BigInt(n)}return Ea}var wa={},Hh;function W6(){if(Hh)return wa;Hh=1,Object.defineProperty(wa,"__esModule",{value:!0}),wa.getBlockTransactionCount=n;const e=Ne(),t=ie();async function n(r,{blockHash:s,blockNumber:a,blockTag:o="latest"}={}){const c=a!==void 0?(0,t.numberToHex)(a):void 0;let u;return s?u=await r.request({method:"eth_getBlockTransactionCountByHash",params:[s]},{dedupe:!0}):u=await r.request({method:"eth_getBlockTransactionCountByNumber",params:[c||o]},{dedupe:!!c}),(0,e.hexToNumber)(u)}return wa}var ja={},Mh;function f_(){if(Mh)return ja;Mh=1,Object.defineProperty(ja,"__esModule",{value:!0}),ja.getCode=t;const e=ie();async function t(n,{address:r,blockNumber:s,blockTag:a="latest"}){const o=s!==void 0?(0,e.numberToHex)(s):void 0,c=await n.request({method:"eth_getCode",params:[r,o||a]},{dedupe:!!o});if(c!=="0x")return c}return ja}var Pa={},xo={},kh;function K6(){if(kh)return xo;kh=1,Object.defineProperty(xo,"__esModule",{value:!0}),xo.Eip712DomainNotFoundError=void 0;const e=fe();class t extends e.BaseError{constructor({address:r}){super(`No EIP-712 domain found on contract "${r}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${r}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}return xo.Eip712DomainNotFoundError=t,xo}var Nh;function Z6(){if(Nh)return Pa;Nh=1,Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.getEip712Domain=r;const e=K6(),t=ge(),n=Nt();async function r(a,o){const{address:c,factory:u,factoryData:d}=o;try{const[l,f,b,T,v,p,O]=await(0,t.getAction)(a,n.readContract,"readContract")({abi:s,address:c,functionName:"eip712Domain",factory:u,factoryData:d});return{domain:{name:f,version:b,chainId:Number(T),verifyingContract:v,salt:p},extensions:O,fields:l}}catch(l){const f=l;throw f.name==="ContractFunctionExecutionError"&&f.cause.name==="ContractFunctionZeroDataError"?new e.Eip712DomainNotFoundError({address:c}):f}}const s=[{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"}];return Pa}var Aa={},Ta={},Fh;function Y6(){if(Fh)return Ta;Fh=1,Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.formatFeeHistory=e;function e(t){return{baseFeePerGas:t.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:t.gasUsedRatio,oldestBlock:BigInt(t.oldestBlock),reward:t.reward?.map(n=>n.map(r=>BigInt(r)))}}return Ta}var Lh;function J6(){if(Lh)return Aa;Lh=1,Object.defineProperty(Aa,"__esModule",{value:!0}),Aa.getFeeHistory=n;const e=ie(),t=Y6();async function n(r,{blockCount:s,blockNumber:a,blockTag:o="latest",rewardPercentiles:c}){const u=typeof a=="bigint"?(0,e.numberToHex)(a):void 0,d=await r.request({method:"eth_feeHistory",params:[(0,e.numberToHex)(s),u||o,c]},{dedupe:!!u});return(0,t.formatFeeHistory)(d)}return Aa}var Sa={},Uh;function X6(){if(Uh)return Sa;Uh=1,Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.getFilterLogs=n;const e=si(),t=nr();async function n(r,{filter:s}){const a=s.strict??!1,c=(await s.request({method:"eth_getFilterLogs",params:[s.id]})).map(u=>(0,t.formatLog)(u));return s.abi?(0,e.parseEventLogs)({abi:s.abi,logs:c,strict:a}):c}return Sa}var Ia={},Ba={},ef={},xa={},zh;function l_(){if(zh)return xa;zh=1,Object.defineProperty(xa,"__esModule",{value:!0}),xa.encodePacked=c;const e=qe(),t=St(),n=ut(),r=Le(),s=hr(),a=ie(),o=Du();function c(d,l){if(d.length!==l.length)throw new e.AbiEncodingLengthMismatchError({expectedLength:d.length,givenLength:l.length});const f=[];for(let b=0;b<d.length;b++){const T=d[b],v=l[b];f.push(u(T,v))}return(0,r.concatHex)(f)}
44function u(d,l,f=!1){if(d==="address"){const p=l;if(!(0,n.isAddress)(p))throw new t.InvalidAddressError({address:p});return(0,s.pad)(p.toLowerCase(),{size:f?32:null})}if(d==="string")return(0,a.stringToHex)(l);if(d==="bytes")return l;if(d==="bool")return(0,s.pad)((0,a.boolToHex)(l),{size:f?32:1});const b=d.match(o.integerRegex);if(b){const[p,O,I="256"]=b,h=Number.parseInt(I,10)/8;return(0,a.numberToHex)(l,{size:f?32:h,signed:O==="int"})}const T=d.match(o.bytesRegex);if(T){const[p,O]=T;if(Number.parseInt(O,10)!==(l.length-2)/2)throw new e.BytesSizeMismatchError({expectedSize:Number.parseInt(O,10),givenSize:(l.length-2)/2});return(0,s.pad)(l,{dir:"right",size:f?32:null})}const v=d.match(o.arrayRegex);if(v&&Array.isArray(l)){const[p,O]=v,I=[];for(let h=0;h<l.length;h++)I.push(u(O,l[h],!0));return I.length===0?"0x":(0,r.concatHex)(I)}throw new e.UnsupportedPackedAbiType(d)}return xa}var _n={},Ra={},Dh;function Xf(){if(Dh)return Ra;Dh=1,Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.isBytes=e;function e(t){return!t||typeof t!="object"||!("BYTES_PER_ELEMENT"in t)?!1:t.BYTES_PER_ELEMENT===1&&t.constructor.name==="Uint8Array"}return Ra}var Gh;function b_(){if(Gh)return _n;Gh=1,Object.defineProperty(_n,"__esModule",{value:!0}),_n.getContractAddress=u,_n.getCreateAddress=d,_n.getCreate2Address=l;const e=Le(),t=Xf(),n=hr(),r=vt(),s=Pe(),a=Qo(),o=ct(),c=yt();function u(f){return f.opcode==="CREATE2"?l(f):d(f)}function d(f){const b=(0,s.toBytes)((0,c.getAddress)(f.from));let T=(0,s.toBytes)(f.nonce);return T[0]===0&&(T=new Uint8Array([])),(0,c.getAddress)(`0x${(0,o.keccak256)((0,a.toRlp)([b,T],"bytes")).slice(26)}`)}function l(f){const b=(0,s.toBytes)((0,c.getAddress)(f.from)),T=(0,n.pad)((0,t.isBytes)(f.salt)?f.salt:(0,s.toBytes)(f.salt),{size:32}),v="bytecodeHash"in f?(0,t.isBytes)(f.bytecodeHash)?f.bytecodeHash:(0,s.toBytes)(f.bytecodeHash):(0,o.keccak256)(f.bytecode,"bytes");return(0,c.getAddress)((0,r.slice)((0,o.keccak256)((0,e.concat)([(0,s.toBytes)("0xff"),b,T,v])),12))}return _n}var Oa={},Ro={},dr={},Vh;function ad(){if(Vh)return dr;Vh=1,Object.defineProperty(dr,"__esModule",{value:!0}),dr.assertTransactionEIP7702=f,dr.assertTransactionEIP4844=b,dr.assertTransactionEIP1559=T,dr.assertTransactionEIP2930=v,dr.assertTransactionLegacy=p;const e=Wp(),t=Af(),n=St(),r=fe(),s=Kp(),a=ci(),o=rr(),c=ut(),u=at(),d=vt(),l=Ne();function f(O){const{authorizationList:I}=O;if(I)for(const h of I){const{chainId:j}=h,i=h.address;if(!(0,c.isAddress)(i))throw new n.InvalidAddressError({address:i});if(j<0)throw new a.InvalidChainIdError({chainId:j})}T(O)}function b(O){const{blobVersionedHashes:I}=O;if(I){if(I.length===0)throw new s.EmptyBlobError;for(const h of I){const j=(0,u.size)(h),i=(0,l.hexToNumber)((0,d.slice)(h,0,1));if(j!==32)throw new s.InvalidVersionedHashSizeError({hash:h,size:j});if(i!==e.versionedHashVersionKzg)throw new s.InvalidVersionedHashVersionError({hash:h,version:i})}}T(O)}function T(O){const{chainId:I,maxPriorityFeePerGas:h,maxFeePerGas:j,to:i}=O;if(I<=0)throw new a.InvalidChainIdError({chainId:I});if(i&&!(0,c.isAddress)(i))throw new n.InvalidAddressError({address:i});if(j&&j>t.maxUint256)throw new o.FeeCapTooHighError({maxFeePerGas:j});if(h&&j&&h>j)throw new o.TipAboveFeeCapError({maxFeePerGas:j,maxPriorityFeePerGas:h})}function v(O){const{chainId:I,maxPriorityFeePerGas:h,gasPrice:j,maxFeePerGas:i,to:g}=O;if(I<=0)throw new a.InvalidChainIdError({chainId:I});if(g&&!(0,c.isAddress)(g))throw new n.InvalidAddressError({address:g});if(h||i)throw new r.BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(j&&j>t.maxUint256)throw new o.FeeCapTooHighError({maxFeePerGas:j})}function p(O){const{chainId:I,maxPriorityFeePerGas:h,gasPrice:j,maxFeePerGas:i,to:g}=O;if(g&&!(0,c.isAddress)(g))throw new n.InvalidAddressError({address:g});if(typeof I<"u"&&I<=0)throw new a.InvalidChainIdError({chainId:I});if(h||i)throw new r.BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(j&&j>t.maxUint256)throw new o.FeeCapTooHighError({maxFeePerGas:j})}return dr}var Ca={},Wh;function Qf(){if(Wh)return Ca;Wh=1,Object.defineProperty(Ca,"__esModule",{value:!0}),Ca.serializeAccessList=r;const e=St(),t=dt(),n=ut();function r(s){if(!s||s.length===0)return[];const a=[];for(let o=0;o<s.length;o++){const{address:c,storageKeys:u}=s[o];for(let d=0;d<u.length;d++)if(u[d].length-2!==64)throw new t.InvalidStorageKeySizeError({storageKey:u[d]});if(!(0,n.isAddress)(c,{strict:!1}))throw new e.InvalidAddressError({address:c});a.push([c,u])}return a}return Ca}var Kh;function cd(){if(Kh)return Ro;Kh=1,Object.defineProperty(Ro,"__esModule",{value:!0}),Ro.serializeTransaction=T,Ro.toYParitySignatureArray=j;const e=dt(),t=m_(),n=Ju(),r=Xu(),s=xf(),a=Qu(),o=Le(),c=er(),u=ie(),d=Qo(),l=ad(),f=$u(),b=Qf();function T(i,g){const _=(0,f.getTransactionType)(i);return _==="eip1559"?O(i,g):_==="eip2930"?I(i,g):_==="eip4844"?p(i,g):_==="eip7702"?v(i,g):h(i,g)}function v(i,g){const{authorizationList:_,chainId:E,gas:R,nonce:w,to:y,value:x,maxFeePerGas:C,maxPriorityFeePerGas:B,accessList:H,data:F}=i;(0,l.assertTransactionEIP7702)(i);const k=(0,b.serializeAccessList)(H),m=(0,t.serializeAuthorizationList)(_);return(0,o.concatHex)(["0x04",(0,d.toRlp)([(0,u.numberToHex)(E),w?(0,u.numberToHex)(w):"0x",B?(0,u.numberToHex)(B):"0x",C?(0,u.numberToHex)(C):"0x",R?(0,u.numberToHex)(R):"0x",y??"0x",x?(0,u.numberToHex)(x):"0x",F??"0x",k,m,...j(i,g)])])}function p(i,g){const{chainId:_,gas:E,nonce:R,to:w,value:y,maxFeePerBlobGas:x,maxFeePerGas:C,maxPriorityFeePerGas:B,accessList:H,data:F}=i;(0,l.assertTransactionEIP4844)(i);let k=i.blobVersionedHashes,m=i.sidecars;if(i.blobs&&(typeof k>"u"||typeof m>"u")){const N=typeof i.blobs[0]=="string"?i.blobs:i.blobs.map(z=>(0,u.bytesToHex)(z)),U=i.kzg,L=(0,n.blobsToCommitments)({blobs:N,kzg:U});if(typeof k>"u"&&(k=(0,s.commitmentsToVersionedHashes)({commitments:L})),typeof m>"u"){const z=(0,r.blobsToProofs)({blobs:N,commitments:L,kzg:U});m=(0,a.toBlobSidecars)({blobs:N,commitments:L,proofs:z})}}const M=(0,b.serializeAccessList)(H),A=[(0,u.numberToHex)(_),R?(0,u.numberToHex)(R):"0x",B?(0,u.numberToHex)(B):"0x",C?(0,u.numberToHex)(C):"0x",E?(0,u.numberToHex)(E):"0x",w??"0x",y?(0,u.numberToHex)(y):"0x",F??"0x",M,x?(0,u.numberToHex)(x):"0x",k??[],...j(i,g)],P=[],S=[],q=[];if(m)for(let N=0;N<m.length;N++){const{blob:U,commitment:L,proof:z}=m[N];P.push(U),S.push(L),q.push(z)}return(0,o.concatHex)(["0x03",m?(0,d.toRlp)([A,P,S,q]):(0,d.toRlp)(A)])}function O(i,g){const{chainId:_,gas:E,nonce:R,to:w,value:y,maxFeePerGas:x,maxPriorityFeePerGas:C,accessList:B,data:H}=i;(0,l.assertTransactionEIP1559)(i);const F=(0,b.serializeAccessList)(B),k=[(0,u.numberToHex)(_),R?(0,u.numberToHex)(R):"0x",C?(0,u.numberToHex)(C):"0x",x?(0,u.numberToHex)(x):"0x",E?(0,u.numberToHex)(E):"0x",w??"0x",y?(0,u.numberToHex)(y):"0x",H??"0x",F,...j(i,g)];return(0,o.concatHex)(["0x02",(0,d.toRlp)(k)])}function I(i,g){const{chainId:_,gas:E,data:R,nonce:w,to:y,value:x,accessList:C,gasPrice:B}=i;(0,l.assertTransactionEIP2930)(i);const H=(0,b.serializeAccessList)(C),F=[(0,u.numberToHex)(_),w?(0,u.numberToHex)(w):"0x",B?(0,u.numberToHex)(B):"0x",E?(0,u.numberToHex)(E):"0x",y??"0x",x?(0,u.numberToHex)(x):"0x",R??"0x",H,...j(i,g)];return(0,o.concatHex)(["0x01",(0,d.toRlp)(F)])}function h(i,g){const{chainId:_=0,gas:E,data:R,nonce:w,to:y,value:x,gasPrice:C}=i;(0,l.assertTransactionLegacy)(i);let B=[w?(0,u.numberToHex)(w):"0x",C?(0,u.numberToHex)(C):"0x",E?(0,u.numberToHex)(E):"0x",y??"0x",x?(0,u.numberToHex)(x):"0x",R??"0x"];if(g){const H=(()=>
44{if(g.v>=35n)return(g.v-35n)/2n>0?g.v:27n+(g.v===35n?0n:1n);if(_>0)return BigInt(_*2)+BigInt(35n+g.v-27n);const m=27n+(g.v===27n?0n:1n);if(g.v!==m)throw new e.InvalidLegacyVError({v:g.v});return m})(),F=(0,c.trim)(g.r),k=(0,c.trim)(g.s);B=[...B,(0,u.numberToHex)(H),F==="0x00"?"0x":F,k==="0x00"?"0x":k]}else _>0&&(B=[...B,(0,u.numberToHex)(_),"0x","0x"]);return(0,d.toRlp)(B)}function j(i,g){const _=g??i,{v:E,yParity:R}=_;if(typeof _.r>"u")return[];if(typeof _.s>"u")return[];if(typeof E>"u"&&typeof R>"u")return[];const w=(0,c.trim)(_.r),y=(0,c.trim)(_.s);return[typeof R=="number"?R?(0,u.numberToHex)(1):"0x":E===0n?"0x":E===1n?(0,u.numberToHex)(1):E===27n?"0x":(0,u.numberToHex)(1),w==="0x00"?"0x":w,y==="0x00"?"0x":y]}return Ro}var Zh;function m_(){if(Zh)return Oa;Zh=1,Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.serializeAuthorizationList=n;const e=ie(),t=cd();function n(r){if(!r||r.length===0)return[];const s=[];for(const a of r){const{chainId:o,nonce:c,...u}=a,d=a.address;s.push([o?(0,e.toHex)(o):"0x",d,c?(0,e.toHex)(c):"0x",...(0,t.toYParitySignatureArray)({},u)])}return s}return Oa}var qa={},Yh;function h_(){if(Yh)return qa;Yh=1,Object.defineProperty(qa,"__esModule",{value:!0}),qa.verifyAuthorization=r;const e=yt(),t=Ot(),n=$o();async function r({address:s,authorization:a,signature:o}){return(0,t.isAddressEqual)((0,e.getAddress)(s),await(0,n.recoverAuthorizationAddress)({authorization:a,signature:o}))}return qa}var Oo={},tf={},Jh;function Q6(){return Jh||(Jh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.promiseCache=void 0,e.withDedupe=n;const t=Xr();e.promiseCache=new t.LruMap(8192);function n(r,{enabled:s=!0,id:a}){if(!s||!a)return r();if(e.promiseCache.get(a))return e.promiseCache.get(a);const o=r().finally(()=>e.promiseCache.delete(a));return e.promiseCache.set(a,o),o}})(tf)),tf}var Xh;function y_(){if(Xh)return Oo;Xh=1,Object.defineProperty(Oo,"__esModule",{value:!0}),Oo.buildRequest=c,Oo.shouldRetry=u;const e=fe(),t=Bt(),n=_r(),r=ie(),s=Q6(),a=id(),o=Ve();function c(d,l={}){return async(f,b={})=>{const{dedupe:T=!1,methods:v,retryDelay:p=150,retryCount:O=3,uid:I}={...l,...b},{method:h}=f;if(v?.exclude?.includes(h))throw new n.MethodNotSupportedRpcError(new Error("method not supported"),{method:h});if(v?.include&&!v.include.includes(h))throw new n.MethodNotSupportedRpcError(new Error("method not supported"),{method:h});const j=T?(0,r.stringToHex)(`${I}.${(0,o.stringify)(f)}`):void 0;return(0,s.withDedupe)(()=>(0,a.withRetry)(async()=>{try{return await d(f)}catch(i){const g=i;switch(g.code){case n.ParseRpcError.code:throw new n.ParseRpcError(g);case n.InvalidRequestRpcError.code:throw new n.InvalidRequestRpcError(g);case n.MethodNotFoundRpcError.code:throw new n.MethodNotFoundRpcError(g,{method:f.method});case n.InvalidParamsRpcError.code:throw new n.InvalidParamsRpcError(g);case n.InternalRpcError.code:throw new n.InternalRpcError(g);case n.InvalidInputRpcError.code:throw new n.InvalidInputRpcError(g);case n.ResourceNotFoundRpcError.code:throw new n.ResourceNotFoundRpcError(g);case n.ResourceUnavailableRpcError.code:throw new n.ResourceUnavailableRpcError(g);case n.TransactionRejectedRpcError.code:throw new n.TransactionRejectedRpcError(g);case n.MethodNotSupportedRpcError.code:throw new n.MethodNotSupportedRpcError(g,{method:f.method});case n.LimitExceededRpcError.code:throw new n.LimitExceededRpcError(g);case n.JsonRpcVersionUnsupportedError.code:throw new n.JsonRpcVersionUnsupportedError(g);case n.UserRejectedRequestError.code:throw new n.UserRejectedRequestError(g);case n.UnauthorizedProviderError.code:throw new n.UnauthorizedProviderError(g);case n.UnsupportedProviderMethodError.code:throw new n.UnsupportedProviderMethodError(g);case n.ProviderDisconnectedError.code:throw new n.ProviderDisconnectedError(g);case n.ChainDisconnectedError.code:throw new n.ChainDisconnectedError(g);case n.SwitchChainError.code:throw new n.SwitchChainError(g);case n.UnsupportedNonOptionalCapabilityError.code:throw new n.UnsupportedNonOptionalCapabilityError(g);case n.UnsupportedChainIdError.code:throw new n.UnsupportedChainIdError(g);case n.DuplicateIdError.code:throw new n.DuplicateIdError(g);case n.UnknownBundleIdError.code:throw new n.UnknownBundleIdError(g);case n.BundleTooLargeError.code:throw new n.BundleTooLargeError(g);case n.AtomicReadyWalletRejectedUpgradeError.code:throw new n.AtomicReadyWalletRejectedUpgradeError(g);case n.AtomicityNotSupportedError.code:throw new n.AtomicityNotSupportedError(g);case 5e3:throw new n.UserRejectedRequestError(g);case n.WalletConnectSessionSettlementError.code:throw new n.WalletConnectSessionSettlementError(g);default:throw i instanceof e.BaseError?i:new n.UnknownRpcError(g)}}},{delay:({count:i,error:g})=>{if(g&&g instanceof t.HttpRequestError){const _=g?.headers?.get("Retry-After");if(_?.match(/\d/))return Number.parseInt(_,10)*1e3}return~~(1<<i)*p},retryCount:O,shouldRetry:({error:i})=>u(i)}),{enabled:T,id:j})}}function u(d){return"code"in d&&typeof d.code=="number"?d.code===-1||d.code===n.LimitExceededRpcError.code||d.code===n.InternalRpcError.code:d instanceof t.HttpRequestError&&d.status?d.status===403||d.status===408||d.status===4
4413||d.status===429||d.status===500||d.status===502||d.status===503||d.status===504:!0}return Oo}var Co={},Qh;function g_(){if(Qh)return Co;Qh=1,Object.defineProperty(Co,"__esModule",{value:!0}),Co.defineChain=e,Co.extendSchema=t;function e(n){const r={formatters:void 0,fees:void 0,serializers:void 0,...n};function s(a){return o=>{const c=typeof o=="function"?o(a):o,u={...a,...c};return Object.assign(u,{extend:s(u)})}}return Object.assign(r,{extend:s(r)})}function t(){return{}}return Co}var Ha={},$h;function p_(){if($h)return Ha;$h=1,Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.extractChain=e;function e({chains:t,id:n}){return t.find(r=>r.id===n)}return Ha}var Ma={},ey;function $f(){if(ey)return Ma;ey=1,Object.defineProperty(Ma,"__esModule",{value:!0}),Ma.fromRlp=a;const e=fe(),t=Bn(),n=Ko(),r=Pe(),s=ie();function a(d,l="hex"){const f=(()=>{if(typeof d=="string"){if(d.length>3&&d.length%2!==0)throw new t.InvalidHexValueError(d);return(0,r.hexToBytes)(d)}return d})(),b=(0,n.createCursor)(f,{recursiveReadLimit:Number.POSITIVE_INFINITY});return o(b,l)}function o(d,l="hex"){if(d.bytes.length===0)return l==="hex"?(0,s.bytesToHex)(d.bytes):d.bytes;const f=d.readByte();if(f<128&&d.decrementPosition(1),f<192){const T=c(d,f,128),v=d.readBytes(T);return l==="hex"?(0,s.bytesToHex)(v):v}const b=c(d,f,192);return u(d,b,l)}function c(d,l,f){if(f===128&&l<128)return 1;if(l<=f+55)return l-f;if(l===f+55+1)return d.readUint8();if(l===f+55+2)return d.readUint16();if(l===f+55+3)return d.readUint24();if(l===f+55+4)return d.readUint32();throw new e.BaseError("Invalid RLP prefix")}function u(d,l,f){const b=d.position,T=[];for(;d.position-b<l;)T.push(o(d,f));return T}return Ma}var ka={},ty;function e0(){if(ty)return ka;ty=1,Object.defineProperty(ka,"__esModule",{value:!0}),ka.isHash=n;const e=nt(),t=at();function n(r){return(0,e.isHex)(r)&&(0,t.size)(r)===32}return ka}var Na={},Nr={},$e={},ry;function $6(){if(ry)return $e;ry=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.ripemd160=$e.RIPEMD160=$e.md5=$e.MD5=$e.sha1=$e.SHA1=void 0;const e=Np(),t=yr(),n=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),r=new Uint32Array(80);class s extends e.HashMD{constructor(){super(64,20,8,!1),this.A=n[0]|0,this.B=n[1]|0,this.C=n[2]|0,this.D=n[3]|0,this.E=n[4]|0}get(){const{A:w,B:y,C:x,D:C,E:B}=this;return[w,y,x,C,B]}set(w,y,x,C,B){this.A=w|0,this.B=y|0,this.C=x|0,this.D=C|0,this.E=B|0}process(w,y){for(let k=0;k<16;k++,y+=4)r[k]=w.getUint32(y,!1);for(let k=16;k<80;k++)r[k]=(0,t.rotl)(r[k-3]^r[k-8]^r[k-14]^r[k-16],1);let{A:x,B:C,C:B,D:H,E:F}=this;for(let k=0;k<80;k++){let m,M;k<20?(m=(0,e.Chi)(C,B,H),M=1518500249):k<40?(m=C^B^H,M=1859775393):k<60?(m=(0,e.Maj)(C,B,H),M=2400959708):(m=C^B^H,M=3395469782);const A=(0,t.rotl)(x,5)+m+F+M+r[k]|0;F=H,H=B,B=(0,t.rotl)(C,30),C=x,x=A}x=x+this.A|0,C=C+this.B|0,B=B+this.C|0,H=H+this.D|0,F=F+this.E|0,this.set(x,C,B,H,F)}roundClean(){(0,t.clean)(r)}destroy(){this.set(0,0,0,0,0),(0,t.clean)(this.buffer)}}$e.SHA1=s,$e.sha1=(0,t.createHasher)(()=>new s);const a=Math.pow(2,32),o=Array.from({length:64},(R,w)=>Math.floor(a*Math.abs(Math.sin(w+1)))),c=n.slice(0,4),u=new Uint32Array(16);class d extends e.HashMD{constructor(){super(64,16,8,!0),this.A=c[0]|0,this.B=c[1]|0,this.C=c[2]|0,this.D=c[3]|0}get(){const{A:w,B:y,C:x,D:C}=this;return[w,y,x,C]}set(w,y,x,C){this.A=w|0,this.B=y|0,this.C=x|0,this.D=C|0}process(w,y){for(let F=0;F<16;F++,y+=4)u[F]=w.getUint32(y,!0);let{A:x,B:C,C:B,D:H}=this;for(let F=0;F<64;F++){let k,m,M;F<16?(k=(0,e.Chi)(C,B,H),m=F,M=[7,12,17,22]):F<32?(k=(0,e.Chi)(H,C,B),m=(5*F+1)%16,M=[5,9,14,20]):F<48?(k=C^B^H,m=(3*F+5)%16,M=[4,11,16,23]):(k=B^(C|~H),m=7*F%16,M=[6,10,15,21]),k=k+x+o[F]+u[m],x=H,H=B,B=C,C=C+(0,t.rotl)(k,M[F%4])}x=x+this.A|0,C=C+this.B|0,B=B+this.C|0,H=H+this.D|0,this.set(x,C,B,H)}roundClean(){(0,t.clean)(u)}destroy(){this.set(0,0,0,0),(0,t.clean)(this.buffer)}}$e.MD5=d,$e.md5=(0,t.createHasher)(()=>new d);const l=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),f=Uint8Array.from(new Array(16).fill(0).map((R,w)=>w)),b=f.map(R=>(9*R+5)%16),T=(()=>{const y=[[f],[b]];for(let x=0;x<4;x++)for(let C of y)C.push(C[x].map(B=>l[B]));return y})(),v=T[0],p=T[1],O=[[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=>Uint8Array.from(R)),I=v.map((R,w)=>R.map(y=>O[w][y])),h=p.map((R,w)=>R.map(y=>O[w][y])),j=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),i=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function g(R,w,y,x){return R===0?w^y^x:R===1?w&y|~w&x:R===2?(w|~y)^x:R===3?w&x|y&~x:w^(y|~x)}const _=new Uint32Array(16);class E extends e.HashMD{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:w,h1:y,h2:x,h3:C,h4:B}=this;return[w,y,x,C,B]}set(w,y,x,C,B){this.h0=w|0,this.h1=y|0,this.h2=x|0,this.h3=C|0,this.h4=B|0}process(w,y){for(let S=0;S<16;S++,y+=4)_[S]=w.getUint32(y,!0);let x=this.h0|0,C=x,B=this.h1|0,H=B,F=this.h2|0,k=F,m=this.h3|0,M=m,A=this.h4|0,P=A;for(let S=0;S<5;S++){const q=4-S,N=j[S],U=i[S],L=v[S],z=p[S],D=I[S],X=h[S];for(let W=0;W<16;
44W++){const Z=(0,t.rotl)(x+g(S,B,F,m)+_[L[W]]+N,D[W])+A|0;x=A,A=m,m=(0,t.rotl)(F,10)|0,F=B,B=Z}for(let W=0;W<16;W++){const Z=(0,t.rotl)(C+g(q,H,k,M)+_[z[W]]+U,X[W])+P|0;C=P,P=M,M=(0,t.rotl)(k,10)|0,k=H,H=Z}}this.set(this.h1+F+M|0,this.h2+m+P|0,this.h3+A+C|0,this.h4+x+H|0,this.h0+B+k|0)}roundClean(){(0,t.clean)(_)}destroy(){this.destroyed=!0,(0,t.clean)(this.buffer),this.set(0,0,0,0,0)}}return $e.RIPEMD160=E,$e.ripemd160=(0,t.createHasher)(()=>new E),$e}var ny;function e2(){if(ny)return Nr;ny=1,Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.ripemd160=Nr.RIPEMD160=void 0;const e=$6();return Nr.RIPEMD160=e.RIPEMD160,Nr.ripemd160=e.ripemd160,Nr}var oy;function __(){if(oy)return Na;oy=1,Object.defineProperty(Na,"__esModule",{value:!0}),Na.ripemd160=s;const e=e2(),t=nt(),n=Pe(),r=ie();function s(a,o){const c=o||"hex",u=(0,e.ripemd160)((0,t.isHex)(a,{strict:!1})?(0,n.toBytes)(a):a);return c==="bytes"?u:(0,r.toHex)(u)}return Na}var rf={},iy;function v_(){return iy||(iy=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toEventHash=void 0;var t=zu();Object.defineProperty(e,"toEventHash",{enumerable:!0,get:function(){return t.toSignatureHash}})})(rf)),rf}var nf={},sy;function E_(){return sy||(sy=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toEventSignature=void 0;var t=gf();Object.defineProperty(e,"toEventSignature",{enumerable:!0,get:function(){return t.toSignature}})})(nf)),nf}var of={},ay;function w_(){return ay||(ay=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toFunctionHash=void 0;var t=zu();Object.defineProperty(e,"toFunctionHash",{enumerable:!0,get:function(){return t.toSignatureHash}})})(of)),of}var sf={},cy;function j_(){return cy||(cy=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toFunctionSignature=void 0;var t=gf();Object.defineProperty(e,"toFunctionSignature",{enumerable:!0,get:function(){return t.toSignature}})})(sf)),sf}var Fr={},uy;function P_(){if(uy)return Fr;uy=1,Object.defineProperty(Fr,"__esModule",{value:!0}),Fr.nonceManager=void 0,Fr.createNonceManager=n,Fr.jsonRpc=r;const e=Yu(),t=Xr();function n(s){const{source:a}=s,o=new Map,c=new t.LruMap(8192),u=new Map,d=({address:l,chainId:f})=>`${l}.${f}`;return{async consume({address:l,chainId:f,client:b}){const T=d({address:l,chainId:f}),v=this.get({address:l,chainId:f,client:b});this.increment({address:l,chainId:f});const p=await v;return await a.set({address:l,chainId:f},p),c.set(T,p),p},async increment({address:l,chainId:f}){const b=d({address:l,chainId:f}),T=o.get(b)??0;o.set(b,T+1)},async get({address:l,chainId:f,client:b}){const T=d({address:l,chainId:f});let v=u.get(T);return v||(v=(async()=>{try{const O=await a.get({address:l,chainId:f,client:b}),I=c.get(T)??0;return I>0&&O<=I?I+1:(c.delete(T),O)}finally{this.reset({address:l,chainId:f})}})(),u.set(T,v)),(o.get(T)??0)+await v},reset({address:l,chainId:f}){const b=d({address:l,chainId:f});o.delete(b),u.delete(b)}}}function r(){return{async get(s){const{address:a,client:o}=s;return(0,e.getTransactionCount)(o,{address:a,blockTag:"pending"})},set(){}}}return Fr.nonceManager=n({source:r()}),Fr}var vn={},qo={},Fa={},dy;function t0(){if(dy)return Fa;dy=1,Object.defineProperty(Fa,"__esModule",{value:!0}),Fa.withTimeout=e;function e(t,{errorInstance:n=new Error("timed out"),timeout:r,signal:s}){return new Promise((a,o)=>{(async()=>{let c;try{const u=new AbortController;r>0&&(c=setTimeout(()=>{s?u.abort():o(n)},r)),a(await t({signal:u?.signal||null}))}catch(u){u?.name==="AbortError"&&o(n),o(u)}finally{clearTimeout(c)}})()})}return Fa}var Ho={},fy;function A_(){if(fy)return Ho;fy=1,Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.idCache=void 0;function e(){return{current:0,take(){return this.current++},reset(){this.current=0}}}return Ho.idCache=e(),Ho}var ly;function r0(){if(ly)return qo;ly=1,Object.defineProperty(qo,"__esModule",{value:!0}),qo.getHttpRpcClient=s,qo.parseUrl=a;const e=Bt(),t=t0(),n=Ve(),r=A_();function s(o,c={}){const{url:u,headers:d}=a(o);return{async request(l){const{body:f,fetchFn:b=c.fetchFn??fetch,onRequest:T=c.onRequest,onResponse:v=c.onResponse,timeout:p=c.timeout??1e4}=l,O={...c.fetchOptions??{},...l.fetchOptions??{}},{headers:I,method:h,signal:j}=O;try{const i=await(0,t.withTimeout)(async({signal:_})=>{const E={...O,body:Array.isArray(f)?(0,n.stringify)(f.map(x=>({jsonrpc:"2.0",id:x.id??r.idCache.take(),...x}))):(0,n.stringify)({jsonrpc:"2.0",id:f.id??r.idCache.take(),...f}),headers:{...d,"Content-Type":"application/json",...I},method:h||"POST",signal:j||(p>0?_:null)}
44,R=new Request(u,E),w=await T?.(R,E)??{...E,url:u};return await b(w.url??u,w)},{errorInstance:new e.TimeoutError({body:f,url:u}),timeout:p,signal:!0});v&&await v(i);let g;if(i.headers.get("Content-Type")?.startsWith("application/json"))g=await i.json();else{g=await i.text();try{g=JSON.parse(g||"{}")}catch(_){if(i.ok)throw _;g={error:g}}}if(!i.ok)throw new e.HttpRequestError({body:f,details:(0,n.stringify)(g.error)||i.statusText,headers:i.headers,status:i.status,url:u});return g}catch(i){throw i instanceof e.HttpRequestError||i instanceof e.TimeoutError?i:new e.HttpRequestError({body:f,cause:i,url:u})}}}}function a(o){try{const c=new URL(o),u=(()=>{if(c.username){const d=`${decodeURIComponent(c.username)}:${decodeURIComponent(c.password)}`;return c.username="",c.password="",{url:c.toString(),headers:{Authorization:`Basic ${btoa(d)}`}}}})();return{url:c.toString(),...u}}catch{return{url:o}}}return qo}var La={},af={},by;function T_(){return by||(by=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.socketClientCache=void 0,e.getSocketRpcClient=a;const t=Bt(),n=kf(),r=t0(),s=A_();e.socketClientCache=new Map;async function a(o){const{getSocket:c,keepAlive:u=!0,key:d="socket",reconnect:l=!0,url:f}=o,{interval:b=3e4}=typeof u=="object"?u:{},{attempts:T=5,delay:v=2e3}=typeof l=="object"?l:{},p=JSON.stringify({keepAlive:u,key:d,url:f,reconnect:l});let O=e.socketClientCache.get(p);if(O)return O;let I=0;const{schedule:h}=(0,n.createBatchScheduler)({id:p,fn:async()=>{const g=new Map,_=new Map;let E,R,w,y=!1;function x(){if(l&&I<T){if(y)return;y=!0,I++,R?.close(),setTimeout(async()=>{await C().catch(console.error),y=!1},v)}else g.clear(),_.clear()}async function C(){const B=await c({onClose(){for(const H of g.values())H.onError?.(new t.SocketClosedError({url:f}));for(const H of _.values())H.onError?.(new t.SocketClosedError({url:f}));x()},onError(H){E=H;for(const F of g.values())F.onError?.(E);for(const F of _.values())F.onError?.(E);x()},onOpen(){E=void 0,I=0},onResponse(H){const F=H.method==="eth_subscription",k=F?H.params.subscription:H.id,m=F?_:g,M=m.get(k);M&&M.onResponse(H),F||m.delete(k)}});if(R=B,u&&(w&&clearInterval(w),w=setInterval(()=>R.ping?.(),b)),l&&_.size>0){const H=_.entries();for(const[F,{onResponse:k,body:m,onError:M}]of H)m&&(_.delete(F),O?.request({body:m,onResponse:k,onError:M}))}return B}return await C(),E=void 0,O={close(){w&&clearInterval(w),R.close(),e.socketClientCache.delete(p)},get socket(){return R},request({body:B,onError:H,onResponse:F}){E&&H&&H(E);const k=B.id??s.idCache.take(),m=M=>{typeof M.id=="number"&&k!==M.id||(B.method==="eth_subscribe"&&typeof M.result=="string"&&_.set(M.result,{onResponse:m,onError:H,body:B}),F(M))};B.method==="eth_unsubscribe"&&_.delete(B.params?.[0]),g.set(k,{onResponse:m,onError:H});try{R.request({body:{jsonrpc:"2.0",id:k,...B}})}catch(M){H?.(M)}},requestAsync({body:B,timeout:H=1e4}){return(0,r.withTimeout)(()=>new Promise((F,k)=>this.request({body:B,onError:k,onResponse:F})),{errorInstance:new t.TimeoutError({body:B,url:f}),timeout:H})},requests:g,subscriptions:_,url:f},e.socketClientCache.set(p,O),[O]}}),[j,[i]]=await h();return i}})(af)),af}const t2=Yv(r6);var my;function n0(){if(my)return La;my=1,Object.defineProperty(La,"__esModule",{value:!0}),La.getWebSocketRpcClient=n;const e=Bt(),t=T_();async function n(r,s={}){const{keepAlive:a,reconnect:o}=s;return(0,t.getSocketRpcClient)({async getSocket({onClose:c,onError:u,onOpen:d,onResponse:l}){const f=await Promise.resolve().then(()=>t2).then(O=>O.WebSocket),b=new f(r);function T(){b.removeEventListener("close",T),b.removeEventListener("message",v),b.removeEventListener("error",u),b.removeEventListener("open",d),c()}function v({data:O}){if(!(typeof O=="string"&&O.trim().length===0))try{const I=JSON.parse(O);l(I)}catch(I){u(I)}}b.addEventListener("close",T),b.addEventListener("message",v),b.addEventListener("error",u),b.addEventListener("open",d),b.readyState===f.CONNECTING&&await new Promise((O,I)=>{b&&(b.onopen=O,b.onerror=I)});const{close:p}=b;return Object.assign(b,{close(){p.bind(b)(),T()},ping(){try{if(b.readyState===b.CLOSED||b.readyState===b.CLOSING)throw new e.WebSocketRequestError({url:b.url,cause:new e.SocketClosedError({url:b.url})});
44const O={jsonrpc:"2.0",id:null,method:"net_version",params:[]};b.send(JSON.stringify(O))}catch(O){u(O)}},request({body:O}){if(b.readyState===b.CLOSED||b.readyState===b.CLOSING)throw new e.WebSocketRequestError({body:O,url:b.url,cause:new e.SocketClosedError({url:b.url})});return b.send(JSON.stringify(O))}})},keepAlive:a,reconnect:o,url:r})}return La}var hy;function S_(){if(hy)return vn;hy=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.rpc=void 0,vn.getSocket=s;const e=r0(),t=n0();function n(a,{body:o,onError:c,onResponse:u}){return a.request({body:o,onError:c,onResponse:u}),a}async function r(a,{body:o,timeout:c=1e4}){return a.requestAsync({body:o,timeout:c})}async function s(a){const o=await(0,t.getWebSocketRpcClient)(a);return Object.assign(o.socket,{requests:o.requests,subscriptions:o.subscriptions})}return vn.rpc={http(a,o){return(0,e.getHttpRpcClient)(a).request(o)},webSocket:n,webSocketAsync:r},vn}var Ua={},za={},Mo={},yy;function I_(){return yy||(yy=1,Object.defineProperty(Mo,"__esModule",{value:!0}),Mo.presignMessagePrefix=void 0,Mo.presignMessagePrefix=`�Ethereum Signed Message:
45`),Mo}var gy;function B_(){if(gy)return za;gy=1,Object.defineProperty(za,"__esModule",{value:!0}),za.toPrefixedMessage=s;const e=I_(),t=Le(),n=at(),r=ie();function s(a){const o=typeof a=="string"?(0,r.stringToHex)(a):typeof a.raw=="string"?a.raw:(0,r.bytesToHex)(a.raw),c=(0,r.stringToHex)(`${e.presignMessagePrefix}${(0,n.size)(o)}`);return(0,t.concat)([c,o])}return za}var py;function bi(){if(py)return Ua;py=1,Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.hashMessage=n;const e=ct(),t=B_();function n(r,s){return(0,e.keccak256)((0,t.toPrefixedMessage)(r),s)}return Ua}var Lr={},Ur={},Qt={},_y;function x_(){if(_y)return Qt;_y=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.InvalidStructTypeError=Qt.InvalidPrimaryTypeError=Qt.InvalidDomainError=void 0;const e=Ve(),t=fe();class n extends t.BaseError{constructor({domain:o}){super(`Invalid domain "${(0,e.stringify)(o)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}Qt.InvalidDomainError=n;class r extends t.BaseError{constructor({primaryType:o,types:c}){super(`Invalid primary type \`${o}\` must be one of \`${JSON.stringify(Object.keys(c))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}Qt.InvalidPrimaryTypeError=r;class s extends t.BaseError{constructor({type:o}){super(`Struct type "${o}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}return Qt.InvalidStructTypeError=s,Qt}var vy;function ud(){if(vy)return Ur;
45vy=1,Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.serializeTypedData=d,Ur.validateTypedData=l,Ur.getTypesForEIP712Domain=f,Ur.domainSeparator=b;const e=qe(),t=St(),n=x_(),r=ut(),s=at(),a=ie(),o=Du(),c=mi(),u=Ve();function d(v){const{domain:p,message:O,primaryType:I,types:h}=v,j=(_,E)=>{const R={...E};for(const w of _){const{name:y,type:x}=w;x==="address"&&(R[y]=R[y].toLowerCase())}return R},i=h.EIP712Domain?p?j(h.EIP712Domain,p):{}:{},g=(()=>{if(I!=="EIP712Domain")return j(h[I],O)})();return(0,u.stringify)({domain:i,message:g,primaryType:I,types:h})}function l(v){const{domain:p,message:O,primaryType:I,types:h}=v,j=(i,g)=>{for(const _ of i){const{name:E,type:R}=_,w=g[E],y=R.match(o.integerRegex);if(y&&(typeof w=="number"||typeof w=="bigint")){const[B,H,F]=y;(0,a.numberToHex)(w,{signed:H==="int",size:Number.parseInt(F,10)/8})}if(R==="address"&&typeof w=="string"&&!(0,r.isAddress)(w))throw new t.InvalidAddressError({address:w});const x=R.match(o.bytesRegex);if(x){const[B,H]=x;if(H&&(0,s.size)(w)!==Number.parseInt(H,10))throw new e.BytesSizeMismatchError({expectedSize:Number.parseInt(H,10),givenSize:(0,s.size)(w)})}const C=h[R];C&&(T(R),j(C,w))}};if(h.EIP712Domain&&p){if(typeof p!="object")throw new n.InvalidDomainError({domain:p});j(h.EIP712Domain,p)}if(I!=="EIP712Domain")if(h[I])j(h[I],O);else throw new n.InvalidPrimaryTypeError({primaryType:I,types:h})}function f({domain:v}){return[typeof v?.name=="string"&&{name:"name",type:"string"},v?.version&&{name:"version",type:"string"},(typeof v?.chainId=="number"||typeof v?.chainId=="bigint")&&{name:"chainId",type:"uint256"},v?.verifyingContract&&{name:"verifyingContract",type:"address"},v?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function b({domain:v}){return(0,c.hashDomain)({domain:v,types:{EIP712Domain:f({domain:v})}})}function T(v){if(v==="address"||v==="bool"||v==="string"||v.startsWith("bytes")||v.startsWith("uint")||v.startsWith("int"))throw new n.InvalidStructTypeError({type:v})}return Ur}var Ey;function mi(){if(Ey)return Lr;Ey=1,Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.hashTypedData=a,Lr.hashDomain=o,Lr.hashStruct=c,Lr.encodeType=l;const e=It(),t=Le(),n=ie(),r=ct(),s=ud();function a(T){const{domain:v={},message:p,primaryType:O}=T,I={EIP712Domain:(0,s.getTypesForEIP712Domain)({domain:v}),...T.types};(0,s.validateTypedData)({domain:v,message:p,primaryType:O,types:I});const h=["0x1901"];return v&&h.push(o({domain:v,types:I})),O!=="EIP712Domain"&&h.push(c({data:p,primaryType:O,types:I})),(0,r.keccak256)((0,t.concat)(h))}function o({domain:T,types:v}){return c({data:T,primaryType:"EIP712Domain",types:v})}function c({data:T,primaryType:v,types:p}){const O=u({data:T,primaryType:v,types:p});return(0,r.keccak256)(O)}function u({data:T,primaryType:v,types:p}){const O=[{type:"bytes32"}],I=[d({primaryType:v,types:p})];for(const h of p[v]){const[j,i]=b({types:p,name:h.name,type:h.type,value:T[h.name]});O.push(j),I.push(i)}return(0,e.encodeAbiParameters)(O,I)}function d({primaryType:T,types:v}){const p=(0,n.toHex)(l({primaryType:T,types:v}));return(0,r.keccak256)(p)}function l({primaryType:T,types:v}){let p="";const O=f({primaryType:T,types:v});O.delete(T);const I=[T,...Array.from(O).sort()];for(const h of I)p+=`${h}(${v[h].map(({name:j,type:i})=>`${i} ${j}`).join(",")})`;return p}function f({primaryType:T,types:v},p=new Set){const I=T.match(/^\w*/u)?.[0];if(p.has(I)||v[I]===void 0)return p;p.add(I);for(const h of v[I])f({primaryType:h.type,types:v},p);return p}function b({types:T,name:v,type:p,value:O}){if(T[p]!==void 0)return[{type:"bytes32"},(0,r.keccak256)(u({data:O,primaryType:p,types:T}))];if(p==="bytes")return[{type:"bytes32"},(0,r.keccak256)(O)];if(p==="string")return[{type:"bytes32"},(0,r.keccak256)((0,n.toHex)(O))];if(p.lastIndexOf("]")===p.length-1){const I=p.slice(0,p.lastIndexOf("[")),h=O.map(j=>b({name:v,type:I,types:T,value:j}));return[{type:"bytes32"},(0,r.keccak256)((0,e.encodeAbiParameters)(h.map(([j])=>j),h.map(([,j])=>j)))]}return[{type:p},O]}return Lr}var Da={},zr={},wy;function o0(){return wy||(wy=1,Object.defineProperty(zr,"__esModule",{value:!0}),zr.zeroHash=zr.erc6492MagicBytes=void 0,zr.erc6492MagicBytes="0x6492649264926492649264926492649264926492649264926492649264926492",zr.zeroHash="0x0000000000000000000000000000000000000000000000000000000000000000"),zr}var jy;function i0(){if(jy)return Da;jy=1,Object.defineProperty(Da,"__esModule",{value:!0}),Da.isErc6492Signature=n;const e=o0(),t=vt();function n(r){return(0,t.sliceHex)(r,-32)===e.erc6492MagicBytes}return Da}var Ga={},ko={},cf={},Oe={},et={},En={},No={},Py;function r2(){if(Py)return No;Py=1,Object.defineProperty(No,"__esModule",{value:!0}),No.LruMap=void 0;class e extends Map{constructor(n){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=n}get(n){const r=super.get(n);return super.has(n)&&r!==void 0&&(this.delete(n),super.set(n,r)),r}set(n,r){if(super.set(n,r),this.maxSize&&this.size>this.maxSize){const s=this.keys().next().value;s&&this.delete(s)}return this}}return No.LruMap=e,No}var Ay;function n2(){if(Ay)return En;Ay=1,Object.defineProperty(En,"__esModule",{value:!0}),En.checksum=void 0,En.clear=n;const e=r2(),t={checksum:new e.LruMap(8192)};En.checksum=t.checksum;function n(){for(const r of Object.values(t))r.clear()}return En}var fr={},uf={},df={},Fo={},Ty;function o2(){return Ty||(Ty=1,Object.defineProperty(Fo,"__esModule",{value:!0}),Fo.crypto=void 0,Fo.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0),Fo}var Sy;function Tr(){return Sy||(Sy=1,(function(e){Object.defineProperty(e,"__esMo
45dule",{value:!0}),e.wrapXOFConstructorWithOpts=e.wrapConstructorWithOpts=e.wrapConstructor=e.Hash=e.nextTick=e.swap32IfBE=e.byteSwapIfBE=e.swap8IfBE=e.isLE=void 0,e.isBytes=n,e.anumber=r,e.abytes=s,e.ahash=a,e.aexists=o,e.aoutput=c,e.u8=u,e.u32=d,e.clean=l,e.createView=f,e.rotr=b,e.rotl=T,e.byteSwap=v,e.byteSwap32=p,e.bytesToHex=h,e.hexToBytes=g,e.asyncLoop=E,e.utf8ToBytes=R,e.bytesToUtf8=w,e.toBytes=y,e.kdfInputToBytes=x,e.concatBytes=C,e.checkOpts=B,e.createHasher=F,e.createOptHasher=k,e.createXOFer=m,e.randomBytes=M;const t=o2();function n(A){return A instanceof Uint8Array||ArrayBuffer.isView(A)&&A.constructor.name==="Uint8Array"}function r(A){if(!Number.isSafeInteger(A)||A<0)throw new Error("positive integer expected, got "+A)}function s(A,...P){if(!n(A))throw new Error("Uint8Array expected");if(P.length>0&&!P.includes(A.length))throw new Error("Uint8Array expected of length "+P+", got length="+A.length)}function a(A){if(typeof A!="function"||typeof A.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");r(A.outputLen),r(A.blockLen)}function o(A,P=!0){if(A.destroyed)throw new Error("Hash instance has been destroyed");if(P&&A.finished)throw new Error("Hash#digest() has already been called")}function c(A,P){s(A);const S=P.outputLen;if(A.length<S)throw new Error("digestInto() expects output buffer of length at least "+S)}function u(A){return new Uint8Array(A.buffer,A.byteOffset,A.byteLength)}function d(A){return new Uint32Array(A.buffer,A.byteOffset,Math.floor(A.byteLength/4))}function l(...A){for(let P=0;P<A.length;P++)A[P].fill(0)}function f(A){return new DataView(A.buffer,A.byteOffset,A.byteLength)}function b(A,P){return A<<32-P|A>>>P}function T(A,P){return A<<P|A>>>32-P>>>0}e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function v(A){return A<<24&4278190080|A<<8&16711680|A>>>8&65280|A>>>24&255}e.swap8IfBE=e.isLE?A=>A:A=>v(A),e.byteSwapIfBE=e.swap8IfBE;function p(A){for(let P=0;P<A.length;P++)A[P]=v(A[P]);return A}e.swap32IfBE=e.isLE?A=>A:p;const O=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",I=Array.from({length:256},(A,P)=>P.toString(16).padStart(2,"0"));function h(A){if(s(A),O)return A.toHex();let P="";for(let S=0;S<A.length;S++)P+=I[A[S]];return P}const j={_0:48,_9:57,A:65,F:70,a:97,f:102};function i(A){if(A>=j._0&&A<=j._9)return A-j._0;if(A>=j.A&&A<=j.F)return A-(j.A-10);if(A>=j.a&&A<=j.f)return A-(j.a-10)}function g(A){if(typeof A!="string")throw new Error("hex string expected, got "+typeof A);if(O)return Uint8Array.fromHex(A);const P=A.length,S=P/2;if(P%2)throw new Error("hex string expected, got unpadded hex of length "+P);const q=new Uint8Array(S);for(let N=0,U=0;N<S;N++,U+=2){const L=i(A.charCodeAt(U)),z=i(A.charCodeAt(U+1));if(L===void 0||z===void 0){const D=A[U]+A[U+1];throw new Error('hex string expected, got non-hex character "'+D+'" at index '+U)}q[N]=L*16+z}return q}const _=async()=>{};e.nextTick=_;async function E(A,P,S){let q=Date.now();for(let N=0;N<A;N++){S(N);const U=Date.now()-q;U>=0&&U<P||(await(0,e.nextTick)(),q+=U)}}function R(A){if(typeof A!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(A))}function w(A){return new TextDecoder().decode(A)}function y(A){return typeof A=="string"&&(A=R(A)),s(A),A}function x(A){return typeof A=="string"&&(A=R(A)),s(A),A}function C(...A){let P=0;for(let q=0;q<A.length;q++){const N=A[q];s(N),P+=N.length}const S=new Uint8Array(P);for(let q=0,N=0;q<A.length;q++){const U=A[q];S.set(U,N),N+=U.length}return S}function B(A,P){if(P!==void 0&&{}.toString.call(P)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(A,P)}class H{}e.Hash=H;function F(A){const P=q=>A().update(y(q)).digest(),S=A();return P.outputLen=S.outputLen,P.blockLen=S.blockLen,P.create=()=>A(),P}function k(A){const P=(q,N)=>A(N).update(y(q)).digest(),S=A({});return P.outputLen=S.outputLen,P.blockLen=S.blockLen,P.create=q=>A(q),P}function m(A){const P=(q,N)=>A(N).update(y(q)).digest(),S=A({});return P.outputLen=S.outputLen,P.blockLen=S.blockLen,P.create=q=>A(q),P}e.wrapConstructor=F,e.wrapConstructorWithOpts=k,e.wrapXOFConstructorWithOpts=m;function M(A=32){if(t.crypto&&typeof t.crypto.getRandomValues=="function")return t.crypto.getRandomValues(new Uint8Array(A));if(t.crypto&&typeof t.crypto.randomBytes=="function")return Uint8Array.from(t.crypto.randomBytes(A));throw new Error("crypto.getRandomValues must be defined")}})(df)),df}var Iy;function R_(){return Iy||(Iy=1,(function(e){Object.defineProperty(e,"__esMo
45dule",{value:!0}),e.hmac=e.HMAC=void 0;const t=Tr();class n extends t.Hash{constructor(a,o){super(),this.finished=!1,this.destroyed=!1,(0,t.ahash)(a);const c=(0,t.toBytes)(o);if(this.iHash=a.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;const u=this.blockLen,d=new Uint8Array(u);d.set(c.length>u?a.create().update(c).digest():c);for(let l=0;l<d.length;l++)d[l]^=54;this.iHash.update(d),this.oHash=a.create();for(let l=0;l<d.length;l++)d[l]^=106;this.oHash.update(d),(0,t.clean)(d)}update(a){return(0,t.aexists)(this),this.iHash.update(a),this}digestInto(a){(0,t.aexists)(this),(0,t.abytes)(a,this.outputLen),this.finished=!0,this.iHash.digestInto(a),this.oHash.update(a),this.oHash.digestInto(a),this.destroy()}digest(){const a=new Uint8Array(this.oHash.outputLen);return this.digestInto(a),a}_cloneInto(a){a||(a=Object.create(Object.getPrototypeOf(this),{}));const{oHash:o,iHash:c,finished:u,destroyed:d,blockLen:l,outputLen:f}=this;return a=a,a.finished=u,a.destroyed=d,a.blockLen=l,a.outputLen=f,a.oHash=o._cloneInto(a.oHash),a.iHash=c._cloneInto(a.iHash),a}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.HMAC=n;const r=(s,a,o)=>new n(s,a).update(o).digest();e.hmac=r,e.hmac.create=(s,a)=>new n(s,a)})(uf)),uf}var Dr={},tt={},Je={},By;function O_(){if(By)return Je;By=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.SHA512_IV=Je.SHA384_IV=Je.SHA224_IV=Je.SHA256_IV=Je.HashMD=void 0,Je.setBigUint64=t,Je.Chi=n,Je.Maj=r;const e=Tr();function t(a,o,c,u){if(typeof a.setBigUint64=="function")return a.setBigUint64(o,c,u);const d=BigInt(32),l=BigInt(4294967295),f=Number(c>>d&l),b=Number(c&l),T=u?4:0,v=u?0:4;a.setUint32(o+T,f,u),a.setUint32(o+v,b,u)}function n(a,o,c){return a&o^~a&c}function r(a,o,c){return a&o^a&c^o&c}class s extends e.Hash{constructor(o,c,u,d){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=o,this.outputLen=c,this.padOffset=u,this.isLE=d,this.buffer=new Uint8Array(o),this.view=(0,e.createView)(this.buffer)}update(o){(0,e.aexists)(this),o=(0,e.toBytes)(o),(0,e.abytes)(o);const{view:c,buffer:u,blockLen:d}=this,l=o.length;for(let f=0;f<l;){const b=Math.min(d-this.pos,l-f);if(b===d){const T=(0,e.createView)(o);for(;d<=l-f;f+=d)this.process(T,f);continue}u.set(o.subarray(f,f+b),this.pos),this.pos+=b,f+=b,this.pos===d&&(this.process(c,0),this.pos=0)}return this.length+=o.length,this.roundClean(),this}digestInto(o){(0,e.aexists)(this),(0,e.aoutput)(o,this),this.finished=!0;const{buffer:c,view:u,blockLen:d,isLE:l}=this;let{pos:f}=this;c[f++]=128,(0,e.clean)(this.buffer.subarray(f)),this.padOffset>d-f&&(this.process(u,0),f=0);for(let O=f;O<d;O++)c[O]=0;t(u,d-8,BigInt(this.length*8),l),this.process(u,0);const b=(0,e.createView)(o),T=this.outputLen;if(T%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const v=T/4,p=this.get();if(v>p.length)throw new Error("_sha2: outputLen bigger than state");for(let O=0;O<v;O++)b.setUint32(4*O,p[O],l)}digest(){const{buffer:o,outputLen:c}=this;this.digestInto(o);const u=o.slice(0,c);return this.destroy(),u}_cloneInto(o){o||(o=new this.constructor),o.set(...this.get());const{blockLen:c,buffer:u,length:d,finished:l,destroyed:f,pos:b}=this;return o.destroyed=f,o.finished=l,o.length=d,o.pos=b,d%c&&o.buffer.set(u),o}clone(){return this._cloneInto()}}return Je.HashMD=s,Je.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Je.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),Je.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Je.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),Je}var xy;function i2(){if(xy)return tt;
45xy=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.ripemd160=tt.RIPEMD160=tt.md5=tt.MD5=tt.sha1=tt.SHA1=void 0;const e=O_(),t=Tr(),n=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]),r=new Uint32Array(80);class s extends e.HashMD{constructor(){super(64,20,8,!1),this.A=n[0]|0,this.B=n[1]|0,this.C=n[2]|0,this.D=n[3]|0,this.E=n[4]|0}get(){const{A:w,B:y,C:x,D:C,E:B}=this;return[w,y,x,C,B]}set(w,y,x,C,B){this.A=w|0,this.B=y|0,this.C=x|0,this.D=C|0,this.E=B|0}process(w,y){for(let k=0;k<16;k++,y+=4)r[k]=w.getUint32(y,!1);for(let k=16;k<80;k++)r[k]=(0,t.rotl)(r[k-3]^r[k-8]^r[k-14]^r[k-16],1);let{A:x,B:C,C:B,D:H,E:F}=this;for(let k=0;k<80;k++){let m,M;k<20?(m=(0,e.Chi)(C,B,H),M=1518500249):k<40?(m=C^B^H,M=1859775393):k<60?(m=(0,e.Maj)(C,B,H),M=2400959708):(m=C^B^H,M=3395469782);const A=(0,t.rotl)(x,5)+m+F+M+r[k]|0;F=H,H=B,B=(0,t.rotl)(C,30),C=x,x=A}x=x+this.A|0,C=C+this.B|0,B=B+this.C|0,H=H+this.D|0,F=F+this.E|0,this.set(x,C,B,H,F)}roundClean(){(0,t.clean)(r)}destroy(){this.set(0,0,0,0,0),(0,t.clean)(this.buffer)}}tt.SHA1=s,tt.sha1=(0,t.createHasher)(()=>new s);const a=Math.pow(2,32),o=Array.from({length:64},(R,w)=>Math.floor(a*Math.abs(Math.sin(w+1)))),c=n.slice(0,4),u=new Uint32Array(16);class d extends e.HashMD{constructor(){super(64,16,8,!0),this.A=c[0]|0,this.B=c[1]|0,this.C=c[2]|0,this.D=c[3]|0}get(){const{A:w,B:y,C:x,D:C}=this;return[w,y,x,C]}set(w,y,x,C){this.A=w|0,this.B=y|0,this.C=x|0,this.D=C|0}process(w,y){for(let F=0;F<16;F++,y+=4)u[F]=w.getUint32(y,!0);let{A:x,B:C,C:B,D:H}=this;for(let F=0;F<64;F++){let k,m,M;F<16?(k=(0,e.Chi)(C,B,H),m=F,M=[7,12,17,22]):F<32?(k=(0,e.Chi)(H,C,B),m=(5*F+1)%16,M=[5,9,14,20]):F<48?(k=C^B^H,m=(3*F+5)%16,M=[4,11,16,23]):(k=B^(C|~H),m=7*F%16,M=[6,10,15,21]),k=k+x+o[F]+u[m],x=H,H=B,B=C,C=C+(0,t.rotl)(k,M[F%4])}x=x+this.A|0,C=C+this.B|0,B=B+this.C|0,H=H+this.D|0,this.set(x,C,B,H)}roundClean(){(0,t.clean)(u)}destroy(){this.set(0,0,0,0),(0,t.clean)(this.buffer)}}tt.MD5=d,tt.md5=(0,t.createHasher)(()=>new d);const l=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),f=Uint8Array.from(new Array(16).fill(0).map((R,w)=>w)),b=f.map(R=>(9*R+5)%16),T=(()=>{const y=[[f],[b]];for(let x=0;x<4;x++)for(let C of y)C.push(C[x].map(B=>l[B]));return y})(),v=T[0],p=T[1],O=[[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=>Uint8Array.from(R)),I=v.map((R,w)=>R.map(y=>O[w][y])),h=p.map((R,w)=>R.map(y=>O[w][y])),j=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),i=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function g(R,w,y,x){return R===0?w^y^x:R===1?w&y|~w&x:R===2?(w|~y)^x:R===3?w&x|y&~x:w^(y|~x)}const _=new Uint32Array(16);class E extends e.HashMD{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:w,h1:y,h2:x,h3:C,h4:B}=this;return[w,y,x,C,B]}set(w,y,x,C,B){this.h0=w|0,this.h1=y|0,this.h2=x|0,this.h3=C|0,this.h4=B|0}process(w,y){for(let S=0;S<16;S++,y+=4)_[S]=w.getUint32(y,!0);let x=this.h0|0,C=x,B=this.h1|0,H=B,F=this.h2|0,k=F,m=this.h3|0,M=m,A=this.h4|0,P=A;for(let S=0;S<5;S++){const q=4-S,N=j[S],U=i[S],L=v[S],z=p[S],D=I[S],X=h[S];for(let W=0;W<16;W++){const Z=(0,t.rotl)(x+g(S,B,F,m)+_[L[W]]+N,D[W])+A|0;x=A,A=m,m=(0,t.rotl)(F,10)|0,F=B,B=Z}for(let W=0;W<16;W++){const Z=(0,t.rotl)(C+g(q,H,k,M)+_[z[W]]+U,X[W])+P|0;C=P,P=M,M=(0,t.rotl)(k,10)|0,k=H,H=Z}}this.set(this.h1+F+M|0,this.h2+m+P|0,this.h3+A+C|0,this.h4+x+H|0,this.h0+B+k|0)}roundClean(){(0,t.clean)(_)}destroy(){this.destroyed=!0,(0,t.clean)(this.buffer),this.set(0,0,0,0,0)}}return tt.RIPEMD160=E,tt.ripemd160=(0,t.createHasher)(()=>new E),tt}var Ry;function s2(){if(Ry)return Dr;Ry=1,Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.ripemd160=Dr.RIPEMD160=void 0;const e=i2();return Dr.RIPEMD160=e.RIPEMD160,Dr.ripemd160=e.ripemd160,Dr}var Be={},de={},Oy;function C_(){if(Oy)return de;Oy=1,Object.defineProperty(de,"__esModule",{value:!0}),de.toBig=de.shrSL=de.shrSH=de.rotrSL=de.rotrSH=de.rotrBL=de.rotrBH=de.rotr32L=de.rotr32H=de.rotlSL=de.rotlSH=de.rotlBL=de.rotlBH=de.add5L=de.add5H=de.add4L=de.add4H=de.add3L=de.add3H=void 0,de.add=I,de.fromBig=n,de.split=r;const e=BigInt(2**32-1),t=BigInt(32);function n(w,y=!1){return y?{h:Number(w&e),l:Number(w>>t&e)}:{h:Number(w>>t&e)|0,l:Number(w&e)|0}}function r(w,y=!1){const x=w.length;let C=new Uint32Array(x),B=new Uint32Array(x);for(let H=0;H<x;H++){const{h:F,l:k}=n(w[H],y);[C[H],B[H]]=[F,k]}return[C,B]}const s=(w,y)=>BigInt(w>>>0)<<t|BigInt(y>>>0);de.toBig=s;const a=(w,y,x)=>w>>>x;de.shrSH=a;const o=(w,y,x)=>w<<32-x|y>>>x;de.shrSL=o;const c=(w,y,x)=>w>>>x|y<<32-x;de.rotrSH=c;const u=(w,y,x)=>w<<32-x|y>>>x;de.rotrSL=u;const d=(w,y,x)=>w<<64-x|y>>>x-32;de.rotrBH=d;const l=(w,y,x)=>w>>>
45x-32|y<<64-x;de.rotrBL=l;const f=(w,y)=>y;de.rotr32H=f;const b=(w,y)=>w;de.rotr32L=b;const T=(w,y,x)=>w<<x|y>>>32-x;de.rotlSH=T;const v=(w,y,x)=>y<<x|w>>>32-x;de.rotlSL=v;const p=(w,y,x)=>y<<x-32|w>>>64-x;de.rotlBH=p;const O=(w,y,x)=>w<<x-32|y>>>64-x;de.rotlBL=O;function I(w,y,x,C){const B=(y>>>0)+(C>>>0);return{h:w+x+(B/2**32|0)|0,l:B|0}}const h=(w,y,x)=>(w>>>0)+(y>>>0)+(x>>>0);de.add3L=h;const j=(w,y,x,C)=>y+x+C+(w/2**32|0)|0;de.add3H=j;const i=(w,y,x,C)=>(w>>>0)+(y>>>0)+(x>>>0)+(C>>>0);de.add4L=i;const g=(w,y,x,C,B)=>y+x+C+B+(w/2**32|0)|0;de.add4H=g;const _=(w,y,x,C,B)=>(w>>>0)+(y>>>0)+(x>>>0)+(C>>>0)+(B>>>0);de.add5L=_;const E=(w,y,x,C,B,H)=>y+x+C+B+H+(w/2**32|0)|0;de.add5H=E;const R={fromBig:n,split:r,toBig:s,shrSH:a,shrSL:o,rotrSH:c,rotrSL:u,rotrBH:d,rotrBL:l,rotr32H:f,rotr32L:b,rotlSH:T,rotlSL:v,rotlBH:p,rotlBL:O,add:I,add3L:h,add3H:j,add4L:i,add4H:g,add5H:E,add5L:_};return de.default=R,de}var Cy;function a2(){if(Cy)return Be;Cy=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.shake256=Be.shake128=Be.keccak_512=Be.keccak_384=Be.keccak_256=Be.keccak_224=Be.sha3_512=Be.sha3_384=Be.sha3_256=Be.sha3_224=Be.Keccak=void 0,Be.keccakP=O;const e=C_(),t=Tr(),n=BigInt(0),r=BigInt(1),s=BigInt(2),a=BigInt(7),o=BigInt(256),c=BigInt(113),u=[],d=[],l=[];for(let i=0,g=r,_=1,E=0;i<24;i++){[_,E]=[E,(2*_+3*E)%5],u.push(2*(5*E+_)),d.push((i+1)*(i+2)/2%64);let R=n;for(let w=0;w<7;w++)g=(g<<r^(g>>a)*c)%o,g&s&&(R^=r<<(r<<BigInt(w))-r);l.push(R)}const f=(0,e.split)(l,!0),b=f[0],T=f[1],v=(i,g,_)=>_>32?(0,e.rotlBH)(i,g,_):(0,e.rotlSH)(i,g,_),p=(i,g,_)=>_>32?(0,e.rotlBL)(i,g,_):(0,e.rotlSL)(i,g,_);function O(i,g=24){const _=new Uint32Array(10);for(let E=24-g;E<24;E++){for(let y=0;y<10;y++)_[y]=i[y]^i[y+10]^i[y+20]^i[y+30]^i[y+40];for(let y=0;y<10;y+=2){const x=(y+8)%10,C=(y+2)%10,B=_[C],H=_[C+1],F=v(B,H,1)^_[x],k=p(B,H,1)^_[x+1];for(let m=0;m<50;m+=10)i[y+m]^=F,i[y+m+1]^=k}let R=i[2],w=i[3];for(let y=0;y<24;y++){const x=d[y],C=v(R,w,x),B=p(R,w,x),H=u[y];R=i[H],w=i[H+1],i[H]=C,i[H+1]=B}for(let y=0;y<50;y+=10){for(let x=0;x<10;x++)_[x]=i[y+x];for(let x=0;x<10;x++)i[y+x]^=~_[(x+2)%10]&_[(x+4)%10]}i[0]^=b[E],i[1]^=T[E]}(0,t.clean)(_)}class I extends t.Hash{constructor(g,_,E,R=!1,w=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=g,this.suffix=_,this.outputLen=E,this.enableXOF=R,this.rounds=w,(0,t.anumber)(E),!(0<g&&g<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,t.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,t.swap32IfBE)(this.state32),O(this.state32,this.rounds),(0,t.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(g){(0,t.aexists)(this),g=(0,t.toBytes)(g),(0,t.abytes)(g);const{blockLen:_,state:E}=this,R=g.length;for(let w=0;w<R;){const y=Math.min(_-this.pos,R-w);for(let x=0;x<y;x++)E[this.pos++]^=g[w++];this.pos===_&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:g,suffix:_,pos:E,blockLen:R}=this;g[E]^=_,(_&128)!==0&&E===R-1&&this.keccak(),g[R-1]^=128,this.keccak()}writeInto(g){(0,t.aexists)(this,!1),(0,t.abytes)(g),this.finish();const _=this.state,{blockLen:E}=this;for(let R=0,w=g.length;R<w;){this.posOut>=E&&this.keccak();const y=Math.min(E-this.posOut,w-R);g.set(_.subarray(this.posOut,this.posOut+y),R),this.posOut+=y,R+=y}return g}xofInto(g){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(g)}xof(g){return(0,t.anumber)(g),this.xofInto(new Uint8Array(g))}digestInto(g){if((0,t.aoutput)(g,this),this.finished)throw new Error("digest() was already called");return this.writeInto(g),this.destroy(),g}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,t.clean)(this.state)}_cloneInto(g){const{blockLen:_,suffix:E,outputLen:R,rounds:w,enableXOF:y}=this;return g||(g=new I(_,E,R,y,w)),g.state32.set(this.state32),g.pos=this.pos,g.posOut=this.posOut,g.finished=this.finished,g.rounds=w,g.suffix=E,g.outputLen=R,g.enableXOF=y,g.destroyed=this.destroyed,g}}Be.Keccak=I;const h=(i,g,_)=>(0,t.createHasher)(()=>new I(g,i,_));Be.sha3_224=h(6,144,224/8),Be.sha3_256=h(6,136,256/8),Be.sha3_384=h(6,104,384/8),Be.sha3_512=h(6,72,512/8),Be.keccak_224=h(1,144,224/8),Be.keccak_256=h(1,136,256/8),Be.keccak_384=h(1,104,384/8),Be.keccak_512=h(1,72,512/8);const j=(i,g,_)=>(0,t.createXOFer)((E={})=>new I(g,i,E.dkLen===void 0?_:E.dkLen,!0));return Be.shake128=j(31,168,128/8),Be.shake256=j(31,136,256/8),Be}var At={},je={},qy;function q_(){if(qy)return je;
45qy=1,Object.defineProperty(je,"__esModule",{value:!0}),je.sha512_224=je.sha512_256=je.sha384=je.sha512=je.sha224=je.sha256=je.SHA512_256=je.SHA512_224=je.SHA384=je.SHA512=je.SHA224=je.SHA256=void 0;const e=O_(),t=C_(),n=Tr(),r=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),s=new Uint32Array(64);class a extends e.HashMD{constructor(j=32){super(64,j,8,!1),this.A=e.SHA256_IV[0]|0,this.B=e.SHA256_IV[1]|0,this.C=e.SHA256_IV[2]|0,this.D=e.SHA256_IV[3]|0,this.E=e.SHA256_IV[4]|0,this.F=e.SHA256_IV[5]|0,this.G=e.SHA256_IV[6]|0,this.H=e.SHA256_IV[7]|0}get(){const{A:j,B:i,C:g,D:_,E,F:R,G:w,H:y}=this;return[j,i,g,_,E,R,w,y]}set(j,i,g,_,E,R,w,y){this.A=j|0,this.B=i|0,this.C=g|0,this.D=_|0,this.E=E|0,this.F=R|0,this.G=w|0,this.H=y|0}process(j,i){for(let B=0;B<16;B++,i+=4)s[B]=j.getUint32(i,!1);for(let B=16;B<64;B++){const H=s[B-15],F=s[B-2],k=(0,n.rotr)(H,7)^(0,n.rotr)(H,18)^H>>>3,m=(0,n.rotr)(F,17)^(0,n.rotr)(F,19)^F>>>10;s[B]=m+s[B-7]+k+s[B-16]|0}let{A:g,B:_,C:E,D:R,E:w,F:y,G:x,H:C}=this;for(let B=0;B<64;B++){const H=(0,n.rotr)(w,6)^(0,n.rotr)(w,11)^(0,n.rotr)(w,25),F=C+H+(0,e.Chi)(w,y,x)+r[B]+s[B]|0,m=((0,n.rotr)(g,2)^(0,n.rotr)(g,13)^(0,n.rotr)(g,22))+(0,e.Maj)(g,_,E)|0;C=x,x=y,y=w,w=R+F|0,R=E,E=_,_=g,g=F+m|0}g=g+this.A|0,_=_+this.B|0,E=E+this.C|0,R=R+this.D|0,w=w+this.E|0,y=y+this.F|0,x=x+this.G|0,C=C+this.H|0,this.set(g,_,E,R,w,y,x,C)}roundClean(){(0,n.clean)(s)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,n.clean)(this.buffer)}}je.SHA256=a;class o extends a{constructor(){super(28),this.A=e.SHA224_IV[0]|0,this.B=e.SHA224_IV[1]|0,this.C=e.SHA224_IV[2]|0,this.D=e.SHA224_IV[3]|0,this.E=e.SHA224_IV[4]|0,this.F=e.SHA224_IV[5]|0,this.G=e.SHA224_IV[6]|0,this.H=e.SHA224_IV[7]|0}}je.SHA224=o;const c=t.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","0xf40e3585
455771202a","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(h=>BigInt(h))),u=c[0],d=c[1],l=new Uint32Array(80),f=new Uint32Array(80);class b extends e.HashMD{constructor(j=64){super(128,j,16,!1),this.Ah=e.SHA512_IV[0]|0,this.Al=e.SHA512_IV[1]|0,this.Bh=e.SHA512_IV[2]|0,this.Bl=e.SHA512_IV[3]|0,this.Ch=e.SHA512_IV[4]|0,this.Cl=e.SHA512_IV[5]|0,this.Dh=e.SHA512_IV[6]|0,this.Dl=e.SHA512_IV[7]|0,this.Eh=e.SHA512_IV[8]|0,this.El=e.SHA512_IV[9]|0,this.Fh=e.SHA512_IV[10]|0,this.Fl=e.SHA512_IV[11]|0,this.Gh=e.SHA512_IV[12]|0,this.Gl=e.SHA512_IV[13]|0,this.Hh=e.SHA512_IV[14]|0,this.Hl=e.SHA512_IV[15]|0}get(){const{Ah:j,Al:i,Bh:g,Bl:_,Ch:E,Cl:R,Dh:w,Dl:y,Eh:x,El:C,Fh:B,Fl:H,Gh:F,Gl:k,Hh:m,Hl:M}=this;return[j,i,g,_,E,R,w,y,x,C,B,H,F,k,m,M]}set(j,i,g,_,E,R,w,y,x,C,B,H,F,k,m,M){this.Ah=j|0,this.Al=i|0,this.Bh=g|0,this.Bl=_|0,this.Ch=E|0,this.Cl=R|0,this.Dh=w|0,this.Dl=y|0,this.Eh=x|0,this.El=C|0,this.Fh=B|0,this.Fl=H|0,this.Gh=F|0,this.Gl=k|0,this.Hh=m|0,this.Hl=M|0}process(j,i){for(let S=0;S<16;S++,i+=4)l[S]=j.getUint32(i),f[S]=j.getUint32(i+=4);for(let S=16;S<80;S++){const q=l[S-15]|0,N=f[S-15]|0,U=t.rotrSH(q,N,1)^t.rotrSH(q,N,8)^t.shrSH(q,N,7),L=t.rotrSL(q,N,1)^t.rotrSL(q,N,8)^t.shrSL(q,N,7),z=l[S-2]|0,D=f[S-2]|0,X=t.rotrSH(z,D,19)^t.rotrBH(z,D,61)^t.shrSH(z,D,6),W=t.rotrSL(z,D,19)^t.rotrBL(z,D,61)^t.shrSL(z,D,6),Z=t.add4L(L,W,f[S-7],f[S-16]),J=t.add4H(Z,U,X,l[S-7],l[S-16]);l[S]=J|0,f[S]=Z|0}let{Ah:g,Al:_,Bh:E,Bl:R,Ch:w,Cl:y,Dh:x,Dl:C,Eh:B,El:H,Fh:F,Fl:k,Gh:m,Gl:M,Hh:A,Hl:P}=this;for(let S=0;S<80;S++){const q=t.rotrSH(B,H,14)^t.rotrSH(B,H,18)^t.rotrBH(B,H,41),N=t.rotrSL(B,H,14)^t.rotrSL(B,H,18)^t.rotrBL(B,H,41),U=B&F^~B&m,L=H&k^~H&M,z=t.add5L(P,N,L,d[S],f[S]),D=t.add5H(z,A,q,U,u[S],l[S]),X=z|0,W=t.rotrSH(g,_,28)^t.rotrBH(g,_,34)^t.rotrBH(g,_,39),Z=t.rotrSL(g,_,28)^t.rotrBL(g,_,34)^t.rotrBL(g,_,39),J=g&E^g&w^E&w,oe=_&R^_&y^R&y;A=m|0,P=M|0,m=F|0,M=k|0,F=B|0,k=H|0,{h:B,l:H}=t.add(x|0,C|0,D|0,X|0),x=w|0,C=y|0,w=E|0,y=R|0,E=g|0,R=_|0;const K=t.add3L(X,Z,oe);g=t.add3H(K,D,W,J),_=K|0}({h:g,l:_}=t.add(this.Ah|0,this.Al|0,g|0,_|0)),{h:E,l:R}=t.add(this.Bh|0,this.Bl|0,E|0,R|0),{h:w,l:y}=t.add(this.Ch|0,this.Cl|0,w|0,y|0),{h:x,l:C}=t.add(this.Dh|0,this.Dl|0,x|0,C|0),{h:B,l:H}=t.add(this.Eh|0,this.El|0,B|0,H|0),{h:F,l:k}=t.add(this.Fh|0,this.Fl|0,F|0,k|0),{h:m,l:M}=t.add(this.Gh|0,this.Gl|0,m|0,M|0),{h:A,l:P}=t.add(this.Hh|0,this.Hl|0,A|0,P|0),this.set(g,_,E,R,w,y,x,C,B,H,F,k,m,M,A,P)}roundClean(){(0,n.clean)(l,f)}destroy(){(0,n.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}je.SHA512=b;class T extends b{constructor(){super(48),this.Ah=e.SHA384_IV[0]|0,this.Al=e.SHA384_IV[1]|0,this.Bh=e.SHA384_IV[2]|0,this.Bl=e.SHA384_IV[3]|0,this.Ch=e.SHA384_IV[4]|0,this.Cl=e.SHA384_IV[5]|0,this.Dh=e.SHA384_IV[6]|0,this.Dl=e.SHA384_IV[7]|0,this.Eh=e.SHA384_IV[8]|0,this.El=e.SHA384_IV[9]|0,this.Fh=e.SHA384_IV[10]|0,this.Fl=e.SHA384_IV[11]|0,this.Gh=e.SHA384_IV[12]|0,this.Gl=e.SHA384_IV[13]|0,this.Hh=e.SHA384_IV[14]|0,this.Hl=e.SHA384_IV[15]|0}}je.SHA384=T;const v=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),p=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class O extends b{constructor(){super(28),this.Ah=v[0]|0,this.Al=v[1]|0,this.Bh=v[2]|0,this.Bl=v[3]|0,this.Ch=v[4]|0,this.Cl=v[5]|0,this.Dh=v[6]|0,this.Dl=v[7]|0,this.Eh=v[8]|0,this.El=v[9]|0,this.Fh=v[10]|0,this.Fl=v[11]|0,this.Gh=v[12]|0,this.Gl=v[13]|0,this.Hh=v[14]|0,this.Hl=v[15]|0}}je.SHA512_224=O;class I extends b{constructor(){super(32),this.Ah=p[0]|0,this.Al=p[1]|0,this.Bh=p[2]|0,this.Bl=p[3]|0,this.Ch=p[4]|0,this.Cl=p[5]|0,this.Dh=p[6]|0,this.Dl=p[7]|0,this.Eh=p[8]|0,this.El=p[9]|0,this.Fh=p[10]|0,this.Fl=p[11]|0,this.Gh=p[12]|0,this.Gl=p[13]|0,this.Hh=p[14]|0,this.Hl=p[15]|0}}return je.SHA512_256=I,je.sha256=(0,n.createHasher)(()=>new a),je.sha224=(0,n.createHasher)(()=>new o),je.sha512=(0,n.createHasher)(()=>new b),je.sha384=(0,n.createHasher)(()=>new T),je.sha512_256=(0,n.createHasher)(()=>new I),je.sha512_224=(0,n.createHasher)(()=>new O),je}var Hy;function c2(){if(Hy)return At;
45Hy=1,Object.defineProperty(At,"__esModule",{value:!0}),At.sha224=At.SHA224=At.sha256=At.SHA256=void 0;const e=q_();return At.SHA256=e.SHA256,At.sha256=e.sha256,At.SHA224=e.SHA224,At.sha224=e.sha224,At}var My;function s0(){if(My)return fr;My=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.keccak256=o,fr.hmac256=c,fr.ripemd160=u,fr.sha256=d,fr.validate=l;const e=R_(),t=s2(),n=a2(),r=c2(),s=kt(),a=We();function o(f,b={}){const{as:T=typeof f=="string"?"Hex":"Bytes"}=b,v=(0,n.keccak_256)(s.from(f));return T==="Bytes"?v:a.fromBytes(v)}function c(f,b,T={}){const{as:v=typeof b=="string"?"Hex":"Bytes"}=T,p=(0,e.hmac)(r.sha256,s.from(f),s.from(b));return v==="Bytes"?p:a.fromBytes(p)}function u(f,b={}){const{as:T=typeof f=="string"?"Hex":"Bytes"}=b,v=(0,t.ripemd160)(s.from(f));return T==="Bytes"?v:a.fromBytes(v)}function d(f,b={}){const{as:T=typeof f=="string"?"Hex":"Bytes"}=b,v=(0,r.sha256)(s.from(f));return T==="Bytes"?v:a.fromBytes(v)}function l(f){return a.validate(f)&&a.size(f)===32}return fr}var Fe={},ky;function H_(){if(ky)return Fe;ky=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.InvalidSerializedSizeError=Fe.InvalidUncompressedPrefixError=Fe.InvalidCompressedPrefixError=Fe.InvalidPrefixError=Fe.InvalidError=void 0,Fe.assert=s,Fe.compress=a,Fe.from=o,Fe.fromBytes=c,Fe.fromHex=u,Fe.toBytes=d,Fe.toHex=l,Fe.validate=f;const e=kt(),t=gt(),n=We(),r=ed();function s(I,h={}){const{compressed:j}=h,{prefix:i,x:g,y:_}=I;if(j===!1||typeof g=="bigint"&&typeof _=="bigint"){if(i!==4)throw new T({prefix:i,cause:new p});return}if(j===!0||typeof g=="bigint"&&typeof _>"u"){if(i!==3&&i!==2)throw new T({prefix:i,cause:new v});return}throw new b({publicKey:I})}function a(I){const{x:h,y:j}=I;return{prefix:j%2n===0n?2:3,x:h}}function o(I){const h=(()=>
45{if(n.validate(I))return u(I);if(e.validate(I))return c(I);const{prefix:j,x:i,y:g}=I;return typeof i=="bigint"&&typeof g=="bigint"?{prefix:j??4,x:i,y:g}:{prefix:j,x:i}})();return s(h),h}function c(I){return u(n.fromBytes(I))}function u(I){if(I.length!==132&&I.length!==130&&I.length!==68)throw new O({publicKey:I});if(I.length===130){const i=BigInt(n.slice(I,0,32)),g=BigInt(n.slice(I,32,64));return{prefix:4,x:i,y:g}}if(I.length===132){const i=Number(n.slice(I,0,1)),g=BigInt(n.slice(I,1,33)),_=BigInt(n.slice(I,33,65));return{prefix:i,x:g,y:_}}const h=Number(n.slice(I,0,1)),j=BigInt(n.slice(I,1,33));return{prefix:h,x:j}}function d(I,h={}){return e.fromHex(l(I,h))}function l(I,h={}){s(I);const{prefix:j,x:i,y:g}=I,{includePrefix:_=!0}=h;return n.concat(_?n.fromNumber(j,{size:1}):"0x",n.fromNumber(i,{size:32}),typeof g=="bigint"?n.fromNumber(g,{size:32}):"0x")}function f(I,h={}){try{return s(I,h),!0}catch{return!1}}class b extends t.BaseError{constructor({publicKey:h}){super(`Value \`${r.stringify(h)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}Fe.InvalidError=b;class T extends t.BaseError{constructor({prefix:h,cause:j}){super(`Prefix "${h}" is invalid.`,{cause:j}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}Fe.InvalidPrefixError=T;class v extends t.BaseError{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}Fe.InvalidCompressedPrefixError=v;class p extends t.BaseError{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}Fe.InvalidUncompressedPrefixError=p;class O extends t.BaseError{constructor({publicKey:h}){super(`Value \`${h}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${n.size(n.from(h))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}}return Fe.InvalidSerializedSizeError=O,Fe}var Ny;function dd(){if(Ny)return et;Ny=1,Object.defineProperty(et,"__esModule",{value:!0}),et.InvalidChecksumError=et.InvalidInputError=et.InvalidAddressError=void 0,et.assert=o,et.checksum=c,et.from=u,et.fromPublicKey=d,et.isEqual=l,et.validate=f;const e=kt(),t=n2(),n=gt(),r=s0(),s=H_(),a=/^0x[a-fA-F0-9]{40}$/;function o(p,O={}){const{strict:I=!0}=O;if(!a.test(p))throw new b({address:p,cause:new T});if(I){if(p.toLowerCase()===p)return;if(c(p)!==p)throw new b({address:p,cause:new v})}}function c(p){if(t.checksum.has(p))return t.checksum.get(p);o(p,{strict:!1});const O=p.substring(2).toLowerCase(),I=r.keccak256(e.fromString(O),{as:"Bytes"}),h=O.split("");for(let i=0;i<40;i+=2)I[i>>1]>>4>=8&&h[i]&&(h[i]=h[i].toUpperCase()),(I[i>>1]&15)>=8&&h[i+1]&&(h[i+1]=h[i+1].toUpperCase());const j=`0x${h.join("")}`;return t.checksum.set(p,j),j}function u(p,O={}){const{checksum:I=!1}=O;return o(p),I?c(p):p}function d(p,O={}){const I=r.keccak256(`0x${s.toHex(p).slice(4)}`).substring(26);return u(`0x${I}`,O)}function l(p,O){return o(p,{strict:!1}),o(O,{strict:!1}),p.toLowerCase()===O.toLowerCase()}function f(p,O={}){const{strict:I=!0}=O??{};try{return o(p,{strict:I}),!0}catch{return!1}}class b extends n.BaseError{constructor({address:O,cause:I}){super(`Address "${O}" is invalid.`,{cause:I}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}et.InvalidAddressError=b;class T extends n.BaseError{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}et.InvalidInputError=T;class v extends n.BaseError{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}return et.InvalidChecksumError=v,et}var Ce={},G={},Fy;
45function a0(){return Fy||(Fy=1,Object.defineProperty(G,"__esModule",{value:!0}),G.minInt120=G.minInt112=G.minInt104=G.minInt96=G.minInt88=G.minInt80=G.minInt72=G.minInt64=G.minInt56=G.minInt48=G.minInt40=G.minInt32=G.minInt24=G.minInt16=G.minInt8=G.maxInt256=G.maxInt248=G.maxInt240=G.maxInt232=G.maxInt224=G.maxInt216=G.maxInt208=G.maxInt200=G.maxInt192=G.maxInt184=G.maxInt176=G.maxInt168=G.maxInt160=G.maxInt152=G.maxInt144=G.maxInt136=G.maxInt128=G.maxInt120=G.maxInt112=G.maxInt104=G.maxInt96=G.maxInt88=G.maxInt80=G.maxInt72=G.maxInt64=G.maxInt56=G.maxInt48=G.maxInt40=G.maxInt32=G.maxInt24=G.maxInt16=G.maxInt8=G.integerRegex=G.bytesRegex=G.arrayRegex=void 0,G.maxUint256=G.maxUint248=G.maxUint240=G.maxUint232=G.maxUint224=G.maxUint216=G.maxUint208=G.maxUint200=G.maxUint192=G.maxUint184=G.maxUint176=G.maxUint168=G.maxUint160=G.maxUint152=G.maxUint144=G.maxUint136=G.maxUint128=G.maxUint120=G.maxUint112=G.maxUint104=G.maxUint96=G.maxUint88=G.maxUint80=G.maxUint72=G.maxUint64=G.maxUint56=G.maxUint48=G.maxUint40=G.maxUint32=G.maxUint24=G.maxUint16=G.maxUint8=G.minInt256=G.minInt248=G.minInt240=G.minInt232=G.minInt224=G.minInt216=G.minInt208=G.minInt200=G.minInt192=G.minInt184=G.minInt176=G.minInt168=G.minInt160=G.minInt152=G.minInt144=G.minInt136=G.minInt128=void 0,G.arrayRegex=/^(.*)\[([0-9]*)\]$/,G.bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,G.integerRegex=/^(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)?$/,G.maxInt8=2n**(8n-1n)-1n,G.maxInt16=2n**(16n-1n)-1n,G.maxInt24=2n**(24n-1n)-1n,G.maxInt32=2n**(32n-1n)-1n,G.maxInt40=2n**(40n-1n)-1n,G.maxInt48=2n**(48n-1n)-1n,G.maxInt56=2n**(56n-1n)-1n,G.maxInt64=2n**(64n-1n)-1n,G.maxInt72=2n**(72n-1n)-1n,G.maxInt80=2n**(80n-1n)-1n,G.maxInt88=2n**(88n-1n)-1n,G.maxInt96=2n**(96n-1n)-1n,G.maxInt104=2n**(104n-1n)-1n,G.maxInt112=2n**(112n-1n)-1n,G.maxInt120=2n**(120n-1n)-1n,G.maxInt128=2n**(128n-1n)-1n,G.maxInt136=2n**(136n-1n)-1n,G.maxInt144=2n**(144n-1n)-1n,G.maxInt152=2n**(152n-1n)-1n,G.maxInt160=2n**(160n-1n)-1n,G.maxInt168=2n**(168n-1n)-1n,G.maxInt176=2n**(176n-1n)-1n,G.maxInt184=2n**(184n-1n)-1n,G.maxInt192=2n**(192n-1n)-1n,G.maxInt200=2n**(200n-1n)-1n,G.maxInt208=2n**(208n-1n)-1n,G.maxInt216=2n**(216n-1n)-1n,G.maxInt224=2n**(224n-1n)-1n,G.maxInt232=2n**(232n-1n)-1n,G.maxInt240=2n**(240n-1n)-1n,G.maxInt248=2n**(248n-1n)-1n,G.maxInt256=2n**(256n-1n)-1n,G.minInt8=-(2n**(8n-1n)),G.minInt16=-(2n**(16n-1n)),G.minInt24=-(2n**(24n-1n)),G.minInt32=-(2n**(32n-1n)),G.minInt40=-(2n**(40n-1n)),G.minInt48=-(2n**(48n-1n)),G.minInt56=-(2n**(56n-1n)),G.minInt64=-(2n**(64n-1n)),G.minInt72=-(2n**(72n-1n)),G.minInt80=-(2n**(80n-1n)),G.minInt88=-(2n**(88n-1n)),G.minInt96=-(2n**(96n-1n)),G.minInt104=-(2n**(104n-1n)),G.minInt112=-(2n**(112n-1n)),G.minInt120=-(2n**(120n-1n)),G.minInt128=-(2n**(128n-1n)),G.minInt136=-(2n**(136n-1n)),G.minInt144=-(2n**(144n-1n)),G.minInt152=-(2n**(152n-1n)),G.minInt160=-(2n**(160n-1n)),G.minInt168=-(2n**(168n-1n)),G.minInt176=-(2n**(176n-1n)),G.minInt184=-(2n**(184n-1n)),G.minInt192=-(2n**(192n-1n)),G.minInt200=-(2n**(200n-1n)),G.minInt208=-(2n**(208n-1n)),G.minInt216=-(2n**(216n-1n)),G.minInt224=-(2n**(224n-1n)),G.minInt232=-(2n**(232n-1n)),G.minInt240=-(2n**(240n-1n)),G.minInt248=-(2n**(248n-1n)),G.minInt256=-(2n**(256n-1n)),G.maxUint8=2n**8n-1n,G.maxUint16=2n**16n-1n,G.maxUint24=2n**24n-1n,G.maxUint32=2n**32n-1n,G.maxUint40=2n**40n-1n,G.maxUint48=2n**48n-1n,G.maxUint56=2n**56n-1n,G.maxUint64=2n**64n-1n,G.maxUint72=2n**72n-1n,G.maxUint80=2n**80n-1n,G.maxUint88=2n**88n-1n,G.maxUint96=2n**96n-1n,G.maxUint104=2n**104n-1n,G.maxUint112=2n**112n-1n,G.maxUint120=2n**120n-1n,G.maxUint128=2n**128n-1n,G.maxUint136=2n**136n-1n,G.maxUint144=2n**144n-1n,G.maxUint152=2n**152n-1n,G.maxUint160=2n**160n-1n,G.maxUint168=2n**168n-1n,G.maxUint176=2n**176n-1n,G.maxUint184=2n**184n-1n,G.maxUint192=2n**192n-1n,G.maxUint200=2n**200n-1n,G.maxUint208=2n**208n-1n,G.maxUint216=2n**216n-1n,G.maxUint224=2n**224n-1n,G.maxUint232=2n**232n-1n,G.maxUint240=2n**240n-1n,G.maxUint248=2n**248n-1n,G.maxUint256=2n**256n-1n),G}var Ly;
45function u2(){if(Ly)return Ce;Ly=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.decodeParameter=o,Ce.decodeAddress=d,Ce.decodeArray=l,Ce.decodeBool=f,Ce.decodeBytes=b,Ce.decodeNumber=T,Ce.decodeTuple=v,Ce.decodeString=p,Ce.prepareParameters=O,Ce.prepareParameter=I,Ce.encode=h,Ce.encodeAddress=j,Ce.encodeArray=i,Ce.encodeBytes=g,Ce.encodeBoolean=_,Ce.encodeNumber=E,Ce.encodeString=R,Ce.encodeTuple=w,Ce.getArrayComponents=y,Ce.hasDynamicChild=x;const e=hi(),t=dd(),n=kt(),r=gt(),s=We(),a=a0();function o(C,B,H){const{checksumAddress:F,staticPosition:k}=H,m=y(B.type);if(m){const[M,A]=m;return l(C,{...B,type:A},{checksumAddress:F,length:M,staticPosition:k})}if(B.type==="tuple")return v(C,B,{checksumAddress:F,staticPosition:k});if(B.type==="address")return d(C,{checksum:F});if(B.type==="bool")return f(C);if(B.type.startsWith("bytes"))return b(C,B,{staticPosition:k});if(B.type.startsWith("uint")||B.type.startsWith("int"))return T(C,B);if(B.type==="string")return p(C,{staticPosition:k});throw new e.InvalidTypeError(B.type)}const c=32,u=32;function d(C,B={}){const{checksum:H=!1}=B,F=C.readBytes(32);return[(m=>H?t.checksum(m):m)(s.fromBytes(n.slice(F,-20))),32]}function l(C,B,H){const{checksumAddress:F,length:k,staticPosition:m}=H;if(!k){const P=n.toNumber(C.readBytes(u)),S=m+P,q=S+c;C.setPosition(S);const N=n.toNumber(C.readBytes(c)),U=x(B);let L=0;const z=[];for(let D=0;D<N;++D){C.setPosition(q+(U?D*32:L));const[X,W]=o(C,B,{checksumAddress:F,staticPosition:q});L+=W,z.push(X)}return C.setPosition(m+32),[z,32]}if(x(B)){const P=n.toNumber(C.readBytes(u)),S=m+P,q=[];for(let N=0;N<k;++N){C.setPosition(S+N*32);const[U]=o(C,B,{checksumAddress:F,staticPosition:S});q.push(U)}return C.setPosition(m+32),[q,32]}let M=0;const A=[];for(let P=0;P<k;++P){const[S,q]=o(C,B,{checksumAddress:F,staticPosition:m+M});M+=q,A.push(S)}return[A,M]}function f(C){return[n.toBoolean(C.readBytes(32),{size:32}),32]}function b(C,B,{staticPosition:H}){const[F,k]=B.type.split("bytes");if(!k){const M=n.toNumber(C.readBytes(32));C.setPosition(H+M);const A=n.toNumber(C.readBytes(32));if(A===0)return C.setPosition(H+32),["0x",32];const P=C.readBytes(A);return C.setPosition(H+32),[s.fromBytes(P),32]}return[s.fromBytes(C.readBytes(Number.parseInt(k,10),32)),32]}function T(C,B){const H=B.type.startsWith("int"),F=Number.parseInt(B.type.split("int")[1]||"256",10),k=C.readBytes(32);return[F>48?n.toBigInt(k,{signed:H}):n.toNumber(k,{signed:H}),32]}function v(C,B,H){const{checksumAddress:F,staticPosition:k}=H,m=B.components.length===0||B.components.some(({name:P})=>!P),M=m?[]:{};let A=0;if(x(B)){const P=n.toNumber(C.readBytes(u)),S=k+P;for(let q=0;q<B.components.length;++q){const N=B.components[q];C.setPosition(S+A);const[U,L]=o(C,N,{checksumAddress:F,staticPosition:S});A+=L,M[m?q:N?.name]=U}return C.setPosition(k+32),[M,32]}for(let P=0;P<B.components.length;++P){const S=B.components[P],[q,N]=o(C,S,{checksumAddress:F,staticPosition:k});M[m?P:S?.name]=q,A+=N}return[M,A]}function p(C,{staticPosition:B}){const H=n.toNumber(C.readBytes(32)),F=B+H;C.setPosition(F);const k=n.toNumber(C.readBytes(32));if(k===0)return C.setPosition(B+32),["",32];const m=C.readBytes(k,32),M=n.toString(n.trimLeft(m));return C.setPosition(B+32),[M,32]}function O({checksumAddress:C,parameters:B,values:H}){const F=[];for(let k=0;k<B.length;k++)F.push(I({checksumAddress:C,parameter:B[k],value:H[k]}));return F}function I({checksumAddress:C=!1,parameter:B,value:H}){const F=B,k=y(F.type);if(k){const[m,M]=k;return i(H,{checksumAddress:C,length:m,parameter:{...F,type:M}})}if(F.type==="tuple")return w(H,{checksumAddress:C,parameter:F});if(F.type==="address")return j(H,{checksum:C});if(F.type==="bool")return _(H);if(F.type.startsWith("uint")||F.type.startsWith("int")){const m=F.type.startsWith("int"),[,,M="256"]=a.integerRegex.exec(F.type)??[];return E(H,{signed:m,size:Number(M)})}if(F.type.startsWith("bytes"))return g(H,{type:F.type});if(F.type==="string")return R(H);throw new e.InvalidTypeError(F.type)}function h(C){let B=0;for(let m=0;m<C.length;m++){const{dynamic:M,encoded:A}=C[m];M?B+=32:B+=s.size(A)}const H=[],F=[];let k=0;for(let m=0;m<C.length;m++){const{dynamic:M,encoded:A}=C[m];M?(H.push(s.fromNumber(B+k,{size:32})),F.push(A),k+=s.size(A)):H.push(A)}return s.concat(...H,...F)}function j(C,B){const{checksum:H=!1}=B;return t.assert(C,{strict:H}),{dynamic:!1,encoded:s.padLeft(C.toLowerCase())}}function i(C,B){const{checksumAddress:H,length:F,parameter:k}=B,m=F===null;if(!Array.isArray(C))throw new e.InvalidArrayError(C);if(!m&&C.length!==F)throw new e.ArrayLengthMismatchError({expectedLength:F,givenLength:C.length,type:`${k.type}[${F}]`});let M=!1;const A=[];for(let P=0;P<C.length;P++){const S=I({checksumAddress:H,parameter:k,value:C[P]});S.dynamic&&(M=!0),A.push(S)}if(m||M){const P=h(A);if(m){const S=s.fromNumber(A.length,{size:32});return{dynamic:!0,encoded:A.length>0?s.concat(S,P):S}}if(M)return{dynamic:!0,encoded:P}}return{dynamic:!1,encoded:s.concat(...A.map(({encoded:P})=>P))}}function g(C,{type:B}){const[,H]=B.split("bytes"),F=s.size(C);if(!H){let k=C;return F%32!==0&&(k=s.padRight(k,Math.ceil((C.length-2)/2/32)*32)),{dynamic:!0,encoded:s.concat(s.padLeft(s.fromNumber(F,{size:32})),k)}}if(F!==Number.parseInt(H,10))throw new e.BytesSizeMismatchError({expectedSize:Number.parseInt(H,10),value:C});return{dynamic:!1,encoded:s.padRight(C)}}function _(C){if(typeof C!="boolean")throw new r.BaseError(`Invalid boolean value: "${C}" (type: ${typeof C}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:s.padLeft(s.fromBoolean(C))}}function E(C,{signed:B,size:H}
45){if(typeof H=="number"){const F=2n**(BigInt(H)-(B?1n:0n))-1n,k=B?-F-1n:0n;if(C>F||C<k)throw new s.IntegerOutOfRangeError({max:F.toString(),min:k.toString(),signed:B,size:H/8,value:C.toString()})}return{dynamic:!1,encoded:s.fromNumber(C,{size:32,signed:B})}}function R(C){const B=s.fromString(C),H=Math.ceil(s.size(B)/32),F=[];for(let k=0;k<H;k++)F.push(s.padRight(s.slice(B,k*32,(k+1)*32)));return{dynamic:!0,encoded:s.concat(s.padRight(s.fromNumber(s.size(B),{size:32})),...F)}}function w(C,B){const{checksumAddress:H,parameter:F}=B;let k=!1;const m=[];for(let M=0;M<F.components.length;M++){const A=F.components[M],P=Array.isArray(C)?M:A.name,S=I({checksumAddress:H,parameter:A,value:C[P]});m.push(S),S.dynamic&&(k=!0)}return{dynamic:k,encoded:k?h(m):s.concat(...m.map(({encoded:M})=>M))}}function y(C){const B=C.match(/^(.*)\[(\d+)?\]$/);return B?[B[2]?Number(B[2]):null,B[1]]:void 0}function x(C){const{type:B}=C;if(B==="string"||B==="bytes"||B.endsWith("[]"))return!0;if(B==="tuple")return C.components?.some(x);const H=y(C.type);return!!(H&&x({...C,type:H[1]}))}return Ce}var Ht={},Uy;function M_(){if(Uy)return Ht;Uy=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.RecursiveReadLimitExceededError=Ht.PositionOutOfBoundsError=Ht.NegativeOffsetError=void 0,Ht.create=n;const e=gt(),t={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 a({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(o){if(o<0||o>this.bytes.length-1)throw new s({length:this.bytes.length,position:o})},decrementPosition(o){if(o<0)throw new r({offset:o});const c=this.position-o;this.assertPosition(c),this.position=c},getReadCount(o){return this.positionReadCount.get(o||this.position)||0},incrementPosition(o){if(o<0)throw new r({offset:o});const c=this.position+o;this.assertPosition(c),this.position=c},inspectByte(o){const c=o??this.position;return this.assertPosition(c),this.bytes[c]},inspectBytes(o,c){const u=c??this.position;return this.assertPosition(u+o-1),this.bytes.subarray(u,u+o)},inspectUint8(o){const c=o??this.position;return this.assertPosition(c),this.bytes[c]},inspectUint16(o){const c=o??this.position;return this.assertPosition(c+1),this.dataView.getUint16(c)},inspectUint24(o){const c=o??this.position;return this.assertPosition(c+2),(this.dataView.getUint16(c)<<8)+this.dataView.getUint8(c+2)},inspectUint32(o){const c=o??this.position;return this.assertPosition(c+3),this.dataView.getUint32(c)},pushByte(o){this.assertPosition(this.position),this.bytes[this.position]=o,this.position++},pushBytes(o){this.assertPosition(this.position+o.length-1),this.bytes.set(o,this.position),this.position+=o.length},pushUint8(o){this.assertPosition(this.position),this.bytes[this.position]=o,this.position++},pushUint16(o){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,o),this.position+=2},pushUint24(o){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,o>>8),this.dataView.setUint8(this.position+2,o&255),this.position+=3},pushUint32(o){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,o),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const o=this.inspectByte();return this.position++,o},readBytes(o,c){this.assertReadLimit(),this._touch();const u=this.inspectBytes(o);return this.position+=c??o,u},readUint8(){this.assertReadLimit(),this._touch();const o=this.inspectUint8();return this.position+=1,o},readUint16(){this.assertReadLimit(),this._touch();const o=this.inspectUint16();return this.position+=2,o},readUint24(){this.assertReadLimit(),this._touch();const o=this.inspectUint24();return this.position+=3,o},readUint32(){this.assertReadLimit(),this._touch();const o=this.inspectUint32();return this.position+=4,o},get remaining(){return this.bytes.length-this.position},setPosition(o){const c=this.position;return this.assertPosition(o),this.position=o,()=>this.position=c},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const o=this.getReadCount();this.positionReadCount.set(this.position,o+1),o>0&&this.recursiveReadCount++}};function n(o,{recursiveReadLimit:c=8192}={}){const u=Object.create(t);return u.bytes=o,u.dataView=new DataView(o.buffer,o.byteOffset,o.byteLength),u.positionReadCount=new Map,u.recursiveReadLimit=c,u}class r extends e.BaseError{constructor({offset:c}){super(`Offset \`${c}
45\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}Ht.NegativeOffsetError=r;class s extends e.BaseError{constructor({length:c,position:u}){super(`Position \`${u}\` is out of bounds (\`0 < position < ${c}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}Ht.PositionOutOfBoundsError=s;class a extends e.BaseError{constructor({count:c,limit:u}){super(`Recursive read limit of \`${u}\` exceeded (recursive read count: \`${c}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}return Ht.RecursiveReadLimitExceededError=a,Ht}var zy;function hi(){if(zy)return Oe;zy=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.InvalidTypeError=Oe.InvalidArrayError=Oe.LengthMismatchError=Oe.BytesSizeMismatchError=Oe.ArrayLengthMismatchError=Oe.ZeroDataError=Oe.DataSizeTooSmallError=void 0,Oe.decode=u,Oe.encode=d,Oe.encodePacked=l,Oe.format=f,Oe.from=b;const e=mr(),t=dd(),n=kt(),r=gt(),s=We(),a=u2(),o=M_(),c=a0();function u(i,g,_={}){const{as:E="Array",checksumAddress:R=!1}=_,w=typeof g=="string"?n.fromHex(g):g,y=o.create(w);if(n.size(w)===0&&i.length>0)throw new v;if(n.size(w)&&n.size(w)<32)throw new T({data:typeof g=="string"?g:s.fromBytes(g),parameters:i,size:n.size(w)});let x=0;const C=E==="Array"?[]:{};for(let B=0;B<i.length;++B){const H=i[B];y.setPosition(x);const[F,k]=a.decodeParameter(y,H,{checksumAddress:R,staticPosition:0});x+=k,E==="Array"?C.push(F):C[H.name??B]=F}return C}function d(i,g,_){const{checksumAddress:E=!1}=_??{};if(i.length!==g.length)throw new I({expectedLength:i.length,givenLength:g.length});const R=a.prepareParameters({checksumAddress:E,parameters:i,values:g}),w=a.encode(R);return w.length===0?"0x":w}function l(i,g){if(i.length!==g.length)throw new I({expectedLength:i.length,givenLength:g.length});const _=[];for(let E=0;E<i.length;E++){const R=i[E],w=g[E];_.push(l.encode(R,w))}return s.concat(..._)}(function(i){function g(_,E,R=!1){if(_==="address"){const C=E;return t.assert(C),s.padLeft(C.toLowerCase(),R?32:0)}if(_==="string")return s.fromString(E);if(_==="bytes")return E;if(_==="bool")return s.padLeft(s.fromBoolean(E),R?32:1);const w=_.match(c.integerRegex);if(w){const[C,B,H="256"]=w,F=Number.parseInt(H,10)/8;return s.fromNumber(E,{size:R?32:F,signed:B==="int"})}const y=_.match(c.bytesRegex);if(y){const[C,B]=y;if(Number.parseInt(B,10)!==(E.length-2)/2)throw new O({expectedSize:Number.parseInt(B,10),value:E});return s.padRight(E,R?32:0)}const x=_.match(c.arrayRegex);if(x&&Array.isArray(E)){const[C,B]=x,H=[];for(let F=0;F<E.length;F++)H.push(g(B,E[F],!0));return H.length===0?"0x":s.concat(...H)}throw new j(_)}i.encode=g})(l||(Oe.encodePacked=l={}));function f(i){return e.formatAbiParameters(i)}function b(i){return Array.isArray(i)&&typeof i[0]=="string"||typeof i=="string"?e.parseAbiParameters(i):i}class T extends r.BaseError{constructor({data:g,parameters:_,size:E}){super(`Data size of ${E} bytes is too small for given parameters.`,{metaMessages:[`Params: (${e.formatAbiParameters(_)})`,`Data:   ${g} (${E} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}Oe.DataSizeTooSmallError=T;class v extends r.BaseError{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}Oe.ZeroDataError=v;class p extends r.BaseError{constructor({expectedLength:g,givenLength:_,type:E}){super(`Array length mismatch for type \`${E}\`. Expected: \`${g}\`. Given: \`${_}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}Oe.ArrayLengthMismatchError=p;class O extends r.BaseError{constructor({expectedSize:g,value:_}){super(`Size of bytes "${_}" (bytes${s.size(_)}) does not match expected size (bytes${g}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}Oe.BytesSizeMismatchError=O;class I extends r.BaseError{constructor({expectedLength:g,givenLength:_}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${g}`,`Given length (values): ${_}`].join(`
46`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}Oe.LengthMismatchError=I;class h extends r.BaseError{constructor(g){super(`Value \`${g}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}Oe.InvalidArrayError=h;
46class j extends r.BaseError{constructor(g){super(`Type \`${g}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}return Oe.InvalidTypeError=j,Oe}var st={},_t={},Dy;function d2(){if(Dy)return _t;Dy=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.toBytes=s,_t.toHex=a,_t.to=o,_t.decodeRlpCursor=c,_t.readLength=u,_t.readList=d,_t.from=l,_t.fromBytes=f,_t.fromHex=b;const e=kt(),t=gt(),n=We(),r=M_();function s(I){return o(I,"Bytes")}function a(I){return o(I,"Hex")}function o(I,h){const j=h??(typeof I=="string"?"Hex":"Bytes"),i=(()=>{if(typeof I=="string"){if(I.length>3&&I.length%2!==0)throw new n.InvalidLengthError(I);return e.fromHex(I)}return I})(),g=r.create(i,{recursiveReadLimit:Number.POSITIVE_INFINITY});return c(g,j)}function c(I,h="Hex"){if(I.bytes.length===0)return h==="Hex"?n.fromBytes(I.bytes):I.bytes;const j=I.readByte();if(j<128&&I.decrementPosition(1),j<192){const g=u(I,j,128),_=I.readBytes(g);return h==="Hex"?n.fromBytes(_):_}const i=u(I,j,192);return d(I,i,h)}function u(I,h,j){if(j===128&&h<128)return 1;if(h<=j+55)return h-j;if(h===j+55+1)return I.readUint8();if(h===j+55+2)return I.readUint16();if(h===j+55+3)return I.readUint24();if(h===j+55+4)return I.readUint32();throw new t.BaseError("Invalid RLP prefix")}function d(I,h,j){const i=I.position,g=[];for(;I.position-i<h;)g.push(c(I,j));return g}function l(I,h){const{as:j}=h,i=T(I),g=r.create(new Uint8Array(i.length));return i.encode(g),j==="Hex"?n.fromBytes(g.bytes):g.bytes}function f(I,h={}){const{as:j="Bytes"}=h;return l(I,{as:j})}function b(I,h={}){const{as:j="Hex"}=h;return l(I,{as:j})}function T(I){return Array.isArray(I)?v(I.map(h=>T(h))):p(I)}function v(I){const h=I.reduce((g,_)=>g+_.length,0),j=O(h);return{length:h<=55?1+h:1+j+h,encode(g){h<=55?g.pushByte(192+h):(g.pushByte(247+j),j===1?g.pushUint8(h):j===2?g.pushUint16(h):j===3?g.pushUint24(h):g.pushUint32(h));for(const{encode:_}of I)_(g)}}}function p(I){const h=typeof I=="string"?e.fromHex(I):I,j=O(h.length);return{length:h.length===1&&h[0]<128?1:h.length<=55?1+h.length:1+j+h.length,encode(g){h.length===1&&h[0]<128?g.pushBytes(h):h.length<=55?(g.pushByte(128+h.length),g.pushBytes(h)):(g.pushByte(183+j),j===1?g.pushUint8(h.length):j===2?g.pushUint16(h.length):j===3?g.pushUint24(h.length):g.pushUint32(h.length),g.pushBytes(h))}}}function O(I){if(I<=255)return 1;if(I<=65535)return 2;if(I<=16777215)return 3;if(I<=4294967295)return 4;throw new t.BaseError("Length is too large.")}return _t}var ye={},ff={},Lo={},lf={},Gr={},Re={},Gy;function fd(){if(Gy)return Re;Gy=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.isNegativeLE=void 0,Re.mod=d,Re.pow=l,Re.pow2=f,Re.invert=b,Re.tonelliShanks=p,Re.FpSqrt=O,Re.validateField=j,Re.FpPow=i,Re.FpInvertBatch=g,Re.FpDiv=_,Re.FpLegendre=E,Re.FpIsSquare=R,Re.nLength=w,Re.Field=y,Re.FpSqrtOdd=x,Re.FpSqrtEven=C,Re.hashToPrivateScalar=B,Re.getFieldBytesLength=H,Re.getMinHashLength=F,Re.mapHashToField=k;const e=Tr(),t=rn(),n=BigInt(0),r=BigInt(1),s=BigInt(2),a=BigInt(3),o=BigInt(4),c=BigInt(5),u=BigInt(8);function d(m,M){const A=m%M;return A>=n?A:M+A}function l(m,M,A){return i(y(A),m,M)}function f(m,M,A){let P=m;for(;M-- >n;)P*=P,P%=A;return P}function b(m,M){if(m===n)throw new Error("invert: expected non-zero number");if(M<=n)throw new Error("invert: expected positive modulus, got "+M);let A=d(m,M),P=M,S=n,q=r;for(;A!==n;){const U=P/A,L=P%A,z=S-q*U;P=A,A=L,S=q,q=z}if(P!==r)throw new Error("invert: does not exist");return d(S,M)}function T(m,M){const A=(m.ORDER+r)/o,P=m.pow(M,A);if(!m.eql(m.sqr(P),M))throw new Error("Cannot find square root");return P}function v(m,M){const A=(m.ORDER-c)/u,P=m.mul(M,s),S=m.pow(P,A),q=m.mul(M,S),N=m.mul(m.mul(q,s),S),U=m.mul(q,m.sub(N,m.ONE));if(!m.eql(m.sqr(U),M))throw new Error("Cannot find square root");return U}function p(m){if(m<BigInt(3))throw new Error("sqrt is not defined for small field");let M=m-r,A=0;for(;M%s===n;)M/=s,A++;let P=s;const S=y(m);for(;E(S,P)===1;)if(P++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(A===1)return T;let q=S.pow(P,M);const N=(M+r)/s;return function(L,z){if(L.is0(z))return z;if(E(L,z)!==1)throw new Error("Cannot find square root");let D=A,X=L.mul(L.ONE,q),W=L.pow(z,M),Z=L.pow(z,N);for(;!L.eql(W,L.ONE);){if(L.is0(W))return L.ZERO;let J=1,oe=L.sqr(W);for(;!L.eql(oe,L.ONE);)if(J++,oe=L.sqr(oe),J===D)throw new Error("Cannot find square root");const K=r<<BigInt(D-J-1),Y=L.pow(X,K);D=J,X=L.sqr(Y),W=L.mul(W,X),Z=L.mul(Z,Y)}return Z}}function O(m){return m%o===a?T:m%u===c?v:p(m)}const I=(m,M)=>(d(m,M)&r)===r;Re.isNegativeLE=I;const h=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function j(m){const M={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},A=h.reduce((P,S)=>(P[S]="function",P),M);return(0,t.validateObject)(m,A)}function i(m,M,A){if(A<n)throw new Error("invalid exponent, negatives unsupported");if(A===n)return m.ONE;if(A===r)return M;let P=m.ONE,S=M;for(;A>n;)A&r&&(P=m.mul(P,S)),S=m.sqr(S),A>>=r;return P}function g(m,M,A=!1){const P=new Array(M.length).fill(A?m.ZERO:void 0),S=M.reduce((N,U,L)=>m.is0(U)?N:(P[L]=N,m.mul(N,U)),m.ONE),q=m.inv(S);return M.reduceRight((N,U,L)=>m.is0(U)?N:(P[L]=m.mul(N,P[L]),m.mul(N,U)),q),P}function _(m,M,A){return m.mul(M,typeof A=="bigint"?b(A,m.ORDER):m.inv(A))}function E(m,M){const A=(m.ORDER-r)/s,P=m.pow(M,A),S=m.eql(P,m.ONE),q=m.eql(P,m.ZERO),N=m.eql(P,m.neg(m.ONE));if(!S&&!q&&!N)throw new Error("invalid Legendre symbol result");return S?1:q?0:-1}function R(m,M){return E(m,M)===1}function w(m,M){M!==void 0&&(0,e.anumber)(M);const A=M!==void 0?M:m.toString(2).length,P=Math.ceil(A/8);return{nBitLength:A,nByteLength:P}}function y(m,M,A=!1,P={}){if(m<=n)throw new Error("invalid field: expected ORDER > 0, got "+m);const{nBitLength:S,nByteLength:q}=w(m,M);if(q>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let N;const U=Object.freeze({ORDER:m,isLE:A,BITS:S,BYTES:q,MASK:(0,t.bitMask)(S),ZERO:n,ONE:r,create:L=>d(L,m),isValid:L=>{if(typeof L!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof L);return n<=L&&L<m},is0:L=>
46L===n,isOdd:L=>(L&r)===r,neg:L=>d(-L,m),eql:(L,z)=>L===z,sqr:L=>d(L*L,m),add:(L,z)=>d(L+z,m),sub:(L,z)=>d(L-z,m),mul:(L,z)=>d(L*z,m),pow:(L,z)=>i(U,L,z),div:(L,z)=>d(L*b(z,m),m),sqrN:L=>L*L,addN:(L,z)=>L+z,subN:(L,z)=>L-z,mulN:(L,z)=>L*z,inv:L=>b(L,m),sqrt:P.sqrt||(L=>(N||(N=O(m)),N(U,L))),toBytes:L=>A?(0,t.numberToBytesLE)(L,q):(0,t.numberToBytesBE)(L,q),fromBytes:L=>{if(L.length!==q)throw new Error("Field.fromBytes: expected "+q+" bytes, got "+L.length);return A?(0,t.bytesToNumberLE)(L):(0,t.bytesToNumberBE)(L)},invertBatch:L=>g(U,L),cmov:(L,z,D)=>D?z:L});return Object.freeze(U)}function x(m,M){if(!m.isOdd)throw new Error("Field doesn't have isOdd");const A=m.sqrt(M);return m.isOdd(A)?A:m.neg(A)}function C(m,M){if(!m.isOdd)throw new Error("Field doesn't have isOdd");const A=m.sqrt(M);return m.isOdd(A)?m.neg(A):A}function B(m,M,A=!1){m=(0,t.ensureBytes)("privateHash",m);const P=m.length,S=w(M).nByteLength+8;if(S<24||P<S||P>1024)throw new Error("hashToPrivateScalar: expected "+S+"-1024 bytes of input, got "+P);const q=A?(0,t.bytesToNumberLE)(m):(0,t.bytesToNumberBE)(m);return d(q,M-r)+r}function H(m){if(typeof m!="bigint")throw new Error("field order must be bigint");const M=m.toString(2).length;return Math.ceil(M/8)}function F(m){const M=H(m);return M+Math.ceil(M/2)}function k(m,M,A=!1){const P=m.length,S=H(M),q=F(M);if(P<16||P<q||P>1024)throw new Error("expected "+q+"-1024 bytes of input, got "+P);const N=A?(0,t.bytesToNumberLE)(m):(0,t.bytesToNumberBE)(m),U=d(N,M-r)+r;return A?(0,t.numberToBytesLE)(U,S):(0,t.numberToBytesBE)(U,S)}return Re}var Vy;function f2(){if(Vy)return Gr;Vy=1,Object.defineProperty(Gr,"__esModule",{value:!0}),Gr.wNAF=T,Gr.pippenger=v,Gr.precomputeMSMUnsafe=p,Gr.validateBasic=O;const e=fd(),t=rn(),n=BigInt(0),r=BigInt(1);function s(I,h){const j=h.negate();return I?j:h}function a(I,h){if(!Number.isSafeInteger(I)||I<=0||I>h)throw new Error("invalid window size, expected [1.."+h+"], got W="+I)}function o(I,h){a(I,h);const j=Math.ceil(h/I)+1,i=2**(I-1),g=2**I,_=(0,t.bitMask)(I),E=BigInt(I);return{windows:j,windowSize:i,mask:_,maxNumber:g,shiftBy:E}}function c(I,h,j){const{windowSize:i,mask:g,maxNumber:_,shiftBy:E}=j;let R=Number(I&g),w=I>>E;R>i&&(R-=_,w+=r);const y=h*i,x=y+Math.abs(R)-1,C=R===0,B=R<0,H=h%2!==0;return{nextN:w,offset:x,isZero:C,isNeg:B,isNegF:H,offsetF:y}}function u(I,h){if(!Array.isArray(I))throw new Error("array expected");I.forEach((j,i)=>{if(!(j instanceof h))throw new Error("invalid point at index "+i)})}function d(I,h){if(!Array.isArray(I))throw new Error("array of scalars expected");I.forEach((j,i)=>{if(!h.isValid(j))throw new Error("invalid scalar at index "+i)})}const l=new WeakMap,f=new WeakMap;function b(I){return f.get(I)||1}function T(I,h){return{constTimeNegate:s,hasPrecomputes(j){return b(j)!==1},unsafeLadder(j,i,g=I.ZERO){let _=j;for(;i>n;)i&r&&(g=g.add(_)),_=_.double(),i>>=r;return g},precomputeWindow(j,i){const{windows:g,windowSize:_}=o(i,h),E=[];let R=j,w=R;for(let y=0;y<g;y++){w=R,E.push(w);for(let x=1;x<_;x++)w=w.add(R),E.push(w);R=w.double()}return E},wNAF(j,i,g){let _=I.ZERO,E=I.BASE;const R=o(j,h);for(let w=0;w<R.windows;w++){const{nextN:y,offset:x,isZero:C,isNeg:B,isNegF:H,offsetF:F}=c(g,w,R);g=y,C?E=E.add(s(H,i[F])):_=_.add(s(B,i[x]))}return{p:_,f:E}},wNAFUnsafe(j,i,g,_=I.ZERO){const E=o(j,h);for(let R=0;R<E.windows&&g!==n;R++){const{nextN:w,offset:y,isZero:x,isNeg:C}=c(g,R,E);if(g=w,!x){const B=i[y];_=_.add(C?B.negate():B)}}return _},getPrecomputes(j,i,g){let _=l.get(i);return _||(_=this.precomputeWindow(i,j),j!==1&&l.set(i,g(_))),_},wNAFCached(j,i,g){const _=b(j);
46return this.wNAF(_,this.getPrecomputes(_,j,g),i)},wNAFCachedUnsafe(j,i,g,_){const E=b(j);return E===1?this.unsafeLadder(j,i,_):this.wNAFUnsafe(E,this.getPrecomputes(E,j,g),i,_)},setWindowSize(j,i){a(i,h),f.set(j,i),l.delete(j)}}}function v(I,h,j,i){u(j,I),d(i,h);const g=j.length,_=i.length;if(g!==_)throw new Error("arrays of points and scalars must have equal length");const E=I.ZERO,R=(0,t.bitLen)(BigInt(g));let w=1;R>12?w=R-3:R>4?w=R-2:R>0&&(w=2);const y=(0,t.bitMask)(w),x=new Array(Number(y)+1).fill(E),C=Math.floor((h.BITS-1)/w)*w;let B=E;for(let H=C;H>=0;H-=w){x.fill(E);for(let k=0;k<_;k++){const m=i[k],M=Number(m>>BigInt(H)&y);x[M]=x[M].add(j[k])}let F=E;for(let k=x.length-1,m=E;k>0;k--)m=m.add(x[k]),F=F.add(m);if(B=B.add(F),H!==0)for(let k=0;k<w;k++)B=B.double()}return B}function p(I,h,j,i){a(i,h.BITS),u(j,I);const g=I.ZERO,_=2**i-1,E=Math.ceil(h.BITS/i),R=(0,t.bitMask)(i),w=j.map(y=>{const x=[];for(let C=0,B=y;C<_;C++)x.push(B),B=B.add(y);return x});return y=>{if(d(y,h),y.length>j.length)throw new Error("array of scalars must be smaller than array of points");let x=g;for(let C=0;C<E;C++){if(x!==g)for(let H=0;H<i;H++)x=x.double();const B=BigInt(E*i-(C+1)*i);for(let H=0;H<y.length;H++){const F=y[H],k=Number(F>>B&R);k&&(x=x.add(w[H][k-1]))}}return x}}function O(I){return(0,e.validateField)(I.Fp),(0,t.validateObject)(I,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,e.nLength)(I.n,I.nBitLength),...I,p:I.Fp.ORDER})}return Gr}var Wy;function k_(){return Wy||(Wy=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DER=e.DERErr=void 0,e.weierstrassPoints=T,e.weierstrass=p,e.SWUFpSqrtRatio=O,e.mapToCurveSimpleSWU=I;const t=f2(),n=fd(),r=rn();function s(h){h.lowS!==void 0&&(0,r.abool)("lowS",h.lowS),h.prehash!==void 0&&(0,r.abool)("prehash",h.prehash)}function a(h){const j=(0,t.validateBasic)(h);(0,r.validateObject)(j,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:i,Fp:g,a:_}=j;if(i){if(!g.eql(_,g.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof i!="object"||typeof i.beta!="bigint"||typeof i.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...j})}class o extends Error{constructor(j=""){super(j)}}e.DERErr=o,e.DER={Err:o,_tlv:{encode:(h,j)=>{const{Err:i}=e.DER;if(h<0||h>256)throw new i("tlv.encode: wrong tag");if(j.length&1)throw new i("tlv.encode: unpadded data");const g=j.length/2,_=(0,r.numberToHexUnpadded)(g);if(_.length/2&128)throw new i("tlv.encode: long form length too big");const E=g>127?(0,r.numberToHexUnpadded)(_.length/2|128):"";return(0,r.numberToHexUnpadded)(h)+E+_+j},decode(h,j){const{Err:i}=e.DER;let g=0;if(h<0||h>256)throw new i("tlv.encode: wrong tag");if(j.length<2||j[g++]!==h)throw new i("tlv.decode: wrong tlv");const _=j[g++],E=!!(_&128);let R=0;if(!E)R=_;else{const y=_&127;
46if(!y)throw new i("tlv.decode(long): indefinite length not supported");if(y>4)throw new i("tlv.decode(long): byte length is too big");const x=j.subarray(g,g+y);if(x.length!==y)throw new i("tlv.decode: length bytes not complete");if(x[0]===0)throw new i("tlv.decode(long): zero leftmost byte");for(const C of x)R=R<<8|C;if(g+=y,R<128)throw new i("tlv.decode(long): not minimal encoding")}const w=j.subarray(g,g+R);if(w.length!==R)throw new i("tlv.decode: wrong value length");return{v:w,l:j.subarray(g+R)}}},_int:{encode(h){const{Err:j}=e.DER;if(h<u)throw new j("integer: negative integers are not allowed");let i=(0,r.numberToHexUnpadded)(h);if(Number.parseInt(i[0],16)&8&&(i="00"+i),i.length&1)throw new j("unexpected DER parsing assertion: unpadded hex");return i},decode(h){const{Err:j}=e.DER;if(h[0]&128)throw new j("invalid signature integer: negative");if(h[0]===0&&!(h[1]&128))throw new j("invalid signature integer: unnecessary leading zero");return(0,r.bytesToNumberBE)(h)}},toSig(h){const{Err:j,_int:i,_tlv:g}=e.DER,_=(0,r.ensureBytes)("signature",h),{v:E,l:R}=g.decode(48,_);if(R.length)throw new j("invalid signature: left bytes after parsing");const{v:w,l:y}=g.decode(2,E),{v:x,l:C}=g.decode(2,y);if(C.length)throw new j("invalid signature: left bytes after parsing");return{r:i.decode(w),s:i.decode(x)}},hexFromSig(h){const{_tlv:j,_int:i}=e.DER,g=j.encode(2,i.encode(h.r)),_=j.encode(2,i.encode(h.s)),E=g+_;return j.encode(48,E)}};function c(h,j){return(0,r.bytesToHex)((0,r.numberToBytesBE)(h,j))}const u=BigInt(0),d=BigInt(1),l=BigInt(2),f=BigInt(3),b=BigInt(4);function T(h){const j=a(h),{Fp:i}=j,g=(0,n.Field)(j.n,j.nBitLength),_=j.toBytes||((S,q,N)=>{const U=q.toAffine();return(0,r.concatBytes)(Uint8Array.from([4]),i.toBytes(U.x),i.toBytes(U.y))}),E=j.fromBytes||(S=>{const q=S.subarray(1),N=i.fromBytes(q.subarray(0,i.BYTES)),U=i.fromBytes(q.subarray(i.BYTES,2*i.BYTES));return{x:N,y:U}});function R(S){const{a:q,b:N}=j,U=i.sqr(S),L=i.mul(U,S);return i.add(i.add(L,i.mul(S,q)),N)}function w(S,q){const N=i.sqr(q),U=R(S);return i.eql(N,U)}if(!w(j.Gx,j.Gy))throw new Error("bad curve params: generator point");const y=i.mul(i.pow(j.a,f),b),x=i.mul(i.sqr(j.b),BigInt(27));if(i.is0(i.add(y,x)))throw new Error("bad curve params: a or b");function C(S){return(0,r.inRange)(S,d,j.n)}function B(S){const{allowedPrivateKeyLengths:q,nByteLength:N,wrapPrivateKey:U,n:L}=j;if(q&&typeof S!="bigint"){if((0,r.isBytes)(S)&&(S=(0,r.bytesToHex)(S)),typeof S!="string"||!q.includes(S.length))throw new Error("invalid private key");S=S.padStart(N*2,"0")}let z;try{z=typeof S=="bigint"?S:(0,r.bytesToNumberBE)((0,r.ensureBytes)("private key",S,N))}catch{throw new Error("invalid private key, expected hex or "+N+" bytes, got "+typeof S)}return U&&(z=(0,n.mod)(z,L)),(0,r.aInRange)("private key",z,d,L),z}function H(S){if(!(S instanceof m))throw new Error("ProjectivePoint expected")}const F=(0,r.memoized)((S,q)=>{const{px:N,py:U,pz:L}=S;if(i.eql(L,i.ONE))return{x:N,y:U};const z=S.is0();q==null&&(q=z?i.ONE:i.inv(L));const D=i.mul(N,q),X=i.mul(U,q),W=i.mul(L,q);if(z)return{x:i.ZERO,y:i.ZERO};if(!i.eql(W,i.ONE))throw new Error("invZ was invalid");return{x:D,y:X}}),k=(0,r.memoized)(S=>{if(S.is0()){if(j.allowInfinityPoint&&!i.is0(S.py))return;throw new Error("bad point: ZERO")}const{x:q,y:N}=S.toAffine();if(!i.isValid(q)||!i.isValid(N))throw new Error("bad point: x or y not FE");if(!w(q,N))throw new Error("bad point: equation left != right");if(!S.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class m{constructor(q,N,U){if(q==null||!i.isValid(q))throw new Error("x required");if(N==null||!i.isValid(N)||i.is0(N))throw new Error("y required");if(U==null||!i.isValid(U))throw new Error("z required");this.px=q,this.py=N,this.pz=U,Object.freeze(this)}static fromAffine(q){const{x:N,y:U}=q||{};if(!q||!i.isValid(N)||!i.isValid(U))throw new Error("invalid affine point");if(q instanceof m)throw new Error("projective point not allowed");const L=z=>i.eql(z,i.ZERO);return L(N)&&L(U)?m.ZERO:new m(N,U,i.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(q){const N=(0,n.FpInvertBatch)(i,q.map(U=>U.pz));return q.map((U,L)=>U.toAffine(N[L])).map(m.fromAffine)}static fromHex(q){const N=m.fromAffine(E((0,r.ensureBytes)("pointHex",q)));return N.assertValidity(),N}static fromPrivateKey(q){return m.BASE.multiply(B(q))}static msm(q,N){return(0,t.pippenger)(m,g,q,N)}_setWindowSize(q){P.setWindowSize(this,q)}assertValidity(){k(this)}hasEvenY(){const{y:q}=this.toAffine();if(i.isOdd)return!i.isOdd(q);throw new Error("Field doesn't support isOdd")}equals(q){H(q);const{px:N,py:U,pz:L}=this,{px:z,py:D,pz:X}=q,W=i.eql(i.mul(N,X),i.mul(z,L)),Z=i.eql(i.mul(U,X),i.mul(D,L));return W&&Z}negate(){return new m(this.px,i.neg(this.py),this.pz)}double(){const{a:q,b:N}=j,U=i.mul(N,f),{px:L,py:z,pz:D}=this;let X=i.ZERO,W=i.ZERO,Z=i.ZERO,J=i.mul(L,L),oe=i.mul(z,z),K=i.mul(D,D),Y=i.mul(L,z);return Y=i.add(Y,Y),Z=i.mul(L,D),Z=i.add(Z,Z),X=i.mul(q,Z),W=i.mul(U,K),W=i.add(X,W),X=i.sub(oe,W),W=i.add(oe,W),W=i.mul(X,W),X=i.mul(Y,X),Z=i.mul(U,Z),K=i.mul(q,K),Y=i.sub(J,K),Y=i.mul(q,Y),Y=i.add(Y,Z),Z=i.add(J,J),J=i.add(Z,J),J=i.add(J,K),J=i.mul(J,Y),W=i.add(W,J),K=i.mul(z,D),K=i.add(K,K),J=i.mul(K,Y),X=i.sub(X,J),Z=i.mul(K,oe),Z=i.add(Z,Z),Z=i.add(Z,Z),new m(X,W,Z)}add(q){H(q);const{px:N,py:U,pz:L}=this,{px:z,py:D,pz:X}=q;let W=i.ZERO,Z=i.ZERO,J=i.ZERO;const oe=j.a,K=i.mul(j.b,f);let Y=i.mul(N,z),$=i.mul(U,D),re=i.mul(L,X),ee=i.add(N,U),ne=i.add(z,D);ee=i.mul(ee,ne),ne=i.add(Y,$),ee=i.sub(ee,ne),ne=i.add(N,L);let se=i.add(z,X);return ne=i.mul(ne,se),se=i.add(Y,re),ne=i.sub(ne,se),se=i.add(U,L),W=i.add(D,X),se=i.mul(se,W),W=i.add($,re),se=i.sub(se,W),J=i.mul(oe,ne),W=i.mul(K,re),J=i.add(W,J),W=i.sub($,J),J=i.add($,J),Z=i.mul(W,J),$=i.add(Y,Y),$=i.add($,Y),re=i.mul(oe,re),ne=i.mul(K,ne),$=i.add($,re),re=i.sub(Y,re),re=i.mul(oe,re),ne=i.add(ne,re),Y=i.mul($,ne),Z=i.add(Z,Y),Y=i.mul(se,ne),W=i.mul(ee,W),W=i.sub(W,Y),Y=i.mul(ee,$),J=i.mul(se,J),J=i.add(J,Y),new m(W,Z,J)}subtract(q){return this.add(q.negate())}is0(){return this.equals(m.ZERO)}wNAF(q){return P.wNAFCached(this,q,m.normalizeZ)}
46multiplyUnsafe(q){const{endo:N,n:U}=j;(0,r.aInRange)("scalar",q,u,U);const L=m.ZERO;if(q===u)return L;if(this.is0()||q===d)return this;if(!N||P.hasPrecomputes(this))return P.wNAFCachedUnsafe(this,q,m.normalizeZ);let{k1neg:z,k1:D,k2neg:X,k2:W}=N.splitScalar(q),Z=L,J=L,oe=this;for(;D>u||W>u;)D&d&&(Z=Z.add(oe)),W&d&&(J=J.add(oe)),oe=oe.double(),D>>=d,W>>=d;return z&&(Z=Z.negate()),X&&(J=J.negate()),J=new m(i.mul(J.px,N.beta),J.py,J.pz),Z.add(J)}multiply(q){const{endo:N,n:U}=j;(0,r.aInRange)("scalar",q,d,U);let L,z;if(N){const{k1neg:D,k1:X,k2neg:W,k2:Z}=N.splitScalar(q);let{p:J,f:oe}=this.wNAF(X),{p:K,f:Y}=this.wNAF(Z);J=P.constTimeNegate(D,J),K=P.constTimeNegate(W,K),K=new m(i.mul(K.px,N.beta),K.py,K.pz),L=J.add(K),z=oe.add(Y)}else{const{p:D,f:X}=this.wNAF(q);L=D,z=X}return m.normalizeZ([L,z])[0]}multiplyAndAddUnsafe(q,N,U){const L=m.BASE,z=(X,W)=>W===u||W===d||!X.equals(L)?X.multiplyUnsafe(W):X.multiply(W),D=z(this,N).add(z(q,U));return D.is0()?void 0:D}toAffine(q){return F(this,q)}isTorsionFree(){const{h:q,isTorsionFree:N}=j;if(q===d)return!0;if(N)return N(m,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:q,clearCofactor:N}=j;return q===d?this:N?N(m,this):this.multiplyUnsafe(j.h)}toRawBytes(q=!0){return(0,r.abool)("isCompressed",q),this.assertValidity(),_(m,this,q)}toHex(q=!0){return(0,r.abool)("isCompressed",q),(0,r.bytesToHex)(this.toRawBytes(q))}}m.BASE=new m(j.Gx,j.Gy,i.ONE),m.ZERO=new m(i.ZERO,i.ONE,i.ZERO);const{endo:M,nBitLength:A}=j,P=(0,t.wNAF)(m,M?Math.ceil(A/2):A);return{CURVE:j,ProjectivePoint:m,normPrivateKeyToScalar:B,weierstrassEquation:R,isWithinCurveOrder:C}}function v(h){const j=(0,t.validateBasic)(h);return(0,r.validateObject)(j,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...j})}function p(h){const j=v(h),{Fp:i,n:g,nByteLength:_,nBitLength:E}=j,R=i.BYTES+1,w=2*i.BYTES+1;function y(K){return(0,n.mod)(K,g)}function x(K){return(0,n.invert)(K,g)}const{ProjectivePoint:C,normPrivateKeyToScalar:B,weierstrassEquation:H,isWithinCurveOrder:F}=T({...j,toBytes(K,Y,$){const re=Y.toAffine(),ee=i.toBytes(re.x),ne=r.concatBytes;return(0,r.abool)("isCompressed",$),$?ne(Uint8Array.from([Y.hasEvenY()?2:3]),ee):ne(Uint8Array.from([4]),ee,i.toBytes(re.y))},fromBytes(K){const Y=K.length,$=K[0],re=K.subarray(1);if(Y===R&&($===2||$===3)){const ee=(0,r.bytesToNumberBE)(re);if(!(0,r.inRange)(ee,d,i.ORDER))throw new Error("Point is not on curve");const ne=H(ee);let se;try{se=i.sqrt(ne)}catch(be){const me=be instanceof Error?": "+be.message:"";throw new Error("Point is not on curve"+me)}const te=(se&d)===d;return($&1)===1!==te&&(se=i.neg(se)),{x:ee,y:se}}else if(Y===w&&$===4){const ee=i.fromBytes(re.subarray(0,i.BYTES)),ne=i.fromBytes(re.subarray(i.BYTES,2*i.BYTES));return{x:ee,y:ne}}else{const ee=R,ne=w;throw new Error("invalid Point, expected length of "+ee+", or uncompressed "+ne+", got "+Y)}}});function k(K){const Y=g>>d;return K>Y}function m(K){return k(K)?y(-K):K}const M=(K,Y,$)=>(0,r.bytesToNumberBE)(K.slice(Y,$));class A{constructor(Y,$,re){(0,r.aInRange)("r",Y,d,g),(0,r.aInRange)("s",$,d,g),this.r=Y,this.s=$,re!=null&&(this.recovery=re),Object.freeze(this)}static fromCompact(Y){const $=_;return Y=(0,r.ensureBytes)("compactSignature",Y,$*2),new A(M(Y,0,$),M(Y,$,2*$))}static fromDER(Y){const{r:$,s:re}=e.DER.toSig((0,r.ensureBytes)("DER",Y));return new A($,re)}assertValidity(){}addRecoveryBit(Y){return new A(this.r,this.s,Y)}recoverPublicKey(Y){const{r:$,s:re,recovery:ee}=this,ne=L((0,r.ensureBytes)("msgHash",Y));if(ee==null||![0,1,2,3].includes(ee))throw new Error("recovery id invalid");const se=ee===2||ee===3?$+j.n:$;if(se>=i.ORDER)throw new Error("recovery id 2 or 3 invalid");const te=(ee&1)===0?"02":"03",Q=C.fromHex(te+c(se,i.BYTES)),be=x(se),me=y(-ne*be),ze=y(re*be),Ae=C.BASE.multiplyAndAddUnsafe(Q,me,ze);if(!Ae)throw new Error("point at infinify");return Ae.assertValidity(),Ae}hasHighS(){return k(this.s)}normalizeS(){return this.hasHighS()?new A(this.r,y(-this.s),this.recovery):this}toDERRawBytes(){return(0,r.hexToBytes)(this.toDERHex())}toDERHex(){return e.DER.hexFromSig(this)}toCompactRawBytes(){return(0,r.hexToBytes)(this.toCompactHex())}toCompactHex(){const Y=_;return c(this.r,Y)+c(this.s,Y)}}const P={isValidPrivateKey(K){try{return B(K),!0}catch{return!1}},normPrivateKeyToScalar:B,randomPrivateKey:()=>{const K=(0,n.getMinHashLength)(j.n);return(0,n.mapHashToField)(j.randomBytes(K),j.n)},precompute(K=8,Y=C.BASE){return Y._setWindowSize(K),Y.multiply(BigInt(3)),Y}};function S(K,Y=!0){return C.fromPrivateKey(K).toRawBytes(Y)}function q(K){if(typeof K=="bigint")return!1;if(K instanceof C)return!0;const $=(0,r.ensureBytes)("key",K).length,re=i.BYTES,ee=re+1,ne=2*re+1;if(!(j.allowedPrivateKeyLengths||_===ee))return $===ee||$===ne}function N(K,Y,$=!0){if(q(K)===!0)throw new Error("first arg must be private key");if(q(Y)===!1)throw new Error("second arg must be public key");return C.fromHex(Y).multiply(B(K)).toRawBytes($)}const U=j.bits2int||function(K){if(K.length>8192)throw new Error("input is too large");
46const Y=(0,r.bytesToNumberBE)(K),$=K.length*8-E;return $>0?Y>>BigInt($):Y},L=j.bits2int_modN||function(K){return y(U(K))},z=(0,r.bitMask)(E);function D(K){return(0,r.aInRange)("num < 2^"+E,K,u,z),(0,r.numberToBytesBE)(K,_)}function X(K,Y,$=W){if(["recovered","canonical"].some(Me=>Me in $))throw new Error("sign() legacy options not supported");const{hash:re,randomBytes:ee}=j;let{lowS:ne,prehash:se,extraEntropy:te}=$;ne==null&&(ne=!0),K=(0,r.ensureBytes)("msgHash",K),s($),se&&(K=(0,r.ensureBytes)("prehashed msgHash",re(K)));const Q=L(K),be=B(Y),me=[D(be),D(Q)];if(te!=null&&te!==!1){const Me=te===!0?ee(i.BYTES):te;me.push((0,r.ensureBytes)("extraEntropy",Me))}const ze=(0,r.concatBytes)(...me),Ae=Q;function Xe(Me){const Te=U(Me);if(!F(Te))return;const pt=x(Te),Ke=C.BASE.multiply(Te).toAffine(),Ue=y(Ke.x);if(Ue===u)return;const Ze=y(pt*y(Ae+Ue*be));if(Ze===u)return;let De=(Ke.x===Ue?0:2)|Number(Ke.y&d),Ct=Ze;return ne&&k(Ze)&&(Ct=m(Ze),De^=1),new A(Ue,Ct,De)}return{seed:ze,k2sig:Xe}}const W={lowS:j.lowS,prehash:!1},Z={lowS:j.lowS,prehash:!1};function J(K,Y,$=W){const{seed:re,k2sig:ee}=X(K,Y,$),ne=j;return(0,r.createHmacDrbg)(ne.hash.outputLen,ne.nByteLength,ne.hmac)(re,ee)}C.BASE._setWindowSize(8);function oe(K,Y,$,re=Z){const ee=K;Y=(0,r.ensureBytes)("msgHash",Y),$=(0,r.ensureBytes)("publicKey",$);const{lowS:ne,prehash:se,format:te}=re;if(s(re),"strict"in re)throw new Error("options.strict was renamed to lowS");if(te!==void 0&&te!=="compact"&&te!=="der")throw new Error("format must be compact or der");const Q=typeof ee=="string"||(0,r.isBytes)(ee),be=!Q&&!te&&typeof ee=="object"&&ee!==null&&typeof ee.r=="bigint"&&typeof ee.s=="bigint";if(!Q&&!be)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let me,ze;try{if(be&&(me=new A(ee.r,ee.s)),Q){try{te!=="compact"&&(me=A.fromDER(ee))}catch(De){if(!(De instanceof e.DER.Err))throw De}!me&&te!=="der"&&(me=A.fromCompact(ee))}ze=C.fromHex($)}catch{return!1}if(!me||ne&&me.hasHighS())return!1;se&&(Y=j.hash(Y));const{r:Ae,s:Xe}=me,Me=L(Y),Te=x(Xe),pt=y(Me*Te),Ke=y(Ae*Te),Ue=C.BASE.multiplyAndAddUnsafe(ze,pt,Ke)?.toAffine();return Ue?y(Ue.x)===Ae:!1}return{CURVE:j,getPublicKey:S,getSharedSecret:N,sign:J,verify:oe,ProjectivePoint:C,Signature:A,utils:P}}function O(h,j){const i=h.ORDER;let g=u;for(let k=i-d;k%l===u;k/=l)g+=d;const _=g,E=l<<_-d-d,R=E*l,w=(i-d)/R,y=(w-d)/l,x=R-d,C=E,B=h.pow(j,w),H=h.pow(j,(w+d)/l);let F=(k,m)=>{let M=B,A=h.pow(m,x),P=h.sqr(A);P=h.mul(P,m);let S=h.mul(k,P);S=h.pow(S,y),S=h.mul(S,A),A=h.mul(S,m),P=h.mul(S,k);let q=h.mul(P,A);S=h.pow(q,C);let N=h.eql(S,h.ONE);A=h.mul(P,H),S=h.mul(q,M),P=h.cmov(A,P,N),q=h.cmov(S,q,N);for(let U=_;U>d;U--){let L=U-l;L=l<<L-d;let z=h.pow(q,L);const D=h.eql(z,h.ONE);A=h.mul(P,M),M=h.mul(M,M),z=h.mul(q,M),P=h.cmov(A,P,D),q=h.cmov(z,q,D)}return{isValid:N,value:P}};if(h.ORDER%b===f){const k=(h.ORDER-f)/b,m=h.sqrt(h.neg(j));F=(M,A)=>{let P=h.sqr(A);const S=h.mul(M,A);P=h.mul(P,S);let q=h.pow(P,k);q=h.mul(q,S);const N=h.mul(q,m),U=h.mul(h.sqr(q),A),L=h.eql(U,M);let z=h.cmov(N,q,L);return{isValid:L,value:z}}}return F}function I(h,j){if((0,n.validateField)(h),!h.isValid(j.A)||!h.isValid(j.B)||!h.isValid(j.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const i=O(h,j.Z);if(!h.isOdd)throw new Error("Fp.isOdd is not implemented!");return g=>{let _,E,R,w,y,x,C,B;_=h.sqr(g),_=h.mul(_,j.Z),E=h.sqr(_),E=h.add(E,_),R=h.add(E,h.ONE),R=h.mul(R,j.B),w=h.cmov(j.Z,h.neg(E),!h.eql(E,h.ZERO)),w=h.mul(w,j.A),E=h.sqr(R),x=h.sqr(w),y=h.mul(x,j.A),E=h.add(E,y),E=h.mul(E,R),x=h.mul(x,w),y=h.mul(x,j.B),E=h.add(E,y),C=h.mul(_,R);const{isValid:H,value:F}=i(E,x);B=h.mul(_,g),B=h.mul(B,F),C=h.cmov(C,R,H),B=h.cmov(B,F,H);const k=h.isOdd(g)===h.isOdd(B);B=h.cmov(h.neg(B),B,k);const m=(0,n.FpInvertBatch)(h,[w],!0)[0];return C=h.mul(C,m),{x:C,y:B}}}})(lf)),lf}var Ky;function l2(){if(Ky)return Lo;Ky=1,Object.defineProperty(Lo,"__esModule",{value:!0}),Lo.getHash=r,Lo.createCurve=s;const e=R_(),t=Tr(),n=k_();function r(a){return{hash:a,hmac:(o,...c)=>(0,e.hmac)(a,o,(0,t.concatBytes)(...c)),randomBytes:t.randomBytes}}function s(a,o){const c=u=>(0,n.weierstrass)({...a,...r(u)});return{...c(o),create:c}}return Lo}var lr={},Zy;function b2(){if(Zy)return lr;
46Zy=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.expand_message_xmd=o,lr.expand_message_xof=c,lr.hash_to_field=u,lr.isogenyMap=d,lr.createHasher=l;const e=fd(),t=rn(),n=t.bytesToNumberBE;function r(f,b){if(a(f),a(b),f<0||f>=1<<8*b)throw new Error("invalid I2OSP input: "+f);const T=Array.from({length:b}).fill(0);for(let v=b-1;v>=0;v--)T[v]=f&255,f>>>=8;return new Uint8Array(T)}function s(f,b){const T=new Uint8Array(f.length);for(let v=0;v<f.length;v++)T[v]=f[v]^b[v];return T}function a(f){if(!Number.isSafeInteger(f))throw new Error("number expected")}function o(f,b,T,v){(0,t.abytes)(f),(0,t.abytes)(b),a(T),b.length>255&&(b=v((0,t.concatBytes)((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-"),b)));const{outputLen:p,blockLen:O}=v,I=Math.ceil(T/p);if(T>65535||I>255)throw new Error("expand_message_xmd: invalid lenInBytes");const h=(0,t.concatBytes)(b,r(b.length,1)),j=r(0,O),i=r(T,2),g=new Array(I),_=v((0,t.concatBytes)(j,f,i,r(0,1),h));g[0]=v((0,t.concatBytes)(_,r(1,1),h));for(let R=1;R<=I;R++){const w=[s(_,g[R-1]),r(R+1,1),h];g[R]=v((0,t.concatBytes)(...w))}return(0,t.concatBytes)(...g).slice(0,T)}function c(f,b,T,v,p){if((0,t.abytes)(f),(0,t.abytes)(b),a(T),b.length>255){const O=Math.ceil(2*v/8);b=p.create({dkLen:O}).update((0,t.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(b).digest()}if(T>65535||b.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return p.create({dkLen:T}).update(f).update(r(T,2)).update(b).update(r(b.length,1)).digest()}function u(f,b,T){(0,t.validateObject)(T,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:v,k:p,m:O,hash:I,expand:h,DST:j}=T;(0,t.abytes)(f),a(b);const i=typeof j=="string"?(0,t.utf8ToBytes)(j):j,g=v.toString(2).length,_=Math.ceil((g+p)/8),E=b*O*_;let R;if(h==="xmd")R=o(f,i,E,I);else if(h==="xof")R=c(f,i,E,p,I);else if(h==="_internal_pass")R=f;else throw new Error('expand must be "xmd" or "xof"');const w=new Array(b);for(let y=0;y<b;y++){const x=new Array(O);for(let C=0;C<O;C++){const B=_*(C+y*O),H=R.subarray(B,B+_);x[C]=(0,e.mod)(n(H),v)}w[y]=x}return w}function d(f,b){const T=b.map(v=>Array.from(v).reverse());return(v,p)=>{const[O,I,h,j]=T.map(_=>_.reduce((E,R)=>f.add(f.mul(E,v),R))),[i,g]=(0,e.FpInvertBatch)(f,[I,j],!0);return v=f.mul(O,i),p=f.mul(p,f.mul(h,g)),{x:v,y:p}}}function l(f,b,T){if(typeof b!="function")throw new Error("mapToCurve() must be defined");function v(O){return f.fromAffine(b(O))}function p(O){const I=O.clearCofactor();return I.equals(f.ZERO)?f.ZERO:(I.assertValidity(),I)}return{defaults:T,hashToCurve(O,I){const h=u(O,2,{...T,DST:T.DST,...I}),j=v(h[0]),i=v(h[1]);return p(j.add(i))},encodeToCurve(O,I){const h=u(O,1,{...T,DST:T.encodeDST,...I});return p(v(h[0]))},mapToCurve(O){if(!Array.isArray(O))throw new Error("expected array of bigints");for(const I of O)if(typeof I!="bigint")throw new Error("expected array of bigints");return p(v(O))}}}return lr}var Yy;function N_(){return Yy||(Yy=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodeToCurve=e.hashToCurve=e.secp256k1_hasher=e.schnorr=e.secp256k1=void 0;const t=q_(),n=Tr(),r=l2(),s=b2(),a=fd(),o=rn(),c=k_(),u=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),d=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),l=BigInt(0),f=BigInt(1),b=BigInt(2),T=(m,M)=>(m+M/b)/M;function v(m){const M=u,A=BigInt(3),P=BigInt(6),S=BigInt(11),q=BigInt(22),N=BigInt(23),U=BigInt(44),L=BigInt(88),z=m*m*m%M,D=z*z*m%M,X=(0,a.pow2)(D,A,M)*D%M,W=(0,a.pow2)(X,A,M)*D%M,Z=(0,a.pow2)(W,b,M)*z%M,J=(0,a.pow2)(Z,S,M)*Z%M,oe=(0,a.pow2)(J,q,M)*J%M,K=(0,a.pow2)(oe,U,M)*oe%M,Y=(0,a.pow2)(K,L,M)*K%M,$=(0,a.pow2)(Y,U,M)*oe%M,re=(0,a.pow2)($,A,M)*D%M,ee=(0,a.pow2)(re,N,M)*J%M,ne=(0,a.pow2)(ee,P,M)*z%M,se=(0,a.pow2)(ne,b,M);if(!p.eql(p.sqr(se),m))throw new Error("Cannot find square root");return se}const p=(0,a.Field)(u,void 0,void 0,{sqrt:v});e.secp256k1=(0,r.createCurve)({a:l,b:BigInt(7),Fp:p,n:d,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:m=>{const M=d,A=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),P=-f*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),S=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),q=A,N=BigInt("0x100000000000000000000000000000000"),U=T(q*m,M),L=T(-P*m,M);let z=(0,a.mod)(m-U*A-L*S,M),D=(0,a.mod)(-U*P-L*q,M);const X=z>N,W=D>N;if(X&&(z=M-z),W&&(D=M-D),z>N||D>N)throw new Error("splitScalar: Endomorphism failed, k="+m);return{k1neg:X,k1:z,k2neg:W,k2:D}}}},t.sha256);const O={};function I(m,...M){let A=O[m];if(A===void 0){const P=(0,t.sha256)(Uint8Array.from(m,S=>S.charCodeAt(0)));A=(0,o.concatBytes)(P,P),O[m]=A}return(0,t.sha256)((0,o.concatBytes)(A,...M))}const h=m=>m.toRawBytes(!0).slice(1),j=m=>(0,o.numberToBytesBE)(m,32),i=m=>(0,a.mod)(m,u),g=m=>(0,a.mod)(m,d),_=e.secp256k1.ProjectivePoint,E=(m,M,A)=>_.BASE.multiplyAndAddUnsafe(m,M,A);function R(m){let M=e.secp256k1.utils.normPrivateKeyToScalar(m),A=_.fromPrivateKey(M);return{scalar:A.hasEvenY()?M:g(-M),bytes:h(A)}}function w(m){(0,o.aInRange)("x",m,f,u);const M=i(m*m),A=i(M*m+BigInt(7));let P=v(A);P%b!==l&&(P=i(-P));const S=new _(m,P,f);return S.assertValidity(),S}const y=o.bytesToNumberBE;function x(...m){return g(y(I("BIP0340/challenge",...m)))}function C(m){return R(m).bytes}function B(m,M,A=(0,n.randomBytes)(32)){const P=(0,o.ensureBytes)("message",m),{bytes:S,scalar:q}=R(M),N=(0,o.ensureBytes)("auxRand",A,32),U=j(q^y(I("BIP0340/aux",N))),L=I("BIP0340/nonce",U,S,P),z=g(y(L));if(z===l)throw new Error("sign failed: k is zero");const{bytes:D,scalar:X}=R(z),W=x(D,S,P),Z=new Uint8Array(64);if(Z.set(D,0),Z.set(j(g(X+W*q)),32),!H(Z,P,S))throw new Error("sign: Invalid signature produced");return Z}function H(m,M,A){const P=(0,o.ensureBytes)("signature",m,64),S=(0,o.ensureBytes)("message",M),q=(0,o.ensureBytes)("publicKey",A,32);try{const N=w(y(q)),U=y(P.subarray(0,32));if(!(0,o.inRange)(U,f,u))return!1;const L=y(P.subarray(32,64));if(!(0,o.inRange)(L,f,d))return!1;const z=x(j(U),h(N),S),D=E(N,L,g(-z));return!(!D||!D.hasEvenY()||D.toAffine().x!==U)}catch{return!1}}e.schnorr={getPublicKey:C,sign:B,verify:H,utils:{randomPrivateKey:e.secp256k1.utils.randomPrivateKey,lift_x:w,pointToBytes:h,numberToBytesBE:o.numberToBytesBE,bytesToNumberBE:o.bytesToNumberBE,taggedHash:I,mod:a.mod}};const F=(0,s.isogenyMap)(p,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a4
4613deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(m=>m.map(M=>BigInt(M)))),k=(0,c.mapToCurveSimpleSWU)(p,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:p.create(BigInt("-11"))});e.secp256k1_hasher=(0,s.createHasher)(e.secp256k1.ProjectivePoint,m=>{const{x:M,y:A}=k(p.create(m[0]));return F(M,A)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:p.ORDER,m:1,k:128,expand:"xmd",hash:t.sha256}),e.hashToCurve=e.secp256k1_hasher.hashToCurve,e.encodeToCurve=e.secp256k1_hasher.encodeToCurve})(ff)),ff}var Jy;function F_(){if(Jy)return ye;Jy=1,Object.defineProperty(ye,"__esModule",{value:!0}),ye.InvalidVError=ye.InvalidYParityError=ye.InvalidSError=ye.InvalidRError=ye.MissingPropertiesError=ye.InvalidSerializedSizeError=void 0,ye.assert=o,ye.fromBytes=c,ye.fromHex=u,ye.extract=d,ye.from=l,ye.fromDerBytes=f,ye.fromDerHex=b,ye.fromLegacy=T,ye.fromRpc=v,ye.fromTuple=p,ye.toBytes=O,ye.toHex=I,ye.toDerBytes=h,ye.toDerHex=j,ye.toLegacy=i,ye.toRpc=g,ye.toTuple=_,ye.validate=E,ye.vToYParity=R,ye.yParityToV=w;const e=N_(),t=kt(),n=gt(),r=We(),s=ed(),a=a0();function o(k,m={}){const{recovered:M}=m;if(typeof k.r>"u")throw new x({signature:k});if(typeof k.s>"u")throw new x({signature:k});if(M&&typeof k.yParity>"u")throw new x({signature:k});if(k.r<0n||k.r>a.maxUint256)throw new C({value:k.r});if(k.s<0n||k.s>a.maxUint256)throw new B({value:k.s});if(typeof k.yParity=="number"&&k.yParity!==0&&k.yParity!==1)throw new H({value:k.yParity})}function c(k){return u(r.fromBytes(k))}function u(k){if(k.length!==130&&k.length!==132)throw new y({signature:k});const m=BigInt(r.slice(k,0,32)),M=BigInt(r.slice(k,32,64)),A=(()=>{const P=+`0x${k.slice(130)}`;if(!Number.isNaN(P))try{return R(P)}catch{throw new H({value:P})}})();return typeof A>"u"?{r:m,s:M}:{r:m,s:M,yParity:A}}function d(k){if(!(typeof k.r>"u")&&!(typeof k.s>"u"))return l(k)}function l(k){const m=typeof k=="string"?u(k):k instanceof Uint8Array?c(k):typeof k.r=="string"?v(k):k.v?T(k):{r:k.r,s:k.s,...typeof k.yParity<"u"?{yParity:k.yParity}:{}};return o(m),m}function f(k){return b(r.fromBytes(k))}function b(k){const{r:m,s:M}=e.secp256k1.Signature.fromDER(r.from(k).slice(2));return{r:m,s:M}}function T(k){return{r:k.r,s:k.s,yParity:R(k.v)}}function v(k){const m=(()=>{const M=k.v?Number(k.v):void 0;let A=k.yParity?Number(k.yParity):void 0;if(typeof M=="number"&&typeof A!="number"&&(A=R(M)),typeof A!="number")throw new H({value:k.yParity});return A})();return{r:BigInt(k.r),s:BigInt(k.s),yParity:m}}function p(k){const[m,M,A]=k;return l({r:M==="0x"?0n:BigInt(M),s:A==="0x"?0n:BigInt(A),yParity:m==="0x"?0:Number(m)})}function O(k){return t.fromHex(I(k))}function I(k){o(k);const m=k.r,M=k.s;return r.concat(r.fromNumber(m,{size:32}),r.fromNumber(M,{size:32}),typeof k.yParity=="number"?r.fromNumber(w(k.yParity),{size:1}):"0x")}function h(k){return new e.secp256k1.Signature(k.r,k.s).toDERRawBytes()}function j(k){return`0x${new e.secp256k1.Signature(k.r,k.s).toDERHex()}`}function i(k){return{r:k.r,s:k.s,v:w(k.yParity)}}function g(k){const{r:m,s:M,yParity:A}=k;return{r:r.fromNumber(m,{size:32}),s:r.fromNumber(M,{size:32}),yParity:A===0?"0x0":"0x1"}}function _(k){const{r:m,s:M,yParity:A}=k;return[A?"0x01":"0x",m===0n?"0x":r.trimLeft(r.fromNumber(m)),M===0n?"0x":r.trimLeft(r.fromNumber(M))]}function E(k,m={}){try{return o(k,m),!0}catch{return!1}}function R(k){if(k===0||k===27)return 0;if(k===1||k===28)return 1;if(k>=35)return k%2===0?1:0;throw new F({value:k})}function w(k){if(k===0)return 27;if(k===1)return 28;throw new H({value:k})}class y extends n.BaseError{constructor({signature:m}){super(`Value \`${m}
46\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${r.size(r.from(m))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}ye.InvalidSerializedSizeError=y;class x extends n.BaseError{constructor({signature:m}){super(`Signature \`${s.stringify(m)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}ye.MissingPropertiesError=x;class C extends n.BaseError{constructor({value:m}){super(`Value \`${m}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}ye.InvalidRError=C;class B extends n.BaseError{constructor({value:m}){super(`Value \`${m}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}ye.InvalidSError=B;class H extends n.BaseError{constructor({value:m}){super(`Value \`${m}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}ye.InvalidYParityError=H;class F extends n.BaseError{constructor({value:m}){super(`Value \`${m}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}return ye.InvalidVError=F,ye}var Xy;function m2(){if(Xy)return st;Xy=1,Object.defineProperty(st,"__esModule",{value:!0}),st.from=s,st.fromRpc=a,st.fromRpcList=o,st.fromTuple=c,st.fromTupleList=u,st.getSignPayload=d,st.hash=l,st.toRpc=f,st.toRpcList=b,st.toTuple=T,st.toTupleList=v;const e=s0(),t=We(),n=d2(),r=F_();function s(p,O={}){return typeof p.chainId=="string"?a(p):{...p,...O.signature}}function a(p){const{address:O,chainId:I,nonce:h}=p,j=r.extract(p);return{address:O,chainId:Number(I),nonce:BigInt(h),...j}}function o(p){return p.map(a)}function c(p){const[O,I,h,j,i,g]=p;let _={address:I,chainId:O==="0x"?0:Number(O),nonce:h==="0x"?0n:BigInt(h)};return j&&i&&g&&(_={..._,...r.fromTuple([j,i,g])}),s(_)}function u(p){const O=[];for(const I of p)O.push(c(I));return O}function d(p){return l(p,{presign:!0})}function l(p,O={}){const{presign:I}=O;return e.keccak256(t.concat("0x05",n.fromHex(T(I?{address:p.address,chainId:p.chainId,nonce:p.nonce}:p))))}function f(p){const{address:O,chainId:I,nonce:h,...j}=p;return{address:O,chainId:t.fromNumber(I),nonce:t.fromNumber(h),...r.toRpc(j)}}function b(p){return p.map(f)}function T(p){const{address:O,chainId:I,nonce:h}=p,j=r.extract(p);return[I?t.fromNumber(I):"0x",O,h?t.fromNumber(h):"0x",...j?r.toTuple(j):[]]}function v(p){if(!p||p.length===0)return[];const O=[];for(const I of p)O.push(T(I));return O}return st}var ht={},Vr={},Qy;function h2(){if(Qy)return Vr;Qy=1,Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.extraEntropy=void 0,Vr.setExtraEntropy=e,Vr.extraEntropy=!1;function e(t){Vr.extraEntropy=t}return Vr}var $y;function y2(){if($y)return ht;$y=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.noble=void 0,ht.createKeyPair=o,ht.getPublicKey=c,ht.getSharedSecret=u,ht.randomPrivateKey=d,ht.recoverAddress=l,ht.recoverPublicKey=f,ht.sign=b,ht.verify=T;const e=N_(),t=dd(),n=kt(),r=We(),s=h2(),a=H_();ht.noble=e.secp256k1;function o(v={}){const{as:p="Hex"}=v,O=d({as:p}),I=c({privateKey:O});return{privateKey:O,publicKey:I}}function c(v){const{privateKey:p}=v,O=e.secp256k1.ProjectivePoint.fromPrivateKey(r.from(p).slice(2));return a.from(O)}function u(v){const{as:p="Hex",privateKey:O,publicKey:I}=v,i=e.secp256k1.ProjectivePoint.fromHex(a.toHex(I).slice(2)).multiply(e.secp256k1.utils.normPrivateKeyToScalar(r.from(O).slice(2))).toRawBytes(!0);return p==="Hex"?r.fromBytes(i):i}function d(v={}){const{as:p="Hex"}=v,O=e.secp256k1.utils.randomPrivateKey();return p==="Hex"?r.fromBytes(O):O}function l(v){return t.fromPublicKey(f(v))}function f(v){const{payload:p,signature:O}=v,{r:I,s:h,yParity:j}=O,g=new e.secp256k1.Signature(BigInt(I),BigInt(h)).addRecoveryBit(j).recoverPublicKey(r.from(p).substring(2));return a.from(g)}function b(v){const{extraEntropy:p=s.extraEntropy,hash:O,payload:I,privateKey:h}=v,{r:j,s:i,recovery:g}=e.secp256k1.sign(n.from(I),n.from(h),{extraEntropy:typeof p=="boolean"?p:r.from(p).slice(2),lowS:!0,...O?{prehash:!0}:{}});return{r:j,s:i,yParity:g}}function T(v){const{address:p,hash:O,payload:I,publicKey:h,signature:j}=v;return p?t.isEqual(p,l({payload:I,signature:j})):e.secp256k1.verify(j,n.from(I),a.toBytes(h),...O?[{prehash:!0,lowS:!0}]:[])}return ht}var e1;function g2(){return e1||(e1=1,(function(e){Object.defineProperty(e,"__esMo
46dule",{value:!0}),e.InvalidWrappedSignatureError=e.suffixParameters=e.magicBytes=void 0,e.assert=c,e.from=u,e.unwrap=d,e.wrap=l,e.validate=f;const t=hi(),n=m2(),r=gt(),s=We(),a=y2(),o=F_();e.magicBytes="0x8010801080108010801080108010801080108010801080108010801080108010",e.suffixParameters=t.from("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function c(T){if(typeof T=="string"){if(s.slice(T,-32)!==e.magicBytes)throw new b(T)}else o.assert(T.authorization)}function u(T){return typeof T=="string"?d(T):T}function d(T){c(T);const v=s.toNumber(s.slice(T,-64,-32)),p=s.slice(T,-v-64,-64),O=s.slice(T,0,-v-64),[I,h,j]=t.decode(e.suffixParameters,p);return{authorization:n.from({address:I.delegation,chainId:Number(I.chainId),nonce:I.nonce,yParity:I.yParity,r:I.r,s:I.s}),signature:O,...j&&j!=="0x"?{data:j,to:h}:{}}}function l(T){const{data:v,signature:p}=T;c(T);const O=a.recoverAddress({payload:n.getSignPayload(T.authorization),signature:o.from(T.authorization)}),I=t.encode(e.suffixParameters,[{...T.authorization,delegation:T.authorization.address,chainId:BigInt(T.authorization.chainId)},T.to??O,v??"0x"]),h=s.fromNumber(s.size(I),{size:32});return s.concat(p,I,h,e.magicBytes)}function f(T){try{return c(T),!0}catch{return!1}}class b extends r.BaseError{constructor(v){super(`Value \`${v}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}e.InvalidWrappedSignatureError=b})(cf)),cf}var t1;function ld(){return t1||(t1=1,Object.defineProperty(ko,"__esModule",{value:!0}),ko.SignatureErc8010=void 0,ko.SignatureErc8010=g2()),ko}var r1;function c0(){if(r1)return Ga;r1=1,Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.isErc8010Signature=t;const e=ld();function t(n){return e.SignatureErc8010.validate(n)}return Ga}var Va={},n1;function L_(){if(n1)return Va;n1=1,Object.defineProperty(Va,"__esModule",{value:!0}),Va.parseErc6492Signature=n;const e=gr(),t=i0();function n(r){if(!(0,t.isErc6492Signature)(r))return{signature:r};const[s,a,o]=(0,e.decodeAbiParameters)([{type:"address"},{type:"bytes"},{type:"bytes"}],r);return{address:s,data:a,signature:o}}return Va}var Wa={},o1;function U_(){if(o1)return Wa;o1=1,Object.defineProperty(Wa,"__esModule",{value:!0}),Wa.parseErc8010Signature=r;const e=ld(),t=ie(),n=c0();function r(s){if(!(0,n.isErc8010Signature)(s))return{signature:s};const{authorization:a,to:o,...c}=e.SignatureErc8010.unwrap(s);return{authorization:{address:a.address,chainId:a.chainId,nonce:Number(a.nonce),r:(0,t.numberToHex)(a.r,{size:32}),s:(0,t.numberToHex)(a.s,{size:32}),yParity:a.yParity},...o?{address:o}:{},...c}}return Wa}var Ka={},i1;function u0(){if(i1)return Ka;i1=1,Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.recoverMessageAddress=n;const e=bi(),t=Er();async function n({message:r,signature:s}){return(0,t.recoverAddress)({hash:(0,e.hashMessage)(r),signature:s})}return Ka}var Za={},s1;function d0(){if(s1)return Za;s1=1,Object.defineProperty(Za,"__esModule",{value:!0}),Za.recoverTypedDataAddress=n;const e=mi(),t=Er();async function n(r){const{domain:s,message:a,primaryType:o,signature:c,types:u}=r;return(0,t.recoverAddress)({hash:(0,e.hashTypedData)({domain:s,message:a,primaryType:o,types:u}),signature:c})}return Za}var Ya={},a1;function z_(){if(a1)return Ya;a1=1,Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.serializeErc6492Signature=s;const e=o0(),t=It(),n=Le(),r=Pe();function s(a){const{address:o,data:c,signature:u,to:d="hex"}=a,l=(0,n.concatHex)([(0,t.encodeAbiParameters)([{type:"address"},{type:"bytes"},{type:"bytes"}],[o,c,u]),e.erc6492MagicBytes]);return d==="hex"?l:(0,r.hexToBytes)(l)}return Ya}var Ja={},c1;function D_(){if(c1)return Ja;c1=1,Object.defineProperty(Ja,"__esModule",{value:!0}),Ja.serializeErc8010Signature=n;const e=ld(),t=Pe();function n(r){const{address:s,data:a,signature:o,to:c="hex"}=r,u=e.SignatureErc8010.wrap({authorization:{address:r.authorization.address,chainId:r.authorization.chainId,nonce:BigInt(r.authorization.nonce),r:BigInt(r.authorization.r),s:BigInt(r.authorization.s),yParity:r.authorization.yParity},data:a,signature:o,to:s});return c==="hex"?u:(0,t.hexToBytes)(u)}return Ja}var Xa={},u1;function G_(){if(u1)return Xa;u1=1,Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.verifyHash=r;const e=yt(),t=Ot(),n=Er();async function r({address:s,hash:a,signature:o}){return(0,t.isAddressEqual)((0,e.getAddress)(s),await(0,n.recoverAddress)({hash:a,signature:o}))}return Xa}var Qa={},d1;
46function V_(){if(d1)return Qa;d1=1,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.verifyMessage=r;const e=yt(),t=Ot(),n=u0();async function r({address:s,message:a,signature:o}){return(0,t.isAddressEqual)((0,e.getAddress)(s),await(0,n.recoverMessageAddress)({message:a,signature:o}))}return Qa}var $a={},f1;function W_(){if(f1)return $a;f1=1,Object.defineProperty($a,"__esModule",{value:!0}),$a.verifyTypedData=r;const e=yt(),t=Ot(),n=d0();async function r(s){const{address:a,domain:o,message:c,primaryType:u,signature:d,types:l}=s;return(0,t.isAddressEqual)((0,e.getAddress)(a),await(0,n.recoverTypedDataAddress)({domain:o,message:c,primaryType:u,signature:d,types:l}))}return $a}var ec={},l1;function f0(){if(l1)return ec;l1=1,Object.defineProperty(ec,"__esModule",{value:!0}),ec.getSerializedTransactionType=r;const e=dt(),t=vt(),n=Ne();function r(s){const a=(0,t.sliceHex)(s,0,1);if(a==="0x04")return"eip7702";if(a==="0x03")return"eip4844";if(a==="0x02")return"eip1559";if(a==="0x01")return"eip2930";if(a!=="0x"&&(0,n.hexToNumber)(a)>=192)return"legacy";throw new e.InvalidSerializedTransactionTypeError({serializedType:a})}return ec}var wn={},b1;function l0(){if(b1)return wn;b1=1,Object.defineProperty(wn,"__esModule",{value:!0}),wn.parseTransaction=b,wn.toTransactionArray=h,wn.parseAccessList=j;const e=St(),t=dt(),n=ut(),r=Qu(),s=nt(),a=hr(),o=er(),c=Ne(),u=$f(),d=e0(),l=ad(),f=f0();function b(_){const E=(0,f.getSerializedTransactionType)(_);return E==="eip1559"?p(_):E==="eip2930"?O(_):E==="eip4844"?v(_):E==="eip7702"?T(_):I(_)}function T(_){const E=h(_),[R,w,y,x,C,B,H,F,k,m,M,A,P]=E;if(E.length!==10&&E.length!==13)throw new t.InvalidSerializedTransactionError({attributes:{chainId:R,nonce:w,maxPriorityFeePerGas:y,maxFeePerGas:x,gas:C,to:B,value:H,data:F,accessList:k,authorizationList:m,...E.length>9?{v:M,r:A,s:P}:{}},serializedTransaction:_,type:"eip7702"});const S={chainId:(0,c.hexToNumber)(R),type:"eip7702"};return(0,s.isHex)(B)&&B!=="0x"&&(S.to=B),(0,s.isHex)(C)&&C!=="0x"&&(S.gas=(0,c.hexToBigInt)(C)),(0,s.isHex)(F)&&F!=="0x"&&(S.data=F),(0,s.isHex)(w)&&(S.nonce=w==="0x"?0:(0,c.hexToNumber)(w)),(0,s.isHex)(H)&&H!=="0x"&&(S.value=(0,c.hexToBigInt)(H)),(0,s.isHex)(x)&&x!=="0x"&&(S.maxFeePerGas=(0,c.hexToBigInt)(x)),(0,s.isHex)(y)&&y!=="0x"&&(S.maxPriorityFeePerGas=(0,c.hexToBigInt)(y)),k.length!==0&&k!=="0x"&&(S.accessList=j(k)),m.length!==0&&m!=="0x"&&(S.authorizationList=i(m)),(0,l.assertTransactionEIP7702)(S),{...E.length===13?g(E):void 0,...S}}function v(_){const E=h(_),R=E.length===4,w=R?E[0]:E,y=R?E.slice(1):[],[x,C,B,H,F,k,m,M,A,P,S,q,N,U]=w,[L,z,D]=y;if(!(w.length===11||w.length===14))throw new t.InvalidSerializedTransactionError({attributes:{chainId:x,nonce:C,maxPriorityFeePerGas:B,maxFeePerGas:H,gas:F,to:k,value:m,data:M,accessList:A,...w.length>9?{v:q,r:N,s:U}:{}},serializedTransaction:_,type:"eip4844"});const X={blobVersionedHashes:S,chainId:(0,c.hexToNumber)(x),to:k,type:"eip4844"};return(0,s.isHex)(F)&&F!=="0x"&&(X.gas=(0,c.hexToBigInt)(F)),(0,s.isHex)(M)&&M!=="0x"&&(X.data=M),(0,s.isHex)(C)&&(X.nonce=C==="0x"?0:(0,c.hexToNumber)(C)),(0,s.isHex)(m)&&m!=="0x"&&(X.value=(0,c.hexToBigInt)(m)),(0,s.isHex)(P)&&P!=="0x"&&(X.maxFeePerBlobGas=(0,c.hexToBigInt)(P)),(0,s.isHex)(H)&&H!=="0x"&&(X.maxFeePerGas=(0,c.hexToBigInt)(H)),(0,s.isHex)(B)&&B!=="0x"&&(X.maxPriorityFeePerGas=(0,c.hexToBigInt)(B)),A.length!==0&&A!=="0x"&&(X.accessList=j(A)),L&&z&&D&&(X.sidecars=(0,r.toBlobSidecars)({blobs:L,commitments:z,proofs:D})),(0,l.assertTransactionEIP4844)(X),{...w.length===14?g(w):void 0,...X}}function p(_){const E=h(_),[R,w,y,x,C,B,H,F,k,m,M,A]=E;if(!(E.length===9||E.length===12))throw new t.InvalidSerializedTransactionError({attributes:{chainId:R,nonce:w,maxPriorityFeePerGas:y,maxFeePerGas:x,gas:C,to:B,value:H,data:F,accessList:k,...E.length>9?{v:m,r:M,s:A}:{}},serializedTransaction:_,type:"eip1559"});const P={chainId:(0,c.hexToNumber)(R),type:"eip1559"};return(0,s.isHex)(B)&&B!=="0x"&&(P.to=B),(0,s.isHex)(C)&&C!=="0x"&&(P.gas=(0,c.hexToBigInt)(C)),(0,s.isHex)(F)&&F!=="0x"&&(P.data=F),(0,s.isHex)(w)&&(P.nonce=w==="0x"?0:(0,c.hexToNumber)(w)),(0,s.isHex)(H)&&H!=="0x"&&(P.value=(0,c.hexToBigInt)(H)),(0,s.isHex)(x)&&x!=="0x"&&(P.maxFeePerGas=(0,c.hexToBigInt)(x)),(0,s.isHex)(y)&&y!=="0x"&&(P.maxPriorityFeePerGas=(0,c.hexToBigInt)(y)),k.length!==0&&k!=="0x"&&(P.accessList=j(k)),(0,l.assertTransactionEIP1559)(P),{...E.length===12?g(E):void 0,...P}}function O(_){const E=h(_),[R,w,y,x,C,B,H,F,k,m,M]=E;
46if(!(E.length===8||E.length===11))throw new t.InvalidSerializedTransactionError({attributes:{chainId:R,nonce:w,gasPrice:y,gas:x,to:C,value:B,data:H,accessList:F,...E.length>8?{v:k,r:m,s:M}:{}},serializedTransaction:_,type:"eip2930"});const A={chainId:(0,c.hexToNumber)(R),type:"eip2930"};return(0,s.isHex)(C)&&C!=="0x"&&(A.to=C),(0,s.isHex)(x)&&x!=="0x"&&(A.gas=(0,c.hexToBigInt)(x)),(0,s.isHex)(H)&&H!=="0x"&&(A.data=H),(0,s.isHex)(w)&&(A.nonce=w==="0x"?0:(0,c.hexToNumber)(w)),(0,s.isHex)(B)&&B!=="0x"&&(A.value=(0,c.hexToBigInt)(B)),(0,s.isHex)(y)&&y!=="0x"&&(A.gasPrice=(0,c.hexToBigInt)(y)),F.length!==0&&F!=="0x"&&(A.accessList=j(F)),(0,l.assertTransactionEIP2930)(A),{...E.length===11?g(E):void 0,...A}}function I(_){const E=(0,u.fromRlp)(_,"hex"),[R,w,y,x,C,B,H,F,k]=E;if(!(E.length===6||E.length===9))throw new t.InvalidSerializedTransactionError({attributes:{nonce:R,gasPrice:w,gas:y,to:x,value:C,data:B,...E.length>6?{v:H,r:F,s:k}:{}},serializedTransaction:_,type:"legacy"});const m={type:"legacy"};if((0,s.isHex)(x)&&x!=="0x"&&(m.to=x),(0,s.isHex)(y)&&y!=="0x"&&(m.gas=(0,c.hexToBigInt)(y)),(0,s.isHex)(B)&&B!=="0x"&&(m.data=B),(0,s.isHex)(R)&&(m.nonce=R==="0x"?0:(0,c.hexToNumber)(R)),(0,s.isHex)(C)&&C!=="0x"&&(m.value=(0,c.hexToBigInt)(C)),(0,s.isHex)(w)&&w!=="0x"&&(m.gasPrice=(0,c.hexToBigInt)(w)),(0,l.assertTransactionLegacy)(m),E.length===6)return m;const M=(0,s.isHex)(H)&&H!=="0x"?(0,c.hexToBigInt)(H):0n;if(k==="0x"&&F==="0x")return M>0&&(m.chainId=Number(M)),m;const A=M,P=Number((A-35n)/2n);if(P>0)m.chainId=P;else if(A!==27n&&A!==28n)throw new t.InvalidLegacyVError({v:A});return m.v=A,m.s=k,m.r=F,m.yParity=A%2n===0n?1:0,m}function h(_){return(0,u.fromRlp)(`0x${_.slice(4)}`,"hex")}function j(_){const E=[];for(let R=0;R<_.length;R++){const[w,y]=_[R];if(!(0,n.isAddress)(w,{strict:!1}))throw new e.InvalidAddressError({address:w});E.push({address:w,storageKeys:y.map(x=>(0,d.isHash)(x)?x:(0,o.trim)(x))})}return E}function i(_){const E=[];for(let R=0;R<_.length;R++){const[w,y,x,C,B,H]=_[R];E.push({address:y,chainId:w==="0x"?0:(0,c.hexToNumber)(w),nonce:x==="0x"?0:(0,c.hexToNumber)(x),...g([C,B,H])})}return E}function g(_){const E=_.slice(-3),R=E[0]==="0x"||(0,c.hexToBigInt)(E[0])===0n?27n:28n;return{r:(0,a.padHex)(E[1],{size:32}),s:(0,a.padHex)(E[2],{size:32}),v:R,yParity:R===27n?0:1}}return wn}var tc={},rc={},Uo={},m1;function K_(){if(m1)return Uo;m1=1,Object.defineProperty(Uo,"__esModule",{value:!0}),Uo.InvalidDecimalNumberError=void 0;const e=fe();class t extends e.BaseError{constructor({value:r}){super(`Number \`${r}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}return Uo.InvalidDecimalNumberError=t,Uo}var h1;function bd(){if(h1)return rc;h1=1,Object.defineProperty(rc,"__esModule",{value:!0}),rc.parseUnits=t;const e=K_();function t(n,r){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(n))throw new e.InvalidDecimalNumberError({value:n});let[s,a="0"]=n.split(".");const o=s.startsWith("-");if(o&&(s=s.slice(1)),a=a.replace(/(0+)$/,""),r===0)Math.round(+`.${a}`)===1&&(s=`${BigInt(s)+1n}`),a="";else if(a.length>r){const[c,u,d]=[a.slice(0,r-1),a.slice(r-1,r),a.slice(r)],l=Math.round(+`${u}.${d}`);l>9?a=`${BigInt(c)+BigInt(1)}0`.padStart(c.length+1,"0"):a=`${c}${l}`,a.length>r&&(a=a.slice(1),s=`${BigInt(s)+1n}`),a=a.slice(0,r)}else a=a.padEnd(r,"0");return BigInt(`${o?"-":""}${s}${a}`)}return rc}var y1;function Z_(){if(y1)return tc;y1=1,Object.defineProperty(tc,"__esModule",{value:!0}),tc.parseEther=n;const e=Zo(),t=bd();function n(r,s="wei"){return(0,t.parseUnits)(r,e.etherUnits[s])}return tc}var nc={},g1;function Y_(){if(g1)return nc;g1=1,Object.defineProperty(nc,"__esModule",{value:!0}),nc.parseGwei=n;const e=Zo(),t=bd();function n(r,s="wei"){return(0,t.parseUnits)(r,e.gweiUnits[s])}return nc}var p1;function b0(){return p1||(p1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.padBytes=e.pad=e.isHex=e.isBytes=e.concatHex=e.concatBytes=e.concat=e.getChainContractAddress=e.extractChain=e.defineChain=e.assertCurrentChain=e.offchainLookupSignature=e.offchainLookupAbiItem=e.offchainLookup=e.ccipFetch=e.ccipRequest=e.buildRequest=e.verifyAuthorization=e.serializeAuthorizationList=e.recoverAuthorizationAddress=e.hashAuthorization=e.isAddressEqual=e.isAddress=e.getCreateAddress=e.getCreate2Address=e.getContractAddress=e.getAddress=e.parseEventLogs=e.getAbiItem=e.formatAbiItemWithArgs=e.formatAbiParams=e.formatAbiItem=e.encodePacked=e.encodeFunctionResult=e.encodeFunctionData=e.encodeEventTopics=e.encodeErrorResult=e.encodeDeployData=e.encodeAbiParameters=e.decodeFunctionResult=e.decodeFunctionData=e.decodeEventLog=e.decodeErrorResult=e.decodeAbiParameters=e.publicKeyToAddress=e.parseAccount=e.parseAbiParameters=e.parseAbiParameter=e.parseAbiItem=e.parseAbi=void 0,e.ripemd160=e.keccak256=e.isHash=e.getAction=e.formatTransactionRequest=e.defineTransactionRequest=e.defineTransactionReceipt=e.transactionType=e.formatTransaction=e.defineTransaction=e.formatLog=e.defineFormatter=e.extract=e.formatBlock=e.defineBlock=e.getTransactionError=e.getNodeError=e.containsNodeError=e.getEstimateGasError=e.getContractError=e.getCallError=e.toRlp=e.toHex=e.stringToHex=e.numberToHex=e.bytesToHex=e.boolToHex=e.toBytes=e.stringToBytes=e.numberToBytes=e.hexToBytes=e.boolToBytes=e.fromRlp=e.hexToString=e.hexToNumber=e.hexToBool=e.hexToBigInt=e.fromHex=e.fromBytes=e.bytesToString=e.bytesToNumber=e.bytesToBool=e.bytesToBigint=e.bytesToBigInt=e.trim=e.sliceHex=e.sliceBytes=e.slice=e.size=e.padHex=void 0,e.validateTypedData=e.serializeTypedData=e.serializeTransaction=e.serializeAccessList=e.parseTransaction=e.getTransactionType=e.getSerializedTransactionType=e.assertTransactionLegacy=e.assertTransactionEIP2930=e.assertTransactionEIP1559=e.assertRequest=e.stringify=e.verifyTypedData=e.verifyMessage=e.verifyHash=e.serializeErc8010Signature=e.serializeErc6492Signature=e.recoverTypedDataAddress=e.recoverPublicKey=e.recoverMessageAddress=e.recoverAddress=e.parseErc8010Signature=e.parseErc6492Signature=e.isErc8010Signature=e.isErc6492Signature=e.hashTypedData=e.hashStruct=e.hashMessage=e.getWebSocketRpcClient=e.socketClientCache=e.getSocketRpcClient=e.getHttpRpcClient=e.rpc=e.getSocket=e.integerRegex=e.bytesRegex=e.arrayRegex=e.nonceManager=e.createNonceManager=e.getFunctionSignature=e.toFunctionSignature=e.getFunctionSelector=e.toFunctionSelector=e.toFunctionHash=e.getEventSignature=e.toEventSignature=e.getEventSelector=e.toEventSelector=e.toEventHash=e.sha256=void 0,e.parseUnits=e.parseGwei=e.parseEther=e.formatUnits=e.formatGwei=e.formatEther=void 0;var t=mr();Object.defineProperty(e,"parseAbi",{enumerable:!0,get:function(){return t.parseAbi}}),Object.defineProperty(e,"parseAbiItem",{enumerable:!0,get:function(){return t.parseAbiItem}}),Object.defineProperty(e,"parseAbiParameter",{enumerable:!0,get:function(){return t.parseAbiParameter}}),Object.defineProperty(e,"parseAbiParameters",{enumerable:!0,get:function(){return t.parseAbiParameters}});var n=He();Object.defineProperty(e,"parseAccount",{enumerable:!0,get:function(){return n.parseAccount}});var r=kp();Object.defineProperty(e,"publicKeyToAddress",{enumerable:!0,get:function(){return r.publicKeyToAddress}});var s=gr();Object.defineProperty(e,"decodeAbiParameters",{enumerable:!0,get:function(){return s.decodeAbiParameters}});var a=Vu();Object.defineProperty(e,"decodeErrorResult",{enumerable:!0,get:function(){return a.decodeErrorResult}});var o=ii();Object.defineProperty(e,"decodeEventLog",{enumerable:!0,get:function(){return o.decodeEventLog}});var c=Nf();Object.defineProperty(e,"decodeFunctionData",{enumerable:!0,get:function(){return c.decodeFunctionData}});var u=Mt();Object.defineProperty(e,"decodeFunctionResult",{enumerable:!0,get:function(){return u.decodeFunctionResult}});var d=It();Object.defineProperty(e,"encodeAbiParameters",{enumerable:!0,get:function(){return d.encodeAbiParameters}});var l=ui();Object.defineProperty(e,"encodeDeployData",{enumerable:!0,get:function(){return l.encodeDeployData}});var f=Ff();Object.defineProperty(e,"encodeErrorResult",{enumerable:!0,get:function(){return f.encodeErrorResult}});var b=$r();Object.defineProperty(e,"encodeEventTopics",{enumerable:!0,get:function(){return b.encodeEventTopics}});var T=ot();Object.defineProperty(e,"encodeFunctionData",{enumerable:!0,get:function(){return T.encodeFunctionData}});var v=Lf();Object.defineProperty(e,"encodeFunctionResult",{enumerable:!0,get:function(){return v.encodeFunctionResult}});var p=l_();Object.defineProperty(e,"encodePacked",{enumerable:!0,get:function(){return p.encodePacked}});var O=$t();Object.defineProperty(e,"formatAbiItem",{enumerable:!0,get:function(){return O.formatAbiItem}}),Object.defineProperty(e,"formatAbiParams",{enumerable:!0,get:function(){return O.formatAbiParams}});var I=Mp();Object.defineProperty(e,"formatAbiItemWithArgs",{enumerable:!0,get:function(){return I.formatAbiItemWithArgs}});var h=tr();Object.defineProperty(e,"getAbiItem",{enumerable:!0,get:function(){return h.getAbiItem}});var j=si();Object.defineProperty(e,"parseEventLogs",{enumerable:!0,get:function(){return j.parseEventLogs}});var i=yt();Object.defineProperty(e,"getAddress",{enumerable:!0,get:function(){return i.getAddress}});var g=b_();Object.defineProperty(e,"getContractAddress",{enumerable:!0,get:function(){return g.getContractAddress}}),Object.defineProperty(e,"getCreate2Address",{enumerable:!0,get:function(){return g.getCreate2Address}}),Object.defineProperty(e,"getCreateAddress",{enumerable:!0,get:function(){return g.getCreateAddress}});var _=ut();Object.defineProperty(e,"isAddress",{enumerable:!0,get:function(){return _.isAddress}});var E=Ot();Object.defineProperty(e,"isAddressEqual",{enumerable:!0,get:function(){return E.isAddressEqual}});var R=Up();Object.defineProperty(e,"hashAuthorization",{enumerable:!0,get:function(){return R.hashAuthorization}});var w=$o();Object.defineProperty(e,"recoverAuthorizationAddress",{enumerable:!0,get:function(){return w.recoverAuthorizationAddress}});var y=m_();Object.defineProperty(e,"serializeAuthorizationList",{enumerable:!0,get:function(){return y.serializeAuthorizationList}});var x=h_();Object.defineProperty(e,"verifyAuthorization",{enumerable:!0,get:function(){return x.verifyAuthorization}});var C=y_();Object.defineProperty(e,"buildRequest",{enumerable:!0,get:function(){return C.buildRequest}});var B=Uf();Object.defineProperty(e,"ccipRequest",{enumerable:!0,get:function(){return B.ccipRequest}}),Object.defineProperty(e,"ccipFetch",{enumerable:!0,get:function(){return B.ccipRequest}}),Object.defineProperty(e,"offchainLookup",{enumerable:!0,get:function(){return B.offchainLookup}}),Object.defineProperty(e,"offchainLookupAbiItem",{enumerable:!0,get:function(){return B.offchainLookupAbiItem}}),Object.defineProperty(e,"offchainLookupSignature",{enumerable:!0,get:function(){return B.offchainLookupSignature}});var H=fi();Object.defineProperty(e,"assertCurrentChain",{enumerable:!0,get:function(){return H.assertCurrentChain}});var F=g_();Object.defineProperty(e,"defineChain",{enumerable:!0,get:function(){return F.defineChain}});var k=p_();Object.defineProperty(e,"extractChain",{enumerable:!0,get:function(){return k.extractChain}});var m=Pr();Object.defineProperty(e,"getChainContractAddress",{enumerable:!0,get:function(){return m.getChainContractAddress}});var M=Le();Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return M.concat}}),Object.defineProperty(e,"concatBytes",{enumerable:!0,get:function(){return M.concatBytes}}),Object.defineProperty(e,"concatHex",{enumerable:!0,get:function(){return M.concatHex}});var A=Xf();Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return A.isBytes}});var P=nt();Object.defineProperty(e,"isHex",{enumerable:!0,get:function(){return P.isHex}});var S=hr();Object.defineProperty(e,"pad",{enumerable:!0,get:function(){return S.pad}}),Object.defineProperty(e,"padBytes",{enumerable:!0,get:function(){return S.padBytes}}),Object.defineProperty(e,"padHex",{enumerable:!0,get:function(){return S.padHex}});var q=at();Object.defineProperty(e,"size",{enumerable:!0,get:function(){return q.size}});var N=vt();Object.defineProperty(e,"slice",{enumerable:!0,get:function(){return N.slice}}),Object.defineProperty(e,"sliceBytes",{enumerable:!0,get:function(){return N.sliceBytes}}),Object.defineProperty(e,"sliceHex",{enumerable:!0,get:function(){return N.sliceHex}});var U=er();Object.defineProperty(e,"trim",{enumerable:!0,get:function(){return U.trim}});var L=vf();Object.defineProperty(e,"bytesToBigInt",{enumerable:!0,get:function(){return L.bytesToBigInt}}),Object.defineProperty(e,"bytesToBigint",{enumerable:!0,get:function(){return L.bytesToBigInt}}),Object.defineProperty(e,"bytesToBool",{enumerable:!0,get:function(){return L.bytesToBool}}),Object.defineProperty(e,"bytesToNumber",{enumerable:!0,get:function(){return L.bytesToNumber}}),Object.defineProperty(e,"bytesToString",{enumerable:!0,get:function(){return L.bytesToString}}),Object.defineProperty(e,"fromBytes",{enumerable:!0,get:function(){return L.fromBytes}});var z=Ne();Object.defineProperty(e,"fromHex",{enumerable:!0,get:function(){return z.fromHex}}),Object.defineProperty(e,"hexToBigInt",{enumerable:!0,get:function(){return z.hexToBigInt}}),Object.defineProperty(e,"hexToBool",{enumerable:!0,get:function(){return z.hexToBool}}),Object.defineProperty(e,"hexToNumber",{enumerable:!0,get:function(){return z.hexToNumber}}),Object.defineProperty(e,"hexToString",{enumerable:!0,get:function(){return z.hexToString}});var D=$f();Object.defineProperty(e,"fromRlp",{enumerable:!0,get:function(){return D.fromRlp}});var X=Pe();Object.defineProperty(e,"boolToBytes",{enumerable:!0,get:function(){return X.boolToBytes}}),Object.defineProperty(e,"hexToBytes",{enumerable:!0,get:function(){return X.hexToBytes}}),Object.defineProperty(e,"numberToBytes",{enumerable:!0,get:function(){return X.numberToBytes}}),Object.defineProperty(e,"stringToBytes",{enumerable:!0,get:function(){return X.stringToBytes}}),Object.defineProperty(e,"toBytes",{enumerable:!0,get:function(){return X.toBytes}});var W=ie();Object.defineProperty(e,"boolToHex",{enumerable:!0,get:function(){return W.boolToHex}}),Object.defineProperty(e,"bytesToHex",{enumerable:!0,get:function(){return W.bytesToHex}}),Object.defineProperty(e,"numberToHex",{enumerable:!0,get:function(){return W.numberToHex}}),Object.defineProperty(e,"stringToHex",{enumerable:!0,get:function(){return W.stringToHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return W.toHex}});var Z=Qo();Object.defineProperty(e,"toRlp",{enumerable:!0,get:function(){return Z.toRlp}});var J=Hf();Object.defineProperty(e,"getCallError",{enumerable:!0,get:function(){return J.getCallError}});var oe=vr();Object.defineProperty(e,"getContractError",{enumerable:!0,get:function(){return oe.getContractError}});var K=Dp();Object.defineProperty(e,"getEstimateGasError",{enumerable:!0,get:function(){return K.getEstimateGasError}});var Y=ei();Object.defineProperty(e,"containsNodeError",{enumerable:!0,get:function(){return Y.containsNodeError}}),Object.defineProperty(e,"getNodeError",{enumerable:!0,get:function(){return Y.getNodeError}});var $=ni();Object.defineProperty(e,"getTransactionError",{enumerable:!0,get:function(){return $.getTransactionError}});var re=Zu();Object.defineProperty(e,"defineBlock",{enumerable:!0,get:function(){return re.defineBlock}}),Object.defineProperty(e,"formatBlock",{enumerable:!0,get:function(){return re.formatBlock}});var ee=wr();Object.defineProperty(e,"extract",{enumerable:!0,get:function(){return ee.extract}});var ne=ti();Object.defineProperty(e,"defineFormatter",{enumerable:!0,get:function(){return ne.defineFormatter}});var se=nr();Object.defineProperty(e,"formatLog",{enumerable:!0,get:function(){return se.formatLog}});var te=Rn();Object.defineProperty(e,"defineTransaction",{enumerable:!0,get:function(){return te.defineTransaction}}),Object.defineProperty(e,"formatTransaction",{enumerable:!0,get:function(){return te.formatTransaction}}),Object.defineProperty(e,"transactionType",{enumerable:!0,get:function(){return te.transactionType}});var Q=li();Object.defineProperty(e,"defineTransactionReceipt",{enumerable:!0,get:function(){return Q.defineTransactionReceipt}});var be=xt();Object.defineProperty(e,"defineTransactionRequest",{enumerable:!0,get:function(){return be.defineTransactionRequest}}),Object.d
46efineProperty(e,"formatTransactionRequest",{enumerable:!0,get:function(){return be.formatTransactionRequest}});var me=ge();Object.defineProperty(e,"getAction",{enumerable:!0,get:function(){return me.getAction}});var ze=e0();Object.defineProperty(e,"isHash",{enumerable:!0,get:function(){return ze.isHash}});var Ae=ct();Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return Ae.keccak256}});var Xe=__();Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return Xe.ripemd160}});var Me=If();Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return Me.sha256}});var Te=v_();Object.defineProperty(e,"toEventHash",{enumerable:!0,get:function(){return Te.toEventHash}});var pt=xn();Object.defineProperty(e,"toEventSelector",{enumerable:!0,get:function(){return pt.toEventSelector}}),Object.defineProperty(e,"getEventSelector",{enumerable:!0,get:function(){return pt.toEventSelector}});var Ke=E_();Object.defineProperty(e,"toEventSignature",{enumerable:!0,get:function(){return Ke.toEventSignature}}),Object.defineProperty(e,"getEventSignature",{enumerable:!0,get:function(){return Ke.toEventSignature}});var Ue=w_();Object.defineProperty(e,"toFunctionHash",{enumerable:!0,get:function(){return Ue.toFunctionHash}});var Ze=Qr();Object.defineProperty(e,"toFunctionSelector",{enumerable:!0,get:function(){return Ze.toFunctionSelector}}),Object.defineProperty(e,"getFunctionSelector",{enumerable:!0,get:function(){return Ze.toFunctionSelector}});var De=j_();Object.defineProperty(e,"toFunctionSignature",{enumerable:!0,get:function(){return De.toFunctionSignature}}),Object.defineProperty(e,"getFunctionSignature",{enumerable:!0,get:function(){return De.toFunctionSignature}});var Ct=P_();Object.defineProperty(e,"createNonceManager",{enumerable:!0,get:function(){return Ct.createNonceManager}}),Object.defineProperty(e,"nonceManager",{enumerable:!0,get:function(){return Ct.nonceManager}});var qn=Du();Object.defineProperty(e,"arrayRegex",{enumerable:!0,get:function(){return qn.arrayRegex}}),Object.defineProperty(e,"bytesRegex",{enumerable:!0,get:function(){return qn.bytesRegex}}),Object.defineProperty(e,"integerRegex",{enumerable:!0,get:function(){return qn.integerRegex}});var gi=S_();Object.defineProperty(e,"getSocket",{enumerable:!0,get:function(){return gi.getSocket}}),Object.defineProperty(e,"rpc",{enumerable:!0,get:function(){return gi.rpc}});var Sr=r0();Object.defineProperty(e,"getHttpRpcClient",{enumerable:!0,get:function(){return Sr.getHttpRpcClient}});var pi=T_();Object.defineProperty(e,"getSocketRpcClient",{enumerable:!0,get:function(){return pi.getSocketRpcClient}}),Object.defineProperty(e,"socketClientCache",{enumerable:!0,get:function(){return pi.socketClientCache}});var _i=n0();Object.defineProperty(e,"getWebSocketRpcClient",{enumerable:!0,get:function(){return _i.getWebSocketRpcClient}});var hd=bi();Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return hd.hashMessage}});var vi=mi();Object.defineProperty(e,"hashStruct",{enumerable:!0,get:function(){return vi.hashStruct}}),Object.defineProperty(e,"hashTypedData",{enumerable:!0,get:function(){return vi.hashTypedData}});var Hn=i0();Object.defineProperty(e,"isErc6492Signature",{enumerable:!0,get:function(){return Hn.isErc6492Signature}});var yd=c0();Object.defineProperty(e,"isErc8010Signature",{enumerable:!0,get:function(){return yd.isErc8010Signature}});var gd=L_();Object.defineProperty(e,"parseErc6492Signature",{enumerable:!0,get:function(){return gd.parseErc6492Signature}});var Mn=U_();Object.defineProperty(e,"parseErc8010Signature",{enumerable:!0,get:function(){return Mn.parseErc8010Signature}});var pd=Er();Object.defineProperty(e,"recoverAddress",{enumerable:!0,get:function(){return pd.recoverAddress}});var kn=u0();Object.defineProperty(e,"recoverMessageAddress",{enumerable:!0,get:function(){return kn.recoverMessageAddress}});var _d=jf();Object.defineProperty(e,"recoverPublicKey",{enumerable:!0,get:function(){return _d.recoverPublicKey}});var Ir=d0();Object.defineProperty(e,"recoverTypedDataAddress",{enumerable:!0,get:function(){return Ir.recoverTypedDataAddress}});var Br=z_();Object.defineProperty(e,"serializeErc6492Signature",{enumerable:!0,get:function(){return Br.serializeErc6492Signature}});var vd=D_();Object.defineProperty(e,"serializeErc8010Signature",{enumerable:!0,get:function(){return vd.seri
46alizeErc8010Signature}});var xr=G_();Object.defineProperty(e,"verifyHash",{enumerable:!0,get:function(){return xr.verifyHash}});var Rr=V_();Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return Rr.verifyMessage}});var Nn=W_();Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return Nn.verifyTypedData}});var Ed=Ve();Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return Ed.stringify}});var wd=Rt();Object.defineProperty(e,"assertRequest",{enumerable:!0,get:function(){return wd.assertRequest}});var Fn=ad();Object.defineProperty(e,"assertTransactionEIP1559",{enumerable:!0,get:function(){return Fn.assertTransactionEIP1559}}),Object.defineProperty(e,"assertTransactionEIP2930",{enumerable:!0,get:function(){return Fn.assertTransactionEIP2930}}),Object.defineProperty(e,"assertTransactionLegacy",{enumerable:!0,get:function(){return Fn.assertTransactionLegacy}});var jd=f0();Object.defineProperty(e,"getSerializedTransactionType",{enumerable:!0,get:function(){return jd.getSerializedTransactionType}});var Ei=$u();Object.defineProperty(e,"getTransactionType",{enumerable:!0,get:function(){return Ei.getTransactionType}});var Pd=l0();Object.defineProperty(e,"parseTransaction",{enumerable:!0,get:function(){return Pd.parseTransaction}});var Ln=Qf();Object.defineProperty(e,"serializeAccessList",{enumerable:!0,get:function(){return Ln.serializeAccessList}});var wi=cd();Object.defineProperty(e,"serializeTransaction",{enumerable:!0,get:function(){return wi.serializeTransaction}});var on=ud();Object.defineProperty(e,"serializeTypedData",{enumerable:!0,get:function(){return on.serializeTypedData}}),Object.defineProperty(e,"validateTypedData",{enumerable:!0,get:function(){return on.validateTypedData}});var Ad=Yo();Object.defineProperty(e,"formatEther",{enumerable:!0,get:function(){return Ad.formatEther}});var Td=en();Object.defineProperty(e,"formatGwei",{enumerable:!0,get:function(){return Td.formatGwei}});var Sd=Wu();Object.defineProperty(e,"formatUnits",{enumerable:!0,get:function(){return Sd.formatUnits}});var Id=Z_();Object.defineProperty(e,"parseEther",{enumerable:!0,get:function(){return Id.parseEther}});var Bd=Y_();Object.defineProperty(e,"parseGwei",{enumerable:!0,get:function(){return Bd.parseGwei}});var ji=bd();Object.defineProperty(e,"parseUnits",{enumerable:!0,get:function(){return ji.parseUnits}})})(ef)),ef}var _1;function p2(){if(_1)return Ba;_1=1,Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.formatProof=n;const e=b0();function t(r){return r.map(s=>({...s,value:BigInt(s.value)}))}function n(r){return{...r,balance:r.balance?BigInt(r.balance):void 0,nonce:r.nonce?(0,e.hexToNumber)(r.nonce):void 0,storageProof:r.storageProof?t(r.storageProof):void 0}}return Ba}var v1;function _2(){if(v1)return Ia;v1=1,Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.getProof=n;const e=ie(),t=p2();async function n(r,{address:s,blockNumber:a,blockTag:o,storageKeys:c}){const u=o??"latest",d=a!==void 0?(0,e.numberToHex)(a):void 0,l=await r.request({method:"eth_getProof",params:[s,c,d||u]});return(0,t.formatProof)(l)}return Ia}var oc={},E1;function v2(){if(E1)return oc;E1=1,Object.defineProperty(oc,"__esModule",{value:!0}),oc.getStorageAt=t;const e=ie();async function t(n,{address:r,blockNumber:s,blockTag:a="latest",slot:o}){const c=s!==void 0?(0,e.numberToHex)(s):void 0;return await n.request({method:"eth_getStorageAt",params:[r,o,c||a]})}return oc}var ic={},w1;function m0(){if(w1)return ic;w1=1,Object.defineProperty(ic,"__esModule",{value:!0}),ic.getTransaction=r;const e=dt(),t=ie(),n=Rn();async function r(s,{blockHash:a,blockNumber:o,blockTag:c,hash:u,index:d,sender:l,nonce:f}){const b=c||"latest",T=o!==void 0?(0,t.numberToHex)(o):void 0;let v=null;if(u?v=await s.request({method:"eth_getTransactionByHash",params:[u]},{dedupe:!0}):a?v=await s.request({method:"eth_getTransactionByBlockHashAndIndex",params:[a,(0,t.numberToHex)(d)]},{dedupe:!0}):typeof d=="number"?v=await s.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[T||b,(0,t.numberToHex)(d)]},{dedupe:!!T}):l&&typeof f=="number"&&(v=await s.request({method:"eth_getTransactionBySenderAndNonce",params:[l,(0,t.numberToHex)(f)]},{dedupe:!0})),!v)throw new e.TransactionNotFoundError({blockHash:a,blockNumber:o,blockTag:b,hash:u,index:d});return(s.chain?.formatters?.transaction?.format||n.formatTransaction)(v,"getTransaction")}return ic}var sc={},j1;function E2(){if(j1)return sc;j1=1,Object.defineProperty(sc,"__esModule",{value:!0}),sc.getTransactionConfirmations=r;const e=ge(),t=di(),n=m0();async function r(s,{hash:a,transactionReceipt:o}){const[c,u]=await Promise.all([(0,e.getAction)(s,t.getBlockNumber,"getBlockNumber")({}),a?(0,e.getAction)(s,n.getTransaction,"getTransaction")({hash:a}):void 0]),d=o?.blockNumber||u?.blockNumber;return d?c-d+1n:0n}return sc}var ac={},P1;function J_(){if(P1)return ac;P1=1,Object.defineProperty(ac,"__esModule",{value:!0}),ac.getTransactionReceipt=n;const e=dt(),t=li();async function n(r,{hash:s}){const a=await r.request({method:"eth_getTransactionReceipt",params:[s]},{dedupe:!0});if(!a)throw new e.TransactionReceiptNotFoundError({hash:s});return(r.chain?.formatters?.transactionReceipt?.format||t.formatTransactionReceipt)(a,"getTransactionReceipt")}return ac}var cc={},A1;function w2(){if(A1)return cc;A1=1,Object.defineProperty(cc,"__esModule",{value:!0}),cc.multicall=f;const e=or(),t=ai(),n=qe(),r=fe(),s=pr(),a=Mt(),o=ot(),c=Pr(),u=vr(),d=ge(),l=Nt();async function f(b,T){const{account:v,authorizationList:p,allowFailure:O=!0,blockNumber:I,blockOverrides:h,blockTag:j,stateOverride:i}=T,g=T.contracts,{batchSize:_=T.batchSize??1024,deployless:E=T.deployless??!1}=typeof b.batch?.multicall=="object"?b.batch.multicall:{},R=(()=>
46{if(T.multicallAddress)return T.multicallAddress;if(E)return null;if(b.chain)return(0,c.getChainContractAddress)({blockNumber:I,chain:b.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),w=[[]];let y=0,x=0;for(let H=0;H<g.length;H++){const{abi:F,address:k,args:m,functionName:M}=g[H];try{const A=(0,o.encodeFunctionData)({abi:F,args:m,functionName:M});x+=(A.length-2)/2,_>0&&x>_&&w[y].length>0&&(y++,x=(A.length-2)/2,w[y]=[]),w[y]=[...w[y],{allowFailure:!0,callData:A,target:k}]}catch(A){const P=(0,u.getContractError)(A,{abi:F,address:k,args:m,docsPath:"/docs/contract/multicall",functionName:M,sender:v});if(!O)throw P;w[y]=[...w[y],{allowFailure:!0,callData:"0x",target:k}]}}const C=await Promise.allSettled(w.map(H=>(0,d.getAction)(b,l.readContract,"readContract")({...R===null?{code:t.multicall3Bytecode}:{address:R},abi:e.multicall3Abi,account:v,args:[H],authorizationList:p,blockNumber:I,blockOverrides:h,blockTag:j,functionName:"aggregate3",stateOverride:i}))),B=[];for(let H=0;H<C.length;H++){const F=C[H];if(F.status==="rejected"){if(!O)throw F.reason;for(let m=0;m<w[H].length;m++)B.push({status:"failure",error:F.reason,result:void 0});continue}const k=F.value;for(let m=0;m<k.length;m++){const{returnData:M,success:A}=k[m],{callData:P}=w[H][m],{abi:S,address:q,functionName:N,args:U}=g[B.length];try{if(P==="0x")throw new n.AbiDecodingZeroDataError;if(!A)throw new s.RawContractError({data:M});const L=(0,a.decodeFunctionResult)({abi:S,args:U,data:M,functionName:N});B.push(O?{result:L,status:"success"}:L)}catch(L){const z=(0,u.getContractError)(L,{abi:S,address:q,args:U,docsPath:"/docs/contract/multicall",functionName:N});if(!O)throw z;B.push({error:z,result:void 0,status:"failure"})}}}if(B.length!==g.length)throw new r.BaseError("multicall results mismatch");return B}return cc}var uc={},T1;function X_(){if(T1)return uc;T1=1,Object.defineProperty(uc,"__esModule",{value:!0}),uc.simulateBlocks=O;const e=Qp(),t=He(),n=qe(),r=pr(),s=rr(),a=Mt(),o=ot(),c=Le(),u=ie(),d=vr(),l=ei(),f=Zu(),b=nr(),T=xt(),v=Pf(),p=Rt();async function O(I,h){const{blockNumber:j,blockTag:i=I.experimental_blockTag??"latest",blocks:g,returnFullTransactions:_,traceTransfers:E,validation:R}=h;try{const w=[];for(const B of g){const H=B.blockOverrides?e.toRpc(B.blockOverrides):void 0,F=B.calls.map(m=>{const M=m,A=M.account?(0,t.parseAccount)(M.account):void 0,P=M.abi?(0,o.encodeFunctionData)(M):M.data,S={...M,account:A,data:M.dataSuffix?(0,c.concat)([P||"0x",M.dataSuffix]):P,from:M.from??A?.address};return(0,p.assertRequest)(S),(0,T.formatTransactionRequest)(S)}),k=B.stateOverrides?(0,v.serializeStateOverride)(B.stateOverrides):void 0;w.push({blockOverrides:H,calls:F,stateOverrides:k})}const x=(typeof j=="bigint"?(0,u.numberToHex)(j):void 0)||i;return(await I.request({method:"eth_simulateV1",params:[{blockStateCalls:w,returnFullTransactions:_,traceTransfers:E,validation:R},x]})).map((B,H)=>({...(0,f.formatBlock)(B),calls:B.calls.map((F,k)=>{const{abi:m,args:M,functionName:A,to:P}=g[H].calls[k],S=F.error?.data??F.returnData,q=BigInt(F.gasUsed),N=F.logs?.map(D=>(0,b.formatLog)(D)),U=F.status==="0x1"?"success":"failure",L=m&&U==="success"&&S!=="0x"?(0,a.decodeFunctionResult)({abi:m,data:S,functionName:A}):null,z=(()=>{if(U==="success")return;let D;if(S==="0x"?D=new n.AbiDecodingZeroDataError:S&&(D=new r.RawContractError({data:S})),!!D)return(0,d.getContractError)(D,{abi:m??[],address:P??"0x",args:M,functionName:A??"<unknown>"})})();return{data:S,gasUsed:q,logs:N,status:U,...U==="success"?{result:L}:{error:z}}})}))}catch(w){const y=w,x=(0,l.getNodeError)(y,{});throw x instanceof s.UnknownNodeError?y:x}}return uc}var dc={},br={},rt={},jn={},S1;function j2(){if(S1)return jn;S1=1,Object.defineProperty(jn,"__esModule",{value:!0}),jn.normalizeSignature=n,jn.isArgOfType=r,jn.getAmbiguousTypes=s;const e=dd(),t=gt();function n(a){let o=!0,c="",u=0,d="",l=!1;for(let f=0;f<a.length;f++){const b=a[f];if(["(",")",","].includes(b)&&(o=!0),b==="("&&u++,b===")"&&u--,!!o){if(u===0){if(b===" "&&["event","function","error",""].includes(d))d="";else if(d+=b,b===")"){l=!0;break}continue}if(b===" "){a[f-1]!==","&&c!==","&&c!==",("&&(c="",o=!1);continue}d+=b,c+=b}}if(!l)throw new t.BaseError("Unable to normalize signature.");return d}function r(a,o){const c=typeof a,u=o.type;switch(u){case"address":return e.validate(a,{strict:!1});case"bool":return c==="boolean";
46case"function":return c==="string";case"string":return c==="string";default:return u==="tuple"&&"components"in o?Object.values(o.components).every((d,l)=>r(Object.values(a)[l],d)):/^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(u)?c==="number"||c==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(u)?c==="string"||a instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(u)?Array.isArray(a)&&a.every(d=>r(d,{...o,type:u.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function s(a,o,c){for(const u in a){const d=a[u],l=o[u];if(d.type==="tuple"&&l.type==="tuple"&&"components"in d&&"components"in l)return s(d.components,l.components,c[u]);const f=[d.type,l.type];if(f.includes("address")&&f.includes("bytes20")?!0:f.includes("address")&&f.includes("string")?e.validate(c[u],{strict:!1}):f.includes("address")&&f.includes("bytes")?e.validate(c[u],{strict:!1}):!1)return f}}return jn}var I1;function Q_(){if(I1)return rt;I1=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.InvalidSelectorSizeError=rt.NotFoundError=rt.AmbiguityError=void 0,rt.format=a,rt.from=o,rt.fromAbi=c,rt.getSelector=u,rt.getSignature=d,rt.getSignatureHash=l;const e=mr(),t=gt(),n=s0(),r=We(),s=j2();function a(v){return e.formatAbiItem(v)}function o(v,p={}){const{prepare:O=!0}=p,I=Array.isArray(v)||typeof v=="string"?e.parseAbiItem(v):v;return{...I,...O?{hash:l(I)}:{}}}function c(v,p,O){const{args:I=[],prepare:h=!0}=O??{},j=r.validate(p,{strict:!1}),i=v.filter(E=>j?E.type==="function"||E.type==="error"?u(E)===r.slice(p,0,4):E.type==="event"?l(E)===p:!1:"name"in E&&E.name===p);if(i.length===0)throw new b({name:p});if(i.length===1)return{...i[0],...h?{hash:l(i[0])}:{}};let g;for(const E of i){if(!("inputs"in E))continue;if(!I||I.length===0){if(!E.inputs||E.inputs.length===0)return{...E,...h?{hash:l(E)}:{}};continue}if(!E.inputs||E.inputs.length===0||E.inputs.length!==I.length)continue;if(I.every((w,y)=>{const x="inputs"in E&&E.inputs[y];return x?s.isArgOfType(w,x):!1})){if(g&&"inputs"in g&&g.inputs){const w=s.getAmbiguousTypes(E.inputs,g.inputs,I);if(w)throw new f({abiItem:E,type:w[0]},{abiItem:g,type:w[1]})}g=E}}const _=(()=>{if(g)return g;const[E,...R]=i;return{...E,overloads:R}})();if(!_)throw new b({name:p});return{..._,...h?{hash:l(_)}:{}}}function u(...v){const p=(()=>
46{if(Array.isArray(v[0])){const[O,I]=v;return c(O,I)}return v[0]})();return r.slice(l(p),0,4)}function d(...v){const p=(()=>{if(Array.isArray(v[0])){const[I,h]=v;return c(I,h)}return v[0]})(),O=typeof p=="string"?p:e.formatAbiItem(p);return s.normalizeSignature(O)}function l(...v){const p=(()=>{if(Array.isArray(v[0])){const[O,I]=v;return c(O,I)}return v[0]})();return typeof p!="string"&&"hash"in p&&p.hash?p.hash:n.keccak256(r.fromString(d(p)))}class f extends t.BaseError{constructor(p,O){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${p.type}\` in \`${s.normalizeSignature(e.formatAbiItem(p.abiItem))}\`, and`,`\`${O.type}\` in \`${s.normalizeSignature(e.formatAbiItem(O.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:"AbiItem.AmbiguityError"})}}rt.AmbiguityError=f;class b extends t.BaseError{constructor({name:p,data:O,type:I="item"}){const h=p?` with name "${p}"`:O?` with data "${O}"`:"";super(`ABI ${I}${h} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}rt.NotFoundError=b;class T extends t.BaseError{constructor({data:p}){super(`Selector size is invalid. Expected 4 bytes. Received ${r.size(p)} bytes ("${p}").`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.InvalidSelectorSizeError"})}}return rt.InvalidSelectorSizeError=T,rt}var B1;function P2(){if(B1)return br;B1=1,Object.defineProperty(br,"__esModule",{value:!0}),br.decode=s,br.encode=a,br.format=o,br.from=c,br.fromAbi=u;const e=mr(),t=Q_(),n=hi(),r=We();function s(...d){const[l,f]=(()=>{if(Array.isArray(d[0])){const[v,p]=d;return[u(v),p]}return d})(),{bytecode:b}=f;if(l.inputs?.length===0)return;const T=f.data.replace(b,"0x");return n.decode(l.inputs,T)}function a(...d){const[l,f]=(()=>{if(Array.isArray(d[0])){const[v,p]=d;return[u(v),p]}return d})(),{bytecode:b,args:T}=f;return r.concat(b,l.inputs?.length&&T?.length?n.encode(l.inputs,T):"0x")}function o(d){return e.formatAbiItem(d)}function c(d){return t.from(d)}function u(d){const l=d.find(f=>f.type==="constructor");if(!l)throw new t.NotFoundError({name:"constructor"});return l}return br}var Tt={},x1;function A2(){if(x1)return Tt;x1=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.decodeData=s,Tt.decodeResult=a,Tt.encodeData=o,Tt.encodeResult=c,Tt.format=u,Tt.from=d,Tt.fromAbi=l,Tt.getSelector=f;const e=mr(),t=Q_(),n=hi(),r=We();function s(...b){const[T,v]=(()=>{if(Array.isArray(b[0])){const[I,h,j]=b;return[l(I,h),j]}return b})(),{overloads:p}=T;if(r.size(v)<4)throw new t.InvalidSelectorSizeError({data:v});if(T.inputs?.length===0)return;const O=p?l([T,...p],v):T;if(!(r.size(v)<=4))return n.decode(O.inputs,r.slice(v,4))}function a(...b){const[T,v,p={}]=(()=>{if(Array.isArray(b[0])){const[I,h,j,i]=b;return[l(I,h),j,i]}return b})(),O=n.decode(T.outputs,v,p);if(!(O&&Object.keys(O).length===0))return O&&Object.keys(O).length===1?Array.isArray(O)?O[0]:Object.values(O)[0]:O}function o(...b){const[T,v=[]]=(()=>{if(Array.isArray(b[0])){const[g,_,E]=b;return[l(g,_,{args:E}),E]}const[j,i]=b;return[j,i]})(),{overloads:p}=T,O=p?l([T,...p],T.name,{args:v}):T,I=f(O),h=v.length>
460?n.encode(O.inputs,v):void 0;return h?r.concat(I,h):I}function c(...b){const[T,v,p={}]=(()=>{if(Array.isArray(b[0])){const[h,j,i,g]=b;return[l(h,j),i,g]}return b})(),{as:O="Array"}=p,I=T.outputs.length===1?[v]:Array.isArray(v)?v:O==="Object"?Object.values(v):[v];return n.encode(T.outputs,I)}function u(b){return e.formatAbiItem(b)}function d(b,T={}){return t.from(b,T)}function l(b,T,v){const p=t.fromAbi(b,T,v);if(p.type!=="function")throw new t.NotFoundError({name:T,type:"function"});return p}function f(b){return t.getSelector(b)}return Tt}var Wr={},R1;function $_(){return R1||(R1=1,Object.defineProperty(Wr,"__esModule",{value:!0}),Wr.zeroAddress=Wr.ethAddress=void 0,Wr.ethAddress="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",Wr.zeroAddress="0x0000000000000000000000000000000000000000"),Wr}var O1;function T2(){if(O1)return dc;O1=1,Object.defineProperty(dc,"__esModule",{value:!0}),dc.simulateCalls=f;const e=P2(),t=A2(),n=He(),r=$_(),s=ai(),a=fe(),o=ot(),c=b0(),u=c_(),d=X_(),l="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function f(b,T){const{blockNumber:v,blockTag:p,calls:O,stateOverrides:I,traceAssetChanges:h,traceTransfers:j,validation:i}=T,g=T.account?(0,n.parseAccount)(T.account):void 0;if(h&&!g)throw new a.BaseError("`account` is required when `traceAssetChanges` is true");const _=g?e.encode(e.from("constructor(bytes, bytes)"),{bytecode:s.deploylessCallViaBytecodeBytecode,args:[l,t.encodeData(t.from("function getBalance(address)"),[g.address])]}):void 0,E=h?await Promise.all(T.calls.map(async Z=>{if(!Z.data&&!Z.abi)return;const{accessList:J}=await(0,u.createAccessList)(b,{account:g.address,...Z,data:Z.abi?(0,o.encodeFunctionData)(Z):Z.data});return J.map(({address:oe,storageKeys:K})=>K.length>0?oe:null)})).then(Z=>Z.flat().filter(Boolean)):[],R=await(0,d.simulateBlocks)(b,{blockNumber:v,blockTag:p,blocks:[...h?[{calls:[{data:_}],stateOverrides:I},{calls:E.map((Z,J)=>({abi:[t.from("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[g.address],to:Z,from:r.zeroAddress,nonce:J})),stateOverrides:[{address:r.zeroAddress,nonce:0}]}]:[],{calls:[...O,{}].map(Z=>({...Z,from:g?.address})),stateOverrides:I},...h?[{calls:[{data:_}]},{calls:E.map((Z,J)=>({abi:[t.from("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[g.address],to:Z,from:r.zeroAddress,nonce:J})),stateOverrides:[{address:r.zeroAddress,nonce:0}]},{calls:E.map((Z,J)=>({to:Z,abi:[t.from("function decimals() returns (uint256)")],functionName:"decimals",from:r.zeroAddress,nonce:J})),stateOverrides:[{address:r.zeroAddress,nonce:0}]},{calls:E.map((Z,J)=>({to:Z,abi:[t.from("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:r.zeroAddress,nonce:J})),stateOverrides:[{address:r.zeroAddress,nonce:0}]},{calls:E.map((Z,J)=>({to:Z,abi:[t.from("function symbol() returns (string)")],functionName:"symbol",from:r.zeroAddress,nonce:J})),stateOverrides:[{address:r.zeroAddress,nonce:0}]}]:[]],traceTransfers:j,validation:i}),w=h?R[2]:R[0],[y,x,,C,B,H,F,k]=h?R:[],{calls:m,...M}=w,A=m.slice(0,-1)??[],P=y?.calls??[],S=x?.calls??[],q=[...P,...S].map(Z=>Z.status==="success"?(0,c.hexToBigInt)(Z.data):null),N=C?.calls??[],U=B?.calls??[],L=[...N,...U].map(Z=>Z.status==="success"?(0,c.hexToBigInt)(Z.data):null),z=(H?.calls??[]).map(Z=>Z.status==="success"?Z.result:null),D=(k?.calls??[]).map(Z=>Z.status==="success"?Z.result:null),X=(F?.calls??[]).map(Z=>Z.status==="success"?Z.result:null),W=[];for(const[Z,J]of L.entries()){const oe=q[Z];if(typeof J!="bigint"||typeof oe!="bigint")continue;const K=z[Z-1],Y=D[Z-1],$=X[Z-1],re=Z===0?{address:r.ethAddress,decimals:18,symbol
46:"ETH"}:{address:E[Z-1],decimals:$||K?Number(K??1):void 0,symbol:Y??void 0};W.some(ee=>ee.token.address===re.address)||W.push({token:re,value:{pre:oe,post:J,diff:J-oe}})}return{assetChanges:W,block:M,results:A}}return dc}var Pn={},zo={},bf={},C1;function S2(){return C1||(C1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InvalidWrappedSignatureError=e.universalSignatureValidatorAbi=e.universalSignatureValidatorBytecode=e.magicBytes=void 0,e.assert=s,e.from=a,e.unwrap=o,e.wrap=c,e.validate=u;const t=hi(),n=gt(),r=We();e.magicBytes="0x6492649264926492649264926492649264926492649264926492649264926492",e.universalSignatureValidatorBytecode="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848
46603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",e.universalSignatureValidatorAbi=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}];function s(l){if(r.slice(l,-32)!==e.magicBytes)throw new d(l)}function a(l){return typeof l=="string"?o(l):l}function o(l){s(l);const[f,b,T]=t.decode(t.from("address, bytes, bytes"),l);return{data:b,signature:T,to:f}}function c(l){const{data:f,signature:b,to:T}=l;return r.concat(t.encode(t.from("address, bytes, bytes"),[T,f,b]),e.magicBytes)}function u(l){try{return s(l),!0}catch{return!1}}class d extends n.BaseError{constructor(f){super(`Value \`${f}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}e.InvalidWrappedSignatureError=d})(bf)),bf}var q1;function I2(){return q1||(q1=1,Object.defineProperty(zo,"__esModule",{value:!0}),zo.SignatureErc6492=void 0,zo.SignatureErc6492=S2()),zo}var fc={},H1;function ev(){if(H1)return fc;H1=1,Object.defineProperty(fc,"__esModule",{value:!0}),fc.serializeSignature=r;const e=Xo(),t=Ne(),n=Pe();function r({r:s,s:a,to:o="hex",v:c,yParity:u}){const d=(()=>{if(u===0||u===1)return u;if(c&&(c===27n||c===28n||c>=35n))return c%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),l=`0x${new e.secp256k1.Signature((0,t.hexToBigInt)(s),(0,t.hexToBigInt)(a)).toCompactHex()}${d===0?"1b":"1c"}`;return o==="hex"?l:(0,n.hexToBytes)(l)}return fc}var M1;function md(){if(M1)return Pn;M1=1,Object.defineProperty(Pn,"__esModule",{value:!0}),Pn.verifyHash=i,Pn.verifyErc8010=g,Pn.verifyErc1271=E;const e=I2(),t=ld(),n=or(),r=ai(),s=pr(),a=ui(),o=ot(),c=yt(),u=Ot(),d=h_(),l=Le(),f=nt(),b=Ne(),T=ie(),v=ge(),p=Er(),O=ev(),I=On(),h=f_(),j=Nt();async function i(w,y){const{address:x,chain:C=w.chain,hash:B,erc6492VerifierAddress:H=y.universalSignatureVerifierAddress??C?.contracts?.erc6492Verifier?.address,multicallAddress:F=y.multicallAddress??C?.contracts?.multicall3?.address}=y;if(C?.verifyHash)return await C.verifyHash(w,y);const k=(()=>{const m=y.signature;return(0,f.isHex)(m)?m:typeof m=="object"&&"r"in m&&"s"in m?(0,O.serializeSignature)(m):(0,T.bytesToHex)(m)})();try{return t.SignatureErc8010.validate(k)?await g(w,{...y,multicallAddress:F,signature:k}):await _(w,{...y,verifierAddress:H,signature:k})}catch(m){try{if((0,u.isAddressEqual)((0,c.getAddress)(x),await(0,p.recoverAddress)({hash:B,signature:k})))return!0}catch{}if(m instanceof R)return!1;throw m}}async function g(w,y){const{address:x,blockNumber:C,blockTag:B,hash:H,multicallAddress:F}=y,{authorization:k,data:m,signature:M,to:A}=t.SignatureErc8010.unwrap(y.signature);if(await(0,h.getCode)(w,{address:x,blockNumber:C,blockTag:B})===(0,l.concatHex)(["0xef0100",k.address]))return await E(w,{address:x,blockNumber:C,blockTag:B,hash:H,signature:M});const S={address:k.address,chainId:Number(k.chainId),nonce:Number(k.nonce),r:(0,T.numberToHex)(k.r,{size:32}),s:(0,T.numberToHex)(k.s,{size:32}),yParity:k.yParity};if(!await(0,d.verifyAuthorization)({address:x,authorization:S}))throw new R;const N=await(0,v.getAction)(w,j.readContract,"readContract")({...F?{address:F}:{code:r.multicall3Bytecode},authorizationList:[S],abi:n.multicall3Abi,blockNumber:C,blockTag:"pending",functionName:"aggregate3",args:[[...m?[{allowFailure:!0,target:A??x,callData:m}
46]:[],{allowFailure:!0,target:x,callData:(0,o.encodeFunctionData)({abi:n.erc1271Abi,functionName:"isValidSignature",args:[H,M]})}]]});if(N[N.length-1]?.returnData?.startsWith("0x1626ba7e"))return!0;throw new R}async function _(w,y){const{address:x,factory:C,factoryData:B,hash:H,signature:F,verifierAddress:k,...m}=y,M=await(async()=>!C&&!B||e.SignatureErc6492.validate(F)?F:e.SignatureErc6492.wrap({data:B,signature:F,to:C}))(),A=k?{to:k,data:(0,o.encodeFunctionData)({abi:n.erc6492SignatureValidatorAbi,functionName:"isValidSig",args:[x,H,M]}),...m}:{data:(0,a.encodeDeployData)({abi:n.erc6492SignatureValidatorAbi,args:[x,H,M],bytecode:r.erc6492SignatureValidatorByteCode}),...m},{data:P}=await(0,v.getAction)(w,I.call,"call")(A).catch(S=>{throw S instanceof s.CallExecutionError?new R:S});if((0,b.hexToBool)(P??"0x0"))return!0;throw new R}async function E(w,y){const{address:x,blockNumber:C,blockTag:B,hash:H,signature:F}=y;if((await(0,v.getAction)(w,j.readContract,"readContract")({address:x,abi:n.erc1271Abi,args:[H,F],blockNumber:C,blockTag:B,functionName:"isValidSignature"}).catch(m=>{throw m instanceof s.ContractFunctionExecutionError?new R:m})).startsWith("0x1626ba7e"))return!0;throw new R}class R extends Error{}return Pn}var lc={},k1;function B2(){if(k1)return lc;k1=1,Object.defineProperty(lc,"__esModule",{value:!0}),lc.verifyMessage=r;const e=ge(),t=bi(),n=md();async function r(s,{address:a,message:o,factory:c,factoryData:u,signature:d,...l}){const f=(0,t.hashMessage)(o);return(0,e.getAction)(s,n.verifyHash,"verifyHash")({address:a,factory:c,factoryData:u,hash:f,signature:d,...l})}return lc}var bc={},N1;function x2(){if(N1)return bc;N1=1,Object.defineProperty(bc,"__esModule",{value:!0}),bc.verifyTypedData=r;const e=ge(),t=mi(),n=md();async function r(s,a){const{address:o,factory:c,factoryData:u,signature:d,message:l,primaryType:f,types:b,domain:T,...v}=a,p=(0,t.hashTypedData)({message:l,primaryType:f,types:b,domain:T});return(0,e.getAction)(s,n.verifyHash,"verifyHash")({address:o,factory:c,factoryData:u,hash:p,signature:d,...v})}return bc}var mc={},hc={},F1;function tv(){if(F1)return hc;F1=1,Object.defineProperty(hc,"__esModule",{value:!0}),hc.watchBlockNumber=o;const e=Ne(),t=ge(),n=nn(),r=Cn(),s=Ve(),a=di();function o(c,{emitOnBegin:u=!1,emitMissed:d=!1,onBlockNumber:l,onError:f,poll:b,pollingInterval:T=c.pollingInterval}){const v=typeof b<"u"?b:!(c.transport.type==="webSocket"||c.transport.type==="ipc"||c.transport.type==="fallback"&&(c.transport.transports[0].c
46onfig.type==="webSocket"||c.transport.transports[0].config.type==="ipc"));let p;return v?(()=>{const h=(0,s.stringify)(["watchBlockNumber",c.uid,u,d,T]);return(0,n.observe)(h,{onBlockNumber:l,onError:f},j=>(0,r.poll)(async()=>{try{const i=await(0,t.getAction)(c,a.getBlockNumber,"getBlockNumber")({cacheTime:0});if(p!==void 0){if(i===p)return;if(i-p>1&&d)for(let g=p+1n;g<i;g++)j.onBlockNumber(g,p),p=g}(p===void 0||i>p)&&(j.onBlockNumber(i,p),p=i)}catch(i){j.onError?.(i)}},{emitOnBegin:u,interval:T}))})():(()=>{const h=(0,s.stringify)(["watchBlockNumber",c.uid,u,d]);return(0,n.observe)(h,{onBlockNumber:l,onError:f},j=>{let i=!0,g=()=>i=!1;return(async()=>{try{const _=(()=>{if(c.transport.type==="fallback"){const R=c.transport.transports.find(w=>w.config.type==="webSocket"||w.config.type==="ipc");return R?R.value:c.transport}return c.transport})(),{unsubscribe:E}=await _.subscribe({params:["newHeads"],onData(R){if(!i)return;const w=(0,e.hexToBigInt)(R.result?.number);j.onBlockNumber(w,p),p=w},onError(R){j.onError?.(R)}});g=E,i||g()}catch(_){f?.(_)}})(),()=>g()})})()}return hc}var L1;function rv(){if(L1)return mc;L1=1,Object.defineProperty(mc,"__esModule",{value:!0}),mc.waitForTransactionReceipt=f;const e=Tf(),t=dt(),n=ge(),r=nn(),s=Mf(),a=id(),o=Ve(),c=tn(),u=m0(),d=J_(),l=tv();async function f(b,T){const{checkReplacement:v=!0,confirmations:p=1,hash:O,onReplaced:I,retryCount:h=6,retryDelay:j=({count:m})=>~~(1<<m)*200,timeout:i=18e4}=T,g=(0,o.stringify)(["waitForTransactionReceipt",b.uid,O]),_=T.pollingInterval?T.pollingInterval:b.chain?.experimental_preconfirmationTime?b.chain.experimental_preconfirmationTime:b.pollingInterval;let E,R,w,y=!1,x,C;const{promise:B,resolve:H,reject:F}=(0,s.withResolvers)(),k=i?setTimeout(()=>{C?.(),x?.(),F(new t.WaitForTransactionReceiptTimeoutError({hash:O}))},i):void 0;return x=(0,r.observe)(g,{onReplaced:I,resolve:H,reject:F},async m=>{if(w=await(0,n.getAction)(b,d.getTransactionReceipt,"getTransactionReceipt")({hash:O}).catch(()=>{}),w&&p<=1){clearTimeout(k),m.resolve(w),x?.();return}C=(0,n.getAction)(b,l.watchBlockNumber,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:_,async onBlockNumber(M){const A=S=>{clearTimeout(k),C?.(),S(),x?.()};let P=M;if(!y)try{if(w){if(p>
461&&(!w.blockNumber||P-w.blockNumber+1n<p))return;A(()=>m.resolve(w));return}if(v&&!E&&(y=!0,await(0,a.withRetry)(async()=>{E=await(0,n.getAction)(b,u.getTransaction,"getTransaction")({hash:O}),E.blockNumber&&(P=E.blockNumber)},{delay:j,retryCount:h}),y=!1),w=await(0,n.getAction)(b,d.getTransactionReceipt,"getTransactionReceipt")({hash:O}),p>1&&(!w.blockNumber||P-w.blockNumber+1n<p))return;A(()=>m.resolve(w))}catch(S){if(S instanceof t.TransactionNotFoundError||S instanceof t.TransactionReceiptNotFoundError){if(!E){y=!1;return}try{R=E,y=!0;const q=await(0,a.withRetry)(()=>(0,n.getAction)(b,c.getBlock,"getBlock")({blockNumber:P,includeTransactions:!0}),{delay:j,retryCount:h,shouldRetry:({error:L})=>L instanceof e.BlockNotFoundError});y=!1;const N=q.transactions.find(({from:L,nonce:z})=>L===R.from&&z===R.nonce);if(!N||(w=await(0,n.getAction)(b,d.getTransactionReceipt,"getTransactionReceipt")({hash:N.hash}),p>1&&(!w.blockNumber||P-w.blockNumber+1n<p)))return;let U="replaced";N.to===R.to&&N.value===R.value&&N.input===R.input?U="repriced":N.from===N.to&&N.value===0n&&(U="cancelled"),A(()=>{m.onReplaced?.({reason:U,replacedTransaction:R,transaction:N,transactionReceipt:w}),m.resolve(w)})}catch(q){A(()=>m.reject(q))}}else A(()=>m.reject(S))}}})}),B}return mc}var yc={},U1;function R2(){if(U1)return yc;U1=1,Object.defineProperty(yc,"__esModule",{value:!0}),yc.watchBlocks=a;const e=ge(),t=nn(),n=Cn(),r=Ve(),s=tn();function a(o,{blockTag:c=o.experimental_blockTag??"latest",emitMissed:u=!1,emitOnBegin:d=!1,onBlock:l,onError:f,includeTransactions:b,poll:T,pollingInterval:v=o.pollingInterval}){const p=typeof T<"u"?T:!(o.transport.type==="webSocket"||o.transport.type==="ipc"||o.transport.type==="fallback"&&(o.transport.transports[0].c
46onfig.type==="webSocket"||o.transport.transports[0].config.type==="ipc")),O=b??!1;let I;return p?(()=>{const i=(0,r.stringify)(["watchBlocks",o.uid,c,u,d,O,v]);return(0,t.observe)(i,{onBlock:l,onError:f},g=>(0,n.poll)(async()=>{try{const _=await(0,e.getAction)(o,s.getBlock,"getBlock")({blockTag:c,includeTransactions:O});if(_.number!==null&&I?.number!=null){if(_.number===I.number)return;if(_.number-I.number>1&&u)for(let E=I?.number+1n;E<_.number;E++){const R=await(0,e.getAction)(o,s.getBlock,"getBlock")({blockNumber:E,includeTransactions:O});g.onBlock(R,I),I=R}}(I?.number==null||c==="pending"&&_?.number==null||_.number!==null&&_.number>I.number)&&(g.onBlock(_,I),I=_)}catch(_){g.onError?.(_)}},{emitOnBegin:d,interval:v}))})():(()=>{let i=!0,g=!0,_=()=>i=!1;return(async()=>{try{d&&(0,e.getAction)(o,s.getBlock,"getBlock")({blockTag:c,includeTransactions:O}).then(w=>{i&&g&&(l(w,void 0),g=!1)}).catch(f);const E=(()=>{if(o.transport.type==="fallback"){const w=o.transport.transports.find(y=>y.config.type==="webSocket"||y.config.type==="ipc");return w?w.value:o.transport}return o.transport})(),{unsubscribe:R}=await E.subscribe({params:["newHeads"],async onData(w){if(!i)return;const y=await(0,e.getAction)(o,s.getBlock,"getBlock")({blockNumber:w.result?.number,includeTransactions:O}).catch(()=>{});i&&(l(y,I),g=!1,I=y)},onError(w){f?.(w)}});_=R,i||_()}catch(E){f?.(E)}})(),()=>_()})()}return yc}var gc={},z1;function O2(){if(z1)return gc;z1=1,Object.defineProperty(gc,"__esModule",{value:!0}),gc.watchEvent=v;const e=qe(),t=_r(),n=ii(),r=$r(),s=nr(),a=ge(),o=nn(),c=Cn(),u=Ve(),d=u_(),l=di(),f=rd(),b=Cf(),T=nd();function v(p,{address:O,args:I,batch:h=!0,event:j,events:i,fromBlock:g,onError:_,onLogs:E,poll:R,pollingInterval:w=p.pollingInterval,strict:y}){const x=typeof R<"u"?R:typeof g=="bigint"?!0:!(p.transport.type==="webSocket"||p.transport.type==="ipc"||p.transport.type==="fallback"&&(p.transport.transports[0].c
46onfig.type==="webSocket"||p.transport.transports[0].config.type==="ipc")),C=y??!1;return x?(()=>{const F=(0,u.stringify)(["watchEvent",O,I,h,p.uid,j,w,g]);return(0,o.observe)(F,{onLogs:E,onError:_},k=>{let m;g!==void 0&&(m=g-1n);let M,A=!1;const P=(0,c.poll)(async()=>{if(!A){try{M=await(0,a.getAction)(p,d.createEventFilter,"createEventFilter")({address:O,args:I,event:j,events:i,strict:C,fromBlock:g})}catch{}A=!0;return}try{let S;if(M)S=await(0,a.getAction)(p,f.getFilterChanges,"getFilterChanges")({filter:M});else{const q=await(0,a.getAction)(p,l.getBlockNumber,"getBlockNumber")({});m&&m!==q?S=await(0,a.getAction)(p,b.getLogs,"getLogs")({address:O,args:I,event:j,events:i,fromBlock:m+1n,toBlock:q}):S=[],m=q}if(S.length===0)return;if(h)k.onLogs(S);else for(const q of S)k.onLogs([q])}catch(S){M&&S instanceof t.InvalidInputRpcError&&(A=!1),k.onError?.(S)}},{emitOnBegin:!0,interval:w});return async()=>{M&&await(0,a.getAction)(p,T.uninstallFilter,"uninstallFilter")({filter:M}),P()}})})():(()=>{let F=!0,k=()=>F=!1;return(async()=>{try{const m=(()=>{if(p.transport.type==="fallback"){const S=p.transport.transports.find(q=>q.config.type==="webSocket"||q.config.type==="ipc");return S?S.value:p.transport}return p.transport})(),M=i??(j?[j]:void 0);let A=[];M&&(A=[M.flatMap(q=>(0,r.encodeEventTopics)({abi:[q],eventName:q.name,args:I}))],j&&(A=A[0]));const{unsubscribe:P}=await m.subscribe({params:["logs",{address:O,topics:A}],onData(S){if(!F)return;const q=S.result;try{const{eventName:N,args:U}=(0,n.decodeEventLog)({abi:M??[],data:q.data,topics:q.topics,strict:C}),L=(0,s.formatLog)(q,{args:U,eventName:N});E([L])}catch(N){let U,L;if(N instanceof e.DecodeLogDataMismatch||N instanceof e.DecodeLogTopicsMismatch){if(y)return;U=N.abiItem.name,L=N.abiItem.inputs?.some(D=>!("name"in D&&D.name))}const z=(0,s.formatLog)(q,{args:L?[]:{},eventName:U});E([z])}},onError(S){_?.(S)}});k=P,F||k()}catch(m){_?.(m)}})(),()=>k()})()}return gc}var pc={},D1;function C2(){if(D1)return pc;D1=1,Object.defineProperty(pc,"__esModule",{value:!0}),pc.watchPendingTransactions=c;const e=ge(),t=nn(),n=Cn(),r=Ve(),s=d_(),a=rd(),o=nd();function c(u,{batch:d=!0,onError:l,onTransactions:f,poll:b,pollingInterval:T=u.pollingInterval}){return(typeof b<"u"?b:u.transport.type!=="webSocket"&&u.transport.type!=="ipc")?(()=>{const I=(0,r.stringify)(["watchPendingTransactions",u.uid,d,T]);return(0,t.observe)(I,{onTransactions:f,onError:l},h=>{let j;const i=(0,n.poll)(async()=>{try{if(!j)try{j=await(0,e.getAction)(u,s.createPendingTransactionFilter,"createPendingTransactionFilter")({});return}catch(_){throw i(),_}const g=await(0,e.getAction)(u,a.getFilterChanges,"getFilterChanges")({filter:j});if(g.length===0)return;if(d)h.onTransactions(g);else for(const _ of g)h.onTransactions([_])}catch(g){h.onError?.(g)}},{emitOnBegin:!0,interval:T});return async()=>{j&&await(0,e.getAction)(u,o.uninstallFilter,"uninstallFilter")({filter:j}),i()}})})():(()=>{let I=!0,h=()=>I=!1;return(async()=>{try{const{unsubscribe:j}=await u.transport.subscribe({params:["newPendingTransactions"],onData(i){if(!I)return;const g=i.result;f([g])},onError(i){l?.(i)}});h=j,I||h()}catch(j){l?.(j)}})(),()=>h()})()}return pc}var _c={},vc={},G1;function q2(){if(G1)return vc;G1=1,Object.defineProperty(vc,"__esModule",{value:!0}),vc.parseSiweMessage=e;function e(r){const{scheme:s,statement:a,...o}=r.match(t)?.groups??{},{chainId:c,expirationTime:u,issuedAt:d,notBefore:l,requestId:f,...b}=r.match(n)?.groups??{},T=r.split("Resources:")[1]?.split(`
47- `).slice(1);return{...o,...b,...c?{chainId:Number(c)}:{},...u?{expirationTime:new Date(u)}:{},...d?{issuedAt:new Date(d)}:{},...l?{notBefore:new Date(l)}:{},...f?{requestId:f}:{},...T?{resources:T}:{},...s?{scheme:s}:{},...a?{statement:a}:{}}}const t=/^(?:(?<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)?/,n=/(?: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>.+))?/;
47return vc}var Ec={},V1;function H2(){if(V1)return Ec;V1=1,Object.defineProperty(Ec,"__esModule",{value:!0}),Ec.validateSiweMessage=n;const e=ut(),t=Ot();function n(r){const{address:s,domain:a,message:o,nonce:c,scheme:u,time:d=new Date}=r;if(a&&o.domain!==a||c&&o.nonce!==c||u&&o.scheme!==u||o.expirationTime&&d>=o.expirationTime||o.notBefore&&d<o.notBefore)return!1;try{if(!o.address||!(0,e.isAddress)(o.address,{strict:!1})||s&&!(0,t.isAddressEqual)(o.address,s))return!1}catch{return!1}return!0}return Ec}var W1;function M2(){if(W1)return _c;W1=1,Object.defineProperty(_c,"__esModule",{value:!0}),_c.verifySiweMessage=s;const e=bi(),t=q2(),n=H2(),r=md();async function s(a,o){const{address:c,domain:u,message:d,nonce:l,scheme:f,signature:b,time:T=new Date,...v}=o,p=(0,t.parseSiweMessage)(d);if(!p.address||!(0,n.validateSiweMessage)({address:c,domain:u,message:p,nonce:l,scheme:f,time:T}))return!1;const I=(0,e.hashMessage)(d);return(0,r.verifyHash)(a,{address:p.address,hash:I,signature:b,...v})}return _c}var wc={},K1;function h0(){if(K1)return wc;K1=1,Object.defineProperty(wc,"__esModule",{value:!0}),wc.sendRawTransactionSync=r;const e=dt(),t=li(),n=b0();async function r(s,{serializedTransaction:a,throwOnReceiptRevert:o,timeout:c}){const u=await s.request({method:"eth_sendRawTransactionSync",params:c?[a,(0,n.numberToHex)(c)]:[a]},{retryCount:0}),l=(s.chain?.formatters?.transactionReceipt?.format||t.formatTransactionReceipt)(u);if(l.status==="reverted"&&o)throw new e.TransactionReceiptRevertedError({receipt:l});return l}return wc}var Z1;function nv(){if(Z1)return na;Z1=1,Object.defineProperty(na,"__esModule",{value:!0}),na.publicActions=se;const e=k6(),t=L6(),n=U6(),r=z6(),s=a_(),a=On(),o=c_(),c=D6(),u=pf(),d=u_(),l=d_(),f=Yp(),b=Vp(),T=Of(),v=Gp(),p=Rf(),O=G6(),I=V6(),h=tn(),j=di(),i=W6(),g=jr(),_=f_(),E=qf(),R=Z6(),w=J6(),y=rd(),x=X6(),C=Sf(),B=Cf(),H=_2(),F=v2(),k=m0(),m=E2(),M=Yu(),A=J_(),P=w2(),S=Nt(),q=X_(),N=T2(),U=$p(),L=nd(),z=md(),D=B2(),X=x2(),W=rv(),Z=tv(),J=R2(),oe=t_(),K=O2(),Y=C2(),$=M2(),re=oi(),ee=Df(),ne=h0();function se(te){return{call:Q=>(0,a.call)(te,Q),createAccessList:Q=>(0,o.createAccessList)(te,Q),createBlockFilter:()=>(0,c.createBlockFilter)(te),createContractEventFilter:Q=>(0,u.createContractEventFilter)(te,Q),createEventFilter:Q=>(0,d.createEventFilter)(te,Q),createPendingTransactionFilter:()=>(0,l.createPendingTransactionFilter)(te),estimateContractGas:Q=>(0,f.estimateContractGas)(te,Q),estimateGas:Q=>(0,T.estimateGas)(te,Q),getBalance:Q=>(0,O.getBalance)(te,Q),getBlobBaseFee:()=>(0,I.getBlobBaseFee)(te),getBlock:Q=>(0,h.getBlock)(te,Q),getBlockNumber:Q=>(0,j.getBlockNumber)(te,Q),getBlockTransactionCount:Q=>(0,i.getBlockTransactionCount)(te,Q),getBytecode:Q=>(0,_.getCode)(te,Q),getChainId:()=>(0,g.getChainId)(te),getCode:Q=>(0,_.getCode)(te,Q),getContractEvents:Q=>(0,E.getContractEvents)(te,Q),getEip712Domain:Q=>(0,R.getEip712Domain)(te,Q),getEnsAddress:Q=>(0,e.getEnsAddress)(te,Q),getEnsAvatar:Q=>(0,t.getEnsAvatar)(te,Q),getEnsName:Q=>(0,n.getEnsName)(te,Q),getEnsResolver:Q=>(0,r.getEnsResolver)(te,Q),getEnsText:Q=>(0,s.getEnsText)(te,Q),getFeeHistory:Q=>(0,w.getFeeHistory)(te,Q),estimateFeesPerGas:Q=>(0,b.estimateFeesPerGas)(te,Q),getFilterChanges:Q=>(0,y.getFilterChanges)(te,Q),getFilterLogs:Q=>(0,x.getFilterLogs)(te,Q),getGasPrice:()=>(0,C.getGasPrice)(te),getLogs:Q=>(0,B.getLogs)(te,Q),getProof:Q=>(0,H.getProof)(te,Q),estimateMaxPriorityFeePerGas:Q=>(0,v.estimateMaxPriorityFeePerGas)(te,Q),fillTransaction:Q=>(0,p.fillTransaction)(te,Q),getStorageAt:Q=>
47(0,F.getStorageAt)(te,Q),getTransaction:Q=>(0,k.getTransaction)(te,Q),getTransactionConfirmations:Q=>(0,m.getTransactionConfirmations)(te,Q),getTransactionCount:Q=>(0,M.getTransactionCount)(te,Q),getTransactionReceipt:Q=>(0,A.getTransactionReceipt)(te,Q),multicall:Q=>(0,P.multicall)(te,Q),prepareTransactionRequest:Q=>(0,re.prepareTransactionRequest)(te,Q),readContract:Q=>(0,S.readContract)(te,Q),sendRawTransaction:Q=>(0,ee.sendRawTransaction)(te,Q),sendRawTransactionSync:Q=>(0,ne.sendRawTransactionSync)(te,Q),simulate:Q=>(0,q.simulateBlocks)(te,Q),simulateBlocks:Q=>(0,q.simulateBlocks)(te,Q),simulateCalls:Q=>(0,N.simulateCalls)(te,Q),simulateContract:Q=>(0,U.simulateContract)(te,Q),verifyHash:Q=>(0,z.verifyHash)(te,Q),verifyMessage:Q=>(0,D.verifyMessage)(te,Q),verifySiweMessage:Q=>(0,$.verifySiweMessage)(te,Q),verifyTypedData:Q=>(0,X.verifyTypedData)(te,Q),uninstallFilter:Q=>(0,L.uninstallFilter)(te,Q),waitForTransactionReceipt:Q=>(0,W.waitForTransactionReceipt)(te,Q),watchBlocks:Q=>(0,J.watchBlocks)(te,Q),watchBlockNumber:Q=>(0,Z.watchBlockNumber)(te,Q),watchContractEvent:Q=>(0,oe.watchContractEvent)(te,Q),watchEvent:Q=>(0,K.watchEvent)(te,Q),watchPendingTransactions:Q=>(0,Y.watchPendingTransactions)(te,Q)}}return na}var Y1;function k2(){if(Y1)return ra;Y1=1,Object.defineProperty(ra,"__esModule",{value:!0}),ra.createPublicClient=n;const e=sd(),t=nv();function n(r){const{key:s="public",name:a="Public Client"}=r;return(0,e.createClient)({...r,key:s,name:a,type:"publicClient"}).extend(t.publicActions)}return ra}var jc={},Pc={},Ac={},J1;function N2(){if(J1)return Ac;J1=1,Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.dropTransaction=e;async function e(t,{hash:n}){await t.request({method:`${t.mode}_dropTransaction`,params:[n]})}return Ac}var Tc={},X1;function F2(){if(X1)return Tc;X1=1,Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.dumpState=e;async function e(t){return t.request({method:`${t.mode}_dumpState`})}return Tc}var Sc={},Q1;function L2(){if(Q1)return Sc;Q1=1,Object.defineProperty(Sc,"__esModule",{value:!0}),Sc.getAutomine=e;async function e(t){return t.mode==="ganache"?await t.request({method:"eth_mining"}):await t.request({method:`${t.mode}_getAutomine`})}return Sc}var Ic={},$1;function U2(){if($1)return Ic;$1=1,Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.getTxpoolContent=e;async function e(t){return await t.request({method:"txpool_content"})}return Ic}var Bc={},eg;function z2(){if(eg)return Bc;eg=1,Object.defineProperty(Bc,"__esModule",{value:!0}),Bc.getTxpoolStatus=t;const e=Ne();async function t(n){const{pending:r,queued:s}=await n.request({method:"txpool_status"});return{pending:(0,e.hexToNumber)(r),queued:(0,e.hexToNumber)(s)}}return Bc}var xc={},tg;function D2(){if(tg)return xc;tg=1,Object.defineProperty(xc,"__esModule",{value:!0}),xc.impersonateAccount=e;async function e(t,{address:n}){await t.request({method:`${t.mode}_impersonateAccount`,params:[n]})}return xc}var Rc={},rg;function G2(){if(rg)return Rc;rg=1,Object.defineProperty(Rc,"__esModule",{value:!0}),Rc.increaseTime=t;const e=ie();async function t(n,{seconds:r}){return await n.request({method:"evm_increaseTime",params:[(0,e.numberToHex)(r)]})}return Rc}var Oc={},ng;function V2(){if(ng)return Oc;ng=1,Object.defineProperty(Oc,"__esModule",{value:!0}),Oc.inspectTxpool=e;async function e(t){return await t.request({method:"txpool_inspect"})}return Oc}var Cc={},og;function W2(){if(og)return Cc;og=1,Object.defineProperty(Cc,"__esModule",{value:!0}),Cc.loadState=e;async function e(t,{state:n}){await t.request({method:`${t.mode}_loadState`,params:[n]})}return Cc}var qc={},ig;function K2(){if(ig)return qc;ig=1,Object.defineProperty(qc,"__esModule",{value:!0}),qc.mine=t;const e=ie();async function t(n,{blocks:r,interval:s}){n.mode==="ganache"?await n.request({method:"evm_mine",params:[{blocks:(0,e.numberToHex)(r)}]}):await n.request({method:`${n.mode}_mine`,params:[(0,e.numberToHex)(r),(0,e.numberToHex)(s||0)]})}return qc}var Hc={},sg;function Z2(){if(sg)return Hc;sg=1,Object.defineProperty(Hc,"__esModule",{value:!0}),Hc.removeBlockTimestampInterval=e;async function e(t){await t.request({method:`${t.mode}_removeBlockTimestampInterval`})}return Hc}var Mc={},ag;function Y2(){if(ag)return Mc;ag=1,Object.defineProperty(Mc,"__esModule",{value:!0}),Mc.reset=e;async function e(t,{blockNumber:n,jsonRpcUrl:r}={}){await t.request({method:`${t.mode}_reset`,params:[{forking:{blockNumber:Number(n),jsonRpcUrl:r}}]})}return Mc}var kc={},cg;
47function J2(){if(cg)return kc;cg=1,Object.defineProperty(kc,"__esModule",{value:!0}),kc.revert=e;async function e(t,{id:n}){await t.request({method:"evm_revert",params:[n]})}return kc}var Nc={},ug;function X2(){if(ug)return Nc;ug=1,Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.sendUnsignedTransaction=n;const e=wr(),t=xt();async function n(r,s){const{accessList:a,data:o,from:c,gas:u,gasPrice:d,maxFeePerGas:l,maxPriorityFeePerGas:f,nonce:b,to:T,value:v,...p}=s,O=r.chain?.formatters?.transactionRequest?.format,h=(O||t.formatTransactionRequest)({...(0,e.extract)(p,{format:O}),accessList:a,data:o,from:c,gas:u,gasPrice:d,maxFeePerGas:l,maxPriorityFeePerGas:f,nonce:b,to:T,value:v},"sendUnsignedTransaction");return await r.request({method:"eth_sendUnsignedTransaction",params:[h]})}return Nc}var Fc={},dg;function Q2(){if(dg)return Fc;dg=1,Object.defineProperty(Fc,"__esModule",{value:!0}),Fc.setAutomine=e;async function e(t,n){t.mode==="ganache"?n?await t.request({method:"miner_start"}):await t.request({method:"miner_stop"}):await t.request({method:"evm_setAutomine",params:[n]})}return Fc}var Lc={},fg;function $2(){if(fg)return Lc;fg=1,Object.defineProperty(Lc,"__esModule",{value:!0}),Lc.setBalance=t;const e=ie();async function t(n,{address:r,value:s}){n.mode==="ganache"?await n.request({method:"evm_setAccountBalance",params:[r,(0,e.numberToHex)(s)]}):await n.request({method:`${n.mode}_setBalance`,params:[r,(0,e.numberToHex)(s)]})}return Lc}var Uc={},lg;function e5(){if(lg)return Uc;lg=1,Object.defineProperty(Uc,"__esModule",{value:!0}),Uc.setBlockGasLimit=t;const e=ie();async function t(n,{gasLimit:r}){await n.request({method:"evm_setBlockGasLimit",params:[(0,e.numberToHex)(r)]})}return Uc}var zc={},bg;function t5(){if(bg)return zc;bg=1,Object.defineProperty(zc,"__esModule",{value:!0}),zc.setBlockTimestampInterval=e;async function e(t,{interval:n}){const r=t.mode==="hardhat"?n*1e3:n;await t.request({method:`${t.mode}_setBlockTimestampInterval`,params:[r]})}return zc}var Dc={},mg;function r5(){if(mg)return Dc;mg=1,Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.setCode=e;async function e(t,{address:n,bytecode:r}){t.mode==="ganache"?await t.request({method:"evm_setAccountCode",params:[n,r]}):await t.request({method:`${t.mode}_setCode`,params:[n,r]})}return Dc}var Gc={},hg;function n5(){if(hg)return Gc;hg=1,Object.defineProperty(Gc,"__esModule",{value:!0}),Gc.setCoinbase=e;async function e(t,{address:n}){await t.request({method:`${t.mode}_setCoinbase`,params:[n]})}return Gc}var Vc={},yg;function o5(){if(yg)return Vc;yg=1,Object.defineProperty(Vc,"__esModule",{value:!0}),Vc.setIntervalMining=e;async function e(t,{interval:n}){const r=t.mode==="hardhat"?n*1e3:n;await t.request({method:"evm_setIntervalMining",params:[r]})}return Vc}var Wc={},gg;function i5(){if(gg)return Wc;gg=1,Object.defineProperty(Wc,"__esModule",{value:!0}),Wc.setLoggingEnabled=e;async function e(t,n){await t.request({method:`${t.mode}_setLoggingEnabled`,params:[n]})}return Wc}var Kc={},pg;function s5(){if(pg)return Kc;pg=1,Object.defineProperty(Kc,"__esModule",{value:!0}),Kc.setMinGasPrice=t;const e=ie();async function t(n,{gasPrice:r}){await n.request({method:`${n.mode}_setMinGasPrice`,params:[(0,e.numberToHex)(r)]})}return Kc}var Zc={},_g;function a5(){if(_g)return Zc;_g=1,Object.defineProperty(Zc,"__esModule",{value:!0}),Zc.setNextBlockBaseFeePerGas=t;const e=ie();async function t(n,{baseFeePerGas:r}){await n.request({method:`${n.mode}_setNextBlockBaseFeePerGas`,params:[(0,e.numberToHex)(r)]})}return Zc}var Yc={},vg;function c5(){if(vg)return Yc;vg=1,Object.defineProperty(Yc,"__esModule",{value:!0}),Yc.setNextBlockTimestamp=t;const e=ie();async function t(n,{timestamp:r}){await n.request({method:"evm_setNextBlockTimestamp",params:[(0,e.numberToHex)(r)]})}return Yc}var Jc={},Eg;function u5(){if(Eg)return Jc;Eg=1,Object.defineProperty(Jc,"__esModule",{value:!0}),Jc.setNonce=t;const e=ie();async function t(n,{address:r,nonce:s}){await n.request({method:`${n.mode}_setNonce`,params:[r,(0,e.numberToHex)(s)]})}return Jc}var Xc={},wg;function d5(){if(wg)return Xc;wg=1,Object.defineProperty(Xc,"__esModule",{value:!0}),Xc.setRpcUrl=e;async function e(t,n){await t.request({method:`${t.mode}_setRpcUrl`,params:[n]})}return Xc}var Qc={},jg;function f5(){if(jg)return Qc;jg=1,Object.defineProperty(Qc,"__esModule",{value:!0}),Qc.setStorageAt=t;const e=ie();async function t(n,{address:r,index:s,value:a}){await n.request({method:`${n.mode}_setStorageAt`,params:[r,typeof s=="number"?(0,e.numberToHex)(s):s,a]})}return Qc}var $c={},Pg;function l5(){if(Pg)return $c;Pg=1,Object.defineProperty($c,"__esModule",{value:!0}),$c.snapshot=e;async function e(t){return await t.request({method:"evm_snapshot"})}return $c}var eu={},Ag;function b5(){if(Ag)return eu;
47Ag=1,Object.defineProperty(eu,"__esModule",{value:!0}),eu.stopImpersonatingAccount=e;async function e(t,{address:n}){await t.request({method:`${t.mode}_stopImpersonatingAccount`,params:[n]})}return eu}var Tg;function ov(){if(Tg)return Pc;Tg=1,Object.defineProperty(Pc,"__esModule",{value:!0}),Pc.testActions=H;const e=N2(),t=F2(),n=L2(),r=U2(),s=z2(),a=D2(),o=G2(),c=V2(),u=W2(),d=K2(),l=Z2(),f=Y2(),b=J2(),T=X2(),v=Q2(),p=$2(),O=e5(),I=t5(),h=r5(),j=n5(),i=o5(),g=i5(),_=s5(),E=a5(),R=c5(),w=u5(),y=d5(),x=f5(),C=l5(),B=b5();function H({mode:F}){return k=>{const m=k.extend(()=>({mode:F}));return{dropTransaction:M=>(0,e.dropTransaction)(m,M),dumpState:()=>(0,t.dumpState)(m),getAutomine:()=>(0,n.getAutomine)(m),getTxpoolContent:()=>(0,r.getTxpoolContent)(m),getTxpoolStatus:()=>(0,s.getTxpoolStatus)(m),impersonateAccount:M=>(0,a.impersonateAccount)(m,M),increaseTime:M=>(0,o.increaseTime)(m,M),inspectTxpool:()=>(0,c.inspectTxpool)(m),loadState:M=>(0,u.loadState)(m,M),mine:M=>(0,d.mine)(m,M),removeBlockTimestampInterval:()=>(0,l.removeBlockTimestampInterval)(m),reset:M=>(0,f.reset)(m,M),revert:M=>(0,b.revert)(m,M),sendUnsignedTransaction:M=>(0,T.sendUnsignedTransaction)(m,M),setAutomine:M=>(0,v.setAutomine)(m,M),setBalance:M=>(0,p.setBalance)(m,M),setBlockGasLimit:M=>(0,O.setBlockGasLimit)(m,M),setBlockTimestampInterval:M=>(0,I.setBlockTimestampInterval)(m,M),setCode:M=>(0,h.setCode)(m,M),setCoinbase:M=>(0,j.setCoinbase)(m,M),setIntervalMining:M=>(0,i.setIntervalMining)(m,M),setLoggingEnabled:M=>(0,g.setLoggingEnabled)(m,M),setMinGasPrice:M=>(0,_.setMinGasPrice)(m,M),setNextBlockBaseFeePerGas:M=>(0,E.setNextBlockBaseFeePerGas)(m,M),setNextBlockTimestamp:M=>(0,R.setNextBlockTimestamp)(m,M),setNonce:M=>(0,w.setNonce)(m,M),setRpcUrl:M=>(0,y.setRpcUrl)(m,M),setStorageAt:M=>(0,x.setStorageAt)(m,M),snapshot:()=>(0,C.snapshot)(m),stopImpersonatingAccount:M=>(0,B.stopImpersonatingAccount)(m,M)}}}return Pc}var Sg;function m5(){if(Sg)return jc;Sg=1,Object.defineProperty(jc,"__esModule",{value:!0}),jc.createTestClient=n;const e=sd(),t=ov();function n(r){const{key:s="test",name:a="Test Client",mode:o}=r;return(0,e.createClient)({...r,key:s,name:a,type:"testClient"}).extend(u=>({mode:o,...(0,t.testActions)({mode:o})(u)}))}return jc}var tu={},ru={},nu={},Ig;function h5(){if(Ig)return nu;Ig=1,Object.defineProperty(nu,"__esModule",{value:!0}),nu.addChain=t;const e=ie();async function t(n,{chain:r}){const{id:s,name:a,nativeCurrency:o,rpcUrls:c,blockExplorers:u}=r;await n.request({method:"wallet_addEthereumChain",params:[{chainId:(0,e.numberToHex)(s),chainName:a,nativeCurrency:o,rpcUrls:c.default.http,blockExplorerUrls:u?Object.values(u).map(({url:d})=>d):void 0}]},{dedupe:!0,retryCount:0})}return nu}var ou={},Bg;function y5(){if(Bg)return ou;Bg=1,Object.defineProperty(ou,"__esModule",{value:!0}),ou.deployContract=n;const e=ui(),t=od();function n(r,s){const{abi:a,args:o,bytecode:c,...u}=s,d=(0,e.encodeDeployData)({abi:a,args:o,bytecode:c});return(0,t.sendTransaction)(r,{...u,...u.authorizationList?{to:null}:{},data:d})}return ou}var iu={},xg;function g5(){if(xg)return iu;xg=1,Object.defineProperty(iu,"__esModule",{value:!0}),iu.getAddresses=t;const e=yt();async function t(n){return n.account?.type==="local"?[n.account.address]:(await n.request({method:"eth_accounts"},{dedupe:!0})).map(s=>(0,e.checksumAddress)(s))}return iu}var su={},Rg;function p5(){if(Rg)return su;Rg=1,Object.defineProperty(su,"__esModule",{value:!0}),su.getCapabilities=n;const e=He(),t=ie();async function n(r,s={}){const{account:a=r.account,chainId:o}=s,c=a?(0,e.parseAccount)(a):void 0,u=o?[c?.address,[(0,t.numberToHex)(o)]]:[c?.address],d=await r.request({method:"wallet_getCapabilities",params:u}),l={};for(const[f,b]of Object.entries(d)){l[Number(f)]={};for(let[T,v]of Object.entries(b))T==="addSubAccount"&&(T="unstable_addSubAccount"),l[Number(f)][T]=v}return typeof o=="number"?l[o]:l}return su}var au={},Og;function _5(){if(Og)return au;Og=1,Object.defineProperty(au,"__esModule",{value:!0}),au.getPermissions=e;async function e(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}return au}var cu={},Cg;function iv(){if(Cg)return cu;
47Cg=1,Object.defineProperty(cu,"__esModule",{value:!0}),cu.prepareAuthorization=o;const e=He(),t=Ar(),n=Ot(),r=ge(),s=jr(),a=Yu();async function o(c,u){const{account:d=c.account,chainId:l,nonce:f}=u;if(!d)throw new t.AccountNotFoundError({docsPath:"/docs/eip7702/prepareAuthorization"});const b=(0,e.parseAccount)(d),T=(()=>{if(u.executor)return u.executor==="self"?u.executor:(0,e.parseAccount)(u.executor)})(),v={address:u.contractAddress??u.address,chainId:l,nonce:f};return typeof v.chainId>"u"&&(v.chainId=c.chain?.id??await(0,r.getAction)(c,s.getChainId,"getChainId")({})),typeof v.nonce>"u"&&(v.nonce=await(0,r.getAction)(c,a.getTransactionCount,"getTransactionCount")({address:b.address,blockTag:"pending"}),(T==="self"||T?.address&&(0,n.isAddressEqual)(T.address,b.address))&&(v.nonce+=1)),v}return cu}var uu={},qg;function v5(){if(qg)return uu;qg=1,Object.defineProperty(uu,"__esModule",{value:!0}),uu.requestAddresses=t;const e=yt();async function t(n){return(await n.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(s=>(0,e.getAddress)(s))}return uu}var du={},Hg;function E5(){if(Hg)return du;Hg=1,Object.defineProperty(du,"__esModule",{value:!0}),du.requestPermissions=e;async function e(t,n){return t.request({method:"wallet_requestPermissions",params:[n]},{retryCount:0})}return du}var fu={},Mg;function w5(){if(Mg)return fu;Mg=1,Object.defineProperty(fu,"__esModule",{value:!0}),fu.sendCallsSync=r;const e=ge(),t=Vf(),n=Wf();async function r(s,a){const{chain:o=s.chain}=a,c=a.timeout??Math.max((o?.blockTime??0)*3,5e3),u=await(0,e.getAction)(s,t.sendCalls,"sendCalls")(a);return await(0,e.getAction)(s,n.waitForCallsStatus,"waitForCallsStatus")({...a,id:u.id,timeout:c})}return fu}var lu={},kg;function sv(){if(kg)return lu;kg=1,Object.defineProperty(lu,"__esModule",{value:!0}),lu.sendTransactionSync=h;const e=He(),t=Ar(),n=fe(),r=dt(),s=$o(),a=fi(),o=Le(),c=ni(),u=wr(),d=xt(),l=ge(),f=Xr(),b=Rt(),T=jr(),v=rv(),p=oi(),O=h0(),I=new f.LruMap(128);async function h(j,i){const{account:g=j.account,assertChainId:_=!0,chain:E=j.chain,accessList:R,authorizationList:w,blobs:y,data:x,dataSuffix:C=typeof j.dataSuffix=="string"?j.dataSuffix:j.dataSuffix?.value,gas:B,gasPrice:H,maxFeePerBlobGas:F,maxFeePerGas:k,maxPriorityFeePerGas:m,nonce:M,pollingInterval:A,throwOnReceiptRevert:P,type:S,value:q,...N}=i,U=i.timeout??Math.max((E?.blockTime??0)*3,5e3);if(typeof g>"u")throw new t.AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransactionSync"});const L=g?(0,e.parseAccount)(g):null;try{(0,b.assertRequest)(i);const z=await(async()=>{if(i.to)return i.to;if(i.to!==null&&w&&w.length>0)return await(0,s.recoverAuthorizationAddress)({authorization:w[0]}).catch(()=>{throw new n.BaseError("`to` is required. Could not infer from `authorizationList`.")})})();if(L?.type==="json-rpc"||L===null){let D;E!==null&&(D=await(0,l.getAction)(j,T.getChainId,"getChainId")({}),_&&(0,a.assertCurrentChain)({currentChainId:D,chain:E}));const X=j.chain?.formatters?.transactionRequest?.format,Z=(X||d.formatTransactionRequest)({...(0,u.extract)(N,{format:X}),accessList:R,account:L,authorizationList:w,blobs:y,chainId:D,data:x&&(0,o.concat)([x,C??"0x"]),gas:B,gasPrice:H,maxFeePerBlobGas:F,maxFeePerGas:k,maxPriorityFeePerGas:m,nonce:M,to:z,type:S,value:q},"sendTransaction"),J=I.get(j.uid),oe=J?"wallet_sendTransaction":"eth_sendTransaction",K=await(async()=>{try{return await j.request({method:oe,params:[Z]},{retryCount:0})}catch($){if(J===!1)throw $;const re=$;if(re.name==="InvalidInputRpcError"||re.name==="InvalidParamsRpcError"||re.name==="MethodNotFoundRpcError"||re.name==="MethodNotSupportedRpcError")return await j.request({method:"wallet_sendTransaction",params:[Z]},{retryCount:0}).then(ee=>(I.set(j.uid,!0),ee)).catch(ee=>{const ne=ee;throw ne.name==="MethodNotFoundRpcError"||ne.name==="MethodNotSupportedRpcError"?(I.set(j.uid,!1),re):ne});throw re}})(),Y=await(0,l.getAction)(j,v.waitForTransactionReceipt,"waitForTransactionReceipt")({checkReplacement:!1,hash:K,pollingInterval:A,timeout:U});if(P&&Y.status==="reverted")throw new r.TransactionReceiptRevertedError({receipt:Y});return Y}if(L?.type==="local"){const D=await(0,l.getAction)(j,p.prepareTransactionRequest,"prepareTransactionRequest")({account:L,accessList:R,authorizationList:w,blobs:y,chain:E,data:x&&(0,o.concat)([x,C??"0x"]),gas:B,gasPrice:H,maxFeePerBlobGas:F,maxFeePerGas:k,maxPriorityFeePerGas:m,nonce:M,nonceManager:L.nonceManager,parameters:[...p.defaultParameters,"sidecars"],type:S,value:q,...N,to:z}),X=E?.serializers?.transaction,W=await L.signTransaction(D,{serializer:X});return await(0,l.getAction)(j,O.sendRawTransactionSync,"sendRawTransactionSync")({serializedTransaction:W,throwOnReceiptRevert:P,timeout:i.timeout})}throw L?.type==="smart"?new t.AccountTypeNotSupportedError({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new t.AccountTypeNotSupportedError({docsPath:"/docs/actions/wallet/sendTransactionSync",type:L?.type})}catch(z){throw z instanceof t.AccountTypeNotSupportedError?z:(0,c.getTransactionError)(z,{...i,account:L,chain:i.chain||void 0})}}return lu}var bu={},Ng;function j5(){if(Ng)return bu;
47Ng=1,Object.defineProperty(bu,"__esModule",{value:!0}),bu.showCallsStatus=e;async function e(t,n){const{id:r}=n;await t.request({method:"wallet_showCallsStatus",params:[r]})}return bu}var mu={},Fg;function P5(){if(Fg)return mu;Fg=1,Object.defineProperty(mu,"__esModule",{value:!0}),mu.signAuthorization=r;const e=He(),t=Ar(),n=iv();async function r(s,a){const{account:o=s.account}=a;if(!o)throw new t.AccountNotFoundError({docsPath:"/docs/eip7702/signAuthorization"});const c=(0,e.parseAccount)(o);if(!c.signAuthorization)throw new t.AccountTypeNotSupportedError({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:c.type});const u=await(0,n.prepareAuthorization)(s,a);return c.signAuthorization(u)}return mu}var hu={},Lg;function A5(){if(Lg)return hu;Lg=1,Object.defineProperty(hu,"__esModule",{value:!0}),hu.signMessage=r;const e=He(),t=Ar(),n=ie();async function r(s,{account:a=s.account,message:o}){if(!a)throw new t.AccountNotFoundError({docsPath:"/docs/actions/wallet/signMessage"});const c=(0,e.parseAccount)(a);if(c.signMessage)return c.signMessage({message:o});const u=typeof o=="string"?(0,n.stringToHex)(o):o.raw instanceof Uint8Array?(0,n.toHex)(o.raw):o.raw;return s.request({method:"personal_sign",params:[u,c.address]},{retryCount:0})}return hu}var yu={},Ug;function T5(){if(Ug)return yu;Ug=1,Object.defineProperty(yu,"__esModule",{value:!0}),yu.signTransaction=u;const e=He(),t=Ar(),n=fi(),r=ie(),s=xt(),a=ge(),o=Rt(),c=jr();async function u(d,l){const{account:f=d.account,chain:b=d.chain,...T}=l;if(!f)throw new t.AccountNotFoundError({docsPath:"/docs/actions/wallet/signTransaction"});const v=(0,e.parseAccount)(f);(0,o.assertRequest)({account:v,...l});const p=await(0,a.getAction)(d,c.getChainId,"getChainId")({});b!==null&&(0,n.assertCurrentChain)({currentChainId:p,chain:b});const I=(b?.formatters||d.chain?.formatters)?.transactionRequest?.format||s.formatTransactionRequest;return v.signTransaction?v.signTransaction({...T,chainId:p},{serializer:d.chain?.serializers?.transaction}):await d.request({method:"eth_signTransaction",params:[{...I({...T,account:v},"signTransaction"),chainId:(0,r.numberToHex)(p),from:v.address}]},{retryCount:0})}return yu}var gu={},zg;function S5(){if(zg)return gu;zg=1,Object.defineProperty(gu,"__esModule",{value:!0}),gu.signTypedData=r;const e=He(),t=Ar(),n=ud();async function r(s,a){const{account:o=s.account,domain:c,message:u,primaryType:d}=a;if(!o)throw new t.AccountNotFoundError({docsPath:"/docs/actions/wallet/signTypedData"});const l=(0,e.parseAccount)(o),f={EIP712Domain:(0,n.getTypesForEIP712Domain)({domain:c}),...a.types};if((0,n.validateTypedData)({domain:c,message:u,primaryType:d,types:f}),l.signTypedData)return l.signTypedData({domain:c,message:u,primaryType:d,types:f});const b=(0,n.serializeTypedData)({domain:c,message:u,primaryType:d,types:f});return s.request({method:"eth_signTypedData_v4",params:[l.address,b]},{retryCount:0})}return gu}var pu={},Dg;function I5(){if(Dg)return pu;Dg=1,Object.defineProperty(pu,"__esModule",{value:!0}),pu.switchChain=t;const e=ie();async function t(n,{id:r}){await n.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,e.numberToHex)(r)}]},{retryCount:0})}return pu}var _u={},Gg;function B5(){if(Gg)return _u;Gg=1,Object.defineProperty(_u,"__esModule",{value:!0}),_u.watchAsset=e;async function e(t,n){return await t.request({method:"wallet_watchAsset",params:n},{retryCount:0})}return _u}var vu={},Vg;function x5(){if(Vg)return vu;Vg=1,Object.defineProperty(vu,"__esModule",{value:!0}),vu.writeContractSync=n;const e=sv(),t=Gf();async function n(r,s){return t.writeContract.internal(r,e.sendTransactionSync,"sendTransactionSync",s)}return vu}var Wg;function av(){if(Wg)return ru;Wg=1,Object.defineProperty(ru,"__esModule",{value:!0}),ru.walletActions=C;const e=Rf(),t=jr(),n=h5(),r=y5(),s=g5(),a=n_(),o=p5(),c=_5(),u=iv(),d=oi(),l=v5(),f=E5(),b=Vf(),T=w5(),v=Df(),p=h0(),O=od(),I=sv(),h=j5(),j=P5(),i=A5(),g=T5(),_=S5(),E=I5(),R=Wf(),w=B5(),y=Gf(),x=x5();function C(B){return{addChain:H=>(0,n.addChain)(B,H),deployContract:H=>(0,r.deployContract)(B,H),fillTransaction:H=>(0,e.fillTransaction)(B,H),getAddresses:()=>(0,s.getAddresses)(B),getCallsStatus:H=>(0,a.getCallsStatus)(B,H),getCapabilities:H=>(0,o.getCapabilities)(B,H),getChainId:()=>(0,t.getChainId)(B),getPermissions:()=>(0,c.getPermissions)(B),prepareAuthorization:H=>(0,u.prepareAuthorization)(B,H),prepareTransactionRequest:H=>(0,d.prepareTransactionRequest)(B,H),requestAddresses:()=>(0,l.requestAddresses)(B),requestPermissions:H=>(0,f.requestPermissions)(B,H),sendCalls:H=>(0,b.sendCalls)(B,H),sendCallsSync:H=>(0,T.sendCallsSync)(B,H),sendRawTransaction:H=>(0,v.sendRawTransaction)(B,H),sendRawTransactionSync:H=>(0,p.sendRawTransactionSync)(B,H),sendTransaction:H=>(0,O.sendTransaction)(B,H),sendTransactionSync:H=>(0,I.sendTransactionSync)(B,H),showCallsStatus:H=>(0,h.showCallsStatus)(B,H),signAuthorization:H=>(0,j.signAuthorization)(B,H),signMessage:H=>(0,i.signMessage)(B,H),signTransaction:H=>(0,g.signTransaction)(B,H),signTypedData:H=>(0,_.signTypedData)(B,H),switchChain:H=>(0,E.switchChain)(B,H),waitForCallsStatus:H=>(0,R.waitForCallsStatus)(B,H),watchAsset:H=>(0,w.watchAsset)(B,H),writeContract:H=>(0,y.writeContract)(B,H),writeContractSync:H=>(0,x.writeContractSync)(B,H)}}return ru}var Kg;function R5(){if(Kg)return tu;
47Kg=1,Object.defineProperty(tu,"__esModule",{value:!0}),tu.createWalletClient=n;const e=sd(),t=av();function n(r){const{key:s="wallet",name:a="Wallet Client",transport:o}=r;return(0,e.createClient)({...r,key:s,name:a,transport:o,type:"walletClient"}).extend(t.walletActions)}return tu}var Eu={},Zg;function yi(){if(Zg)return Eu;Zg=1,Object.defineProperty(Eu,"__esModule",{value:!0}),Eu.createTransport=n;const e=y_(),t=o_();function n({key:r,methods:s,name:a,request:o,retryCount:c=3,retryDelay:u=150,timeout:d,type:l},f){const b=(0,t.uid)();return{config:{key:r,methods:s,name:a,request:o,retryCount:c,retryDelay:u,timeout:d,type:l},request:(0,e.buildRequest)(o,{methods:s,retryCount:c,retryDelay:u,uid:b}),value:f}}return Eu}var wu={},Yg;function O5(){if(Yg)return wu;Yg=1,Object.defineProperty(wu,"__esModule",{value:!0}),wu.custom=t;const e=yi();function t(n,r={}){const{key:s="custom",methods:a,name:o="Custom Provider",retryDelay:c}=r;return({retryCount:u})=>(0,e.createTransport)({key:s,methods:a,name:o,request:n.request.bind(n),retryCount:r.retryCount??u,retryDelay:c,type:"custom"})}return wu}var An={},Jg;function C5(){if(Jg)return An;Jg=1,Object.defineProperty(An,"__esModule",{value:!0}),An.fallback=s,An.shouldThrow=a,An.rankTransports=o;
47const e=rr(),t=_r(),n=zf(),r=yi();function s(c,u={}){const{key:d="fallback",name:l="Fallback",rank:f=!1,shouldThrow:b=a,retryCount:T,retryDelay:v}=u;return(({chain:p,pollingInterval:O=4e3,timeout:I,...h})=>{let j=c,i=()=>{};const g=(0,r.createTransport)({key:d,name:l,async request({method:_,params:E}){let R;const w=async(y=0)=>{const x=j[y]({...h,chain:p,retryCount:0,timeout:I});try{const C=await x.request({method:_,params:E});return i({method:_,params:E,response:C,transport:x,status:"success"}),C}catch(C){if(i({error:C,method:_,params:E,transport:x,status:"error"}),b(C)||y===j.length-1||(R??=j.slice(y+1).some(B=>{const{include:H,exclude:F}=B({chain:p}).config.methods||{};return H?H.includes(_):F?!F.includes(_):!0}),!R))throw C;return w(y+1)}};return w()},retryCount:T,retryDelay:v,type:"fallback"},{onResponse:_=>i=_,transports:j.map(_=>_({chain:p,retryCount:0}))});if(f){const _=typeof f=="object"?f:{};o({chain:p,interval:_.interval??O,onTransports:E=>j=E,ping:_.ping,sampleCount:_.sampleCount,timeout:_.timeout,transports:j,weights:_.weights})}return g})}function a(c){return!!("code"in c&&typeof c.code=="number"&&(c.code===t.TransactionRejectedRpcError.code||c.code===t.UserRejectedRequestError.code||c.code===t.WalletConnectSessionSettlementError.code||e.ExecutionRevertedError.nodeMessage.test(c.message)||c.code===5e3))}function o({chain:c,interval:u=4e3,onTransports:d,ping:l,sampleCount:f=10,timeout:b=1e3,transports:T,weights:v={}}){const{stability:p=.7,latency:O=.3}=v,I=[],h=async()=>{const j=await Promise.all(T.map(async _=>{const E=_({chain:c,retryCount:0,timeout:b}),R=Date.now();let w,y;try{await(l?l({transport:E}):E.request({method:"net_listening"})),y=1}catch{y=0}finally{w=Date.now()}return{latency:w-R,success:y}}));I.push(j),I.length>f&&I.shift();const i=Math.max(...I.map(_=>Math.max(..._.map(({latency:E})=>E)))),g=T.map((_,E)=>{const R=I.map(B=>B[E].latency),y=1-R.reduce((B,H)=>B+H,0)/R.length/i,x=I.map(B=>B[E].success),C=x.reduce((B,H)=>B+H,0)/x.length;return C===0?[0,E]:[O*y+p*C,E]}).sort((_,E)=>E[0]-_[0]);d(g.map(([,_])=>T[_])),await(0,n.wait)(u),h()};h()}return An}var ju={},Do={},Xg;function y0(){if(Xg)return Do;Xg=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.UrlRequiredError=void 0;const e=fe();class t extends e.BaseError{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}return Do.UrlRequiredError=t,Do}var Qg;function q5(){if(Qg)return ju;Qg=1,Object.defineProperty(ju,"__esModule",{value:!0}),ju.http=a;const e=Bt(),t=y0(),n=kf(),r=r0(),s=yi();function a(o,c={}){const{batch:u,fetchFn:d,fetchOptions:l,key:f="http",methods:b,name:T="HTTP JSON-RPC",onFetchRequest:v,onFetchResponse:p,retryDelay:O,raw:I}=c;return({chain:h,retryCount:j,timeout:i})=>{const{batchSize:g=1e3,wait:_=0}=typeof u=="object"?u:{},E=c.retryCount??j,R=i??c.timeout??1e4,w=o||h?.rpcUrls.default.http[0];if(!w)throw new t.UrlRequiredError;const y=(0,r.getHttpRpcClient)(w,{fetchFn:d,fetchOptions:l,onRequest:v,onResponse:p,timeout:R});return(0,s.createTransport)({key:f,methods:b,name:T,async request({method:x,params:C}){const B={method:x,params:C},{schedule:H}=(0,n.createBatchScheduler)({id:w,wait:_,shouldSplitBatch(M){return M.length>g},fn:M=>y.request({body:M}),sort:(M,A)=>M.id-A.id}),F=async M=>u?H(M):[await y.request({body:M})],[{error:k,result:m}]=await F(B);if(I)return{error:k,result:m};if(k)throw new e.RpcRequestError({body:B,error:k,url:w});return m},retryCount:E,retryDelay:O,timeout:R,type:"http"},{fetchOptions:l,url:w})}}return ju}var Pu={},$g;function H5(){if($g)return Pu;$g=1,Object.defineProperty(Pu,"__esModule",{value:!0}),Pu.webSocket=a;const e=Bt(),t=y0(),n=S_(),r=n0(),s=yi();function a(o,c={}){const{keepAlive:u,key:d="webSocket",methods:l,name:f="WebSocket JSON-RPC",reconnect:b,retryDelay:T}=c;return({chain:v,retryCount:p,timeout:O})=>{const I=c.retryCount??p,h=O??c.timeout??1e4,j=o||v?.rpcUrls.default.webSocket?.[0],i={keepAlive:u,reconnect:b};if(!j)throw new t.UrlRequiredError;return(0,s.createTransport)({key:d,methods:l,name:f,async request({method:g,params:_}){const E={method:g,params:_},R=await(0,r.getWebSocketRpcClient)(j,i),{error:w,result:y}=await R.requestAsync({body:E,timeout:h});if(w)throw new e.RpcRequestError({body:E,error:w,url:j});return y},retryCount:I,retryDelay:T,timeout:h,type:"webSocket"},{getSocket(){return(0,n.getSocket)(j)},getRpcClient(){return(0,r.getWebSocketRpcClient)(j,i)},async subscribe({params:g,onData:_,onError:E}){const R=await(0,r.getWebSocketRpcClient)(j,i),{result:w}=await new Promise((y,x)=>R.request({body:{method:"eth_subscribe",params:g},onError(C){x(C),E?.(C)},onResponse(C){if(C.error){x(C.error),E?.(C.error);return}if(typeof C.id=="number"){y(C);return}C.method==="eth_subscription"&&_(C.params)}}));return{subscriptionId:w,async unsubscribe(){return new Promise(y=>R.request({body:{method:"eth_unsubscribe",params:[w]},onResponse:y}))}}}})}}return Pu}var Go={},ep;function M5(){if(ep)return Go;ep=1,Object.defineProperty(Go,"__esModule",{value:!0}),Go.ProviderRpcError=void 0;
47class e extends Error{constructor(n,r){super(r),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n,this.details=r}}return Go.ProviderRpcError=e,Go}var Au={},tp;function k5(){if(tp)return Au;tp=1,Object.defineProperty(Au,"__esModule",{value:!0}),Au.decodeDeployData=r;const e=qe(),t=gr(),n="/docs/contract/decodeDeployData";function r(s){const{abi:a,bytecode:o,data:c}=s;if(c===o)return{bytecode:o};const u=a.find(l=>"type"in l&&l.type==="constructor");if(!u)throw new e.AbiConstructorNotFoundError({docsPath:n});if(!("inputs"in u))throw new e.AbiConstructorParamsNotFoundError({docsPath:n});if(!u.inputs||u.inputs.length===0)throw new e.AbiConstructorParamsNotFoundError({docsPath:n});return{args:(0,t.decodeAbiParameters)(u.inputs,`0x${c.replace(o,"")}`),bytecode:o}}return Au}var Tu={},rp;function N5(){if(rp)return Tu;rp=1,Object.defineProperty(Tu,"__esModule",{value:!0}),Tu.fromBlobs=r;const e=Ko(),t=Pe(),n=ie();function r(s){const a=s.to??(typeof s.blobs[0]=="string"?"hex":"bytes"),o=typeof s.blobs[0]=="string"?s.blobs.map(f=>(0,t.hexToBytes)(f)):s.blobs,c=o.reduce((f,b)=>f+b.length,0),u=(0,e.createCursor)(new Uint8Array(c));let d=!0;for(const f of o){const b=(0,e.createCursor)(f);for(;d&&b.position<f.length;){b.incrementPosition(1);let T=31;f.length-b.position<31&&(T=f.length-b.position);for(const v in Array.from({length:T})){const p=b.readByte();if(p===128&&!b.inspectBytes(b.remaining).includes(128)){d=!1;break}u.pushByte(p)}}}const l=u.bytes.slice(0,u.position);return a==="hex"?(0,n.bytesToHex)(l):l}return Tu}var Su={},np;function F5(){if(np)return Su;np=1,Object.defineProperty(Su,"__esModule",{value:!0}),Su.sidecarsToVersionedHashes=t;const e=Bf();function t(n){const{sidecars:r,version:s}=n,a=n.to??(typeof r[0].blob=="string"?"hex":"bytes"),o=[];for(const{commitment:c}of r)o.push((0,e.commitmentToVersionedHash)({commitment:c,to:a,version:s}));return o}return Su}var Iu={},op;function L5(){if(op)return Iu;op=1,Object.defineProperty(Iu,"__esModule",{value:!0}),Iu.toCoinType=n;const e=Jf(),t=2147483648;function n(r){if(r===1)return 60n;if(r>=t||r<0)throw new e.EnsInvalidChainIdError({chainId:r});return BigInt((2147483648|r)>>>0)}return Iu}var Bu={},ip;function cv(){if(ip)return Bu;ip=1,Object.defineProperty(Bu,"__esModule",{value:!0}),Bu.defineKzg=e;function e({blobToKzgCommitment:t,computeBlobKzgProof:n}){return{blobToKzgCommitment:t,computeBlobKzgProof:n}}return Bu}var xu={},sp;function U5(){if(sp)return xu;sp=1,Object.defineProperty(xu,"__esModule",{value:!0}),xu.setupKzg=t;const e=cv();function t(n,r){try{n.loadTrustedSetup(r)}catch(s){const a=s;if(!a.message.includes("trusted setup is already loaded"))throw a}return(0,e.defineKzg)(n)}return xu}var Ru={},ap;function z5(){if(ap)return Ru;ap=1,Object.defineProperty(Ru,"__esModule",{value:!0}),Ru.compactSignatureToSignature=n;const e=Pe(),t=ie();function n({r,yParityAndS:s}){const a=(0,e.hexToBytes)(s),o=a[0]&128?1:0,c=a;return o===1&&(c[0]&=127),{r,s:(0,t.bytesToHex)(c),yParity:o}}return Ru}var Ou={},cp;function D5(){if(cp)return Ou;cp=1,Object.defineProperty(Ou,"__esModule",{value:!0}),Ou.parseCompactSignature=n;const e=Xo(),t=ie();function n(r){const{r:s,s:a}=e.secp256k1.Signature.fromCompact(r.slice(2,130));return{r:(0,t.numberToHex)(s,{size:32}),yParityAndS:(0,t.numberToHex)(a,{size:32})}}return Ou}var Cu={},up;function G5(){if(up)return Cu;up=1,Object.defineProperty(Cu,"__esModule",{value:!0}),Cu.parseSignature=n;const e=Xo(),t=ie();function n(r){const{r:s,s:a}=e.secp256k1.Signature.fromCompact(r.slice(2,130)),o=+`0x${r.slice(130)}`,[c,u]=(()=>
47{if(o===0||o===1)return[void 0,o];if(o===27)return[BigInt(o),0];if(o===28)return[BigInt(o),1];throw new Error("Invalid yParityOrV value")})();return typeof c<"u"?{r:(0,t.numberToHex)(s,{size:32}),s:(0,t.numberToHex)(a,{size:32}),v:c,yParity:u}:{r:(0,t.numberToHex)(s,{size:32}),s:(0,t.numberToHex)(a,{size:32}),yParity:u}}return Cu}var qu={},dp;function V5(){if(dp)return qu;dp=1,Object.defineProperty(qu,"__esModule",{value:!0}),qu.recoverTransactionAddress=s;const e=ct(),t=l0(),n=cd(),r=Er();async function s(a){const{serializedTransaction:o,signature:c}=a,u=(0,t.parseTransaction)(o),d=c??{r:u.r,s:u.s,v:u.v,yParity:u.yParity},l=(0,n.serializeTransaction)({...u,r:void 0,s:void 0,v:void 0,yParity:void 0,sidecars:void 0});return await(0,r.recoverAddress)({hash:(0,e.keccak256)(l),signature:d})}return qu}var Hu={},fp;function W5(){if(fp)return Hu;fp=1,Object.defineProperty(Hu,"__esModule",{value:!0}),Hu.serializeCompactSignature=n;const e=Xo(),t=Ne();function n({r,yParityAndS:s}){return`0x${new e.secp256k1.Signature((0,t.hexToBigInt)(r),(0,t.hexToBigInt)(s)).toCompactHex()}`}return Hu}var Mu={},lp;function K5(){if(lp)return Mu;lp=1,Object.defineProperty(Mu,"__esModule",{value:!0}),Mu.signatureToCompactSignature=n;const e=Pe(),t=ie();function n(r){const{r:s,s:a,v:o,yParity:c}=r,u=Number(c??o-27n);let d=a;if(u===1){const l=(0,e.hexToBytes)(a);l[0]|=128,d=(0,t.bytesToHex)(l)}return{r:s,yParityAndS:d}}return Mu}var bp;function Z5(){return bp||(bp=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.maxInt8=e.universalSignatureValidatorByteCode=e.erc6492SignatureValidatorByteCode=e.deploylessCallViaFactoryBytecode=e.deploylessCallViaBytecodeBytecode=e.zeroHash=e.zeroAddress=e.ethAddress=e.multicall3Abi=e.universalSignatureValidatorAbi=e.erc6492SignatureValidatorAbi=e.erc4626Abi=e.erc1155Abi=e.erc721Abi=e.erc20Abi_bytes32=e.erc20Abi=e.webSocket=e.http=e.shouldThrow=e.fallback=e.custom=e.createTransport=e.walletActions=e.testActions=e.publicActions=e.createWalletClient=e.createTestClient=e.createPublicClient=e.rpcSchema=e.createClient=e.WaitForCallsStatusTimeoutError=e.getContract=e.UnknownTypeError=e.UnknownSignatureError=e.SolidityProtectedKeywordError=e.parseAbiParameters=e.parseAbiParameter=e.parseAbiItem=e.parseAbi=e.InvalidStructSignatureError=e.InvalidSignatureError=e.InvalidParenthesisError=e.InvalidParameterError=e.InvalidModifierError=e.InvalidFunctionModifierError=e.InvalidAbiTypeParameterError=e.InvalidAbiParametersError=e.InvalidAbiParameterError=e.InvalidAbiItemError=e.CircularReferenceError=void 0,e.maxUint152=e.maxUint144=e.maxUint136=e.maxUint128=e.maxUint120=e.maxUint112=e.maxUint104=e.maxUint96=e.maxUint88=e.maxUint80=e.maxUint72=e.maxUint64=e.maxUint56=e.maxUint48=e.maxUint40=e.maxUint32=e.maxUint24=e.maxUint16=e.maxUint8=e.maxInt256=e.maxInt248=e.maxInt240=e.maxInt232=e.maxInt224=e.maxInt216=e.maxInt208=e.maxInt200=e.maxInt192=e.maxInt184=e.maxInt176=e.maxInt168=e.maxInt160=e.maxInt152=e.maxInt144=e.maxInt136=e.maxInt128=e.maxInt120=e.maxInt112=e.maxInt104=e.maxInt96=e.maxInt88=e.maxInt80=e.maxInt72=e.maxInt64=e.maxInt56=e.maxInt48=e.maxInt40=e.maxInt32=e.maxInt24=e.maxInt16=void 0,e.AbiConstructorNotFoundError=e.weiUnits=e.gweiUnits=e.etherUnits=e.presignMessagePrefix=e.minInt256=e.minInt248=e.minInt240=e.minInt232=e.minInt224=e.minInt216=e.minInt208=e.minInt200=e.minInt192=e.minInt184=e.minInt176=e.minInt168=e.minInt160=e.minInt152=e.minInt144=e.minInt136=e.minInt128=e.minInt120=e.minInt112=e.minInt104=e.minInt96=e.minInt88=e.minInt80=e.minInt72=e.minInt64=e.minInt56=e.minInt48=e.minInt40=e.minInt32=e.minInt24=e.minInt16=e.minInt8=e.maxUint256=e.maxUint248=e.maxUint240=e.maxUint232=e.maxUint224=e.maxUint216=e.maxUint208=e.maxUint200=e.maxUint192=e.maxUint184=e.maxUint176=e.maxUint168=e.maxUint160=void 0,e.EnsAvatarUriResolutionError=e.EnsAvatarUnsupportedNamespaceError=e.EnsAvatarInvalidNftUriError=e.SizeOverflowError=e.InvalidHexValueError=e.InvalidHexBooleanError=e.InvalidBytesBooleanError=e.IntegerOutOfRangeError=e.SliceOffsetOutOfBoundsError=e.SizeExceedsPaddingSizeError=e.RawContractError=e.CounterfactualDeploymentFailedError=e.ContractFunctionZeroDataError=e.ContractFunctionRevertedError=e.ContractFunctionExecutionError=e.CallExecutionError=e.InvalidChainIdError=e.ClientChainNotConfiguredError=e.ChainNotFoundError=e.ChainMismatchError=e.ChainDoesNotSupportContract=e.BundleFailedError=e.BlockNotFoundError=e.setErrorConfig=e.BaseError=e.InvalidAddressError=e.UnsupportedPackedAbiType=e.InvalidDefinitionTypeError=e.InvalidArrayError=e.InvalidAbiEncodingTypeError=e.InvalidAbiDecodingTypeError=e.DecodeLogTopicsMismatch=e.DecodeLogDataMismatch=e.BytesSizeMismatchError=e.AbiFunctionSignatureNotFoundError=e.AbiFunctionOutputsNotFoundError=e.AbiFunctionNotFoundError=e.AbiEventSignatureNotFoundError=e.AbiEventSignatureEmptyTopicsError=e.AbiEventNotFoundError=e.AbiErrorSignatureNotFoundError=e.AbiErrorNotFoundError=e.AbiErrorInputsNotFoundError=e.AbiEncodingLengthMismatchError=e.AbiEncodingBytesSizeMismatchError=e.AbiEncodingArrayLe
47ngthMismatchError=e.AbiDecodingZeroDataError=e.AbiDecodingDataSizeTooSmallError=e.AbiDecodingDataSizeInvalidError=e.AbiConstructorParamsNotFoundError=void 0,e.UnsupportedProviderMethodError=e.UnsupportedNonOptionalCapabilityError=e.UnsupportedChainIdError=e.UnknownRpcError=e.UnknownBundleIdError=e.UnauthorizedProviderError=e.TransactionRejectedRpcError=e.SwitchChainError=e.RpcError=e.ResourceUnavailableRpcError=e.ResourceNotFoundRpcError=e.ProviderRpcError=e.ProviderDisconnectedError=e.ParseRpcError=e.MethodNotSupportedRpcError=e.MethodNotFoundRpcError=e.LimitExceededRpcError=e.JsonRpcVersionUnsupportedError=e.InvalidRequestRpcError=e.InvalidParamsRpcError=e.InvalidInputRpcError=e.InternalRpcError=e.DuplicateIdError=e.ChainDisconnectedError=e.BundleTooLargeError=e.AtomicReadyWalletRejectedUpgradeError=e.AtomicityNotSupportedError=e.WebSocketRequestError=e.TimeoutError=e.SocketClosedError=e.RpcRequestError=e.HttpRequestError=e.UnknownNodeError=e.TransactionTypeNotSupportedError=e.TipAboveFeeCapError=e.NonceTooLowError=e.NonceTooHighError=e.NonceMaxValueError=e.IntrinsicGasTooLowError=e.IntrinsicGasTooHighError=e.InsufficientFundsError=e.FeeCapTooLowError=e.FeeCapTooHighError=e.ExecutionRevertedError=e.FilterTypeNotSupportedError=e.MaxFeePerGasTooLowError=e.Eip1559FeesNotSupportedError=e.BaseFeeScalarError=e.EstimateGasExecutionError=e.EnsInvalidChainIdError=void 0,e.toBlobs=e.toBlobSidecars=e.sidecarsToVersionedHashes=e.fromBlobs=e.commitmentToVersionedHash=e.commitmentsToVersionedHashes=e.blobsToProofs=e.blobsToCommitments=e.isAddressEqual=e.isAddress=e.getCreateAddress=e.getCreate2Address=e.getContractAddress=e.getAddress=e.checksumAddress=e.prepareEncodeFunctionData=e.parseEventLogs=e.getAbiItem=e.encodePacked=e.encodeFunctionResult=e.encodeFunctionData=e.encodeEventTopics=e.encodeErrorResult=e.encodeDeployData=e.encodeAbiParameters=e.decodeFunctionResult=e.decodeFunctionData=e.decodeEventLog=e.decodeErrorResult=e.decodeDeployData=e.decodeAbiParameters=e.EIP1193ProviderRpcError=e.InvalidDecimalNumberError=e.InvalidStructTypeError=e.InvalidPrimaryTypeError=e.InvalidDomainError=e.UrlRequiredError=e.WaitForTransactionReceiptTimeoutError=e.TransactionReceiptNotFoundError=e.TransactionNotFoundError=e.TransactionExecutionError=e.InvalidStorageKeySizeError=e.InvalidSerializedTransactionTypeError=e.InvalidSerializedTransactionError=e.InvalidSerializableTransactionError=e.InvalidLegacyVError=e.FeeConflictError=e.StateAssignmentConflictError=e.AccountStateConflictError=e.UserRejectedRequestError=void 0,e.toCoinType=e.namehash=e.labelhash=e.toRlp=e.hexToRlp=e.bytesToRlp=e.toHex=e.stringToHex=e.numberToHex=e.bytesToHex=e.boolToHex=e.toBytes=e.stringToBytes=e.numberToBytes=e.hexToBytes=e.boolToBytes=e.fromRlp=e.hexToString=e.hexToNumber=e.hexToBool=e.hexToBigInt=e.fromHex=e.fromBytes=e.bytesToString=e.bytesToNumber=e.bytesToBool=e.bytesToBigInt=e.trim=e.sliceHex=e.sliceBytes=e.slice=e.size=e.padHex=e.padBytes=e.pad=e.isHex=e.isBytes=e.concatHex=e.concatBytes=e.concat=e.getChainContractAddress=e.extractChain=e.extendSchema=e.defineChain=e.assertCurrentChain=e.offchainLookupSignature=e.offchainLookupAbiItem=e.offchainLookup=e.ccipFetch=e.ccipRequest=void 0,e.recoverTransactionAddress=e.recoverPublicKey=e.recoverMessageAddress=e.recoverAddress=e.parseSignature=e.hexToSignature=e.parseErc8010Signature=e.parseErc6492Signature=e.parseCompactSignature=e.hexToCompactSignature=e.isErc8010Signature=e.isErc6492Signature=e.hashTypedData=e.hashStruct=e.hashDomain=e.hashMessage=e.compactSignatureToSignature=e.withTimeout=e.withRetry=e.withCache=e.nonceManager=e.createNonceManager=e.setupKzg=e.defineKzg=e.getFunctionSignature=e.toFunctionSignature=e.getFunctionSelector=e.toFunctionSelector=e.toFunctionHash=e.getEventSignature=e.toEventSignature=e.getEventSelector=e.toEventSelector=e.toEventHash=e.sha256=e.ripemd160=e.keccak256=e.isHash=e.rpcTransactionType=e.formatTransactionRequest=e.defineTransactionRequest=e.formatTransactionReceipt=e.defineTransactionReceipt=e.transactionType=e.formatTransaction=e.defineTransaction=e.formatLog=e.formatBlock=e.defineBlock=e.getContractError=void 0,e.parseUnits=e.parseGwei=e.parseEther=e.formatUnits=e.formatGwei=e.formatEther=e.validateTypedData=e.serializeTypedData=e.getTypesForEIP712Domain=e.domainSeparator=e.serializeTransaction=e.serializeAccessList=e.parseTransaction=e.getTransactionType=e.getSerializedTransactionType=e.assertTransactionLegacy=e.assertTransactionEIP2930=e.assertTransactionEIP1559=e.assertRequest=e.stringify=e.verifyTypedData=e.verifyMessage=e.verifyHash=e.toPrefixedMessage=e.signatureToCompactSignature=e.serializeSignature=e.signatureToHex=e.serializeErc8010Signature=e.serializeErc6492Signature=e.serializeCompactSignature=e.compactSignatureToHex=e.recoverTypedDataAddress=void 0;var t=mr();Object.defineProperty(e,"CircularReferenceError",{enumerable:!0,get:function(){return t.CircularReferenceError}}),Object.defineProperty(e,"InvalidAbiItemError",{enumerable:!0,get:function(){return t.InvalidAbiItemError}}),Object.defineProperty(e,"InvalidAbiParameterError",{enumerable:!0,get:function(){return t.InvalidAbiParameterError}}),Object.defineProperty(e,"InvalidAbiParametersError",{enumerable:!0,get:function(){return t.InvalidAbiParametersError}}),Object.defineProperty(e,"InvalidAbiTypeParameterError",{enumerable:!0,get:function(){return t.InvalidAbiTypeParameterError}}),Object.defineProperty(e,"InvalidFunctionModifierError",{enumerable:!0,get:function(){return t.InvalidFunctionModifierError}}),Object.defineProperty(e,"InvalidModifierError",{enumerable:!0,get:function(){return t.InvalidModifierError}}),Object.defineProperty(e,"InvalidParameterError",{enumerable:!0,get:function(){return t.InvalidParameterError}}),Object.defineProperty(e,"InvalidParenthesisError",{enumerable:!0,get:function(){return t.InvalidParenthesisError}}),Object.defineProperty(e,"InvalidSignatureError",{enumerable:!0,get:function(){return t.InvalidSignatureError}}),Object.defineProperty(e,"InvalidStructSignatureError",{enumerable:!0,get:function(){return t.InvalidStructSignatureError}}),Object.defineProperty(e,"parseAbi",{enumerable:!0,get:function(){return t.parseAbi}}),Object.defineProperty(e,"parseAbiItem",{enumerable:!0,get:function(){return t.parseAbiItem}}),Object.defineProperty(e,"parseAbiParameter",{enumerable:!0,get:function(){return t.parseAbiParameter}}),Object.defineProperty(e,"parseAbiParameters",{enumerable:!0,get:function(){return t.parseAbiParameters}}),Object.defineProperty(e,"SolidityProtectedKeywordError",{enumerable:!0,get:function(){return t.SolidityProtectedKeywordError}}),Object.defineProperty(e,"UnknownSignatureError",{enumerable:!0,get:function(){return t.UnknownSignatureError}}),Object.defineProperty(e,"UnknownTypeError",{enumerable:!0,get:function(){return t.UnknownTypeError}});var n=H6();Object.defineProperty(e,"getContract",{enumerable:!0,get:function(){return n.getContract}});var r=Wf();Object.defineProperty(e,"WaitForCallsStatusTimeoutError",{enumerable:!0,get:function(){return r.WaitForCallsStatusTimeoutError}});var s=sd();Object.defineProperty(e,"createClient",{enumerable:!0,get:function(){return s.createClient}}),Object.defineProperty(e,"rpcSchema",{enumerable:!0,get:function(){return s.rpcSchema}});var a=k2();Object.defineProperty(e,"createPublicClient",{enumerable:!0,get:function(){return a.createPublicClient}});var o=m5();Object.defineProperty(e,"createTestClient",{enumerable:!0,get:function(){return o.createTestClient}});var c=R5();Object.defineProperty(e,"createWalletClient",{enumerable:!0,get:function(){return c.createWalletClient}});var u=nv();Object.defineProperty(e,"publicActions",{enumerable:!0,get:function(){return u.publicActions}});var d=ov();Object.defineProperty(e,"testActions",{enumerable:!0,get:function(){return d.testActions}});var l=av();Object.defineProperty(e,"walletActions",{enumerable:!0,get:function(){return l.walletActions}});var f=yi();Object.defineProperty(e,"createTransport",{enumerable:!0,get:function(){return f.createTransport}});var b=O5();Object.defineProperty(e,"custom",{enumerable:!0,get:function(){return b.custom}});var T=C5();Object.defineProperty(e,"fallback",{enumerable:!0,get:function(){return T.fallback}}),Object.defineProperty(e,"shouldThrow",{enumerable:!0,get:function(){return T.
47shouldThrow}});var v=q5();Object.defineProperty(e,"http",{enumerable:!0,get:function(){return v.http}});var p=H5();Object.defineProperty(e,"webSocket",{enumerable:!0,get:function(){return p.webSocket}});var O=or();Object.defineProperty(e,"erc20Abi",{enumerable:!0,get:function(){return O.erc20Abi}}),Object.defineProperty(e,"erc20Abi_bytes32",{enumerable:!0,get:function(){return O.erc20Abi_bytes32}}),Object.defineProperty(e,"erc721Abi",{enumerable:!0,get:function(){return O.erc721Abi}}),Object.defineProperty(e,"erc1155Abi",{enumerable:!0,get:function(){return O.erc1155Abi}}),Object.defineProperty(e,"erc4626Abi",{enumerable:!0,get:function(){return O.erc4626Abi}}),Object.defineProperty(e,"erc6492SignatureValidatorAbi",{enumerable:!0,get:function(){return O.erc6492SignatureValidatorAbi}}),Object.defineProperty(e,"universalSignatureValidatorAbi",{enumerable:!0,get:function(){return O.erc6492SignatureValidatorAbi}}),Object.defineProperty(e,"multicall3Abi",{enumerable:!0,get:function(){return O.multicall3Abi}});var I=$_();Object.defineProperty(e,"ethAddress",{enumerable:!0,get:function(){return I.ethAddress}}),Object.defineProperty(e,"zeroAddress",{enumerable:!0,get:function(){return I.zeroAddress}});var h=o0();Object.defineProperty(e,"zeroHash",{enumerable:!0,get:function(){return h.zeroHash}});var j=ai();Object.defineProperty(e,"deploylessCallViaBytecodeBytecode",{enumerable:!0,get:function(){return j.deploylessCallViaBytecodeBytecode}}),Object.defineProperty(e,"deploylessCallViaFactoryBytecode",{enumerable:!0,get:function(){return j.deploylessCallViaFactoryBytecode}}),Object.defineProperty(e,"erc6492SignatureValidatorByteCode",{enumerable:!0,get:function(){return j.erc6492SignatureValidatorByteCode}}),Object.defineProperty(e,"universalSignatureValidatorByteCode",{enumerable:!0,get:function(){return j.erc6492SignatureValidatorByteCode}});var i=Af();Object.defineProperty(e,"maxInt8",{enumerable:!0,get:function(){return i.maxInt8}}),Object.defineProperty(e,"maxInt16",{enumerable:!0,get:function(){return i.maxInt16}}),Object.defineProperty(e,"maxInt24",{enumerable:!0,get:function(){return i.maxInt24}}),Object.defineProperty(e,"maxInt32",{enumerable:!0,get:function(){return i.maxInt32}}),Object.defineProperty(e,"maxInt40",{enumerable:!0,get:function(){return i.maxInt40}}),Object.defineProperty(e,"maxInt48",{enumerable:!0,get:function(){return i.maxInt48}}),Object.defineProperty(e,"maxInt56",{enumerable:!0,get:function(){return i.maxInt56}}),Object.defineProperty(e,"maxInt64",{enumerable:!0,get:function(){return i.maxInt64}}),Object.defineProperty(e,"maxInt72",{enumerable:!0,get:function(){return i.maxInt72}}),Object.defineProperty(e,"maxInt80",{enumerable:!0,get:function(){return i.maxInt80}}),Object.defineProperty(e,"maxInt88",{enumerable:!0,get:function(){return i.maxInt88}}),Object.defineProperty(e,"maxInt96",{enumerable:!0,get:function(){return i.maxInt96}}),Object.defineProperty(e,"maxInt104",{enumerable:!0,get:function(){return i.maxInt104}}),Object.defineProperty(e,"maxInt112",{enumerable:!0,get:function(){return i.maxInt112}}),Object.defineProperty(e,"maxInt120",{enumerable:!0,get:function(){return i.maxInt120}}),Object.defineProperty(e,"maxInt128",{enumerable:!0,get:function(){return i.maxInt128}}),Object.defineProperty(e,"maxInt136",{enumerable:!0,get:function(){return i.maxInt136}}),Object.defineProperty(e,"maxInt144",{enumerable:!0,get:function(){return i.maxInt144}}),Object.defineProperty(e,"maxInt152",{enumerable:!0,get:function(){return i.maxInt152}}),Object.defineProperty(e,"maxInt160",{enumerable:!0,get:function(){return i.maxInt160}}),Object.defineProperty(e,"maxInt168",{enumerable:!0,get:function(){return i.maxInt168}}),Object.defineProperty(e,"maxInt176",{enumerable:!0,get:function(){return i.maxInt176}}),Object.defineProperty(e,"maxInt184",{enumerable:!0,get:function(){return i.maxInt184}}),Object.defineProperty(e,"maxInt192",{enumerable:!0,get:function(){return i.maxInt192}}),Object.defineProperty(e,"maxInt200",{enumerable:!0,get:function(){return i.maxInt200}}),Object.defineProperty(e,"maxInt208",{enumerable:!0,get:function(){return i.maxInt208}}),Object.defineProperty(e,"maxInt216",{enumerable:!0,get:function(){return i.maxInt216}}),Object.defineProperty(e,"maxInt224",{enumerable:!0,get:function(){return i.maxInt224}}),Object.defineProperty(e,"maxInt232",{enumerable:!0,get:function(){return i.maxInt232}}),Object.defineProperty(e,"maxInt240",{enumerable:!0,get:function(){return i.maxInt240}}),Object.defineProperty(e,"maxInt248",{enumerable:!0,get:function(){return i.maxInt248}}),Object.defineProperty(e,"maxInt256",{enumerable:!0,get:function(){return i.maxInt256}}),Object.defineProperty(e,"maxUint8",{enumerable:!0,get:function(){return i.maxUint8}}),Object.defineProperty(e,"maxUint16",{enumerable:!0,get:function(){return i.maxUint16}}),Object.defineProperty(e,"maxUint24",{enumerable:!0,get:function(){return i.maxUint24}}
47),Object.defineProperty(e,"maxUint32",{enumerable:!0,get:function(){return i.maxUint32}}),Object.defineProperty(e,"maxUint40",{enumerable:!0,get:function(){return i.maxUint40}}),Object.defineProperty(e,"maxUint48",{enumerable:!0,get:function(){return i.maxUint48}}),Object.defineProperty(e,"maxUint56",{enumerable:!0,get:function(){return i.maxUint56}}),Object.defineProperty(e,"maxUint64",{enumerable:!0,get:function(){return i.maxUint64}}),Object.defineProperty(e,"maxUint72",{enumerable:!0,get:function(){return i.maxUint72}}),Object.defineProperty(e,"maxUint80",{enumerable:!0,get:function(){return i.maxUint80}}),Object.defineProperty(e,"maxUint88",{enumerable:!0,get:function(){return i.maxUint88}}),Object.defineProperty(e,"maxUint96",{enumerable:!0,get:function(){return i.maxUint96}}),Object.defineProperty(e,"maxUint104",{enumerable:!0,get:function(){return i.maxUint104}}),Object.defineProperty(e,"maxUint112",{enumerable:!0,get:function(){return i.maxUint112}}),Object.defineProperty(e,"maxUint120",{enumerable:!0,get:function(){return i.maxUint120}}),Object.defineProperty(e,"maxUint128",{enumerable:!0,get:function(){return i.maxUint128}}),Object.defineProperty(e,"maxUint136",{enumerable:!0,get:function(){return i.maxUint136}}),Object.defineProperty(e,"maxUint144",{enumerable:!0,get:function(){return i.maxUint144}}),Object.defineProperty(e,"maxUint152",{enumerable:!0,get:function(){return i.maxUint152}}),Object.defineProperty(e,"maxUint160",{enumerable:!0,get:function(){return i.maxUint160}}),Object.defineProperty(e,"maxUint168",{enumerable:!0,get:function(){return i.maxUint168}}),Object.defineProperty(e,"maxUint176",{enumerable:!0,get:function(){return i.maxUint176}}),Object.defineProperty(e,"maxUint184",{enumerable:!0,get:function(){return i.maxUint184}}),Object.defineProperty(e,"maxUint192",{enumerable:!0,get:function(){return i.maxUint192}}),Object.defineProperty(e,"maxUint200",{enumerable:!0,get:function(){return i.maxUint200}}),Object.defineProperty(e,"maxUint208",{enumerable:!0,get:function(){return i.maxUint208}}),Object.defineProperty(e,"maxUint216",{enumerable:!0,get:function(){return i.maxUint216}}),Object.defineProperty(e,"maxUint224",{enumerable:!0,get:function(){return i.maxUint224}}),Object.defineProperty(e,"maxUint232",{enumerable:!0,get:function(){return i.maxUint232}}),Object.defineProperty(e,"maxUint240",{enumerable:!0,get:function(){return i.maxUint240}}),Object.defineProperty(e,"maxUint248",{enumerable:!0,get:function(){return i.maxUint248}}),Object.defineProperty(e,"maxUint256",{enumerable:!0,get:function(){return i.maxUint256}}),Object.defineProperty(e,"minInt8",{enumerable:!0,get:function(){return i.minInt8}}),Object.defineProperty(e,"minInt16",{enumerable:!0,get:function(){return i.minInt16}}),Object.defineProperty(e,"minInt24",{enumerable:!0,get:function(){return i.minInt24}}),Object.defineProperty(e,"minInt32",{enumerable:!0,get:function(){return i.minInt32}}),Object.defineProperty(e,"minInt40",{enumerable:!0,get:function(){return i.minInt40}}),Object.defineProperty(e,"minInt48",{enumerable:!0,get:function(){return i.minInt48}}),Object.defineProperty(e,"minInt56",{enumerable:!0,get:function(){return i.minInt56}}),Object.defineProperty(e,"minInt64",{enumerable:!0,get:function(){return i.minInt64}}),Object.defineProperty(e,"minInt72",{enumerable:!0,get:function(){return i.minInt72}}),Object.defineProperty(e,"minInt80",{enumerable:!0,get:function(){return i.minInt80}}),Object.defineProperty(e,"minInt88",{enumerable:!0,get:function(){return i.minInt88}}),Object.defineProperty(e,"minInt96",{enumerable:!0,get:function(){return i.minInt96}}),Object.defineProperty(e,"minInt104",{enumerable:!0,get:function(){return i.minInt104}}),Object.defineProperty(e,"minInt112",{enumerable:!0,get:function(){return i.minInt112}}),Object.defineProperty(e,"minInt120",{enumerable:!0,get:function(){return i.minInt120}}),Object.defineProperty(e,"minInt128",{enumerable:!0,get:function(){return i.minInt128}}),Object.defineProperty(e,"minInt136",{enumerable:!0,get:function(){return i.minInt136}}),Object.defineProperty(e,"minInt144",{enumerable:!0,get:function(){return i.minInt144}}),Object.defineProperty(e,"minInt152",{enumerable:!0,get:function(){return i.minInt152}}),Object.defineProperty(e,"minInt160",{enumerable:!0,get:function(){return i.minInt160}}),Object.defineProperty(e,"minInt168",{enumerable:!0,get:function(){return i.minInt168}}),Object.defineProperty(e,"minInt176",{enumerable:!0,get:function(){return i.minInt176}}),Object.defineProperty(e,"minInt184",{enumerable:!0,get:function(){return i.minInt184}}),Object.defineProperty(e,"minInt192",{enumerable:!0,get:function(){return i.minInt192}}),Object.defineProperty(e,"minInt200",{enumerable:!0,get:function(){return i.minInt200}}),Object.defineProperty(e,"minInt208",{enumerable:!0,get:function(){return i.minInt208}}),Object.defineProperty(e,"minInt216",{enumerable:!0,get:function(){return i.minInt216}}),Object.defineProperty(e,"minInt224",{enumerable:!0,get:function(){return i.minInt224}}),Object.defineProperty(e,"minInt232",{enumerable:!0,get:function(){return i.minInt232}}),Object.defineProperty(e,"minInt240",{enumerable:!0,get:function(){return i.minInt240}}),Object.defineProperty(e,"minInt248",{enumerable:!0,get:function(){return i.minInt248}}),Object.defineProperty(e,"minInt256",{enumerable:!0,get:function(){return i.minInt256}});var g=I_();Object.defineProperty(e,"presignMessagePrefix",{enumerable:!0,get:function(){return g.presignMessagePrefix}});var _=Zo();Object.defineProperty(e,"etherUnits",{enumerable:!0,get:function(){return _.etherUnits}}),Object.defineProperty(e,"gweiUnits",{enumerable:!0,get:function(){return _.gweiUnits}}),Object.defineProperty(e,"weiUnits",{enumerable:!0,get:function(){return _.weiUnits}});var E=qe();Object.defineProperty(e,"AbiConstructorNotFoundError",{enumerable:!0,get:function(){return E.AbiConstructorNotFoundError}}),Object.defineProperty(e,"AbiConstructorParamsNotFoundError",{enumerable:!0,get:function(){return E.AbiConstructorParamsNotFoundError}}),Object.defineProperty(e,"AbiDecodingDataSizeInvalidError",{enumerable:!0,get:function(){return E.AbiDecodingDataSizeInvalidError}}),Object.defineProperty(e,"AbiDecodingDataSizeTooSmallError",{enumerable:!0,get:function(){return E.AbiDecodingDataSizeTooSmallError}}),Object.defineProperty(e,"AbiDecodingZeroDataError",{enumerable:!0,get:function(){return E.AbiDecodingZeroDataError}}
47),Object.defineProperty(e,"AbiEncodingArrayLengthMismatchError",{enumerable:!0,get:function(){return E.AbiEncodingArrayLengthMismatchError}}),Object.defineProperty(e,"AbiEncodingBytesSizeMismatchError",{enumerable:!0,get:function(){return E.AbiEncodingBytesSizeMismatchError}}),Object.defineProperty(e,"AbiEncodingLengthMismatchError",{enumerable:!0,get:function(){return E.AbiEncodingLengthMismatchError}}),Object.defineProperty(e,"AbiErrorInputsNotFoundError",{enumerable:!0,get:function(){return E.AbiErrorInputsNotFoundError}}),Object.defineProperty(e,"AbiErrorNotFoundError",{enumerable:!0,get:function(){return E.AbiErrorNotFoundError}}),Object.defineProperty(e,"AbiErrorSignatureNotFoundError",{enumerable:!0,get:function(){return E.AbiErrorSignatureNotFoundError}}),Object.defineProperty(e,"AbiEventNotFoundError",{enumerable:!0,get:function(){return E.AbiEventNotFoundError}}),Object.defineProperty(e,"AbiEventSignatureEmptyTopicsError",{enumerable:!0,get:function(){return E.AbiEventSignatureEmptyTopicsError}}),Object.defineProperty(e,"AbiEventSignatureNotFoundError",{enumerable:!0,get:function(){return E.AbiEventSignatureNotFoundError}}),Object.defineProperty(e,"AbiFunctionNotFoundError",{enumerable:!0,get:function(){return E.AbiFunctionNotFoundError}}),Object.defineProperty(e,"AbiFunctionOutputsNotFoundError",{enumerable:!0,get:function(){return E.AbiFunctionOutputsNotFoundError}}),Object.defineProperty(e,"AbiFunctionSignatureNotFoundError",{enumerable:!0,get:function(){return E.AbiFunctionSignatureNotFoundError}}),Object.defineProperty(e,"BytesSizeMismatchError",{enumerable:!0,get:function(){return E.BytesSizeMismatchError}}),Object.defineProperty(e,"DecodeLogDataMismatch",{enumerable:!0,get:function(){return E.DecodeLogDataMismatch}}),Object.defineProperty(e,"DecodeLogTopicsMismatch",{enumerable:!0,get:function(){return E.DecodeLogTopicsMismatch}}),Object.defineProperty(e,"InvalidAbiDecodingTypeError",{enumerable:!0,get:function(){return E.InvalidAbiDecodingTypeError}}),Object.defineProperty(e,"InvalidAbiEncodingTypeError",{enumerable:!0,get:function(){return E.InvalidAbiEncodingTypeError}}),Object.defineProperty(e,"InvalidArrayError",{enumerable:!0,get:function(){return E.InvalidArrayError}}),Object.defineProperty(e,"InvalidDefinitionTypeError",{enumerable:!0,get:function(){return E.InvalidDefinitionTypeError}}),Object.defineProperty(e,"UnsupportedPackedAbiType",{enumerable:!0,get:function(){return E.UnsupportedPackedAbiType}});var R=St();Object.defineProperty(e,"InvalidAddressError",{enumerable:!0,get:function(){return R.InvalidAddressError}});var w=fe();Object.defineProperty(e,"BaseError",{enumerable:!0,get:function(){return w.BaseError}}),Object.defineProperty(e,"setErrorConfig",{enumerable:!0,get:function(){return w.setErrorConfig}});var y=Tf();Object.defineProperty(e,"BlockNotFoundError",{enumerable:!0,get:function(){return y.BlockNotFoundError}});var x=r_();Object.defineProperty(e,"BundleFailedError",{enumerable:!0,get:function(){return x.BundleFailedError}});var C=ci();Object.defineProperty(e,"ChainDoesNotSupportContract",{enumerable:!0,get:function(){return C.ChainDoesNotSupportContract}}),Object.defineProperty(e,"ChainMismatchError",{enumerable:!0,get:function(){return C.ChainMismatchError}}),Object.defineProperty(e,"ChainNotFoundError",{enumerable:!0,get:function(){return C.ChainNotFoundError}}),Object.defineProperty(e,"ClientChainNotConfiguredError",{enumerable:!0,get:function(){return C.ClientChainNotConfiguredError}}),Object.defineProperty(e,"InvalidChainIdError",{enumerable:!0,get:function(){return C.InvalidChainIdError}});var B=pr();Object.defineProperty(e,"CallExecutionError",{enumerable:!0,get:function(){return B.CallExecutionError}}),Object.defineProperty(e,"ContractFunctionExecutionError",{enumerable:!0,get:function(){return B.ContractFunctionExecutionError}}),Object.defineProperty(e,"ContractFunctionRevertedError",{enumerable:!0,get:function(){return B.ContractFunctionRevertedError}}),Object.defineProperty(e,"ContractFunctionZeroDataError",{enumerable:!0,get:function(){return B.ContractFunctionZeroDataError}}),Object.defineProperty(e,"CounterfactualDeploymentFailedError",{enumerable:!0,get:function(){return B.CounterfactualDeploymentFailedError}}),Object.defineProperty(e,"RawContractError",{enumerable:!0,get:function(){return B.RawContractError}});var H=Uu();Object.defineProperty(e,"SizeExceedsPaddingSizeError",{enumerable:!0,get:function(){return H.SizeExceedsPaddingSizeError}}),Object.defineProperty(e,"SliceOffsetOutOfBoundsError",{enumerable:!0,get:function(){return H.SliceOffsetOutOfBoundsError}});var F=Bn();Object.defineProperty(e,"IntegerOutOfRangeError",{enumerable:!0,get:function(){return F.IntegerOutOfRangeError}}),Object.defineProperty(e,"InvalidBytesBooleanError",{enumerable:!0,get:function(){return F.InvalidBytesBooleanError}}),Object.defineProperty(e,"InvalidHexBooleanError",{enumerable:!0,get:function(){return F.InvalidHexBooleanError}}),Object.defineProperty(e,"InvalidHexValueError",{enumerable:!0,get:function(){return F.InvalidHexValueError}}),Object.defineProperty(e,"SizeOverflowError",{enumerable:!0,get:function(){return F.SizeOverflowError}});var k=Jf();Object.defineProperty(e,"EnsAvatarInvalidNftUriError",{enumerable:!0,get:function(){return k.EnsAvatarInvalidNftUriError}}),Object.defineProperty(e,"EnsAvatarUnsupportedNamespaceError",{enumerable:!0,get:function(){return k.EnsAvatarUnsupportedNamespaceError}}),Object.defineProperty(e,"EnsAvatarUriResolutionError",{enumerable:!0,get:function(){return k.EnsAvatarUriResolutionError}}),Object.defineProperty(e,"EnsInvalidChainIdError",{enumerable:!0,get:function(){return k.EnsInvalidChainIdError}});var m=zp();Object.defineProperty(e,"EstimateGasExecutionError",{enumerable:!0,get:function(){return m.EstimateGasExecutionError}});var M=ri();Object.defineProperty(e,"BaseFeeScalarError",{enumerable:!0,get:function(){return M.BaseFeeScalarError}}),Object.defineProperty(e,"Eip1559FeesNotSupportedError",{enumerable:!0,get:function(){return M.Eip1559FeesNotSupportedError}}),Object.defineProperty(e,"MaxFeePerGasTooLowError",{enumerable:!0,get:function(){return M.MaxFeePerGasTooLowError}});var A=Op();Object.defineProperty(e,"FilterTypeNotSupportedError",{enumerable:!0,get:function(){return A.FilterTypeNotSupportedError}});var P=rr();Object.defineProperty(e,"ExecutionRevertedError",{enumerable:!0,get:function(){return P.ExecutionRevertedError}}),Object.defineProperty(e,"FeeCapTooHighError",{enumerable:!0,get:function(){return P.FeeCapTooHighError}}),Object.defineProperty(e,"FeeCapTooLowError",{enumerable:!0,get:function(){return P.FeeCapTooLowError}}),Object.defineProperty(e,"InsufficientFundsError",{enumerable:!0,get:function(){return P.InsufficientFundsError}}),Object.defineProperty(e,"IntrinsicGasTooHighError",{enumerable:!0,get:function(){return P.IntrinsicGasTooHighError}}),Object.defineProperty(e,"IntrinsicGasTooLowError",{enumerable:!0,get:function(){return P.IntrinsicGasTooLowError}}),Object.defineProperty(e,"NonceMaxValueError",{enumerable:!0,get:function(){return P.NonceMaxValueError}}),Object.defineProperty(e,"NonceTooHighError",{enumerable:!0,get:function(){return P.NonceTooHighError}}),Object.defineProperty(e,"NonceTooLowError",{enumerable:!0,get:function(){return P.NonceTooLowError}}),Object.defineProperty(e,"TipAboveFeeCapError",{enumerable:!0,get:function(){return P.TipAboveFeeCapError}}),Object.defineProperty(e,"TransactionTypeNotSupportedError",{enumerable:!0,get:function(){return P.TransactionTypeNotSupportedError}}),Object.defineProperty(e,"UnknownNodeError",{enumerable:!0,get:function(){return P.UnknownNodeError}});var S=Bt();Object.defineProperty(e,"HttpRequestError",{enumerable:!0,get:function(){return S.HttpRequestError}}),Object.defineProperty(e,"RpcRequestError",{enumerable:!0,get:function(){return S.RpcRequestError}}),Object.defineProperty(e,"SocketClosedError",{enumerable:!0,get:function(){return S.SocketClosedError}}),Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return S.TimeoutError}}),Object.defineProperty(e,"WebSocketRequestError",{enumerable:!0,get:function(){return S.WebSocketRequestError}});var q=_r();Object.defineProperty(e,"AtomicityNotSupportedError",{enumerable:!0,get:function(){return q.AtomicityNotSupportedError}}),Object.defineProperty(e,"AtomicReadyWalletRejectedUpgradeError",{enumerable:!0,get:function(){return q.AtomicReadyWalletRejectedUpgradeError}}),Object.defineProperty(e,"BundleTooLargeError",{enumerable:!0,get:function(){return q.BundleTooLargeError}}),Object.defineProperty(e,"ChainDisconnectedError",{enumerable:!0,get:function(){return q.ChainDisconnectedError}}),Object.defineProperty(e,"DuplicateIdError",{enumerable:!0,get:function(){return q.DuplicateIdError}}),Object.defineProperty(e,"InternalRpcError",{enumerable:!0,get:function(){return q.InternalRpcError}}),Object.defineProperty(e,"InvalidInputRpcError",{enumerable:!0,get:function(){return q.InvalidInputRpcError}}),Object.defineProperty(e,"InvalidParamsRpcError",{enumerable:!0,get:function(){return q.InvalidParamsRpcError}}),Object.defineProperty(e,"InvalidRequestRpcError",{enumerable:!0,get:function(){return q.InvalidRequestRpcError}}),Object.defineProperty(e,"JsonRpcVersionUnsupportedError",{enumerable:!0,get:function(){return q.JsonRpcVersionUnsupportedError}}),Object.defineProperty(e,"LimitExceededRpcError",{enumerable:!0,get:function(){return q.LimitExceededRpcError}}),Object.defineProperty(e,"MethodNotFoundRpcError",{enumerable:!0,get:function(){return q.MethodNotFoundRpcError}}),Object.defineProperty(e,"MethodNotSupportedRpcError",{enumerable:!0,get:function(){return q.MethodNotSupportedRpcError}}),Object.defineProperty(e,"ParseRpcError",{enumerable:!0,get:function(){return q.ParseRpcError}}),Object.defineProperty(e,"ProviderDisconnectedError",{enumerable:!0,get:function(){return q.ProviderDisconnectedError}}),Object.defineProperty(e,"ProviderRpcError",{enumerable:!0,get:function(){return q.ProviderRpcError}}),Object.defineProperty(e,"ResourceNotFoundRpcError",{enumerable:!0,get:function(){return q.ResourceNotFoundRpcError}}),Object.defineProperty(e,"ResourceUnavailableRpcError",{enumerable:!0,get:function(){return q.ResourceUnavailableRpcError}}),Object.defineProperty(e,"RpcError",{enumerable:!0,get:function(){return q.RpcError}}),Object.defineProperty(e,"SwitchChainError",{enumerable:!0,get:function(){return q.SwitchChainError}}),Object.defineProperty(e,"TransactionRejectedRpcError",{enumerable:!0,get:function(){return q.TransactionRejectedRpcError}}),Object.defineProperty(e,"UnauthorizedProviderError",{enumerable:!0,get:function(){return q.UnauthorizedProviderError}}),Object.defineProperty(e,"UnknownBundleIdError",{enumerable:!0,get:function(){return q.UnknownBundleIdError}}),Object.defineProperty(e,"UnknownRpcError",{enumerable:!0,get:function(){return q.UnknownRpcError}}),Object.defineProperty(e,"UnsupportedChainIdError",{enumerable:!0,get:function(){return q.UnsupportedChainIdError}}),Object.defineProperty(e,"UnsupportedNonOptionalCapabilityError",{enumerable:!0,get:function(){return q.UnsupportedNonOptionalCapabilityError}}),Object.defineProperty(e,"UnsupportedProviderMethodError",{enumerable:!0,get:function(){return q.UnsupportedProviderMethodError}}),Object.defineProperty(e,"UserRejectedRequestError",{enumerable:!0,get:function(){return q.UserRejectedRequestError}});var N=Ef();Object.defineProperty(e,"AccountStateConflictError",{enumerable:!0,get:function(){return N.AccountStateConflictError}}
47),Object.defineProperty(e,"StateAssignmentConflictError",{enumerable:!0,get:function(){return N.StateAssignmentConflictError}});var U=dt();Object.defineProperty(e,"FeeConflictError",{enumerable:!0,get:function(){return U.FeeConflictError}}),Object.defineProperty(e,"InvalidLegacyVError",{enumerable:!0,get:function(){return U.InvalidLegacyVError}}),Object.defineProperty(e,"InvalidSerializableTransactionError",{enumerable:!0,get:function(){return U.InvalidSerializableTransactionError}}),Object.defineProperty(e,"InvalidSerializedTransactionError",{enumerable:!0,get:function(){return U.InvalidSerializedTransactionError}}),Object.defineProperty(e,"InvalidSerializedTransactionTypeError",{enumerable:!0,get:function(){return U.InvalidSerializedTransactionTypeError}}),Object.defineProperty(e,"InvalidStorageKeySizeError",{enumerable:!0,get:function(){return U.InvalidStorageKeySizeError}}),Object.defineProperty(e,"TransactionExecutionError",{enumerable:!0,get:function(){return U.TransactionExecutionError}}),Object.defineProperty(e,"TransactionNotFoundError",{enumerable:!0,get:function(){return U.TransactionNotFoundError}}),Object.defineProperty(e,"TransactionReceiptNotFoundError",{enumerable:!0,get:function(){return U.TransactionReceiptNotFoundError}}),Object.defineProperty(e,"WaitForTransactionReceiptTimeoutError",{enumerable:!0,get:function(){return U.WaitForTransactionReceiptTimeoutError}});var L=y0();Object.defineProperty(e,"UrlRequiredError",{enumerable:!0,get:function(){return L.UrlRequiredError}});var z=x_();Object.defineProperty(e,"InvalidDomainError",{enumerable:!0,get:function(){return z.InvalidDomainError}}),Object.defineProperty(e,"InvalidPrimaryTypeError",{enumerable:!0,get:function(){return z.InvalidPrimaryTypeError}}),Object.defineProperty(e,"InvalidStructTypeError",{enumerable:!0,get:function(){return z.InvalidStructTypeError}});var D=K_();Object.defineProperty(e,"InvalidDecimalNumberError",{enumerable:!0,get:function(){return D.InvalidDecimalNumberError}});var X=M5();Object.defineProperty(e,"EIP1193ProviderRpcError",{enumerable:!0,get:function(){return X.ProviderRpcError}});var W=gr();Object.defineProperty(e,"decodeAbiParameters",{enumerable:!0,get:function(){return W.decodeAbiParameters}});var Z=k5();Object.defineProperty(e,"decodeDeployData",{enumerable:!0,get:function(){return Z.decodeDeployData}});var J=Vu();Object.defineProperty(e,"decodeErrorResult",{enumerable:!0,get:function(){return J.decodeErrorResult}});var oe=ii();Object.defineProperty(e,"decodeEventLog",{enumerable:!0,get:function(){return oe.decodeEventLog}});var K=Nf();Object.defineProperty(e,"decodeFunctionData",{enumerable:!0,get:function(){return K.decodeFunctionData}});var Y=Mt();Object.defineProperty(e,"decodeFunctionResult",{enumerable:!0,get:function(){return Y.decodeFunctionResult}});var $=It();Object.defineProperty(e,"encodeAbiParameters",{enumerable:!0,get:function(){return $.encodeAbiParameters}});var re=ui();Object.defineProperty(e,"encodeDeployData",{enumerable:!0,get:function(){return re.encodeDeployData}});var ee=Ff();Object.defineProperty(e,"encodeErrorResult",{enumerable:!0,get:function(){return ee.encodeErrorResult}});var ne=$r();Object.defineProperty(e,"encodeEventTopics",{enumerable:!0,get:function(){return ne.encodeEventTopics}});var se=ot();Object.defineProperty(e,"encodeFunctionData",{enumerable:!0,get:function(){return se.encodeFunctionData}});var te=Lf();Object.defineProperty(e,"encodeFunctionResult",{enumerable:!0,get:function(){return te.encodeFunctionResult}});var Q=l_();Object.defineProperty(e,"encodePacked",{enumerable:!0,get:function(){return Q.encodePacked}});var be=tr();Object.defineProperty(e,"getAbiItem",{enumerable:!0,get:function(){return be.getAbiItem}});var me=si();Object.defineProperty(e,"parseEventLogs",{enumerable:!0,get:function(){return me.parseEventLogs}});var ze=qp();Object.defineProperty(e,"prepareEncodeFunctionData",{enumerable:!0,get:function(){return ze.prepareEncodeFunctionData}});var Ae=yt();Object.defineProperty(e,"checksumAddress",{enumerable:!0,get:function(){return Ae.checksumAddress}}),Object.defineProperty(e,"getAddress",{enumerable:!0,get:function(){return Ae.getAddress}});var Xe=b_();Object.defineProperty(e,"getContractAddress",{enumerable:!0,get:function(){return Xe.getContractAddress}}),Object.defineProperty(e,"getCreate2Address",{enumerable:!0,get:function(){return Xe.getCreate2Address}}),Object.defineProperty(e,"getCreateAddress",{enumerable:!0,get:function(){return Xe.getCreateAddress}});var Me=ut();Object.defineProperty(e,"isAddress",{enumerable:!0,get:function(){return Me.isAddress}});var Te=Ot();Object.defineProperty(e,"isAddressEqual",{enumerable:!0,get:function(){return Te.isAddressEqual}});var pt=Ju();Object.defineProperty(e,"blobsToCommitments",{enumerable:!0,get:function(){return pt.blobsToCommitments}});var Ke=Xu();Object.defineProperty(e,"blobsToProofs",{enumerable:!0,get:function(){return Ke.blobsToProofs}});var Ue=xf();Object.defineProperty(e,"commitmentsToVersionedHashes",{enumerable:!0,get:function(){return Ue.commitmentsToVersionedHashes}});var Ze=Bf();Object.defineProperty(e,"commitmentToVersionedHash",{enumerable:!0,get:function(){return Ze.commitmentToVersionedHash}});
47var De=N5();Object.defineProperty(e,"fromBlobs",{enumerable:!0,get:function(){return De.fromBlobs}});var Ct=F5();Object.defineProperty(e,"sidecarsToVersionedHashes",{enumerable:!0,get:function(){return Ct.sidecarsToVersionedHashes}});var qn=Qu();Object.defineProperty(e,"toBlobSidecars",{enumerable:!0,get:function(){return qn.toBlobSidecars}});var gi=Zp();Object.defineProperty(e,"toBlobs",{enumerable:!0,get:function(){return gi.toBlobs}});var Sr=Uf();Object.defineProperty(e,"ccipRequest",{enumerable:!0,get:function(){return Sr.ccipRequest}}),Object.defineProperty(e,"ccipFetch",{enumerable:!0,get:function(){return Sr.ccipRequest}}),Object.defineProperty(e,"offchainLookup",{enumerable:!0,get:function(){return Sr.offchainLookup}}),Object.defineProperty(e,"offchainLookupAbiItem",{enumerable:!0,get:function(){return Sr.offchainLookupAbiItem}}),Object.defineProperty(e,"offchainLookupSignature",{enumerable:!0,get:function(){return Sr.offchainLookupSignature}});var pi=fi();Object.defineProperty(e,"assertCurrentChain",{enumerable:!0,get:function(){return pi.assertCurrentChain}});var _i=g_();Object.defineProperty(e,"defineChain",{enumerable:!0,get:function(){return _i.defineChain}}),Object.defineProperty(e,"extendSchema",{enumerable:!0,get:function(){return _i.extendSchema}});var hd=p_();Object.defineProperty(e,"extractChain",{enumerable:!0,get:function(){return hd.extractChain}});var vi=Pr();Object.defineProperty(e,"getChainContractAddress",{enumerable:!0,get:function(){return vi.getChainContractAddress}});var Hn=Le();Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return Hn.concat}}),Object.defineProperty(e,"concatBytes",{enumerable:!0,get:function(){return Hn.concatBytes}}),Object.defineProperty(e,"concatHex",{enumerable:!0,get:function(){return Hn.concatHex}});var yd=Xf();Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return yd.isBytes}});var gd=nt();Object.defineProperty(e,"isHex",{enumerable:!0,get:function(){return gd.isHex}});var Mn=hr();Object.defineProperty(e,"pad",{enumerable:!0,get:function(){return Mn.pad}}),Object.defineProperty(e,"padBytes",{enumerable:!0,get:function(){return Mn.padBytes}}),Object.defineProperty(e,"padHex",{enumerable:!0,get:function(){return Mn.padHex}});var pd=at();Object.defineProperty(e,"size",{enumerable:!0,get:function(){return pd.size}});var kn=vt();Object.defineProperty(e,"slice",{enumerable:!0,get:function(){return kn.slice}}),Object.defineProperty(e,"sliceBytes",{enumerable:!0,get:function(){return kn.sliceBytes}}),Object.defineProperty(e,"sliceHex",{enumerable:!0,get:function(){return kn.sliceHex}});var _d=er();Object.defineProperty(e,"trim",{enumerable:!0,get:function(){return _d.trim}});var Ir=vf();Object.defineProperty(e,"bytesToBigInt",{enumerable:!0,get:function(){return Ir.bytesToBigInt}}),Object.defineProperty(e,"bytesToBool",{enumerable:!0,get:function(){return Ir.bytesToBool}}),Object.defineProperty(e,"bytesToNumber",{enumerable:!0,get:function(){return Ir.bytesToNumber}}),Object.defineProperty(e,"bytesToString",{enumerable:!0,get:function(){return Ir.bytesToString}}),Object.defineProperty(e,"fromBytes",{enumerable:!0,get:function(){return Ir.fromBytes}});var Br=Ne();Object.defineProperty(e,"fromHex",{enumerable:!0,get:function(){return Br.fromHex}}),Object.defineProperty(e,"hexToBigInt",{enumerable:!0,get:function(){return Br.hexToBigInt}}),Object.defineProperty(e,"hexToBool",{enumerable:!0,get:function(){return Br.hexToBool}}),Object.defineProperty(e,"hexToNumber",{enumerable:!0,get:function(){return Br.hexToNumber}}),Object.defineProperty(e,"hexToString",{enumerable:!0,get:function(){return Br.hexToString}});var vd=$f();Object.defineProperty(e,"fromRlp",{enumerable:!0,get:function(){return vd.fromRlp}});var xr=Pe();Object.defineProperty(e,"boolToBytes",{enumerable:!0,get:function(){return xr.boolToBytes}}),Object.defineProperty(e,"hexToBytes",{enumerable:!0,get:function(){return xr.hexToBytes}}),Object.defineProperty(e,"numberToBytes",{enumerable:!0,get:function(){return xr.numberToBytes}}),Object.defineProperty(e,"stringToBytes",{enumerable:!0,get:function(){return xr.stringToBytes}}),Object.defineProperty(e,"toBytes",{enumerable:!0,get:function(){return xr.toBytes}});var Rr=ie();Object.defineProperty(e,"boolToHex",{enumerable:!0,get:function(){return Rr.boolToHex}}),Object.defineProperty(e,"bytesToHex",{enumerable:!0,get:function(){return Rr.bytesToHex}}),Object.defineProperty(e,"numberToHex",{enumerable:!0,get:function(){return Rr.numberToHex}}),Object.defineProperty(e,"stringToHex",{enumerable:!0,get:function(){return Rr.stringToHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return Rr.toHex}});var Nn=Qo();Object.defineProperty(e,"bytesToRlp",{enumerable:!0,get:function(){return Nn.bytesToRlp}}),Object.defineProperty(e,"hexToRlp",{enumerable:!0,get:function(){return Nn.hexToRlp}}),Object.defineProperty(e,"toRlp",{enumerable:!0,get:function(){return Nn.toRlp}});var Ed=s_();Object.defineProperty(e,"labelhash",{enumerable:!0,get:function(){return Ed.labelhash}});var wd=Zf();Object.defineProperty(e,"namehash",{enumerable:!0,get:function(){return wd.namehash}});var Fn=L5();Object.defineProperty(e,"toCoinType",{enumerable:!0,get:function(){return Fn.toCoinType}});var jd=vr();Object.defineProperty(e,"getContractError",{enumerable:!0,get:function(){return jd.getContractError}});var Ei=Zu();Object.defineProperty(e,"defineBlock",{enumerable:!0,get:function(){return Ei.defineBlock}}),Object.defineProperty(e,"formatBlock",{enumerable:!0,get:function(){return Ei.formatBlock}});var Pd=nr();Object.defineProperty(e,"formatLog",{enumerable:!0,get:function(){return Pd.formatLog}});var Ln=Rn();Object.defineProperty(e,"defineTransaction",{enumerable:!0,get:function(){return Ln.defineTransaction}}),Object.defineProperty(e,"formatTransaction",{enumerable:!0,get:function(){return Ln.formatTransaction}}),Object.defineProperty(e,"transactionType",{enumerable:!0,get:function(){return Ln.transactionType}});var wi=li();Object.defineProperty(e,"defineTransactionReceipt",{enumerable:!0,get:function(){return wi.defineTransactionReceipt}}),Object.defineProperty(e,"formatTransactionReceipt",{enumerable:!0,get:function(){return wi.formatTransactionReceipt}});var on=xt();Object.defineProperty(e,"defineTransactionRequest",{enumerable:!0,get:function(){return on.defineTransactionRequest}}),Object.defineProperty(e,"formatTransactionRequest",{enumerable:!0,get:function(){return on.formatTransactionRequest}}),Object.defineProperty(e,"rpcTransactionType",{enumerable:!0,get:function(){return on.rpcTransactionType}});var Ad=e0();Object.defineProperty(e,"isHash",{enumerable:!0,get:function(){return Ad.isHash}});var Td=ct();Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return Td.keccak256}});var Sd=__();Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return Sd.ripemd160}});var Id=If();Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return Id.sha256}});var Bd=v_();Object.defineProperty(e,"toEventHash",{enumerable:!0,get:function(){return Bd.toEventHash}});var ji=xn();Object.defineProperty(e,"toEventSelector",{enumerable:!0,get:function(){return ji.toEventSelector}}),Object.defineProperty(e,"getEventSelector",{enumerable:!0,get:function(){return ji.toEventSelector}});var g0=E_();Object.defineProperty(e,"toEventSignature",{enumerable:!0,get:function(){return g0.toEventSignature}}),Object.defineProperty(e,"getEventSignature",{enumerable:!0,get:function(){return g0.toEventSignature}});var lv=w_();Object.defineProperty(e,"toFunctionHash",{enumerable:!0,get:function(){return lv.toFunctionHash}});var p0=Qr();Object.defineProperty(e,"toFunctionSelector",{enumerable:!0,get:function(){return p0.toFunctionSelector}}),Object.defineProperty(e,"getFunctionSelector",{enumerable:!0,get:function(){return p0.toFunctionSelector}});var _0=j_();Object.defineProperty(e,"toFunctionSignature",{enumerable:!0,get:function(){return _0.toFunctionSignature}}),Object.defineProperty(e,"getFunctionSignature",{enumerable:!0,get:function(){return _0.toFunctionSignature}});var bv=cv();Object.defineProperty(e,"defineKzg",{enumerable:!0,get:function(){return bv.defineKzg}});var mv=U5();Object.defineProperty(e,"setupKzg",{enumerable:!0,get:function(){return mv.setupKzg}});var v0=P_();Object.defineProperty(e,"createNonceManager",{enumerable:!0,get:function(){return v0.createNonceManager}}),Object.defineProperty(e,"nonceManager",{enumerable:!0,get:function(){return v0.nonceManager}});var hv=e_();Object.defineProperty(e,"withCache",{enumerable:!0,get:function(){return hv.withCache}});var yv=id();Object.defineProperty(e,"withRetry",{enumerable:!0,get:function(){return yv.withRetry}});var gv=t0();Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return gv.withTimeout}});var pv=z5();Object.defineProperty(e,"compactSignatureToSignature",{enumerable:!0,get:function(){return pv.compactSignatureToSignature}});var _v=bi();Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return _v.hashMessage}});var xd=mi();Object.defineProperty(e,"hashDomain",{enumerable:!0,get:function(){return xd.hashDomain}}),Object.defineProperty(e,"hashStruct",{enumerable:!0,get:function(){return xd.hashStruct}}),Object.defineProperty(e,"hashTypedData",{enumerable:!0,get:function(){return xd.hashTypedData}
47});var vv=i0();Object.defineProperty(e,"isErc6492Signature",{enumerable:!0,get:function(){return vv.isErc6492Signature}});var Ev=c0();Object.defineProperty(e,"isErc8010Signature",{enumerable:!0,get:function(){return Ev.isErc8010Signature}});var E0=D5();Object.defineProperty(e,"hexToCompactSignature",{enumerable:!0,get:function(){return E0.parseCompactSignature}}),Object.defineProperty(e,"parseCompactSignature",{enumerable:!0,get:function(){return E0.parseCompactSignature}});var wv=L_();Object.defineProperty(e,"parseErc6492Signature",{enumerable:!0,get:function(){return wv.parseErc6492Signature}});var jv=U_();Object.defineProperty(e,"parseErc8010Signature",{enumerable:!0,get:function(){return jv.parseErc8010Signature}});var w0=G5();Object.defineProperty(e,"hexToSignature",{enumerable:!0,get:function(){return w0.parseSignature}}),Object.defineProperty(e,"parseSignature",{enumerable:!0,get:function(){return w0.parseSignature}});var Pv=Er();Object.defineProperty(e,"recoverAddress",{enumerable:!0,get:function(){return Pv.recoverAddress}});var Av=u0();Object.defineProperty(e,"recoverMessageAddress",{enumerable:!0,get:function(){return Av.recoverMessageAddress}});var Tv=jf();Object.defineProperty(e,"recoverPublicKey",{enumerable:!0,get:function(){return Tv.recoverPublicKey}});var Sv=V5();Object.defineProperty(e,"recoverTransactionAddress",{enumerable:!0,get:function(){return Sv.recoverTransactionAddress}});var Iv=d0();Object.defineProperty(e,"recoverTypedDataAddress",{enumerable:!0,get:function(){return Iv.recoverTypedDataAddress}});var j0=W5();Object.defineProperty(e,"compactSignatureToHex",{enumerable:!0,get:function(){return j0.serializeCompactSignature}}),Object.defineProperty(e,"serializeCompactSignature",{enumerable:!0,get:function(){return j0.serializeCompactSignature}});var Bv=z_();Object.defineProperty(e,"serializeErc6492Signature",{enumerable:!0,get:function(){return Bv.serializeErc6492Signature}});var xv=D_();Object.defineProperty(e,"serializeErc8010Signature",{enumerable:!0,get:function(){return xv.serializeErc8010Signature}});var P0=ev();Object.defineProperty(e,"signatureToHex",{enumerable:!0,get:function(){return P0.serializeSignature}}),Object.defineProperty(e,"serializeSignature",{enumerable:!0,get:function(){return P0.serializeSignature}});var Rv=K5();Object.defineProperty(e,"signatureToCompactSignature",{enumerable:!0,get:function(){return Rv.signatureToCompactSignature}});var Ov=B_();Object.defineProperty(e,"toPrefixedMessage",{enumerable:!0,get:function(){return Ov.toPrefixedMessage}});var Cv=G_();Object.defineProperty(e,"verifyHash",{enumerable:!0,get:function(){return Cv.verifyHash}});var qv=V_();Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return qv.verifyMessage}});var Hv=W_();Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return Hv.verifyTypedData}});var Mv=Ve();Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return Mv.stringify}});var kv=Rt();Object.defineProperty(e,"assertRequest",{enumerable:!0,get:function(){return kv.assertRequest}});var Rd=ad();Object.defineProperty(e,"assertTransactionEIP1559",{enumerable:!0,get:function(){return Rd.assertTransactionEIP1559}}),Object.defineProperty(e,"assertTransactionEIP2930",{enumerable:!0,get:function(){return Rd.assertTransactionEIP2930}}),Object.defineProperty(e,"assertTransactionLegacy",{enumerable:!0,get:function(){return Rd.assertTransactionLegacy}});var Nv=f0();Object.defineProperty(e,"getSerializedTransactionType",{enumerable:!0,get:function(){return Nv.getSerializedTransactionType}});var Fv=$u();Object.defineProperty(e,"getTransactionType",{enumerable:!0,get:function(){return Fv.getTransactionType}});var Lv=l0();Object.defineProperty(e,"parseTransaction",{enumerable:!0,get:function(){return Lv.parseTransaction}});var Uv=Qf();Object.defineProperty(e,"serializeAccessList",{enumerable:!0,get:function(){return Uv.serializeAccessList}});var zv=cd();Object.defineProperty(e,"serializeTransaction",{enumerable:!0,get:function(){return zv.serializeTransaction}});var Pi=ud();Object.defineProperty(e,"domainSeparator",{enumerable:!0,get:function(){return Pi.domainSeparator}}),Object.defineProperty(e,"getTypesForEIP712Domain",{enumerable:!0,get:function(){return Pi.getTypesForEIP712Domain}}),Object.defineProperty(e,"serializeTypedData",{enumerable:!0,get:function(){return Pi.serializeTypedData}
47}),Object.defineProperty(e,"validateTypedData",{enumerable:!0,get:function(){return Pi.validateTypedData}});var Dv=Yo();Object.defineProperty(e,"formatEther",{enumerable:!0,get:function(){return Dv.formatEther}});var Gv=en();Object.defineProperty(e,"formatGwei",{enumerable:!0,get:function(){return Gv.formatGwei}});var Vv=Wu();Object.defineProperty(e,"formatUnits",{enumerable:!0,get:function(){return Vv.formatUnits}});var Wv=Z_();Object.defineProperty(e,"parseEther",{enumerable:!0,get:function(){return Wv.parseEther}});var Kv=Y_();Object.defineProperty(e,"parseGwei",{enumerable:!0,get:function(){return Kv.parseGwei}});var Zv=bd();Object.defineProperty(e,"parseUnits",{enumerable:!0,get:function(){return Zv.parseUnits}})})(Md)),Md}var Kr={},mp;function Y5(){if(mp)return Kr;mp=1,Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.MAGIC_VALUE_BYTES=Kr.MAGIC_VALUE=void 0;const e="0x1626ba7e";Kr.MAGIC_VALUE=e;const t="0x20c13b0b";return Kr.MAGIC_VALUE_BYTES=t,Kr}var ku={},Vo={},Zr={},hp;function uv(){if(hp)return Zr;hp=1,Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.PermissionsError=Zr.PERMISSIONS_REQUEST_REJECTED=void 0,Zr.PERMISSIONS_REQUEST_REJECTED=4001;class e extends Error{constructor(n,r,s){super(n),this.code=r,this.data=s,Object.setPrototypeOf(this,e.prototype)}}return Zr.PermissionsError=e,Zr}var yp;function dv(){if(yp)return Vo;yp=1,Object.defineProperty(Vo,"__esModule",{value:!0}),Vo.Wallet=void 0;const e=Jr(),t=uv();class n{constructor(s){this.communicator=s}async getPermissions(){return(await this.communicator.send(e.Methods.wallet_getPermissions,void 0)).data}async requestPermissions(s){if(!this.isPermissionRequestValid(s))throw new t.PermissionsError("Permissions request is invalid",t.PERMISSIONS_REQUEST_REJECTED);try{return(await this.communicator.send(e.Methods.wallet_requestPermissions,s)).data}catch{throw new t.PermissionsError("Permissions rejected",t.PERMISSIONS_REQUEST_REJECTED)}}isPermissionRequestValid(s){return s.every(a=>typeof a=="object"?Object.keys(a).every(o=>!!Object.values(e.RestrictedMethods).includes(o)):!1)}}return Vo.Wallet=n,Vo}var gp;function J5(){if(gp)return ku;gp=1,Object.defineProperty(ku,"__esModule",{value:!0});const e=dv(),t=uv(),n=(s,a)=>a.some(o=>o.parentCapability===s),r=()=>(s,a,o)=>{const c=o.value;return o.value=async function(){const u=new e.Wallet(this.communicator);let d=await u.getPermissions();if(n(a,d)||(d=await u.requestPermissions([{[a]:{}}])),!n(a,d))throw new t.PermissionsError("Permissions rejected",t.PERMISSIONS_REQUEST_REJECTED);return c.apply(this)},o};return ku.default=r,ku}var pp;function X5(){if(pp)return Lt;pp=1;var e=Lt&&Lt.__decorate||function(d,l,f,b){var T=arguments.length,v=T<3?l:b===null?b=Object.getOwnPropertyDescriptor(l,f):b,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(d,l,f,b);else for(var O=d.length-1;O>=0;O--)(p=d[O])&&(v=(T<3?p(v):T>3?p(l,f,v):p(l,f))||v);return T>3&&v&&Object.defineProperty(l,f,v),v},t=Lt&&Lt.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.Safe=void 0;const n=Z5(),r=Y5(),s=Jr(),a=hf(),o=mf(),c=t(J5());class u{constructor(l){this.communicator=l}async getChainInfo(){return(await this.communicator.send(s.Methods.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(s.Methods.getSafeInfo,void 0)).data}async experimental_getBalances({currency:l="usd"}={}){return(await this.communicator.send(s.Methods.getSafeBalances,{currency:l})).data}async check1271Signature(l,f="0x"){const b=await this.getInfo(),T=(0,n.encodeFunctionData)({abi:[{constant:!1,inputs:[{name:"_dataHash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[l,f]}),v={call:a.RPC_CALLS.eth_call,params:[{to:b.safeAddress,data:T},"latest"]};try{return(await this.communicator.send(s.Methods.rpcCall,v)).data.slice(0,10).toLowerCase()===r.MAGIC_VALUE}catch{return!1}}async check1271SignatureBytes(l,f="0x"){const b=await this.getInfo(),T=(0,n.encodeFunctionData)({abi:[{constant:!1,inputs:[{name:"_data",type:"bytes"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[l,f]}),v={call:a.RPC_CALLS.eth_call,params:[{to:b.safeAddress,data:T},"latest"]};try{return(await this.communicator.send(s.Methods.rpcCall,v)).data.slice(0,10).toLowerCase()===r.MAGIC_VALUE_BYTES}catch{return!1}}calculateMessageHash(l){return(0,n.hashMessage)(l)}calculateTypedMessageHash(l){const f=typeof l.domain.chainId=="object"?l.domain.chainId.toNumber():Number(l.domain.chainId);let b=l.primaryType;if(!b){const T=Object.values(l.types),v=Object.keys(l.types).filter(p=>T.every(O=>O.every(({type:I})=>I.replace("[","").replace("]","")!==p)));if(v.length===0||v.length>1)throw new Error("Please specify primaryType");b=v[0]}return(0,n.hashTypedData)({message:l.message,domain:{...l.domain,chainId:f,verifyingContract:l.domain.verifyingContract,salt:l.domain.salt},types:l.types,primaryType:b})}async getOffChainSignature(l){return(await this.communicator.send(s.Methods.getOffChainSignature,l)).data}async isMessageSigned(l,f="0x"){let b;if(typeof l=="string"&&(b=async()=>{const T=this.calculateMessageHash(l);return await this.isMessageHashSigned(T,f)}),(0,o.isObjectEIP712TypedData)(l)&&(b=async()=>{const T=this.calculateTypedMessageHash(l);return await this.isMessageHashSigned(T,f)}),b)return await b();throw new Error("Invalid message type")}async isMessageHashSigned(l,f="0x"){const b=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(const T of b)if(await T(l,f))return!0;return!1}async getEnvironmentInfo(){return(await this.communicator.send(s.Methods.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(s.Methods.requestAddressBook,void 0)).data}}return Lt.Safe=u,e([(0,c.default)()],u.prototype,"requestAddressBook",null),Lt}var _p;function vp(){if(_p)return sn;_p=1;var e=sn&&sn.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(sn,"__esModule",{value:!0});const t=e(o6()),n=u6(),r=d6(),s=X5(),a=dv();class o{constructor(u={}){const{allowedDomains:d=null,debug:l=!1}=u;this.communicator=new t.default(d,l),this.eth=new r.Eth(this.communicator),this.txs=new n.TXs(this.communicator),this.safe=new s.Safe(this.communicator),this.wallet=new a.Wallet(this.communicator)}}return sn.default=o,sn}var Ep;function Q5(){return Ep||(Ep=1,(function(e){var t=Ft&&Ft.__createBinding||(Object.create?(function(o,c,u,d){d===void 0&&(d=u);var l=Object.getOwnPropertyDescriptor(c,u);(!l||("get"in l?!c.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return c[u]}}),Object.defineProperty(o,d,l)}):(function(o,c,u,d){d===void 0&&(d=u),o[d]=c[u]})),n=Ft&&Ft.__exportStar||function(o,c){for(var u in o)u!=="default"&&!Object.prototype.hasOwnProperty.call(c,u)&&t(c,o,u)},r=Ft&&Ft.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};
47Object.defineProperty(e,"__esModule",{value:!0}),e.getSDKVersion=void 0;const s=r(vp());e.default=s.default,n(vp(),e),n(mf(),e),n(Jr(),e),n(Tp(),e);var a=Ap();Object.defineProperty(e,"getSDKVersion",{enumerable:!0,get:function(){return a.getSDKVersion}}),n(hf(),e)})(Ft)),Ft}var Yr={},wp;function $5(){if(wp)return Yr;wp=1,Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.numberToHex=Yr.getLowerCase=void 0;function e(n){return n&&n.toLowerCase()}Yr.getLowerCase=e;function t(n){return`0x${n.toString(16)}`}return Yr.numberToHex=t,Yr}var jp;function eE(){if(jp)return Un;jp=1,Object.defineProperty(Un,"__esModule",{value:!0}),Un.SafeAppProvider=void 0;const e=Q5(),t=Qv(),n=$5();class r extends t.EventEmitter{constructor(a,o){super(),this.submittedTxs=new Map,this.safe=a,this.sdk=o}async connect(){this.emit("connect",{chainId:this.chainId})}async disconnect(){}get chainId(){return this.safe.chainId}async request(a){const{method:o,params:c=[]}=a;switch(o){case"eth_accounts":return[this.safe.safeAddress];case"net_version":case"eth_chainId":return(0,n.numberToHex)(this.chainId);case"personal_sign":{const[b,T]=c;if(this.safe.safeAddress.toLowerCase()!==T.toLowerCase())throw new Error("The address or message hash is invalid");const v=await this.sdk.txs.signMessage(b);return("signature"in v?v.signature:void 0)||"0x"}case"eth_sign":{const[b,T]=c;if(this.safe.safeAddress.toLowerCase()!==b.toLowerCase()||!T.startsWith("0x"))throw new Error("The address or message hash is invalid");const v=await this.sdk.txs.signMessage(T);return("signature"in v?v.signature:void 0)||"0x"}case"eth_signTypedData":case"eth_signTypedData_v4":{const[b,T]=c,v=typeof T=="string"?JSON.parse(T):T;if(this.safe.safeAddress.toLowerCase()!==b.toLowerCase())throw new Error("The address is invalid");const p=await this.sdk.txs.signTypedMessage(v);return("signature"in p?p.signature:void 0)||"0x"}case"eth_sendTransaction":const u={...c[0],value:c[0].value||"0",data:c[0].data||"0x"};typeof u.gas=="string"&&u.gas.startsWith("0x")&&(u.gas=parseInt(u.gas,16));const d=await this.sdk.txs.send({txs:[u],params:{safeTxGas:u.gas}});return this.submittedTxs.set(d.safeTxHash,{from:this.safe.safeAddress,hash:d.safeTxHash,gas:0,gasPrice:"0x00",nonce:0,input:u.data,value:u.value,to:u.to,blockHash:null,blockNumber:null,transactionIndex:null}),d.safeTxHash;case"eth_blockNumber":return(await this.sdk.eth.getBlockByNumber(["latest"])).number;case"eth_getBalance":return this.sdk.eth.getBalance([(0,n.getLowerCase)(c[0]),c[1]]);case"eth_getCode":return this.sdk.eth.getCode([(0,n.getLowerCase)(c[0]),c[1]]);case"eth_getTransactionCount":return this.sdk.eth.getTransactionCount([(0,n.getLowerCase)(c[0]),c[1]]);case"eth_getStorageAt":return this.sdk.eth.getStorageAt([(0,n.getLowerCase)(c[0]),c[1],c[2]]);case"eth_getBlockByNumber":return this.sdk.eth.getBlockByNumber([c[0],c[1]]);case"eth_getBlockByHash":return this.sdk.eth.getBlockByHash([c[0],c[1]]);case"eth_getTransactionByHash":let f=c[0];try{f=(await this.sdk.txs.getBySafeTxHash(f)).txHash||f}catch{}return this.submittedTxs.has(f)?this.submittedTxs.get(f):this.sdk.eth.getTransactionByHash([f]).then(b=>(b&&(b.hash=c[0]),b));case"eth_getTransactionReceipt":{let b=c[0];try{b=(await this.sdk.txs.getBySafeTxHash(b)).txHash||b}catch{}return this.sdk.eth.getTransactionReceipt([b]).then(T=>(T&&(T.transactionHash=c[0]),T))}case"eth_estimateGas":return this.sdk.eth.getEstimateGas(c[0]);case"eth_call":return this.sdk.eth.call([c[0],c[1]]);case"eth_getLogs":return this.sdk.eth.getPastLogs([c[0]]);case"eth_gasPrice":return this.sdk.eth.getGasPrice();case"wallet_getPermissions":return this.sdk.wallet.getPermissions();case"wallet_requestPermissions":return this.sdk.wallet.requestPermissions(c[0]);case"safe_setSettings":return this.sdk.eth.setSafeSettings([c[0]]);case"wallet_sendCalls":{const{from:b,calls:T,chainId:v}=c[0];if(v!==(0,n.numberToHex)(this.chainId))throw new Error(`Safe is not on chain ${v}`);if(b!==this.safe.safeAddress)throw Error("Invalid from address");const p=T.map((h,j)=>{if(!h.to)throw new Error(`Invalid call #${j}: missing "to" field`);return{to:h.to,data:h.data??"0x",value:h.value??(0,n.numberToHex)(0)}}),{safeTxHash:O}=await this.sdk.txs.send({txs:p});return{id:O}}case"wallet_getCallsStatus":{const b=c[0],T={[e.TransactionStatus.AWAITING_CONFIRMATIONS]:100,[e.TransactionStatus.AWAITING_EXECUTION]:100,[e.TransactionStatus.SUCCESS]:200,[e.TransactionStatus.CANCELLED]:400,[e.TransactionStatus.FAILED]:500},v=await this.sdk.txs.getBySafeTxHash(b),p={version:"1.0",id:b,chainId:(0,n.numberToHex)(this.chainId),status:T[v.txStatus]};if(!v.txHash)return p;const O=await this.sdk.eth.getTransactionReceipt([v.txHash]);if(!O)return p;const I=v.txData?.dataDecoded?.method!=="multiSend"?1:v.txData.dataDecoded.parameters?.[0].valueDecoded?.length??1,h=Number(O.blockNumber),j=Number(O.gasUsed);return p.receipts=Array(I).fill({logs:O.logs,status:(0,n.numberToHex)(v.txStatus===e.TransactionStatus.SUCCESS?1:0),blockHash:O.blockHash,blockNumber:(0,n.numberToHex)(h),gasUsed:(0,n.numberToHex)(j),transactionHash:v.txHash}),p}case"wallet_showCallsStatus":throw new Error(`"${a.method}" not supported`);case"wallet_getCapabilities":return{[(0,n.numberToHex)(this.chainId)]:{atomicBatch:{supported:!0}
47}};default:throw Error(`"${a.method}" not implemented`)}}send(a,o){a||o("Undefined request"),this.request(a).then(c=>o(null,{jsonrpc:"2.0",id:a.id,result:c})).catch(c=>o(c,null))}}return Un.SafeAppProvider=r,Un}var Pp;function tE(){return Pp||(Pp=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SafeAppProvider=void 0;var t=eE();Object.defineProperty(e,"SafeAppProvider",{enumerable:!0,get:function(){return t.SafeAppProvider}})})(Od)),Od}var fv=tE();const rE=Jv(fv),sE=$v({__proto__:null,default:rE},[fv]);export{sE as i};

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