"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[433],{7602:function(e,t,n){n.d(t,{V:function(){return _}});var i=n(1196);let r=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/,s=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/,o=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/,a=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/,u=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/,l=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/,c=/^receive\(\) external payable$/,f=new Set(["indexed"]),p=new Set(["calldata","memory","storage"]);class d extends Error{constructor(e,t={}){let n=t.cause instanceof d?t.cause.details:t.cause?.message?t.cause.message:t.details,i=t.cause instanceof d&&t.cause.docsPath||t.docsPath;super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...n?[`Details: ${n}`]:[],"Version: abitype@1.0.5"].join("\n")),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=i,this.metaMessages=t.metaMessages,this.shortMessage=e}}class h extends d{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class y extends d{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class m extends d{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class b extends d{constructor({param:e,name:t}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class g extends d{constructor({param:e,type:t,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class w extends d{constructor({param:e,type:t,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${t?` in "${t}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class v extends d{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class $ extends d{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class x extends d{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class z extends d{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class P extends d{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class I extends d{constructor({current:e,depth:t}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${t>0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}let A=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}]]),O=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,B=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,M=/^u?int$/;function E(e,t){var n,r,s;let o;let a=(n=t?.type)?`${n}:${e}`:e;if(A.has(a))return A.get(a);let u=i.cN.test(e),l=(0,i.Zw)(u?B:O,e);if(!l)throw new m({param:e});if(l.name&&("address"===(r=l.name)||"bool"===r||"function"===r||"string"===r||"tuple"===r||i.eL.test(r)||i.lh.test(r)||S.test(r)))throw new b({param:e,name:l.name});let c=l.name?{name:l.name}:{},f="indexed"===l.modifier?{indexed:!0}:{},d=t?.structs??{},h={};if(u){o="tuple";let e=U(l.type),t=[],n=e.length;for(let i=0;i<n;i++)t.push(E(e[i],{structs:d}));h={components:t}}else if(l.type in d)o="tuple",h={components:d[l.type]};else if(M.test(l.type))o=`${l.type}256`;else if(o=l.type,t?.type!=="struct"&&!k(o))throw new y({type:o});if(l.modifier){if(!t?.modifiers?.has?.(l.modifier))throw new g({param:e,type:t?.type,modifier:l.modifier});if(p.has(l.modifier)&&(s=o,!l.array&&"bytes"!==s&&"string"!==s&&"tuple"!==s))throw new w({param:e,type:t?.type,modifier:l.modifier})}let v={type:`${o}${l.array??""}`,...c,...f,...h};return A.set(a,v),v}function U(e,t=[],n="",i=0){let r=e.trim().length;for(let s=0;s<r;s++){let r=e[s],o=e.slice(s+1);switch(r){case",":return 0===i?U(o,[...t,n.trim()]):U(o,t,`${n}${r}`,i);case"(":return U(o,t,`${n}${r}`,i+1);case")":return U(o,t,`${n}${r}`,i-1);default:return U(o,t,`${n}${r}`,i)}}if(""===n)return t;if(0!==i)throw new I({current:n,depth:i});return t.push(n.trim()),t}function k(e){return"address"===e||"bool"===e||"function"===e||"string"===e||i.eL.test(e)||i.lh.test(e)}let S=/^(?: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)$/,j=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function _(e){let t=function(e){let t={},n=e.length;for(let r=0;r<n;r++){let n=e[r];if(!a.test(n))continue;let s=(0,i.Zw)(a,n);if(!s)throw new $({signature:n,type:"struct"});let o=s.properties.split(";"),u=[],l=o.length;for(let e=0;e<l;e++){let t=o[e].trim();if(!t)continue;let n=E(t,{type:"struct"});u.push(n)}if(!u.length)throw new z({signature:n});t[s.name]=u}let r={},s=Object.entries(t),o=s.length;for(let e=0;e<o;e++){let[n,o]=s[e];r[n]=function e(t,n,r=new Set){let s=[],o=t.length;for(let a=0;a<o;a++){let o=t[a];if(i.cN.test(o.type))s.push(o);else{let t=(0,i.Zw)(j,o.type);if(!t?.type)throw new v({abiParameter:o});let{array:a,type:u}=t;if(u in n){if(r.has(u))throw new P({type:u});s.push({...o,type:`tuple${a??""}`,components:e(n[u]??[],n,new Set([...r,u]))})}else if(k(u))s.push(o);else throw new h({type:u})}}return s}(o,t)}return r}(e),n=[],d=e.length;for(let h=0;h<d;h++){let d=e[h];a.test(d)||n.push(function(e,t={}){if(o.test(e)){let n=(0,i.Zw)(o,e);if(!n)throw new $({signature:e,type:"function"});let r=U(n.parameters),s=[],a=r.length;for(let e=0;e<a;e++)s.push(E(r[e],{modifiers:p,structs:t,type:"function"}));let u=[];if(n.returns){let e=U(n.returns),i=e.length;for(let n=0;n<i;n++)u.push(E(e[n],{modifiers:p,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:s,outputs:u}}if(s.test(e)){let n=(0,i.Zw)(s,e);if(!n)throw new $({signature:e,type:"event"});let r=U(n.parameters),o=[],a=r.length;for(let e=0;e<a;e++)o.push(E(r[e],{modifiers:f,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:o}}if(r.test(e)){let n=(0,i.Zw)(r,e);if(!n)throw new $({signature:e,type:"error"});let s=U(n.parameters),o=[],a=s.length;for(let e=0;e<a;e++)o.push(E(s[e],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:o}}if(u.test(e)){let n=(0,i.Zw)(u,e);if(!n)throw new $({signature:e,type:"constructor"});let r=U(n.parameters),s=[],o=r.length;for(let e=0;e<o;e++)s.push(E(r[e],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:s}}if(l.test(e))return{type:"fallback"};if(c.test(e))return{type:"receive",stateMutability:"payable"};throw new x({signature:e})}(d,t))}return n}},1196:function(e,t,n){function i(e,t){let n=e.exec(t);return n?.groups}n.d(t,{Zw:function(){return i},cN:function(){return o},eL:function(){return r},lh:function(){return s}});let r=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,s=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,o=/^\(.+?\).*?$/},7088:function(e,t,n){n.d(t,{CI:function(){return p},FM:function(){return a},Gy:function(){return f},SM:function(){return c},eF:function(){return l},lC:function(){return u},wM:function(){return d},wb:function(){return o},xB:function(){return s}});var i=n(4468);n(9937);var r=n(1966);class s extends r.G{constructor({data:e,params:t,size:n}){super(`Data size of ${n} bytes is too small for given parameters.`,{metaMessages:[`Params: (${(0,i.h)(t,{includeName:!0})})`,`Data:   ${e} (${n} 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=e,this.params=t,this.size=n}}class o extends r.G{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class a extends r.G{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e,name:"AbiEventSignatureEmptyTopicsError"})}}class u extends r.G{constructor(e,{docsPath:t}){super(`Encoded event signature "${e}" not found on ABI.
Make sure you are using the correct ABI and that the event exists on it.
You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`,{docsPath:t,name:"AbiEventSignatureNotFoundError"})}}class l extends r.G{constructor(e,{docsPath:t}){super(`Encoded function signature "${e}" 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://openchain.xyz/signatures?query=${e}.`,{docsPath:t,name:"AbiFunctionSignatureNotFoundError"})}}class c extends r.G{constructor({abiItem:e,data:t,params:n,size:r}){super(`Data size of ${r} bytes is too small for non-indexed event parameters.`,{metaMessages:[`Params: (${(0,i.h)(n,{includeName:!0})})`,`Data:   ${t} (${r} 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=e,this.data=t,this.params=n,this.size=r}}class f extends r.G{constructor({abiItem:e,param:t}){super(`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${(0,i.t)(e,{includeName:!0})}".`,{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class p extends r.G{constructor(e,{docsPath:t}){super(`Type "${e}" is not a valid decoding type.
Please provide a valid ABI type.`,{docsPath:t,name:"InvalidAbiDecodingType"})}}class d extends r.G{constructor(e){super(`"${e}" is not a valid definition type.
Valid types: "function", "event", "error"`,{name:"InvalidDefinitionTypeError"})}}},1966:function(e,t,n){n.d(t,{G:function(){return s}});let i="2.21.16",r={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:i};class s extends Error{constructor(e,t={}){let n=t.cause instanceof s?t.cause.details:t.cause?.message?t.cause.message:t.details,o=t.cause instanceof s&&t.cause.docsPath||t.docsPath,a=r.getDocsUrl?.({...t,docsPath:o});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...n?[`Details: ${n}`]:[],...r.version?[`Version: ${r.version}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"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=n,this.docsPath=o,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=i}walk(e){return function e(t,n){return n?.(t)?t:t&&"object"==typeof t&&"cause"in t?e(t.cause,n):n?null:t}(this,e)}}},9442:function(e,t,n){n.d(t,{KD:function(){return o},T_:function(){return r},lQ:function(){return s}});var i=n(1966);class r extends i.G{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class s extends i.G{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class o extends i.G{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}},3837:function(e,t,n){n.d(t,{$s:function(){return s},mV:function(){return r}});var i=n(1966);class r extends i.G{constructor({offset:e,position:t,size:n}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}}class s extends i.G{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}},2033:function(e,t,n){n.d(t,{J5:function(){return r},M6:function(){return o},yr:function(){return s}});var i=n(1966);class r extends i.G{constructor({max:e,min:t,signed:n,size:i,value:r}){super(`Number "${r}" is not in safe ${i?`${8*i}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class s extends i.G{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class o extends i.G{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}},3636:function(e,t,n){n.d(t,{r:function(){return g}});var i=n(7088),r=n(4431),s=n(5844);class o extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=this.keys().next().value;e&&this.delete(e)}return this}}let a=new o(8192);var u=n(9442);let l={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 u.KD({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new u.lQ({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new u.T_({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new u.T_({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};var c=n(9937),f=n(2715);function p(e,{dir:t="left"}={}){let n="string"==typeof e?e.replace("0x",""):e,i=0;for(let e=0;e<n.length-1&&"0"===n["left"===t?e:n.length-e-1].toString();e++)i++;return(n="left"===t?n.slice(i):n.slice(0,n.length-i),"string"==typeof e)?(1===n.length&&"right"===t&&(n=`${n}0`),`0x${n.length%2==1?`0${n}`:n}`):n}var d=n(2033),h=n(8656),y=n(6137);function m(e,t={}){void 0!==t.size&&(0,h.Yf)(e,{size:t.size});let n=(0,y.ci)(e,t);return(0,h.ly)(n,t)}function b(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function g(e,t){let n="string"==typeof t?(0,r.nr)(t):t,o=function(e,{recursiveReadLimit:t=8192}={}){let n=Object.create(l);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}(n);if(0===(0,c.d)(n)&&e.length>0)throw new i.wb;if((0,c.d)(t)&&32>(0,c.d)(t))throw new i.xB({data:"string"==typeof t?t:(0,y.ci)(t),params:e,size:(0,c.d)(t)});let u=0,g=[];for(let t=0;t<e.length;++t){let n=e[t];o.setPosition(u);let[l,c]=function e(t,n,{staticPosition:o}){let u=b(n.type);if(u){let[i,r]=u;return function(t,n,{length:i,staticPosition:r}){if(!i){let i=r+m(t.readBytes(32)),s=i+32;t.setPosition(i);let o=m(t.readBytes(32)),a=w(n),u=0,l=[];for(let i=0;i<o;++i){t.setPosition(s+(a?32*i:u));let[r,o]=e(t,n,{staticPosition:s});u+=o,l.push(r)}return t.setPosition(r+32),[l,32]}if(w(n)){let s=r+m(t.readBytes(32)),o=[];for(let r=0;r<i;++r){t.setPosition(s+32*r);let[i]=e(t,n,{staticPosition:s});o.push(i)}return t.setPosition(r+32),[o,32]}let s=0,o=[];for(let a=0;a<i;++a){let[i,a]=e(t,n,{staticPosition:r+s});s+=a,o.push(i)}return[o,s]}(t,{...n,type:r},{length:i,staticPosition:o})}if("tuple"===n.type)return function(t,n,{staticPosition:i}){let r=0===n.components.length||n.components.some(({name:e})=>!e),s=r?[]:{},o=0;if(w(n)){let a=i+m(t.readBytes(32));for(let i=0;i<n.components.length;++i){let u=n.components[i];t.setPosition(a+o);let[l,c]=e(t,u,{staticPosition:a});o+=c,s[r?i:u?.name]=l}return t.setPosition(i+32),[s,32]}for(let a=0;a<n.components.length;++a){let u=n.components[a],[l,c]=e(t,u,{staticPosition:i});s[r?a:u?.name]=l,o+=c}return[s,o]}(t,n,{staticPosition:o});if("address"===n.type)return function(e){let t=e.readBytes(32);return[function(e,t){if(a.has(`${e}.undefined`))return a.get(`${e}.undefined`);let n=e.substring(2).toLowerCase(),i=(0,s.w)((0,r.qX)(n),"bytes"),o=(t?n.substring(`${t}0x`.length):n).split("");for(let e=0;e<40;e+=2)i[e>>1]>>4>=8&&o[e]&&(o[e]=o[e].toUpperCase()),(15&i[e>>1])>=8&&o[e+1]&&(o[e+1]=o[e+1].toUpperCase());let u=`0x${o.join("")}`;return a.set(`${e}.${t}`,u),u}((0,y.ci)((0,f.T4)(t,-20))),32]}(t);if("bool"===n.type)return[function(e,t={}){let n=e;if(void 0!==t.size&&((0,h.Yf)(n,{size:t.size}),n=p(n)),n.length>1||n[0]>1)throw new d.yr(n);return!!n[0]}(t.readBytes(32),{size:32}),32];if(n.type.startsWith("bytes"))return function(e,t,{staticPosition:n}){let[i,r]=t.type.split("bytes");if(!r){let t=m(e.readBytes(32));e.setPosition(n+t);let i=m(e.readBytes(32));if(0===i)return e.setPosition(n+32),["0x",32];let r=e.readBytes(i);return e.setPosition(n+32),[(0,y.ci)(r),32]}return[(0,y.ci)(e.readBytes(Number.parseInt(r),32)),32]}(t,n,{staticPosition:o});if(n.type.startsWith("uint")||n.type.startsWith("int"))return function(e,t){let n=t.type.startsWith("int"),i=Number.parseInt(t.type.split("int")[1]||"256"),r=e.readBytes(32);return[i>48?function(e,t={}){void 0!==t.size&&(0,h.Yf)(e,{size:t.size});let n=(0,y.ci)(e,t);return(0,h.y_)(n,t)}(r,{signed:n}):m(r,{signed:n}),32]}(t,n);if("string"===n.type)return function(e,{staticPosition:t}){let n=m(e.readBytes(32));e.setPosition(t+n);let i=m(e.readBytes(32));if(0===i)return e.setPosition(t+32),["",32];let r=function(e,t={}){let n=e;return void 0!==t.size&&((0,h.Yf)(n,{size:t.size}),n=p(n,{dir:"right"})),new TextDecoder().decode(n)}(p(e.readBytes(i,32)));return e.setPosition(t+32),[r,32]}(t,{staticPosition:o});throw new i.CI(n.type,{docsPath:"/docs/contract/decodeAbiParameters"})}(o,n,{staticPosition:0});u+=c,g.push(l)}return g}function w(e){let{type:t}=e;if("string"===t||"bytes"===t||t.endsWith("[]"))return!0;if("tuple"===t)return e.components?.some(w);let n=b(e.type);return!!(n&&w({...e,type:n[1]}))}},8789:function(e,t,n){n.d(t,{F:function(){return c}});var i=n(7088),r=n(9937);let s=n(5624).r;var o=n(9442),a=n(3636),u=n(4468);let l="/docs/contract/decodeEventLog";function c(e){let{abi:t,data:n,strict:c,topics:f}=e,p=c??!0,[d,...h]=f;if(!d)throw new i.FM({docsPath:l});let y=1===t.length?t[0]:t.find(e=>"event"===e.type&&d===s((0,u.t)(e)));if(!(y&&"name"in y)||"event"!==y.type)throw new i.lC(d,{docsPath:l});let{name:m,inputs:b}=y,g=b?.some(e=>!("name"in e&&e.name)),w=g?[]:{},v=b.filter(e=>"indexed"in e&&e.indexed);for(let e=0;e<v.length;e++){let t=v[e],n=h[e];if(!n)throw new i.Gy({abiItem:y,param:t});w[g?e:t.name||e]=function({param:e,value:t}){return"string"===e.type||"bytes"===e.type||"tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/)?t:((0,a.r)([e],t)||[])[0]}({param:t,value:n})}let $=b.filter(e=>!("indexed"in e&&e.indexed));if($.length>0){if(n&&"0x"!==n)try{let e=(0,a.r)($,n);if(e){if(g)w=[...w,...e];else for(let t=0;t<$.length;t++)w[$[t].name]=e[t]}}catch(e){if(p){if(e instanceof i.xB||e instanceof o.lQ)throw new i.SM({abiItem:y,data:n,params:$,size:(0,r.d)(n)});throw e}}else if(p)throw new i.SM({abiItem:y,data:"0x",params:$,size:0})}return{eventName:m,args:Object.values(w).length>0?w:void 0}}},4468:function(e,t,n){n.d(t,{h:function(){return s},t:function(){return r}});var i=n(7088);function r(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new i.wM(e.type);return`${e.name}(${s(e.inputs,{includeName:t})})`}function s(e,{includeName:t=!1}={}){return e?e.map(e=>(function(e,{includeName:t}){return e.type.startsWith("tuple")?`(${s(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")})(e,{includeName:t})).join(t?", ":","):""}},7559:function(e,t,n){n.d(t,{v:function(){return i}});function i(e,{strict:t=!0}={}){return!!e&&"string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x"))}},10:function(e,t,n){n.d(t,{vk:function(){return r}});var i=n(3837);function r(e,{dir:t,size:n=32}={}){return"string"==typeof e?function(e,{dir:t,size:n=32}={}){if(null===n)return e;let r=e.replace("0x","");if(r.length>2*n)throw new i.$s({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new i.$s({size:e.length,targetSize:n,type:"bytes"});let r=new Uint8Array(n);for(let i=0;i<n;i++){let s="right"===t;r[s?i:n-i-1]=e[s?i:e.length-i-1]}return r}(e,{dir:t,size:n})}},9937:function(e,t,n){n.d(t,{d:function(){return r}});var i=n(7559);function r(e){return(0,i.v)(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}},2715:function(e,t,n){n.d(t,{T4:function(){return l},tP:function(){return o}});var i=n(3837),r=n(7559),s=n(9937);function o(e,t,n,{strict:i}={}){return(0,r.v)(e,{strict:!1})?function(e,t,n,{strict:i}={}){a(e,t);let r=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return i&&u(r,t,n),r}(e,t,n,{strict:i}):l(e,t,n,{strict:i})}function a(e,t){if("number"==typeof t&&t>0&&t>(0,s.d)(e)-1)throw new i.mV({offset:t,position:"start",size:(0,s.d)(e)})}function u(e,t,n){if("number"==typeof t&&"number"==typeof n&&(0,s.d)(e)!==n-t)throw new i.mV({offset:n,position:"end",size:(0,s.d)(e)})}function l(e,t,n,{strict:i}={}){a(e,t);let r=e.slice(t,n);return i&&u(r,t,n),r}},8656:function(e,t,n){n.d(t,{Yf:function(){return s},ly:function(){return a},y_:function(){return o}});var i=n(2033),r=n(9937);function s(e,{size:t}){if((0,r.d)(e)>t)throw new i.M6({givenSize:(0,r.d)(e),maxSize:t})}function o(e,t={}){let{signed:n}=t;t.size&&s(e,{size:t.size});let i=BigInt(e);if(!n)return i;let r=(e.length-2)/2;return i<=(1n<<8n*BigInt(r)-1n)-1n?i:i-BigInt(`0x${"f".padStart(2*r,"f")}`)-1n}function a(e,t={}){return Number(o(e,t))}},4431:function(e,t,n){n.d(t,{O0:function(){return l},nr:function(){return p},qX:function(){return d}});var i=n(1966),r=n(7559),s=n(10),o=n(8656),a=n(6137);let u=new TextEncoder;function l(e,t={}){return"number"==typeof e||"bigint"==typeof e?p((0,a.eC)(e,t)):"boolean"==typeof e?function(e,t={}){let n=new Uint8Array(1);return(n[0]=Number(e),"number"==typeof t.size)?((0,o.Yf)(n,{size:t.size}),(0,s.vk)(n,{size:t.size})):n}(e,t):(0,r.v)(e)?p(e,t):d(e,t)}let c={zero:48,nine:57,A:65,F:70,a:97,f:102};function f(e){return e>=c.zero&&e<=c.nine?e-c.zero:e>=c.A&&e<=c.F?e-(c.A-10):e>=c.a&&e<=c.f?e-(c.a-10):void 0}function p(e,t={}){let n=e;t.size&&((0,o.Yf)(n,{size:t.size}),n=(0,s.vk)(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);let a=r.length/2,u=new Uint8Array(a);for(let e=0,t=0;e<a;e++){let n=f(r.charCodeAt(t++)),s=f(r.charCodeAt(t++));if(void 0===n||void 0===s)throw new i.G(`Invalid byte sequence ("${r[t-2]}${r[t-1]}" in "${r}").`);u[e]=16*n+s}return u}function d(e,t={}){let n=u.encode(e);return"number"==typeof t.size?((0,o.Yf)(n,{size:t.size}),(0,s.vk)(n,{dir:"right",size:t.size})):n}},6137:function(e,t,n){n.d(t,{NC:function(){return a},ci:function(){return u},eC:function(){return l}});var i=n(2033),r=n(10),s=n(8656);let o=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function a(e,t={}){return"number"==typeof e||"bigint"==typeof e?l(e,t):"string"==typeof e?function(e,t={}){return u(c.encode(e),t)}(e,t):"boolean"==typeof e?function(e,t={}){let n=`0x${Number(e)}`;return"number"==typeof t.size?((0,s.Yf)(n,{size:t.size}),(0,r.vk)(n,{size:t.size})):n}(e,t):u(e,t)}function u(e,t={}){let n="";for(let t=0;t<e.length;t++)n+=o[e[t]];let i=`0x${n}`;return"number"==typeof t.size?((0,s.Yf)(i,{size:t.size}),(0,r.vk)(i,{dir:"right",size:t.size})):i}function l(e,t={}){let n;let{signed:s,size:o}=t,a=BigInt(e);o?n=s?(1n<<8n*BigInt(o)-1n)-1n:2n**(8n*BigInt(o))-1n:"number"==typeof e&&(n=BigInt(Number.MAX_SAFE_INTEGER));let u="bigint"==typeof n&&s?-n-1n:0;if(n&&a>n||a<u){let t="bigint"==typeof e?"n":"";throw new i.J5({max:n?`${n}${t}`:void 0,min:`${u}${t}`,signed:s,size:o,value:`${e}${t}`})}let l=`0x${(s&&a<0?(1n<<BigInt(8*o))+BigInt(a):a).toString(16)}`;return o?(0,r.vk)(l,{size:o}):l}let c=new TextEncoder},5844:function(e,t,n){function i(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, not ${e}`)}function r(e,...t){if(!(e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function s(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}n.d(t,{w:function(){return N}});let o=BigInt(4294967296-1),a=BigInt(32),u=(e,t,n)=>e<<n|t>>>32-n,l=(e,t,n)=>t<<n|e>>>32-n,c=(e,t,n)=>t<<n-32|e>>>64-n,f=(e,t,n)=>e<<n-32|t>>>64-n,p=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),d=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],h=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function y(e){for(let t=0;t<e.length;t++)e[t]=h(e[t])}function m(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}(e)),r(e),e}class b{clone(){return this._cloneInto()}}let g=[],w=[],v=[],$=BigInt(0),x=BigInt(1),z=BigInt(2),P=BigInt(7),I=BigInt(256),A=BigInt(113);for(let e=0,t=x,n=1,i=0;e<24;e++){[n,i]=[i,(2*n+3*i)%5],g.push(2*(5*i+n)),w.push((e+1)*(e+2)/2%64);let r=$;for(let e=0;e<7;e++)(t=(t<<x^(t>>P)*A)%I)&z&&(r^=x<<(x<<BigInt(e))-x);v.push(r)}let[O,B]=function(e,t=!1){let n=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let r=0;r<e.length;r++){let{h:s,l:u}=function(e,t=!1){return t?{h:Number(e&o),l:Number(e>>a&o)}:{h:0|Number(e>>a&o),l:0|Number(e&o)}}(e[r],t);[n[r],i[r]]=[s,u]}return[n,i]}(v,!0),M=(e,t,n)=>n>32?c(e,t,n):u(e,t,n),E=(e,t,n)=>n>32?f(e,t,n):l(e,t,n);class U extends b{constructor(e,t,n,r=!1,s=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=r,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,i(n),0>=this.blockLen||this.blockLen>=200)throw Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=p(this.state)}keccak(){d||y(this.state32),function(e,t=24){let n=new Uint32Array(10);for(let i=24-t;i<24;i++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let i=(t+8)%10,r=(t+2)%10,s=n[r],o=n[r+1],a=M(s,o,1)^n[i],u=E(s,o,1)^n[i+1];for(let n=0;n<50;n+=10)e[t+n]^=a,e[t+n+1]^=u}let t=e[2],r=e[3];for(let n=0;n<24;n++){let i=w[n],s=M(t,r,i),o=E(t,r,i),a=g[n];t=e[a],r=e[a+1],e[a]=s,e[a+1]=o}for(let t=0;t<50;t+=10){for(let i=0;i<10;i++)n[i]=e[t+i];for(let i=0;i<10;i++)e[t+i]^=~n[(i+2)%10]&n[(i+4)%10]}e[0]^=O[i],e[1]^=B[i]}n.fill(0)}(this.state32,this.rounds),d||y(this.state32),this.posOut=0,this.pos=0}update(e){s(this);let{blockLen:t,state:n}=this,i=(e=m(e)).length;for(let r=0;r<i;){let s=Math.min(t-this.pos,i-r);for(let t=0;t<s;t++)n[this.pos++]^=e[r++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:i}=this;e[n]^=t,(128&t)!=0&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){s(this,!1),r(e),this.finish();let t=this.state,{blockLen:n}=this;for(let i=0,r=e.length;i<r;){this.posOut>=n&&this.keccak();let s=Math.min(n-this.posOut,r-i);e.set(t.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return i(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(!function(e,t){r(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least ${n}`)}(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:n,outputLen:i,rounds:r,enableXOF:s}=this;return e||(e=new U(t,n,i,s,r)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=r,e.suffix=n,e.outputLen=i,e.enableXOF=s,e.destroyed=this.destroyed,e}}let k=function(e){let t=t=>e().update(m(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}(()=>new U(136,1,32));var S=n(7559),j=n(4431),_=n(6137);function N(e,t){let n=k((0,S.v)(e,{strict:!1})?(0,j.O0)(e):e);return"bytes"===(t||"hex")?n:(0,_.NC)(n)}},5624:function(e,t,n){n.d(t,{r:function(){return f}});var i=n(4431),r=n(5844);let s=e=>(0,r.w)((0,i.O0)(e));var o=n(1196);let a=/^tuple(?<array>(\[(\d*)\])*)$/;function u(e){let t="",n=e.length;for(let i=0;i<n;i++)t+=function e(t){let n=t.type;if(a.test(t.type)&&"components"in t){n="(";let i=t.components.length;for(let r=0;r<i;r++)n+=e(t.components[r]),r<i-1&&(n+=", ");let r=(0,o.Zw)(a,t.type);return n+=`)${r?.array??""}`,e({...t,type:n})}return("indexed"in t&&t.indexed&&(n=`${n} indexed`),t.name)?`${n} ${t.name}`:n}(e[i]),i!==n-1&&(t+=", ");return t}var l=n(1966);let c=e=>(function(e){let t=!0,n="",i=0,r="",s=!1;for(let o=0;o<e.length;o++){let a=e[o];if(["(",")",","].includes(a)&&(t=!0),"("===a&&i++,")"===a&&i--,t){if(0===i){if(" "===a&&["event","function",""].includes(r))r="";else if(r+=a,")"===a){s=!0;break}continue}if(" "===a){","!==e[o-1]&&","!==n&&",("!==n&&(n="",t=!1);continue}r+=a,n+=a}}if(!s)throw new l.G("Unable to normalize signature.");return r})("string"==typeof e?e:"function"===e.type?`function ${e.name}(${u(e.inputs)})${e.stateMutability&&"nonpayable"!==e.stateMutability?` ${e.stateMutability}`:""}${e.outputs.length?` returns (${u(e.outputs)})`:""}`:"event"===e.type?`event ${e.name}(${u(e.inputs)})`:"error"===e.type?`error ${e.name}(${u(e.inputs)})`:"constructor"===e.type?`constructor(${u(e.inputs)})${"payable"===e.stateMutability?" payable":""}`:"fallback"===e.type?"fallback()":"receive() external payable");function f(e){return s(c(e))}}}]);