@lodestar/light-client 1.41.0 → 1.41.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ let be,Fg,Te,ao,so,ho,lo,co,sR=(async()=>{function Do(I){return{all:I=I||new Map
2
2
 
3
3
  `+I.mark.snippet),B+" "+g):B}function yC(I,A){Error.call(this),this.name="YAMLException",this.reason=I,this.mark=A,this.message=or(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}yC.prototype=Object.create(Error.prototype),yC.prototype.constructor=yC,yC.prototype.toString=function(I){return this.name+": "+or(this,I)};var nB=yC,bD=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],TD=["scalar","sequence","mapping"];function qD(I){var A={};return I!==null&&Object.keys(I).forEach(function(g){I[g].forEach(function(B){A[String(B)]=g})}),A}function VD(I,A){if(A=A||{},Object.keys(A).forEach(function(g){if(bD.indexOf(g)===-1)throw new nB('Unknown option "'+g+'" is met in definition of "'+I+'" YAML type.')}),this.options=A,this.tag=I,this.kind=A.kind||null,this.resolve=A.resolve||function(){return!0},this.construct=A.construct||function(g){return g},this.instanceOf=A.instanceOf||null,this.predicate=A.predicate||null,this.represent=A.represent||null,this.representName=A.representName||null,this.defaultStyle=A.defaultStyle||null,this.multi=A.multi||!1,this.styleAliases=qD(A.styleAliases||null),TD.indexOf(this.kind)===-1)throw new nB('Unknown kind "'+this.kind+'" is specified for "'+I+'" YAML type.')}var eI=VD;function rr(I,A){var g=[];return I[A].forEach(function(B){var e=g.length;g.forEach(function(Q,C){Q.tag===B.tag&&Q.kind===B.kind&&Q.multi===B.multi&&(e=C)}),g[e]=B}),g}function jD(){var I={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},A,g;function B(e){e.multi?(I.multi[e.kind].push(e),I.multi.fallback.push(e)):I[e.kind][e.tag]=I.fallback[e.tag]=e}for(A=0,g=arguments.length;A<g;A+=1)arguments[A].forEach(B);return I}function Qi(I){return this.extend(I)}Qi.prototype.extend=function(I){var A=[],g=[];if(I instanceof eI)g.push(I);else if(Array.isArray(I))g=g.concat(I);else if(I&&(Array.isArray(I.implicit)||Array.isArray(I.explicit)))I.implicit&&(A=A.concat(I.implicit)),I.explicit&&(g=g.concat(I.explicit));else throw new nB("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");A.forEach(function(e){if(!(e instanceof eI))throw new nB("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&e.loadKind!=="scalar")throw new nB("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new nB("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),g.forEach(function(e){if(!(e instanceof eI))throw new nB("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var B=Object.create(Qi.prototype);return B.implicit=(this.implicit||[]).concat(A),B.explicit=(this.explicit||[]).concat(g),B.compiledImplicit=rr(B,"implicit"),B.compiledExplicit=rr(B,"explicit"),B.compiledTypeMap=jD(B.compiledImplicit,B.compiledExplicit),B};var _D=Qi,ZD=new eI("tag:yaml.org,2002:str",{kind:"scalar",construct:function(I){return I!==null?I:""}}),PD=new eI("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(I){return I!==null?I:[]}}),OD=new eI("tag:yaml.org,2002:map",{kind:"mapping",construct:function(I){return I!==null?I:{}}}),nr=new _D({explicit:[ZD,PD,OD]});function xD(I){if(I===null)return!0;var A=I.length;return A===1&&I==="~"||A===4&&(I==="null"||I==="Null"||I==="NULL")}function zD(){return null}function vD(I){return I===null}var ar=new eI("tag:yaml.org,2002:null",{kind:"scalar",resolve:xD,construct:zD,predicate:vD,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function WD(I){if(I===null)return!1;var A=I.length;return A===4&&(I==="true"||I==="True"||I==="TRUE")||A===5&&(I==="false"||I==="False"||I==="FALSE")}function XD(I){return I==="true"||I==="True"||I==="TRUE"}function $D(I){return Object.prototype.toString.call(I)==="[object Boolean]"}var sr=new eI("tag:yaml.org,2002:bool",{kind:"scalar",resolve:WD,construct:XD,predicate:$D,represent:{lowercase:function(I){return I?"true":"false"},uppercase:function(I){return I?"TRUE":"FALSE"},camelcase:function(I){return I?"True":"False"}},defaultStyle:"lowercase"});function AU(I){return 48<=I&&I<=57||65<=I&&I<=70||97<=I&&I<=102}function IU(I){return 48<=I&&I<=55}function gU(I){return 48<=I&&I<=57}function BU(I){if(I===null)return!1;var A=I.length,g=0,B=!1,e;if(!A)return!1;if(e=I[g],(e==="-"||e==="+")&&(e=I[++g]),e==="0"){if(g+1===A)return!0;if(e=I[++g],e==="b"){for(g++;g<A;g++)if(e=I[g],e!=="_"){if(e!=="0"&&e!=="1")return!1;B=!0}return B&&e!=="_"}if(e==="x"){for(g++;g<A;g++)if(e=I[g],e!=="_"){if(!AU(I.charCodeAt(g)))return!1;B=!0}return B&&e!=="_"}if(e==="o"){for(g++;g<A;g++)if(e=I[g],e!=="_"){if(!IU(I.charCodeAt(g)))return!1;B=!0}return B&&e!=="_"}}if(e==="_")return!1;for(;g<A;g++)if(e=I[g],e!=="_"){if(!gU(I.charCodeAt(g)))return!1;B=!0}return!(!B||e==="_")}function CU(I){var A=I,g=1,B;if(A.indexOf("_")!==-1&&(A=A.replace(/_/g,"")),B=A[0],(B==="-"||B==="+")&&(B==="-"&&(g=-1),A=A.slice(1),B=A[0]),A==="0")return 0;if(B==="0"){if(A[1]==="b")return g*parseInt(A.slice(2),2);if(A[1]==="x")return g*parseInt(A.slice(2),16);if(A[1]==="o")return g*parseInt(A.slice(2),8)}return g*parseInt(A,10)}function QU(I){return Object.prototype.toString.call(I)==="[object Number]"&&I%1===0&&!Ci.isNegativeZero(I)}var eU=new eI("tag:yaml.org,2002:int",{kind:"scalar",resolve:BU,construct:CU,predicate:QU,represent:{binary:function(I){return I>=0?"0b"+I.toString(2):"-0b"+I.toString(2).slice(1)},octal:function(I){return I>=0?"0o"+I.toString(8):"-0o"+I.toString(8).slice(1)},decimal:function(I){return I.toString(10)},hexadecimal:function(I){return I>=0?"0x"+I.toString(16).toUpperCase():"-0x"+I.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),iU=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function tU(I){return!(I===null||!iU.test(I)||I[I.length-1]==="_")}function EU(I){var A,g;return A=I.replace(/_/g,"").toLowerCase(),g=A[0]==="-"?-1:1,"+-".indexOf(A[0])>=0&&(A=A.slice(1)),A===".inf"?g===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:A===".nan"?NaN:g*parseFloat(A,10)}var oU=/^[-+]?[0-9]+e/;function rU(I,A){var g;if(isNaN(I))switch(A){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===I)switch(A){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===I)switch(A){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Ci.isNegativeZero(I))return"-0.0";return g=I.toString(10),oU.test(g)?g.replace("e",".e"):g}function nU(I){return Object.prototype.toString.call(I)==="[object Number]"&&(I%1!==0||Ci.isNegativeZero(I))}var hr=new eI("tag:yaml.org,2002:float",{kind:"scalar",resolve:tU,construct:EU,predicate:nU,represent:rU,defaultStyle:"lowercase"}),aU=nr.extend({implicit:[ar,sr,eU,hr]}),sU=aU,lr=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),cr=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function hU(I){return I===null?!1:lr.exec(I)!==null||cr.exec(I)!==null}function lU(I){var A,g,B,e,Q,C,i,o=0,D=null,a,U,J;if(A=lr.exec(I),A===null&&(A=cr.exec(I)),A===null)throw new Error("Date resolve error");if(g=+A[1],B=+A[2]-1,e=+A[3],!A[4])return new Date(Date.UTC(g,B,e));if(Q=+A[4],C=+A[5],i=+A[6],A[7]){for(o=A[7].slice(0,3);o.length<3;)o+="0";o=+o}return A[9]&&(a=+A[10],U=+(A[11]||0),D=(a*60+U)*6e4,A[9]==="-"&&(D=-D)),J=new Date(Date.UTC(g,B,e,Q,C,i,o)),D&&J.setTime(J.getTime()-D),J}function cU(I){return I.toISOString()}var DU=new eI("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:hU,construct:lU,instanceOf:Date,represent:cU});function UU(I){return I==="<<"||I===null}var fU=new eI("tag:yaml.org,2002:merge",{kind:"scalar",resolve:UU}),ei=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
4
4
  \r`;function SU(I){if(I===null)return!1;var A,g,B=0,e=I.length,Q=ei;for(g=0;g<e;g++)if(A=Q.indexOf(I.charAt(g)),!(A>64)){if(A<0)return!1;B+=6}return B%8===0}function wU(I){var A,g,B=I.replace(/[\r\n=]/g,""),e=B.length,Q=ei,C=0,i=[];for(A=0;A<e;A++)A%4===0&&A&&(i.push(C>>16&255),i.push(C>>8&255),i.push(C&255)),C=C<<6|Q.indexOf(B.charAt(A));return g=e%4*6,g===0?(i.push(C>>16&255),i.push(C>>8&255),i.push(C&255)):g===18?(i.push(C>>10&255),i.push(C>>2&255)):g===12&&i.push(C>>4&255),new Uint8Array(i)}function yU(I){var A="",g=0,B,e,Q=I.length,C=ei;for(B=0;B<Q;B++)B%3===0&&B&&(A+=C[g>>18&63],A+=C[g>>12&63],A+=C[g>>6&63],A+=C[g&63]),g=(g<<8)+I[B];return e=Q%3,e===0?(A+=C[g>>18&63],A+=C[g>>12&63],A+=C[g>>6&63],A+=C[g&63]):e===2?(A+=C[g>>10&63],A+=C[g>>4&63],A+=C[g<<2&63],A+=C[64]):e===1&&(A+=C[g>>2&63],A+=C[g<<4&63],A+=C[64],A+=C[64]),A}function dU(I){return Object.prototype.toString.call(I)==="[object Uint8Array]"}var NU=new eI("tag:yaml.org,2002:binary",{kind:"scalar",resolve:SU,construct:wU,predicate:dU,represent:yU}),uU=Object.prototype.hasOwnProperty,RU=Object.prototype.toString;function GU(I){if(I===null)return!0;var A=[],g,B,e,Q,C,i=I;for(g=0,B=i.length;g<B;g+=1){if(e=i[g],C=!1,RU.call(e)!=="[object Object]")return!1;for(Q in e)if(uU.call(e,Q))if(!C)C=!0;else return!1;if(!C)return!1;if(A.indexOf(Q)===-1)A.push(Q);else return!1}return!0}function kU(I){return I!==null?I:[]}var FU=new eI("tag:yaml.org,2002:omap",{kind:"sequence",resolve:GU,construct:kU}),JU=Object.prototype.toString;function pU(I){if(I===null)return!0;var A,g,B,e,Q,C=I;for(Q=new Array(C.length),A=0,g=C.length;A<g;A+=1){if(B=C[A],JU.call(B)!=="[object Object]"||(e=Object.keys(B),e.length!==1))return!1;Q[A]=[e[0],B[e[0]]]}return!0}function HU(I){if(I===null)return[];var A,g,B,e,Q,C=I;for(Q=new Array(C.length),A=0,g=C.length;A<g;A+=1)B=C[A],e=Object.keys(B),Q[A]=[e[0],B[e[0]]];return Q}var MU=new eI("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:pU,construct:HU}),mU=Object.prototype.hasOwnProperty;function LU(I){if(I===null)return!0;var A,g=I;for(A in g)if(mU.call(g,A)&&g[A]!==null)return!1;return!0}function KU(I){return I!==null?I:{}}var YU=new eI("tag:yaml.org,2002:set",{kind:"mapping",resolve:LU,construct:KU});sU.extend({implicit:[DU,fU],explicit:[NU,FU,MU,YU]});function Dr(I){return I===48?"\0":I===97?"\x07":I===98?"\b":I===116||I===9?" ":I===110?`
5
- `:I===118?"\v":I===102?"\f":I===114?"\r":I===101?"\x1B":I===32?" ":I===34?'"':I===47?"/":I===92?"\\":I===78?"\x85":I===95?"\xA0":I===76?"\u2028":I===80?"\u2029":""}for(var bU=new Array(256),TU=new Array(256),ZB=0;ZB<256;ZB++)bU[ZB]=Dr(ZB)?1:0,TU[ZB]=Dr(ZB);var qU=eI,VU=nr,jU={float:hr,null:ar,bool:sr},fQ={Type:qU,types:jU};const{Type:_U}=fQ;function ZU(I){return 48<=I&&I<=57||65<=I&&I<=70||97<=I&&I<=102}function PU(I){return 48<=I&&I<=55}function OU(I){return 48<=I&&I<=57}function xU(I){if(I===null)return!1;const A=I.length;let g,B=0,e=!1;if(!A)return!1;if(g=I[B],(g==="-"||g==="+")&&(g=I[++B]),g==="0"){if(B+1===A)return!0;if(g=I[++B],g==="b"){for(B++;B<A;B++)if(g=I[B],g!=="_"){if(g!=="0"&&g!=="1")return!1;e=!0}return e&&g!=="_"}if(g==="x"){for(B++;B<A;B++)if(g=I[B],g!=="_"){if(!ZU(I.charCodeAt(B)))return!1;e=!0}return e&&g!=="_"}for(;B<A;B++)if(g=I[B],g!=="_"){if(!PU(I.charCodeAt(B)))return!1;e=!0}return e&&g!=="_"}if(g==="_")return!1;for(;B<A;B++)if(g=I[B],g!=="_"){if(g===":")break;if(!OU(I.charCodeAt(B)))return!1;e=!0}return!e||g==="_"?!1:g!==":"?!0:/^(:[0-5]?[0-9])+$/.test(I.slice(B))}function zU(I){let A=I,g=1,B,e;const Q=[];if(A.indexOf("_")!==-1&&(A=A.replace(/_/g,"")),B=A[0],(B==="-"||B==="+")&&(B==="-"&&(g=-1),A=A.slice(1),B=A[0]),A==="0")return BigInt(0);if(B==="0")return A[1]==="b"||A[1]==="x"?BigInt(A)*BigInt(g):BigInt("0o"+A)*BigInt(g);if(A.indexOf(":")!==-1){for(const C of A.split(":"))Q.unshift(parseInt(C,10));A=BigInt(0),e=BigInt(1);for(const C of Q)A=(BigInt(A)+BigInt(e))*BigInt(C),e=BigInt(e)*BigInt(60);return A*BigInt(g)}return BigInt(A)*BigInt(g)}function vU(I){return typeof I=="bigint"||typeof I=="number"}const WU=new _U("tag:yaml.org,2002:int",{kind:"scalar",resolve:xU,construct:zU,predicate:vU,instanceOf:BigInt,represent:{binary:function(I){return I>=0?"0b"+I.toString(2):"-0b"+I.toString(2).slice(1)},octal:function(I){return I>=0?"0"+I.toString(8):"-0"+I.toString(8).slice(1)},decimal:function(I){return I.toString(10)},hexadecimal:function(I){return I>=0?"0x"+I.toString(16).toUpperCase():"-0x"+I.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}});VU.extend({implicit:[fQ.types.null,fQ.types.bool,WU,fQ.types.float],explicit:[]});const aB={PRESET_BASE:KI.mainnet,CONFIG_NAME:"mainnet",TERMINAL_TOTAL_DIFFICULTY:BigInt("58750000000000000000000"),TERMINAL_BLOCK_HASH:sA("0x0000000000000000000000000000000000000000000000000000000000000000"),TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH:1/0,MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:16384,MIN_GENESIS_TIME:1606824e3,GENESIS_FORK_VERSION:sA("0x00000000"),GENESIS_DELAY:604800,ALTAIR_FORK_VERSION:sA("0x01000000"),ALTAIR_FORK_EPOCH:74240,BELLATRIX_FORK_VERSION:sA("0x02000000"),BELLATRIX_FORK_EPOCH:144896,CAPELLA_FORK_VERSION:sA("0x03000000"),CAPELLA_FORK_EPOCH:194048,DENEB_FORK_VERSION:sA("0x04000000"),DENEB_FORK_EPOCH:269568,ELECTRA_FORK_VERSION:sA("0x05000000"),ELECTRA_FORK_EPOCH:364032,FULU_FORK_VERSION:sA("0x06000000"),FULU_FORK_EPOCH:411392,GLOAS_FORK_VERSION:sA("0x07000000"),GLOAS_FORK_EPOCH:1/0,SECONDS_PER_SLOT:12,SLOT_DURATION_MS:12e3,SECONDS_PER_ETH1_BLOCK:14,MIN_VALIDATOR_WITHDRAWABILITY_DELAY:256,MIN_BUILDER_WITHDRAWABILITY_DELAY:64,SHARD_COMMITTEE_PERIOD:256,ETH1_FOLLOW_DISTANCE:2048,PROPOSER_REORG_CUTOFF_BPS:1667,ATTESTATION_DUE_BPS:3333,AGGREGATE_DUE_BPS:6667,SYNC_MESSAGE_DUE_BPS:3333,CONTRIBUTION_DUE_BPS:6667,ATTESTATION_DUE_BPS_GLOAS:2500,AGGREGATE_DUE_BPS_GLOAS:5e3,SYNC_MESSAGE_DUE_BPS_GLOAS:2500,CONTRIBUTION_DUE_BPS_GLOAS:5e3,PAYLOAD_ATTESTATION_DUE_BPS:7500,INACTIVITY_SCORE_BIAS:4,INACTIVITY_SCORE_RECOVERY_RATE:16,EJECTION_BALANCE:16e9,MIN_PER_EPOCH_CHURN_LIMIT:4,MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT:8,CHURN_LIMIT_QUOTIENT:65536,PROPOSER_SCORE_BOOST:40,REORG_HEAD_WEIGHT_THRESHOLD:20,REORG_PARENT_WEIGHT_THRESHOLD:160,REORG_MAX_EPOCHS_SINCE_FINALIZATION:2,DEPOSIT_CHAIN_ID:1,DEPOSIT_NETWORK_ID:1,DEPOSIT_CONTRACT_ADDRESS:sA("0x00000000219ab540356cBB839Cbe05303d7705Fa"),MAX_PAYLOAD_SIZE:10485760,MAX_REQUEST_BLOCKS:1024,EPOCHS_PER_SUBNET_SUBSCRIPTION:256,MIN_EPOCHS_FOR_BLOCK_REQUESTS:33024,ATTESTATION_PROPAGATION_SLOT_RANGE:32,MAXIMUM_GOSSIP_CLOCK_DISPARITY:500,MESSAGE_DOMAIN_INVALID_SNAPPY:sA("0x00000000"),MESSAGE_DOMAIN_VALID_SNAPPY:sA("0x01000000"),SUBNETS_PER_NODE:2,MAX_REQUEST_BLOCKS_DENEB:128,MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS:4096,BLOB_SIDECAR_SUBNET_COUNT:6,MAX_BLOBS_PER_BLOCK:6,MAX_REQUEST_BLOB_SIDECARS:768,MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT:256e9,MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA:128e9,BLOB_SIDECAR_SUBNET_COUNT_ELECTRA:9,MAX_BLOBS_PER_BLOCK_ELECTRA:9,MAX_REQUEST_BLOB_SIDECARS_ELECTRA:1152,NUMBER_OF_CUSTODY_GROUPS:128,DATA_COLUMN_SIDECAR_SUBNET_COUNT:128,MAX_REQUEST_DATA_COLUMN_SIDECARS:16384,SAMPLES_PER_SLOT:8,CUSTODY_REQUIREMENT:4,VALIDATOR_CUSTODY_REQUIREMENT:8,BALANCE_PER_ADDITIONAL_CUSTODY_GROUP:32e9,MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS:4096,MAX_REQUEST_PAYLOADS:128,BLOB_SCHEDULE:[{EPOCH:412672,MAX_BLOBS_PER_BLOCK:15},{EPOCH:419072,MAX_BLOBS_PER_BLOCK:21}]},XU={PRESET_BASE:KI.minimal,CONFIG_NAME:"minimal",TERMINAL_TOTAL_DIFFICULTY:BigInt("115792089237316195423570985008687907853269984665640564039457584007913129638912"),TERMINAL_BLOCK_HASH:sA("0x0000000000000000000000000000000000000000000000000000000000000000"),TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH:1/0,MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:64,MIN_GENESIS_TIME:1578009600,GENESIS_FORK_VERSION:sA("0x00000001"),GENESIS_DELAY:300,ALTAIR_FORK_VERSION:sA("0x01000001"),ALTAIR_FORK_EPOCH:74240,BELLATRIX_FORK_VERSION:sA("0x02000001"),BELLATRIX_FORK_EPOCH:1/0,CAPELLA_FORK_VERSION:sA("0x03000001"),CAPELLA_FORK_EPOCH:1/0,DENEB_FORK_VERSION:sA("0x04000001"),DENEB_FORK_EPOCH:1/0,ELECTRA_FORK_VERSION:sA("0x05000001"),ELECTRA_FORK_EPOCH:1/0,FULU_FORK_VERSION:sA("0x06000001"),FULU_FORK_EPOCH:1/0,GLOAS_FORK_VERSION:sA("0x07000001"),GLOAS_FORK_EPOCH:1/0,SECONDS_PER_SLOT:6,SLOT_DURATION_MS:6e3,SECONDS_PER_ETH1_BLOCK:14,MIN_VALIDATOR_WITHDRAWABILITY_DELAY:256,MIN_BUILDER_WITHDRAWABILITY_DELAY:2,SHARD_COMMITTEE_PERIOD:64,ETH1_FOLLOW_DISTANCE:16,PROPOSER_REORG_CUTOFF_BPS:1667,ATTESTATION_DUE_BPS:3333,AGGREGATE_DUE_BPS:6667,SYNC_MESSAGE_DUE_BPS:3333,CONTRIBUTION_DUE_BPS:6667,ATTESTATION_DUE_BPS_GLOAS:2500,AGGREGATE_DUE_BPS_GLOAS:5e3,SYNC_MESSAGE_DUE_BPS_GLOAS:2500,CONTRIBUTION_DUE_BPS_GLOAS:5e3,PAYLOAD_ATTESTATION_DUE_BPS:7500,INACTIVITY_SCORE_BIAS:4,INACTIVITY_SCORE_RECOVERY_RATE:16,EJECTION_BALANCE:16e9,MIN_PER_EPOCH_CHURN_LIMIT:2,MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT:4,CHURN_LIMIT_QUOTIENT:32,PROPOSER_SCORE_BOOST:40,REORG_HEAD_WEIGHT_THRESHOLD:20,REORG_PARENT_WEIGHT_THRESHOLD:160,REORG_MAX_EPOCHS_SINCE_FINALIZATION:2,DEPOSIT_CHAIN_ID:5,DEPOSIT_NETWORK_ID:5,DEPOSIT_CONTRACT_ADDRESS:sA("0x1234567890123456789012345678901234567890"),MAX_PAYLOAD_SIZE:10485760,MAX_REQUEST_BLOCKS:1024,EPOCHS_PER_SUBNET_SUBSCRIPTION:256,MIN_EPOCHS_FOR_BLOCK_REQUESTS:272,ATTESTATION_PROPAGATION_SLOT_RANGE:32,MAXIMUM_GOSSIP_CLOCK_DISPARITY:500,MESSAGE_DOMAIN_INVALID_SNAPPY:sA("0x00000000"),MESSAGE_DOMAIN_VALID_SNAPPY:sA("0x01000000"),SUBNETS_PER_NODE:2,MAX_REQUEST_BLOCKS_DENEB:128,MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS:4096,BLOB_SIDECAR_SUBNET_COUNT:6,MAX_BLOBS_PER_BLOCK:6,MAX_REQUEST_BLOB_SIDECARS:768,MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT:128e9,MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA:64e9,BLOB_SIDECAR_SUBNET_COUNT_ELECTRA:9,MAX_BLOBS_PER_BLOCK_ELECTRA:9,MAX_REQUEST_BLOB_SIDECARS_ELECTRA:1152,NUMBER_OF_CUSTODY_GROUPS:128,DATA_COLUMN_SIDECAR_SUBNET_COUNT:128,MAX_REQUEST_DATA_COLUMN_SIDECARS:16384,SAMPLES_PER_SLOT:8,CUSTODY_REQUIREMENT:4,VALIDATOR_CUSTODY_REQUIREMENT:8,BALANCE_PER_ADDITIONAL_CUSTODY_GROUP:32e9,MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS:4096,MAX_REQUEST_PAYLOADS:128,BLOB_SCHEDULE:[]};let SQ;switch(sQ){case KI.minimal:SQ=XU;break;case KI.mainnet:SQ=aB;break;default:SQ=aB}function $U(I){const A={...SQ,...I};if(I.SLOT_DURATION_MS===void 0&&(A.SLOT_DURATION_MS=A.SECONDS_PER_SLOT*1e3),A.PRESET_BASE!==sQ)throw new Error(`Can only create a config for the active preset: ACTIVE_PRESET=${sQ} PRESET_BASE=${A.PRESET_BASE}`);return A}function mg(I,A){const g=BigInt(1)<<BigInt(I);if(A>=g)throw new Error(`index ${A} too large for depth ${I}`);return g|A}function ii(I,A){const g=A?Number(A).toString(2):"";if(g.length>I)throw new Error("index too large for depth");return`1${g.padStart(I,"0")}`}function ti(I){if(typeof I=="string"){if(I.length===0)throw new Error(wQ);return I}if(I<1)throw new Error(wQ);return I.toString(2)}const wQ="Invalid gindex";function Af(I){let A;if(typeof I=="string"){if(!I.length)throw new Error(wQ);A=I}else{if(I<1)throw new Error(wQ);A=I.toString(2)}let g=1;const B=()=>{if(g===A.length)return{done:!0,value:void 0};const e=Number(A[g]);return g++,{done:!1,value:e}};return{[Symbol.iterator](){return{next:B}},remainingBitLength(){return A.length-g}}}function yI(I){return BigInt(I.reduce((A,g)=>A+g.toString(2).slice(1),"0b1"))}function If(I){return I instanceof Uint8Array||ArrayBuffer.isView(I)&&I.constructor.name==="Uint8Array"}function Ei(I,...A){if(!If(I))throw new Error("Uint8Array expected");if(A.length>0&&!A.includes(I.length))throw new Error("Uint8Array expected of length "+A+", got length="+I.length)}function Ur(I,A=!0){if(I.destroyed)throw new Error("Hash instance has been destroyed");if(A&&I.finished)throw new Error("Hash#digest() has already been called")}function gf(I,A){Ei(I);const g=A.outputLen;if(I.length<g)throw new Error("digestInto() expects output buffer of length at least "+g)}function oi(...I){for(let A=0;A<I.length;A++)I[A].fill(0)}function ri(I){return new DataView(I.buffer,I.byteOffset,I.byteLength)}function Qg(I,A){return I<<32-A|I>>>A}function Bf(I){if(typeof I!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(I))}function fr(I){return typeof I=="string"&&(I=Bf(I)),Ei(I),I}let Cf=class{};function Qf(I){const A=B=>I().update(fr(B)).digest(),g=I();return A.outputLen=g.outputLen,A.blockLen=g.blockLen,A.create=()=>I(),A}function ef(I,A,g,B){if(typeof I.setBigUint64=="function")return I.setBigUint64(A,g,B);const e=BigInt(32),Q=BigInt(4294967295),C=Number(g>>e&Q),i=Number(g&Q),o=B?4:0,D=B?0:4;I.setUint32(A+o,C,B),I.setUint32(A+D,i,B)}function tf(I,A,g){return I&A^~I&g}function Ef(I,A,g){return I&A^I&g^A&g}class of extends Cf{constructor(A,g,B,e){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=A,this.outputLen=g,this.padOffset=B,this.isLE=e,this.buffer=new Uint8Array(A),this.view=ri(this.buffer)}update(A){Ur(this),A=fr(A),Ei(A);const{view:g,buffer:B,blockLen:e}=this,Q=A.length;for(let C=0;C<Q;){const i=Math.min(e-this.pos,Q-C);if(i===e){const o=ri(A);for(;e<=Q-C;C+=e)this.process(o,C);continue}B.set(A.subarray(C,C+i),this.pos),this.pos+=i,C+=i,this.pos===e&&(this.process(g,0),this.pos=0)}return this.length+=A.length,this.roundClean(),this}digestInto(A){Ur(this),gf(A,this),this.finished=!0;const{buffer:g,view:B,blockLen:e,isLE:Q}=this;let{pos:C}=this;g[C++]=128,oi(this.buffer.subarray(C)),this.padOffset>e-C&&(this.process(B,0),C=0);for(let U=C;U<e;U++)g[U]=0;ef(B,e-8,BigInt(this.length*8),Q),this.process(B,0);const i=ri(A),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const D=o/4,a=this.get();if(D>a.length)throw new Error("_sha2: outputLen bigger than state");for(let U=0;U<D;U++)i.setUint32(4*U,a[U],Q)}digest(){const{buffer:A,outputLen:g}=this;this.digestInto(A);const B=A.slice(0,g);return this.destroy(),B}_cloneInto(A){A||(A=new this.constructor),A.set(...this.get());const{blockLen:g,buffer:B,length:e,finished:Q,destroyed:C,pos:i}=this;return A.destroyed=C,A.finished=Q,A.length=e,A.pos=i,e%g&&A.buffer.set(B),A}clone(){return this._cloneInto()}}const Lg=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),rf=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]),Kg=new Uint32Array(64);class nf extends of{constructor(A=32){super(64,A,8,!1),this.A=Lg[0]|0,this.B=Lg[1]|0,this.C=Lg[2]|0,this.D=Lg[3]|0,this.E=Lg[4]|0,this.F=Lg[5]|0,this.G=Lg[6]|0,this.H=Lg[7]|0}get(){const{A,B:g,C:B,D:e,E:Q,F:C,G:i,H:o}=this;return[A,g,B,e,Q,C,i,o]}set(A,g,B,e,Q,C,i,o){this.A=A|0,this.B=g|0,this.C=B|0,this.D=e|0,this.E=Q|0,this.F=C|0,this.G=i|0,this.H=o|0}process(A,g){for(let U=0;U<16;U++,g+=4)Kg[U]=A.getUint32(g,!1);for(let U=16;U<64;U++){const J=Kg[U-15],f=Kg[U-2],y=Qg(J,7)^Qg(J,18)^J>>>3,S=Qg(f,17)^Qg(f,19)^f>>>10;Kg[U]=S+Kg[U-7]+y+Kg[U-16]|0}let{A:B,B:e,C:Q,D:C,E:i,F:o,G:D,H:a}=this;for(let U=0;U<64;U++){const J=Qg(i,6)^Qg(i,11)^Qg(i,25),f=a+J+tf(i,o,D)+rf[U]+Kg[U]|0,y=(Qg(B,2)^Qg(B,13)^Qg(B,22))+Ef(B,e,Q)|0;a=D,D=o,o=i,i=C+f|0,C=Q,Q=e,e=B,B=f+y|0}B=B+this.A|0,e=e+this.B|0,Q=Q+this.C|0,C=C+this.D|0,i=i+this.E|0,o=o+this.F|0,D=D+this.G|0,a=a+this.H|0,this.set(B,e,Q,C,i,o,D,a)}roundClean(){oi(Kg)}destroy(){this.set(0,0,0,0,0,0,0,0),oi(this.buffer)}}const af=Qf(()=>new nf),Sr=af,PB=[new Uint8Array(32)];function OB(I){if(I>=PB.length)for(let A=PB.length;A<=I;A++)PB[A]=Sr.create().update(PB[A-1]).update(PB[A-1]).digest();return PB[I]}function dC(I){const A=new Uint8Array(32);return cD(I,A,0),A}function sf(I){return DD(I,0)}const aI=64;function hf(I,A,g,B,e){if(A<1)throw new Error(`Invalid padFor, expect to be greater than 0, got ${A}`);const Q=Math.ceil(Math.log2(A));if(I.length===0){g.set(OB(Q),B);return}if(I.length%32!==0)throw new Error(`Invalid input length, expect to be multiple of 32 bytes, got ${I.length}`);if(A>1&&I.length%aI!==0)throw new Error(`Invalid input length, expect to be multiple of 64 bytes, got ${I.length}, padFor=${A}`);let C=I.length,i=Math.floor(C/2),o=I;for(let D=0;D<Q;D++){const a=I.subarray(0,i);e(o,a),Math.floor(i/32)%2===1&&D<Q-1?(C=i+32,o=I.subarray(0,C),o.set(OB(D+1),i)):(o=a,C=i),i=Math.floor(C/2)}g.set(o.subarray(0,32),B)}function lf(I,A,g,B,e,Q,C){if(g<1)throw new Error(`Invalid padFor, expect to be at least 1, got ${g}`);if(A>I.length)throw new Error(`Invalid blockLimit, expect to be less than or equal blocks.length ${I.length}, got ${A}`);const i=Math.ceil(Math.log2(g));if(A===0){B.set(OB(i),e);return}for(const f of I)if(f.length!==aI)throw new Error(`Invalid block length, expect to be 64 bytes, got ${f.length}`);if(C.length===0||C.length%(4*aI)!==0)throw new Error(`Invalid buffer length, expect to be multiple of 64 bytes, got ${C.length}`);const o=Math.floor(C.length/aI),D=Math.floor(o/2);let a=C,U=C.subarray(0,D*aI),J=A;for(let f=0;f<i;f++){let y=0;const S=Math.floor(J/o);for(let N=0;N<S;N++){for(let G=0;G<o;G++){const H=N*o+G;a.set(I[H],G*aI)}Q(a,U);for(let G=0;G<D;G++)I[y].set(U.subarray(G*aI,(G+1)*aI)),y++}const R=J%o;a=C.subarray(0,R*aI),U=C.subarray(0,Math.floor(a.length/2));for(let N=Math.floor(J/o)*o;N<J;N++)a.set(I[N],N%o*aI);Q(a,U);for(let N=0;N<Math.floor(U.length/aI);N++)I[y].set(U.subarray(N*aI,(N+1)*aI)),y++;U.length%aI!==0&&(I[y].set(U.subarray(U.length-32,U.length),0),I[y].set(OB(f+1),32),y++),J=y,a=C.subarray(0,J*aI),U=C.subarray(0,Math.floor(a.length/2))}B.set(I[0].subarray(0,32),e)}function cf(I,A,g){let B=I.length;const e=Math.pow(2,A)*32;if(A<1)throw new Error(`Invalid nLevel, expect to be greater than 0, got ${A}`);if(B%e!==0)throw new Error(`Invalid input length, expect to be multiple of ${e} for nLevel ${A}, got ${B}`);let Q=Math.floor(B/2),C=I;for(let i=A;i>0;i--){const o=C.subarray(0,Q);g(C,o),C=o,B=Q,Q=Math.floor(B/2)}return C}const ni=new Uint8Array(64),ai=(I,A)=>Sr.create().update(I).update(A).digest(),NC=(I,A)=>{if(I.length%64!==0)throw new Error(`Invalid input length ${I.length}`);if(I.length!==A.length*2)throw new Error(`Invalid output length ${A.length}`);const g=Math.floor(I.length/64);for(let B=0;B<g;B++){const e=B*64,Q=I.subarray(e,e+32),C=I.subarray(e+32,e+64),i=ai(Q,C);A.set(i,B*32)}},Df=new Uint8Array(4*aI);let sB={name:"noble",hashInto:NC,digest64:ai,digest64Into:(I,A,g)=>{if(I.length!==32||A.length!==32)throw new Error("Invalid input length");if(g.length!==32)throw new Error("Invalid output length");ni.set(I,0),ni.set(A,32),NC(ni,g)},digest64HashObjects:(I,A,g)=>{gi(ai(dC(I),dC(A)),0,g)},merkleizeBlocksBytes(I,A,g,B){hf(I,A,g,B,NC)},merkleizeBlockArray(I,A,g,B,e){lf(I,A,g,B,e,NC,Df)},digestNLevel(I,A){return cf(I,A,NC)},executeHashComputations:I=>{for(let A=I.length-1;A>=0;A--){const g=I[A];if(!g)throw Error(`no hash computations for level ${A}`);for(const B of g)B.dest.applyHash(dD(B.src0,B.src1))}}};function xB(I,A,g,B){sB.merkleizeBlocksBytes(I,A,g,B)}function wr(I,A,g,B,e){sB.merkleizeBlockArray(I,A,g,B,e)}function Uf(I){sB.executeHashComputations(I)}const yr=2**32;class si{h0;h1;h2;h3;h4;h5;h6;h7;constructor(A,g,B,e,Q,C,i,o){this.h0=A,this.h1=g,this.h2=B,this.h3=e,this.h4=Q,this.h5=C,this.h6=i,this.h7=o}applyHash(A){this.h0=A.h0,this.h1=A.h1,this.h2=A.h2,this.h3=A.h3,this.h4=A.h4,this.h5=A.h5,this.h6=A.h6,this.h7=A.h7}}class _A extends si{_left;_right;constructor(A,g){if(super(null,0,0,0,0,0,0,0),this._left=A,this._right=g,!A)throw new Error("Left node is undefined");if(!g)throw new Error("Right node is undefined")}get rootHashObject(){return this.h0===null&&sB.digest64HashObjects(this.left.rootHashObject,this.right.rootHashObject,this),this}get root(){return dC(this.rootHashObject)}get left(){return this._left}get right(){return this._right}isLeaf(){return!1}}class qA extends si{get rootHashObject(){return this}get root(){return dC(this)}get left(){throw Error("LeafNode has no left node")}get right(){throw Error("LeafNode has no right node")}static fromRoot(A){return qA.fromHashObject(sf(A))}static fromHashObject(A){return new qA(A.h0,A.h1,A.h2,A.h3,A.h4,A.h5,A.h6,A.h7)}static fromZero(){return new qA(0,0,0,0,0,0,0,0)}static fromUint32(A){return new qA(A,0,0,0,0,0,0,0)}clone(){return qA.fromHashObject(this)}isLeaf(){return!0}writeToBytes(A,g,B){A.set(this.root.slice(0,B),g)}getUint(A,g,B){const e=Math.floor(g/4);if(A<4){const Q=g%4*8,C=_I(this,e);return A===1?255&C>>Q:65535&C>>Q}if(A===4)return _I(this,e)>>>0;if(A===8){const Q=_I(this,e),C=_I(this,e+1);return C===0?Q>>>0:C===-1&&Q===-1&&B?1/0:(Q>>>0)+(C>>>0)*yr}throw Error("uintBytes > 8")}getUintBigint(A,g){const B=Math.floor(g/4);if(A<4){const C=g%4*8,i=_I(this,B);return BigInt(A===1?255&i>>C:65535&i>>C)}if(A===4)return BigInt(_I(this,B)>>>0);const e=Math.ceil(A/4);let Q=BigInt(0);for(let C=0;C<e;C++)Q+=BigInt(_I(this,B+C)>>>0)<<BigInt(32*C);return Q}setUint(A,g,B,e){const Q=Math.floor(g/4);if(A<4){const C=g%4*8;let i=_I(this,Q);A===1?(i&=~(255<<C),i|=(255&B)<<C):(i&=~(65535<<C),i|=(65535&B)<<C),lI(this,Q,i)}else if(A===4)lI(this,Q,B);else if(A===8)B===1/0&&e?(lI(this,Q,-1),lI(this,Q+1,-1)):(lI(this,Q,B&4294967295),lI(this,Q+1,B/yr&4294967295));else throw Error("uintBytes > 8")}setUintBigint(A,g,B){const e=Math.floor(g/4);if(A<4){const Q=Number(B),C=g%4*8;let i=_I(this,e);A===1?(i&=~(255<<C),i|=(255&Q)<<C):(i&=~(65535<<C),i|=(65535&Q)<<C),lI(this,e,i)}else if(A===4)lI(this,e,Number(B));else{const Q=e+Math.ceil(A/4);for(let C=e;C<Q;C++)lI(this,C,Number(B&BigInt(4294967295))),B=B>>BigInt(32)}}bitwiseOrUint(A,g,B){const e=Math.floor(g/4);if(A<4){const Q=g%4*8;hi(this,e,B<<Q)}else if(A===4)hi(this,e,B);else{const Q=e+Math.ceil(A/4);for(let C=e;C<Q;C++)hi(this,C,B&4294967295),B>>=32}}}function _I(I,A){if(A===0)return I.h0;if(A===1)return I.h1;if(A===2)return I.h2;if(A===3)return I.h3;if(A===4)return I.h4;if(A===5)return I.h5;if(A===6)return I.h6;if(A===7)return I.h7;throw Error("hIndex > 7")}function lI(I,A,g){if(A===0)I.h0=g;else if(A===1)I.h1=g;else if(A===2)I.h2=g;else if(A===3)I.h3=g;else if(A===4)I.h4=g;else if(A===5)I.h5=g;else if(A===6)I.h6=g;else if(A===7)I.h7=g;else throw Error("hIndex > 7")}function hi(I,A,g){if(A===0)I.h0|=g;else if(A===1)I.h1|=g;else if(A===2)I.h2|=g;else if(A===3)I.h3|=g;else if(A===4)I.h4|=g;else if(A===5)I.h5|=g;else if(A===6)I.h6|=g;else if(A===7)I.h7|=g;else throw Error("hIndex > 7")}class ff{_length;_totalLength;head;tail;pointer;constructor(){this._length=0,this._totalLength=0,this.head={src0:null,src1:null,dest:null,next:null},this.tail=null,this.pointer=null}get length(){return this._length}get totalLength(){return this._totalLength}reset(){this.head.src0=null,this.head.src1=null,this.head.dest=null,this.tail=null,this._length=0,this.pointer=null}push(A,g,B){if(this.tail!==null){let e=this.tail.next;e!==null?(e.src0=A,e.src1=g,e.dest=B):(e={src0:A,src1:g,dest:B,next:null},this.tail.next=e,this._totalLength++),this.tail=e,this._length++;return}this.head.src0=A,this.head.src1=g,this.head.dest=B,this.tail=this.head,this._length=1,this._totalLength===0&&(this._totalLength=1)}clean(){let A=this.tail?.next??null;for(;A!==null&&A.src0!==null;)A.src0=null,A.src1=null,A.dest=null,A=A.next}next(){if(!this.pointer||this.tail===null)return{done:!0,value:void 0};const A=this.pointer,g=A.src0===null;return this.pointer=this.pointer.next,g?{done:!0,value:void 0}:{done:!1,value:A}}[Symbol.iterator](){return this.pointer=this.head,this}toArray(){const A=[];for(const g of this)A.push(g);return A}dump(){const A=[];let g=null;for(g=this.head;g!==null;g=g.next)A.push(g);return A}}class Sf{byLevel;constructor(){this.byLevel=[]}reset(){for(const A of this.byLevel)A.reset()}clean(){for(const A of this.byLevel)A.clean()}}function iI(I,A,g){if(I.h0===null){const B=ZI(g,A),{left:e,right:Q}=I;B.push(e,Q,I),iI(e,A+1,g),iI(Q,A+1,g)}}function ZI(I,A){return I[A]===void 0&&(I[A]=new ff),I[A]}const hB=[qA.fromZero()];function Yg(I){if(I>=hB.length){for(let A=hB.length;A<=I;A++)hB[A]=new _A(hB[A-1],hB[A-1]);hB[I].root}return hB[I]}function uC(I,A,g=0,B=null){const e=2**A;if(I.length>e)throw new Error(`nodes.length ${I.length} over maxIndex at depth ${A}`);if(I.length===0)return Yg(A);if(A===0){const C=I[0];return B!==null&&iI(C,g,B),C}if(A===1){const C=I[0],i=I.length>1?I[1]:Yg(0),o=new _A(C,i);return B!==null&&(iI(C,g+1,B),iI(i,g+1,B),ZI(B,g).push(C,i,o)),o}let Q=I.length;for(let C=A;C>0;C--){const i=Q%2,o=Q-i,D=B?g+C-1:null;for(let a=0;a<o;a+=2){const U=I[a],J=I[a+1],f=new _A(U,J);I[a/2]=f,D!==null&&B!==null&&(ZI(B,D).push(U,J,f),C===A&&(iI(U,D+1,B),iI(J,D+1,B)))}if(i>0){const a=I[o],U=Yg(A-C),J=new _A(a,U);I[o/2]=J,D!==null&&B!==null&&(C===A&&iI(a,D+1,B),ZI(B,D).push(a,U,J))}Q=o/2+i}return I[0]}const wf=2**32;function RC(I,A,g,B){const e=df(A,g,B);return uC(e,I)}function yf(I){const A=new Array(Math.ceil(I.length/4));for(let g=0;g<I.length;g++){const B=Math.floor(g/4),e=A[B]??new qA(0,0,0,0,0,0,0,0),Q=2*(g%4),C=I[g];C===1/0?(lI(e,Q,4294967295),lI(e,Q+1,4294967295)):(lI(e,Q,C&4294967295),lI(e,Q+1,C/wf&4294967295)),A[B]=e}return A}function df(I,A,g){const B=g-A,e=Math.floor(B/32),Q=new Array(Math.ceil(B/32));for(let i=0;i<e;i++){const o=A+i*32;Q[i]=new qA(I.getInt32(o+0,!0),I.getInt32(o+4,!0),I.getInt32(o+8,!0),I.getInt32(o+12,!0),I.getInt32(o+16,!0),I.getInt32(o+20,!0),I.getInt32(o+24,!0),I.getInt32(o+28,!0))}const C=B%32;if(C>0){const i=new qA(0,0,0,0,0,0,0,0);Q[e]=i;const o=Math.floor(C/4);for(let a=0;a<o;a++)lI(i,a,I.getInt32(A+e*32+a*4,!0));const D=B%4;if(D>0){let a=0;for(let U=0;U<D;U++)a|=I.getUint8(A+B-D+U)<<U*8;lI(i,o,a)}}return Q}function GC(I,A,g,B){const e=g%32,Q=Math.floor(g/32);for(let C=0;C<Q;C++){const i=B[C],o=A+C*32;I.setInt32(o+0,i.h0,!0),I.setInt32(o+4,i.h1,!0),I.setInt32(o+8,i.h2,!0),I.setInt32(o+12,i.h3,!0),I.setInt32(o+16,i.h4,!0),I.setInt32(o+20,i.h5,!0),I.setInt32(o+24,i.h6,!0),I.setInt32(o+28,i.h7,!0)}if(e>0){const C=B[Q],i=Math.floor(e/4);for(let D=0;D<i;D++)I.setInt32(A+Q*32+D*4,_I(C,D),!0);const o=g%4;if(o>0){const D=_I(C,i);for(let a=0;a<o;a++)I.setUint8(A+g-o+a,D>>a*8&255)}}}function Nf(I){const A=new Set,g=new Set;let B=I;for(;B.length>1;){A.add(B);const e=B.at(-1),Q=B.substring(0,B.length-1);g.add(Q+(Number(e)^1)),B=Q}return{path:A,branch:g}}function uf(I,A){return I.length?I.map(g=>g.padEnd(A)).sort().map(g=>g.trim()):[]}function Rf(I){return I.length?I.sort((A,g)=>{if(A.length<g.length)return 1;if(g.length<A.length)return-1;let B=A.indexOf("0"),e=g.indexOf("0");for(;;){if(B===-1)return-1;if(e===-1||B<e)return 1;if(e<B)return-1;B=A.indexOf("0",B+1),e=g.indexOf("0",e+1)}}):[]}function Gf(I){const A=I.slice().sort((B,e)=>B.length-e.length),g=[];A:for(let B=0;B<A.length;B++){const e=A[B];for(let Q=B+1;Q<A.length;Q++)if(A[Q].startsWith(e))continue A;g.push(e)}return g}var bg;(function(I){I[I.InOrder=0]="InOrder",I[I.Decreasing=1]="Decreasing",I[I.Unsorted=2]="Unsorted"})(bg||(bg={}));function li(I,A=!0,g=bg.InOrder){const B=Gf(I),e=new Set(A?B:[]),Q=new Set,C=new Set;let i=1;for(const o of B){o.length>i&&(i=o.length);const{path:D,branch:a}=Nf(o);for(const U of D)Q.add(U);for(const U of a)C.add(U)}for(const o of Q)C.delete(o);for(const o of C)e.add(o);switch(g){case bg.InOrder:return uf(Array.from(e),i);case bg.Decreasing:return Rf(Array.from(e));case bg.Unsorted:return Array.from(e)}}function dr(I,A){const g=A%8,B=Math.floor(A/8),e=I[B];switch(g){case 0:return(e&128)!==0;case 1:return(e&64)!==0;case 2:return(e&32)!==0;case 3:return(e&16)!==0;case 4:return(e&8)!==0;case 5:return(e&4)!==0;case 6:return(e&2)!==0;case 7:return(e&1)!==0;default:throw new Error("unreachable")}}function Nr(I){const A=[],g=I.length*8;let B=0,e=0;for(let Q=0;Q<g;Q++){const C=dr(I,Q);if(A.push(C),C?e++:B++,e>B){if(Q++,Q+7<g)throw new Error("Invalid descriptor: too many bytes");for(;Q<g;Q++)if(dr(I,Q))throw new Error("Invalid descriptor: too many 1 bits");return A}}throw new Error("Invalid descriptor: not enough 1 bits")}function ci(I,A,g){if(A[g])return[I.root];const B=ci(I.left,A,g+1),e=ci(I.right,A,g+B.length*2);return[...B,...e]}function Di(I,A,g){return I[g.bitIndex++]?qA.fromRoot(A[g.leafIndex++]):new _A(Di(I,A,g),Di(I,A,g))}function kf(I,A){return ci(I,Nr(A),0)}function Ff(I,A){const g=Nr(A);if(g.length!==I.length*2-1)throw new Error("Invalid multiproof: invalid number of leaves");return Di(g,I,{bitIndex:0,leafIndex:0})}const ur="Invalid tree navigation";function Rr(I,A){const g=[];let B=I;for(const e of Af(A))if(e){if(B.isLeaf())throw new Error(ur);g.push(B.left.root),B=B.right}else{if(B.isLeaf())throw new Error(ur);g.push(B.right.root),B=B.left}return[B.root,g.reverse()]}function Jf(I,A,g){let B=qA.fromRoot(A);const e=g.slice().reverse();for(;I>1;){const Q=qA.fromRoot(e.pop());I%BigInt(2)===BigInt(0)?B=new _A(B,Q):B=new _A(Q,B),I=I/BigInt(2)}return B}class GI{_rootNode;hook;constructor(A,g){this._rootNode=A,g&&(typeof WeakRef>"u"?this.hook=g:this.hook=new WeakRef(g))}get root(){return this.rootNode.root}get rootNode(){return this._rootNode}set rootNode(A){if(this._rootNode=A,this.hook)if(typeof WeakRef>"u")this.hook(A);else{const g=this.hook.deref();g?g(A):this.hook=void 0}}static createFromProof(A){return new GI(qf(A))}clone(){return new GI(this.rootNode)}getSubtree(A){return new GI(this.getNode(A),g=>this.setNode(A,g))}getNode(A){return kC(this.rootNode,A)}getNodeAtDepth(A,g){return YI(this.rootNode,A,g)}getRoot(A){return this.getNode(A).root}setNode(A,g){this.rootNode=pf(this.rootNode,A,g)}setNodeWithFn(A,g){this.rootNode=Hf(this.rootNode,A,g)}setNodeAtDepth(A,g,B){this.rootNode=Mf(this.rootNode,A,g,B)}setRoot(A,g){this.setNode(A,qA.fromRoot(g))}getNodesAtDepth(A,g,B){return tI(this.rootNode,A,g,B)}iterateNodesAtDepth(A,g,B){return mf(this.rootNode,A,g,B)}getSingleProof(A){return Rr(this.rootNode,A)[1]}getProof(A){return pr(this.rootNode,A)}}function kC(I,A){const g=ti(A);let B=I;for(let e=1;e<g.length;e++){if(B.isLeaf())throw new Error(`Invalid tree - found leaf at depth ${e}`);B=g[e]==="1"?B.right:B.left}return B}function pf(I,A,g){const B=ti(A),e=Gr(I,B);return kr(B,e,g)}function Hf(I,A,g){const B=ti(A),e=Gr(I,B),Q=e.at(-1);if(!Q)throw new Error("Invalid tree - can not find last parent");const C=B.at(-1)==="1"?Q.right:Q.left,i=g(C);return kr(B,e,i)}function Gr(I,A){let g=I;const B=[I];for(let e=1;e<A.length-1;e++)A[e]==="1"?g=g.right:g=g.left,B.push(g);return B}function kr(I,A,g){let B=g;for(let e=I.length-1;e>=1;e--)I[e]==="1"?B=new _A(A[e-1].left,B):B=new _A(B,A[e-1].right);return B}function YI(I,A,g){if(A===0)return I;if(A===1)return g===0?I.left:I.right;const B=A-1,e=0;let Q=I;for(let C=B;C>=e;C--)Q=lB(C,g)?Q.left:Q.right;return Q}function Mf(I,A,g,B){return FC(I,A,[g],[B])}function FC(I,A,g,B,e=0,Q=null){if(A===0)return B.length>0?B[0]:I;const C=new Array(A),i=new Array(A),o=A-1,D=0;let a=o,U=I;C[o]=I;for(let J=0;J<g.length;J++){const f=g[J];for(let R=a;R>D;R--)U=lB(R,f)?U.left:U.right,C[R-1]=U;if(a=D,(f&1)!==1)if(f+1===g[J+1])U=new _A(B[J],B[J+1]),Q!=null&&ZI(Q,A-1+e).push(B[J],B[J+1],U),J++;else{const R=U;U=new _A(B[J],R.right),Q!=null&&ZI(Q,A-1+e).push(B[J],R.right,U)}else{const R=U;U=new _A(R.left,B[J]),Q!=null&&ZI(Q,A-1+e).push(R.left,B[J],U)}const y=J>=g.length-1,S=y?o:Lf(f,g[J+1]);for(let R=D+1;R<=S;R++){const N=A-R-1;if(N<0)throw Error(`Invalid depth ${N}, d=${R}, nodesDepth=${A}`);if(lB(R,f))if(y||R!==S){const G=U;U=new _A(G,C[R].right),Q!=null&&ZI(Q,N+e).push(G,C[R].right,U)}else i[R]=U,U=C[R];else{const G=i[R];if(G!==void 0){const H=U;U=new _A(G,H),Q!=null&&ZI(Q,N+e).push(G,H,U),i[R]=void 0}else{const H=U;U=new _A(C[R].left,H),Q!=null&&ZI(Q,N+e).push(C[R].left,H,U)}}}a=S}return U}function tI(I,A,g,B){if(A===0)return g===0&&B>0?[I]:[];if(A===1)return B===0?[]:B===1?g===0?[I.left]:[I.right]:[I.left,I.right];const e=A-1,Q=0;let C=e,i=I;const o=new Array(A),D=new Array(A),a=new Array(B);o[e]=I;for(let U=0;U<B;U++){for(let J=C;J>=Q;J--){J!==C&&(o[J]=i);const f=lB(J,g+U);D[J]=f,i=f?i.left:i.right}a[U]=i;for(let J=Q;J<=e;J++)if(D[J]===!0){C=J;break}i=o[C]}return a}function*mf(I,A,g,B){const e=g+B,Q=A-1,C=0;let i=Q,o=I;const D=new Array(A),a=new Array(A);D[Q]=I;for(let U=g;U<e;U++){for(let J=i;J>=C;J--){J!==i&&(D[J]=o);const f=lB(J,U);a[J]=f,o=f?o.left:o.right}yield o;for(let J=C;J<=Q;J++)if(a[J]===!0){i=J;break}o=D[i]}}function Fr(I,A,g){if(g<0)return Yg(A);const B=new Array(A),e=A-1,Q=0;let C=e,i=I;B[e]=I;for(let o=C;o>=Q;o--)i=lB(o,g)?i.left:i.right,B[o-1]=i;C=Q;for(let o=Q;o<=e;o++)lB(o,g)?i=new _A(i,Yg(o)):i=new _A(B[o].left,i);return i}const yQ=4294967295,Jr=2**32;function Lf(I,A){if(I===A||I<0||A<0)throw Error(`Expect different positive inputs, from=${I} to=${A}`);const g=Math.ceil(Math.log2(I+1)),B=Math.ceil(Math.log2(A+1));if(g!==B)return Math.max(g,B)-1;if(g>32){const e=Math.floor(I/Jr)&yQ,Q=Math.floor(A/Jr)&yQ;return e===Q?Ui(I&yQ,A&yQ):32+Ui(e,Q)}return Ui(I,A)}function lB(I,A){if(I>31){const B=A/4294967296>>>0,e=1<<I-32;return(B&e)!==e}const g=1<<I;return(A&g)!==g}function Ui(I,A){const g=I^A;if(g===0)throw Error(`Do not support equal value from=${I} to=${A}`);return(g<0?32:Math.ceil(Math.log2(g+1)))-1}function Kf(I,A){const g=new GI(I),B=li(A.map(i=>i.toString(2)),!1,bg.Decreasing),e=A.slice().sort((i,o)=>i<o?1:-1),Q=e.map(i=>g.getRoot(i)),C=B.map(i=>g.getRoot(i));return[Q,C,e]}function Yf(I,A,g){if(I.length!==g.length)throw new Error("Leaves length should equal gindices length");const B=g.map(o=>o.toString(2)),e=li(B,!1,bg.Decreasing);if(e.length!==A.length)throw new Error("Witnesses length should equal witnesses gindices length");const Q=Math.max(B[0]?.length??0,e[0]?.length??0),C=Object.fromEntries(Array.from({length:Q},(o,D)=>[D+1,{}]));for(let o=0;o<B.length;o++){const D=B[o],a=I[o];C[D.length][D]=qA.fromRoot(a)}for(let o=0;o<e.length;o++){const D=e[o],a=A[o];C[D.length][D]=qA.fromRoot(a)}for(let o=Q;o>1;o--){const D=C[o],a=C[o-1];for(const U of Object.keys(D)){const J=D[U];if(!J)continue;const f=U.at(-1)==="0",y=U.substring(0,U.length-1),S=y+(f?"1":"0"),R=D[S];if(!R)throw new Error(`Sibling not found: ${S}`);const N=f?new _A(J,R):new _A(R,J);a[y]=N,delete D[U],delete D[S]}}const i=C[1][1];if(!i)throw new Error("Internal consistency error: no root found");return i}function fi(I,A,g){if(!g.length||!g[0].startsWith(A))return[[],[]];if(A===g[0])return g.shift(),[[],[I.root]];const[B,e]=fi(I.left,`${A}0`,g),[Q,C]=fi(I.right,`${A}1`,g);return[[e.length].concat(B,Q),e.concat(C)]}function Si(I,A){if(!A.length)throw new Error("Proof must contain gt 0 leaves");if(A.length===1)return qA.fromRoot(A[0]);const g=I[0];return new _A(Si(I.slice(1,g),A.slice(0,g)),Si(I.slice(g),A.slice(g)))}function bf(I,A){return fi(I,"1",li(A.map(g=>g.toString(2))))}function Tf(I,A){return Si(I,A)}var ZA;(function(I){I.single="single",I.treeOffset="treeOffset",I.multi="multi",I.compactMulti="compactMulti"})(ZA||(ZA={})),ZA.single,ZA.treeOffset,ZA.multi,ZA.compactMulti;function pr(I,A){switch(A.type){case ZA.single:{const[g,B]=Rr(I,A.gindex);return{type:ZA.single,gindex:A.gindex,leaf:g,witnesses:B}}case ZA.treeOffset:{const[g,B]=bf(I,A.gindices);return{type:ZA.treeOffset,offsets:g,leaves:B}}case ZA.multi:{const[g,B,e]=Kf(I,A.gindices);return{type:ZA.multi,leaves:g,witnesses:B,gindices:e}}case ZA.compactMulti:{const g=kf(I,A.descriptor);return{type:ZA.compactMulti,leaves:g,descriptor:A.descriptor}}default:throw new Error("Invalid proof type")}}function qf(I){switch(I.type){case ZA.single:return Jf(I.gindex,I.leaf,I.witnesses);case ZA.treeOffset:return Tf(I.offsets,I.leaves);case ZA.multi:return Yf(I.leaves,I.witnesses,I.gindices);case ZA.compactMulti:return Ff(I.leaves,I.descriptor);default:throw new Error("Invalid proof type")}}function Vf(I,A,g){if(g<0)throw new Error(`Expect count to be non-negative, got ${g}`);return{finalized:(g>0?jf(A,g-1):[]).map(B=>kC(I,B).root),count:g}}function jf(I,A){if(A<0||I<0)throw new Error(`Expect index and depth to be non-negative, got ${A} and ${I}`);const g=Array.from({length:I+1},()=>0);let B=A+1;const e=[];for(;B>0;){const Q=Math.floor(Math.log2(B)),C=2**Q,i=I-Q,o=mg(i,BigInt(g[i]));e.push(o);for(let D=0;D<=Q;D++)g[i+D]+=Math.pow(2,D);B-=C}return e}const Tg=Symbol("ssz_cached_permanent_root");function wi(I,A,g,B){const e=B&&A.length===32&&g===0?A:B?A.subarray(g,g+32):Uint8Array.prototype.slice.call(A,g,g+32);I[Tg]=e}function _f(I,A){return sB.digest64(I,A)}function Sg(I){return I===0?0:Math.ceil(Math.log2(I))}function dI(I,A){return new Function("superClass",`return class ${A} extends superClass {}`)(I)}const yi=new Array(256);class wg{uint8Array;bitLen;constructor(A,g){if(this.uint8Array=A,this.bitLen=g,A.length!==Math.ceil(g/8))throw Error("BitArray uint8Array length does not match bitLen")}static fromBitLen(A){return new wg(new Uint8Array(Math.ceil(A/8)),A)}static fromSingleBit(A,g){const B=wg.fromBitLen(A);return B.set(g,!0),B}static fromBoolArray(A){const g=wg.fromBitLen(A.length);for(let B=0;B<A.length;B++)A[B]===!0&&g.set(B,!0);return g}clone(){return new wg(Uint8Array.prototype.slice.call(this.uint8Array,0),this.bitLen)}get(A){const g=Math.floor(A/8),B=1<<A%8;return(this.uint8Array[g]&B)===B}set(A,g){if(A>=this.bitLen)throw Error(`BitArray set bitIndex ${A} beyond bitLen ${this.bitLen}`);const B=Math.floor(A/8),e=1<<A%8;let Q=this.uint8Array[B];g?(Q|=e,this.uint8Array[B]=Q):(Q&e)===e&&(Q^=e,this.uint8Array[B]=Q)}mergeOrWith(A){if(A.bitLen!==this.bitLen)throw Error("Must merge BitArrays of same bitLen");for(let g=0;g<this.uint8Array.length;g++)this.uint8Array[g]=this.uint8Array[g]|A.uint8Array[g]}intersectValues(A){const g=[];if(A.length!==this.bitLen)throw Error(`Must not intersect values of length ${A.length} != bitLen ${this.bitLen}`);const B=Math.floor(this.bitLen/8),e=this.bitLen%8,Q=this.uint8Array;for(let C=0;C<B;C++){const i=dQ(Q[C]);for(let o=0;o<8;o++)i[o]&&g.push(A[C*8+o])}if(e>0){const C=dQ(Q[B]);for(let i=0;i<e;i++)C[i]&&g.push(A[B*8+i])}return g}getTrueBitIndexes(){const A=[],g=this.uint8Array;for(let B=0,e=g.length;B<e;B++){const Q=dQ(g[B]);for(let C=0;C<8;C++)Q[C]&&A.push(B*8+C)}return A}getSingleTrueBit(){let A=null;const g=this.uint8Array;for(let B=0,e=g.length;B<e;B++){if(g[B]===0)continue;const Q=dQ(g[B]);for(let C=0;C<8;C++)if(Q[C]===!0){if(A!==null)return null;A=B*8+C}}return A===null?null:A}toBoolArray(){const A=new Array(this.bitLen);for(let g=0;g<this.bitLen;g++)A[g]=this.get(g);return A}}function dQ(I){return yi[I]||(yi[I]=Zf(I)),yi[I]}function Zf(I){const A=I.toString(2),g=A.length,B=new Array(8);for(let e=0;e<8;e++)B[e]=e<g?A[g-e-1]==="1":!1;return B}function eg(I){return I.right.getUint(4,0)}function Hr(I){return I.left}function qg(I,A){return new _A(I,qA.fromUint32(A))}function Mr(I,A,g,B=0,e=null){const Q=g!==null?qA.fromUint32(g):I.right,C=new _A(A,Q);return e!==null&&ZI(e,B).push(A,Q,C),C}function NQ(I,A,g,B,e){const Q=I.byteLength;for(let C=0;C<A;C++)I.value_serializeToBytes(g,B+C*Q,e[C]);return B+A*Q}function mr(I,A,g,B,e){const Q=I.byteLength,C=(B-g)/Q;uQ(C,e,!0);const i=new Array(C);for(let o=0;o<C;o++)i[o]=I.value_deserializeFromBytes(A,g+o*Q,g+(o+1)*Q);return i}function di(I,A,g,B,e,Q,C=null){const i=I.byteLength*A,o=Math.ceil(i/32),D=C??tI(Q,g,0,o);return GC(B.dataView,e,i,D),e+i}function Lr(I,A,g,B,e,Q){const C=(e-B)/I.byteLength;uQ(C,Q,!0);const i=RC(A,g.dataView,B,e);return Q.isList?qg(i,C):i}function Pf(I,A,g){if(!Array.isArray(A))throw Error("JSON is not an array");uQ(A.length,g);const B=new Array(A.length);for(let e=0;e<A.length;e++)B[e]=I.fromJson(A[e]);return B}function Of(I,A,g){const B=g.isList?A.length:g.length,e=new Array(B);for(let Q=0;Q<B;Q++)e[Q]=I.toJson(A[Q]);return e}function xf(I,A){const g=new Array(A.length);for(let B=0;B<A.length;B++)g[B]=I.clone(A[B]);return g}function zf(I,A,g){if(A.length!==g.length)return!1;for(let B=0;B<A.length;B++)if(!I.equals(A[B],g[B]))return!1;return!0}function vf(I,A){const g=new Array(A);for(let B=0;B<A;B++)g[B]=I.defaultValue();return g}function uQ(I,A,g){if(g&&I%1!==0)throw Error("size not multiple of element fixedSize");if(A.isList){if(I>A.limit)throw new Error(`Invalid list length ${I} over limit ${A.limit}`)}else if(I!==A.length)throw new Error(`Incorrect vector length ${I} expected ${A.length}`)}const Ni=new Array(256);function Kr(I){let A="0x";for(const g of I)Ni[g]||(Ni[g]=g<16?`0${g.toString(16)}`:g.toString(16)),A+=Ni[g];return A}function Yr(I){if(typeof I!="string")throw new Error(`hex argument type ${typeof I} must be of type string`);if(I.startsWith("0x")&&(I=I.slice(2)),I.length%2!==0)throw new Error(`hex string length ${I.length} must be multiple of 2`);const A=I.length/2,g=new Uint8Array(A);for(let B=0;B<A;B++){const e=parseInt(I.slice(B*2,(B+1)*2),16);g[B]=e}return g}function ui(I,A){if(I.length!==A.length)return!1;for(let g=0;g<I.length;g++)if(I[g]!==A[g])return!1;return!0}class zB{serialize(){const A=new Uint8Array(this.type.tree_serializedSize(this.node)),g=new DataView(A.buffer,A.byteOffset,A.byteLength);return this.type.tree_serializeToBytes({uint8Array:A,dataView:g},0,this.node),A}hashTreeRoot(){return this.node.root}createProof(A){return this.type.tree_createProof(this.node,A)}toValue(){return this.type.tree_toValue(this.node)}clone(){return this.type.getView(new GI(this.node))}}class Wf extends zB{type;tree;bitArray;constructor(A,g){super(),this.type=A,this.tree=g,this.bitArray=A.tree_toValue(g.rootNode)}get node(){return this.tree.rootNode}get uint8Array(){return this.bitArray.uint8Array}get bitLen(){return this.bitArray.bitLen}get(A){return this.bitArray.get(A)}set(A,g){this.bitArray.set(A,g),this.tree.rootNode=this.type.value_toTree(this.bitArray)}mergeOrWith(A){this.bitArray.mergeOrWith(A)}intersectValues(A){return this.bitArray.intersectValues(A)}getTrueBitIndexes(){return this.bitArray.getTrueBitIndexes()}getSingleTrueBit(){return this.bitArray.getSingleTrueBit()}toBoolArray(){return this.bitArray.toBoolArray()}}const br=Symbol("ssz_cached_tree_root");class JC extends zB{serializeToBytes(A,g){return this.type.tree_serializeToBytes(A,g,this.node)}hashTreeRoot(){return this.commit(),super.hashTreeRoot()}batchHashTreeRoot(A=new Sf){A.reset(),this.commit(0,A.byLevel),A.clean();const g=this.node[br];if(g)return g;if(Uf(A.byLevel),this.node.h0===null)throw Error("Root is not computed by batch");const B=this.node.root;return this.node[br]=B,B}serialize(){this.commit();const A=new Uint8Array(this.type.tree_serializedSize(this.node)),g=new DataView(A.buffer,A.byteOffset,A.byteLength);return this.serializeToBytes({uint8Array:A,dataView:g},0),A}clone(A){if(A)return this.type.getViewDU(this.node);const g=this.cache;return this.clearCache(),this.type.getViewDU(this.node,g)}}class Xf extends JC{type;_rootNode;_bitArray=null;constructor(A,g){super(),this.type=A,this._rootNode=g}get node(){return this._rootNode}get cache(){}get uint8Array(){return this.bitArray.uint8Array}get bitLen(){return this.bitArray.bitLen}get bitArray(){return this._bitArray===null&&(this._bitArray=this.type.tree_toValue(this._rootNode)),this._bitArray}commit(A=0,g=null){this._bitArray!==null&&(this._rootNode=this.type.value_toTree(this._bitArray)),g!==null&&this._rootNode.h0===null&&iI(this._rootNode,A,g)}get(A){return this.bitArray.get(A)}set(A,g){this.bitArray.set(A,g)}mergeOrWith(A){this.bitArray.mergeOrWith(A)}intersectValues(A){return this.bitArray.intersectValues(A)}getTrueBitIndexes(){return this.bitArray.getTrueBitIndexes()}getSingleTrueBit(){return this.bitArray.getSingleTrueBit()}toBoolArray(){return this.bitArray.toBoolArray()}clearCache(){this._bitArray=null}}function Tr(I){return!I.isBasic}function RQ(I,A,g="",B=0){if(B===0){const i=A.tree_fromProofNode(I);if(i.done)return i.node;I=i.node}const e=A.depth===B;if(I.isLeaf()){if(e){const i=A.getIndexProperty(qr(g));if(i===null)return I;const o=A.getPropertyType(i);return o.maxChunkCount===1&&Tr(o)?o.tree_fromProofNode(I).node:I}return I}if(e){const i=A.getIndexProperty(qr(g));if(i===null)return I;const o=A.getPropertyType(i);if(!Tr(o))throw Error("BranchNode does not map to CompositeType");const D=o.tree_fromProofNode(I);return D.done?D.node:RQ(D.node,o)}const Q=RQ(I.left,A,`${g}0`,B+1),C=RQ(I.right,A,`${g}1`,B+1);return Q===I.left&&C===I.right?I:new _A(Q,C)}function qr(I){return I===""?0:parseInt(I,2)}class Vr{value_toTree(A){const g=new Uint8Array(this.value_serializedSize(A)),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return this.value_serializeToBytes({uint8Array:g,dataView:B},0,A),this.tree_deserializeFromBytes({uint8Array:g,dataView:B},0,g.length)}tree_toValue(A){const g=new Uint8Array(this.tree_serializedSize(A)),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return this.tree_serializeToBytes({uint8Array:g,dataView:B},0,A),this.value_deserializeFromBytes({uint8Array:g,dataView:B},0,g.length)}serialize(A){const g=new Uint8Array(this.value_serializedSize(A)),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return this.value_serializeToBytes({uint8Array:g,dataView:B},0,A),g}deserialize(A){const g=new DataView(A.buffer,A.byteOffset,A.byteLength);return this.value_deserializeFromBytes({uint8Array:A,dataView:g},0,A.length)}}const Ri=BigInt(3);class pC extends Vr{cachePermanentRootStruct;isBasic=!1;blocksBuffer=new Uint8Array(0);constructor(A){super(),this.cachePermanentRootStruct=A}defaultView(){return this.toView(this.defaultValue())}defaultViewDU(){return this.toViewDU(this.defaultValue())}deserializeToView(A){const g=new DataView(A.buffer,A.byteOffset,A.byteLength),B=this.tree_deserializeFromBytes({uint8Array:A,dataView:g},0,A.length);return this.getView(new GI(B))}deserializeToViewDU(A){const g=new DataView(A.buffer,A.byteOffset,A.byteLength),B=this.tree_deserializeFromBytes({uint8Array:A,dataView:g},0,A.length);return this.getViewDU(B)}toView(A){const g=this.value_toTree(A);return this.getView(new GI(g))}toViewDU(A){const g=this.value_toTree(A);return this.getViewDU(g)}toValueFromView(A){const g=this.commitView(A);return this.tree_toValue(g)}toValueFromViewDU(A){const g=this.commitViewDU(A);return this.tree_toValue(g)}toViewFromViewDU(A){const g=this.commitViewDU(A);return this.getView(new GI(g))}toViewDUFromView(A){const g=this.commitView(A);return this.getViewDU(g)}hashTreeRoot(A){if(this.cachePermanentRootStruct){const B=A[Tg];if(B)return B}const g=oB(32);return this.hashTreeRootInto(A,g,0,!0),g}hashTreeRootInto(A,g,B,e=!1){if(this.cachePermanentRootStruct){const C=A[Tg];if(C){g.set(C,B);return}}const Q=this.getBlocksBytes(A);xB(Q,this.maxChunkCount,g,B),this.cachePermanentRootStruct&&wi(A,g,B,e)}getCachedPermanentRoot(A){return A[Tg]}createFromProof(A,g){const B=GI.createFromProof(A).rootNode,e=RQ(B,this);if(g!==void 0&&!ui(e.root,g))throw new Error("Proof does not match trusted root");return this.getView(new GI(e))}tree_createProof(A,g){const B=this.tree_createProofGindexes(A,g);return pr(A,{type:ZA.treeOffset,gindices:B})}tree_createProofGindexes(A,g){const B=[];for(const e of g){const{type:Q,gindex:C}=this.getPathInfo(e);if(!NI(Q))B.push(C);else{const i=Q.tree_getLeafGindices(C,Q.fixedSize===null?kC(A,C):void 0);for(const o of i)B.push(o)}}return B}getPathInfo(A){const g=[];let B=this;for(const e of A){if(B.isBasic)throw new Error("Invalid path: cannot navigate beyond a basic type");const Q=B.getPropertyGindex(e);Q!==null&&(g.push(Q),B=B.getPropertyType(e))}return{type:B,gindex:yI(g)}}tree_fromProofNode(A){return{node:A,done:!1}}}function NI(I){return!I.isBasic}class jr extends pC{isViewMutable=!1;defaultValue(){return new Uint8Array(this.minSize)}getView(A){return this.getViewDU(A.rootNode)}getViewDU(A){return this.tree_toValue(A)}commitView(A){return this.commitViewDU(A)}commitViewDU(A,g=0,B=null){const e=new Uint8Array(this.value_serializedSize(A)),Q=new DataView(e.buffer,e.byteOffset,e.byteLength);this.value_serializeToBytes({uint8Array:e,dataView:Q},0,A);const C=this.tree_deserializeFromBytes({uint8Array:e,dataView:Q},0,e.length);return B!==null&&C.h0===null&&iI(C,g,B),C}cacheOfViewDU(){}toView(A){return A}toViewDU(A){return A}value_serializeToBytes(A,g,B){return A.uint8Array.set(B,g),g+B.length}value_deserializeFromBytes(A,g,B){return this.assertValidSize(B-g),Uint8Array.prototype.slice.call(A.uint8Array,g,B)}value_toTree(A){const g=new DataView(A.buffer,A.byteOffset,A.byteLength);return this.tree_deserializeFromBytes({uint8Array:A,dataView:g},0,A.length)}getBlocksBytes(A){if(A.length>this.blocksBuffer.length){const g=Math.ceil(A.length/32);this.blocksBuffer=new Uint8Array(Math.ceil(g/2)*64)}return _r(A,this.blocksBuffer)}getPropertyGindex(){return null}getPropertyType(){throw Error("Must only request ByteArray complete data")}getIndexProperty(){throw Error("Must only request ByteArray complete data")}tree_fromProofNode(A){return{node:A,done:!0}}tree_getLeafGindices(A,g){const B=this.tree_getByteLen(g),e=Math.ceil(B/32),Q=yI([A,mg(this.depth,BigInt(0))]),C=new Array(e);for(let i=0,o=Q;i<e;i++,o++)C[i]=o;return this.isList&&C.push(yI([A,Ri])),C}fromJson(A){const g=Yr(A);return this.assertValidSize(g.length),g}toJson(A){return Kr(A)}clone(A){return A}equals(A,g){return ui(A,g)}}function _r(I,A){if(I.length>A.length)throw new Error(`data length ${I.length} exceeds blocksBuffer length ${A.length}`);A.set(I);const g=I.length,B=Math.ceil(g/64)*64;return A.subarray(g,B).fill(0),A.subarray(0,B)}class Zr extends pC{isViewMutable=!0;getView(A){return new Wf(this,A)}getViewDU(A){return new Xf(this,A)}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}cacheOfViewDU(A){return A.cache}getBlocksBytes(A){if(A.uint8Array.length>this.blocksBuffer.length){const g=Math.ceil(A.bitLen/8/32);this.blocksBuffer=new Uint8Array(Math.ceil(g/2)*64)}return _r(A.uint8Array,this.blocksBuffer)}getPropertyGindex(){return null}getPropertyType(){throw Error("Must only request BitArray complete data")}getIndexProperty(){throw Error("Must only request BitArray complete data")}tree_fromProofNode(A){return{node:A,done:!0}}tree_getLeafGindices(A,g){const B=this.tree_getByteLen(g),e=Math.ceil(B/32),Q=yI([A,mg(this.depth,BigInt(0))]),C=new Array(e);for(let i=0,o=Q;i<e;i++,o++)C[i]=o;return this.isList&&C.push(yI([A,Ri])),C}fromJson(A){const g=Yr(A),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return this.value_deserializeFromBytes({uint8Array:g,dataView:B},0,g.length)}toJson(A){return Kr(this.serialize(A))}clone(A){return A.clone()}equals(A,g){return A.bitLen===g.bitLen&&ui(A.uint8Array,g.uint8Array)}}class GQ extends Zr{limitBits;typeName;depth;chunkDepth;fixedSize=null;minSize=1;maxSize;maxChunkCount;isList=!0;mixInLengthBlockBytes=new Uint8Array(64);mixInLengthBuffer=vA.from(this.mixInLengthBlockBytes.buffer,this.mixInLengthBlockBytes.byteOffset,this.mixInLengthBlockBytes.byteLength);constructor(A,g){if(super(),this.limitBits=A,A===0)throw Error("List limit must be > 0");this.typeName=g?.typeName??`BitList[${A}]`,this.maxChunkCount=Math.ceil(this.limitBits/8/32),this.chunkDepth=Sg(this.maxChunkCount),this.depth=1+this.chunkDepth,this.maxSize=Math.ceil(A/8)+1}static named(A,g){return new(dI(GQ,g.typeName))(A,g)}defaultValue(){return wg.fromBitLen(0)}value_serializedSize(A){return Pr(A.bitLen)}value_serializeToBytes(A,g,B){return A.uint8Array.set(B.uint8Array,g),Or(A.uint8Array,g,B.bitLen)}value_deserializeFromBytes(A,g,B){const{uint8Array:e,bitLen:Q}=this.deserializeUint8ArrayBitListFromBytes(A.uint8Array,g,B);return new wg(e,Q)}tree_serializedSize(A){return Pr(eg(A))}tree_serializeToBytes(A,g,B){const e=Hr(B),Q=eg(B),C=Math.ceil(Q/8),i=Math.ceil(C/32),o=tI(e,this.chunkDepth,0,i);return GC(A.dataView,g,C,o),Or(A.uint8Array,g,Q)}tree_deserializeFromBytes(A,g,B){const{uint8Array:e,bitLen:Q}=this.deserializeUint8ArrayBitListFromBytes(A.uint8Array,g,B),C=new DataView(e.buffer,e.byteOffset,e.byteLength),i=RC(this.chunkDepth,C,0,e.length);return qg(i,Q)}tree_getByteLen(A){if(!A)throw new Error("BitListType requires a node to get leaves");return Math.ceil(eg(A)/8)}hashTreeRoot(A){const g=oB(32);return this.hashTreeRootInto(A,g,0),g}hashTreeRootInto(A,g,B){super.hashTreeRootInto(A,this.mixInLengthBlockBytes,0),this.mixInLengthBuffer.writeUIntLE(A.bitLen,32,6),xB(this.mixInLengthBlockBytes,2,g,B)}deserializeUint8ArrayBitListFromBytes(A,g,B){const{uint8Array:e,bitLen:Q}=$f(A,g,B);if(Q>this.limitBits)throw Error(`bitLen over limit ${Q} > ${this.limitBits}`);return{uint8Array:e,bitLen:Q}}}function $f(I,A,g){if(g>I.length)throw Error(`BitList attempting to read byte ${g} of data length ${I.length}`);const B=I[g-1],e=g-A;if(B===0)throw new Error("Invalid deserialized bitlist, padding bit required");if(B===1){const D=Uint8Array.prototype.slice.call(I,A,g-1),a=(e-1)*8;return{uint8Array:D,bitLen:a}}const Q=Uint8Array.prototype.slice.call(I,A,g),C=B.toString(2).length-1,i=(e-1)*8+C,o=255>>8-C;return Q[e-1]&=o,{uint8Array:Q,bitLen:i}}function Pr(I){const A=Math.ceil(I/8);return I%8===0?A+1:A}function Or(I,A,g){const B=Math.ceil(g/8),e=A+B;return g%8===0?(I[e]=1,e+1):(I[e-1]|=1<<g%8,e)}class ig extends Zr{lengthBits;typeName;chunkCount;depth;fixedSize;minSize;maxSize;maxChunkCount;isList=!1;zeroBitsMask;constructor(A,g){if(super(),this.lengthBits=A,A===0)throw Error("Vector length must be > 0");this.typeName=g?.typeName??`BitVector[${A}]`,this.chunkCount=Math.ceil(this.lengthBits/8/32),this.maxChunkCount=this.chunkCount,this.depth=Sg(this.chunkCount),this.fixedSize=Math.ceil(this.lengthBits/8),this.minSize=this.fixedSize,this.maxSize=this.fixedSize,this.zeroBitsMask=A%8===0?0:255&255<<A%8}static named(A,g){return new(dI(ig,g.typeName))(A,g)}defaultValue(){return wg.fromBitLen(this.lengthBits)}value_serializedSize(){return this.fixedSize}value_serializeToBytes(A,g,B){return A.uint8Array.set(B.uint8Array,g),g+this.fixedSize}value_deserializeFromBytes(A,g,B){return this.assertValidLength(A.uint8Array,g,B),new wg(Uint8Array.prototype.slice.call(A.uint8Array,g,B),this.lengthBits)}tree_serializedSize(){return this.fixedSize}tree_serializeToBytes(A,g,B){const e=tI(B,this.depth,0,this.chunkCount);return GC(A.dataView,g,this.fixedSize,e),g+this.fixedSize}tree_deserializeFromBytes(A,g,B){return this.assertValidLength(A.uint8Array,g,B),RC(this.depth,A.dataView,g,B)}tree_getByteLen(){return this.fixedSize}assertValidLength(A,g,B){const e=B-g;if(B-g!==this.fixedSize)throw Error(`Invalid BitVector size ${e} != ${this.fixedSize}`);if(this.zeroBitsMask>0&&(A[B-1]&this.zeroBitsMask)>0)throw Error("BitVector: nonzero bits past length")}}class kQ extends Vr{isBasic=!0;depth=0;maxChunkCount=1;value_serializedSize(){return this.byteLength}tree_serializedSize(){return this.byteLength}assertValidSize(A){if(A!==this.byteLength)throw Error(`BasicType invalid size ${A} expected ${this.byteLength}`)}hashTreeRoot(A){const g=new Uint8Array(32);return this.hashTreeRootInto(A,g,0),g}hashTreeRootInto(A,g,B){const e=g.subarray(B,B+32);e.fill(0);const Q=new DataView(e.buffer,e.byteOffset,e.byteLength);this.value_serializeToBytes({uint8Array:e,dataView:Q},0,A)}clone(A){return A}equals(A,g){return A===g}}function Gi(I){return I.isBasic}class ki extends kQ{typeName;byteLength=1;itemsPerChunk=32;fixedSize=1;minSize=1;maxSize=1;constructor(A){super(),this.typeName=A?.typeName??"boolean"}static named(A){return new(dI(ki,A.typeName))(A)}defaultValue(){return!1}value_serializeToBytes(A,g,B){return A.uint8Array[g]=B?1:0,g+1}value_deserializeFromBytes(A,g,B){switch(this.assertValidSize(B-g),A.uint8Array[g]){case 1:return!0;case 0:return!1;default:throw new Error(`Boolean: invalid value: ${A.uint8Array[g]}`)}}tree_serializeToBytes(A,g,B){return A.uint8Array[g]=B.getUint(4,0),g+1}tree_deserializeFromBytes(A,g,B){this.assertValidSize(B-g);const e=A.uint8Array[g];if(e>1)throw Error(`Boolean: invalid value ${e}`);return qA.fromUint32(e)}tree_getFromNode(A){return A.getUint(4,0)===1}tree_setToNode(A,g){A.setUint(4,0,g?1:0)}tree_getFromPackedNode(A,g){const B=g%this.itemsPerChunk;return A.getUint(1,B)!==0}tree_setToPackedNode(A,g,B){const e=g%this.itemsPerChunk;A.setUint(1,e,B?1:0)}fromJson(A){if(typeof A!="boolean")throw Error(`JSON invalid type ${typeof A} expected boolean`);return A}toJson(A){return A}}class HC extends jr{limitBytes;typeName;depth;chunkDepth;fixedSize=null;minSize;maxSize;maxChunkCount;isList=!0;blockArray=[];blockBytesLen=0;mixInLengthBlockBytes=new Uint8Array(64);mixInLengthBuffer=vA.from(this.mixInLengthBlockBytes.buffer,this.mixInLengthBlockBytes.byteOffset,this.mixInLengthBlockBytes.byteLength);constructor(A,g){if(super(),this.limitBytes=A,A===0)throw Error("List limit must be > 0");this.typeName=g?.typeName??`ByteList[${A}]`,this.maxChunkCount=Math.ceil(this.limitBytes/32),this.chunkDepth=Sg(this.maxChunkCount),this.depth=1+this.chunkDepth,this.minSize=0,this.maxSize=this.limitBytes}static named(A,g){return new(dI(HC,g.typeName))(A,g)}value_serializedSize(A){return A.length}tree_serializedSize(A){return eg(A)}tree_serializeToBytes(A,g,B){const e=Hr(B),Q=eg(B),C=Math.ceil(Q/32),i=tI(e,this.chunkDepth,0,C);return GC(A.dataView,g,Q,i),g+Q}tree_deserializeFromBytes(A,g,B){this.assertValidSize(B-g);const e=RC(this.chunkDepth,A.dataView,g,B);return qg(e,B-g)}tree_getByteLen(A){if(!A)throw new Error("ByteListType requires a node to get leaves");return eg(A)}hashTreeRoot(A){const g=oB(32);return this.hashTreeRootInto(A,g,0),g}hashTreeRootInto(A,g,B){if(A.length>this.blockBytesLen){const Q=Math.ceil(A.length/64),C=Math.ceil(this.blockBytesLen/64),i=Q-C,o=new Uint8Array(i*64);for(let D=0;D<i;D++)this.blockArray.push(o.subarray(D*64,(D+1)*64)),this.blockBytesLen+=64}for(let Q=0;Q<A.length;Q+=64){const C=this.blockArray[Q/64];Q+64>A.length&&C.fill(0),C.set(A.subarray(Q,Math.min(Q+64,A.length)))}const e=Math.ceil(A.length/64);wr(this.blockArray,e,this.maxChunkCount,this.mixInLengthBlockBytes,0),this.mixInLengthBuffer.writeUIntLE(A.length,32,6),xB(this.mixInLengthBlockBytes,2,g,B)}assertValidSize(A){if(A>this.limitBytes)throw Error(`ByteList invalid size ${A} limit ${this.limitBytes}`)}}class kI extends jr{lengthBytes;typeName;depth;chunkDepth;fixedSize;minSize;maxSize;maxChunkCount;isList=!1;constructor(A,g){if(super(),this.lengthBytes=A,A===0)throw Error("Vector length must be > 0");this.typeName=g?.typeName??`ByteVector[${A}]`,this.maxChunkCount=Math.ceil(this.lengthBytes/32),this.chunkDepth=Sg(this.maxChunkCount),this.depth=this.chunkDepth,this.fixedSize=this.lengthBytes,this.minSize=this.fixedSize,this.maxSize=this.fixedSize}static named(A,g){return new(dI(kI,g.typeName))(A,g)}value_serializedSize(){return this.fixedSize}tree_serializedSize(){return this.fixedSize}tree_serializeToBytes(A,g,B){const e=tI(B,this.chunkDepth,0,this.maxChunkCount);return GC(A.dataView,g,this.fixedSize,e),g+this.fixedSize}tree_deserializeFromBytes(A,g,B){return this.assertValidSize(B-g),RC(this.chunkDepth,A.dataView,g,B)}tree_getByteLen(){return this.lengthBytes}assertValidSize(A){if(A!==this.lengthBytes)throw Error(`ByteVector invalid size ${A} expected ${this.lengthBytes}`)}}const xr={snake:I=>I.replace(/[^0-z]/g,"").replace(/[a-z][A-Z]|[0-9][A-Z]/g,A=>`${A[0]}_${A[1].toLowerCase()}`),constant:I=>I.replace(/[^0-z]/g,"").replace(/[a-z][A-Z]|[0-9][A-Z]/g,A=>`${A[0]}_${A[1]}`).toUpperCase(),pascal:I=>(I[0].toUpperCase()+I.slice(1)).replace(/[^0-z]/g,""),camel:I=>I[0].toLowerCase()+I.slice(1),header:I=>I[0].toUpperCase()+I.slice(1).replace(/[^0-z]/g,"").replace(/[a-z][A-Z]|[0-9][A-Z]/g,A=>`${A[0]}-${A[1]}`),eth2:I=>xr.snake(I).replace(/(\d)$/,"_$1")};let A2=class extends zB{type;tree;constructor(I,A){super(),this.type=I,this.tree=A}get node(){return this.tree.rootNode}};function I2(I){class A extends A2{}for(let g=0;g<I.fieldsEntries.length;g++){const{fieldName:B,fieldType:e}=I.fieldsEntries[g];if(Gi(e))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){const Q=YI(this.node,this.type.depth,g);return e.tree_getFromNode(Q)},set:function(Q){const C=YI(this.node,this.type.depth,g).clone();e.tree_setToNode(C,Q),this.tree.setNodeAtDepth(this.type.depth,g,C)}});else if(NI(e))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){const Q=ii(this.type.depth,g);return e.getView(this.tree.getSubtree(Q))},set:function(Q){const C=e.commitView(Q);this.tree.setNodeAtDepth(this.type.depth,g,C)}});else throw Error(`Unknown fieldType ${e.typeName} for fieldName ${String(B)}`)}return Object.defineProperty(A,"name",{value:I.typeName,writable:!1}),A}class g2 extends JC{type;_rootNode;nodes=[];caches;nodesChanged=new Set;viewsChanged=new Map;nodesPopulated;constructor(A,g,B){super(),this.type=A,this._rootNode=g,B?(this.nodes=B.nodes,this.caches=B.caches,this.nodesPopulated=B.nodesPopulated):(this.nodes=[],this.caches=[],this.nodesPopulated=!1)}get node(){return this._rootNode}get cache(){return{nodes:this.nodes,caches:this.caches,nodesPopulated:this.nodesPopulated}}commit(A=0,g=null){const B=this._rootNode.h0!==null;if(this.nodesChanged.size===0&&this.viewsChanged.size===0){!B&&g!==null&&iI(this._rootNode,A,g);return}const e=A+this.type.depth,Q=g!=null&&B?g:null,C=[];for(const[a,U]of this.viewsChanged){const J=this.type.fieldsEntries[a].fieldType,f=J.commitViewDU(U,e,Q);this.nodes[a]!==f&&(this.nodes[a]=f,C.push({index:a,node:f}));const y=J.cacheOfViewDU(U);y&&(this.caches[a]=y)}for(const a of this.nodesChanged)C.push({index:a,node:this.nodes[a]});const i=C.sort((a,U)=>a.index-U.index),{indexes:o,nodes:D}=this.parseNodesChanged(i);this._rootNode=FC(this._rootNode,this.type.depth,o,D,A,B?g:null),!B&&g!==null&&iI(this._rootNode,A,g),this.nodesChanged.clear(),this.viewsChanged.clear()}parseNodesChanged(A){const g=A.map(e=>e.index),B=A.map(e=>e.node);return{indexes:g,nodes:B}}clearCache(){this.nodes=[],this.caches=[],this.nodesPopulated=!1,this.nodesChanged.clear(),this.viewsChanged.clear()}}class B2 extends g2{type;_rootNode;constructor(A,g,B){super(A,g,B),this.type=A,this._rootNode=g}serializeToBytes(A,g){this.commit();let B=g,e=g+this.type.fixedEnd;for(let Q=0;Q<this.type.fieldsEntries.length;Q++){const{fieldType:C}=this.type.fieldsEntries[Q];let i=this.nodes[Q];if(i===void 0&&(i=YI(this._rootNode,this.type.depth,Q),this.nodes[Q]=i),C.fixedSize===null){if(A.dataView.setUint32(B,e-g,!0),B+=4,NI(C)){const o=C.getViewDU(i,this.caches[Q]);o.serializeToBytes!==void 0?e=o.serializeToBytes(A,e):e=C.tree_serializeToBytes(A,e,i)}}else B=C.tree_serializeToBytes(A,B,i)}return e}}function C2(I){class A extends B2{}for(let g=0;g<I.fieldsEntries.length;g++){const{fieldName:B,fieldType:e}=I.fieldsEntries[g];if(Gi(e))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){let Q=this.nodes[g];return Q===void 0&&(Q=YI(this._rootNode,this.type.depth,g),this.nodes[g]=Q),e.tree_getFromNode(Q)},set:function(Q){let C;this.nodesChanged.has(g)?C=this.nodes[g]:(C=(this.nodes[g]??YI(this._rootNode,this.type.depth,g)).clone(),this.nodes[g]=C,this.nodesChanged.add(g)),e.tree_setToNode(C,Q)}});else if(NI(e))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){const Q=this.viewsChanged.get(g);if(Q)return Q;let C=this.nodes[g];C===void 0&&(C=YI(this._rootNode,this.type.depth,g),this.nodes[g]=C);const i=e.getViewDU(C,this.caches[g]);return e.isViewMutable&&this.viewsChanged.set(g,i),i},set:function(Q){this.viewsChanged.set(g,Q)}});else throw Error(`Unknown fieldType ${e.typeName} for fieldName ${String(B)}`)}return Object.defineProperty(A,"name",{value:I.typeName,writable:!1}),A}class K extends pC{fields;opts;typeName;depth;maxChunkCount;fixedSize;minSize;maxSize;isList=!1;isViewMutable=!0;fieldsEntries;fixedEnd;fieldsGindex;jsonKeyToFieldName;isFixedLen;fieldRangesFixedLen;variableOffsetsPosition;TreeView;TreeViewDU;constructor(A,g){super(g?.cachePermanentRootStruct),this.fields=A,this.opts=g,this.typeName=g?.typeName??zr(A),this.maxChunkCount=Object.keys(A).length,this.depth=Sg(this.maxChunkCount),this.fieldsEntries=[];for(const U of Object.keys(A))this.fieldsEntries.push({fieldName:U,fieldType:this.fields[U],jsonKey:t2(U,g?.casingMap,g?.jsonCase),gindex:mg(this.depth,BigInt(this.fieldsEntries.length))});if(this.fieldsEntries.length===0)throw Error("Container must have > 0 fields");this.fieldsGindex={};for(let U=0;U<this.fieldsEntries.length;U++)this.fieldsGindex[this.fieldsEntries[U].fieldName]=mg(this.depth,BigInt(U));this.jsonKeyToFieldName={};for(const{fieldName:U,jsonKey:J}of this.fieldsEntries)this.jsonKeyToFieldName[J]=U;const{minLen:B,maxLen:e,fixedSize:Q}=i2(A);this.minSize=B,this.maxSize=e,this.fixedSize=Q;const{isFixedLen:C,fieldRangesFixedLen:i,variableOffsetsPosition:o,fixedEnd:D}=e2(A);this.isFixedLen=C,this.fieldRangesFixedLen=i,this.variableOffsetsPosition=o,this.fixedEnd=D,this.TreeView=g?.getContainerTreeViewClass?.(this)??I2(this),this.TreeViewDU=g?.getContainerTreeViewDUClass?.(this)??C2(this);const a=this.fieldsEntries.length*32;this.blocksBuffer=new Uint8Array(Math.ceil(a/64)*64)}static named(A,g){return new(dI(K,g.typeName))(A,g)}defaultValue(){const A={};for(const{fieldName:g,fieldType:B}of this.fieldsEntries)A[g]=B.defaultValue();return A}getView(A){return new this.TreeView(this,A)}getViewDU(A,g){return new this.TreeViewDU(this,A,g)}cacheOfViewDU(A){return A.cache}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}value_serializedSize(A){let g=0;for(let B=0;B<this.fieldsEntries.length;B++){const{fieldName:e,fieldType:Q}=this.fieldsEntries[B];g+=Q.fixedSize===null?4+Q.value_serializedSize(A[e]):Q.fixedSize}return g}value_serializeToBytes(A,g,B){let e=g,Q=g+this.fixedEnd;for(let C=0;C<this.fieldsEntries.length;C++){const{fieldName:i,fieldType:o}=this.fieldsEntries[C];o.fixedSize===null?(A.dataView.setUint32(e,Q-g,!0),e+=4,Q=o.value_serializeToBytes(A,Q,B[i])):e=o.value_serializeToBytes(A,e,B[i])}return Q}value_deserializeFromBytes(A,g,B){const e=this.getFieldRanges(A.dataView,g,B),Q={};for(let C=0;C<this.fieldsEntries.length;C++){const{fieldName:i,fieldType:o}=this.fieldsEntries[C],D=e[C];Q[i]=o.value_deserializeFromBytes(A,g+D.start,g+D.end)}return Q}tree_serializedSize(A){let g=0;const B=tI(A,this.depth,0,this.fieldsEntries.length);for(let e=0;e<this.fieldsEntries.length;e++){const{fieldType:Q}=this.fieldsEntries[e],C=B[e];g+=Q.fixedSize===null?4+Q.tree_serializedSize(C):Q.fixedSize}return g}tree_serializeToBytes(A,g,B){let e=g,Q=g+this.fixedEnd;const C=tI(B,this.depth,0,this.fieldsEntries.length);for(let i=0;i<this.fieldsEntries.length;i++){const{fieldType:o}=this.fieldsEntries[i],D=C[i];o.fixedSize===null?(A.dataView.setUint32(e,Q-g,!0),e+=4,Q=o.tree_serializeToBytes(A,Q,D)):e=o.tree_serializeToBytes(A,e,D)}return Q}tree_deserializeFromBytes(A,g,B){const e=this.getFieldRanges(A.dataView,g,B),Q=new Array(this.fieldsEntries.length);for(let C=0;C<this.fieldsEntries.length;C++){const{fieldType:i}=this.fieldsEntries[C],o=e[C];Q[C]=i.tree_deserializeFromBytes(A,g+o.start,g+o.end)}return uC(Q,this.depth)}getBlocksBytes(A){for(let g=0;g<this.fieldsEntries.length;g++){const{fieldName:B,fieldType:e}=this.fieldsEntries[g];e.hashTreeRootInto(A[B],this.blocksBuffer,g*32)}return this.blocksBuffer}getPropertyGindex(A){const g=this.fieldsGindex[A]??this.fieldsGindex[this.jsonKeyToFieldName[A]];if(g===void 0)throw Error(`Unknown container property ${A}`);return g}getPropertyType(A){const g=this.fields[A]??this.fields[this.jsonKeyToFieldName[A]];if(g===void 0)throw Error(`Unknown container property ${A}`);return g}getIndexProperty(A){return A>=this.fieldsEntries.length?null:this.fieldsEntries[A].fieldName}tree_getLeafGindices(A,g){const B=[];for(let e=0;e<this.fieldsEntries.length;e++){const{fieldName:Q,fieldType:C}=this.fieldsEntries[e],i=this.fieldsGindex[Q],o=yI([A,i]);if(C.isBasic)B.push(o);else{const D=C;if(C.fixedSize===null){if(!g)throw new Error("variable type requires tree argument to get leaves");B.push(...D.tree_getLeafGindices(o,kC(g,i)))}else B.push(...D.tree_getLeafGindices(o))}}return B}fromJson(A){if(typeof A!="object")throw Error("JSON must be of type object");if(A===null)throw Error("JSON must not be null");const g={};for(let B=0;B<this.fieldsEntries.length;B++){const{fieldName:e,fieldType:Q,jsonKey:C}=this.fieldsEntries[B],i=A[C];if(i===void 0)throw Error(`JSON expected key ${C} is undefined`);g[e]=Q.fromJson(i)}return g}toJson(A){const g={};for(let B=0;B<this.fieldsEntries.length;B++){const{fieldName:e,fieldType:Q,jsonKey:C}=this.fieldsEntries[B];g[C]=Q.toJson(A[e])}return g}clone(A){const g={};for(let B=0;B<this.fieldsEntries.length;B++){const{fieldName:e,fieldType:Q}=this.fieldsEntries[B];g[e]=Q.clone(A[e])}return g}equals(A,g){for(let B=0;B<this.fieldsEntries.length;B++){const{fieldName:e,fieldType:Q}=this.fieldsEntries[B];if(!Q.equals(A[e],g[e]))return!1}return!0}getFieldRanges(A,g,B){if(this.variableOffsetsPosition.length===0){const o=B-g;if(o!==this.fixedEnd)throw Error(`${this.typeName} size ${o} not equal fixed size ${this.fixedEnd}`);return this.fieldRangesFixedLen}const e=Q2(A,g,B,this.fixedEnd,this.variableOffsetsPosition);e.push(B-g);let Q=0,C=0;const i=new Array(this.isFixedLen.length);for(let o=0;o<this.isFixedLen.length;o++)this.isFixedLen[o]?i[o]=this.fieldRangesFixedLen[C++]:(i[o]={start:e[Q],end:e[Q+1]},Q++);return i}}function Q2(I,A,g,B,e){const Q=g-A,C=new Array(e.length);for(let i=0;i<e.length;i++){const o=I.getUint32(A+e[i],!0);if(o>Q)throw new Error(`Offset out of bounds ${o} > ${Q}`);if(i===0){if(o!==B)throw new Error(`First offset must equal to fixedEnd ${o} != ${B}`)}else if(o<C[i-1])throw new Error(`Offsets must be increasing ${o} < ${C[i-1]}`);C[i]=o}return C}function e2(I){const A=[],g=[],B=[];let e=0;for(const Q of Object.values(I))A.push(Q.fixedSize!==null),Q.fixedSize===null?(B.push(e),e+=4):(g.push({start:e,end:e+Q.fixedSize}),e+=Q.fixedSize);return{isFixedLen:A,fieldRangesFixedLen:g,variableOffsetsPosition:B,fixedEnd:e}}function i2(I){let A=0,g=0,B=0;for(const e of Object.values(I))A+=e.minSize,g+=e.maxSize,e.fixedSize===null?(A+=4,g+=4,B=null):B!==null&&(B+=e.fixedSize);return{minLen:A,maxLen:g,fixedSize:B}}function t2(I,A,g){if(A){const B=A[I];if(B===void 0)throw Error(`casingMap[${String(I)}] not defined`);return B}return g?xr[g](I):I}function zr(I,A="Container"){const g=Object.keys(I).map(B=>`${String(B)}: ${I[B].typeName}`).join(", ");return`${A}({${g}})`}class MC extends si{valueToNode;value;constructor(A,g){super(null,0,0,0,0,0,0,0),this.valueToNode=A,this.value=g}get rootHashObject(){if(this.h0===null){const A=this.valueToNode(this.value);super.applyHash(A.rootHashObject)}return this}get root(){return dC(this.rootHashObject)}get left(){return this.valueToNode(this.value).left}get right(){return this.valueToNode(this.value).right}isLeaf(){return!1}}class E2 extends zB{type;tree;constructor(A,g){super(),this.type=A,this.tree=g}get node(){return this.tree.rootNode}}function o2(I){class A extends E2{}for(let g=0;g<I.fieldsEntries.length;g++){const{fieldName:B,fieldType:e}=I.fieldsEntries[g];if(e.isBasic)Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){return this.tree.rootNode.value[B]},set:function(Q){const C=this.tree.rootNode,i=this.type.clone(C.value);i[B]=Q,this.tree.rootNode=new MC(C.valueToNode,i)}});else if(NI(e))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){const{value:Q}=this.tree.rootNode;return e.toView(Q[B])},set:function(Q){const C=this.tree.rootNode,i=this.type.clone(C.value);i[B]=e.toValueFromView(Q),this.tree.rootNode=new MC(C.valueToNode,i)}});else throw Error(`Unknown fieldType ${e.typeName} for fieldName ${String(B)}`)}return Object.defineProperty(A,"name",{value:I.typeName,writable:!1}),A}class r2 extends JC{type;valueChanged=null;_rootNode;constructor(A,g){super(),this.type=A,this._rootNode=g}get node(){return this._rootNode}get cache(){}get value(){return this.valueChanged??this._rootNode.value}commit(A,g=null){if(this.valueChanged!==null){const B=this.valueChanged;this.valueChanged=null,this._rootNode=this.type.value_toTree(B)}this._rootNode.h0===null&&g!==null&&this._rootNode.rootHashObject}clearCache(){this.valueChanged=null}}function n2(I){class A extends r2{}for(let g=0;g<I.fieldsEntries.length;g++){const{fieldName:B,fieldType:e}=I.fieldsEntries[g];if(e.isBasic)Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){return(this.valueChanged||this._rootNode.value)[B]},set:function(Q){this.valueChanged===null&&(this.valueChanged=this.type.clone(this._rootNode.value)),this.valueChanged[B]=Q}});else if(NI(e))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){const Q=this.valueChanged||this._rootNode.value;return e.toViewDU(Q[B])},set:function(Q){this.valueChanged===null&&(this.valueChanged=this.type.clone(this._rootNode.value));const C=e.toValueFromViewDU(Q);this.valueChanged[B]=C}});else throw Error(`Unknown fieldType ${e.typeName} for fieldName ${String(B)}`)}return Object.defineProperty(A,"name",{value:I.typeName,writable:!1}),A}class a2 extends K{fields;constructor(A,g){super(A,{typeName:g?.typeName??zr(A,"ContainerNodeStruct"),...g,getContainerTreeViewClass:o2,getContainerTreeViewDUClass:n2}),this.fields=A;for(const{fieldName:B,fieldType:e}of this.fieldsEntries)if(NI(e)&&e.isViewMutable)throw Error(`ContainerNodeStructType field '${String(B)}' ${e.typeName} view is mutable`)}static named(A,g){return new(dI(K,g.typeName))(A,g)}tree_serializedSize(A){return this.value_serializedSize(A.value)}tree_serializeToBytes(A,g,B){const{value:e}=B;return this.value_serializeToBytes(A,g,e)}tree_deserializeFromBytes(A,g,B){const e=this.value_deserializeFromBytes(A,g,B);return new MC(this.valueToTree.bind(this),e)}getPropertyGindex(){return null}tree_fromProofNode(A){const g=new Uint8Array(super.tree_serializedSize(A)),B=new DataView(g.buffer,g.byteOffset,g.byteLength);super.tree_serializeToBytes({uint8Array:g,dataView:B},0,A);const e=this.value_deserializeFromBytes({uint8Array:g,dataView:B},0,g.length);return{node:new MC(this.valueToTree.bind(this),e),done:!0}}tree_toValue(A){return A.value}value_toTree(A){return new MC(this.valueToTree.bind(this),A)}valueToTree(A){const g=new Uint8Array(this.value_serializedSize(A)),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return this.value_serializeToBytes({uint8Array:g,dataView:B},0,A),super.tree_deserializeFromBytes({uint8Array:g,dataView:B},0,g.length)}}class vr extends zB{type;tree;constructor(A,g){super(),this.type=A,this.tree=g}get length(){return this.type.tree_getLength(this.tree.rootNode)}get node(){return this.tree.rootNode}get(A){const g=Math.floor(A/this.type.itemsPerChunk),B=this.tree.getNodeAtDepth(this.type.depth,g);return this.type.elementType.tree_getFromPackedNode(B,A)}set(A,g){const B=this.length;if(A>=B)throw Error(`Error setting index over length ${A} > ${B}`);const e=Math.floor(A/this.type.itemsPerChunk),Q=this.tree.getNodeAtDepth(this.type.depth,e).clone();this.type.elementType.tree_setToPackedNode(Q,A,g),this.tree.setNodeAtDepth(this.type.depth,e,Q)}getAll(A){if(A&&A.length!==this.length)throw Error(`Expected ${this.length} values, got ${A.length}`);const g=this.length,B=this.type.tree_getChunksNode(this.node),e=Math.ceil(g/this.type.itemsPerChunk),Q=tI(B,this.type.chunkDepth,0,e);A=A??new Array(g);const C=this.type.itemsPerChunk,i=Math.floor(g/C),o=g%C;for(let D=0;D<i;D++){const a=Q[D];for(let U=0;U<C;U++)A[D*C+U]=this.type.elementType.tree_getFromPackedNode(a,U)}if(o>0){const D=Q[i];for(let a=0;a<o;a++)A[i*C+a]=this.type.elementType.tree_getFromPackedNode(D,a)}return A}}class s2 extends vr{type;tree;constructor(A,g){super(A,g),this.type=A,this.tree=g}push(A){const g=this.length;if(g>=this.type.limit)throw Error("Error pushing over limit");if(this.type.tree_setLength(this.tree,g+1),g%this.type.itemsPerChunk===0){const B=qA.fromZero();this.type.elementType.tree_setToPackedNode(B,g,A);const e=Math.floor(g/this.type.itemsPerChunk);this.tree.setNodeAtDepth(this.type.depth,e,B)}else this.set(g,A)}}class Wr extends JC{type;_rootNode;nodes;nodesChanged=new Set;_length;dirtyLength=!1;nodesPopulated;constructor(A,g,B){super(),this.type=A,this._rootNode=g,B?(this.nodes=B.nodes,this._length=B.length,this.nodesPopulated=B.nodesPopulated):(this.nodes=[],this._length=this.type.tree_getLength(g),this.nodesPopulated=!1)}get length(){return this._length}get node(){return this._rootNode}get cache(){return{nodes:this.nodes,length:this._length,nodesPopulated:this.nodesPopulated}}get(A){const g=Math.floor(A/this.type.itemsPerChunk);let B=this.nodes[g];return B===void 0&&(B=YI(this._rootNode,this.type.depth,g),this.nodes[g]=B),this.type.elementType.tree_getFromPackedNode(B,A)}set(A,g){if(A>=this._length)throw Error(`Error setting index over length ${A} > ${this._length}`);const B=Math.floor(A/this.type.itemsPerChunk);let e;this.nodesChanged.has(B)?e=this.nodes[B]:(e=(this.nodes[B]??YI(this._rootNode,this.type.depth,B)).clone(),this.nodes[B]=e,this.nodesChanged.add(B)),this.type.elementType.tree_setToPackedNode(e,A,g)}getAll(A){if(A&&A.length!==this._length)throw Error(`Expected ${this._length} values, got ${A.length}`);if(!this.nodesPopulated){const Q=this.nodes,C=this.type.tree_getChunksNode(this.node),i=Math.ceil(this._length/this.type.itemsPerChunk);this.nodes=tI(C,this.type.chunkDepth,0,i);for(const o of this.nodesChanged)this.nodes[o]=Q[o];this.nodesPopulated=!0}A=A??new Array(this._length);const g=this.type.itemsPerChunk,B=Math.floor(this._length/g),e=this._length%g;for(let Q=0;Q<B;Q++){const C=this.nodes[Q];for(let i=0;i<g;i++)A[Q*g+i]=this.type.elementType.tree_getFromPackedNode(C,i)}if(e>0){const Q=this.nodes[B];for(let C=0;C<e;C++)A[B*g+C]=this.type.elementType.tree_getFromPackedNode(Q,C)}return A}commit(A=0,g=null){const B=this._rootNode.h0!==null;if(this.nodesChanged.size===0){!B&&g!==null&&iI(this._rootNode,A,g);return}const e=Array.from(this.nodesChanged.keys()).sort((a,U)=>a-U),Q=new Array(e.length);for(let a=0;a<e.length;a++)Q[a]=this.nodes[e[a]];const C=this.type.tree_getChunksNode(this._rootNode),i=A+this.type.tree_chunksNodeOffset(),o=g!=null&&B?g:null,D=FC(C,this.type.chunkDepth,e,Q,i,o);this._rootNode=this.type.tree_setChunksNode(this._rootNode,D,this.dirtyLength?this._length:null,A,B?g:null),!B&&g!==null&&iI(this._rootNode,A,g),this.nodesChanged.clear(),this.dirtyLength=!1}clearCache(){this.nodes=[],this.nodesPopulated=!1,this.nodesChanged.clear(),this.dirtyLength&&(this._length=this.type.tree_getLength(this._rootNode),this.dirtyLength=!1)}}class h2 extends Wr{type;_rootNode;constructor(A,g,B){super(A,g,B),this.type=A,this._rootNode=g}push(A){if(this._length>=this.type.limit)throw Error("Error pushing over limit");this.dirtyLength=!0;const g=this._length++;if(g%this.type.itemsPerChunk===0){const B=Math.floor(g/this.type.itemsPerChunk);this.nodes[B]=Yg(0)}this.set(g,A)}sliceTo(A){if(A<0)throw new Error(`Does not support sliceTo() with negative index ${A}`);if(this.commit(),A>=this._length-1)return this;const g=this._rootNode,B=Math.floor(A/this.type.itemsPerChunk),e=this.nodes[B]??YI(g,this.type.depth,B),Q=qA.fromZero();for(let a=B*this.type.itemsPerChunk;a<=A;a++){const U=this.type.elementType.tree_getFromPackedNode(e,a);this.type.elementType.tree_setToPackedNode(Q,a,U)}const C=this.type.tree_getChunksNode(this._rootNode);let i=FC(C,this.type.chunkDepth,[B],[Q]);i=Fr(i,this.type.chunkDepth,B);const o=A+1,D=this.type.tree_setChunksNode(g,i,o);return this.type.getViewDU(D)}serializeToBytes(A,g){this.commit();const{nodes:B,nodesPopulated:e}=this.cache,Q=this.type.tree_getChunksNode(this._rootNode);return di(this.type.elementType,this._length,this.type.chunkDepth,A,g,Q,e?B:null)}}class FQ extends pC{elementType;constructor(A,g){super(g),this.elementType=A}defaultValue(){return vf(this.elementType,this.defaultLen)}getPropertyType(){return this.elementType}getPropertyGindex(A){if(typeof A!="number")throw Error(`Invalid array index: ${A}`);const g=Math.floor(A/this.itemsPerChunk);return mg(this.depth,BigInt(g))}getIndexProperty(A){return A}tree_getLeafGindices(A,g){let B;if(this.isList){if(!g)throw new Error("List type requires tree argument to get leaves");B=this.tree_getLength(g)}else B=this.tree_getLength(null);const e=[];if(NI(this.elementType)){const Q=mg(this.depth,BigInt(0)),C=Q+BigInt(B),i=yI([A,Q]);if(this.elementType.fixedSize===null){if(!g)throw new Error("Array of variable size requires tree argument to get leaves");for(let o=Q,D=i;o<C;o++,D++)e.push(...this.elementType.tree_getLeafGindices(D,kC(g,o)))}else for(let o=0,D=i;o<B;o++,D++)e.push(...this.elementType.tree_getLeafGindices(D))}else{const Q=Math.ceil(B/this.itemsPerChunk),C=yI([A,mg(this.depth,BigInt(0))]),i=C+BigInt(Q);for(let o=C;o<i;o++)e.push(o)}return this.isList&&e.push(yI([A,Ri])),e}fromJson(A){return Pf(this.elementType,A,this)}toJson(A){return Of(this.elementType,A,this)}clone(A){return xf(this.elementType,A)}equals(A,g){return zf(this.elementType,A,g)}}class bI extends FQ{elementType;limit;typeName;itemsPerChunk;depth;chunkDepth;maxChunkCount;fixedSize=null;minSize;maxSize;isList=!0;isViewMutable=!0;mixInLengthBlockBytes=new Uint8Array(64);mixInLengthBuffer=vA.from(this.mixInLengthBlockBytes.buffer,this.mixInLengthBlockBytes.byteOffset,this.mixInLengthBlockBytes.byteLength);defaultLen=0;constructor(A,g,B){if(super(A,B?.cachePermanentRootStruct),this.elementType=A,this.limit=g,!A.isBasic)throw Error("elementType must be basic");if(g===0)throw Error("List limit must be > 0");this.typeName=B?.typeName??`List[${A.typeName}, ${g}]`,this.itemsPerChunk=32/A.byteLength,this.maxChunkCount=Math.ceil(this.limit*A.byteLength/32),this.chunkDepth=Sg(this.maxChunkCount),this.depth=this.chunkDepth+1,this.minSize=0,this.maxSize=this.limit*A.maxSize}static named(A,g,B){return new(dI(bI,B.typeName))(A,g,B)}getView(A){return new s2(this,A)}getViewDU(A,g){return new h2(this,A,g)}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}cacheOfViewDU(A){return A.cache}value_serializedSize(A){return A.length*this.elementType.byteLength}value_serializeToBytes(A,g,B){return NQ(this.elementType,B.length,A,g,B)}value_deserializeFromBytes(A,g,B){return mr(this.elementType,A,g,B,this)}tree_serializedSize(A){return this.tree_getLength(A)*this.elementType.byteLength}tree_serializeToBytes(A,g,B){const e=this.tree_getChunksNode(B),Q=this.tree_getLength(B);return di(this.elementType,Q,this.chunkDepth,A,g,e)}tree_deserializeFromBytes(A,g,B){return Lr(this.elementType,this.chunkDepth,A,g,B,this)}tree_getLength(A){return A.right.getUint(4,0)}tree_setLength(A,g){A.rootNode=qg(A.rootNode.left,g)}tree_getChunksNode(A){return A.left}tree_chunksNodeOffset(){return 1}tree_setChunksNode(A,g,B,e=0,Q=null){return Mr(A,g,B,e,Q)}hashTreeRoot(A){if(this.cachePermanentRootStruct){const B=A[Tg];if(B)return B}const g=oB(32);return this.hashTreeRootInto(A,g,0,!0),g}hashTreeRootInto(A,g,B,e=!1){if(this.cachePermanentRootStruct){const Q=A[Tg];if(Q){g.set(Q,B);return}}super.hashTreeRootInto(A,this.mixInLengthBlockBytes,0),this.mixInLengthBuffer.writeUIntLE(A.length,32,6),xB(this.mixInLengthBlockBytes,2,g,B),this.cachePermanentRootStruct&&wi(A,g,B,e)}getBlocksBytes(A){const g=this.value_serializedSize(A),B=Math.ceil(g/64)*64;g>this.blocksBuffer.length&&(this.blocksBuffer=new Uint8Array(B));const e=this.blocksBuffer.subarray(0,B),Q=e.subarray(0,g),C=new DataView(Q.buffer,Q.byteOffset,Q.byteLength);return NQ(this.elementType,A.length,{uint8Array:Q,dataView:C},0,A),this.blocksBuffer.subarray(g,B).fill(0),e}}class Xr extends zB{type;tree;constructor(A,g){super(),this.type=A,this.tree=g}get length(){return this.type.tree_getLength(this.tree.rootNode)}get node(){return this.tree.rootNode}get(A){const g=ii(this.type.depth,A),B=this.tree.getSubtree(g);return this.type.elementType.getView(B)}getReadonly(A){const g=ii(this.type.depth,A),B=new GI(this.tree.getNode(g));return this.type.elementType.getView(B)}set(A,g){const B=this.length;if(A>=B)throw Error(`Error setting index over length ${A} > ${B}`);const e=this.type.elementType.commitView(g);this.tree.setNodeAtDepth(this.type.depth,A,e)}getAllReadonly(A){if(A&&A.length!==this.length)throw Error(`Expected ${this.length} views, got ${A.length}`);const g=this.length,B=this.type.tree_getChunksNode(this.node),e=tI(B,this.type.chunkDepth,0,g);A=A??new Array(g);for(let Q=0;Q<g;Q++)A[Q]=this.type.elementType.getView(new GI(e[Q]));return A}getAllReadonlyValues(A){if(A&&A.length!==this.length)throw Error(`Expected ${this.length} values, got ${A.length}`);const g=this.length,B=this.type.tree_getChunksNode(this.node),e=tI(B,this.type.chunkDepth,0,g);A=A??new Array(g);for(let Q=0;Q<g;Q++)A[Q]=this.type.elementType.tree_toValue(e[Q]);return A}}class l2 extends Xr{type;tree;constructor(A,g){super(A,g),this.type=A,this.tree=g}push(A){const g=this.length;if(g>=this.type.limit)throw Error("Error pushing over limit");this.type.tree_setLength(this.tree,g+1),this.set(g,A)}}function c2(I,A){return I.fixedSize===null?A*(4+I.minSize):A*I.minSize}function $r(I,A){return I.fixedSize===null?A*(4+I.maxSize):A*I.maxSize}function An(I,A,g){if(I.fixedSize===null){let B=0;for(let e=0;e<A;e++)B+=4+I.value_serializedSize(g[e]);return B}return A*I.fixedSize}function In(I,A,g,B,e){if(I.fixedSize===null){let Q=B+A*4;for(let C=0;C<A;C++)g.dataView.setUint32(B+C*4,Q-B,!0),Q=I.value_serializeToBytes(g,Q,e[C]);return Q}for(let Q=0;Q<A;Q++)I.value_serializeToBytes(g,B+Q*I.fixedSize,e[Q]);return B+A*I.fixedSize}function gn(I,A,g,B,e){const Q=Qn(I.fixedSize,A.dataView,g,B,e),C=Q.length,i=new Array(C);for(let o=0;o<C;o++){const D=g+Q[o],a=o===C-1?B:g+Q[o+1];i[o]=I.value_deserializeFromBytes(A,D,a)}return i}function Bn(I,A,g,B){if(I.fixedSize===null){const e=tI(B,g,0,A);let Q=0;for(let C=0;C<e.length;C++)Q+=4+I.tree_serializedSize(e[C]);return Q}return A*I.fixedSize}function Fi(I,A,g,B,e,Q,C=null){const i=C??tI(B,g,0,A);if(I.fixedSize===null){let o=Q+A*4;const{dataView:D}=e;for(let a=0;a<i.length;a++)D.setUint32(Q+a*4,o-Q,!0),o=I.tree_serializeToBytes(e,o,i[a]);return o}for(let o=0;o<i.length;o++)Q=I.tree_serializeToBytes(e,Q,i[o]);return Q}function Cn(I,A,g,B,e,Q){const C=Qn(I.fixedSize,g.dataView,B,e,Q),i=C.length,o=new Array(i);for(let a=0;a<i;a++){const U=B+C[a],J=a===i-1?e:B+C[a+1];o[a]=I.tree_deserializeFromBytes(g,U,J)}const D=uC(o,A);return Q.isList?qg(D,i):D}function D2(I,A,g,B){const e=Math.ceil(A/2)*64;if(e>B.length)throw new Error(`blocksBuffer is too small: ${B.length} < ${e}`);const Q=B.subarray(0,e);for(let C=0;C<A;C++)I.hashTreeRootInto(g[C],Q,C*32);return A%2===1&&Q.subarray(A*32,e).fill(0),Q}function Qn(I,A,g,B,e){const Q=B-g;let C;if(I===null)C=U2(A,g,Q);else{if(I===0)throw Error("element fixed length is 0");if(Q%I!==0)throw Error(`size ${Q} is not multiple of element fixedSize ${I}`);const i=Q/I;C=new Uint32Array(i);for(let o=0;o<i;o++)C[o]=o*I}return uQ(C.length,e),C}function U2(I,A,g){if(g===0)return new Uint32Array(0);const B=I.getUint32(A,!0),e=B;if(B===0)throw Error("First offset must be > 0");if(e%4!==0)throw Error("Offset data length not multiple of 4");const Q=e/4,C=new Uint32Array(Q);C[0]=B;for(let i=1;i<Q;i++){const o=I.getUint32(A+i*4,!0);if(C[i]=o,o>g)throw new Error(`Offset out of bounds ${o} > ${g}`);if(o<C[i-1])throw new Error(`Offsets must be increasing ${o} < ${C[i-1]}`)}return C}function f2(I){return{finalized:[],count:0,root:_f(OB(I),OB(0))}}class en extends JC{type;_rootNode;nodes;caches;viewsChanged=new Map;_length;dirtyLength=!1;nodesPopulated;constructor(A,g,B){super(),this.type=A,this._rootNode=g,B?(this.nodes=B.nodes,this.caches=B.caches,this._length=B.length,this.nodesPopulated=B.nodesPopulated):(this.nodes=[],this.caches=[],this._length=this.type.tree_getLength(g),this.nodesPopulated=this._length===0)}get length(){return this._length}get node(){return this._rootNode}get cache(){return{nodes:this.nodes,caches:this.caches,length:this._length,nodesPopulated:this.nodesPopulated}}get(A){const g=this.viewsChanged.get(A);if(g)return g;let B=this.nodes[A];B===void 0&&(B=YI(this._rootNode,this.type.depth,A),this.nodes[A]=B);const e=this.type.elementType.getViewDU(B,this.caches[A]);return this.type.elementType.isViewMutable&&this.viewsChanged.set(A,e),e}getReadonly(A){const g=this.viewsChanged.get(A);if(g)return g;let B=this.nodes[A];return B===void 0&&(B=YI(this._rootNode,this.type.depth,A),this.nodes[A]=B),this.type.elementType.getViewDU(B,this.caches[A])}set(A,g){if(A>=this._length)throw Error(`Error setting index over length ${A} > ${this._length}`);this.viewsChanged.set(A,g)}getAllReadonly(A){if(A&&A.length!==this._length)throw Error(`Expected ${this._length} views, got ${A.length}`);this.populateAllOldNodes(),A=A??new Array(this._length);for(let g=0;g<this._length;g++)A[g]=this.getReadonly(g);return A}forEach(A){this.populateAllOldNodes();for(let g=0;g<this._length;g++)A(this.getReadonly(g),g)}getAllReadonlyValues(A){if(A&&A.length!==this._length)throw Error(`Expected ${this._length} values, got ${A.length}`);this.populateAllNodes(),A=A??new Array(this._length);for(let g=0;g<this._length;g++)A[g]=this.type.elementType.tree_toValue(this.nodes[g]);return A}forEachValue(A){this.populateAllNodes();for(let g=0;g<this._length;g++)A(this.type.elementType.tree_toValue(this.nodes[g]),g)}getReadonlyByRange(A,g){if(A<0)throw Error(`Error getting by range, startIndex < 0: ${A}`);if(g<=0)throw Error(`Error getting by range, count <= 0: ${g}`);const B=this.dirtyLength?this.type.tree_getLength(this._rootNode):this._length;if(A>=B)throw Error(`Error getting by range, startIndex >= length: ${A} >= ${B}`);g=Math.min(g,B-A);let e=!0;for(let C=A;C<A+g;C++)if(this.nodes[C]==null){e=!1;break}if(!e){const C=tI(this._rootNode,this.type.depth,A,g);for(const[i,o]of C.entries())this.nodes[A+i]=o}const Q=new Array(g);for(let C=0;C<g;C++)Q[C]=this.getReadonly(A+C);return Q}commit(A=0,g=null){const B=this._rootNode.h0!==null;if(this.viewsChanged.size===0){!B&&g!==null&&iI(this._rootNode,A,g);return}const e=A+this.type.depth,Q=g!=null&&B?g:null,C=[];for(const[y,S]of this.viewsChanged){const R=this.type.elementType.commitViewDU(S,e,Q);this.nodes[y]!==R&&(this.nodes[y]=R,C.push({index:y,node:R}));const N=this.type.elementType.cacheOfViewDU(S);N&&(this.caches[y]=N)}const i=C.sort((y,S)=>y.index-S.index),o=i.map(y=>y.index),D=i.map(y=>y.node),a=this.type.tree_getChunksNode(this._rootNode),U=A+this.type.tree_chunksNodeOffset(),J=g!=null&&B?g:null,f=FC(a,this.type.chunkDepth,o,D,U,J);this._rootNode=this.type.tree_setChunksNode(this._rootNode,f,this.dirtyLength?this._length:null,A,g),!B&&g!==null&&iI(this._rootNode,A,g),this.viewsChanged.clear(),this.dirtyLength=!1}clearCache(){this.nodes=[],this.caches=[],this.nodesPopulated=!1,this.viewsChanged.clear(),this.dirtyLength&&(this._length=this.type.tree_getLength(this._rootNode),this.dirtyLength=!1)}populateAllNodes(){if(this.viewsChanged.size>0)throw Error("Must commit changes before reading all nodes");this.nodesPopulated||(this.nodes=tI(this._rootNode,this.type.depth,0,this.length),this.nodesPopulated=!0)}populateAllOldNodes(){if(!this.nodesPopulated){const A=this.dirtyLength?this.type.tree_getLength(this._rootNode):this._length;this.nodes=tI(this._rootNode,this.type.depth,0,A),this.nodesPopulated=!0}}}class S2 extends en{type;_rootNode;constructor(A,g,B){super(A,g,B),this.type=A,this._rootNode=g}push(A){if(this._length>=this.type.limit)throw Error("Error pushing over limit");this.dirtyLength=!0;const g=this._length++;this.set(g,A)}sliceTo(A){this.commit();const g=this._rootNode,B=this._length;if(A>=B-1)return this;const e=this.type.tree_getChunksNode(g),Q=Fr(e,this.type.chunkDepth,A),C=A+1,i=this.type.tree_setChunksNode(g,Q,C);return this.rootNodeToViewDU(i)}sliceFrom(A){if(this.commit(),this.populateAllNodes(),A<0&&(A+=this.nodes.length),A<=0)return this;let g,B;if(A>=this.nodes.length)g=Yg(this.type.chunkDepth),B=0;else{const Q=this.nodes.slice(A);g=uC(Q,this.type.chunkDepth),B=Q.length}const e=this.type.tree_setChunksNode(this._rootNode,g,B);return this.rootNodeToViewDU(e)}toSnapshot(A){if(this.commit(),A<0||A>this._length)throw Error(`Invalid count ${A}, length is ${this._length}`);if(A===0)return f2(this.type.chunkDepth);const g=this.sliceTo(A-1)._rootNode,B=this.type.tree_getChunksNode(g);return{...Vf(B,this.type.chunkDepth,A),root:g.root}}serializeToBytes(A,g){this.commit(),this.populateAllNodes();const B=this.type.tree_getChunksNode(this._rootNode);return Fi(this.type.elementType,this._length,this.type.chunkDepth,B,A,g,this.nodes)}rootNodeToViewDU(A){return this.type.getViewDU(A)}}class wA extends FQ{elementType;limit;typeName;itemsPerChunk=1;depth;chunkDepth;maxChunkCount;fixedSize=null;minSize;maxSize;isList=!0;isViewMutable=!0;blockArray=[];mixInLengthBlockBytes=new Uint8Array(64);mixInLengthBuffer=vA.from(this.mixInLengthBlockBytes.buffer,this.mixInLengthBlockBytes.byteOffset,this.mixInLengthBlockBytes.byteLength);defaultLen=0;constructor(A,g,B){if(super(A,B?.cachePermanentRootStruct),this.elementType=A,this.limit=g,A.isBasic)throw Error("elementType must not be basic");if(g===0)throw Error("List limit must be > 0");this.typeName=B?.typeName??`List[${A.typeName}, ${g}]`,this.maxChunkCount=this.limit,this.chunkDepth=Sg(this.maxChunkCount),this.depth=this.chunkDepth+1,this.minSize=0,this.maxSize=$r(A,this.limit)}static named(A,g,B){return new(dI(wA,B.typeName))(A,g,B)}getView(A){return new l2(this,A)}getViewDU(A,g){return new S2(this,A,g)}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}cacheOfViewDU(A){return A.cache}value_serializedSize(A){return An(this.elementType,A.length,A)}value_serializeToBytes(A,g,B){return In(this.elementType,B.length,A,g,B)}value_deserializeFromBytes(A,g,B){return gn(this.elementType,A,g,B,this)}tree_serializedSize(A){const g=this.tree_getChunksNode(A),B=this.tree_getLength(A);return Bn(this.elementType,B,this.chunkDepth,g)}tree_serializeToBytes(A,g,B){const e=this.tree_getChunksNode(B),Q=this.tree_getLength(B);return Fi(this.elementType,Q,this.chunkDepth,e,A,g)}tree_deserializeFromBytes(A,g,B){return Cn(this.elementType,this.chunkDepth,A,g,B,this)}tree_getLength(A){return eg(A)}tree_setLength(A,g){A.rootNode=qg(A.rootNode.left,g)}tree_getChunksNode(A){return A.left}tree_chunksNodeOffset(){return 1}tree_setChunksNode(A,g,B,e=0,Q=null){return Mr(A,g,B,e,Q)}hashTreeRoot(A){if(this.cachePermanentRootStruct){const B=A[Tg];if(B)return B}const g=oB(32);return this.hashTreeRootInto(A,g,0,!0),g}hashTreeRootInto(A,g,B,e=!1){if(this.cachePermanentRootStruct){const C=A[Tg];if(C){g.set(C,B);return}}if(A.length>this.blockArray.length){const C=A.length-this.blockArray.length,i=new Uint8Array(C*64);for(let o=0;o<C;o++)this.blockArray.push(i.subarray(o*64,(o+1)*64))}for(let C=0;C<A.length;C++){const i=this.blockArray[Math.floor(C/2)],o=C%2===0?0:32;this.elementType.hashTreeRootInto(A[C],i,o)}const Q=Math.ceil(A.length/2);A.length%2===1&&this.blockArray[Q-1].fill(0,32),wr(this.blockArray,Q,this.maxChunkCount,this.mixInLengthBlockBytes,0),this.mixInLengthBuffer.writeUIntLE(A.length,32,6),xB(this.mixInLengthBlockBytes,2,g,B),this.cachePermanentRootStruct&&wi(A,g,B,e)}getBlocksBytes(){throw Error("getBlockBytes should not be called for ListCompositeType")}}const w2=BigInt(Number.MAX_SAFE_INTEGER),Ji=BigInt(2)**BigInt(64),y2=BigInt(2)**BigInt(128),d2=BigInt(2)**BigInt(192),tn=2**32,En=4294967295;class tg extends kQ{byteLength;typeName;itemsPerChunk;fixedSize;minSize;maxSize;maxDecimalStr;clipInfinity;setBitwiseOR;constructor(A,g){if(super(),this.byteLength=A,A>8)throw Error("UintNumber byteLength limit is 8");if(Math.log2(A)%1!==0)throw Error("byteLength must be a power of 2");this.typeName=g?.typeName??`uint${A*8}`,g?.clipInfinity&&(this.typeName+="Inf"),g?.setBitwiseOR&&(this.typeName+="OR"),this.itemsPerChunk=32/this.byteLength,this.fixedSize=A,this.minSize=A,this.maxSize=A,this.maxDecimalStr=(BigInt(2)**BigInt(this.byteLength*8)-BigInt(1)).toString(10),this.clipInfinity=g?.clipInfinity===!0,this.setBitwiseOR=g?.setBitwiseOR===!0}static named(A,g){return new(dI(tg,g.typeName))(A,g)}defaultValue(){return 0}value_serializeToBytes({dataView:A},g,B){switch(this.byteLength){case 1:A.setInt8(g,B);break;case 2:A.setUint16(g,B,!0);break;case 4:A.setUint32(g,B,!0);break;case 8:B===1/0?(A.setUint32(g,4294967295),A.setUint32(g+4,4294967295)):(A.setUint32(g,B&4294967295,!0),A.setUint32(g+4,B/tn&4294967295,!0));break}return g+this.byteLength}value_deserializeFromBytes({dataView:A},g,B){switch(this.assertValidSize(B-g),this.byteLength){case 1:return A.getUint8(g);case 2:return A.getUint16(g,!0);case 4:return A.getUint32(g,!0);case 8:{const e=A.getUint32(g,!0),Q=A.getUint32(g+4,!0);return Q===En&&e===En&&this.clipInfinity?1/0:Q*tn+e}}}value_toTree(A){const g=qA.fromZero();return g.setUint(this.byteLength,0,A,this.clipInfinity),g}tree_serializeToBytes(A,g,B){const e=B.getUint(this.byteLength,0,this.clipInfinity);return this.value_serializeToBytes(A,g,e),g+this.byteLength}tree_deserializeFromBytes(A,g,B){this.assertValidSize(B-g);const e=this.value_deserializeFromBytes(A,g,B),Q=qA.fromZero();return Q.setUint(this.byteLength,0,e,this.clipInfinity),Q}tree_getFromNode(A){return A.getUint(this.byteLength,0,this.clipInfinity)}tree_setToNode(A,g){this.tree_setToPackedNode(A,0,g)}tree_getFromPackedNode(A,g){const B=this.byteLength*(g%this.itemsPerChunk);return A.getUint(this.byteLength,B,this.clipInfinity)}tree_setToPackedNode(A,g,B){const e=this.byteLength*(g%this.itemsPerChunk);this.setBitwiseOR?A.bitwiseOrUint(this.byteLength,e,B):A.setUint(this.byteLength,e,B,this.clipInfinity)}fromJson(A){if(typeof A=="number")return A;if(typeof A=="string"){if(this.clipInfinity&&A===this.maxDecimalStr)return 1/0;const g=Number.parseInt(A,10);if(Number.isNaN(g))throw Error("JSON invalid number isNaN");if(g>Number.MAX_SAFE_INTEGER)throw Error("JSON invalid number > MAX_SAFE_INTEGER");return g}if(typeof A=="bigint"){if(A>w2)throw Error("JSON invalid number > MAX_SAFE_INTEGER_BN");return Number(A)}throw Error(`JSON invalid type ${typeof A} expected number`)}toJson(A){return A===1/0?this.maxDecimalStr:A.toString(10)}}class mC extends kQ{byteLength;typeName;itemsPerChunk;fixedSize;minSize;maxSize;constructor(A,g){if(super(),this.byteLength=A,A>32)throw Error("UintBigint byteLength limit is 32");if(Math.log2(A)%1!==0)throw Error("byteLength must be a power of 2");this.typeName=g?.typeName??`uintBigint${A*8}`,this.byteLength=A,this.itemsPerChunk=32/this.byteLength,this.fixedSize=A,this.minSize=A,this.maxSize=A}static named(A,g){return new(dI(mC,g.typeName))(A,g)}defaultValue(){return BigInt(0)}value_serializeToBytes({dataView:A},g,B){switch(this.byteLength){case 1:A.setInt8(g,Number(B));break;case 2:A.setUint16(g,Number(B),!0);break;case 4:A.setUint32(g,Number(B),!0);break;case 8:A.setBigUint64(g,B,!0);break;default:for(let e=0;e<this.byteLength;e+=8){e>0&&(B=B/Ji);const Q=BigInt.asUintN(64,B);A.setBigUint64(g+e,Q,!0)}}return g+this.byteLength}value_deserializeFromBytes({dataView:A},g,B){const e=B-g;if(e!==this.byteLength)throw Error(`Invalid size ${e} expected ${this.byteLength}`);switch(this.byteLength){case 1:return BigInt(A.getUint8(g));case 2:return BigInt(A.getUint16(g,!0));case 4:return BigInt(A.getUint32(g,!0));case 8:return A.getBigUint64(g,!0);case 16:{const Q=A.getBigUint64(g,!0);return A.getBigUint64(g+8,!0)*Ji+Q}case 32:{const Q=A.getBigUint64(g,!0),C=A.getBigUint64(g+8,!0),i=A.getBigUint64(g+16,!0);return A.getBigUint64(g+24,!0)*d2+i*y2+C*Ji+Q}}}tree_serializeToBytes(A,g,B){const e=B.getUintBigint(this.byteLength,0);return this.value_serializeToBytes(A,g,e),g+this.byteLength}tree_deserializeFromBytes(A,g,B){const e=B-g;if(e!==this.byteLength)throw Error(`Invalid size ${e} expected ${this.byteLength}`);const Q=this.value_deserializeFromBytes(A,g,B),C=qA.fromZero();return C.setUintBigint(this.byteLength,0,Q),C}tree_getFromNode(A){return A.getUintBigint(this.byteLength,0)}tree_setToNode(A,g){this.tree_setToPackedNode(A,0,g)}tree_getFromPackedNode(A,g){const B=this.byteLength*(g%this.itemsPerChunk);return A.getUintBigint(this.byteLength,B)}tree_setToPackedNode(A,g,B){const e=this.byteLength*(g%this.itemsPerChunk);A.setUintBigint(this.byteLength,e,B)}fromJson(A){if(typeof A=="bigint")return A;if(typeof A=="string"||typeof A=="number")return BigInt(A);throw Error(`JSON invalid type ${typeof A} expected bigint`)}toJson(A){return A.toString(10)}}BigInt(2),BigInt(3);const pi=BigInt(2),on=BigInt(3);class JQ extends pC{elementType;typeName;depth;maxChunkCount;fixedSize=null;minSize;maxSize;isList=!0;isViewMutable=!0;mixInLengthBlockBytes=new Uint8Array(64);mixInLengthBuffer=vA.from(this.mixInLengthBlockBytes.buffer,this.mixInLengthBlockBytes.byteOffset,this.mixInLengthBlockBytes.byteLength);constructor(A,g){super(),this.elementType=A,this.typeName=g?.typeName??`Optional[${A.typeName}]`,this.maxChunkCount=1,this.depth=A.depth+1,this.minSize=0,this.maxSize=A.maxSize+1,this.blocksBuffer=new Uint8Array(32)}static named(A,g){return new(dI(JQ,g.typeName))(A,g)}defaultValue(){return null}getView(A){return this.tree_toValue(A.rootNode)}getViewDU(A){return this.tree_toValue(A)}commitView(A){return this.value_toTree(A)}commitViewDU(A,g=0,B=null){const e=this.value_toTree(A);return B!==null&&e.h0===null&&iI(e,g,B),e}cacheOfViewDU(){}value_serializedSize(A){return A!==null?1+this.elementType.value_serializedSize(A):0}value_serializeToBytes(A,g,B){return B!==null?(A.uint8Array[g]=1,this.elementType.value_serializeToBytes(A,g+1,B)):g}value_deserializeFromBytes(A,g,B){if(g===B)return null;const e=A.uint8Array[g];if(e!==1)throw new Error(`Invalid selector for Optional type: ${e}`);return this.elementType.value_deserializeFromBytes(A,g+1,B)}tree_serializedSize(A){const g=eg(A);if(g===0)return 0;if(g===1)return 1+this.elementType.value_serializedSize(A.left);throw new Error(`Invalid selector for Optional type: ${g}`)}tree_serializeToBytes(A,g,B){const e=eg(B);if(e===0)return g;if(e===1)return A.uint8Array[g]=1,this.elementType.tree_serializeToBytes(A,g+1,B.left);throw new Error(`Invalid selector for Optional type: ${e}`)}tree_deserializeFromBytes(A,g,B){let e,Q;if(g===B)Q=0,e=Yg(0);else{if(Q=A.uint8Array[g],Q!==1)throw new Error(`Invalid selector for Optional type: ${Q}`);e=this.elementType.tree_deserializeFromBytes(A,g+1,B)}return qg(e,Q)}hashTreeRoot(A){const g=oB(32);return this.hashTreeRootInto(A,g,0),g}hashTreeRootInto(A,g,B){super.hashTreeRootInto(A,this.mixInLengthBlockBytes,0);const e=A===null?0:1;this.mixInLengthBuffer.writeUIntLE(e,32,6),xB(this.mixInLengthBlockBytes,2,g,B)}getBlocksBytes(A){return A===null?this.blocksBuffer.fill(0):this.elementType.hashTreeRootInto(A,this.blocksBuffer,0),this.blocksBuffer}getPropertyGindex(A){if(NI(this.elementType)){const g=this.elementType.getPropertyGindex(A);return g===null?g:yI([pi,g])}throw new Error("not applicable for Optional basic type")}getPropertyType(A){if(NI(this.elementType))return this.elementType.getPropertyType(A);throw new Error("not applicable for Optional basic type")}getIndexProperty(A){if(NI(this.elementType))return this.elementType.getIndexProperty(A);throw new Error("not applicable for Optional basic type")}tree_createProofGindexes(A,g){if(NI(this.elementType))return super.tree_createProofGindexes(A,g);throw new Error("not applicable for Optional basic type")}tree_getLeafGindices(A,g){if(!g)throw new Error("Optional type requires rootNode argument to get leaves");const B=eg(g);if(NI(this.elementType)&&B===1)return[...this.elementType.tree_getLeafGindices(yI([A,pi]),g.left),yI([A,on])];if(B===0||B===1)return[yI([A,pi]),yI([A,on])];throw new Error(`Invalid selector for Optional type: ${B}`)}fromJson(A){return A===null?null:this.elementType.fromJson(A)}toJson(A){return A===null?null:this.elementType.toJson(A)}clone(A){return A===null?null:this.elementType.clone(A)}equals(A,g){return A===null&&g===null?!0:A===null||g===null?!1:this.elementType.equals(A,g)}}class pQ extends FQ{elementType;length;typeName;itemsPerChunk;depth;chunkDepth;maxChunkCount;fixedSize;minSize;maxSize;isList=!1;isViewMutable=!0;defaultLen;constructor(A,g,B){if(super(A),this.elementType=A,this.length=g,!A.isBasic)throw Error("elementType must be basic");if(g===0)throw Error("Vector length must be > 0");this.typeName=B?.typeName??`Vector[${A.typeName}, ${g}]`,this.itemsPerChunk=32/A.byteLength,this.maxChunkCount=Math.ceil(g*A.byteLength/32),this.chunkDepth=Sg(this.maxChunkCount),this.depth=this.chunkDepth,this.fixedSize=g*A.byteLength,this.minSize=this.fixedSize,this.maxSize=this.fixedSize,this.defaultLen=g,this.blocksBuffer=new Uint8Array(Math.ceil(this.maxChunkCount/2)*64)}static named(A,g,B){return new(dI(pQ,B.typeName))(A,g,B)}getView(A){return new vr(this,A)}getViewDU(A,g){return new Wr(this,A,g)}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}cacheOfViewDU(A){return A.cache}value_serializedSize(){return this.fixedSize}value_serializeToBytes(A,g,B){return NQ(this.elementType,this.length,A,g,B)}value_deserializeFromBytes(A,g,B){return mr(this.elementType,A,g,B,this)}tree_serializedSize(){return this.fixedSize}tree_serializeToBytes(A,g,B){return di(this.elementType,this.length,this.depth,A,g,B)}tree_deserializeFromBytes(A,g,B){return Lr(this.elementType,this.depth,A,g,B,this)}tree_getLength(){return this.length}tree_setLength(){}tree_getChunksNode(A){return A}tree_chunksNodeOffset(){return 0}tree_setChunksNode(A,g){return g}getBlocksBytes(A){const g=this.blocksBuffer.subarray(0,this.fixedSize),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return NQ(this.elementType,this.length,{uint8Array:g,dataView:B},0,A),this.blocksBuffer}}class EI extends FQ{elementType;length;typeName;itemsPerChunk=1;depth;chunkDepth;maxChunkCount;fixedSize;minSize;maxSize;isList=!1;isViewMutable=!0;defaultLen;constructor(A,g,B){if(super(A),this.elementType=A,this.length=g,A.isBasic)throw Error("elementType must not be basic");if(g===0)throw Error("Vector length must be > 0");this.typeName=B?.typeName??`Vector[${A.typeName}, ${g}]`,this.maxChunkCount=g,this.chunkDepth=Sg(this.maxChunkCount),this.depth=this.chunkDepth,this.fixedSize=A.fixedSize===null?null:g*A.fixedSize,this.minSize=c2(A,g),this.maxSize=$r(A,g),this.defaultLen=g,this.blocksBuffer=new Uint8Array(Math.ceil(this.maxChunkCount/2)*64)}static named(A,g,B){return new(dI(EI,B.typeName))(A,g,B)}getView(A){return new Xr(this,A)}getViewDU(A,g){return new en(this,A,g)}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}cacheOfViewDU(A){return A.cache}value_serializedSize(A){return An(this.elementType,this.length,A)}value_serializeToBytes(A,g,B){return In(this.elementType,this.length,A,g,B)}value_deserializeFromBytes(A,g,B){return gn(this.elementType,A,g,B,this)}tree_serializedSize(A){return Bn(this.elementType,this.length,this.depth,A)}tree_serializeToBytes(A,g,B){return Fi(this.elementType,this.length,this.depth,B,A,g)}tree_deserializeFromBytes(A,g,B){return Cn(this.elementType,this.depth,A,g,B,this)}tree_getLength(){return this.length}tree_setLength(){}tree_getChunksNode(A){return A}tree_chunksNodeOffset(){return 0}tree_setChunksNode(A,g){return g}getBlocksBytes(A){return D2(this.elementType,this.length,A,this.blocksBuffer)}}class N2 extends bI{constructor(A,g){super(new tg(8),A,g)}toViewDU(A){const{treeNode:g,leafNodes:B}=this.packedUintNum64sToNode(A);return this.getViewDU(g,{nodes:B,length:A.length,nodesPopulated:!0})}value_toTree(A){const{treeNode:g}=this.packedUintNum64sToNode(A);return g}packedUintNum64sToNode(A){if(A.length>this.limit)throw new Error(`Exceeds limit: ${A.length} > ${this.limit}`);const g=yf(A),B=uC([...g],this.chunkDepth);return{treeNode:qg(B,A.length),leafNodes:g}}}new Uint8Array(64).subarray(32);function LC(I){if(!Number.isSafeInteger(I)||I<0)throw new Error(`positive integer expected, not ${I}`)}function u2(I){if(typeof I!="boolean")throw new Error(`boolean expected, not ${I}`)}function R2(I){return I instanceof Uint8Array||I!=null&&typeof I=="object"&&I.constructor.name==="Uint8Array"}function HQ(I,...A){if(!R2(I))throw new Error("Uint8Array expected");if(A.length>0&&!A.includes(I.length))throw new Error(`Uint8Array expected of length ${A}, not of length=${I.length}`)}function G2(I){if(typeof I!="function"||typeof I.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");LC(I.outputLen),LC(I.blockLen)}function Hi(I,A=!0){if(I.destroyed)throw new Error("Hash instance has been destroyed");if(A&&I.finished)throw new Error("Hash#digest() has already been called")}function rn(I,A){HQ(I);const g=A.outputLen;if(I.length<g)throw new Error(`digestInto() expects output buffer of length at least ${g}`)}const k2={number:LC,bool:u2,bytes:HQ,hash:G2,exists:Hi,output:rn},MQ=BigInt(2**32-1),nn=BigInt(32);function F2(I,A=!1){return A?{h:Number(I&MQ),l:Number(I>>nn&MQ)}:{h:Number(I>>nn&MQ)|0,l:Number(I&MQ)|0}}function J2(I,A=!1){let g=new Uint32Array(I.length),B=new Uint32Array(I.length);for(let e=0;e<I.length;e++){const{h:Q,l:C}=F2(I[e],A);[g[e],B[e]]=[Q,C]}return[g,B]}const p2=(I,A,g)=>I<<g|A>>>32-g,H2=(I,A,g)=>A<<g|I>>>32-g,M2=(I,A,g)=>A<<g-32|I>>>64-g,m2=(I,A,g)=>I<<g-32|A>>>64-g,L2=I=>new Uint32Array(I.buffer,I.byteOffset,Math.floor(I.byteLength/4)),an=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,K2=I=>I<<24&4278190080|I<<8&16711680|I>>>8&65280|I>>>24&255;function sn(I){for(let A=0;A<I.length;A++)I[A]=K2(I[A])}function Y2(I){if(typeof I!="string")throw new Error(`utf8ToBytes expected string, got ${typeof I}`);return new Uint8Array(new TextEncoder().encode(I))}function hn(I){return typeof I=="string"&&(I=Y2(I)),HQ(I),I}class b2{clone(){return this._cloneInto()}}function T2(I){const A=B=>I().update(hn(B)).digest(),g=I();return A.outputLen=g.outputLen,A.blockLen=g.blockLen,A.create=()=>I(),A}const ln=[],cn=[],Dn=[],q2=BigInt(0),KC=BigInt(1),V2=BigInt(2),j2=BigInt(7),_2=BigInt(256),Z2=BigInt(113);for(let I=0,A=KC,g=1,B=0;I<24;I++){[g,B]=[B,(2*g+3*B)%5],ln.push(2*(5*B+g)),cn.push((I+1)*(I+2)/2%64);let e=q2;for(let Q=0;Q<7;Q++)A=(A<<KC^(A>>j2)*Z2)%_2,A&V2&&(e^=KC<<(KC<<BigInt(Q))-KC);Dn.push(e)}const[P2,O2]=J2(Dn,!0),Un=(I,A,g)=>g>32?M2(I,A,g):p2(I,A,g),fn=(I,A,g)=>g>32?m2(I,A,g):H2(I,A,g);function x2(I,A=24){const g=new Uint32Array(10);for(let B=24-A;B<24;B++){for(let C=0;C<10;C++)g[C]=I[C]^I[C+10]^I[C+20]^I[C+30]^I[C+40];for(let C=0;C<10;C+=2){const i=(C+8)%10,o=(C+2)%10,D=g[o],a=g[o+1],U=Un(D,a,1)^g[i],J=fn(D,a,1)^g[i+1];for(let f=0;f<50;f+=10)I[C+f]^=U,I[C+f+1]^=J}let e=I[2],Q=I[3];for(let C=0;C<24;C++){const i=cn[C],o=Un(e,Q,i),D=fn(e,Q,i),a=ln[C];e=I[a],Q=I[a+1],I[a]=o,I[a+1]=D}for(let C=0;C<50;C+=10){for(let i=0;i<10;i++)g[i]=I[C+i];for(let i=0;i<10;i++)I[C+i]^=~g[(i+2)%10]&g[(i+4)%10]}I[0]^=P2[B],I[1]^=O2[B]}g.fill(0)}class Mi extends b2{constructor(A,g,B,e=!1,Q=24){if(super(),this.blockLen=A,this.suffix=g,this.outputLen=B,this.enableXOF=e,this.rounds=Q,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,LC(B),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=L2(this.state)}keccak(){an||sn(this.state32),x2(this.state32,this.rounds),an||sn(this.state32),this.posOut=0,this.pos=0}update(A){Hi(this);const{blockLen:g,state:B}=this;A=hn(A);const e=A.length;for(let Q=0;Q<e;){const C=Math.min(g-this.pos,e-Q);for(let i=0;i<C;i++)B[this.pos++]^=A[Q++];this.pos===g&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:A,suffix:g,pos:B,blockLen:e}=this;A[B]^=g,g&128&&B===e-1&&this.keccak(),A[e-1]^=128,this.keccak()}writeInto(A){Hi(this,!1),HQ(A),this.finish();const g=this.state,{blockLen:B}=this;for(let e=0,Q=A.length;e<Q;){this.posOut>=B&&this.keccak();const C=Math.min(B-this.posOut,Q-e);A.set(g.subarray(this.posOut,this.posOut+C),e),this.posOut+=C,e+=C}return A}xofInto(A){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(A)}xof(A){return LC(A),this.xofInto(new Uint8Array(A))}digestInto(A){if(rn(A,this),this.finished)throw new Error("digest() was already called");return this.writeInto(A),this.destroy(),A}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(A){const{blockLen:g,suffix:B,outputLen:e,rounds:Q,enableXOF:C}=this;return A||(A=new Mi(g,B,e,C,Q)),A.state32.set(this.state32),A.pos=this.pos,A.posOut=this.posOut,A.finished=this.finished,A.rounds=Q,A.suffix=B,A.outputLen=e,A.enableXOF=C,A.destroyed=this.destroyed,A}}const z2=(I,A,g)=>T2(()=>new Mi(A,I,g)),Sn=z2(1,136,256/8);function v2(I){return A=>(k2.bytes(A),I(A))}(()=>{const I=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,A=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);return{node:A&&!I?A("crypto"):void 0,web:I}})();const W2=(()=>{const I=v2(Sn);return I.create=Sn.create,I})();class X2 extends kI{constructor(){super(20,{typeName:"ExecutionAddress"})}toJson(A){const g=super.toJson(A);return AS(g)}}function $2(I){return/^(0x)?[0-9a-f]{40}$/i.test(I)}function AS(I){if(!$2(I))throw Error(`Invalid address: ${I}`);const A=(I.startsWith("0x")?I.slice(2):I).toLowerCase(),g=A.split(""),B=new Uint8Array(g.length);for(let Q=0;Q<B.length;Q++)B[Q]=A[Q].charCodeAt(0);const e=W2(B);for(let Q=0;Q<g.length;Q+=2)e[Q>>1]>>4>=8&&(g[Q]=g[Q].toUpperCase()),(e[Q>>1]&15)>=8&&(g[Q+1]=g[Q+1].toUpperCase());return"0x"+g.join("")}const BI=new ki,wn=new tg(1),YC=new kI(4),mi=new kI(8),yn=new kI(20),Li=new kI(32),Ki=new kI(48),Yi=new kI(96),dn=new tg(1),Nn=new tg(2),bi=new tg(4),RA=new tg(8),mQ=new tg(8,{clipInfinity:!0}),cB=new mC(8),un=new mC(16),Ti=new mC(32),KA=RA,PI=RA,Rn=mQ,Gn=RA,DB=RA,qi=RA,kn=mQ,XA=RA,Fn=RA,Jn=cB,pn=cB,Hn=Ti,UB=new kI(32),Vi=RA,Mn=YC,mn=YC,ji=YC,vB=Ki,LQ=Yi,Ln=Li,Kn=new tg(1,{setBitwiseOR:!0}),_i=new X2,Zi=RA,Yn=RA,bn=RA,Eg=Object.freeze(Object.defineProperty({__proto__:null,BLSPubkey:vB,BLSSignature:LQ,BlobIndex:Vi,Boolean:BI,BuilderIndex:kn,Byte:wn,Bytes20:yn,Bytes32:Li,Bytes4:YC,Bytes48:Ki,Bytes8:mi,Bytes96:Yi,ColumnIndex:Zi,CommitteeIndex:DB,CustodyIndex:Yn,DepositIndex:Jn,Domain:Ln,DomainType:mn,Epoch:PI,EpochInf:Rn,ExecutionAddress:_i,ForkDigest:ji,Gwei:pn,ParticipationFlags:Kn,Root:UB,RowIndex:bn,Slot:KA,SubcommitteeIndex:qi,SyncPeriod:Gn,Uint16:Nn,Uint32:bi,Uint8:dn,UintBn128:un,UintBn256:Ti,UintBn64:cB,UintNum64:RA,UintNumInf64:mQ,ValidatorIndex:XA,Version:Mn,Wei:Hn,WithdrawalIndex:Fn},Symbol.toStringTag,{value:"Module"})),{Boolean:IS,Bytes32:gS,UintNum64:BS,BLSPubkey:CS,EpochInf:KQ}=Eg,Tn=2**32,WB=4,QS=48,eS=32,iS=1,tS={pubkey:CS,withdrawalCredentials:gS,effectiveBalance:BS,slashed:IS,activationEligibilityEpoch:KQ,activationEpoch:KQ,exitEpoch:KQ,withdrawableEpoch:KQ};class ES extends a2{constructor(){super(tS,{typeName:"Validator",jsonCase:"eth2"})}value_serializeToBytes({uint8Array:A,dataView:g},B,e){A.set(e.pubkey,B),B+=QS,A.set(e.withdrawalCredentials,B),B+=eS;const{effectiveBalance:Q,activationEligibilityEpoch:C,activationEpoch:i,exitEpoch:o,withdrawableEpoch:D}=e;return g.setUint32(B,Q&4294967295,!0),B+=WB,g.setUint32(B,Q/Tn&4294967295,!0),B+=WB,A[B]=e.slashed?1:0,B+=iS,B=YQ(g,B,C),B=YQ(g,B,i),B=YQ(g,B,o),B=YQ(g,B,D),B}}function YQ(I,A,g){return g===1/0?(I.setUint32(A,4294967295,!0),A+=WB,I.setUint32(A,4294967295,!0),A+=WB):(I.setUint32(A,g&4294967295,!0),A+=WB,I.setUint32(A,g/Tn&4294967295,!0),A+=WB),A}const qn=new ES,{Bytes32:fB,UintNum64:cI,UintBn64:SB,Slot:Vg,Epoch:bC,CommitteeIndex:Vn,ValidatorIndex:wB,Root:MA,Version:TC,ForkDigest:jn,BLSPubkey:_n,BLSSignature:OI,Domain:oS}=Eg,Pi=new ig(Jc),TI=new K({slot:Vg,proposerIndex:wB,parentRoot:MA,stateRoot:MA,bodyRoot:MA},{typeName:"BeaconBlockHeader",jsonCase:"eth2",cachePermanentRootStruct:!0}),Zn=new K({slot:SB,proposerIndex:wB,parentRoot:MA,stateRoot:MA,bodyRoot:MA},{typeName:"BeaconBlockHeader",jsonCase:"eth2",cachePermanentRootStruct:!0}),Oi=new K({message:TI,signature:OI},{typeName:"SignedBeaconBlockHeader",jsonCase:"eth2"}),xi=new K({message:Zn,signature:OI},{typeName:"SignedBeaconBlockHeader",jsonCase:"eth2"}),jA=new K({epoch:bC,root:MA},{typeName:"Checkpoint",jsonCase:"eth2"}),zi=new K({epoch:SB,root:MA},{typeName:"Checkpoint",jsonCase:"eth2"}),vi=new GQ(UC),bQ=new bI(wB,UC),rS=new K({pubkey:_n,withdrawalCredentials:fB,amount:cI},{typeName:"DepositMessage",jsonCase:"eth2"}),Wi=new K({pubkey:_n,withdrawalCredentials:fB,amount:cI,signature:OI},{typeName:"DepositData",jsonCase:"eth2"}),nS=new wA(MA,2**Ho),aS=new K({depositData:Wi,blockNumber:cI,index:cI},{typeName:"DepositEvent",jsonCase:"eth2"}),og=new K({depositRoot:MA,depositCount:cI,blockHash:fB},{typeName:"Eth1Data",jsonCase:"eth2"}),jg=new wA(og,$1*wI),sS=new K({depositRoot:MA,depositCount:cI,blockHash:fB,blockNumber:cI},{typeName:"Eth1DataOrdered",jsonCase:"eth2"}),hS=new K({timestamp:cI,depositRoot:MA,depositCount:cI},{typeName:"Eth1Block",jsonCase:"eth2"}),_g=new K({previousVersion:TC,currentVersion:TC,epoch:bC},{typeName:"Fork",jsonCase:"eth2"}),lS=new K({currentVersion:TC,genesisValidatorsRoot:MA},{typeName:"ForkData",jsonCase:"eth2"}),cS=new K({forkDigest:jn,nextForkVersion:TC,nextForkEpoch:bC},{typeName:"ENRForkID",jsonCase:"eth2"}),yg=new EI(MA,Oe),dg=new EI(MA,Oe),DS=new K({blockRoots:yg,stateRoots:dg},{typeName:"HistoricalBatch",jsonCase:"eth2"}),US=new K({blockRoots:MA,stateRoots:MA},{typeName:"HistoricalBatchRoots",jsonCase:"eth2"}),fS=qn,Zg=new wA(qn,fC),Pg=new N2(fC),Og=new EI(fB,Ac),xg=new pQ(cI,Ic),zg=new ig(kc),yB=new K({slot:Vg,index:Vn,beaconBlockRoot:MA,source:jA,target:jA},{typeName:"AttestationData",jsonCase:"eth2",cachePermanentRootStruct:!0}),Xi=new K({slot:SB,index:SB,beaconBlockRoot:MA,source:zi,target:zi},{typeName:"AttestationData",jsonCase:"eth2",cachePermanentRootStruct:!0}),SS=new K({attestingIndices:bQ,data:yB,signature:OI},{typeName:"IndexedAttestation",jsonCase:"eth2"}),$i=new K({attestingIndices:bQ,data:Xi,signature:OI},{typeName:"IndexedAttestation",jsonCase:"eth2"}),Pn=new K({aggregationBits:vi,data:yB,inclusionDelay:Vg,proposerIndex:wB},{typeName:"PendingAttestation",jsonCase:"eth2"}),wS=new K({objectRoot:MA,domain:oS},{typeName:"SigningData",jsonCase:"eth2"}),TQ=new K({aggregationBits:vi,data:yB,signature:OI},{typeName:"Attestation",jsonCase:"eth2"}),yS=TQ,On=new K({attestation1:$i,attestation2:$i},{typeName:"AttesterSlashing",jsonCase:"eth2"}),xn=new K({proof:new EI(fB,Ho+1),data:Wi},{typeName:"Deposit",jsonCase:"eth2"}),zn=new K({signedHeader1:xi,signedHeader2:xi},{typeName:"ProposerSlashing",jsonCase:"eth2"}),vn=new K({epoch:bC,validatorIndex:wB},{typeName:"VoluntaryExit",jsonCase:"eth2",cachePermanentRootStruct:!0}),Wn=new K({message:vn,signature:OI},{typeName:"SignedVoluntaryExit",jsonCase:"eth2"}),$A=new K({randaoReveal:OI,eth1Data:og,graffiti:fB,proposerSlashings:new wA(zn,gc),attesterSlashings:new wA(On,Bc),attestations:new wA(TQ,Go),deposits:new wA(xn,Cc),voluntaryExits:new wA(Wn,Qc)},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),Xn=new K({slot:Vg,proposerIndex:wB,parentRoot:MA,stateRoot:MA,body:$A},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),dS=new K({message:Xn,signature:OI},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),At=new wA(Pn,Go*wI),NS=new K({genesisTime:cI,genesisValidatorsRoot:MA,slot:Vg,fork:_g,latestBlockHeader:TI,blockRoots:yg,stateRoots:dg,historicalRoots:new wA(MA,Jg),eth1Data:og,eth1DataVotes:jg,eth1DepositIndex:cI,validators:Zg,balances:Pg,randaoMixes:Og,slashings:xg,previousEpochAttestations:At,currentEpochAttestations:At,justificationBits:zg,previousJustifiedCheckpoint:jA,currentJustifiedCheckpoint:jA,finalizedCheckpoint:jA},{typeName:"BeaconState",jsonCase:"eth2"}),uS=new K({validators:bQ,committeeIndex:Vn,slot:Vg},{typeName:"CommitteeAssignment",jsonCase:"eth2"}),$n=new K({aggregatorIndex:wB,aggregate:TQ,selectionProof:OI},{typeName:"AggregateAndProof",jsonCase:"eth2",cachePermanentRootStruct:!0}),RS=new K({message:$n,signature:OI},{typeName:"SignedAggregateAndProof",jsonCase:"eth2"}),Aa=new K({forkDigest:jn,finalizedRoot:MA,finalizedEpoch:bC,headRoot:MA,headSlot:Vg},{typeName:"Status",jsonCase:"eth2"}),GS=SB,kS=SB,FS=new K({seqNumber:SB,attnets:Pi},{typeName:"Metadata",jsonCase:"eth2"}),JS=new K({startSlot:Vg,count:cI,step:cI},{typeName:"BeaconBlocksByRangeRequest",jsonCase:"eth2"}),pS=new K({genesisValidatorsRoot:MA,genesisTime:cI,genesisForkVersion:TC},{typeName:"Genesis",jsonCase:"eth2"}),vg=Object.freeze(Object.defineProperty({__proto__:null,AggregateAndProof:$n,Attestation:TQ,AttestationData:yB,AttestationDataBigint:Xi,AttestationSubnets:Pi,AttesterSlashing:On,Balances:Pg,BeaconBlock:Xn,BeaconBlockBody:$A,BeaconBlockHeader:TI,BeaconBlockHeaderBigint:Zn,BeaconBlocksByRangeRequest:JS,BeaconState:NS,Checkpoint:jA,CheckpointBigint:zi,CommitteeAssignment:uS,CommitteeBits:vi,CommitteeIndices:bQ,Deposit:xn,DepositData:Wi,DepositDataRootList:nS,DepositEvent:aS,DepositMessage:rS,ENRForkID:cS,EpochAttestations:At,Eth1Block:hS,Eth1Data:og,Eth1DataOrdered:sS,Eth1DataVotes:jg,Fork:_g,ForkData:lS,Genesis:pS,Goodbye:GS,HistoricalBatch:DS,HistoricalBatchRoots:US,HistoricalBlockRoots:yg,HistoricalStateRoots:dg,IndexedAttestation:SS,IndexedAttestationBigint:$i,JustificationBits:zg,Metadata:FS,PendingAttestation:Pn,Ping:kS,ProposerSlashing:zn,RandaoMixes:Og,SignedAggregateAndProof:RS,SignedBeaconBlock:dS,SignedBeaconBlockHeader:Oi,SignedBeaconBlockHeaderBigint:xi,SignedVoluntaryExit:Wn,SigningData:wS,SingleAttestation:yS,Slashings:xg,Status:Aa,Validator:fS,Validators:Zg,VoluntaryExit:vn},Symbol.toStringTag,{value:"Module"})),{Bytes32:It,UintNum64:qC,UintBn64:HS,Slot:Wg,SubcommitteeIndex:Ia,ValidatorIndex:gt,Root:XB,BLSPubkey:ga,BLSSignature:$B,ParticipationFlags:MS}=Eg,Ba=new ig(Lo),Bt=new EI(It,VB),Ca=new EI(It,Hc),Qa=new EI(It,hQ),ea=new K({seqNumber:HS,attnets:Pi,syncnets:Ba},{typeName:"Metadata",jsonCase:"eth2"}),AI=new K({pubkeys:new EI(ga,pg),aggregatePubkey:ga},{typeName:"SyncCommittee",jsonCase:"eth2"}),mS=new K({slot:Wg,beaconBlockRoot:XB,validatorIndex:gt,signature:$B},{typeName:"SyncCommitteeMessage",jsonCase:"eth2"}),ia=new K({slot:Wg,beaconBlockRoot:XB,subcommitteeIndex:Ia,aggregationBits:new ig(pg/Lo),signature:$B},{typeName:"SyncCommitteeContribution",jsonCase:"eth2"}),ta=new K({aggregatorIndex:gt,contribution:ia,selectionProof:$B},{typeName:"ContributionAndProof",jsonCase:"eth2",cachePermanentRootStruct:!0}),LS=new K({message:ta,signature:$B},{typeName:"SignedContributionAndProof",jsonCase:"eth2"}),KS=new K({slot:Wg,subcommitteeIndex:Ia},{typeName:"SyncAggregatorSelectionData",jsonCase:"eth2"}),Ea=new ig(pg),DI=new K({syncCommitteeBits:Ea,syncCommitteeSignature:$B},{typeName:"SyncCommitteeBits",jsonCase:"eth2"}),rg=new K({...$A.fields,syncAggregate:DI},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),oa=new K({slot:Wg,proposerIndex:gt,parentRoot:XB,stateRoot:XB,body:rg},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),YS=new K({message:oa,signature:$B},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),FI=new bI(MS,fC),dB=new bI(qC,fC),bS=new K({genesisTime:qC,genesisValidatorsRoot:XB,slot:Wg,fork:_g,latestBlockHeader:TI,blockRoots:yg,stateRoots:dg,historicalRoots:new wA(XB,Jg),eth1Data:og,eth1DataVotes:jg,eth1DepositIndex:qC,validators:Zg,balances:Pg,randaoMixes:Og,slashings:xg,previousEpochParticipation:FI,currentEpochParticipation:FI,justificationBits:zg,previousJustifiedCheckpoint:jA,currentJustifiedCheckpoint:jA,finalizedCheckpoint:jA,inactivityScores:dB,currentSyncCommittee:AI,nextSyncCommittee:AI},{typeName:"BeaconState",jsonCase:"eth2"}),NB=new K({beacon:TI},{typeName:"LightClientHeader",jsonCase:"eth2"}),qQ=new K({header:NB,currentSyncCommittee:AI,currentSyncCommitteeBranch:Ca},{typeName:"LightClientBootstrap",jsonCase:"eth2"}),AC=new K({attestedHeader:NB,nextSyncCommittee:AI,nextSyncCommitteeBranch:Qa,finalizedHeader:NB,finalityBranch:Bt,syncAggregate:DI,signatureSlot:Wg},{typeName:"LightClientUpdate",jsonCase:"eth2"}),Ct=new K({attestedHeader:NB,finalizedHeader:NB,finalityBranch:Bt,syncAggregate:DI,signatureSlot:Wg},{typeName:"LightClientFinalityUpdate",jsonCase:"eth2"}),TS=new K({attestedHeader:NB,syncAggregate:DI,signatureSlot:Wg},{typeName:"LightClientOptimisticUpdate",jsonCase:"eth2"}),qS=new K({startPeriod:qC,count:qC},{typeName:"LightClientUpdatesByRange",jsonCase:"eth2"}),VS=new K({snapshot:qQ,validUpdates:new wA(AC,Hg*wI)},{typeName:"LightClientStore",jsonCase:"eth2"}),uB=Object.freeze(Object.defineProperty({__proto__:null,BeaconBlock:oa,BeaconBlockBody:rg,BeaconState:bS,ContributionAndProof:ta,CurrentSyncCommitteeBranch:Ca,EpochParticipation:FI,FinalityBranch:Bt,InactivityScores:dB,LightClientBootstrap:qQ,LightClientFinalityUpdate:Ct,LightClientHeader:NB,LightClientOptimisticUpdate:TS,LightClientStore:VS,LightClientUpdate:AC,LightClientUpdatesByRange:qS,Metadata:ea,NextSyncCommitteeBranch:Qa,SignedBeaconBlock:YS,SignedContributionAndProof:LS,SyncAggregate:DI,SyncAggregatorSelectionData:KS,SyncCommittee:AI,SyncCommitteeBits:Ea,SyncCommitteeContribution:ia,SyncCommitteeMessage:mS,SyncSubnets:Ba},Symbol.toStringTag,{value:"Module"}));class Xg extends kQ{typeName="string";byteLength=0;fixedSize=0;minSize=0;maxSize=0;defaultValue(){return""}value_serializeToBytes(){throw Error("Not supported in String type")}value_deserializeFromBytes(){throw Error("Not supported in String type")}tree_serializeToBytes(){throw Error("Not supported in String type")}tree_deserializeFromBytes(){throw Error("Not supported in String type")}tree_getFromNode(){throw Error("Not supported in String type")}tree_setToNode(){throw Error("Not supported in String type")}tree_getFromPackedNode(){throw Error("Not supported in String type")}tree_setToPackedNode(){throw Error("Not supported in String type")}fromJson(A){if(typeof A!="string")throw Error(`JSON invalid type ${typeof A} expected string`);return A}toJson(A){return A}}const xI=new Xg,{Bytes32:VQ,UintNum64:zI,Slot:Qt,ValidatorIndex:ra,Root:JI,BLSSignature:jQ,UintBn256:et,BLSPubkey:na,ExecutionAddress:aa}=Eg,sa=new HC(ic),ha=new wA(sa,tc),it=new K({parentHash:JI,feeRecipient:aa,stateRoot:VQ,receiptsRoot:VQ,logsBloom:new kI(Ec),prevRandao:VQ,blockNumber:zI,gasLimit:zI,gasUsed:zI,timestamp:zI,extraData:new HC(oc),baseFeePerGas:et,blockHash:JI}),tt=new K({...it.fields,transactions:ha},{typeName:"ExecutionPayload",jsonCase:"eth2"}),VC=new K({...it.fields,transactionsRoot:JI},{typeName:"ExecutionPayloadHeader",jsonCase:"eth2"}),la=new K({...rg.fields,executionPayload:tt},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),ca=new K({slot:Qt,proposerIndex:ra,parentRoot:JI,stateRoot:JI,body:la},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),jS=new K({message:ca,signature:jQ},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),_S=new K({blockHash:JI,parentHash:JI,totalDifficulty:et},{typeName:"PowBlock",jsonCase:"eth2"}),ZS=new K({genesisTime:zI,genesisValidatorsRoot:JI,slot:KA,fork:_g,latestBlockHeader:TI,blockRoots:yg,stateRoots:dg,historicalRoots:new wA(JI,Jg),eth1Data:og,eth1DataVotes:jg,eth1DepositIndex:zI,validators:Zg,balances:Pg,randaoMixes:Og,slashings:xg,previousEpochParticipation:FI,currentEpochParticipation:FI,justificationBits:zg,previousJustifiedCheckpoint:jA,currentJustifiedCheckpoint:jA,finalizedCheckpoint:jA,inactivityScores:dB,currentSyncCommittee:AI,nextSyncCommittee:AI,latestExecutionPayloadHeader:VC},{typeName:"BeaconState",jsonCase:"eth2"}),Da=new K({...rg.fields,executionPayloadHeader:VC},{typeName:"BlindedBeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),Et=new K({slot:Qt,proposerIndex:ra,parentRoot:JI,stateRoot:JI,body:Da},{typeName:"BlindedBeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),PS=new K({message:Et,signature:jQ},{typeName:"SignedBlindedBeaconBlock",jsonCase:"eth2"}),Ua=new K({feeRecipient:aa,gasLimit:zI,timestamp:zI,pubkey:na},{typeName:"ValidatorRegistrationV1",jsonCase:"eth2"}),OS=new K({message:Ua,signature:jQ},{typeName:"SignedValidatorRegistrationV1",jsonCase:"eth2"}),fa=new K({header:VC,value:et,pubkey:na},{typeName:"BuilderBid",jsonCase:"eth2"}),xS=new K({message:fa,signature:jQ},{typeName:"SignedBuilderBid",jsonCase:"eth2"}),ot=new K({timestamp:zI,prevRandao:VQ,suggestedFeeRecipient:xI},{typeName:"PayloadAttributes",jsonCase:"eth2"}),jC=new K({proposerIndex:zI,proposalSlot:Qt,parentBlockNumber:zI,parentBlockRoot:JI,parentBlockHash:JI},{typeName:"SSEPayloadAttributesCommon",jsonCase:"eth2"}),zS=new K({...jC.fields,payloadAttributes:ot},{typeName:"SSEPayloadAttributes",jsonCase:"eth2"}),IC=Object.freeze(Object.defineProperty({__proto__:null,BeaconBlock:ca,BeaconBlockBody:la,BeaconState:ZS,BlindedBeaconBlock:Et,BlindedBeaconBlockBody:Da,BuilderBid:fa,CommonExecutionPayloadType:it,ExecutionPayload:tt,ExecutionPayloadHeader:VC,PayloadAttributes:ot,PowBlock:_S,SSEPayloadAttributes:zS,SSEPayloadAttributesCommon:jC,SignedBeaconBlock:jS,SignedBlindedBeaconBlock:PS,SignedBuilderBid:xS,SignedValidatorRegistrationV1:OS,Transaction:sa,Transactions:ha,ValidatorRegistrationV1:Ua},Symbol.toStringTag,{value:"Module"})),{UintNum64:Sa,Slot:_Q,ValidatorIndex:ZQ,WithdrawalIndex:wa,Root:RB,BLSSignature:PQ,BLSPubkey:ya,ExecutionAddress:da,Gwei:vS,UintBn256:WS,Bytes32:XS}=Eg,Na=new EI(XS,Yo),ua=new K({index:wa,validatorIndex:ZQ,address:da,amount:vS},{typeName:"Withdrawal",jsonCase:"eth2"}),Ra=new K({validatorIndex:ZQ,fromBlsPubkey:ya,toExecutionAddress:da},{typeName:"BLSToExecutionChange",jsonCase:"eth2"}),Ga=new K({message:Ra,signature:PQ},{typeName:"SignedBLSToExecutionChange",jsonCase:"eth2"}),OQ=new wA(ua,nc),rt=new K({...tt.fields,withdrawals:OQ},{typeName:"ExecutionPayload",jsonCase:"eth2"}),gC=new K({...VC.fields,withdrawalsRoot:RB},{typeName:"ExecutionPayloadHeader",jsonCase:"eth2"}),nt=new wA(Ga,rc),GB=new K({...rg.fields,executionPayload:rt,blsToExecutionChanges:nt},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),at=new K({slot:_Q,proposerIndex:ZQ,parentRoot:RB,stateRoot:RB,body:GB},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),$S=new K({message:at,signature:PQ},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),ka=new K({header:gC,value:WS,pubkey:ya},{typeName:"BuilderBid",jsonCase:"eth2"}),Aw=new K({message:ka,signature:PQ},{typeName:"SignedBuilderBid",jsonCase:"eth2"}),Fa=new K({blockSummaryRoot:RB,stateSummaryRoot:RB},{typeName:"HistoricalSummary",jsonCase:"eth2"}),Ja=new wA(Fa,Jg,{typeName:"HistoricalSummaries"}),ng=new K({genesisTime:Sa,genesisValidatorsRoot:RB,slot:KA,fork:_g,latestBlockHeader:TI,blockRoots:yg,stateRoots:dg,historicalRoots:new wA(RB,Jg),eth1Data:og,eth1DataVotes:jg,eth1DepositIndex:Sa,validators:Zg,balances:Pg,randaoMixes:Og,slashings:xg,previousEpochParticipation:FI,currentEpochParticipation:FI,justificationBits:zg,previousJustifiedCheckpoint:jA,currentJustifiedCheckpoint:jA,finalizedCheckpoint:jA,inactivityScores:dB,currentSyncCommittee:AI,nextSyncCommittee:AI,latestExecutionPayloadHeader:gC,nextWithdrawalIndex:wa,nextWithdrawalValidatorIndex:ZQ,historicalSummaries:Ja},{typeName:"BeaconState",jsonCase:"eth2"}),pa=new K({...rg.fields,executionPayloadHeader:gC,blsToExecutionChanges:nt},{typeName:"BlindedBeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),st=new K({...Et.fields,body:pa},{typeName:"BlindedBeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),Iw=new K({message:st,signature:PQ},{typeName:"SignedBlindedBeaconBlock",jsonCase:"eth2"}),$g=new K({beacon:TI,execution:gC,executionBranch:Na},{typeName:"LightClientHeader",jsonCase:"eth2"}),Ha=new K({header:$g,currentSyncCommittee:AI,currentSyncCommitteeBranch:qQ.fields.currentSyncCommitteeBranch},{typeName:"LightClientBootstrap",jsonCase:"eth2"}),Ma=new K({attestedHeader:$g,nextSyncCommittee:AI,nextSyncCommitteeBranch:AC.fields.nextSyncCommitteeBranch,finalizedHeader:$g,finalityBranch:AC.fields.finalityBranch,syncAggregate:DI,signatureSlot:_Q},{typeName:"LightClientUpdate",jsonCase:"eth2"}),gw=new K({attestedHeader:$g,finalizedHeader:$g,finalityBranch:Ct.fields.finalityBranch,syncAggregate:DI,signatureSlot:_Q},{typeName:"LightClientFinalityUpdate",jsonCase:"eth2"}),Bw=new K({attestedHeader:$g,syncAggregate:DI,signatureSlot:_Q},{typeName:"LightClientOptimisticUpdate",jsonCase:"eth2"}),Cw=new K({snapshot:Ha,validUpdates:new wA(Ma,Hg*wI)},{typeName:"LightClientStore",jsonCase:"eth2"}),xQ=new K({...ot.fields,withdrawals:OQ},{typeName:"PayloadAttributes",jsonCase:"eth2"}),Qw=new K({...jC.fields,payloadAttributes:xQ},{typeName:"SSEPayloadAttributes",jsonCase:"eth2"}),_C=Object.freeze(Object.defineProperty({__proto__:null,BLSToExecutionChange:Ra,BLSToExecutionChanges:nt,BeaconBlock:at,BeaconBlockBody:GB,BeaconState:ng,BlindedBeaconBlock:st,BlindedBeaconBlockBody:pa,BuilderBid:ka,ExecutionBranch:Na,ExecutionPayload:rt,ExecutionPayloadHeader:gC,HistoricalSummaries:Ja,HistoricalSummary:Fa,LightClientBootstrap:Ha,LightClientFinalityUpdate:gw,LightClientHeader:$g,LightClientOptimisticUpdate:Bw,LightClientStore:Cw,LightClientUpdate:Ma,PayloadAttributes:xQ,SSEPayloadAttributes:Qw,SignedBLSToExecutionChange:Ga,SignedBeaconBlock:$S,SignedBlindedBeaconBlock:Iw,SignedBuilderBid:Aw,Withdrawal:ua,Withdrawals:OQ},Symbol.toStringTag,{value:"Module"})),{UintNum64:ht,Slot:zQ,Root:vQ,BLSSignature:lt,UintBn64:WQ,UintBn256:ew,Bytes32:XQ,Bytes48:ct,Bytes96:iw,BLSPubkey:tw,BlobIndex:ma}=Eg,Ew=ct,ow=iw,rw=XQ,Dt=ct,BC=ct,$Q=new kI(To*ac),Ng=new wA($Q,Ug),La=XQ,nw=new wA(La,Ug),aw=XQ,ug=new wA(Dt,Ug),kB=new wA(BC,Ug),sw=new K({startSlot:zQ,count:ht},{typeName:"BlobSidecarsByRangeRequest",jsonCase:"eth2"}),hw=new K({blockRoot:vQ,index:ma},{typeName:"BlobIdentifier",jsonCase:"eth2"}),Ae=new K({...rt.fields,blobGasUsed:WQ,excessBlobGas:WQ},{typeName:"ExecutionPayload",jsonCase:"eth2"}),CC=new K({...gC.fields,blobGasUsed:WQ,excessBlobGas:WQ},{typeName:"ExecutionPayloadHeader",jsonCase:"eth2"}),Ie=new K({...rg.fields,executionPayload:Ae,blsToExecutionChanges:GB.fields.blsToExecutionChanges,blobKzgCommitments:ug},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),ge=new K({...at.fields,body:Ie},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),Ka=new K({message:ge,signature:lt},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),Ya=new EI(XQ,sc),ba=new K({index:ma,blob:$Q,kzgCommitment:Dt,kzgProof:BC,signedBlockHeader:Oi,kzgCommitmentInclusionProof:Ya},{typeName:"BlobSidecar",jsonCase:"eth2"}),lw=new wA(ba,Ug),Ta=new K({commitments:ug,proofs:kB,blobs:Ng},{typeName:"BlobsBundle",jsonCase:"eth2"}),qa=new K({...rg.fields,executionPayloadHeader:CC,blsToExecutionChanges:GB.fields.blsToExecutionChanges,blobKzgCommitments:ug},{typeName:"BlindedBeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),Ut=new K({...st.fields,body:qa},{typeName:"BlindedBeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),cw=new K({message:Ut,signature:lt},{typeName:"SignedBlindedBeaconBlock",jsonCase:"eth2"}),Va=new K({header:CC,blobKzgCommitments:ug,value:ew,pubkey:tw},{typeName:"BuilderBid",jsonCase:"eth2"}),Dw=new K({message:Va,signature:lt},{typeName:"SignedBuilderBid",jsonCase:"eth2"}),Uw=new K({executionPayload:Ae,blobsBundle:Ta},{typeName:"ExecutionPayloadAndBlobsBundle",jsonCase:"eth2"}),fw=new K({genesisTime:ht,genesisValidatorsRoot:vQ,slot:KA,fork:_g,latestBlockHeader:TI,blockRoots:yg,stateRoots:dg,historicalRoots:new wA(vQ,Jg),eth1Data:og,eth1DataVotes:jg,eth1DepositIndex:ht,validators:Zg,balances:Pg,randaoMixes:Og,slashings:xg,previousEpochParticipation:FI,currentEpochParticipation:FI,justificationBits:zg,previousJustifiedCheckpoint:jA,currentJustifiedCheckpoint:jA,finalizedCheckpoint:jA,inactivityScores:dB,currentSyncCommittee:AI,nextSyncCommittee:AI,latestExecutionPayloadHeader:CC,nextWithdrawalIndex:ng.fields.nextWithdrawalIndex,nextWithdrawalValidatorIndex:ng.fields.nextWithdrawalValidatorIndex,historicalSummaries:ng.fields.historicalSummaries},{typeName:"BeaconState",jsonCase:"eth2"}),pI=new K({beacon:TI,execution:CC,executionBranch:$g.fields.executionBranch},{typeName:"LightClientHeader",jsonCase:"eth2"}),ja=new K({header:pI,currentSyncCommittee:AI,currentSyncCommitteeBranch:qQ.fields.currentSyncCommitteeBranch},{typeName:"LightClientBootstrap",jsonCase:"eth2"}),_a=new K({attestedHeader:pI,nextSyncCommittee:AI,nextSyncCommitteeBranch:AC.fields.nextSyncCommitteeBranch,finalizedHeader:pI,finalityBranch:AC.fields.finalityBranch,syncAggregate:DI,signatureSlot:zQ},{typeName:"LightClientUpdate",jsonCase:"eth2"}),Sw=new K({attestedHeader:pI,finalizedHeader:pI,finalityBranch:Ct.fields.finalityBranch,syncAggregate:DI,signatureSlot:zQ},{typeName:"LightClientFinalityUpdate",jsonCase:"eth2"}),ww=new K({attestedHeader:pI,syncAggregate:DI,signatureSlot:zQ},{typeName:"LightClientOptimisticUpdate",jsonCase:"eth2"}),yw=new K({snapshot:ja,validUpdates:new wA(_a,Hg*wI)},{typeName:"LightClientStore",jsonCase:"eth2"}),Za=new K({...xQ.fields,parentBeaconBlockRoot:vQ},{typeName:"PayloadAttributes",jsonCase:"eth2"}),dw=new K({...jC.fields,payloadAttributes:Za},{typeName:"SSEPayloadAttributes",jsonCase:"eth2"}),Nw=new K({block:ge,kzgProofs:kB,blobs:Ng},{typeName:"BlockContents",jsonCase:"eth2"}),uw=new K({signedBlock:Ka,kzgProofs:kB,blobs:Ng},{typeName:"SignedBlockContents",jsonCase:"eth2"}),Be=Object.freeze(Object.defineProperty({__proto__:null,BLSFieldElement:rw,BeaconBlock:ge,BeaconBlockBody:Ie,BeaconState:fw,BlindedBeaconBlock:Ut,BlindedBeaconBlockBody:qa,BlindedBlob:La,BlindedBlobs:nw,Blob:$Q,BlobIdentifier:hw,BlobKzgCommitments:ug,BlobSidecar:ba,BlobSidecars:lw,BlobSidecarsByRangeRequest:sw,Blobs:Ng,BlobsBundle:Ta,BlockContents:Nw,BuilderBid:Va,ExecutionPayload:Ae,ExecutionPayloadAndBlobsBundle:Uw,ExecutionPayloadHeader:CC,G1Point:Ew,G2Point:ow,KZGCommitment:Dt,KZGProof:BC,KZGProofs:kB,KzgCommitmentInclusionProof:Ya,LightClientBootstrap:ja,LightClientFinalityUpdate:Sw,LightClientHeader:pI,LightClientOptimisticUpdate:ww,LightClientStore:yw,LightClientUpdate:_a,PayloadAttributes:Za,SSEPayloadAttributes:dw,SignedBeaconBlock:Ka,SignedBlindedBeaconBlock:cw,SignedBlockContents:uw,SignedBuilderBid:Dw,VersionedHash:aw},Symbol.toStringTag,{value:"Module"})),{Epoch:ft,Gwei:ZC,UintNum64:Ce,Slot:Qe,Root:St,BLSSignature:vI,UintBn256:Rw,Bytes32:PC,BLSPubkey:QC,DepositIndex:Gw,UintBn64:kw,ExecutionAddress:Pa,ValidatorIndex:eC,CommitteeIndex:Fw}=Eg,Oa=new EI(PC,mc),wt=new EI(PC,Mg),xa=new EI(PC,lQ),za=new GQ(UC*Pe),va=new ig(Pe),yt=new bI(eC,UC*Pe),ee=new K({aggregationBits:za,data:yB,signature:vI,committeeBits:va},{typeName:"Attestation",jsonCase:"eth2"}),Jw=new K({committeeIndex:Fw,attesterIndex:eC,data:yB,signature:vI},{typeName:"SingleAttestation",jsonCase:"eth2"}),pw=new K({attestingIndices:yt,data:yB,signature:vI},{typeName:"IndexedAttestation",jsonCase:"eth2"}),dt=new K({attestingIndices:yt,data:Xi,signature:vI},{typeName:"IndexedAttestation",jsonCase:"eth2"}),Nt=new K({attestation1:dt,attestation2:dt},{typeName:"AttesterSlashing",jsonCase:"eth2"}),Wa=new K({aggregatorIndex:eC,aggregate:ee,selectionProof:vI},{typeName:"AggregateAndProof",jsonCase:"eth2",cachePermanentRootStruct:!0}),Hw=new K({message:Wa,signature:vI},{typeName:"SignedAggregateAndProof",jsonCase:"eth2"}),Xa=new K({pubkey:QC,withdrawalCredentials:PC,amount:Ce,signature:vI,index:Gw},{typeName:"DepositRequest",jsonCase:"eth2"}),$a=new wA(Xa,Uc),As=new K({sourceAddress:Pa,validatorPubkey:QC,amount:ZC},{typeName:"WithdrawalRequest",jsonCase:"eth2"}),Is=new wA(As,fc),gs=new K({sourceAddress:Pa,sourcePubkey:QC,targetPubkey:QC},{typeName:"ConsolidationRequest",jsonCase:"eth2"}),Bs=new wA(gs,Dc),OC=new K({deposits:$a,withdrawals:Is,consolidations:Bs},{typeName:"ExecutionRequests",jsonCase:"eth2"}),ie=CC,te=Ae,Ee=new K({randaoReveal:$A.fields.randaoReveal,eth1Data:$A.fields.eth1Data,graffiti:$A.fields.graffiti,proposerSlashings:$A.fields.proposerSlashings,attesterSlashings:new wA(Nt,Fo),attestations:new wA(ee,Jo),deposits:$A.fields.deposits,voluntaryExits:$A.fields.voluntaryExits,syncAggregate:rg.fields.syncAggregate,executionPayload:te,blsToExecutionChanges:GB.fields.blsToExecutionChanges,blobKzgCommitments:Ie.fields.blobKzgCommitments,executionRequests:OC},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),xC=new K({...ge.fields,body:Ee},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),oe=new K({message:xC,signature:vI},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),Cs=new K({randaoReveal:$A.fields.randaoReveal,eth1Data:$A.fields.eth1Data,graffiti:$A.fields.graffiti,proposerSlashings:$A.fields.proposerSlashings,attesterSlashings:new wA(Nt,Fo),attestations:new wA(ee,Jo),deposits:$A.fields.deposits,voluntaryExits:$A.fields.voluntaryExits,syncAggregate:DI,executionPayloadHeader:ie,blsToExecutionChanges:GB.fields.blsToExecutionChanges,blobKzgCommitments:Ie.fields.blobKzgCommitments,executionRequests:OC},{typeName:"BlindedBeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),Qs=new K({...Ut.fields,body:Cs},{typeName:"BlindedBeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),Mw=new K({message:Qs,signature:vI},{typeName:"SignedBlindedBeaconBlock",jsonCase:"eth2"}),es=new K({header:ie,blobKzgCommitments:ug,executionRequests:OC,value:Rw,pubkey:QC},{typeName:"BuilderBid",jsonCase:"eth2"}),mw=new K({message:es,signature:vI},{typeName:"SignedBuilderBid",jsonCase:"eth2"}),is=new K({pubkey:QC,withdrawalCredentials:PC,amount:Ce,signature:vI,slot:Qe},{typeName:"PendingDeposit",jsonCase:"eth2"}),ts=new wA(is,hc),Es=new K({validatorIndex:eC,amount:ZC,withdrawableEpoch:ft},{typeName:"PendingPartialWithdrawal",jsonCase:"eth2"}),os=new wA(Es,lc),rs=new K({sourceIndex:eC,targetIndex:eC},{typeName:"PendingConsolidation",jsonCase:"eth2"}),ns=new wA(rs,cc),zC=new K({genesisTime:Ce,genesisValidatorsRoot:St,slot:KA,fork:_g,latestBlockHeader:TI,blockRoots:yg,stateRoots:dg,historicalRoots:new wA(St,Jg),eth1Data:og,eth1DataVotes:jg,eth1DepositIndex:Ce,validators:Zg,balances:Pg,randaoMixes:Og,slashings:xg,previousEpochParticipation:FI,currentEpochParticipation:FI,justificationBits:zg,previousJustifiedCheckpoint:jA,currentJustifiedCheckpoint:jA,finalizedCheckpoint:jA,inactivityScores:dB,currentSyncCommittee:AI,nextSyncCommittee:AI,latestExecutionPayloadHeader:ie,nextWithdrawalIndex:ng.fields.nextWithdrawalIndex,nextWithdrawalValidatorIndex:ng.fields.nextWithdrawalValidatorIndex,historicalSummaries:ng.fields.historicalSummaries,depositRequestsStartIndex:kw,depositBalanceToConsume:ZC,exitBalanceToConsume:ZC,earliestExitEpoch:ft,consolidationBalanceToConsume:ZC,earliestConsolidationEpoch:ft,pendingDeposits:ts,pendingPartialWithdrawals:os,pendingConsolidations:ns},{typeName:"BeaconState",jsonCase:"eth2"}),as=new K({header:pI,currentSyncCommittee:AI,currentSyncCommitteeBranch:Oa},{typeName:"LightClientBootstrap",jsonCase:"eth2"}),ss=new K({attestedHeader:pI,nextSyncCommittee:AI,nextSyncCommitteeBranch:xa,finalizedHeader:pI,finalityBranch:wt,syncAggregate:DI,signatureSlot:Qe},{typeName:"LightClientUpdate",jsonCase:"eth2"}),Lw=new K({attestedHeader:pI,finalizedHeader:pI,finalityBranch:wt,syncAggregate:DI,signatureSlot:Qe},{typeName:"LightClientFinalityUpdate",jsonCase:"eth2"}),Kw=new K({attestedHeader:pI,syncAggregate:DI,signatureSlot:Qe},{typeName:"LightClientOptimisticUpdate",jsonCase:"eth2"}),Yw=new K({snapshot:as,validUpdates:new wA(ss,Hg*wI)},{typeName:"LightClientStore",jsonCase:"eth2"}),hs=new K({...xQ.fields,parentBeaconBlockRoot:St},{typeName:"PayloadAttributes",jsonCase:"eth2"}),bw=new K({...jC.fields,payloadAttributes:hs},{typeName:"SSEPayloadAttributes",jsonCase:"eth2"}),Tw=new K({block:xC,kzgProofs:kB,blobs:Ng},{typeName:"BlockContents",jsonCase:"eth2"}),qw=new K({signedBlock:oe,kzgProofs:kB,blobs:Ng},{typeName:"BlockContents",jsonCase:"eth2"}),ut=Object.freeze(Object.defineProperty({__proto__:null,AggregateAndProof:Wa,AggregationBits:za,Attestation:ee,AttesterSlashing:Nt,AttestingIndices:yt,BeaconBlock:xC,BeaconBlockBody:Ee,BeaconState:zC,BlindedBeaconBlock:Qs,BlindedBeaconBlockBody:Cs,BlockContents:Tw,BuilderBid:es,CommitteeBits:va,ConsolidationRequest:gs,ConsolidationRequests:Bs,CurrentSyncCommitteeBranch:Oa,DepositRequest:Xa,DepositRequests:$a,ExecutionPayload:te,ExecutionPayloadHeader:ie,ExecutionRequests:OC,FinalityBranch:wt,IndexedAttestation:pw,IndexedAttestationBigint:dt,LightClientBootstrap:as,LightClientFinalityUpdate:Lw,LightClientOptimisticUpdate:Kw,LightClientStore:Yw,LightClientUpdate:ss,NextSyncCommitteeBranch:xa,PayloadAttributes:hs,PendingConsolidation:rs,PendingConsolidations:ns,PendingDeposit:is,PendingDeposits:ts,PendingPartialWithdrawal:Es,PendingPartialWithdrawals:os,SSEPayloadAttributes:bw,SignedAggregateAndProof:Hw,SignedBeaconBlock:oe,SignedBlindedBeaconBlock:Mw,SignedBlockContents:qw,SignedBuilderBid:mw,SingleAttestation:Jw,WithdrawalRequest:As,WithdrawalRequests:Is},Symbol.toStringTag,{value:"Module"})),{Root:Vw,ColumnIndex:re,RowIndex:jw,Bytes32:_w,Slot:ls,UintNum64:cs,ValidatorIndex:Zw}=Eg,Pw=BC,Ow=$Q,xw=new K({...ea.fields,custodyGroupCount:cs},{typeName:"Metadata",jsonCase:"eth2"}),zw=new K({...Aa.fields,earliestAvailableSlot:ls},{typeName:"Status",jsonCase:"eth2"}),ne=new kI(To*Sc),Rt=new wA(ne,Ug),vw=new wA(Rt,qB),Ww=new wA(ne,Ug*qB),Ds=new EI(_w,yc),ae=new wA(BC,wc*Ug),Us=new pQ(Zw,(X1+1)*wI),vC=new K({index:re,column:Rt,kzgCommitments:ug,kzgProofs:kB,signedBlockHeader:Oi,kzgCommitmentsInclusionProof:Ds},{typeName:"DataColumnSidecar",jsonCase:"eth2"}),Xw=new wA(vC,qB),$w=new K({cell:ne,kzgProof:BC,columnIndex:re,rowIndex:jw},{typeName:"MatrixEntry",jsonCase:"eth2"}),Ay=new K({blockRoot:Vw,columns:new bI(re,qB)},{typeName:"DataColumnsByRootIdentifier",jsonCase:"eth2"}),Iy=new K({startSlot:ls,count:cs,columns:new bI(re,qB)},{typeName:"DataColumnSidecarsByRangeRequest",jsonCase:"eth2"}),Ss=xC,gy=oe,ws=new K({commitments:ug,proofs:ae,blobs:Ng},{typeName:"BlobsBundle",jsonCase:"eth2"}),By=new K({executionPayload:te,blobsBundle:ws},{typeName:"ExecutionPayloadAndBlobsBundle",jsonCase:"eth2"}),ys=new K({...zC.fields,proposerLookahead:Us},{typeName:"BeaconState",jsonCase:"eth2"}),Cy=new K({block:xC,kzgProofs:ae,blobs:Ng},{typeName:"BlockContents",jsonCase:"eth2"}),Qy=new K({signedBlock:oe,kzgProofs:ae,blobs:Ng},{typeName:"SignedBlockContents",jsonCase:"eth2"}),ds=Object.freeze(Object.defineProperty({__proto__:null,BeaconBlock:Ss,BeaconState:ys,Blob:Ow,BlobsBundle:ws,BlockContents:Cy,Cell:ne,DataColumn:Rt,DataColumnSidecar:vC,DataColumnSidecars:Xw,DataColumnSidecarsByRangeRequest:Iy,DataColumns:vw,DataColumnsByRootIdentifier:Ay,ExecutionPayloadAndBlobsBundle:By,ExtendedMatrix:Ww,KZGProof:Pw,KZGProofs:ae,KzgCommitmentsInclusionProof:Ds,MatrixEntry:$w,Metadata:xw,ProposerLookahead:Us,SignedBeaconBlock:gy,SignedBlockContents:Qy,Status:zw},Symbol.toStringTag,{value:"Module"})),{Boolean:Ns}=Eg,{Gwei:Gt,ExecutionAddress:se,ValidatorIndex:kt,Epoch:us,BLSSignature:FB,Bytes32:he,Root:JB,Slot:WC,UintBn64:Rs,UintNum64:AB,BLSPubkey:ey,Uint8:iy,BuilderIndex:le,EpochInf:Gs}=Eg,ks=new K({pubkey:ey,version:iy,executionAddress:se,balance:AB,depositEpoch:Gs,withdrawableEpoch:Gs},{typeName:"Builder",jsonCase:"eth2"}),Ft=new K({feeRecipient:se,amount:AB,builderIndex:le},{typeName:"BuilderPendingWithdrawal",jsonCase:"eth2"}),Fs=new K({weight:AB,withdrawal:Ft},{typeName:"BuilderPendingPayment",jsonCase:"eth2"}),ce=new K({beaconBlockRoot:JB,slot:WC,payloadPresent:Ns,blobDataAvailable:Ns},{typeName:"PayloadAttestationData",jsonCase:"eth2"}),Js=new K({aggregationBits:new ig(po),data:ce,signature:FB},{typeName:"PayloadAttestation",jsonCase:"eth2"}),ty=new K({validatorIndex:kt,data:ce,signature:FB},{typeName:"PayloadAttestationMessage",jsonCase:"eth2"}),Ey=new K({attestingIndices:new bI(kt,po),data:ce,signature:FB},{typeName:"IndexedPayloadAttestation",jsonCase:"eth2"}),ps=new K({proposalSlot:WC,validatorIndex:kt,feeRecipient:se,gasLimit:AB},{typeName:"ProposerPreferences",jsonCase:"eth2"}),oy=new K({message:ps,signature:FB},{typeName:"SignedProposerPreferences",jsonCase:"eth2"}),Jt=new K({parentBlockHash:he,parentBlockRoot:JB,blockHash:he,prevRandao:he,feeRecipient:se,gasLimit:Rs,builderIndex:le,slot:WC,value:AB,executionPayment:AB,blobKzgCommitments:ug},{typeName:"ExecutionPayloadBid",jsonCase:"eth2"}),Hs=new K({message:Jt,signature:FB},{typeName:"SignedExecutionPayloadBid",jsonCase:"eth2"}),Ms=new K({payload:te,executionRequests:OC,builderIndex:le,beaconBlockRoot:JB,slot:WC,stateRoot:JB},{typeName:"ExecutionPayloadEnvelope",jsonCase:"eth2"}),ry=new K({message:Ms,signature:FB},{typeName:"SignedExecutionPayloadEnvelope",jsonCase:"eth2"}),ms=new K({randaoReveal:$A.fields.randaoReveal,eth1Data:$A.fields.eth1Data,graffiti:$A.fields.graffiti,proposerSlashings:$A.fields.proposerSlashings,attesterSlashings:Ee.fields.attesterSlashings,attestations:Ee.fields.attestations,deposits:$A.fields.deposits,voluntaryExits:$A.fields.voluntaryExits,syncAggregate:rg.fields.syncAggregate,blsToExecutionChanges:GB.fields.blsToExecutionChanges,signedExecutionPayloadBid:Hs,payloadAttestations:new wA(Js,dc)},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),Ls=new K({...Ss.fields,body:ms},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),ny=new K({message:Ls,signature:FB},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),ay=new K({genesisTime:AB,genesisValidatorsRoot:JB,slot:KA,fork:_g,latestBlockHeader:TI,blockRoots:yg,stateRoots:dg,historicalRoots:new wA(JB,Jg),eth1Data:og,eth1DataVotes:jg,eth1DepositIndex:AB,validators:Zg,balances:Pg,randaoMixes:Og,slashings:xg,previousEpochParticipation:FI,currentEpochParticipation:FI,justificationBits:zg,previousJustifiedCheckpoint:jA,currentJustifiedCheckpoint:jA,finalizedCheckpoint:jA,inactivityScores:dB,currentSyncCommittee:AI,nextSyncCommittee:AI,latestExecutionPayloadBid:Jt,nextWithdrawalIndex:ng.fields.nextWithdrawalIndex,nextWithdrawalValidatorIndex:ng.fields.nextWithdrawalValidatorIndex,historicalSummaries:ng.fields.historicalSummaries,depositRequestsStartIndex:Rs,depositBalanceToConsume:Gt,exitBalanceToConsume:Gt,earliestExitEpoch:us,consolidationBalanceToConsume:Gt,earliestConsolidationEpoch:us,pendingDeposits:zC.fields.pendingDeposits,pendingPartialWithdrawals:zC.fields.pendingPartialWithdrawals,pendingConsolidations:zC.fields.pendingConsolidations,proposerLookahead:ys.fields.proposerLookahead,builders:new wA(ks,Nc),nextWithdrawalBuilderIndex:le,executionPayloadAvailability:new ig(Oe),builderPendingPayments:new EI(Fs,2*wI),builderPendingWithdrawals:new wA(Ft,uc),latestBlockHash:he,payloadExpectedWithdrawals:OQ},{typeName:"BeaconState",jsonCase:"eth2"}),Ks=new K({index:vC.fields.index,column:vC.fields.column,kzgProofs:vC.fields.kzgProofs,slot:WC,beaconBlockRoot:JB},{typeName:"DataColumnSidecar",jsonCase:"eth2"}),sy=new wA(Ks,qB),hy=Object.freeze(Object.defineProperty({__proto__:null,BeaconBlock:Ls,BeaconBlockBody:ms,BeaconState:ay,Builder:ks,BuilderPendingPayment:Fs,BuilderPendingWithdrawal:Ft,DataColumnSidecar:Ks,DataColumnSidecars:sy,ExecutionPayloadBid:Jt,ExecutionPayloadEnvelope:Ms,IndexedPayloadAttestation:Ey,PayloadAttestation:Js,PayloadAttestationData:ce,PayloadAttestationMessage:ty,ProposerPreferences:ps,SignedBeaconBlock:ny,SignedExecutionPayloadBid:Hs,SignedExecutionPayloadEnvelope:ry,SignedProposerPreferences:oy},Symbol.toStringTag,{value:"Module"}));var iC;(function(I){I.builder="builder",I.engine="engine"})(iC||(iC={}));const Rg={[nA.phase0]:{...vg},[nA.altair]:{...vg,...uB},[nA.bellatrix]:{...vg,...uB,...IC},[nA.capella]:{...vg,...uB,...IC,..._C},[nA.deneb]:{...vg,...uB,...IC,..._C,...Be},[nA.electra]:{...vg,...uB,...IC,..._C,...Be,...ut},[nA.fulu]:{...vg,...uB,...IC,..._C,...Be,...ut,...ds},[nA.gloas]:{...vg,...uB,...IC,..._C,...Be,...ut,...ds,...hy}},yA=Rg[nA.phase0],WI=Rg[nA.altair],Ys=Rg[nA.bellatrix],ag=Rg[nA.capella],XC=Rg[nA.deneb],uI=Rg[nA.electra],pt=Rg[nA.fulu],bs=Rg[nA.gloas];function pA(I,A){const g=Rg[I];if(g===void 0)throw Error(`SSZ types for fork ${I} are not defined`);return A===void 0?g:g[A]}const RI=Object.freeze(Object.defineProperty({__proto__:null,BLSPubkey:vB,BLSSignature:LQ,BlobIndex:Vi,Boolean:BI,BuilderIndex:kn,Byte:wn,Bytes20:yn,Bytes32:Li,Bytes4:YC,Bytes48:Ki,Bytes8:mi,Bytes96:Yi,ColumnIndex:Zi,CommitteeIndex:DB,CustodyIndex:Yn,DepositIndex:Jn,Domain:Ln,DomainType:mn,Epoch:PI,EpochInf:Rn,ExecutionAddress:_i,ForkDigest:ji,Gwei:pn,ParticipationFlags:Kn,Root:UB,RowIndex:bn,Slot:KA,SubcommitteeIndex:qi,SyncPeriod:Gn,Uint16:Nn,Uint32:bi,Uint8:dn,UintBn128:un,UintBn256:Ti,UintBn64:cB,UintNum64:RA,UintNumInf64:mQ,ValidatorIndex:XA,Version:Mn,Wei:Hn,WithdrawalIndex:Fn,altair:WI,bellatrix:Ys,capella:ag,deneb:XC,electra:uI,fulu:pt,gloas:bs,phase0:yA,sszTypesFor:pA},Symbol.toStringTag,{value:"Module"}));function dA(I,A=1/0){if(NI(I))return new wA(I,A);if(Gi(I))return new bI(I,A);throw Error(`Unknown type ${I.typeName}`)}const ly=new K({proposerIndex:XA,total:RA,attestations:RA,syncAggregate:RA,proposerSlashings:RA,attesterSlashings:RA},{jsonCase:"eth2"}),Ts=new K({head:RA,target:RA,source:RA,inclusionDelay:RA,inactivity:RA},{jsonCase:"eth2"}),cy=new K({...Ts.fields,effectiveBalance:RA},{jsonCase:"eth2"}),Dy=new K({...Ts.fields,validatorIndex:XA},{jsonCase:"eth2"}),Uy=new K({idealRewards:dA(cy),totalRewards:dA(Dy)},{jsonCase:"eth2"}),fy=dA(new K({validatorIndex:XA,reward:RA},{jsonCase:"eth2"}));function Gg(I){const A=I;return A.finalityBranch!==void 0&&A.finalityBranch.length===Mg}function qs(I){const A=I;return A.finalityBranch!==void 0&&A.finalityBranch.length===Mg}function Sy(I){const A={name:nA.phase0,seq:LA.phase0,epoch:Gc,version:I.GENESIS_FORK_VERSION,prevVersion:I.GENESIS_FORK_VERSION,prevForkName:nA.phase0},g={name:nA.altair,seq:LA.altair,epoch:I.ALTAIR_FORK_EPOCH,version:I.ALTAIR_FORK_VERSION,prevVersion:I.GENESIS_FORK_VERSION,prevForkName:nA.phase0},B={name:nA.bellatrix,seq:LA.bellatrix,epoch:I.BELLATRIX_FORK_EPOCH,version:I.BELLATRIX_FORK_VERSION,prevVersion:I.ALTAIR_FORK_VERSION,prevForkName:nA.altair},e={name:nA.capella,seq:LA.capella,epoch:I.CAPELLA_FORK_EPOCH,version:I.CAPELLA_FORK_VERSION,prevVersion:I.BELLATRIX_FORK_VERSION,prevForkName:nA.bellatrix},Q={name:nA.deneb,seq:LA.deneb,epoch:I.DENEB_FORK_EPOCH,version:I.DENEB_FORK_VERSION,prevVersion:I.CAPELLA_FORK_VERSION,prevForkName:nA.capella},C={name:nA.electra,seq:LA.electra,epoch:I.ELECTRA_FORK_EPOCH,version:I.ELECTRA_FORK_VERSION,prevVersion:I.DENEB_FORK_VERSION,prevForkName:nA.deneb},i={name:nA.fulu,seq:LA.fulu,epoch:I.FULU_FORK_EPOCH,version:I.FULU_FORK_VERSION,prevVersion:I.ELECTRA_FORK_VERSION,prevForkName:nA.electra},o={name:nA.gloas,seq:LA.gloas,epoch:I.GLOAS_FORK_EPOCH,version:I.GLOAS_FORK_VERSION,prevVersion:I.FULU_FORK_VERSION,prevForkName:nA.fulu},D={phase0:A,altair:g,bellatrix:B,capella:e,deneb:Q,electra:C,fulu:i,gloas:o},a=Object.values(D),U=Object.values(D).reverse(),J=[...I.BLOB_SCHEDULE].sort((S,R)=>R.EPOCH-S.EPOCH),f=[...a.map(S=>({fork:S.name,epoch:S.epoch})),...I.BLOB_SCHEDULE.map(S=>({fork:U.find(R=>S.EPOCH>=R.epoch)?.name??A.name,epoch:S.EPOCH}))].filter(({epoch:S})=>S!==1/0).sort((S,R)=>S.epoch-R.epoch),y=[...f].reverse();return{forks:D,forksAscendingEpochOrder:a,forksDescendingEpochOrder:U,forkBoundariesAscendingEpochOrder:f,forkBoundariesDescendingEpochOrder:y,getForkInfo(S){const R=Math.floor(Math.max(S,0)/wI);return this.getForkInfoAtEpoch(R)},getForkInfoAtEpoch(S){return D[this.getForkBoundaryAtEpoch(S).fork]},getForkBoundaryAtEpoch(S){S<0&&(S=0);for(const R of y)if(S>=R.epoch)return R;throw Error("Unreachable as phase0 is scheduled at epoch 0")},getForkName(S){return this.getForkInfo(S).name},getForkSeq(S){return this.getForkInfo(S).seq},getForkSeqAtEpoch(S){return this.getForkInfoAtEpoch(S).seq},getForkVersion(S){return this.getForkInfo(S).version},getForkTypes(S){return pA(this.getForkName(S))},getPostBellatrixForkTypes(S){const R=this.getForkName(S);if(!aQ(R))throw Error(`Invalid slot=${S} fork=${R} for post-bellatrix fork types`);return pA(R)},getPostAltairForkTypes(S){const R=this.getForkName(S);if(!Ze(R))throw Error(`Invalid slot=${S} fork=${R} for post-altair fork types`);return pA(R)},getPostDenebForkTypes(S){const R=this.getForkName(S);if(!SI(R))throw Error(`Invalid slot=${S} fork=${R} for post-deneb fork types`);return pA(R)},getMaxBlobsPerBlock(S){switch(this.getForkInfoAtEpoch(S).name){case nA.electra:return I.MAX_BLOBS_PER_BLOCK_ELECTRA;case nA.deneb:return I.MAX_BLOBS_PER_BLOCK}return this.getBlobParameters(S).maxBlobsPerBlock},getBlobParameters(S){if(S<I.FULU_FORK_EPOCH)throw Error(`getBlobParameters is not available pre-fulu epoch=${S}`);for(const R of J)if(S>=R.EPOCH)return{epoch:R.EPOCH,maxBlobsPerBlock:R.MAX_BLOBS_PER_BLOCK};return{epoch:I.ELECTRA_FORK_EPOCH,maxBlobsPerBlock:I.MAX_BLOBS_PER_BLOCK_ELECTRA}},getAttestationDueMs(S){return Dg(S)?this.getSlotComponentDurationMs(I.ATTESTATION_DUE_BPS_GLOAS):this.getSlotComponentDurationMs(I.ATTESTATION_DUE_BPS)},getAggregateDueMs(S){return Dg(S)?this.getSlotComponentDurationMs(I.AGGREGATE_DUE_BPS_GLOAS):this.getSlotComponentDurationMs(I.AGGREGATE_DUE_BPS)},getSyncMessageDueMs(S){return Dg(S)?this.getSlotComponentDurationMs(I.SYNC_MESSAGE_DUE_BPS_GLOAS):this.getSlotComponentDurationMs(I.SYNC_MESSAGE_DUE_BPS)},getSyncContributionDueMs(S){return Dg(S)?this.getSlotComponentDurationMs(I.CONTRIBUTION_DUE_BPS_GLOAS):this.getSlotComponentDurationMs(I.CONTRIBUTION_DUE_BPS)},getProposerReorgCutoffMs(S){return this.getSlotComponentDurationMs(I.PROPOSER_REORG_CUTOFF_BPS)},getSlotComponentDurationMs(S){return Math.round(S*I.SLOT_DURATION_MS/Mc)}}}function wy(I,A){const g=new Map,B=new Map,e=new Map,Q=new Map,{forkBoundariesAscendingEpochOrder:C}=I;for(let i=0;i<C.length;i++){const o=C[i],D=C[i+1],a=o.epoch,U=D!==void 0?D.epoch:1/0;if(a===U)continue;const J=yy(I,A,a),f=De(J);Q.set(f,a),B.set(a,J),e.set(a,f)}return{genesisValidatorsRoot:A,getDomain(i,o,D){const a=Math.floor((D??i)/wI),U=I.getForkInfo(i),J=a<U.epoch?U.prevForkName:U.name,f=I.forks[J];let y=g.get(f.name);y||(y=new Map,g.set(f.name,y));let S=y.get(o);return S||(S=Vs(o,f.version,A),y.set(o,S)),S},getDomainAtFork(i,o){const D=I.forks[i];let a=g.get(D.name);a||(a=new Map,g.set(D.name,a));let U=a.get(o);return U||(U=Vs(o,D.version,A),a.set(o,U)),U},getDomainForVoluntaryExit(i,o){return i<I.DENEB_FORK_EPOCH*wI?this.getDomain(i,Mo,o):this.getDomainAtFork(nA.capella,Mo)},forkDigest2ForkBoundary(i){const o=De(i),D=Q.get(o);if(D==null)throw Error(`Unknown forkDigest ${o}`);return I.getForkBoundaryAtEpoch(D)},forkDigest2ForkBoundaryOption(i){const o=De(i),D=Q.get(o);return D==null?null:I.getForkBoundaryAtEpoch(D)},forkBoundary2ForkDigest(i){const o=B.get(i.epoch);if(!o)throw Error(`No precomputed forkDigest for ${i.epoch}`);return o},forkBoundary2ForkDigestHex(i){const o=e.get(i.epoch);if(!o)throw Error(`No precomputed forkDigest for ${i.epoch}`);return De(o)}}}function Vs(I,A,g){const B=js(A,g),e=new Uint8Array(32);return e.set(I,0),e.set(B.slice(0,28),4),e}function js(I,A){const g={currentVersion:I,genesisValidatorsRoot:A};return yA.ForkData.hashTreeRoot(g)}function De(I){return BD(typeof I=="string"?I:fg(I))}function yy(I,A,g){const B=I.getForkInfoAtEpoch(g),e=js(B.version,A);if(B.seq<LA.fulu)return e.slice(0,4);const Q=I.getBlobParameters(g);return _c(e,wD(vA.concat([Wo(Q.epoch,8,"le"),Wo(Q.maxBlobsPerBlock,8,"le")]))).slice(0,4)}function Ht(I){const A=$U(I);return{...A,...Sy(A)}}function _s(I,A){const g=Ht(I);return{...g,...wy(g,A)}}let CI;Fg=(I=>(I.lightClientOptimisticHeader="light_client_optimistic_header",I.lightClientFinalityHeader="light_client_finality_header",I.statusChange="light_client_status_change",I))(Fg||{}),function(I){I.ContentType="content-type",I.Accept="accept",I.Authorization="authorization",I.ExposeHeaders="access-control-expose-headers"}(CI||(CI={}));var HI;(function(I){I.json="application/json",I.ssz="application/octet-stream"})(HI||(HI={}));const dy=Object.values(HI);function Ny(I,A){return I!==null&&A.includes(I)}function uy(I){if(!I)return null;const A=I.split(";",1)[0].trim().toLowerCase();return Ny(A,dy)?A:null}function Ry(I,A,{bearerToken:g}){g&&!A.has(CI.Authorization)&&A.set(CI.Authorization,`Bearer ${g}`),(I.username||I.password)&&(A.has(CI.Authorization)||A.set(CI.Authorization,`Basic ${Pc(decodeURIComponent(`${I.username}:${I.password}`))}`),I.username="",I.password="")}function Mt(...I){const A=new Headers;for(const g of I)if(g)if(Array.isArray(g))for(const[B,e]of g)A.set(B,e);else if(g instanceof Headers)for(const[B,e]of g)A.set(B,e);else for(const[B,e]of Object.entries(g))A.set(B,e);return A}function sI(I,A,g=!0){const B=I[A.toLowerCase()];if(B===void 0&&g)throw Error(`${A} header is required`);return B}class Gy extends Headers{getRequired(A){const g=this.get(A);if(g===null)throw Error(`${A} header is required in response`);return g}getOrDefault(A,g){return this.get(A)??g}}var NA;(function(I){I.json="json",I.ssz="ssz"})(NA||(NA={}));function ky(I){switch(I){case HI.json:return NA.json;case HI.ssz:return NA.ssz}}const kA={writeReq:()=>({}),parseReq:()=>{},schema:{}};function tC(I){return{...I,writeReqSsz:()=>{throw Error("Not implemented")},parseReqSsz:()=>{throw Error("Not implemented")},onlySupport:NA.json}}const Fy={toJson:()=>{},fromJson:()=>{},serialize:()=>new Uint8Array,deserialize:()=>{}},VA={toJson:()=>{},fromJson:()=>{},toHeadersObject:()=>({}),fromHeaders:()=>{}},YA={data:Fy,meta:VA,isEmpty:!0};function MI(I){return{toJson:(A,g)=>I(g.version).toJson(A),fromJson:(A,g)=>I(g.version).fromJson(A),serialize:(A,g)=>I(g.version).serialize(A),deserialize:(A,g)=>I(g.version).deserialize(A)}}function Jy(I){return{...I,data:{...I.data,serialize:()=>{throw Error("Not implemented")},deserialize:()=>{throw Error("Not implemented")}},onlySupport:NA.json}}const PA={data:{toJson:I=>UQ(I,"snake"),fromJson:I=>{if(typeof I!="object"||I===null)throw Error("JSON must be of type object");return UQ(I,"camel")},serialize:()=>{throw Error("Not implemented")},deserialize:()=>{throw Error("Not implemented")}},meta:VA,onlySupport:NA.json};function OA(I){if(I=I.toLowerCase(),!(I in nA))throw Error(`Invalid version ${I}`);return I}function kg(I){if(!Ze(I))throw Error(`Invalid fork=${I} for post-altair fork types`);return pA(I)}function mI(I){if(!aQ(I))throw Error(`Invalid fork=${I} for post-bellatrix fork types`);return pA(I)}function $C(I){if(!Dg(I))throw Error(`Invalid fork=${I} for post-gloas fork types`);return pA(I)}var gA;(function(I){I[I.Uint=0]="Uint",I[I.UintRequired=1]="UintRequired",I[I.UintArray=2]="UintArray",I[I.String=3]="String",I[I.StringRequired=4]="StringRequired",I[I.StringArray=5]="StringArray",I[I.StringArrayRequired=6]="StringArrayRequired",I[I.UintOrStringRequired=7]="UintOrStringRequired",I[I.UintOrStringArray=8]="UintOrStringArray",I[I.Object=9]="Object",I[I.ObjectArray=10]="ObjectArray",I[I.AnyArray=11]="AnyArray",I[I.Boolean=12]="Boolean"})(gA||(gA={}));function py(I){return I.method==="GET"||I.req.schema.body===void 0}var IB;(function(I){I.String="String",I.Variable="Variable"})(IB||(IB={}));function Hy(I){const A=[];let g=0,B=!1;for(let e=0,Q=I.length;e<Q;e++)switch(I[e]){case"{":{if(B)throw Error(`Invalid path variable not closed: ${I}`);e>g&&A.push({type:IB.String,str:I.slice(g,e)}),g=e+1,B=!0;break}case"}":{if(!B)throw Error(`Invalid path variable not open: ${I}`);if(g===e)throw Error(`Empty variable: ${I}`);A.push({type:IB.Variable,var:I.slice(g,e)}),B=!1,g=e+1;break}}if(B)throw Error(`Invalid path variable not closed: ${I}`);return g<I.length&&A.push({type:IB.String,str:I.slice(g)}),A}function My(I){const A=Hy(I);if(A.length===1&&A[0].type===IB.String)return()=>I;const g=A.map(B=>{switch(B.type){case IB.String:return()=>B.str;case IB.Variable:{const e=B.var;return Q=>Q[e]}}});return function(B){let e="";for(const Q of g)e+=Q(B);return e}}function my(I){const A=parseInt(I,10);if(!Number.isFinite(A))throw Error(`Invalid uin64 ${I}`);return A}function Ly(I){return I.toString(10)}function AQ(I){return I?.map(A=>typeof A=="string"?A:Ly(A))}function IQ(I){return I?.map(A=>typeof A=="string"&&A.startsWith("0x")?A:my(A))}const Ue=66;function Zs(I){if(I===void 0)return;const A=fg(new TextEncoder().encode(I));return A.length>Ue?A.slice(0,Ue):A.length<Ue?A.padEnd(Ue,"0"):A}function Ps(I){if(I!==void 0)try{return new TextDecoder("utf8").decode(sA(I))}catch{return I}}function pB(I){if(I=I.toLowerCase(),I!=="true"&&I!=="false")throw Error(`Invalid boolean ${I}`);return I==="true"}const gB=new K({version:new Xg});gB.fields.version.fromJson=I=>OA(xI.fromJson(I));const gQ=new K({executionOptimistic:BI},{jsonCase:"eth2"}),mt=new K({...gQ.fields,finalized:BI},{jsonCase:"eth2"});new K({...gQ.fields,...gB.fields},{jsonCase:"eth2"});const Os=new K({...mt.fields,...gB.fields},{jsonCase:"eth2"}),xs=new K({...gQ.fields,dependentRoot:xI},{jsonCase:"eth2"});var aA;(function(I){I.Version="Eth-Consensus-Version",I.ConsensusBlockValue="Eth-Consensus-Block-Value",I.ExecutionPayloadBlinded="Eth-Execution-Payload-Blinded",I.ExecutionPayloadValue="Eth-Execution-Payload-Value",I.Finalized="Eth-Consensus-Finalized",I.DependentRoot="Eth-Consensus-Dependent-Root",I.ExecutionOptimistic="Eth-Execution-Optimistic",I.ExecutionPayloadSource="Eth-Execution-Payload-Source"})(aA||(aA={}));const Ky={toJson:I=>gQ.toJson(I),fromJson:I=>gQ.fromJson(I),toHeadersObject:I=>({[aA.ExecutionOptimistic]:I.executionOptimistic.toString(),[CI.ExposeHeaders]:aA.ExecutionOptimistic}),fromHeaders:I=>({executionOptimistic:pB(I.getOrDefault(aA.ExecutionOptimistic,"false"))})},sg={toJson:I=>gB.toJson(I),fromJson:I=>gB.fromJson(I),toHeadersObject:I=>({[aA.Version]:I.version,[CI.ExposeHeaders]:aA.Version}),fromHeaders:I=>({version:OA(I.getRequired(aA.Version))})},gI={toJson:I=>mt.toJson(I),fromJson:I=>mt.fromJson(I),toHeadersObject:I=>({[aA.ExecutionOptimistic]:I.executionOptimistic.toString(),[aA.Finalized]:I.finalized.toString(),[CI.ExposeHeaders]:[aA.ExecutionOptimistic,aA.Finalized].toString()}),fromHeaders:I=>({executionOptimistic:pB(I.getOrDefault(aA.ExecutionOptimistic,"false")),finalized:pB(I.getOrDefault(aA.Finalized,"false"))})},XI={toJson:I=>Os.toJson(I),fromJson:I=>Os.fromJson(I),toHeadersObject:I=>({[aA.ExecutionOptimistic]:I.executionOptimistic.toString(),[aA.Finalized]:I.finalized.toString(),[aA.Version]:I.version,[CI.ExposeHeaders]:[aA.ExecutionOptimistic,aA.Finalized,aA.Version].toString()}),fromHeaders:I=>({executionOptimistic:pB(I.getOrDefault(aA.ExecutionOptimistic,"false")),finalized:pB(I.getOrDefault(aA.Finalized,"false")),version:OA(I.getRequired(aA.Version))})},Lt={toJson:I=>xs.toJson(I),fromJson:I=>xs.fromJson(I),toHeadersObject:I=>({[aA.ExecutionOptimistic]:I.executionOptimistic.toString(),[aA.DependentRoot]:I.dependentRoot,[CI.ExposeHeaders]:[aA.ExecutionOptimistic,aA.DependentRoot].toString()}),fromHeaders:I=>({executionOptimistic:pB(I.getOrDefault(aA.ExecutionOptimistic,"false")),dependentRoot:I.getRequired(aA.DependentRoot)})},zs=new K({root:UB,canonical:BI,header:yA.SignedBeaconBlockHeader}),Yy=new wA(zs,1e3),vs=new K({root:UB});var Ws;(function(I){I.none="none",I.gossip="gossip",I.consensus="consensus",I.consensusAndEquivocation="consensus_and_equivocation"})(Ws||(Ws={}));const EC={writeReq:({blockId:I})=>({params:{block_id:I.toString()}}),parseReq:({params:I})=>({blockId:I.block_id}),schema:{params:{block_id:gA.StringRequired}}};function by(I){return{getBlockV2:{url:"/eth/v2/beacon/blocks/{block_id}",method:"GET",req:EC,resp:{data:MI(A=>RI[A].SignedBeaconBlock),meta:XI}},getBlindedBlock:{url:"/eth/v1/beacon/blinded_blocks/{block_id}",method:"GET",req:EC,resp:{data:MI(A=>aQ(A)?RI[A].SignedBlindedBeaconBlock:RI[A].SignedBeaconBlock),meta:XI}},getBlockAttestations:{url:"/eth/v1/beacon/blocks/{block_id}/attestations",method:"GET",req:EC,resp:{data:yA.BeaconBlockBody.fields.attestations,meta:gI}},getBlockAttestationsV2:{url:"/eth/v2/beacon/blocks/{block_id}/attestations",method:"GET",req:EC,resp:{data:MI(A=>RI[A].BeaconBlockBody.fields.attestations),meta:XI}},getBlockHeader:{url:"/eth/v1/beacon/headers/{block_id}",method:"GET",req:EC,resp:{data:zs,meta:gI}},getBlockHeaders:{url:"/eth/v1/beacon/headers",method:"GET",req:{writeReq:({slot:A,parentRoot:g})=>({query:{slot:A,parent_root:g}}),parseReq:({query:A})=>({slot:A.slot,parentRoot:A.parent_root}),schema:{query:{slot:gA.Uint,parent_root:gA.String}}},resp:{data:Yy,meta:gI}},getBlockRoot:{url:"/eth/v1/beacon/blocks/{block_id}/root",method:"GET",req:EC,resp:{data:vs,meta:gI}},publishBlock:{url:"/eth/v1/beacon/blocks",method:"POST",req:{writeReqJson:({signedBlockContents:A})=>{const g=A.signedBlock.message.slot,B=I.getForkName(g);return{body:SI(B)?pA(B).SignedBlockContents.toJson(A):pA(B).SignedBeaconBlock.toJson(A.signedBlock),headers:{[aA.Version]:I.getForkName(g)}}},parseReqJson:({body:A,headers:g})=>{let B;const e=sI(g,aA.Version,!1);return e!==void 0?B=OA(e):B=I.getForkName(A.signed_block!==void 0?A.signed_block.message.slot:A.message.slot),{signedBlockContents:SI(B)?pA(B).SignedBlockContents.fromJson(A):{signedBlock:RI[B].SignedBeaconBlock.fromJson(A)}}},writeReqSsz:({signedBlockContents:A})=>{const g=A.signedBlock.message.slot,B=I.getForkName(g);return{body:SI(B)?pA(B).SignedBlockContents.serialize(A):pA(B).SignedBeaconBlock.serialize(A.signedBlock),headers:{[aA.Version]:I.getForkName(g)}}},parseReqSsz:({body:A,headers:g})=>{const B=OA(sI(g,aA.Version));return{signedBlockContents:SI(B)?pA(B).SignedBlockContents.deserialize(A):{signedBlock:RI[B].SignedBeaconBlock.deserialize(A)}}},schema:{body:gA.Object,headers:{[aA.Version]:gA.String}}},resp:YA,init:{requestWireFormat:NA.ssz}},publishBlockV2:{url:"/eth/v2/beacon/blocks",method:"POST",req:{writeReqJson:({signedBlockContents:A,broadcastValidation:g})=>{const B=A.signedBlock.message.slot,e=I.getForkName(B);return{body:SI(e)&&!Dg(e)?pA(e).SignedBlockContents.toJson(A):pA(e).SignedBeaconBlock.toJson(A.signedBlock),headers:{[aA.Version]:e},query:{broadcast_validation:g}}},parseReqJson:({body:A,headers:g,query:B})=>{const e=OA(sI(g,aA.Version));return{signedBlockContents:SI(e)&&!Dg(e)?pA(e).SignedBlockContents.fromJson(A):{signedBlock:RI[e].SignedBeaconBlock.fromJson(A)},broadcastValidation:B.broadcast_validation}},writeReqSsz:({signedBlockContents:A,broadcastValidation:g})=>{const B=A.signedBlock.message.slot,e=I.getForkName(B);return{body:SI(e)&&!Dg(e)?pA(e).SignedBlockContents.serialize(A):pA(e).SignedBeaconBlock.serialize(A.signedBlock),headers:{[aA.Version]:e},query:{broadcast_validation:g}}},parseReqSsz:({body:A,headers:g,query:B})=>{const e=OA(sI(g,aA.Version));return{signedBlockContents:SI(e)&&!Dg(e)?pA(e).SignedBlockContents.deserialize(A):{signedBlock:RI[e].SignedBeaconBlock.deserialize(A)},broadcastValidation:B.broadcast_validation}},schema:{body:gA.Object,query:{broadcast_validation:gA.String},headers:{[aA.Version]:gA.String}}},resp:YA,init:{requestWireFormat:NA.ssz}},publishBlindedBlock:{url:"/eth/v1/beacon/blinded_blocks",method:"POST",req:{writeReqJson:({signedBlindedBlock:A})=>{const g=I.getForkName(A.message.slot);return{body:mI(g).SignedBlindedBeaconBlock.toJson(A),headers:{[aA.Version]:g}}},parseReqJson:({body:A,headers:g})=>{let B;const e=sI(g,aA.Version,!1);return e!==void 0?B=OA(e):B=I.getForkName(A.message.slot),{signedBlindedBlock:mI(B).SignedBlindedBeaconBlock.fromJson(A)}},writeReqSsz:({signedBlindedBlock:A})=>{const g=I.getForkName(A.message.slot);return{body:mI(g).SignedBlindedBeaconBlock.serialize(A),headers:{[aA.Version]:g}}},parseReqSsz:({body:A,headers:g})=>{const B=OA(sI(g,aA.Version));return{signedBlindedBlock:mI(B).SignedBlindedBeaconBlock.deserialize(A)}},schema:{body:gA.Object,headers:{[aA.Version]:gA.String}}},resp:YA,init:{requestWireFormat:NA.ssz}},publishBlindedBlockV2:{url:"/eth/v2/beacon/blinded_blocks",method:"POST",req:{writeReqJson:({signedBlindedBlock:A,broadcastValidation:g})=>{const B=I.getForkName(A.message.slot);return{body:mI(B).SignedBlindedBeaconBlock.toJson(A),headers:{[aA.Version]:B},query:{broadcast_validation:g}}},parseReqJson:({body:A,headers:g,query:B})=>{const e=OA(sI(g,aA.Version));return{signedBlindedBlock:mI(e).SignedBlindedBeaconBlock.fromJson(A),broadcastValidation:B.broadcast_validation}},writeReqSsz:({signedBlindedBlock:A,broadcastValidation:g})=>{const B=I.getForkName(A.message.slot);return{body:mI(B).SignedBlindedBeaconBlock.serialize(A),headers:{[aA.Version]:B},query:{broadcast_validation:g}}},parseReqSsz:({body:A,headers:g,query:B})=>{const e=OA(sI(g,aA.Version));return{signedBlindedBlock:mI(e).SignedBlindedBeaconBlock.deserialize(A),broadcastValidation:B.broadcast_validation}},schema:{body:gA.Object,query:{broadcast_validation:gA.String},headers:{[aA.Version]:gA.String}}},resp:YA,init:{requestWireFormat:NA.ssz}},publishExecutionPayloadEnvelope:{url:"/eth/v1/beacon/execution_payload_envelope",method:"POST",req:{writeReqJson:({signedExecutionPayloadEnvelope:A})=>{const g=I.getForkName(A.message.slot);return{body:$C(g).SignedExecutionPayloadEnvelope.toJson(A),headers:{[aA.Version]:g}}},parseReqJson:({body:A,headers:g})=>{const B=OA(sI(g,aA.Version));return{signedExecutionPayloadEnvelope:$C(B).SignedExecutionPayloadEnvelope.fromJson(A)}},writeReqSsz:({signedExecutionPayloadEnvelope:A})=>{const g=I.getForkName(A.message.slot);return{body:$C(g).SignedExecutionPayloadEnvelope.serialize(A),headers:{[aA.Version]:g}}},parseReqSsz:({body:A,headers:g})=>{const B=OA(sI(g,aA.Version));return{signedExecutionPayloadEnvelope:$C(B).SignedExecutionPayloadEnvelope.deserialize(A)}},schema:{body:gA.Object,headers:{[aA.Version]:gA.String}}},resp:YA,init:{requestWireFormat:NA.ssz}},getBlobSidecars:{url:"/eth/v1/beacon/blob_sidecars/{block_id}",method:"GET",req:{writeReq:({blockId:A,indices:g})=>({params:{block_id:A.toString()},query:{indices:g}}),parseReq:({params:A,query:g})=>({blockId:A.block_id,indices:g.indices}),schema:{params:{block_id:gA.StringRequired},query:{indices:gA.UintArray}}},resp:{data:XC.BlobSidecars,meta:XI}},getBlobs:{url:"/eth/v1/beacon/blobs/{block_id}",method:"GET",req:{writeReq:({blockId:A,versionedHashes:g})=>({params:{block_id:A.toString()},query:{versioned_hashes:g}}),parseReq:({params:A,query:g})=>({blockId:A.block_id,versionedHashes:g.versioned_hashes?.map(B=>B.toLowerCase())}),schema:{params:{block_id:gA.StringRequired},query:{versioned_hashes:gA.StringArray}}},resp:{data:XC.Blobs,meta:gI}}}}const BB=dA(yA.Attestation),fe=dA(uI.SingleAttestation),Xs=dA(yA.Attestation),Ty=dA(uI.Attestation),$s=dA(yA.AttesterSlashing),qy=dA(uI.AttesterSlashing),Vy=dA(yA.ProposerSlashing),jy=dA(yA.SignedVoluntaryExit),BQ=dA(ag.SignedBLSToExecutionChange),Se=dA(WI.SyncCommitteeMessage);function _y(I){return{getPoolAttestations:{url:"/eth/v1/beacon/pool/attestations",method:"GET",req:{writeReq:({slot:A,committeeIndex:g})=>({query:{slot:A,committee_index:g}}),parseReq:({query:A})=>({slot:A.slot,committeeIndex:A.committee_index}),schema:{query:{slot:gA.Uint,committee_index:gA.Uint}}},resp:{data:Xs,meta:VA}},getPoolAttestationsV2:{url:"/eth/v2/beacon/pool/attestations",method:"GET",req:{writeReq:({slot:A,committeeIndex:g})=>({query:{slot:A,committee_index:g}}),parseReq:({query:A})=>({slot:A.slot,committeeIndex:A.committee_index}),schema:{query:{slot:gA.Uint,committee_index:gA.Uint}}},resp:{data:MI(A=>WA(A)?Ty:Xs),meta:sg}},getPoolAttesterSlashings:{url:"/eth/v1/beacon/pool/attester_slashings",method:"GET",req:kA,resp:{data:$s,meta:VA}},getPoolAttesterSlashingsV2:{url:"/eth/v2/beacon/pool/attester_slashings",method:"GET",req:kA,resp:{data:MI(A=>WA(A)?qy:$s),meta:sg}},getPoolProposerSlashings:{url:"/eth/v1/beacon/pool/proposer_slashings",method:"GET",req:kA,resp:{data:Vy,meta:VA}},getPoolVoluntaryExits:{url:"/eth/v1/beacon/pool/voluntary_exits",method:"GET",req:kA,resp:{data:jy,meta:VA}},getPoolBLSToExecutionChanges:{url:"/eth/v1/beacon/pool/bls_to_execution_changes",method:"GET",req:kA,resp:{data:BQ,meta:VA}},submitPoolAttestations:{url:"/eth/v1/beacon/pool/attestations",method:"POST",req:{writeReqJson:({signedAttestations:A})=>({body:BB.toJson(A)}),parseReqJson:({body:A})=>({signedAttestations:BB.fromJson(A)}),writeReqSsz:({signedAttestations:A})=>({body:BB.serialize(A)}),parseReqSsz:({body:A})=>({signedAttestations:BB.deserialize(A)}),schema:{body:gA.ObjectArray}},resp:YA},submitPoolAttestationsV2:{url:"/eth/v2/beacon/pool/attestations",method:"POST",req:{writeReqJson:({signedAttestations:A})=>{const g=I.getForkName(A[0]?.data.slot??0);return{body:WA(g)?fe.toJson(A):BB.toJson(A),headers:{[aA.Version]:g}}},parseReqJson:({body:A,headers:g})=>{const B=OA(sI(g,aA.Version));return{signedAttestations:WA(B)?fe.fromJson(A):BB.fromJson(A)}},writeReqSsz:({signedAttestations:A})=>{const g=I.getForkName(A[0]?.data.slot??0);return{body:WA(g)?fe.serialize(A):BB.serialize(A),headers:{[aA.Version]:g}}},parseReqSsz:({body:A,headers:g})=>{const B=OA(sI(g,aA.Version));return{signedAttestations:WA(B)?fe.deserialize(A):BB.deserialize(A)}},schema:{body:gA.ObjectArray,headers:{[aA.Version]:gA.String}}},resp:YA},submitPoolAttesterSlashings:{url:"/eth/v1/beacon/pool/attester_slashings",method:"POST",req:{writeReqJson:({attesterSlashing:A})=>({body:yA.AttesterSlashing.toJson(A)}),parseReqJson:({body:A})=>({attesterSlashing:yA.AttesterSlashing.fromJson(A)}),writeReqSsz:({attesterSlashing:A})=>({body:yA.AttesterSlashing.serialize(A)}),parseReqSsz:({body:A})=>({attesterSlashing:yA.AttesterSlashing.deserialize(A)}),schema:{body:gA.Object}},resp:YA},submitPoolAttesterSlashingsV2:{url:"/eth/v2/beacon/pool/attester_slashings",method:"POST",req:{writeReqJson:({attesterSlashing:A})=>{const g=I.getForkName(Number(A.attestation1.data.slot));return{body:WA(g)?uI.AttesterSlashing.toJson(A):yA.AttesterSlashing.toJson(A),headers:{[aA.Version]:g}}},parseReqJson:({body:A,headers:g})=>{const B=OA(sI(g,aA.Version));return{attesterSlashing:WA(B)?uI.AttesterSlashing.fromJson(A):yA.AttesterSlashing.fromJson(A)}},writeReqSsz:({attesterSlashing:A})=>{const g=I.getForkName(Number(A.attestation1.data.slot));return{body:WA(g)?uI.AttesterSlashing.serialize(A):yA.AttesterSlashing.serialize(A),headers:{[aA.Version]:g}}},parseReqSsz:({body:A,headers:g})=>{const B=OA(sI(g,aA.Version));return{attesterSlashing:WA(B)?uI.AttesterSlashing.deserialize(A):yA.AttesterSlashing.deserialize(A)}},schema:{body:gA.Object,headers:{[aA.Version]:gA.String}}},resp:YA},submitPoolProposerSlashings:{url:"/eth/v1/beacon/pool/proposer_slashings",method:"POST",req:{writeReqJson:({proposerSlashing:A})=>({body:yA.ProposerSlashing.toJson(A)}),parseReqJson:({body:A})=>({proposerSlashing:yA.ProposerSlashing.fromJson(A)}),writeReqSsz:({proposerSlashing:A})=>({body:yA.ProposerSlashing.serialize(A)}),parseReqSsz:({body:A})=>({proposerSlashing:yA.ProposerSlashing.deserialize(A)}),schema:{body:gA.Object}},resp:YA},submitPoolVoluntaryExit:{url:"/eth/v1/beacon/pool/voluntary_exits",method:"POST",req:{writeReqJson:({signedVoluntaryExit:A})=>({body:yA.SignedVoluntaryExit.toJson(A)}),parseReqJson:({body:A})=>({signedVoluntaryExit:yA.SignedVoluntaryExit.fromJson(A)}),writeReqSsz:({signedVoluntaryExit:A})=>({body:yA.SignedVoluntaryExit.serialize(A)}),parseReqSsz:({body:A})=>({signedVoluntaryExit:yA.SignedVoluntaryExit.deserialize(A)}),schema:{body:gA.Object}},resp:YA},submitPoolBLSToExecutionChange:{url:"/eth/v1/beacon/pool/bls_to_execution_changes",method:"POST",req:{writeReqJson:({blsToExecutionChanges:A})=>({body:BQ.toJson(A)}),parseReqJson:({body:A})=>({blsToExecutionChanges:BQ.fromJson(A)}),writeReqSsz:({blsToExecutionChanges:A})=>({body:BQ.serialize(A)}),parseReqSsz:({body:A})=>({blsToExecutionChanges:BQ.deserialize(A)}),schema:{body:gA.ObjectArray}},resp:YA},submitPoolSyncCommitteeSignatures:{url:"/eth/v1/beacon/pool/sync_committees",method:"POST",req:{writeReqJson:({signatures:A})=>({body:Se.toJson(A)}),parseReqJson:({body:A})=>({signatures:Se.fromJson(A)}),writeReqSsz:({signatures:A})=>({body:Se.serialize(A)}),parseReqSsz:({body:A})=>({signatures:Se.deserialize(A)}),schema:{body:gA.ObjectArray}},resp:YA}}}function Zy(I){return{getBlockRewards:{url:"/eth/v1/beacon/rewards/blocks/{block_id}",method:"GET",req:{writeReq:({blockId:A})=>({params:{block_id:A.toString()}}),parseReq:({params:A})=>({blockId:A.block_id}),schema:{params:{block_id:gA.StringRequired}}},resp:{data:ly,meta:gI}},getAttestationsRewards:{url:"/eth/v1/beacon/rewards/attestations/{epoch}",method:"POST",req:tC({writeReqJson:({epoch:A,validatorIds:g})=>({params:{epoch:A},body:AQ(g)||[]}),parseReqJson:({params:A,body:g})=>({epoch:A.epoch,validatorIds:IQ(g)}),schema:{params:{epoch:gA.UintRequired},body:gA.UintOrStringArray}}),resp:{data:Uy,meta:gI}},getSyncCommitteeRewards:{url:"/eth/v1/beacon/rewards/sync_committee/{block_id}",method:"POST",req:tC({writeReqJson:({blockId:A,validatorIds:g})=>({params:{block_id:A.toString()},body:AQ(g)||[]}),parseReqJson:({params:A,body:g})=>({blockId:A.block_id,validatorIds:IQ(g)}),schema:{params:{block_id:gA.StringRequired},body:gA.UintOrStringArray}}),resp:{data:fy,meta:gI}}}}const Py=new K({randao:UB}),Oy=new K({previousJustified:yA.Checkpoint,currentJustified:yA.Checkpoint,finalized:yA.Checkpoint},{jsonCase:"eth2"}),A0=new K({index:XA,balance:RA,status:new Xg,validator:yA.Validator}),xy=new K({index:XA,pubkey:vB,activationEpoch:RA},{jsonCase:"eth2"}),zy=new K({index:DB,slot:KA,validators:dA(XA,UC)}),vy=new K({index:XA,balance:RA}),Wy=new K({validators:dA(XA),validatorAggregates:dA(dA(XA))},{jsonCase:"eth2"}),I0=dA(A0),Xy=dA(xy),$y=dA(zy),g0=dA(vy),HB={writeReq:({stateId:I})=>({params:{state_id:I.toString()}}),parseReq:({params:I})=>({stateId:I.state_id}),schema:{params:{state_id:gA.StringRequired}}};function Ad(I){return{getEpochCommittees:{url:"/eth/v1/beacon/states/{state_id}/committees",method:"GET",req:{writeReq:({stateId:A,epoch:g,index:B,slot:e})=>({params:{state_id:A.toString()},query:{epoch:g,index:B,slot:e}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,epoch:g.epoch,index:g.index,slot:g.slot}),schema:{params:{state_id:gA.StringRequired},query:{slot:gA.Uint,epoch:gA.Uint,index:gA.Uint}}},resp:{data:$y,meta:gI}},getEpochSyncCommittees:{url:"/eth/v1/beacon/states/{state_id}/sync_committees",method:"GET",req:{writeReq:({stateId:A,epoch:g})=>({params:{state_id:A.toString()},query:{epoch:g}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,epoch:g.epoch}),schema:{params:{state_id:gA.StringRequired},query:{epoch:gA.Uint}}},resp:{data:Wy,meta:gI}},getStateFinalityCheckpoints:{url:"/eth/v1/beacon/states/{state_id}/finality_checkpoints",method:"GET",req:HB,resp:{data:Oy,meta:gI}},getStateFork:{url:"/eth/v1/beacon/states/{state_id}/fork",method:"GET",req:HB,resp:{data:yA.Fork,meta:gI}},getStateRoot:{url:"/eth/v1/beacon/states/{state_id}/root",method:"GET",req:HB,resp:{data:vs,meta:gI}},getStateRandao:{url:"/eth/v1/beacon/states/{state_id}/randao",method:"GET",req:{writeReq:({stateId:A,epoch:g})=>({params:{state_id:A.toString()},query:{epoch:g}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,epoch:g.epoch}),schema:{params:{state_id:gA.StringRequired},query:{epoch:gA.Uint}}},resp:{data:Py,meta:gI}},getStateValidator:{url:"/eth/v1/beacon/states/{state_id}/validators/{validator_id}",method:"GET",req:{writeReq:({stateId:A,validatorId:g})=>({params:{state_id:A.toString(),validator_id:g}}),parseReq:({params:A})=>({stateId:A.state_id,validatorId:A.validator_id}),schema:{params:{state_id:gA.StringRequired,validator_id:gA.StringRequired}}},resp:{onlySupport:NA.json,data:A0,meta:gI}},getStateValidators:{url:"/eth/v1/beacon/states/{state_id}/validators",method:"GET",req:{writeReq:({stateId:A,validatorIds:g,statuses:B})=>({params:{state_id:A.toString()},query:{id:g,status:B}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,validatorIds:g.id,statuses:g.status}),schema:{params:{state_id:gA.StringRequired},query:{id:gA.UintOrStringArray,status:gA.StringArray}}},resp:{onlySupport:NA.json,data:I0,meta:gI}},postStateValidators:{url:"/eth/v1/beacon/states/{state_id}/validators",method:"POST",req:tC({writeReqJson:({stateId:A,validatorIds:g,statuses:B})=>({params:{state_id:A.toString()},body:{ids:AQ(g),statuses:B}}),parseReqJson:({params:A,body:g={}})=>({stateId:A.state_id,validatorIds:IQ(g.ids),statuses:g.statuses??void 0}),schema:{params:{state_id:gA.StringRequired},body:gA.Object}}),resp:{onlySupport:NA.json,data:I0,meta:gI}},postStateValidatorIdentities:{url:"/eth/v1/beacon/states/{state_id}/validator_identities",method:"POST",req:tC({writeReqJson:({stateId:A,validatorIds:g})=>({params:{state_id:A.toString()},body:AQ(g)||[]}),parseReqJson:({params:A,body:g=[]})=>({stateId:A.state_id,validatorIds:IQ(g)}),schema:{params:{state_id:gA.StringRequired},body:gA.UintOrStringArray}}),resp:{data:Xy,meta:gI}},getStateValidatorBalances:{url:"/eth/v1/beacon/states/{state_id}/validator_balances",method:"GET",req:{writeReq:({stateId:A,validatorIds:g})=>({params:{state_id:A.toString()},query:{id:g}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,validatorIds:g.id}),schema:{params:{state_id:gA.StringRequired},query:{id:gA.UintOrStringArray}}},resp:{data:g0,meta:gI}},postStateValidatorBalances:{url:"/eth/v1/beacon/states/{state_id}/validator_balances",method:"POST",req:tC({writeReqJson:({stateId:A,validatorIds:g})=>({params:{state_id:A.toString()},body:AQ(g)||[]}),parseReqJson:({params:A,body:g=[]})=>({stateId:A.state_id,validatorIds:IQ(g)}),schema:{params:{state_id:gA.StringRequired},body:gA.UintOrStringArray}}),resp:{data:g0,meta:gI}},getPendingDeposits:{url:"/eth/v1/beacon/states/{state_id}/pending_deposits",method:"GET",req:HB,resp:{data:uI.PendingDeposits,meta:XI}},getPendingPartialWithdrawals:{url:"/eth/v1/beacon/states/{state_id}/pending_partial_withdrawals",method:"GET",req:HB,resp:{data:uI.PendingPartialWithdrawals,meta:XI}},getPendingConsolidations:{url:"/eth/v1/beacon/states/{state_id}/pending_consolidations",method:"GET",req:HB,resp:{data:uI.PendingConsolidations,meta:XI}},getProposerLookahead:{url:"/eth/v1/beacon/states/{state_id}/proposer_lookahead",method:"GET",req:HB,resp:{data:pt.ProposerLookahead,meta:XI}}}}function Id(I){return{getGenesis:{url:"/eth/v1/beacon/genesis",method:"GET",req:kA,resp:{data:yA.Genesis,meta:VA}},...by(I),..._y(I),...Ad(),...Zy()}}const gd=new K({chainId:RA,address:_i},{jsonCase:"eth2"}),Bd=dA(yA.Fork);function Cd(I){return{getDepositContract:{url:"/eth/v1/config/deposit_contract",method:"GET",req:kA,resp:{data:gd,meta:VA}},getForkSchedule:{url:"/eth/v1/config/fork_schedule",method:"GET",req:kA,resp:{data:Bd,meta:VA}},getSpec:{url:"/eth/v1/config/spec",method:"GET",req:kA,resp:Jy({data:{toJson:A=>A,fromJson:A=>{if(typeof A!="object"||A===null)throw Error("JSON must be of type object");return A}},meta:VA})}}}const oI=new Xg,Qd=new K({executionPayloadBlockHash:oI,executionPayloadNumber:RA,executionStatus:oI,slot:KA,blockRoot:oI,parentRoot:oI,stateRoot:oI,targetRoot:oI,timeliness:BI,justifiedEpoch:PI,justifiedRoot:oI,finalizedEpoch:PI,finalizedRoot:oI,unrealizedJustifiedEpoch:PI,unrealizedJustifiedRoot:oI,unrealizedFinalizedEpoch:PI,unrealizedFinalizedRoot:oI,parent:oI,weight:bi,bestChild:oI,bestDescendant:oI},{jsonCase:"eth2"}),ed=new K({slot:KA,root:oI,executionOptimistic:BI},{jsonCase:"eth2"}),id=new K({slot:KA,blockRoot:oI,parentRoot:oI,justifiedEpoch:PI,finalizedEpoch:PI,weight:RA,validity:new Xg,executionBlockHash:oI},{jsonCase:"eth2"}),td=new K({justifiedCheckpoint:yA.Checkpoint,finalizedCheckpoint:yA.Checkpoint,forkChoiceNodes:dA(id)},{jsonCase:"eth2"}),Ed=dA(Qd),od=dA(ed);function rd(I){return{getDebugChainHeadsV2:{url:"/eth/v2/debug/beacon/heads",method:"GET",req:kA,resp:{data:od,meta:VA,onlySupport:NA.json}},getDebugForkChoice:{url:"/eth/v1/debug/fork_choice",method:"GET",req:kA,resp:{data:td,meta:VA,onlySupport:NA.json,transform:{toResponse:A=>({...A}),fromResponse:A=>({data:A})}}},getProtoArrayNodes:{url:"/eth/v0/debug/forkchoice",method:"GET",req:kA,resp:{data:Ed,meta:VA,onlySupport:NA.json}},getStateV2:{url:"/eth/v2/debug/beacon/states/{state_id}",method:"GET",req:{writeReq:({stateId:A})=>({params:{state_id:A.toString()}}),parseReq:({params:A})=>({stateId:A.state_id}),schema:{params:{state_id:gA.StringRequired}}},resp:{data:MI(A=>RI[A].BeaconState),meta:XI},init:{timeoutMs:3e5}},getDebugDataColumnSidecars:{url:"/eth/v1/debug/beacon/data_column_sidecars/{block_id}",method:"GET",req:{writeReq:({blockId:A,indices:g})=>({params:{block_id:A.toString()},query:{indices:g}}),parseReq:({params:A,query:g})=>({blockId:A.block_id,indices:g.indices}),schema:{params:{block_id:gA.StringRequired},query:{indices:gA.UintArray}}},resp:{data:MI(A=>Ro(A)?pA(A).DataColumnSidecars:pt.DataColumnSidecars),meta:XI}}}}const rI=new Xg,nd=new K({blockRoot:rI,index:Vi,slot:KA,kzgCommitment:rI,versionedHash:rI},{typeName:"BlobSidecarSSE",jsonCase:"eth2"}),ad=new K({blockRoot:rI,index:Zi,slot:KA,kzgCommitments:new bI(rI,Ug)},{typeName:"DataColumnSidecarSSE",jsonCase:"eth2"});var fA;(function(I){I.head="head",I.block="block",I.blockGossip="block_gossip",I.attestation="attestation",I.singleAttestation="single_attestation",I.voluntaryExit="voluntary_exit",I.proposerSlashing="proposer_slashing",I.attesterSlashing="attester_slashing",I.blsToExecutionChange="bls_to_execution_change",I.finalizedCheckpoint="finalized_checkpoint",I.chainReorg="chain_reorg",I.contributionAndProof="contribution_and_proof",I.lightClientOptimisticUpdate="light_client_optimistic_update",I.lightClientFinalityUpdate="light_client_finality_update",I.payloadAttributes="payload_attributes",I.blobSidecar="blob_sidecar",I.dataColumnSidecar="data_column_sidecar"})(fA||(fA={})),fA.head+"",fA.head,fA.block+"",fA.block,fA.blockGossip+"",fA.blockGossip,fA.attestation+"",fA.attestation,fA.singleAttestation+"",fA.singleAttestation,fA.voluntaryExit+"",fA.voluntaryExit,fA.proposerSlashing+"",fA.proposerSlashing,fA.attesterSlashing+"",fA.attesterSlashing,fA.blsToExecutionChange+"",fA.blsToExecutionChange,fA.finalizedCheckpoint+"",fA.finalizedCheckpoint,fA.chainReorg+"",fA.chainReorg,fA.contributionAndProof+"",fA.contributionAndProof,fA.lightClientOptimisticUpdate+"",fA.lightClientOptimisticUpdate,fA.lightClientFinalityUpdate+"",fA.lightClientFinalityUpdate,fA.payloadAttributes+"",fA.payloadAttributes,fA.blobSidecar+"",fA.blobSidecar,fA.dataColumnSidecar+"",fA.dataColumnSidecar;function sd(I){return{eventstream:{url:"/eth/v1/events",method:"GET",req:{writeReq:({topics:A})=>({query:{topics:A}}),parseReq:({query:A})=>({topics:A.topics}),schema:{query:{topics:gA.StringArrayRequired}}},resp:YA}}}function hd(I){const A=g=>({toJson:({data:B,version:e})=>({data:g(e).toJson(B),version:e}),fromJson:B=>{const{version:e}=gB.fromJson(B);return{data:g(e).fromJson(B.data),version:e}}});return{[fA.head]:new K({slot:KA,block:rI,state:rI,epochTransition:BI,previousDutyDependentRoot:rI,currentDutyDependentRoot:rI,executionOptimistic:BI},{jsonCase:"eth2"}),[fA.block]:new K({slot:KA,block:rI,executionOptimistic:BI},{jsonCase:"eth2"}),[fA.blockGossip]:new K({slot:KA,block:rI},{jsonCase:"eth2"}),[fA.attestation]:{toJson:g=>{const B=I.getForkName(g.data.slot);return pA(B).Attestation.toJson(g)},fromJson:g=>{const B=I.getForkName(g.data.slot);return pA(B).Attestation.fromJson(g)}},[fA.singleAttestation]:uI.SingleAttestation,[fA.voluntaryExit]:yA.SignedVoluntaryExit,[fA.proposerSlashing]:yA.ProposerSlashing,[fA.attesterSlashing]:{toJson:g=>{const B=I.getForkName(Number(g.attestation1.data.slot));return pA(B).AttesterSlashing.toJson(g)},fromJson:g=>{const B=I.getForkName(Number(g.attestation1.data.slot));return pA(B).AttesterSlashing.fromJson(g)}},[fA.blsToExecutionChange]:ag.SignedBLSToExecutionChange,[fA.finalizedCheckpoint]:new K({block:rI,state:rI,epoch:PI,executionOptimistic:BI},{jsonCase:"eth2"}),[fA.chainReorg]:new K({slot:KA,depth:RA,oldHeadBlock:rI,newHeadBlock:rI,oldHeadState:rI,newHeadState:rI,epoch:PI,executionOptimistic:BI},{jsonCase:"eth2"}),[fA.contributionAndProof]:WI.SignedContributionAndProof,[fA.payloadAttributes]:A(g=>mI(g).SSEPayloadAttributes),[fA.blobSidecar]:nd,[fA.dataColumnSidecar]:ad,[fA.lightClientOptimisticUpdate]:A(g=>kg(g).LightClientOptimisticUpdate),[fA.lightClientFinalityUpdate]:A(g=>kg(g).LightClientFinalityUpdate)}}function ld(I){const A=hd(I);return{toJson:g=>A[g.type].toJson(g.message),fromJson:(g,B)=>A[g].fromJson(B)}}const B0={...aB,PRESET_BASE:KI.gnosis,CONFIG_NAME:"gnosis",TERMINAL_TOTAL_DIFFICULTY:BigInt("8626000000000000000000058750000000000000000000"),SECONDS_PER_SLOT:5,SLOT_DURATION_MS:5e3,SECONDS_PER_ETH1_BLOCK:6,ETH1_FOLLOW_DISTANCE:1024,CHURN_LIMIT_QUOTIENT:4096,MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT:2,DEPOSIT_CHAIN_ID:100,DEPOSIT_NETWORK_ID:100,DEPOSIT_CONTRACT_ADDRESS:sA("0x0b98057ea310f4d31f2a452b414647007d1645d9"),MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS:16384,MIN_GENESIS_TIME:1638968400,MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:4096,GENESIS_FORK_VERSION:sA("0x00000064"),GENESIS_DELAY:6e3,ALTAIR_FORK_VERSION:sA("0x01000064"),ALTAIR_FORK_EPOCH:512,BELLATRIX_FORK_VERSION:sA("0x02000064"),BELLATRIX_FORK_EPOCH:385536,CAPELLA_FORK_VERSION:sA("0x03000064"),CAPELLA_FORK_EPOCH:648704,DENEB_FORK_VERSION:sA("0x04000064"),DENEB_FORK_EPOCH:889856,ELECTRA_FORK_VERSION:sA("0x05000064"),ELECTRA_FORK_EPOCH:1337856,FULU_FORK_VERSION:sA("0x06000064"),FULU_FORK_EPOCH:1/0,GLOAS_FORK_VERSION:sA("0x07000064"),GLOAS_FORK_EPOCH:1/0,MAX_BLOBS_PER_BLOCK:2,MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT:64e9,BLOB_SIDECAR_SUBNET_COUNT_ELECTRA:2,MAX_BLOBS_PER_BLOCK_ELECTRA:2,MAX_REQUEST_BLOB_SIDECARS_ELECTRA:256,BLOB_SCHEDULE:[]},cd={...B0,CONFIG_NAME:"chiado",TERMINAL_TOTAL_DIFFICULTY:BigInt("231707791542740786049188744689299064356246512"),DEPOSIT_CHAIN_ID:10200,DEPOSIT_NETWORK_ID:10200,DEPOSIT_CONTRACT_ADDRESS:sA("0xb97036A26259B7147018913bD58a774cf91acf25"),MIN_GENESIS_TIME:1665396e3,MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:6e3,GENESIS_FORK_VERSION:sA("0x0000006f"),GENESIS_DELAY:300,ALTAIR_FORK_VERSION:sA("0x0100006f"),ALTAIR_FORK_EPOCH:90,BELLATRIX_FORK_VERSION:sA("0x0200006f"),BELLATRIX_FORK_EPOCH:180,CAPELLA_FORK_VERSION:sA("0x0300006f"),CAPELLA_FORK_EPOCH:244224,DENEB_FORK_VERSION:sA("0x0400006f"),DENEB_FORK_EPOCH:516608,ELECTRA_FORK_VERSION:sA("0x0500006f"),ELECTRA_FORK_EPOCH:948224,FULU_FORK_VERSION:sA("0x0600006f"),FULU_FORK_EPOCH:1353216,GLOAS_FORK_VERSION:sA("0x0700006f"),GLOAS_FORK_EPOCH:1/0,BLOB_SCHEDULE:[]},CQ={...aB,CONFIG_NAME:"ephemery",MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:64,MIN_GENESIS_TIME:1638471600,GENESIS_FORK_VERSION:sA("0x1000101b"),GENESIS_DELAY:300,ALTAIR_FORK_VERSION:sA("0x2000101b"),ALTAIR_FORK_EPOCH:0,BELLATRIX_FORK_VERSION:sA("0x3000101b"),BELLATRIX_FORK_EPOCH:0,TERMINAL_TOTAL_DIFFICULTY:BigInt("0"),CAPELLA_FORK_VERSION:sA("0x4000101b"),CAPELLA_FORK_EPOCH:0,DENEB_FORK_VERSION:sA("0x5000101b"),DENEB_FORK_EPOCH:0,ELECTRA_FORK_VERSION:sA("0x6000101b"),ELECTRA_FORK_EPOCH:0,FULU_FORK_VERSION:sA("0x7000101b"),FULU_FORK_EPOCH:0,GLOAS_FORK_VERSION:sA("0x8000101b"),GLOAS_FORK_EPOCH:1/0,DEPOSIT_CHAIN_ID:39438e3,DEPOSIT_NETWORK_ID:39438e3,ETH1_FOLLOW_DISTANCE:12,BLOB_SCHEDULE:[{EPOCH:2048,MAX_BLOBS_PER_BLOCK:12},{EPOCH:4096,MAX_BLOBS_PER_BLOCK:15}]},C0=6048e5,Kt=Math.floor(Date.now()-CQ.MIN_GENESIS_TIME)/C0,Yt={...CQ,MIN_GENESIS_TIME:C0*Kt+CQ.MIN_GENESIS_TIME,DEPOSIT_CHAIN_ID:CQ.DEPOSIT_CHAIN_ID+Kt,DEPOSIT_NETWORK_ID:CQ.DEPOSIT_NETWORK_ID+Kt},Dd={...aB,CONFIG_NAME:"hoodi",MIN_GENESIS_TIME:1742212800,GENESIS_DELAY:600,GENESIS_FORK_VERSION:sA("0x10000910"),ALTAIR_FORK_VERSION:sA("0x20000910"),ALTAIR_FORK_EPOCH:0,BELLATRIX_FORK_VERSION:sA("0x30000910"),BELLATRIX_FORK_EPOCH:0,TERMINAL_TOTAL_DIFFICULTY:BigInt("0"),CAPELLA_FORK_VERSION:sA("0x40000910"),CAPELLA_FORK_EPOCH:0,DENEB_FORK_VERSION:sA("0x50000910"),DENEB_FORK_EPOCH:0,ELECTRA_FORK_VERSION:sA("0x60000910"),ELECTRA_FORK_EPOCH:2048,FULU_FORK_VERSION:sA("0x70000910"),FULU_FORK_EPOCH:50688,GLOAS_FORK_VERSION:sA("0x80000910"),GLOAS_FORK_EPOCH:1/0,SECONDS_PER_ETH1_BLOCK:12,DEPOSIT_CHAIN_ID:560048,DEPOSIT_NETWORK_ID:560048,BLOB_SCHEDULE:[{EPOCH:52480,MAX_BLOBS_PER_BLOCK:15},{EPOCH:54016,MAX_BLOBS_PER_BLOCK:21}]},Ud={...aB,CONFIG_NAME:"mainnet",DEPOSIT_CONTRACT_ADDRESS:sA("0x00000000219ab540356cBB839Cbe05303d7705Fa"),DEPOSIT_CHAIN_ID:1,DEPOSIT_NETWORK_ID:1,MIN_GENESIS_TIME:1606824e3,GENESIS_DELAY:604800},fd={...aB,CONFIG_NAME:"sepolia",MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:1300,MIN_GENESIS_TIME:1655647200,GENESIS_FORK_VERSION:sA("0x90000069"),GENESIS_DELAY:86400,ALTAIR_FORK_VERSION:sA("0x90000070"),ALTAIR_FORK_EPOCH:50,BELLATRIX_FORK_VERSION:sA("0x90000071"),BELLATRIX_FORK_EPOCH:100,TERMINAL_TOTAL_DIFFICULTY:BigInt("17000000000000000"),CAPELLA_FORK_VERSION:sA("0x90000072"),CAPELLA_FORK_EPOCH:56832,DENEB_FORK_VERSION:sA("0x90000073"),DENEB_FORK_EPOCH:132608,ELECTRA_FORK_VERSION:sA("0x90000074"),ELECTRA_FORK_EPOCH:222464,FULU_FORK_VERSION:sA("0x90000075"),FULU_FORK_EPOCH:272640,GLOAS_FORK_VERSION:sA("0x90000076"),GLOAS_FORK_EPOCH:1/0,DEPOSIT_CHAIN_ID:11155111,DEPOSIT_NETWORK_ID:11155111,DEPOSIT_CONTRACT_ADDRESS:sA("0x7f02C3E3c98b133055B8B348B2Ac625669Ed295D"),BLOB_SCHEDULE:[{EPOCH:274176,MAX_BLOBS_PER_BLOCK:15},{EPOCH:275712,MAX_BLOBS_PER_BLOCK:21}]},oC={mainnet:Ud,gnosis:B0,sepolia:fd,hoodi:Dd,chiado:cd,ephemery:Yt},Sd={mainnet:{genesisTime:1606824023,genesisValidatorsRoot:"0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95"},gnosis:{genesisTime:1638993340,genesisValidatorsRoot:"0xf5dcb5564e829aab27264b9becd5dfaa017085611224cb3036f573368dbb9d47"},sepolia:{genesisTime:1655733600,genesisValidatorsRoot:"0xd8ea171f3c94aea21ebc42a1ed61052acf3f9209c00e4efbaaddac09ed9b8078"},hoodi:{genesisTime:1742213400,genesisValidatorsRoot:"0x212f13fc4df078b6cb7db228f1c8307566dcecf900867401a92023d7ba99cb5f"},chiado:{genesisTime:1665396300,genesisValidatorsRoot:"0x9d642dac73058fbf39c0ae41ab1e34e4d889043cb199851ded7095bc99eb4c1e"},ephemery:{genesisTime:Yt.MIN_GENESIS_TIME+Yt.GENESIS_DELAY,genesisValidatorsRoot:"0x0000000000000000000000000000000000000000000000000000000000000000"}},wd=new wA(UB,1e4);function yd(I){let A;const g=()=>{if(A===void 0){const B=Sd[I.CONFIG_NAME]?.genesisValidatorsRoot;A=_s(I,B?sA(B):Fc)}return A};return{getLightClientUpdatesByRange:{url:"/eth/v1/beacon/light_client/updates",method:"GET",req:{writeReq:({startPeriod:B,count:e})=>({query:{start_period:B,count:e}}),parseReq:({query:B})=>({startPeriod:B.start_period,count:B.count}),schema:{query:{start_period:gA.UintRequired,count:gA.UintRequired}}},resp:{data:{toJson:(B,e)=>{const Q=[];for(const[C,i]of B.entries())Q.push(kg(e.versions[C]).LightClientUpdate.toJson(i));return Q},fromJson:(B,e)=>{const Q=B,C=[];for(let i=0;i<Q.length;i++){const o=e.versions[i];C.push(kg(o).LightClientUpdate.fromJson(Q[i]))}return C},serialize:(B,e)=>{const Q=[];for(const[C,i]of B.entries()){const o=e.versions[C],D=g(),a=Math.floor(i.attestedHeader.beacon.slot/wI),U=D.forkBoundary2ForkDigest(D.getForkBoundaryAtEpoch(a)),J=kg(o).LightClientUpdate.serialize(i),f=RA.serialize(4+J.length);Q.push(f,U,J)}return vA.concat(Q)},deserialize:B=>{let e=0;const Q=[];for(;e<B.length;){const C=RA.deserialize(B.subarray(e,e+8)),i=ji.deserialize(B.subarray(e+8,e+12)),{fork:o}=g().forkDigest2ForkBoundary(i);Q.push(kg(o).LightClientUpdate.deserialize(B.subarray(e+12,e+8+C))),e+=8+C}return Q}},meta:{toJson:B=>B,fromJson:B=>B,toHeadersObject:B=>({[aA.Version]:B.versions.join(",")}),fromHeaders:B=>{const e=B.getOrDefault(aA.Version,"");return{versions:e===""?[]:e.split(",")}}},transform:{toResponse:(B,e)=>{const Q=B,C=[];for(let i=0;i<Q.length;i++)C.push({data:Q[i],version:e.versions[i]});return C},fromResponse:B=>{if(!Array.isArray(B))throw Error("JSON is not an array");const e=[],Q={versions:[]};for(const{data:C,version:i}of B)e.push(C),Q.versions.push(OA(i));return{data:e,meta:Q}}}}},getLightClientOptimisticUpdate:{url:"/eth/v1/beacon/light_client/optimistic_update",method:"GET",req:kA,resp:{data:MI(B=>kg(B).LightClientOptimisticUpdate),meta:sg}},getLightClientFinalityUpdate:{url:"/eth/v1/beacon/light_client/finality_update",method:"GET",req:kA,resp:{data:MI(B=>kg(B).LightClientFinalityUpdate),meta:sg}},getLightClientBootstrap:{url:"/eth/v1/beacon/light_client/bootstrap/{block_root}",method:"GET",req:{writeReq:({blockRoot:B})=>({params:{block_root:B}}),parseReq:({params:B})=>({blockRoot:B.block_root}),schema:{params:{block_root:gA.StringRequired}}},resp:{data:MI(B=>kg(B).LightClientBootstrap),meta:sg}},getLightClientCommitteeRoot:{url:"/eth/v0/beacon/light_client/committee_root",method:"GET",req:{writeReq:({startPeriod:B,count:e})=>({query:{start_period:B,count:e}}),parseReq:({query:B})=>({startPeriod:B.start_period,count:B.count}),schema:{query:{start_period:gA.UintRequired,count:gA.UintRequired}}},resp:{data:wd,meta:VA}}}}const dd=new K({slot:KA,historicalSummaries:ag.HistoricalSummaries,proof:dA(mi)},{jsonCase:"eth2"});function Nd(I){return{writeHeapdump:{url:"/eth/v1/lodestar/write_heapdump",method:"POST",req:{writeReq:({thread:A,dirpath:g})=>({query:{thread:A,dirpath:g}}),parseReq:({query:A})=>({thread:A.thread,dirpath:A.dirpath}),schema:{query:{thread:gA.String,dirpath:gA.String}}},resp:PA},writeProfile:{url:"/eth/v1/lodestar/write_profile",method:"POST",req:{writeReq:({thread:A,duration:g,dirpath:B})=>({query:{thread:A,duration:g,dirpath:B}}),parseReq:({query:A})=>({thread:A.thread,duration:A.duration,dirpath:A.dirpath}),schema:{query:{thread:gA.String,duration:gA.Uint,dirpath:gA.String}}},resp:PA},getLatestWeakSubjectivityCheckpointEpoch:{url:"/eth/v1/lodestar/ws_epoch",method:"GET",req:kA,resp:PA},getSyncChainsDebugState:{url:"/eth/v1/lodestar/sync_chains_debug_state",method:"GET",req:kA,resp:PA},getGossipQueueItems:{url:"/eth/v1/lodestar/gossip_queue_items/:gossipType",method:"GET",req:{writeReq:({gossipType:A})=>({params:{gossipType:A}}),parseReq:({params:A})=>({gossipType:A.gossipType}),schema:{params:{gossipType:gA.StringRequired}}},resp:PA},getRegenQueueItems:{url:"/eth/v1/lodestar/regen_queue_items",method:"GET",req:kA,resp:PA},getBlockProcessorQueueItems:{url:"/eth/v1/lodestar/block_processor_queue_items",method:"GET",req:kA,resp:PA},getStateCacheItems:{url:"/eth/v1/lodestar/state_cache_items",method:"GET",req:kA,resp:PA},getGossipPeerScoreStats:{url:"/eth/v1/lodestar/gossip_peer_score_stats",method:"GET",req:kA,resp:PA},getLodestarPeerScoreStats:{url:"/eth/v1/lodestar/lodestar_peer_score_stats",method:"GET",req:kA,resp:PA},runGC:{url:"/eth/v1/lodestar/gc",method:"POST",req:kA,resp:YA},dropStateCache:{url:"/eth/v1/lodestar/drop_state_cache",method:"POST",req:kA,resp:YA},connectPeer:{url:"/eth/v1/lodestar/connect_peer",method:"POST",req:{writeReq:({peerId:A,multiaddrs:g})=>({query:{peerId:A,multiaddr:g}}),parseReq:({query:A})=>({peerId:A.peerId,multiaddrs:A.multiaddr}),schema:{query:{peerId:gA.StringRequired,multiaddr:gA.StringArray}}},resp:YA},disconnectPeer:{url:"/eth/v1/lodestar/disconnect_peer",method:"POST",req:{writeReq:({peerId:A})=>({query:{peerId:A}}),parseReq:({query:A})=>({peerId:A.peerId}),schema:{query:{peerId:gA.StringRequired}}},resp:YA},addDirectPeer:{url:"/eth/v1/lodestar/direct_peers",method:"POST",req:{writeReq:({peer:A})=>({query:{peer:A}}),parseReq:({query:A})=>({peer:A.peer}),schema:{query:{peer:gA.StringRequired}}},resp:PA},removeDirectPeer:{url:"/eth/v1/lodestar/direct_peers",method:"DELETE",req:{writeReq:({peerId:A})=>({query:{peerId:A}}),parseReq:({query:A})=>({peerId:A.peerId}),schema:{query:{peerId:gA.StringRequired}}},resp:PA},getDirectPeers:{url:"/eth/v1/lodestar/direct_peers",method:"GET",req:kA,resp:PA},getPeers:{url:"/eth/v1/lodestar/peers",method:"GET",req:{writeReq:({state:A,direction:g})=>({query:{state:A,direction:g}}),parseReq:({query:A})=>({state:A.state,direction:A.direction}),schema:{query:{state:gA.StringArray,direction:gA.StringArray}}},resp:PA},getBlacklistedBlocks:{url:"/eth/v1/lodestar/blacklisted_blocks",method:"GET",req:kA,resp:PA},getHistoricalSummaries:{url:"/eth/v1/lodestar/states/{state_id}/historical_summaries",method:"GET",req:{writeReq:({stateId:A})=>({params:{state_id:A.toString()}}),parseReq:({params:A})=>({stateId:A.state_id}),schema:{params:{state_id:gA.StringRequired}}},resp:{data:dd,meta:XI}},getPersistedCheckpointState:{url:"/eth/v1/lodestar/persisted_checkpoint_state",method:"GET",req:{writeReq:({checkpointId:A})=>({query:{checkpoint_id:A}}),parseReq:({query:A})=>({checkpointId:A.checkpoint_id}),schema:{query:{checkpoint_id:gA.String}}},resp:{data:MI(A=>RI[A].BeaconState),meta:sg},init:{timeoutMs:3e5}},getMonitoredValidatorIndices:{url:"/eth/v1/lodestar/monitored_validators",method:"GET",req:kA,resp:PA},discv5GetKadValues:{url:"/eth/v1/debug/discv5_kad_values",method:"GET",req:kA,resp:PA},dumpDbBucketKeys:{url:"/eth/v1/debug/dump_db_bucket_keys/:bucket",method:"GET",req:{writeReq:({bucket:A})=>({params:{bucket:A}}),parseReq:({params:A})=>({bucket:A.bucket}),schema:{params:{bucket:gA.String}}},resp:PA},dumpDbStateIndex:{url:"/eth/v1/debug/dump_db_state_index",method:"GET",req:kA,resp:PA},getCustodyInfo:{url:"/eth/v1/lodestar/custody_info",method:"GET",req:kA,resp:PA}}}var MB;(function(I){I[I.CONTINUE=100]="CONTINUE",I[I.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",I[I.PROCESSING=102]="PROCESSING",I[I.OK=200]="OK",I[I.CREATED=201]="CREATED",I[I.ACCEPTED=202]="ACCEPTED",I[I.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",I[I.NO_CONTENT=204]="NO_CONTENT",I[I.RESET_CONTENT=205]="RESET_CONTENT",I[I.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",I[I.MULTI_STATUS=207]="MULTI_STATUS",I[I.ALREADY_REPORTED=208]="ALREADY_REPORTED",I[I.IM_USED=226]="IM_USED",I[I.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",I[I.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",I[I.FOUND=302]="FOUND",I[I.SEE_OTHER=303]="SEE_OTHER",I[I.NOT_MODIFIED=304]="NOT_MODIFIED",I[I.USE_PROXY=305]="USE_PROXY",I[I.SWITCH_PROXY=306]="SWITCH_PROXY",I[I.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",I[I.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",I[I.BAD_REQUEST=400]="BAD_REQUEST",I[I.UNAUTHORIZED=401]="UNAUTHORIZED",I[I.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",I[I.FORBIDDEN=403]="FORBIDDEN",I[I.NOT_FOUND=404]="NOT_FOUND",I[I.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",I[I.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",I[I.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",I[I.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",I[I.CONFLICT=409]="CONFLICT",I[I.GONE=410]="GONE",I[I.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",I[I.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",I[I.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",I[I.URI_TOO_LONG=414]="URI_TOO_LONG",I[I.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",I[I.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",I[I.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",I[I.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",I[I.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",I[I.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",I[I.LOCKED=423]="LOCKED",I[I.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",I[I.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",I[I.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",I[I.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",I[I.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",I[I.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",I[I.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",I[I.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",I[I.BAD_GATEWAY=502]="BAD_GATEWAY",I[I.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",I[I.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",I[I.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",I[I.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",I[I.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",I[I.LOOP_DETECTED=508]="LOOP_DETECTED",I[I.NOT_EXTENDED=510]="NOT_EXTENDED",I[I.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(MB||(MB={}));const Q0=new K({peerId:xI,enr:xI,p2pAddresses:dA(xI),discoveryAddresses:dA(xI),metadata:WI.Metadata},{jsonCase:"eth2"}),ud=new K({disconnected:RA,connecting:RA,connected:RA,disconnecting:RA},{jsonCase:"eth2"}),Rd=new K({headSlot:KA,syncDistance:KA,isSyncing:BI,isOptimistic:BI,elOffline:BI},{jsonCase:"eth2"}),e0=new K({peerId:xI,enr:new JQ(xI),lastSeenP2pAddress:xI,state:new Xg,direction:new JQ(new Xg)},{jsonCase:"eth2"}),Gd=dA(e0);var i0;(function(I){I.READY=MB.OK,typeof I.READY!="string"&&(I[I.READY]="READY"),I.SYNCING=MB.PARTIAL_CONTENT,typeof I.SYNCING!="string"&&(I[I.SYNCING]="SYNCING"),I.NOT_INITIALIZED_OR_ISSUES=MB.SERVICE_UNAVAILABLE,typeof I.NOT_INITIALIZED_OR_ISSUES!="string"&&(I[I.NOT_INITIALIZED_OR_ISSUES]="NOT_INITIALIZED_OR_ISSUES")})(i0||(i0={}));var t0;(function(I){I.BU="BU",I.EJ="EJ",I.EG="EG",I.GE="GE",I.GR="GR",I.LH="LH",I.LS="LS",I.NM="NM",I.NB="NB",I.TE="TE",I.TK="TK",I.PM="PM",I.RH="RH",I.XX="XX"})(t0||(t0={}));function kd(I){return{getNetworkIdentity:{url:"/eth/v1/node/identity",method:"GET",req:kA,resp:{onlySupport:NA.json,data:{...PA.data,toJson:A=>{const g=Q0.toJson(A),{custodyGroupCount:B}=A.metadata;return g.metadata.custody_group_count=B!==void 0?String(B):void 0,g},fromJson:A=>{const g=Q0.fromJson(A),{metadata:{custody_group_count:B}}=A;return g.metadata.custodyGroupCount=B!==void 0?parseInt(B):void 0,g}},meta:VA}},getPeers:{url:"/eth/v1/node/peers",method:"GET",req:{writeReq:({state:A,direction:g})=>({query:{state:A,direction:g}}),parseReq:({query:A})=>({state:A.state,direction:A.direction}),schema:{query:{state:gA.StringArray,direction:gA.StringArray}}},resp:{data:Gd,meta:{toJson:A=>A,fromJson:A=>({count:A.count}),toHeadersObject:()=>({}),fromHeaders:()=>({})},transform:{toResponse:(A,g)=>({data:A,meta:g}),fromResponse:A=>A},onlySupport:NA.json}},getPeer:{url:"/eth/v1/node/peers/{peer_id}",method:"GET",req:{writeReq:({peerId:A})=>({params:{peer_id:A}}),parseReq:({params:A})=>({peerId:A.peer_id}),schema:{params:{peer_id:gA.StringRequired}}},resp:{data:e0,meta:VA,onlySupport:NA.json}},getPeerCount:{url:"/eth/v1/node/peer_count",method:"GET",req:kA,resp:{data:ud,meta:VA}},getNodeVersion:{url:"/eth/v1/node/version",method:"GET",req:kA,resp:PA},getNodeVersionV2:{url:"/eth/v2/node/version",method:"GET",req:kA,resp:PA},getSyncingStatus:{url:"/eth/v1/node/syncing",method:"GET",req:kA,resp:{data:Rd,meta:VA}},getHealth:{url:"/eth/v1/node/health",method:"GET",req:{writeReq:({syncingStatus:A})=>({query:{syncing_status:A}}),parseReq:({query:A})=>({syncingStatus:A.syncing_status}),schema:{query:{syncing_status:gA.Uint}}},resp:YA}}}const CB=new K({leaves:dA(UB,1e4),descriptor:new HC(2048)});function Fd(I){return{getStateProof:{url:"/eth/v0/beacon/proof/state/{state_id}",method:"GET",req:{writeReq:({stateId:A,descriptor:g})=>({params:{state_id:A},query:{format:fg(g)}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,descriptor:sA(g.format)}),schema:{params:{state_id:gA.StringRequired},query:{format:gA.StringRequired}}},resp:{data:{toJson:A=>CB.toJson(A),fromJson:A=>({...CB.fromJson(A),type:ZA.compactMulti}),serialize:A=>CB.serialize(A),deserialize:A=>({...CB.deserialize(A),type:ZA.compactMulti})},meta:sg}},getBlockProof:{url:"/eth/v0/beacon/proof/block/{block_id}",method:"GET",req:{writeReq:({blockId:A,descriptor:g})=>({params:{block_id:A},query:{format:fg(g)}}),parseReq:({params:A,query:g})=>({blockId:A.block_id,descriptor:sA(g.format)}),schema:{params:{block_id:gA.StringRequired},query:{format:gA.StringRequired}}},resp:{data:{toJson:A=>CB.toJson(A),fromJson:A=>({...CB.fromJson(A),type:ZA.compactMulti}),serialize:A=>CB.serialize(A),deserialize:A=>({...CB.deserialize(A),type:ZA.compactMulti})},meta:sg}}}}var E0;(function(I){I.Default="default",I.BuilderAlways="builderalways",I.ExecutionAlways="executionalways",I.MaxProfit="maxprofit",I.BuilderOnly="builderonly",I.ExecutionOnly="executiononly"})(E0||(E0={}));const o0=new K({...gB.fields,executionPayloadBlinded:BI,executionPayloadValue:cB,consensusBlockValue:cB},{jsonCase:"eth2"}),r0=new K({...gB.fields,consensusBlockValue:cB},{jsonCase:"eth2"}),Jd=new K({pubkey:vB,validatorIndex:XA,committeeIndex:DB,committeeLength:RA,committeesAtSlot:RA,validatorCommitteeIndex:RA,slot:KA},{jsonCase:"eth2"}),pd=new K({slot:KA,validatorIndex:XA,pubkey:vB},{jsonCase:"eth2"}),Hd=new K({pubkey:vB,validatorIndex:XA,validatorSyncCommitteeIndices:dA(DB)},{jsonCase:"eth2"}),Md=new K({validatorIndex:XA,committeeIndex:DB,committeesAtSlot:KA,slot:KA,isAggregator:BI},{jsonCase:"eth2"}),md=new K({validatorIndex:XA,syncCommitteeIndices:dA(DB),untilEpoch:PI},{jsonCase:"eth2"}),Ld=new K({validatorIndex:XA,feeRecipient:xI},{jsonCase:"eth2"}),Kd=new K({validatorIndex:XA,slot:KA,selectionProof:LQ},{jsonCase:"eth2"}),Yd=new K({validatorIndex:XA,slot:KA,subcommitteeIndex:qi,selectionProof:LQ},{jsonCase:"eth2"}),bd=new K({index:XA,isLive:BI},{jsonCase:"eth2"}),qI=dA(XA),Td=dA(Jd),n0=dA(pd),qd=dA(Hd),QB=dA(yA.SignedAggregateAndProof),we=dA(uI.SignedAggregateAndProof),ye=dA(WI.SignedContributionAndProof),de=dA(Md),Ne=dA(md),a0=dA(Ld),QQ=dA(Kd),eQ=dA(Yd),Vd=dA(bd),ue=dA(Ys.SignedValidatorRegistrationV1,fC);function jd(I){return{getAttesterDuties:{url:"/eth/v1/validator/duties/attester/{epoch}",method:"POST",req:{writeReqJson:({epoch:A,indices:g})=>({params:{epoch:A},body:qI.toJson(g)}),parseReqJson:({params:A,body:g})=>({epoch:A.epoch,indices:qI.fromJson(g)}),writeReqSsz:({epoch:A,indices:g})=>({params:{epoch:A},body:qI.serialize(g)}),parseReqSsz:({params:A,body:g})=>({epoch:A.epoch,indices:qI.deserialize(g)}),schema:{params:{epoch:gA.UintRequired},body:gA.StringArray}},resp:{data:Td,meta:Lt}},getProposerDuties:{url:"/eth/v1/validator/duties/proposer/{epoch}",method:"GET",req:{writeReq:({epoch:A})=>({params:{epoch:A}}),parseReq:({params:A})=>({epoch:A.epoch}),schema:{params:{epoch:gA.UintRequired}}},resp:{data:n0,meta:Lt}},getProposerDutiesV2:{url:"/eth/v2/validator/duties/proposer/{epoch}",method:"GET",req:{writeReq:({epoch:A})=>({params:{epoch:A}}),parseReq:({params:A})=>({epoch:A.epoch}),schema:{params:{epoch:gA.UintRequired}}},resp:{data:n0,meta:Lt}},getSyncCommitteeDuties:{url:"/eth/v1/validator/duties/sync/{epoch}",method:"POST",req:{writeReqJson:({epoch:A,indices:g})=>({params:{epoch:A},body:qI.toJson(g)}),parseReqJson:({params:A,body:g})=>({epoch:A.epoch,indices:qI.fromJson(g)}),writeReqSsz:({epoch:A,indices:g})=>({params:{epoch:A},body:qI.serialize(g)}),parseReqSsz:({params:A,body:g})=>({epoch:A.epoch,indices:qI.deserialize(g)}),schema:{params:{epoch:gA.UintRequired},body:gA.StringArray}},resp:{data:qd,meta:Ky}},produceBlockV3:{url:"/eth/v3/validator/blocks/{slot}",method:"GET",req:{writeReq:({slot:A,randaoReveal:g,graffiti:B,skipRandaoVerification:e,feeRecipient:Q,builderSelection:C,builderBoostFactor:i,strictFeeRecipientCheck:o,blindedLocal:D})=>({params:{slot:A},query:{randao_reveal:fg(g),graffiti:Zs(B),skip_randao_verification:h0(e),fee_recipient:Q,builder_selection:C,builder_boost_factor:i?.toString(),strict_fee_recipient_check:o,blinded_local:D}}),parseReq:({params:A,query:g})=>({slot:A.slot,randaoReveal:sA(g.randao_reveal),graffiti:Ps(g.graffiti),skipRandaoVerification:l0(g.skip_randao_verification),feeRecipient:g.fee_recipient,builderSelection:g.builder_selection,builderBoostFactor:s0(g.builder_boost_factor),strictFeeRecipientCheck:g.strict_fee_recipient_check,blindedLocal:g.blinded_local}),schema:{params:{slot:gA.UintRequired},query:{randao_reveal:gA.StringRequired,graffiti:gA.String,skip_randao_verification:gA.String,fee_recipient:gA.String,builder_selection:gA.String,builder_boost_factor:gA.String,strict_fee_recipient_check:gA.Boolean,blinded_local:gA.Boolean}}},resp:{data:{toJson(A,{executionPayloadBlinded:g,version:B}){return g?mI(B).BlindedBeaconBlock.toJson(A):SI(B)?pA(B).BlockContents.toJson(A):RI[B].BeaconBlock.toJson(A.block)},fromJson(A,{executionPayloadBlinded:g,version:B}){return g?mI(B).BlindedBeaconBlock.fromJson(A):SI(B)?pA(B).BlockContents.fromJson(A):{block:RI[B].BeaconBlock.fromJson(A)}},serialize(A,{executionPayloadBlinded:g,version:B}){return g?mI(B).BlindedBeaconBlock.serialize(A):SI(B)?pA(B).BlockContents.serialize(A):RI[B].BeaconBlock.serialize(A.block)},deserialize(A,{executionPayloadBlinded:g,version:B}){return g?mI(B).BlindedBeaconBlock.deserialize(A):SI(B)?pA(B).BlockContents.deserialize(A):{block:RI[B].BeaconBlock.deserialize(A)}}},meta:{toJson:A=>({...o0.toJson(A),execution_payload_source:A.executionPayloadSource}),fromJson:A=>{const{executionPayloadBlinded:g,...B}=o0.fromJson(A),e=A.execution_payload_source??(g===!0?iC.builder:iC.engine);return{...B,executionPayloadBlinded:g,executionPayloadSource:e}},toHeadersObject:A=>({[aA.Version]:A.version,[aA.ExecutionPayloadBlinded]:A.executionPayloadBlinded.toString(),[aA.ExecutionPayloadSource]:A.executionPayloadSource.toString(),[aA.ExecutionPayloadValue]:A.executionPayloadValue.toString(),[aA.ConsensusBlockValue]:A.consensusBlockValue.toString()}),fromHeaders:A=>{const g=pB(A.getRequired(aA.ExecutionPayloadBlinded)),B=A.get(aA.ExecutionPayloadSource)??(g===!0?iC.builder:iC.engine);return{version:OA(A.getRequired(aA.Version)),executionPayloadBlinded:g,executionPayloadSource:B,executionPayloadValue:BigInt(A.getRequired(aA.ExecutionPayloadValue)),consensusBlockValue:BigInt(A.getRequired(aA.ConsensusBlockValue))}}}}},produceBlockV4:{url:"/eth/v4/validator/blocks/{slot}",method:"GET",req:{writeReq:({slot:A,randaoReveal:g,graffiti:B,skipRandaoVerification:e,feeRecipient:Q,builderSelection:C,builderBoostFactor:i,strictFeeRecipientCheck:o})=>({params:{slot:A},query:{randao_reveal:fg(g),graffiti:Zs(B),skip_randao_verification:h0(e),fee_recipient:Q,builder_selection:C,builder_boost_factor:i?.toString(),strict_fee_recipient_check:o}}),parseReq:({params:A,query:g})=>({slot:A.slot,randaoReveal:sA(g.randao_reveal),graffiti:Ps(g.graffiti),skipRandaoVerification:l0(g.skip_randao_verification),feeRecipient:g.fee_recipient,builderSelection:g.builder_selection,builderBoostFactor:s0(g.builder_boost_factor),strictFeeRecipientCheck:g.strict_fee_recipient_check}),schema:{params:{slot:gA.UintRequired},query:{randao_reveal:gA.StringRequired,graffiti:gA.String,skip_randao_verification:gA.String,fee_recipient:gA.String,builder_selection:gA.String,builder_boost_factor:gA.String,strict_fee_recipient_check:gA.Boolean}}},resp:{data:MI(A=>$C(A).BeaconBlock),meta:{toJson:A=>r0.toJson(A),fromJson:A=>r0.fromJson(A),toHeadersObject:A=>({[aA.Version]:A.version,[aA.ConsensusBlockValue]:A.consensusBlockValue.toString()}),fromHeaders:A=>({version:OA(A.getRequired(aA.Version)),consensusBlockValue:BigInt(A.getRequired(aA.ConsensusBlockValue))})}}},getExecutionPayloadEnvelope:{url:"/eth/v1/validator/execution_payload_envelope/{slot}/{beacon_block_root}",method:"GET",req:{writeReq:({slot:A,beaconBlockRoot:g})=>({params:{slot:A,beacon_block_root:DQ(g)}}),parseReq:({params:A})=>({slot:A.slot,beaconBlockRoot:sA(A.beacon_block_root)}),schema:{params:{slot:gA.UintRequired,beacon_block_root:gA.StringRequired}}},resp:{data:bs.ExecutionPayloadEnvelope,meta:sg}},produceAttestationData:{url:"/eth/v1/validator/attestation_data",method:"GET",req:{writeReq:({committeeIndex:A,slot:g})=>({query:{slot:g,committee_index:A}}),parseReq:({query:A})=>({committeeIndex:A.committee_index,slot:A.slot}),schema:{query:{slot:gA.UintRequired,committee_index:gA.Uint}}},resp:{data:yA.AttestationData,meta:VA}},produceSyncCommitteeContribution:{url:"/eth/v1/validator/sync_committee_contribution",method:"GET",req:{writeReq:({slot:A,subcommitteeIndex:g,beaconBlockRoot:B})=>({query:{slot:A,subcommittee_index:g,beacon_block_root:DQ(B)}}),parseReq:({query:A})=>({slot:A.slot,subcommitteeIndex:A.subcommittee_index,beaconBlockRoot:sA(A.beacon_block_root)}),schema:{query:{slot:gA.UintRequired,subcommittee_index:gA.UintRequired,beacon_block_root:gA.StringRequired}}},resp:{data:WI.SyncCommitteeContribution,meta:VA}},getAggregatedAttestation:{url:"/eth/v1/validator/aggregate_attestation",method:"GET",req:{writeReq:({attestationDataRoot:A,slot:g})=>({query:{attestation_data_root:DQ(A),slot:g}}),parseReq:({query:A})=>({attestationDataRoot:sA(A.attestation_data_root),slot:A.slot}),schema:{query:{attestation_data_root:gA.StringRequired,slot:gA.UintRequired}}},resp:{data:yA.Attestation,meta:VA}},getAggregatedAttestationV2:{url:"/eth/v2/validator/aggregate_attestation",method:"GET",req:{writeReq:({attestationDataRoot:A,slot:g,committeeIndex:B})=>({query:{attestation_data_root:fg(A),slot:g,committee_index:B}}),parseReq:({query:A})=>({attestationDataRoot:sA(A.attestation_data_root),slot:A.slot,committeeIndex:A.committee_index}),schema:{query:{attestation_data_root:gA.StringRequired,slot:gA.UintRequired,committee_index:gA.UintRequired}}},resp:{data:MI(A=>WA(A)?uI.Attestation:yA.Attestation),meta:sg}},publishAggregateAndProofs:{url:"/eth/v1/validator/aggregate_and_proofs",method:"POST",req:{writeReqJson:({signedAggregateAndProofs:A})=>({body:QB.toJson(A)}),parseReqJson:({body:A})=>({signedAggregateAndProofs:QB.fromJson(A)}),writeReqSsz:({signedAggregateAndProofs:A})=>({body:QB.serialize(A)}),parseReqSsz:({body:A})=>({signedAggregateAndProofs:QB.deserialize(A)}),schema:{body:gA.ObjectArray}},resp:YA},publishAggregateAndProofsV2:{url:"/eth/v2/validator/aggregate_and_proofs",method:"POST",req:{writeReqJson:({signedAggregateAndProofs:A})=>{const g=I.getForkName(A[0]?.message.aggregate.data.slot??0);return{body:WA(g)?we.toJson(A):QB.toJson(A),headers:{[aA.Version]:g}}},parseReqJson:({body:A,headers:g})=>{const B=OA(sI(g,aA.Version));return{signedAggregateAndProofs:WA(B)?we.fromJson(A):QB.fromJson(A)}},writeReqSsz:({signedAggregateAndProofs:A})=>{const g=I.getForkName(A[0]?.message.aggregate.data.slot??0);return{body:WA(g)?we.serialize(A):QB.serialize(A),headers:{[aA.Version]:g}}},parseReqSsz:({body:A,headers:g})=>{const B=OA(sI(g,aA.Version));return{signedAggregateAndProofs:WA(B)?we.deserialize(A):QB.deserialize(A)}},schema:{body:gA.ObjectArray,headers:{[aA.Version]:gA.String}}},resp:YA},publishContributionAndProofs:{url:"/eth/v1/validator/contribution_and_proofs",method:"POST",req:{writeReqJson:({contributionAndProofs:A})=>({body:ye.toJson(A)}),parseReqJson:({body:A})=>({contributionAndProofs:ye.fromJson(A)}),writeReqSsz:({contributionAndProofs:A})=>({body:ye.serialize(A)}),parseReqSsz:({body:A})=>({contributionAndProofs:ye.deserialize(A)}),schema:{body:gA.ObjectArray}},resp:YA},prepareBeaconCommitteeSubnet:{url:"/eth/v1/validator/beacon_committee_subscriptions",method:"POST",req:{writeReqJson:({subscriptions:A})=>({body:de.toJson(A)}),parseReqJson:({body:A})=>({subscriptions:de.fromJson(A)}),writeReqSsz:({subscriptions:A})=>({body:de.serialize(A)}),parseReqSsz:({body:A})=>({subscriptions:de.deserialize(A)}),schema:{body:gA.ObjectArray}},resp:YA},prepareSyncCommitteeSubnets:{url:"/eth/v1/validator/sync_committee_subscriptions",method:"POST",req:{writeReqJson:({subscriptions:A})=>({body:Ne.toJson(A)}),parseReqJson:({body:A})=>({subscriptions:Ne.fromJson(A)}),writeReqSsz:({subscriptions:A})=>({body:Ne.serialize(A)}),parseReqSsz:({body:A})=>({subscriptions:Ne.deserialize(A)}),schema:{body:gA.ObjectArray}},resp:YA},prepareBeaconProposer:{url:"/eth/v1/validator/prepare_beacon_proposer",method:"POST",req:tC({writeReqJson:({proposers:A})=>({body:a0.toJson(A)}),parseReqJson:({body:A})=>({proposers:a0.fromJson(A)}),schema:{body:gA.ObjectArray}}),resp:YA},submitBeaconCommitteeSelections:{url:"/eth/v1/validator/beacon_committee_selections",method:"POST",req:{writeReqJson:({selections:A})=>({body:QQ.toJson(A)}),parseReqJson:({body:A})=>({selections:QQ.fromJson(A)}),writeReqSsz:({selections:A})=>({body:QQ.serialize(A)}),parseReqSsz:({body:A})=>({selections:QQ.deserialize(A)}),schema:{body:gA.ObjectArray}},resp:{data:QQ,meta:VA}},submitSyncCommitteeSelections:{url:"/eth/v1/validator/sync_committee_selections",method:"POST",req:{writeReqJson:({selections:A})=>({body:eQ.toJson(A)}),parseReqJson:({body:A})=>({selections:eQ.fromJson(A)}),writeReqSsz:({selections:A})=>({body:eQ.serialize(A)}),parseReqSsz:({body:A})=>({selections:eQ.deserialize(A)}),schema:{body:gA.ObjectArray}},resp:{data:eQ,meta:VA}},getLiveness:{url:"/eth/v1/validator/liveness/{epoch}",method:"POST",req:{writeReqJson:({epoch:A,indices:g})=>({params:{epoch:A},body:qI.toJson(g)}),parseReqJson:({params:A,body:g})=>({epoch:A.epoch,indices:qI.fromJson(g)}),writeReqSsz:({epoch:A,indices:g})=>({params:{epoch:A},body:qI.serialize(g)}),parseReqSsz:({params:A,body:g})=>({epoch:A.epoch,indices:qI.deserialize(g)}),schema:{params:{epoch:gA.UintRequired},body:gA.StringArray}},resp:{data:Vd,meta:VA}},registerValidator:{url:"/eth/v1/validator/register_validator",method:"POST",req:{writeReqJson:({registrations:A})=>({body:ue.toJson(A)}),parseReqJson:({body:A})=>({registrations:ue.fromJson(A)}),writeReqSsz:({registrations:A})=>({body:ue.serialize(A)}),parseReqSsz:({body:A})=>({registrations:ue.deserialize(A)}),schema:{body:gA.ObjectArray}},resp:YA,init:{requestWireFormat:NA.ssz}}}}function s0(I){return I!==void 0?BigInt(I):void 0}function h0(I){return I===!0?"":void 0}function l0(I){return I!==void 0&&I===""}class _d extends Error{status;operationId;constructor(A,g,B){super(`${B} failed with status ${g}: ${A}`),this.status=g,this.operationId=B}}var c0,D0;function rC(){return D0||(D0=1,c0=TypeError),c0}const bt=QD(xc);var Tt,U0;function Re(){if(U0)return Tt;U0=1;var I=typeof Map=="function"&&Map.prototype,A=Object.getOwnPropertyDescriptor&&I?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,g=I&&A&&typeof A.get=="function"?A.get:null,B=I&&Map.prototype.forEach,e=typeof Set=="function"&&Set.prototype,Q=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,C=e&&Q&&typeof Q.get=="function"?Q.get:null,i=e&&Set.prototype.forEach,o=typeof WeakMap=="function"&&WeakMap.prototype,D=o?WeakMap.prototype.has:null,a=typeof WeakSet=="function"&&WeakSet.prototype,U=a?WeakSet.prototype.has:null,J=typeof WeakRef=="function"&&WeakRef.prototype,f=J?WeakRef.prototype.deref:null,y=Boolean.prototype.valueOf,S=Object.prototype.toString,R=Function.prototype.toString,N=String.prototype.match,G=String.prototype.slice,H=String.prototype.replace,Z=String.prototype.toUpperCase,W=String.prototype.toLowerCase,x=RegExp.prototype.test,X=Array.prototype.concat,m=Array.prototype.join,z=Array.prototype.slice,q=Math.floor,iA=typeof BigInt=="function"?BigInt.prototype.valueOf:null,hA=Object.getOwnPropertySymbols,DA=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,p=typeof Symbol=="function"&&typeof Symbol.iterator=="object",T=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===p||!0)?Symbol.toStringTag:null,$=Object.prototype.propertyIsEnumerable,j=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(M){return M.__proto__}:null);function P(M,_){if(M===1/0||M===-1/0||M!==M||M&&M>-1e3&&M<1e3||x.call(/e/,_))return _;var E=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof M=="number"){var s=M<0?-q(-M):q(M);if(s!==M){var d=String(s),O=G.call(_,d.length+1);return H.call(d,E,"$&_")+"."+H.call(H.call(O,/([0-9]{3})/g,"$&_"),/_$/,"")}}return H.call(_,E,"$&_")}var EA=bt,CA=EA.custom,L=tA(CA)?CA:null,V={__proto__:null,double:'"',single:"'"},AA={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Tt=function M(_,E,s,d){var O=E||{};if(UA(O,"quoteStyle")&&!UA(V,O.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(UA(O,"maxStringLength")&&(typeof O.maxStringLength=="number"?O.maxStringLength<0&&O.maxStringLength!==1/0:O.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var GA=UA(O,"customInspect")?O.customInspect:!0;if(typeof GA!="boolean"&&GA!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(UA(O,"indent")&&O.indent!==null&&O.indent!==" "&&!(parseInt(O.indent,10)===O.indent&&O.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(UA(O,"numericSeparator")&&typeof O.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Ag=O.numericSeparator;if(typeof _>"u")return"undefined";if(_===null)return"null";if(typeof _=="boolean")return _?"true":"false";if(typeof _=="string")return r(_,O);if(typeof _=="number"){if(_===0)return 1/0/_>0?"0":"-0";var nI=String(_);return Ag?P(_,nI):nI}if(typeof _=="bigint"){var jI=String(_)+"n";return Ag?P(_,jI):jI}var EQ=typeof O.depth>"u"?5:O.depth;if(typeof s>"u"&&(s=0),s>=EQ&&EQ>0&&typeof _=="object")return b(_)?"[Array]":"[Object]";var cC=F(O,s);if(typeof d>"u")d=[];else if(FA(d,_)>=0)return"[Circular]";function Ig(DC,Ye,aR){if(Ye&&(d=z.call(d),d.push(Ye)),aR){var H1={depth:O.depth};return UA(O,"quoteStyle")&&(H1.quoteStyle=O.quoteStyle),M(DC,H1,s+1,d)}return M(DC,O,s+1,d)}if(typeof _=="function"&&!eA(_)){var u1=xA(_),R1=IA(_,Ig);return"[Function"+(u1?": "+u1:" (anonymous)")+"]"+(R1.length>0?" { "+m.call(R1,", ")+" }":"")}if(tA(_)){var G1=p?H.call(String(_),/^(Symbol\(.*\))_[^)]*$/,"$1"):DA.call(_);return typeof _=="object"&&!p?w(G1):G1}if(fI(_)){for(var oQ="<"+W.call(String(_.nodeName)),io=_.attributes||[],Ke=0;Ke<io.length;Ke++)oQ+=" "+io[Ke].name+"="+QA(oA(io[Ke].value),"double",O);return oQ+=">",_.childNodes&&_.childNodes.length&&(oQ+="..."),oQ+="</"+W.call(String(_.nodeName))+">",oQ}if(b(_)){if(_.length===0)return"[]";var to=IA(_,Ig);return cC&&!h(to)?"["+c(to,cC)+"]":"[ "+m.call(to,", ")+" ]"}if(rA(_)){var Eo=IA(_,Ig);return!("cause"in Error.prototype)&&"cause"in _&&!$.call(_,"cause")?"{ ["+String(_)+"] "+m.call(X.call("[cause]: "+Ig(_.cause),Eo),", ")+" }":Eo.length===0?"["+String(_)+"]":"{ ["+String(_)+"] "+m.call(Eo,", ")+" }"}if(typeof _=="object"&&GA){if(L&&typeof _[L]=="function"&&EA)return EA(_,{depth:EQ-s});if(GA!=="symbol"&&typeof _.inspect=="function")return _.inspect()}if(bA(_)){var k1=[];return B&&B.call(_,function(DC,Ye){k1.push(Ig(Ye,_,!0)+" => "+Ig(DC,_))}),n("Map",g.call(_),k1,cC)}if(UI(_)){var F1=[];return i&&i.call(_,function(DC){F1.push(Ig(DC,_))}),n("Set",C.call(_),F1,cC)}if(JA(_))return t("WeakMap");if(HA(_))return t("WeakSet");if(mA(_))return t("WeakRef");if(k(_))return w(Ig(Number(_)));if(cA(_))return w(Ig(iA.call(_)));if(BA(_))return w(y.call(_));if(u(_))return w(Ig(String(_)));if(typeof window<"u"&&_===window)return"{ [object Window] }";if(typeof globalThis<"u"&&_===globalThis||typeof TA<"u"&&_===TA)return"{ [object globalThis] }";if(!v(_)&&!eA(_)){var oo=IA(_,Ig),J1=j?j(_)===Object.prototype:_ instanceof Object||_.constructor===Object,ro=_ instanceof Object?"":"null prototype",p1=!J1&&T&&Object(_)===_&&T in _?G.call(uA(_),8,-1):ro?"Object":"",nR=J1||typeof _.constructor!="function"?"":_.constructor.name?_.constructor.name+" ":"",no=nR+(p1||ro?"["+m.call(X.call([],p1||[],ro||[]),": ")+"] ":"");return oo.length===0?no+"{}":cC?no+"{"+c(oo,cC)+"}":no+"{ "+m.call(oo,", ")+" }"}return String(_)};function QA(M,_,E){var s=E.quoteStyle||_,d=V[s];return d+M+d}function oA(M){return H.call(String(M),/"/g,"&quot;")}function Y(M){return!T||!(typeof M=="object"&&(T in M||typeof M[T]<"u"))}function b(M){return uA(M)==="[object Array]"&&Y(M)}function v(M){return uA(M)==="[object Date]"&&Y(M)}function eA(M){return uA(M)==="[object RegExp]"&&Y(M)}function rA(M){return uA(M)==="[object Error]"&&Y(M)}function u(M){return uA(M)==="[object String]"&&Y(M)}function k(M){return uA(M)==="[object Number]"&&Y(M)}function BA(M){return uA(M)==="[object Boolean]"&&Y(M)}function tA(M){if(p)return M&&typeof M=="object"&&M instanceof Symbol;if(typeof M=="symbol")return!0;if(!M||typeof M!="object"||!DA)return!1;try{return DA.call(M),!0}catch{}return!1}function cA(M){if(!M||typeof M!="object"||!iA)return!1;try{return iA.call(M),!0}catch{}return!1}var lA=Object.prototype.hasOwnProperty||function(M){return M in this};function UA(M,_){return lA.call(M,_)}function uA(M){return S.call(M)}function xA(M){if(M.name)return M.name;var _=N.call(R.call(M),/^function\s*([\w$]+)/);return _?_[1]:null}function FA(M,_){if(M.indexOf)return M.indexOf(_);for(var E=0,s=M.length;E<s;E++)if(M[E]===_)return E;return-1}function bA(M){if(!g||!M||typeof M!="object")return!1;try{g.call(M);try{C.call(M)}catch{return!0}return M instanceof Map}catch{}return!1}function JA(M){if(!D||!M||typeof M!="object")return!1;try{D.call(M,D);try{U.call(M,U)}catch{return!0}return M instanceof WeakMap}catch{}return!1}function mA(M){if(!f||!M||typeof M!="object")return!1;try{return f.call(M),!0}catch{}return!1}function UI(M){if(!C||!M||typeof M!="object")return!1;try{C.call(M);try{g.call(M)}catch{return!0}return M instanceof Set}catch{}return!1}function HA(M){if(!U||!M||typeof M!="object")return!1;try{U.call(M,U);try{D.call(M,D)}catch{return!0}return M instanceof WeakSet}catch{}return!1}function fI(M){return!M||typeof M!="object"?!1:typeof HTMLElement<"u"&&M instanceof HTMLElement?!0:typeof M.nodeName=="string"&&typeof M.getAttribute=="function"}function r(M,_){if(M.length>_.maxStringLength){var E=M.length-_.maxStringLength,s="... "+E+" more character"+(E>1?"s":"");return r(G.call(M,0,_.maxStringLength),_)+s}var d=AA[_.quoteStyle||"single"];d.lastIndex=0;var O=H.call(H.call(M,d,"\\$1"),/[\x00-\x1f]/g,l);return QA(O,"single",_)}function l(M){var _=M.charCodeAt(0),E={8:"b",9:"t",10:"n",12:"f",13:"r"}[_];return E?"\\"+E:"\\x"+(_<16?"0":"")+Z.call(_.toString(16))}function w(M){return"Object("+M+")"}function t(M){return M+" { ? }"}function n(M,_,E,s){var d=s?c(E,s):m.call(E,", ");return M+" ("+_+") {"+d+"}"}function h(M){for(var _=0;_<M.length;_++)if(FA(M[_],`
5
+ `:I===118?"\v":I===102?"\f":I===114?"\r":I===101?"\x1B":I===32?" ":I===34?'"':I===47?"/":I===92?"\\":I===78?"\x85":I===95?"\xA0":I===76?"\u2028":I===80?"\u2029":""}for(var bU=new Array(256),TU=new Array(256),ZB=0;ZB<256;ZB++)bU[ZB]=Dr(ZB)?1:0,TU[ZB]=Dr(ZB);var qU=eI,VU=nr,jU={float:hr,null:ar,bool:sr},fQ={Type:qU,types:jU};const{Type:_U}=fQ;function ZU(I){return 48<=I&&I<=57||65<=I&&I<=70||97<=I&&I<=102}function PU(I){return 48<=I&&I<=55}function OU(I){return 48<=I&&I<=57}function xU(I){if(I===null)return!1;const A=I.length;let g,B=0,e=!1;if(!A)return!1;if(g=I[B],(g==="-"||g==="+")&&(g=I[++B]),g==="0"){if(B+1===A)return!0;if(g=I[++B],g==="b"){for(B++;B<A;B++)if(g=I[B],g!=="_"){if(g!=="0"&&g!=="1")return!1;e=!0}return e&&g!=="_"}if(g==="x"){for(B++;B<A;B++)if(g=I[B],g!=="_"){if(!ZU(I.charCodeAt(B)))return!1;e=!0}return e&&g!=="_"}for(;B<A;B++)if(g=I[B],g!=="_"){if(!PU(I.charCodeAt(B)))return!1;e=!0}return e&&g!=="_"}if(g==="_")return!1;for(;B<A;B++)if(g=I[B],g!=="_"){if(g===":")break;if(!OU(I.charCodeAt(B)))return!1;e=!0}return!e||g==="_"?!1:g!==":"?!0:/^(:[0-5]?[0-9])+$/.test(I.slice(B))}function zU(I){let A=I,g=1,B,e;const Q=[];if(A.indexOf("_")!==-1&&(A=A.replace(/_/g,"")),B=A[0],(B==="-"||B==="+")&&(B==="-"&&(g=-1),A=A.slice(1),B=A[0]),A==="0")return BigInt(0);if(B==="0")return A[1]==="b"||A[1]==="x"?BigInt(A)*BigInt(g):BigInt("0o"+A)*BigInt(g);if(A.indexOf(":")!==-1){for(const C of A.split(":"))Q.unshift(parseInt(C,10));A=BigInt(0),e=BigInt(1);for(const C of Q)A=(BigInt(A)+BigInt(e))*BigInt(C),e=BigInt(e)*BigInt(60);return A*BigInt(g)}return BigInt(A)*BigInt(g)}function vU(I){return typeof I=="bigint"||typeof I=="number"}const WU=new _U("tag:yaml.org,2002:int",{kind:"scalar",resolve:xU,construct:zU,predicate:vU,instanceOf:BigInt,represent:{binary:function(I){return I>=0?"0b"+I.toString(2):"-0b"+I.toString(2).slice(1)},octal:function(I){return I>=0?"0"+I.toString(8):"-0"+I.toString(8).slice(1)},decimal:function(I){return I.toString(10)},hexadecimal:function(I){return I>=0?"0x"+I.toString(16).toUpperCase():"-0x"+I.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}});VU.extend({implicit:[fQ.types.null,fQ.types.bool,WU,fQ.types.float],explicit:[]});const aB={PRESET_BASE:KI.mainnet,CONFIG_NAME:"mainnet",TERMINAL_TOTAL_DIFFICULTY:BigInt("58750000000000000000000"),TERMINAL_BLOCK_HASH:sA("0x0000000000000000000000000000000000000000000000000000000000000000"),TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH:1/0,MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:16384,MIN_GENESIS_TIME:1606824e3,GENESIS_FORK_VERSION:sA("0x00000000"),GENESIS_DELAY:604800,ALTAIR_FORK_VERSION:sA("0x01000000"),ALTAIR_FORK_EPOCH:74240,BELLATRIX_FORK_VERSION:sA("0x02000000"),BELLATRIX_FORK_EPOCH:144896,CAPELLA_FORK_VERSION:sA("0x03000000"),CAPELLA_FORK_EPOCH:194048,DENEB_FORK_VERSION:sA("0x04000000"),DENEB_FORK_EPOCH:269568,ELECTRA_FORK_VERSION:sA("0x05000000"),ELECTRA_FORK_EPOCH:364032,FULU_FORK_VERSION:sA("0x06000000"),FULU_FORK_EPOCH:411392,GLOAS_FORK_VERSION:sA("0x07000000"),GLOAS_FORK_EPOCH:1/0,SECONDS_PER_SLOT:12,SLOT_DURATION_MS:12e3,SECONDS_PER_ETH1_BLOCK:14,MIN_VALIDATOR_WITHDRAWABILITY_DELAY:256,MIN_BUILDER_WITHDRAWABILITY_DELAY:64,SHARD_COMMITTEE_PERIOD:256,ETH1_FOLLOW_DISTANCE:2048,PROPOSER_REORG_CUTOFF_BPS:1667,ATTESTATION_DUE_BPS:3333,AGGREGATE_DUE_BPS:6667,SYNC_MESSAGE_DUE_BPS:3333,CONTRIBUTION_DUE_BPS:6667,ATTESTATION_DUE_BPS_GLOAS:2500,AGGREGATE_DUE_BPS_GLOAS:5e3,SYNC_MESSAGE_DUE_BPS_GLOAS:2500,CONTRIBUTION_DUE_BPS_GLOAS:5e3,PAYLOAD_ATTESTATION_DUE_BPS:7500,INACTIVITY_SCORE_BIAS:4,INACTIVITY_SCORE_RECOVERY_RATE:16,EJECTION_BALANCE:16e9,MIN_PER_EPOCH_CHURN_LIMIT:4,MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT:8,CHURN_LIMIT_QUOTIENT:65536,PROPOSER_SCORE_BOOST:40,REORG_HEAD_WEIGHT_THRESHOLD:20,REORG_PARENT_WEIGHT_THRESHOLD:160,REORG_MAX_EPOCHS_SINCE_FINALIZATION:2,DEPOSIT_CHAIN_ID:1,DEPOSIT_NETWORK_ID:1,DEPOSIT_CONTRACT_ADDRESS:sA("0x00000000219ab540356cBB839Cbe05303d7705Fa"),MAX_PAYLOAD_SIZE:10485760,MAX_REQUEST_BLOCKS:1024,EPOCHS_PER_SUBNET_SUBSCRIPTION:256,MIN_EPOCHS_FOR_BLOCK_REQUESTS:33024,ATTESTATION_PROPAGATION_SLOT_RANGE:32,MAXIMUM_GOSSIP_CLOCK_DISPARITY:500,MESSAGE_DOMAIN_INVALID_SNAPPY:sA("0x00000000"),MESSAGE_DOMAIN_VALID_SNAPPY:sA("0x01000000"),SUBNETS_PER_NODE:2,MAX_REQUEST_BLOCKS_DENEB:128,MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS:4096,BLOB_SIDECAR_SUBNET_COUNT:6,MAX_BLOBS_PER_BLOCK:6,MAX_REQUEST_BLOB_SIDECARS:768,MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT:256e9,MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA:128e9,BLOB_SIDECAR_SUBNET_COUNT_ELECTRA:9,MAX_BLOBS_PER_BLOCK_ELECTRA:9,MAX_REQUEST_BLOB_SIDECARS_ELECTRA:1152,NUMBER_OF_CUSTODY_GROUPS:128,DATA_COLUMN_SIDECAR_SUBNET_COUNT:128,MAX_REQUEST_DATA_COLUMN_SIDECARS:16384,SAMPLES_PER_SLOT:8,CUSTODY_REQUIREMENT:4,VALIDATOR_CUSTODY_REQUIREMENT:8,BALANCE_PER_ADDITIONAL_CUSTODY_GROUP:32e9,MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS:4096,MAX_REQUEST_PAYLOADS:128,BLOB_SCHEDULE:[{EPOCH:412672,MAX_BLOBS_PER_BLOCK:15},{EPOCH:419072,MAX_BLOBS_PER_BLOCK:21}]},XU={PRESET_BASE:KI.minimal,CONFIG_NAME:"minimal",TERMINAL_TOTAL_DIFFICULTY:BigInt("115792089237316195423570985008687907853269984665640564039457584007913129638912"),TERMINAL_BLOCK_HASH:sA("0x0000000000000000000000000000000000000000000000000000000000000000"),TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH:1/0,MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:64,MIN_GENESIS_TIME:1578009600,GENESIS_FORK_VERSION:sA("0x00000001"),GENESIS_DELAY:300,ALTAIR_FORK_VERSION:sA("0x01000001"),ALTAIR_FORK_EPOCH:74240,BELLATRIX_FORK_VERSION:sA("0x02000001"),BELLATRIX_FORK_EPOCH:1/0,CAPELLA_FORK_VERSION:sA("0x03000001"),CAPELLA_FORK_EPOCH:1/0,DENEB_FORK_VERSION:sA("0x04000001"),DENEB_FORK_EPOCH:1/0,ELECTRA_FORK_VERSION:sA("0x05000001"),ELECTRA_FORK_EPOCH:1/0,FULU_FORK_VERSION:sA("0x06000001"),FULU_FORK_EPOCH:1/0,GLOAS_FORK_VERSION:sA("0x07000001"),GLOAS_FORK_EPOCH:1/0,SECONDS_PER_SLOT:6,SLOT_DURATION_MS:6e3,SECONDS_PER_ETH1_BLOCK:14,MIN_VALIDATOR_WITHDRAWABILITY_DELAY:256,MIN_BUILDER_WITHDRAWABILITY_DELAY:2,SHARD_COMMITTEE_PERIOD:64,ETH1_FOLLOW_DISTANCE:16,PROPOSER_REORG_CUTOFF_BPS:1667,ATTESTATION_DUE_BPS:3333,AGGREGATE_DUE_BPS:6667,SYNC_MESSAGE_DUE_BPS:3333,CONTRIBUTION_DUE_BPS:6667,ATTESTATION_DUE_BPS_GLOAS:2500,AGGREGATE_DUE_BPS_GLOAS:5e3,SYNC_MESSAGE_DUE_BPS_GLOAS:2500,CONTRIBUTION_DUE_BPS_GLOAS:5e3,PAYLOAD_ATTESTATION_DUE_BPS:7500,INACTIVITY_SCORE_BIAS:4,INACTIVITY_SCORE_RECOVERY_RATE:16,EJECTION_BALANCE:16e9,MIN_PER_EPOCH_CHURN_LIMIT:2,MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT:4,CHURN_LIMIT_QUOTIENT:32,PROPOSER_SCORE_BOOST:40,REORG_HEAD_WEIGHT_THRESHOLD:20,REORG_PARENT_WEIGHT_THRESHOLD:160,REORG_MAX_EPOCHS_SINCE_FINALIZATION:2,DEPOSIT_CHAIN_ID:5,DEPOSIT_NETWORK_ID:5,DEPOSIT_CONTRACT_ADDRESS:sA("0x1234567890123456789012345678901234567890"),MAX_PAYLOAD_SIZE:10485760,MAX_REQUEST_BLOCKS:1024,EPOCHS_PER_SUBNET_SUBSCRIPTION:256,MIN_EPOCHS_FOR_BLOCK_REQUESTS:272,ATTESTATION_PROPAGATION_SLOT_RANGE:32,MAXIMUM_GOSSIP_CLOCK_DISPARITY:500,MESSAGE_DOMAIN_INVALID_SNAPPY:sA("0x00000000"),MESSAGE_DOMAIN_VALID_SNAPPY:sA("0x01000000"),SUBNETS_PER_NODE:2,MAX_REQUEST_BLOCKS_DENEB:128,MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS:4096,BLOB_SIDECAR_SUBNET_COUNT:6,MAX_BLOBS_PER_BLOCK:6,MAX_REQUEST_BLOB_SIDECARS:768,MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT:128e9,MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA:64e9,BLOB_SIDECAR_SUBNET_COUNT_ELECTRA:9,MAX_BLOBS_PER_BLOCK_ELECTRA:9,MAX_REQUEST_BLOB_SIDECARS_ELECTRA:1152,NUMBER_OF_CUSTODY_GROUPS:128,DATA_COLUMN_SIDECAR_SUBNET_COUNT:128,MAX_REQUEST_DATA_COLUMN_SIDECARS:16384,SAMPLES_PER_SLOT:8,CUSTODY_REQUIREMENT:4,VALIDATOR_CUSTODY_REQUIREMENT:8,BALANCE_PER_ADDITIONAL_CUSTODY_GROUP:32e9,MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS:4096,MAX_REQUEST_PAYLOADS:128,BLOB_SCHEDULE:[]};let SQ;switch(sQ){case KI.minimal:SQ=XU;break;case KI.mainnet:SQ=aB;break;default:SQ=aB}function $U(I){const A={...SQ,...I};if(I.SLOT_DURATION_MS===void 0&&(A.SLOT_DURATION_MS=A.SECONDS_PER_SLOT*1e3),A.PRESET_BASE!==sQ)throw new Error(`Can only create a config for the active preset: ACTIVE_PRESET=${sQ} PRESET_BASE=${A.PRESET_BASE}`);return A}function mg(I,A){const g=BigInt(1)<<BigInt(I);if(A>=g)throw new Error(`index ${A} too large for depth ${I}`);return g|A}function ii(I,A){const g=A?Number(A).toString(2):"";if(g.length>I)throw new Error("index too large for depth");return`1${g.padStart(I,"0")}`}function ti(I){if(typeof I=="string"){if(I.length===0)throw new Error(wQ);return I}if(I<1)throw new Error(wQ);return I.toString(2)}const wQ="Invalid gindex";function Af(I){let A;if(typeof I=="string"){if(!I.length)throw new Error(wQ);A=I}else{if(I<1)throw new Error(wQ);A=I.toString(2)}let g=1;const B=()=>{if(g===A.length)return{done:!0,value:void 0};const e=Number(A[g]);return g++,{done:!1,value:e}};return{[Symbol.iterator](){return{next:B}},remainingBitLength(){return A.length-g}}}function yI(I){return BigInt(I.reduce((A,g)=>A+g.toString(2).slice(1),"0b1"))}function If(I){return I instanceof Uint8Array||ArrayBuffer.isView(I)&&I.constructor.name==="Uint8Array"}function Ei(I,...A){if(!If(I))throw new Error("Uint8Array expected");if(A.length>0&&!A.includes(I.length))throw new Error("Uint8Array expected of length "+A+", got length="+I.length)}function Ur(I,A=!0){if(I.destroyed)throw new Error("Hash instance has been destroyed");if(A&&I.finished)throw new Error("Hash#digest() has already been called")}function gf(I,A){Ei(I);const g=A.outputLen;if(I.length<g)throw new Error("digestInto() expects output buffer of length at least "+g)}function oi(...I){for(let A=0;A<I.length;A++)I[A].fill(0)}function ri(I){return new DataView(I.buffer,I.byteOffset,I.byteLength)}function Qg(I,A){return I<<32-A|I>>>A}function Bf(I){if(typeof I!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(I))}function fr(I){return typeof I=="string"&&(I=Bf(I)),Ei(I),I}let Cf=class{};function Qf(I){const A=B=>I().update(fr(B)).digest(),g=I();return A.outputLen=g.outputLen,A.blockLen=g.blockLen,A.create=()=>I(),A}function ef(I,A,g,B){if(typeof I.setBigUint64=="function")return I.setBigUint64(A,g,B);const e=BigInt(32),Q=BigInt(4294967295),C=Number(g>>e&Q),i=Number(g&Q),o=B?4:0,D=B?0:4;I.setUint32(A+o,C,B),I.setUint32(A+D,i,B)}function tf(I,A,g){return I&A^~I&g}function Ef(I,A,g){return I&A^I&g^A&g}class of extends Cf{constructor(A,g,B,e){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=A,this.outputLen=g,this.padOffset=B,this.isLE=e,this.buffer=new Uint8Array(A),this.view=ri(this.buffer)}update(A){Ur(this),A=fr(A),Ei(A);const{view:g,buffer:B,blockLen:e}=this,Q=A.length;for(let C=0;C<Q;){const i=Math.min(e-this.pos,Q-C);if(i===e){const o=ri(A);for(;e<=Q-C;C+=e)this.process(o,C);continue}B.set(A.subarray(C,C+i),this.pos),this.pos+=i,C+=i,this.pos===e&&(this.process(g,0),this.pos=0)}return this.length+=A.length,this.roundClean(),this}digestInto(A){Ur(this),gf(A,this),this.finished=!0;const{buffer:g,view:B,blockLen:e,isLE:Q}=this;let{pos:C}=this;g[C++]=128,oi(this.buffer.subarray(C)),this.padOffset>e-C&&(this.process(B,0),C=0);for(let U=C;U<e;U++)g[U]=0;ef(B,e-8,BigInt(this.length*8),Q),this.process(B,0);const i=ri(A),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const D=o/4,a=this.get();if(D>a.length)throw new Error("_sha2: outputLen bigger than state");for(let U=0;U<D;U++)i.setUint32(4*U,a[U],Q)}digest(){const{buffer:A,outputLen:g}=this;this.digestInto(A);const B=A.slice(0,g);return this.destroy(),B}_cloneInto(A){A||(A=new this.constructor),A.set(...this.get());const{blockLen:g,buffer:B,length:e,finished:Q,destroyed:C,pos:i}=this;return A.destroyed=C,A.finished=Q,A.length=e,A.pos=i,e%g&&A.buffer.set(B),A}clone(){return this._cloneInto()}}const Lg=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),rf=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]),Kg=new Uint32Array(64);class nf extends of{constructor(A=32){super(64,A,8,!1),this.A=Lg[0]|0,this.B=Lg[1]|0,this.C=Lg[2]|0,this.D=Lg[3]|0,this.E=Lg[4]|0,this.F=Lg[5]|0,this.G=Lg[6]|0,this.H=Lg[7]|0}get(){const{A,B:g,C:B,D:e,E:Q,F:C,G:i,H:o}=this;return[A,g,B,e,Q,C,i,o]}set(A,g,B,e,Q,C,i,o){this.A=A|0,this.B=g|0,this.C=B|0,this.D=e|0,this.E=Q|0,this.F=C|0,this.G=i|0,this.H=o|0}process(A,g){for(let U=0;U<16;U++,g+=4)Kg[U]=A.getUint32(g,!1);for(let U=16;U<64;U++){const J=Kg[U-15],f=Kg[U-2],y=Qg(J,7)^Qg(J,18)^J>>>3,S=Qg(f,17)^Qg(f,19)^f>>>10;Kg[U]=S+Kg[U-7]+y+Kg[U-16]|0}let{A:B,B:e,C:Q,D:C,E:i,F:o,G:D,H:a}=this;for(let U=0;U<64;U++){const J=Qg(i,6)^Qg(i,11)^Qg(i,25),f=a+J+tf(i,o,D)+rf[U]+Kg[U]|0,y=(Qg(B,2)^Qg(B,13)^Qg(B,22))+Ef(B,e,Q)|0;a=D,D=o,o=i,i=C+f|0,C=Q,Q=e,e=B,B=f+y|0}B=B+this.A|0,e=e+this.B|0,Q=Q+this.C|0,C=C+this.D|0,i=i+this.E|0,o=o+this.F|0,D=D+this.G|0,a=a+this.H|0,this.set(B,e,Q,C,i,o,D,a)}roundClean(){oi(Kg)}destroy(){this.set(0,0,0,0,0,0,0,0),oi(this.buffer)}}const af=Qf(()=>new nf),Sr=af,PB=[new Uint8Array(32)];function OB(I){if(I>=PB.length)for(let A=PB.length;A<=I;A++)PB[A]=Sr.create().update(PB[A-1]).update(PB[A-1]).digest();return PB[I]}function dC(I){const A=new Uint8Array(32);return cD(I,A,0),A}function sf(I){return DD(I,0)}const aI=64;function hf(I,A,g,B,e){if(A<1)throw new Error(`Invalid padFor, expect to be greater than 0, got ${A}`);const Q=Math.ceil(Math.log2(A));if(I.length===0){g.set(OB(Q),B);return}if(I.length%32!==0)throw new Error(`Invalid input length, expect to be multiple of 32 bytes, got ${I.length}`);if(A>1&&I.length%aI!==0)throw new Error(`Invalid input length, expect to be multiple of 64 bytes, got ${I.length}, padFor=${A}`);let C=I.length,i=Math.floor(C/2),o=I;for(let D=0;D<Q;D++){const a=I.subarray(0,i);e(o,a),Math.floor(i/32)%2===1&&D<Q-1?(C=i+32,o=I.subarray(0,C),o.set(OB(D+1),i)):(o=a,C=i),i=Math.floor(C/2)}g.set(o.subarray(0,32),B)}function lf(I,A,g,B,e,Q,C){if(g<1)throw new Error(`Invalid padFor, expect to be at least 1, got ${g}`);if(A>I.length)throw new Error(`Invalid blockLimit, expect to be less than or equal blocks.length ${I.length}, got ${A}`);const i=Math.ceil(Math.log2(g));if(A===0){B.set(OB(i),e);return}for(const f of I)if(f.length!==aI)throw new Error(`Invalid block length, expect to be 64 bytes, got ${f.length}`);if(C.length===0||C.length%(4*aI)!==0)throw new Error(`Invalid buffer length, expect to be multiple of 64 bytes, got ${C.length}`);const o=Math.floor(C.length/aI),D=Math.floor(o/2);let a=C,U=C.subarray(0,D*aI),J=A;for(let f=0;f<i;f++){let y=0;const S=Math.floor(J/o);for(let N=0;N<S;N++){for(let G=0;G<o;G++){const H=N*o+G;a.set(I[H],G*aI)}Q(a,U);for(let G=0;G<D;G++)I[y].set(U.subarray(G*aI,(G+1)*aI)),y++}const R=J%o;a=C.subarray(0,R*aI),U=C.subarray(0,Math.floor(a.length/2));for(let N=Math.floor(J/o)*o;N<J;N++)a.set(I[N],N%o*aI);Q(a,U);for(let N=0;N<Math.floor(U.length/aI);N++)I[y].set(U.subarray(N*aI,(N+1)*aI)),y++;U.length%aI!==0&&(I[y].set(U.subarray(U.length-32,U.length),0),I[y].set(OB(f+1),32),y++),J=y,a=C.subarray(0,J*aI),U=C.subarray(0,Math.floor(a.length/2))}B.set(I[0].subarray(0,32),e)}function cf(I,A,g){let B=I.length;const e=Math.pow(2,A)*32;if(A<1)throw new Error(`Invalid nLevel, expect to be greater than 0, got ${A}`);if(B%e!==0)throw new Error(`Invalid input length, expect to be multiple of ${e} for nLevel ${A}, got ${B}`);let Q=Math.floor(B/2),C=I;for(let i=A;i>0;i--){const o=C.subarray(0,Q);g(C,o),C=o,B=Q,Q=Math.floor(B/2)}return C}const ni=new Uint8Array(64),ai=(I,A)=>Sr.create().update(I).update(A).digest(),NC=(I,A)=>{if(I.length%64!==0)throw new Error(`Invalid input length ${I.length}`);if(I.length!==A.length*2)throw new Error(`Invalid output length ${A.length}`);const g=Math.floor(I.length/64);for(let B=0;B<g;B++){const e=B*64,Q=I.subarray(e,e+32),C=I.subarray(e+32,e+64),i=ai(Q,C);A.set(i,B*32)}},Df=new Uint8Array(4*aI);let sB={name:"noble",hashInto:NC,digest64:ai,digest64Into:(I,A,g)=>{if(I.length!==32||A.length!==32)throw new Error("Invalid input length");if(g.length!==32)throw new Error("Invalid output length");ni.set(I,0),ni.set(A,32),NC(ni,g)},digest64HashObjects:(I,A,g)=>{gi(ai(dC(I),dC(A)),0,g)},merkleizeBlocksBytes(I,A,g,B){hf(I,A,g,B,NC)},merkleizeBlockArray(I,A,g,B,e){lf(I,A,g,B,e,NC,Df)},digestNLevel(I,A){return cf(I,A,NC)},executeHashComputations:I=>{for(let A=I.length-1;A>=0;A--){const g=I[A];if(!g)throw Error(`no hash computations for level ${A}`);for(const B of g)B.dest.applyHash(dD(B.src0,B.src1))}}};function xB(I,A,g,B){sB.merkleizeBlocksBytes(I,A,g,B)}function wr(I,A,g,B,e){sB.merkleizeBlockArray(I,A,g,B,e)}function Uf(I){sB.executeHashComputations(I)}const yr=2**32;class si{h0;h1;h2;h3;h4;h5;h6;h7;constructor(A,g,B,e,Q,C,i,o){this.h0=A,this.h1=g,this.h2=B,this.h3=e,this.h4=Q,this.h5=C,this.h6=i,this.h7=o}applyHash(A){this.h0=A.h0,this.h1=A.h1,this.h2=A.h2,this.h3=A.h3,this.h4=A.h4,this.h5=A.h5,this.h6=A.h6,this.h7=A.h7}}class _A extends si{_left;_right;constructor(A,g){if(super(null,0,0,0,0,0,0,0),this._left=A,this._right=g,!A)throw new Error("Left node is undefined");if(!g)throw new Error("Right node is undefined")}get rootHashObject(){return this.h0===null&&sB.digest64HashObjects(this.left.rootHashObject,this.right.rootHashObject,this),this}get root(){return dC(this.rootHashObject)}get left(){return this._left}get right(){return this._right}isLeaf(){return!1}}class qA extends si{get rootHashObject(){return this}get root(){return dC(this)}get left(){throw Error("LeafNode has no left node")}get right(){throw Error("LeafNode has no right node")}static fromRoot(A){return qA.fromHashObject(sf(A))}static fromHashObject(A){return new qA(A.h0,A.h1,A.h2,A.h3,A.h4,A.h5,A.h6,A.h7)}static fromZero(){return new qA(0,0,0,0,0,0,0,0)}static fromUint32(A){return new qA(A,0,0,0,0,0,0,0)}clone(){return qA.fromHashObject(this)}isLeaf(){return!0}writeToBytes(A,g,B){A.set(this.root.slice(0,B),g)}getUint(A,g,B){const e=Math.floor(g/4);if(A<4){const Q=g%4*8,C=_I(this,e);return A===1?255&C>>Q:65535&C>>Q}if(A===4)return _I(this,e)>>>0;if(A===8){const Q=_I(this,e),C=_I(this,e+1);return C===0?Q>>>0:C===-1&&Q===-1&&B?1/0:(Q>>>0)+(C>>>0)*yr}throw Error("uintBytes > 8")}getUintBigint(A,g){const B=Math.floor(g/4);if(A<4){const C=g%4*8,i=_I(this,B);return BigInt(A===1?255&i>>C:65535&i>>C)}if(A===4)return BigInt(_I(this,B)>>>0);const e=Math.ceil(A/4);let Q=BigInt(0);for(let C=0;C<e;C++)Q+=BigInt(_I(this,B+C)>>>0)<<BigInt(32*C);return Q}setUint(A,g,B,e){const Q=Math.floor(g/4);if(A<4){const C=g%4*8;let i=_I(this,Q);A===1?(i&=~(255<<C),i|=(255&B)<<C):(i&=~(65535<<C),i|=(65535&B)<<C),lI(this,Q,i)}else if(A===4)lI(this,Q,B);else if(A===8)B===1/0&&e?(lI(this,Q,-1),lI(this,Q+1,-1)):(lI(this,Q,B&4294967295),lI(this,Q+1,B/yr&4294967295));else throw Error("uintBytes > 8")}setUintBigint(A,g,B){const e=Math.floor(g/4);if(A<4){const Q=Number(B),C=g%4*8;let i=_I(this,e);A===1?(i&=~(255<<C),i|=(255&Q)<<C):(i&=~(65535<<C),i|=(65535&Q)<<C),lI(this,e,i)}else if(A===4)lI(this,e,Number(B));else{const Q=e+Math.ceil(A/4);for(let C=e;C<Q;C++)lI(this,C,Number(B&BigInt(4294967295))),B=B>>BigInt(32)}}bitwiseOrUint(A,g,B){const e=Math.floor(g/4);if(A<4){const Q=g%4*8;hi(this,e,B<<Q)}else if(A===4)hi(this,e,B);else{const Q=e+Math.ceil(A/4);for(let C=e;C<Q;C++)hi(this,C,B&4294967295),B>>=32}}}function _I(I,A){if(A===0)return I.h0;if(A===1)return I.h1;if(A===2)return I.h2;if(A===3)return I.h3;if(A===4)return I.h4;if(A===5)return I.h5;if(A===6)return I.h6;if(A===7)return I.h7;throw Error("hIndex > 7")}function lI(I,A,g){if(A===0)I.h0=g;else if(A===1)I.h1=g;else if(A===2)I.h2=g;else if(A===3)I.h3=g;else if(A===4)I.h4=g;else if(A===5)I.h5=g;else if(A===6)I.h6=g;else if(A===7)I.h7=g;else throw Error("hIndex > 7")}function hi(I,A,g){if(A===0)I.h0|=g;else if(A===1)I.h1|=g;else if(A===2)I.h2|=g;else if(A===3)I.h3|=g;else if(A===4)I.h4|=g;else if(A===5)I.h5|=g;else if(A===6)I.h6|=g;else if(A===7)I.h7|=g;else throw Error("hIndex > 7")}class ff{_length;_totalLength;head;tail;pointer;constructor(){this._length=0,this._totalLength=0,this.head={src0:null,src1:null,dest:null,next:null},this.tail=null,this.pointer=null}get length(){return this._length}get totalLength(){return this._totalLength}reset(){this.head.src0=null,this.head.src1=null,this.head.dest=null,this.tail=null,this._length=0,this.pointer=null}push(A,g,B){if(this.tail!==null){let e=this.tail.next;e!==null?(e.src0=A,e.src1=g,e.dest=B):(e={src0:A,src1:g,dest:B,next:null},this.tail.next=e,this._totalLength++),this.tail=e,this._length++;return}this.head.src0=A,this.head.src1=g,this.head.dest=B,this.tail=this.head,this._length=1,this._totalLength===0&&(this._totalLength=1)}clean(){let A=this.tail?.next??null;for(;A!==null&&A.src0!==null;)A.src0=null,A.src1=null,A.dest=null,A=A.next}next(){if(!this.pointer||this.tail===null)return{done:!0,value:void 0};const A=this.pointer,g=A.src0===null;return this.pointer=this.pointer.next,g?{done:!0,value:void 0}:{done:!1,value:A}}[Symbol.iterator](){return this.pointer=this.head,this}toArray(){const A=[];for(const g of this)A.push(g);return A}dump(){const A=[];let g=null;for(g=this.head;g!==null;g=g.next)A.push(g);return A}}class Sf{byLevel;constructor(){this.byLevel=[]}reset(){for(const A of this.byLevel)A.reset()}clean(){for(const A of this.byLevel)A.clean()}}function iI(I,A,g){if(I.h0===null){const B=ZI(g,A),{left:e,right:Q}=I;B.push(e,Q,I),iI(e,A+1,g),iI(Q,A+1,g)}}function ZI(I,A){return I[A]===void 0&&(I[A]=new ff),I[A]}const hB=[qA.fromZero()];function Yg(I){if(I>=hB.length){for(let A=hB.length;A<=I;A++)hB[A]=new _A(hB[A-1],hB[A-1]);hB[I].root}return hB[I]}function uC(I,A,g=0,B=null){const e=2**A;if(I.length>e)throw new Error(`nodes.length ${I.length} over maxIndex at depth ${A}`);if(I.length===0)return Yg(A);if(A===0){const C=I[0];return B!==null&&iI(C,g,B),C}if(A===1){const C=I[0],i=I.length>1?I[1]:Yg(0),o=new _A(C,i);return B!==null&&(iI(C,g+1,B),iI(i,g+1,B),ZI(B,g).push(C,i,o)),o}let Q=I.length;for(let C=A;C>0;C--){const i=Q%2,o=Q-i,D=B?g+C-1:null;for(let a=0;a<o;a+=2){const U=I[a],J=I[a+1],f=new _A(U,J);I[a/2]=f,D!==null&&B!==null&&(ZI(B,D).push(U,J,f),C===A&&(iI(U,D+1,B),iI(J,D+1,B)))}if(i>0){const a=I[o],U=Yg(A-C),J=new _A(a,U);I[o/2]=J,D!==null&&B!==null&&(C===A&&iI(a,D+1,B),ZI(B,D).push(a,U,J))}Q=o/2+i}return I[0]}const wf=2**32;function RC(I,A,g,B){const e=df(A,g,B);return uC(e,I)}function yf(I){const A=new Array(Math.ceil(I.length/4));for(let g=0;g<I.length;g++){const B=Math.floor(g/4),e=A[B]??new qA(0,0,0,0,0,0,0,0),Q=2*(g%4),C=I[g];C===1/0?(lI(e,Q,4294967295),lI(e,Q+1,4294967295)):(lI(e,Q,C&4294967295),lI(e,Q+1,C/wf&4294967295)),A[B]=e}return A}function df(I,A,g){const B=g-A,e=Math.floor(B/32),Q=new Array(Math.ceil(B/32));for(let i=0;i<e;i++){const o=A+i*32;Q[i]=new qA(I.getInt32(o+0,!0),I.getInt32(o+4,!0),I.getInt32(o+8,!0),I.getInt32(o+12,!0),I.getInt32(o+16,!0),I.getInt32(o+20,!0),I.getInt32(o+24,!0),I.getInt32(o+28,!0))}const C=B%32;if(C>0){const i=new qA(0,0,0,0,0,0,0,0);Q[e]=i;const o=Math.floor(C/4);for(let a=0;a<o;a++)lI(i,a,I.getInt32(A+e*32+a*4,!0));const D=B%4;if(D>0){let a=0;for(let U=0;U<D;U++)a|=I.getUint8(A+B-D+U)<<U*8;lI(i,o,a)}}return Q}function GC(I,A,g,B){const e=g%32,Q=Math.floor(g/32);for(let C=0;C<Q;C++){const i=B[C],o=A+C*32;I.setInt32(o+0,i.h0,!0),I.setInt32(o+4,i.h1,!0),I.setInt32(o+8,i.h2,!0),I.setInt32(o+12,i.h3,!0),I.setInt32(o+16,i.h4,!0),I.setInt32(o+20,i.h5,!0),I.setInt32(o+24,i.h6,!0),I.setInt32(o+28,i.h7,!0)}if(e>0){const C=B[Q],i=Math.floor(e/4);for(let D=0;D<i;D++)I.setInt32(A+Q*32+D*4,_I(C,D),!0);const o=g%4;if(o>0){const D=_I(C,i);for(let a=0;a<o;a++)I.setUint8(A+g-o+a,D>>a*8&255)}}}function Nf(I){const A=new Set,g=new Set;let B=I;for(;B.length>1;){A.add(B);const e=B.at(-1),Q=B.substring(0,B.length-1);g.add(Q+(Number(e)^1)),B=Q}return{path:A,branch:g}}function uf(I,A){return I.length?I.map(g=>g.padEnd(A)).sort().map(g=>g.trim()):[]}function Rf(I){return I.length?I.sort((A,g)=>{if(A.length<g.length)return 1;if(g.length<A.length)return-1;let B=A.indexOf("0"),e=g.indexOf("0");for(;;){if(B===-1)return-1;if(e===-1||B<e)return 1;if(e<B)return-1;B=A.indexOf("0",B+1),e=g.indexOf("0",e+1)}}):[]}function Gf(I){const A=I.slice().sort((B,e)=>B.length-e.length),g=[];A:for(let B=0;B<A.length;B++){const e=A[B];for(let Q=B+1;Q<A.length;Q++)if(A[Q].startsWith(e))continue A;g.push(e)}return g}var bg;(function(I){I[I.InOrder=0]="InOrder",I[I.Decreasing=1]="Decreasing",I[I.Unsorted=2]="Unsorted"})(bg||(bg={}));function li(I,A=!0,g=bg.InOrder){const B=Gf(I),e=new Set(A?B:[]),Q=new Set,C=new Set;let i=1;for(const o of B){o.length>i&&(i=o.length);const{path:D,branch:a}=Nf(o);for(const U of D)Q.add(U);for(const U of a)C.add(U)}for(const o of Q)C.delete(o);for(const o of C)e.add(o);switch(g){case bg.InOrder:return uf(Array.from(e),i);case bg.Decreasing:return Rf(Array.from(e));case bg.Unsorted:return Array.from(e)}}function dr(I,A){const g=A%8,B=Math.floor(A/8),e=I[B];switch(g){case 0:return(e&128)!==0;case 1:return(e&64)!==0;case 2:return(e&32)!==0;case 3:return(e&16)!==0;case 4:return(e&8)!==0;case 5:return(e&4)!==0;case 6:return(e&2)!==0;case 7:return(e&1)!==0;default:throw new Error("unreachable")}}function Nr(I){const A=[],g=I.length*8;let B=0,e=0;for(let Q=0;Q<g;Q++){const C=dr(I,Q);if(A.push(C),C?e++:B++,e>B){if(Q++,Q+7<g)throw new Error("Invalid descriptor: too many bytes");for(;Q<g;Q++)if(dr(I,Q))throw new Error("Invalid descriptor: too many 1 bits");return A}}throw new Error("Invalid descriptor: not enough 1 bits")}function ci(I,A,g){if(A[g])return[I.root];const B=ci(I.left,A,g+1),e=ci(I.right,A,g+B.length*2);return[...B,...e]}function Di(I,A,g){return I[g.bitIndex++]?qA.fromRoot(A[g.leafIndex++]):new _A(Di(I,A,g),Di(I,A,g))}function kf(I,A){return ci(I,Nr(A),0)}function Ff(I,A){const g=Nr(A);if(g.length!==I.length*2-1)throw new Error("Invalid multiproof: invalid number of leaves");return Di(g,I,{bitIndex:0,leafIndex:0})}const ur="Invalid tree navigation";function Rr(I,A){const g=[];let B=I;for(const e of Af(A))if(e){if(B.isLeaf())throw new Error(ur);g.push(B.left.root),B=B.right}else{if(B.isLeaf())throw new Error(ur);g.push(B.right.root),B=B.left}return[B.root,g.reverse()]}function Jf(I,A,g){let B=qA.fromRoot(A);const e=g.slice().reverse();for(;I>1;){const Q=qA.fromRoot(e.pop());I%BigInt(2)===BigInt(0)?B=new _A(B,Q):B=new _A(Q,B),I=I/BigInt(2)}return B}class GI{_rootNode;hook;constructor(A,g){this._rootNode=A,g&&(typeof WeakRef>"u"?this.hook=g:this.hook=new WeakRef(g))}get root(){return this.rootNode.root}get rootNode(){return this._rootNode}set rootNode(A){if(this._rootNode=A,this.hook)if(typeof WeakRef>"u")this.hook(A);else{const g=this.hook.deref();g?g(A):this.hook=void 0}}static createFromProof(A){return new GI(qf(A))}clone(){return new GI(this.rootNode)}getSubtree(A){return new GI(this.getNode(A),g=>this.setNode(A,g))}getNode(A){return kC(this.rootNode,A)}getNodeAtDepth(A,g){return YI(this.rootNode,A,g)}getRoot(A){return this.getNode(A).root}setNode(A,g){this.rootNode=pf(this.rootNode,A,g)}setNodeWithFn(A,g){this.rootNode=Hf(this.rootNode,A,g)}setNodeAtDepth(A,g,B){this.rootNode=Mf(this.rootNode,A,g,B)}setRoot(A,g){this.setNode(A,qA.fromRoot(g))}getNodesAtDepth(A,g,B){return tI(this.rootNode,A,g,B)}iterateNodesAtDepth(A,g,B){return mf(this.rootNode,A,g,B)}getSingleProof(A){return Rr(this.rootNode,A)[1]}getProof(A){return pr(this.rootNode,A)}}function kC(I,A){const g=ti(A);let B=I;for(let e=1;e<g.length;e++){if(B.isLeaf())throw new Error(`Invalid tree - found leaf at depth ${e}`);B=g[e]==="1"?B.right:B.left}return B}function pf(I,A,g){const B=ti(A),e=Gr(I,B);return kr(B,e,g)}function Hf(I,A,g){const B=ti(A),e=Gr(I,B),Q=e.at(-1);if(!Q)throw new Error("Invalid tree - can not find last parent");const C=B.at(-1)==="1"?Q.right:Q.left,i=g(C);return kr(B,e,i)}function Gr(I,A){let g=I;const B=[I];for(let e=1;e<A.length-1;e++)A[e]==="1"?g=g.right:g=g.left,B.push(g);return B}function kr(I,A,g){let B=g;for(let e=I.length-1;e>=1;e--)I[e]==="1"?B=new _A(A[e-1].left,B):B=new _A(B,A[e-1].right);return B}function YI(I,A,g){if(A===0)return I;if(A===1)return g===0?I.left:I.right;const B=A-1,e=0;let Q=I;for(let C=B;C>=e;C--)Q=lB(C,g)?Q.left:Q.right;return Q}function Mf(I,A,g,B){return FC(I,A,[g],[B])}function FC(I,A,g,B,e=0,Q=null){if(A===0)return B.length>0?B[0]:I;const C=new Array(A),i=new Array(A),o=A-1,D=0;let a=o,U=I;C[o]=I;for(let J=0;J<g.length;J++){const f=g[J];for(let R=a;R>D;R--)U=lB(R,f)?U.left:U.right,C[R-1]=U;if(a=D,(f&1)!==1)if(f+1===g[J+1])U=new _A(B[J],B[J+1]),Q!=null&&ZI(Q,A-1+e).push(B[J],B[J+1],U),J++;else{const R=U;U=new _A(B[J],R.right),Q!=null&&ZI(Q,A-1+e).push(B[J],R.right,U)}else{const R=U;U=new _A(R.left,B[J]),Q!=null&&ZI(Q,A-1+e).push(R.left,B[J],U)}const y=J>=g.length-1,S=y?o:Lf(f,g[J+1]);for(let R=D+1;R<=S;R++){const N=A-R-1;if(N<0)throw Error(`Invalid depth ${N}, d=${R}, nodesDepth=${A}`);if(lB(R,f))if(y||R!==S){const G=U;U=new _A(G,C[R].right),Q!=null&&ZI(Q,N+e).push(G,C[R].right,U)}else i[R]=U,U=C[R];else{const G=i[R];if(G!==void 0){const H=U;U=new _A(G,H),Q!=null&&ZI(Q,N+e).push(G,H,U),i[R]=void 0}else{const H=U;U=new _A(C[R].left,H),Q!=null&&ZI(Q,N+e).push(C[R].left,H,U)}}}a=S}return U}function tI(I,A,g,B){if(A===0)return g===0&&B>0?[I]:[];if(A===1)return B===0?[]:B===1?g===0?[I.left]:[I.right]:[I.left,I.right];const e=A-1,Q=0;let C=e,i=I;const o=new Array(A),D=new Array(A),a=new Array(B);o[e]=I;for(let U=0;U<B;U++){for(let J=C;J>=Q;J--){J!==C&&(o[J]=i);const f=lB(J,g+U);D[J]=f,i=f?i.left:i.right}a[U]=i;for(let J=Q;J<=e;J++)if(D[J]===!0){C=J;break}i=o[C]}return a}function*mf(I,A,g,B){const e=g+B,Q=A-1,C=0;let i=Q,o=I;const D=new Array(A),a=new Array(A);D[Q]=I;for(let U=g;U<e;U++){for(let J=i;J>=C;J--){J!==i&&(D[J]=o);const f=lB(J,U);a[J]=f,o=f?o.left:o.right}yield o;for(let J=C;J<=Q;J++)if(a[J]===!0){i=J;break}o=D[i]}}function Fr(I,A,g){if(g<0)return Yg(A);const B=new Array(A),e=A-1,Q=0;let C=e,i=I;B[e]=I;for(let o=C;o>=Q;o--)i=lB(o,g)?i.left:i.right,B[o-1]=i;C=Q;for(let o=Q;o<=e;o++)lB(o,g)?i=new _A(i,Yg(o)):i=new _A(B[o].left,i);return i}const yQ=4294967295,Jr=2**32;function Lf(I,A){if(I===A||I<0||A<0)throw Error(`Expect different positive inputs, from=${I} to=${A}`);const g=Math.ceil(Math.log2(I+1)),B=Math.ceil(Math.log2(A+1));if(g!==B)return Math.max(g,B)-1;if(g>32){const e=Math.floor(I/Jr)&yQ,Q=Math.floor(A/Jr)&yQ;return e===Q?Ui(I&yQ,A&yQ):32+Ui(e,Q)}return Ui(I,A)}function lB(I,A){if(I>31){const B=A/4294967296>>>0,e=1<<I-32;return(B&e)!==e}const g=1<<I;return(A&g)!==g}function Ui(I,A){const g=I^A;if(g===0)throw Error(`Do not support equal value from=${I} to=${A}`);return(g<0?32:Math.ceil(Math.log2(g+1)))-1}function Kf(I,A){const g=new GI(I),B=li(A.map(i=>i.toString(2)),!1,bg.Decreasing),e=A.slice().sort((i,o)=>i<o?1:-1),Q=e.map(i=>g.getRoot(i)),C=B.map(i=>g.getRoot(i));return[Q,C,e]}function Yf(I,A,g){if(I.length!==g.length)throw new Error("Leaves length should equal gindices length");const B=g.map(o=>o.toString(2)),e=li(B,!1,bg.Decreasing);if(e.length!==A.length)throw new Error("Witnesses length should equal witnesses gindices length");const Q=Math.max(B[0]?.length??0,e[0]?.length??0),C=Object.fromEntries(Array.from({length:Q},(o,D)=>[D+1,{}]));for(let o=0;o<B.length;o++){const D=B[o],a=I[o];C[D.length][D]=qA.fromRoot(a)}for(let o=0;o<e.length;o++){const D=e[o],a=A[o];C[D.length][D]=qA.fromRoot(a)}for(let o=Q;o>1;o--){const D=C[o],a=C[o-1];for(const U of Object.keys(D)){const J=D[U];if(!J)continue;const f=U.at(-1)==="0",y=U.substring(0,U.length-1),S=y+(f?"1":"0"),R=D[S];if(!R)throw new Error(`Sibling not found: ${S}`);const N=f?new _A(J,R):new _A(R,J);a[y]=N,delete D[U],delete D[S]}}const i=C[1][1];if(!i)throw new Error("Internal consistency error: no root found");return i}function fi(I,A,g){if(!g.length||!g[0].startsWith(A))return[[],[]];if(A===g[0])return g.shift(),[[],[I.root]];const[B,e]=fi(I.left,`${A}0`,g),[Q,C]=fi(I.right,`${A}1`,g);return[[e.length].concat(B,Q),e.concat(C)]}function Si(I,A){if(!A.length)throw new Error("Proof must contain gt 0 leaves");if(A.length===1)return qA.fromRoot(A[0]);const g=I[0];return new _A(Si(I.slice(1,g),A.slice(0,g)),Si(I.slice(g),A.slice(g)))}function bf(I,A){return fi(I,"1",li(A.map(g=>g.toString(2))))}function Tf(I,A){return Si(I,A)}var ZA;(function(I){I.single="single",I.treeOffset="treeOffset",I.multi="multi",I.compactMulti="compactMulti"})(ZA||(ZA={})),ZA.single,ZA.treeOffset,ZA.multi,ZA.compactMulti;function pr(I,A){switch(A.type){case ZA.single:{const[g,B]=Rr(I,A.gindex);return{type:ZA.single,gindex:A.gindex,leaf:g,witnesses:B}}case ZA.treeOffset:{const[g,B]=bf(I,A.gindices);return{type:ZA.treeOffset,offsets:g,leaves:B}}case ZA.multi:{const[g,B,e]=Kf(I,A.gindices);return{type:ZA.multi,leaves:g,witnesses:B,gindices:e}}case ZA.compactMulti:{const g=kf(I,A.descriptor);return{type:ZA.compactMulti,leaves:g,descriptor:A.descriptor}}default:throw new Error("Invalid proof type")}}function qf(I){switch(I.type){case ZA.single:return Jf(I.gindex,I.leaf,I.witnesses);case ZA.treeOffset:return Tf(I.offsets,I.leaves);case ZA.multi:return Yf(I.leaves,I.witnesses,I.gindices);case ZA.compactMulti:return Ff(I.leaves,I.descriptor);default:throw new Error("Invalid proof type")}}function Vf(I,A,g){if(g<0)throw new Error(`Expect count to be non-negative, got ${g}`);return{finalized:(g>0?jf(A,g-1):[]).map(B=>kC(I,B).root),count:g}}function jf(I,A){if(A<0||I<0)throw new Error(`Expect index and depth to be non-negative, got ${A} and ${I}`);const g=Array.from({length:I+1},()=>0);let B=A+1;const e=[];for(;B>0;){const Q=Math.floor(Math.log2(B)),C=2**Q,i=I-Q,o=mg(i,BigInt(g[i]));e.push(o);for(let D=0;D<=Q;D++)g[i+D]+=Math.pow(2,D);B-=C}return e}const Tg=Symbol("ssz_cached_permanent_root");function wi(I,A,g,B){const e=B&&A.length===32&&g===0?A:B?A.subarray(g,g+32):Uint8Array.prototype.slice.call(A,g,g+32);I[Tg]=e}function _f(I,A){return sB.digest64(I,A)}function Sg(I){return I===0?0:Math.ceil(Math.log2(I))}function dI(I,A){return new Function("superClass",`return class ${A} extends superClass {}`)(I)}const yi=new Array(256);class wg{uint8Array;bitLen;constructor(A,g){if(this.uint8Array=A,this.bitLen=g,A.length!==Math.ceil(g/8))throw Error("BitArray uint8Array length does not match bitLen")}static fromBitLen(A){return new wg(new Uint8Array(Math.ceil(A/8)),A)}static fromSingleBit(A,g){const B=wg.fromBitLen(A);return B.set(g,!0),B}static fromBoolArray(A){const g=wg.fromBitLen(A.length);for(let B=0;B<A.length;B++)A[B]===!0&&g.set(B,!0);return g}clone(){return new wg(Uint8Array.prototype.slice.call(this.uint8Array,0),this.bitLen)}get(A){const g=Math.floor(A/8),B=1<<A%8;return(this.uint8Array[g]&B)===B}set(A,g){if(A>=this.bitLen)throw Error(`BitArray set bitIndex ${A} beyond bitLen ${this.bitLen}`);const B=Math.floor(A/8),e=1<<A%8;let Q=this.uint8Array[B];g?(Q|=e,this.uint8Array[B]=Q):(Q&e)===e&&(Q^=e,this.uint8Array[B]=Q)}mergeOrWith(A){if(A.bitLen!==this.bitLen)throw Error("Must merge BitArrays of same bitLen");for(let g=0;g<this.uint8Array.length;g++)this.uint8Array[g]=this.uint8Array[g]|A.uint8Array[g]}intersectValues(A){const g=[];if(A.length!==this.bitLen)throw Error(`Must not intersect values of length ${A.length} != bitLen ${this.bitLen}`);const B=Math.floor(this.bitLen/8),e=this.bitLen%8,Q=this.uint8Array;for(let C=0;C<B;C++){const i=dQ(Q[C]);for(let o=0;o<8;o++)i[o]&&g.push(A[C*8+o])}if(e>0){const C=dQ(Q[B]);for(let i=0;i<e;i++)C[i]&&g.push(A[B*8+i])}return g}getTrueBitIndexes(){const A=[],g=this.uint8Array;for(let B=0,e=g.length;B<e;B++){const Q=dQ(g[B]);for(let C=0;C<8;C++)Q[C]&&A.push(B*8+C)}return A}getSingleTrueBit(){let A=null;const g=this.uint8Array;for(let B=0,e=g.length;B<e;B++){if(g[B]===0)continue;const Q=dQ(g[B]);for(let C=0;C<8;C++)if(Q[C]===!0){if(A!==null)return null;A=B*8+C}}return A===null?null:A}toBoolArray(){const A=new Array(this.bitLen);for(let g=0;g<this.bitLen;g++)A[g]=this.get(g);return A}}function dQ(I){return yi[I]||(yi[I]=Zf(I)),yi[I]}function Zf(I){const A=I.toString(2),g=A.length,B=new Array(8);for(let e=0;e<8;e++)B[e]=e<g?A[g-e-1]==="1":!1;return B}function eg(I){return I.right.getUint(4,0)}function Hr(I){return I.left}function qg(I,A){return new _A(I,qA.fromUint32(A))}function Mr(I,A,g,B=0,e=null){const Q=g!==null?qA.fromUint32(g):I.right,C=new _A(A,Q);return e!==null&&ZI(e,B).push(A,Q,C),C}function NQ(I,A,g,B,e){const Q=I.byteLength;for(let C=0;C<A;C++)I.value_serializeToBytes(g,B+C*Q,e[C]);return B+A*Q}function mr(I,A,g,B,e){const Q=I.byteLength,C=(B-g)/Q;uQ(C,e,!0);const i=new Array(C);for(let o=0;o<C;o++)i[o]=I.value_deserializeFromBytes(A,g+o*Q,g+(o+1)*Q);return i}function di(I,A,g,B,e,Q,C=null){const i=I.byteLength*A,o=Math.ceil(i/32),D=C??tI(Q,g,0,o);return GC(B.dataView,e,i,D),e+i}function Lr(I,A,g,B,e,Q){const C=(e-B)/I.byteLength;uQ(C,Q,!0);const i=RC(A,g.dataView,B,e);return Q.isList?qg(i,C):i}function Pf(I,A,g){if(!Array.isArray(A))throw Error("JSON is not an array");uQ(A.length,g);const B=new Array(A.length);for(let e=0;e<A.length;e++)B[e]=I.fromJson(A[e]);return B}function Of(I,A,g){const B=g.isList?A.length:g.length,e=new Array(B);for(let Q=0;Q<B;Q++)e[Q]=I.toJson(A[Q]);return e}function xf(I,A){const g=new Array(A.length);for(let B=0;B<A.length;B++)g[B]=I.clone(A[B]);return g}function zf(I,A,g){if(A.length!==g.length)return!1;for(let B=0;B<A.length;B++)if(!I.equals(A[B],g[B]))return!1;return!0}function vf(I,A){const g=new Array(A);for(let B=0;B<A;B++)g[B]=I.defaultValue();return g}function uQ(I,A,g){if(g&&I%1!==0)throw Error("size not multiple of element fixedSize");if(A.isList){if(I>A.limit)throw new Error(`Invalid list length ${I} over limit ${A.limit}`)}else if(I!==A.length)throw new Error(`Incorrect vector length ${I} expected ${A.length}`)}const Ni=new Array(256);function Kr(I){let A="0x";for(const g of I)Ni[g]||(Ni[g]=g<16?`0${g.toString(16)}`:g.toString(16)),A+=Ni[g];return A}function Yr(I){if(typeof I!="string")throw new Error(`hex argument type ${typeof I} must be of type string`);if(I.startsWith("0x")&&(I=I.slice(2)),I.length%2!==0)throw new Error(`hex string length ${I.length} must be multiple of 2`);const A=I.length/2,g=new Uint8Array(A);for(let B=0;B<A;B++){const e=parseInt(I.slice(B*2,(B+1)*2),16);g[B]=e}return g}function ui(I,A){if(I.length!==A.length)return!1;for(let g=0;g<I.length;g++)if(I[g]!==A[g])return!1;return!0}class zB{serialize(){const A=new Uint8Array(this.type.tree_serializedSize(this.node)),g=new DataView(A.buffer,A.byteOffset,A.byteLength);return this.type.tree_serializeToBytes({uint8Array:A,dataView:g},0,this.node),A}hashTreeRoot(){return this.node.root}createProof(A){return this.type.tree_createProof(this.node,A)}toValue(){return this.type.tree_toValue(this.node)}clone(){return this.type.getView(new GI(this.node))}}class Wf extends zB{type;tree;bitArray;constructor(A,g){super(),this.type=A,this.tree=g,this.bitArray=A.tree_toValue(g.rootNode)}get node(){return this.tree.rootNode}get uint8Array(){return this.bitArray.uint8Array}get bitLen(){return this.bitArray.bitLen}get(A){return this.bitArray.get(A)}set(A,g){this.bitArray.set(A,g),this.tree.rootNode=this.type.value_toTree(this.bitArray)}mergeOrWith(A){this.bitArray.mergeOrWith(A)}intersectValues(A){return this.bitArray.intersectValues(A)}getTrueBitIndexes(){return this.bitArray.getTrueBitIndexes()}getSingleTrueBit(){return this.bitArray.getSingleTrueBit()}toBoolArray(){return this.bitArray.toBoolArray()}}const br=Symbol("ssz_cached_tree_root");class JC extends zB{serializeToBytes(A,g){return this.type.tree_serializeToBytes(A,g,this.node)}hashTreeRoot(){return this.commit(),super.hashTreeRoot()}batchHashTreeRoot(A=new Sf){A.reset(),this.commit(0,A.byLevel),A.clean();const g=this.node[br];if(g)return g;if(Uf(A.byLevel),this.node.h0===null)throw Error("Root is not computed by batch");const B=this.node.root;return this.node[br]=B,B}serialize(){this.commit();const A=new Uint8Array(this.type.tree_serializedSize(this.node)),g=new DataView(A.buffer,A.byteOffset,A.byteLength);return this.serializeToBytes({uint8Array:A,dataView:g},0),A}clone(A){if(A)return this.type.getViewDU(this.node);const g=this.cache;return this.clearCache(),this.type.getViewDU(this.node,g)}}class Xf extends JC{type;_rootNode;_bitArray=null;constructor(A,g){super(),this.type=A,this._rootNode=g}get node(){return this._rootNode}get cache(){}get uint8Array(){return this.bitArray.uint8Array}get bitLen(){return this.bitArray.bitLen}get bitArray(){return this._bitArray===null&&(this._bitArray=this.type.tree_toValue(this._rootNode)),this._bitArray}commit(A=0,g=null){this._bitArray!==null&&(this._rootNode=this.type.value_toTree(this._bitArray)),g!==null&&this._rootNode.h0===null&&iI(this._rootNode,A,g)}get(A){return this.bitArray.get(A)}set(A,g){this.bitArray.set(A,g)}mergeOrWith(A){this.bitArray.mergeOrWith(A)}intersectValues(A){return this.bitArray.intersectValues(A)}getTrueBitIndexes(){return this.bitArray.getTrueBitIndexes()}getSingleTrueBit(){return this.bitArray.getSingleTrueBit()}toBoolArray(){return this.bitArray.toBoolArray()}clearCache(){this._bitArray=null}}function Tr(I){return!I.isBasic}function RQ(I,A,g="",B=0){if(B===0){const i=A.tree_fromProofNode(I);if(i.done)return i.node;I=i.node}const e=A.depth===B;if(I.isLeaf()){if(e){const i=A.getIndexProperty(qr(g));if(i===null)return I;const o=A.getPropertyType(i);return o.maxChunkCount===1&&Tr(o)?o.tree_fromProofNode(I).node:I}return I}if(e){const i=A.getIndexProperty(qr(g));if(i===null)return I;const o=A.getPropertyType(i);if(!Tr(o))throw Error("BranchNode does not map to CompositeType");const D=o.tree_fromProofNode(I);return D.done?D.node:RQ(D.node,o)}const Q=RQ(I.left,A,`${g}0`,B+1),C=RQ(I.right,A,`${g}1`,B+1);return Q===I.left&&C===I.right?I:new _A(Q,C)}function qr(I){return I===""?0:parseInt(I,2)}class Vr{value_toTree(A){const g=new Uint8Array(this.value_serializedSize(A)),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return this.value_serializeToBytes({uint8Array:g,dataView:B},0,A),this.tree_deserializeFromBytes({uint8Array:g,dataView:B},0,g.length)}tree_toValue(A){const g=new Uint8Array(this.tree_serializedSize(A)),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return this.tree_serializeToBytes({uint8Array:g,dataView:B},0,A),this.value_deserializeFromBytes({uint8Array:g,dataView:B},0,g.length)}serialize(A){const g=new Uint8Array(this.value_serializedSize(A)),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return this.value_serializeToBytes({uint8Array:g,dataView:B},0,A),g}deserialize(A){const g=new DataView(A.buffer,A.byteOffset,A.byteLength);return this.value_deserializeFromBytes({uint8Array:A,dataView:g},0,A.length)}}const Ri=BigInt(3);class pC extends Vr{cachePermanentRootStruct;isBasic=!1;blocksBuffer=new Uint8Array(0);constructor(A){super(),this.cachePermanentRootStruct=A}defaultView(){return this.toView(this.defaultValue())}defaultViewDU(){return this.toViewDU(this.defaultValue())}deserializeToView(A){const g=new DataView(A.buffer,A.byteOffset,A.byteLength),B=this.tree_deserializeFromBytes({uint8Array:A,dataView:g},0,A.length);return this.getView(new GI(B))}deserializeToViewDU(A){const g=new DataView(A.buffer,A.byteOffset,A.byteLength),B=this.tree_deserializeFromBytes({uint8Array:A,dataView:g},0,A.length);return this.getViewDU(B)}toView(A){const g=this.value_toTree(A);return this.getView(new GI(g))}toViewDU(A){const g=this.value_toTree(A);return this.getViewDU(g)}toValueFromView(A){const g=this.commitView(A);return this.tree_toValue(g)}toValueFromViewDU(A){const g=this.commitViewDU(A);return this.tree_toValue(g)}toViewFromViewDU(A){const g=this.commitViewDU(A);return this.getView(new GI(g))}toViewDUFromView(A){const g=this.commitView(A);return this.getViewDU(g)}hashTreeRoot(A){if(this.cachePermanentRootStruct){const B=A[Tg];if(B)return B}const g=oB(32);return this.hashTreeRootInto(A,g,0,!0),g}hashTreeRootInto(A,g,B,e=!1){if(this.cachePermanentRootStruct){const C=A[Tg];if(C){g.set(C,B);return}}const Q=this.getBlocksBytes(A);xB(Q,this.maxChunkCount,g,B),this.cachePermanentRootStruct&&wi(A,g,B,e)}getCachedPermanentRoot(A){return A[Tg]}createFromProof(A,g){const B=GI.createFromProof(A).rootNode,e=RQ(B,this);if(g!==void 0&&!ui(e.root,g))throw new Error("Proof does not match trusted root");return this.getView(new GI(e))}tree_createProof(A,g){const B=this.tree_createProofGindexes(A,g);return pr(A,{type:ZA.treeOffset,gindices:B})}tree_createProofGindexes(A,g){const B=[];for(const e of g){const{type:Q,gindex:C}=this.getPathInfo(e);if(!NI(Q))B.push(C);else{const i=Q.tree_getLeafGindices(C,Q.fixedSize===null?kC(A,C):void 0);for(const o of i)B.push(o)}}return B}getPathInfo(A){const g=[];let B=this;for(const e of A){if(B.isBasic)throw new Error("Invalid path: cannot navigate beyond a basic type");const Q=B.getPropertyGindex(e);Q!==null&&(g.push(Q),B=B.getPropertyType(e))}return{type:B,gindex:yI(g)}}tree_fromProofNode(A){return{node:A,done:!1}}}function NI(I){return!I.isBasic}class jr extends pC{isViewMutable=!1;defaultValue(){return new Uint8Array(this.minSize)}getView(A){return this.getViewDU(A.rootNode)}getViewDU(A){return this.tree_toValue(A)}commitView(A){return this.commitViewDU(A)}commitViewDU(A,g=0,B=null){const e=new Uint8Array(this.value_serializedSize(A)),Q=new DataView(e.buffer,e.byteOffset,e.byteLength);this.value_serializeToBytes({uint8Array:e,dataView:Q},0,A);const C=this.tree_deserializeFromBytes({uint8Array:e,dataView:Q},0,e.length);return B!==null&&C.h0===null&&iI(C,g,B),C}cacheOfViewDU(){}toView(A){return A}toViewDU(A){return A}value_serializeToBytes(A,g,B){return A.uint8Array.set(B,g),g+B.length}value_deserializeFromBytes(A,g,B){return this.assertValidSize(B-g),Uint8Array.prototype.slice.call(A.uint8Array,g,B)}value_toTree(A){const g=new DataView(A.buffer,A.byteOffset,A.byteLength);return this.tree_deserializeFromBytes({uint8Array:A,dataView:g},0,A.length)}getBlocksBytes(A){if(A.length>this.blocksBuffer.length){const g=Math.ceil(A.length/32);this.blocksBuffer=new Uint8Array(Math.ceil(g/2)*64)}return _r(A,this.blocksBuffer)}getPropertyGindex(){return null}getPropertyType(){throw Error("Must only request ByteArray complete data")}getIndexProperty(){throw Error("Must only request ByteArray complete data")}tree_fromProofNode(A){return{node:A,done:!0}}tree_getLeafGindices(A,g){const B=this.tree_getByteLen(g),e=Math.ceil(B/32),Q=yI([A,mg(this.depth,BigInt(0))]),C=new Array(e);for(let i=0,o=Q;i<e;i++,o++)C[i]=o;return this.isList&&C.push(yI([A,Ri])),C}fromJson(A){const g=Yr(A);return this.assertValidSize(g.length),g}toJson(A){return Kr(A)}clone(A){return A}equals(A,g){return ui(A,g)}}function _r(I,A){if(I.length>A.length)throw new Error(`data length ${I.length} exceeds blocksBuffer length ${A.length}`);A.set(I);const g=I.length,B=Math.ceil(g/64)*64;return A.subarray(g,B).fill(0),A.subarray(0,B)}class Zr extends pC{isViewMutable=!0;getView(A){return new Wf(this,A)}getViewDU(A){return new Xf(this,A)}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}cacheOfViewDU(A){return A.cache}getBlocksBytes(A){if(A.uint8Array.length>this.blocksBuffer.length){const g=Math.ceil(A.bitLen/8/32);this.blocksBuffer=new Uint8Array(Math.ceil(g/2)*64)}return _r(A.uint8Array,this.blocksBuffer)}getPropertyGindex(){return null}getPropertyType(){throw Error("Must only request BitArray complete data")}getIndexProperty(){throw Error("Must only request BitArray complete data")}tree_fromProofNode(A){return{node:A,done:!0}}tree_getLeafGindices(A,g){const B=this.tree_getByteLen(g),e=Math.ceil(B/32),Q=yI([A,mg(this.depth,BigInt(0))]),C=new Array(e);for(let i=0,o=Q;i<e;i++,o++)C[i]=o;return this.isList&&C.push(yI([A,Ri])),C}fromJson(A){const g=Yr(A),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return this.value_deserializeFromBytes({uint8Array:g,dataView:B},0,g.length)}toJson(A){return Kr(this.serialize(A))}clone(A){return A.clone()}equals(A,g){return A.bitLen===g.bitLen&&ui(A.uint8Array,g.uint8Array)}}class GQ extends Zr{limitBits;typeName;depth;chunkDepth;fixedSize=null;minSize=1;maxSize;maxChunkCount;isList=!0;mixInLengthBlockBytes=new Uint8Array(64);mixInLengthBuffer=vA.from(this.mixInLengthBlockBytes.buffer,this.mixInLengthBlockBytes.byteOffset,this.mixInLengthBlockBytes.byteLength);constructor(A,g){if(super(),this.limitBits=A,A===0)throw Error("List limit must be > 0");this.typeName=g?.typeName??`BitList[${A}]`,this.maxChunkCount=Math.ceil(this.limitBits/8/32),this.chunkDepth=Sg(this.maxChunkCount),this.depth=1+this.chunkDepth,this.maxSize=Math.ceil(A/8)+1}static named(A,g){return new(dI(GQ,g.typeName))(A,g)}defaultValue(){return wg.fromBitLen(0)}value_serializedSize(A){return Pr(A.bitLen)}value_serializeToBytes(A,g,B){return A.uint8Array.set(B.uint8Array,g),Or(A.uint8Array,g,B.bitLen)}value_deserializeFromBytes(A,g,B){const{uint8Array:e,bitLen:Q}=this.deserializeUint8ArrayBitListFromBytes(A.uint8Array,g,B);return new wg(e,Q)}tree_serializedSize(A){return Pr(eg(A))}tree_serializeToBytes(A,g,B){const e=Hr(B),Q=eg(B),C=Math.ceil(Q/8),i=Math.ceil(C/32),o=tI(e,this.chunkDepth,0,i);return GC(A.dataView,g,C,o),Or(A.uint8Array,g,Q)}tree_deserializeFromBytes(A,g,B){const{uint8Array:e,bitLen:Q}=this.deserializeUint8ArrayBitListFromBytes(A.uint8Array,g,B),C=new DataView(e.buffer,e.byteOffset,e.byteLength),i=RC(this.chunkDepth,C,0,e.length);return qg(i,Q)}tree_getByteLen(A){if(!A)throw new Error("BitListType requires a node to get leaves");return Math.ceil(eg(A)/8)}hashTreeRoot(A){const g=oB(32);return this.hashTreeRootInto(A,g,0),g}hashTreeRootInto(A,g,B){super.hashTreeRootInto(A,this.mixInLengthBlockBytes,0),this.mixInLengthBuffer.writeUIntLE(A.bitLen,32,6),xB(this.mixInLengthBlockBytes,2,g,B)}deserializeUint8ArrayBitListFromBytes(A,g,B){const{uint8Array:e,bitLen:Q}=$f(A,g,B);if(Q>this.limitBits)throw Error(`bitLen over limit ${Q} > ${this.limitBits}`);return{uint8Array:e,bitLen:Q}}}function $f(I,A,g){if(g>I.length)throw Error(`BitList attempting to read byte ${g} of data length ${I.length}`);const B=I[g-1],e=g-A;if(B===0)throw new Error("Invalid deserialized bitlist, padding bit required");if(B===1){const D=Uint8Array.prototype.slice.call(I,A,g-1),a=(e-1)*8;return{uint8Array:D,bitLen:a}}const Q=Uint8Array.prototype.slice.call(I,A,g),C=B.toString(2).length-1,i=(e-1)*8+C,o=255>>8-C;return Q[e-1]&=o,{uint8Array:Q,bitLen:i}}function Pr(I){const A=Math.ceil(I/8);return I%8===0?A+1:A}function Or(I,A,g){const B=Math.ceil(g/8),e=A+B;return g%8===0?(I[e]=1,e+1):(I[e-1]|=1<<g%8,e)}class ig extends Zr{lengthBits;typeName;chunkCount;depth;fixedSize;minSize;maxSize;maxChunkCount;isList=!1;zeroBitsMask;constructor(A,g){if(super(),this.lengthBits=A,A===0)throw Error("Vector length must be > 0");this.typeName=g?.typeName??`BitVector[${A}]`,this.chunkCount=Math.ceil(this.lengthBits/8/32),this.maxChunkCount=this.chunkCount,this.depth=Sg(this.chunkCount),this.fixedSize=Math.ceil(this.lengthBits/8),this.minSize=this.fixedSize,this.maxSize=this.fixedSize,this.zeroBitsMask=A%8===0?0:255&255<<A%8}static named(A,g){return new(dI(ig,g.typeName))(A,g)}defaultValue(){return wg.fromBitLen(this.lengthBits)}value_serializedSize(){return this.fixedSize}value_serializeToBytes(A,g,B){return A.uint8Array.set(B.uint8Array,g),g+this.fixedSize}value_deserializeFromBytes(A,g,B){return this.assertValidLength(A.uint8Array,g,B),new wg(Uint8Array.prototype.slice.call(A.uint8Array,g,B),this.lengthBits)}tree_serializedSize(){return this.fixedSize}tree_serializeToBytes(A,g,B){const e=tI(B,this.depth,0,this.chunkCount);return GC(A.dataView,g,this.fixedSize,e),g+this.fixedSize}tree_deserializeFromBytes(A,g,B){return this.assertValidLength(A.uint8Array,g,B),RC(this.depth,A.dataView,g,B)}tree_getByteLen(){return this.fixedSize}assertValidLength(A,g,B){const e=B-g;if(B-g!==this.fixedSize)throw Error(`Invalid BitVector size ${e} != ${this.fixedSize}`);if(this.zeroBitsMask>0&&(A[B-1]&this.zeroBitsMask)>0)throw Error("BitVector: nonzero bits past length")}}class kQ extends Vr{isBasic=!0;depth=0;maxChunkCount=1;value_serializedSize(){return this.byteLength}tree_serializedSize(){return this.byteLength}assertValidSize(A){if(A!==this.byteLength)throw Error(`BasicType invalid size ${A} expected ${this.byteLength}`)}hashTreeRoot(A){const g=new Uint8Array(32);return this.hashTreeRootInto(A,g,0),g}hashTreeRootInto(A,g,B){const e=g.subarray(B,B+32);e.fill(0);const Q=new DataView(e.buffer,e.byteOffset,e.byteLength);this.value_serializeToBytes({uint8Array:e,dataView:Q},0,A)}clone(A){return A}equals(A,g){return A===g}}function Gi(I){return I.isBasic}class ki extends kQ{typeName;byteLength=1;itemsPerChunk=32;fixedSize=1;minSize=1;maxSize=1;constructor(A){super(),this.typeName=A?.typeName??"boolean"}static named(A){return new(dI(ki,A.typeName))(A)}defaultValue(){return!1}value_serializeToBytes(A,g,B){return A.uint8Array[g]=B?1:0,g+1}value_deserializeFromBytes(A,g,B){switch(this.assertValidSize(B-g),A.uint8Array[g]){case 1:return!0;case 0:return!1;default:throw new Error(`Boolean: invalid value: ${A.uint8Array[g]}`)}}tree_serializeToBytes(A,g,B){return A.uint8Array[g]=B.getUint(4,0),g+1}tree_deserializeFromBytes(A,g,B){this.assertValidSize(B-g);const e=A.uint8Array[g];if(e>1)throw Error(`Boolean: invalid value ${e}`);return qA.fromUint32(e)}tree_getFromNode(A){return A.getUint(4,0)===1}tree_setToNode(A,g){A.setUint(4,0,g?1:0)}tree_getFromPackedNode(A,g){const B=g%this.itemsPerChunk;return A.getUint(1,B)!==0}tree_setToPackedNode(A,g,B){const e=g%this.itemsPerChunk;A.setUint(1,e,B?1:0)}fromJson(A){if(typeof A!="boolean")throw Error(`JSON invalid type ${typeof A} expected boolean`);return A}toJson(A){return A}}class HC extends jr{limitBytes;typeName;depth;chunkDepth;fixedSize=null;minSize;maxSize;maxChunkCount;isList=!0;blockArray=[];blockBytesLen=0;mixInLengthBlockBytes=new Uint8Array(64);mixInLengthBuffer=vA.from(this.mixInLengthBlockBytes.buffer,this.mixInLengthBlockBytes.byteOffset,this.mixInLengthBlockBytes.byteLength);constructor(A,g){if(super(),this.limitBytes=A,A===0)throw Error("List limit must be > 0");this.typeName=g?.typeName??`ByteList[${A}]`,this.maxChunkCount=Math.ceil(this.limitBytes/32),this.chunkDepth=Sg(this.maxChunkCount),this.depth=1+this.chunkDepth,this.minSize=0,this.maxSize=this.limitBytes}static named(A,g){return new(dI(HC,g.typeName))(A,g)}value_serializedSize(A){return A.length}tree_serializedSize(A){return eg(A)}tree_serializeToBytes(A,g,B){const e=Hr(B),Q=eg(B),C=Math.ceil(Q/32),i=tI(e,this.chunkDepth,0,C);return GC(A.dataView,g,Q,i),g+Q}tree_deserializeFromBytes(A,g,B){this.assertValidSize(B-g);const e=RC(this.chunkDepth,A.dataView,g,B);return qg(e,B-g)}tree_getByteLen(A){if(!A)throw new Error("ByteListType requires a node to get leaves");return eg(A)}hashTreeRoot(A){const g=oB(32);return this.hashTreeRootInto(A,g,0),g}hashTreeRootInto(A,g,B){if(A.length>this.blockBytesLen){const Q=Math.ceil(A.length/64),C=Math.ceil(this.blockBytesLen/64),i=Q-C,o=new Uint8Array(i*64);for(let D=0;D<i;D++)this.blockArray.push(o.subarray(D*64,(D+1)*64)),this.blockBytesLen+=64}for(let Q=0;Q<A.length;Q+=64){const C=this.blockArray[Q/64];Q+64>A.length&&C.fill(0),C.set(A.subarray(Q,Math.min(Q+64,A.length)))}const e=Math.ceil(A.length/64);wr(this.blockArray,e,this.maxChunkCount,this.mixInLengthBlockBytes,0),this.mixInLengthBuffer.writeUIntLE(A.length,32,6),xB(this.mixInLengthBlockBytes,2,g,B)}assertValidSize(A){if(A>this.limitBytes)throw Error(`ByteList invalid size ${A} limit ${this.limitBytes}`)}}class kI extends jr{lengthBytes;typeName;depth;chunkDepth;fixedSize;minSize;maxSize;maxChunkCount;isList=!1;constructor(A,g){if(super(),this.lengthBytes=A,A===0)throw Error("Vector length must be > 0");this.typeName=g?.typeName??`ByteVector[${A}]`,this.maxChunkCount=Math.ceil(this.lengthBytes/32),this.chunkDepth=Sg(this.maxChunkCount),this.depth=this.chunkDepth,this.fixedSize=this.lengthBytes,this.minSize=this.fixedSize,this.maxSize=this.fixedSize}static named(A,g){return new(dI(kI,g.typeName))(A,g)}value_serializedSize(){return this.fixedSize}tree_serializedSize(){return this.fixedSize}tree_serializeToBytes(A,g,B){const e=tI(B,this.chunkDepth,0,this.maxChunkCount);return GC(A.dataView,g,this.fixedSize,e),g+this.fixedSize}tree_deserializeFromBytes(A,g,B){return this.assertValidSize(B-g),RC(this.chunkDepth,A.dataView,g,B)}tree_getByteLen(){return this.lengthBytes}assertValidSize(A){if(A!==this.lengthBytes)throw Error(`ByteVector invalid size ${A} expected ${this.lengthBytes}`)}}const xr={snake:I=>I.replace(/[^0-z]/g,"").replace(/[a-z][A-Z]|[0-9][A-Z]/g,A=>`${A[0]}_${A[1].toLowerCase()}`),constant:I=>I.replace(/[^0-z]/g,"").replace(/[a-z][A-Z]|[0-9][A-Z]/g,A=>`${A[0]}_${A[1]}`).toUpperCase(),pascal:I=>(I[0].toUpperCase()+I.slice(1)).replace(/[^0-z]/g,""),camel:I=>I[0].toLowerCase()+I.slice(1),header:I=>I[0].toUpperCase()+I.slice(1).replace(/[^0-z]/g,"").replace(/[a-z][A-Z]|[0-9][A-Z]/g,A=>`${A[0]}-${A[1]}`),eth2:I=>xr.snake(I).replace(/(\d)$/,"_$1")};let A2=class extends zB{type;tree;constructor(I,A){super(),this.type=I,this.tree=A}get node(){return this.tree.rootNode}};function I2(I){class A extends A2{}for(let g=0;g<I.fieldsEntries.length;g++){const{fieldName:B,fieldType:e}=I.fieldsEntries[g];if(Gi(e))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){const Q=YI(this.node,this.type.depth,g);return e.tree_getFromNode(Q)},set:function(Q){const C=YI(this.node,this.type.depth,g).clone();e.tree_setToNode(C,Q),this.tree.setNodeAtDepth(this.type.depth,g,C)}});else if(NI(e))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){const Q=ii(this.type.depth,g);return e.getView(this.tree.getSubtree(Q))},set:function(Q){const C=e.commitView(Q);this.tree.setNodeAtDepth(this.type.depth,g,C)}});else throw Error(`Unknown fieldType ${e.typeName} for fieldName ${String(B)}`)}return Object.defineProperty(A,"name",{value:I.typeName,writable:!1}),A}class g2 extends JC{type;_rootNode;nodes=[];caches;nodesChanged=new Set;viewsChanged=new Map;nodesPopulated;constructor(A,g,B){super(),this.type=A,this._rootNode=g,B?(this.nodes=B.nodes,this.caches=B.caches,this.nodesPopulated=B.nodesPopulated):(this.nodes=[],this.caches=[],this.nodesPopulated=!1)}get node(){return this._rootNode}get cache(){return{nodes:this.nodes,caches:this.caches,nodesPopulated:this.nodesPopulated}}commit(A=0,g=null){const B=this._rootNode.h0!==null;if(this.nodesChanged.size===0&&this.viewsChanged.size===0){!B&&g!==null&&iI(this._rootNode,A,g);return}const e=A+this.type.depth,Q=g!=null&&B?g:null,C=[];for(const[a,U]of this.viewsChanged){const J=this.type.fieldsEntries[a].fieldType,f=J.commitViewDU(U,e,Q);this.nodes[a]!==f&&(this.nodes[a]=f,C.push({index:a,node:f}));const y=J.cacheOfViewDU(U);y&&(this.caches[a]=y)}for(const a of this.nodesChanged)C.push({index:a,node:this.nodes[a]});const i=C.sort((a,U)=>a.index-U.index),{indexes:o,nodes:D}=this.parseNodesChanged(i);this._rootNode=FC(this._rootNode,this.type.depth,o,D,A,B?g:null),!B&&g!==null&&iI(this._rootNode,A,g),this.nodesChanged.clear(),this.viewsChanged.clear()}parseNodesChanged(A){const g=A.map(e=>e.index),B=A.map(e=>e.node);return{indexes:g,nodes:B}}clearCache(){this.nodes=[],this.caches=[],this.nodesPopulated=!1,this.nodesChanged.clear(),this.viewsChanged.clear()}}class B2 extends g2{type;_rootNode;constructor(A,g,B){super(A,g,B),this.type=A,this._rootNode=g}serializeToBytes(A,g){this.commit();let B=g,e=g+this.type.fixedEnd;for(let Q=0;Q<this.type.fieldsEntries.length;Q++){const{fieldType:C}=this.type.fieldsEntries[Q];let i=this.nodes[Q];if(i===void 0&&(i=YI(this._rootNode,this.type.depth,Q),this.nodes[Q]=i),C.fixedSize===null){if(A.dataView.setUint32(B,e-g,!0),B+=4,NI(C)){const o=C.getViewDU(i,this.caches[Q]);o.serializeToBytes!==void 0?e=o.serializeToBytes(A,e):e=C.tree_serializeToBytes(A,e,i)}}else B=C.tree_serializeToBytes(A,B,i)}return e}}function C2(I){class A extends B2{}for(let g=0;g<I.fieldsEntries.length;g++){const{fieldName:B,fieldType:e}=I.fieldsEntries[g];if(Gi(e))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){let Q=this.nodes[g];return Q===void 0&&(Q=YI(this._rootNode,this.type.depth,g),this.nodes[g]=Q),e.tree_getFromNode(Q)},set:function(Q){let C;this.nodesChanged.has(g)?C=this.nodes[g]:(C=(this.nodes[g]??YI(this._rootNode,this.type.depth,g)).clone(),this.nodes[g]=C,this.nodesChanged.add(g)),e.tree_setToNode(C,Q)}});else if(NI(e))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){const Q=this.viewsChanged.get(g);if(Q)return Q;let C=this.nodes[g];C===void 0&&(C=YI(this._rootNode,this.type.depth,g),this.nodes[g]=C);const i=e.getViewDU(C,this.caches[g]);return e.isViewMutable&&this.viewsChanged.set(g,i),i},set:function(Q){this.viewsChanged.set(g,Q)}});else throw Error(`Unknown fieldType ${e.typeName} for fieldName ${String(B)}`)}return Object.defineProperty(A,"name",{value:I.typeName,writable:!1}),A}class K extends pC{fields;opts;typeName;depth;maxChunkCount;fixedSize;minSize;maxSize;isList=!1;isViewMutable=!0;fieldsEntries;fixedEnd;fieldsGindex;jsonKeyToFieldName;isFixedLen;fieldRangesFixedLen;variableOffsetsPosition;TreeView;TreeViewDU;constructor(A,g){super(g?.cachePermanentRootStruct),this.fields=A,this.opts=g,this.typeName=g?.typeName??zr(A),this.maxChunkCount=Object.keys(A).length,this.depth=Sg(this.maxChunkCount),this.fieldsEntries=[];for(const U of Object.keys(A))this.fieldsEntries.push({fieldName:U,fieldType:this.fields[U],jsonKey:t2(U,g?.casingMap,g?.jsonCase),gindex:mg(this.depth,BigInt(this.fieldsEntries.length))});if(this.fieldsEntries.length===0)throw Error("Container must have > 0 fields");this.fieldsGindex={};for(let U=0;U<this.fieldsEntries.length;U++)this.fieldsGindex[this.fieldsEntries[U].fieldName]=mg(this.depth,BigInt(U));this.jsonKeyToFieldName={};for(const{fieldName:U,jsonKey:J}of this.fieldsEntries)this.jsonKeyToFieldName[J]=U;const{minLen:B,maxLen:e,fixedSize:Q}=i2(A);this.minSize=B,this.maxSize=e,this.fixedSize=Q;const{isFixedLen:C,fieldRangesFixedLen:i,variableOffsetsPosition:o,fixedEnd:D}=e2(A);this.isFixedLen=C,this.fieldRangesFixedLen=i,this.variableOffsetsPosition=o,this.fixedEnd=D,this.TreeView=g?.getContainerTreeViewClass?.(this)??I2(this),this.TreeViewDU=g?.getContainerTreeViewDUClass?.(this)??C2(this);const a=this.fieldsEntries.length*32;this.blocksBuffer=new Uint8Array(Math.ceil(a/64)*64)}static named(A,g){return new(dI(K,g.typeName))(A,g)}defaultValue(){const A={};for(const{fieldName:g,fieldType:B}of this.fieldsEntries)A[g]=B.defaultValue();return A}getView(A){return new this.TreeView(this,A)}getViewDU(A,g){return new this.TreeViewDU(this,A,g)}cacheOfViewDU(A){return A.cache}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}value_serializedSize(A){let g=0;for(let B=0;B<this.fieldsEntries.length;B++){const{fieldName:e,fieldType:Q}=this.fieldsEntries[B];g+=Q.fixedSize===null?4+Q.value_serializedSize(A[e]):Q.fixedSize}return g}value_serializeToBytes(A,g,B){let e=g,Q=g+this.fixedEnd;for(let C=0;C<this.fieldsEntries.length;C++){const{fieldName:i,fieldType:o}=this.fieldsEntries[C];o.fixedSize===null?(A.dataView.setUint32(e,Q-g,!0),e+=4,Q=o.value_serializeToBytes(A,Q,B[i])):e=o.value_serializeToBytes(A,e,B[i])}return Q}value_deserializeFromBytes(A,g,B){const e=this.getFieldRanges(A.dataView,g,B),Q={};for(let C=0;C<this.fieldsEntries.length;C++){const{fieldName:i,fieldType:o}=this.fieldsEntries[C],D=e[C];Q[i]=o.value_deserializeFromBytes(A,g+D.start,g+D.end)}return Q}tree_serializedSize(A){let g=0;const B=tI(A,this.depth,0,this.fieldsEntries.length);for(let e=0;e<this.fieldsEntries.length;e++){const{fieldType:Q}=this.fieldsEntries[e],C=B[e];g+=Q.fixedSize===null?4+Q.tree_serializedSize(C):Q.fixedSize}return g}tree_serializeToBytes(A,g,B){let e=g,Q=g+this.fixedEnd;const C=tI(B,this.depth,0,this.fieldsEntries.length);for(let i=0;i<this.fieldsEntries.length;i++){const{fieldType:o}=this.fieldsEntries[i],D=C[i];o.fixedSize===null?(A.dataView.setUint32(e,Q-g,!0),e+=4,Q=o.tree_serializeToBytes(A,Q,D)):e=o.tree_serializeToBytes(A,e,D)}return Q}tree_deserializeFromBytes(A,g,B){const e=this.getFieldRanges(A.dataView,g,B),Q=new Array(this.fieldsEntries.length);for(let C=0;C<this.fieldsEntries.length;C++){const{fieldType:i}=this.fieldsEntries[C],o=e[C];Q[C]=i.tree_deserializeFromBytes(A,g+o.start,g+o.end)}return uC(Q,this.depth)}getBlocksBytes(A){for(let g=0;g<this.fieldsEntries.length;g++){const{fieldName:B,fieldType:e}=this.fieldsEntries[g];e.hashTreeRootInto(A[B],this.blocksBuffer,g*32)}return this.blocksBuffer}getPropertyGindex(A){const g=this.fieldsGindex[A]??this.fieldsGindex[this.jsonKeyToFieldName[A]];if(g===void 0)throw Error(`Unknown container property ${A}`);return g}getPropertyType(A){const g=this.fields[A]??this.fields[this.jsonKeyToFieldName[A]];if(g===void 0)throw Error(`Unknown container property ${A}`);return g}getIndexProperty(A){return A>=this.fieldsEntries.length?null:this.fieldsEntries[A].fieldName}tree_getLeafGindices(A,g){const B=[];for(let e=0;e<this.fieldsEntries.length;e++){const{fieldName:Q,fieldType:C}=this.fieldsEntries[e],i=this.fieldsGindex[Q],o=yI([A,i]);if(C.isBasic)B.push(o);else{const D=C;if(C.fixedSize===null){if(!g)throw new Error("variable type requires tree argument to get leaves");B.push(...D.tree_getLeafGindices(o,kC(g,i)))}else B.push(...D.tree_getLeafGindices(o))}}return B}fromJson(A){if(typeof A!="object")throw Error("JSON must be of type object");if(A===null)throw Error("JSON must not be null");const g={};for(let B=0;B<this.fieldsEntries.length;B++){const{fieldName:e,fieldType:Q,jsonKey:C}=this.fieldsEntries[B],i=A[C];if(i===void 0)throw Error(`JSON expected key ${C} is undefined`);g[e]=Q.fromJson(i)}return g}toJson(A){const g={};for(let B=0;B<this.fieldsEntries.length;B++){const{fieldName:e,fieldType:Q,jsonKey:C}=this.fieldsEntries[B];g[C]=Q.toJson(A[e])}return g}clone(A){const g={};for(let B=0;B<this.fieldsEntries.length;B++){const{fieldName:e,fieldType:Q}=this.fieldsEntries[B];g[e]=Q.clone(A[e])}return g}equals(A,g){for(let B=0;B<this.fieldsEntries.length;B++){const{fieldName:e,fieldType:Q}=this.fieldsEntries[B];if(!Q.equals(A[e],g[e]))return!1}return!0}getFieldRanges(A,g,B){if(this.variableOffsetsPosition.length===0){const o=B-g;if(o!==this.fixedEnd)throw Error(`${this.typeName} size ${o} not equal fixed size ${this.fixedEnd}`);return this.fieldRangesFixedLen}const e=Q2(A,g,B,this.fixedEnd,this.variableOffsetsPosition);e.push(B-g);let Q=0,C=0;const i=new Array(this.isFixedLen.length);for(let o=0;o<this.isFixedLen.length;o++)this.isFixedLen[o]?i[o]=this.fieldRangesFixedLen[C++]:(i[o]={start:e[Q],end:e[Q+1]},Q++);return i}}function Q2(I,A,g,B,e){const Q=g-A,C=new Array(e.length);for(let i=0;i<e.length;i++){const o=I.getUint32(A+e[i],!0);if(o>Q)throw new Error(`Offset out of bounds ${o} > ${Q}`);if(i===0){if(o!==B)throw new Error(`First offset must equal to fixedEnd ${o} != ${B}`)}else if(o<C[i-1])throw new Error(`Offsets must be increasing ${o} < ${C[i-1]}`);C[i]=o}return C}function e2(I){const A=[],g=[],B=[];let e=0;for(const Q of Object.values(I))A.push(Q.fixedSize!==null),Q.fixedSize===null?(B.push(e),e+=4):(g.push({start:e,end:e+Q.fixedSize}),e+=Q.fixedSize);return{isFixedLen:A,fieldRangesFixedLen:g,variableOffsetsPosition:B,fixedEnd:e}}function i2(I){let A=0,g=0,B=0;for(const e of Object.values(I))A+=e.minSize,g+=e.maxSize,e.fixedSize===null?(A+=4,g+=4,B=null):B!==null&&(B+=e.fixedSize);return{minLen:A,maxLen:g,fixedSize:B}}function t2(I,A,g){if(A){const B=A[I];if(B===void 0)throw Error(`casingMap[${String(I)}] not defined`);return B}return g?xr[g](I):I}function zr(I,A="Container"){const g=Object.keys(I).map(B=>`${String(B)}: ${I[B].typeName}`).join(", ");return`${A}({${g}})`}class MC extends si{valueToNode;value;constructor(A,g){super(null,0,0,0,0,0,0,0),this.valueToNode=A,this.value=g}get rootHashObject(){if(this.h0===null){const A=this.valueToNode(this.value);super.applyHash(A.rootHashObject)}return this}get root(){return dC(this.rootHashObject)}get left(){return this.valueToNode(this.value).left}get right(){return this.valueToNode(this.value).right}isLeaf(){return!1}}class E2 extends zB{type;tree;constructor(A,g){super(),this.type=A,this.tree=g}get node(){return this.tree.rootNode}}function o2(I){class A extends E2{}for(let g=0;g<I.fieldsEntries.length;g++){const{fieldName:B,fieldType:e}=I.fieldsEntries[g];if(e.isBasic)Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){return this.tree.rootNode.value[B]},set:function(Q){const C=this.tree.rootNode,i=this.type.clone(C.value);i[B]=Q,this.tree.rootNode=new MC(C.valueToNode,i)}});else if(NI(e))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){const{value:Q}=this.tree.rootNode;return e.toView(Q[B])},set:function(Q){const C=this.tree.rootNode,i=this.type.clone(C.value);i[B]=e.toValueFromView(Q),this.tree.rootNode=new MC(C.valueToNode,i)}});else throw Error(`Unknown fieldType ${e.typeName} for fieldName ${String(B)}`)}return Object.defineProperty(A,"name",{value:I.typeName,writable:!1}),A}class r2 extends JC{type;valueChanged=null;_rootNode;constructor(A,g){super(),this.type=A,this._rootNode=g}get node(){return this._rootNode}get cache(){}get value(){return this.valueChanged??this._rootNode.value}commit(A,g=null){if(this.valueChanged!==null){const B=this.valueChanged;this.valueChanged=null,this._rootNode=this.type.value_toTree(B)}this._rootNode.h0===null&&g!==null&&this._rootNode.rootHashObject}clearCache(){this.valueChanged=null}}function n2(I){class A extends r2{}for(let g=0;g<I.fieldsEntries.length;g++){const{fieldName:B,fieldType:e}=I.fieldsEntries[g];if(e.isBasic)Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){return(this.valueChanged||this._rootNode.value)[B]},set:function(Q){this.valueChanged===null&&(this.valueChanged=this.type.clone(this._rootNode.value)),this.valueChanged[B]=Q}});else if(NI(e))Object.defineProperty(A.prototype,B,{configurable:!1,enumerable:!0,get:function(){const Q=this.valueChanged||this._rootNode.value;return e.toViewDU(Q[B])},set:function(Q){this.valueChanged===null&&(this.valueChanged=this.type.clone(this._rootNode.value));const C=e.toValueFromViewDU(Q);this.valueChanged[B]=C}});else throw Error(`Unknown fieldType ${e.typeName} for fieldName ${String(B)}`)}return Object.defineProperty(A,"name",{value:I.typeName,writable:!1}),A}class a2 extends K{fields;constructor(A,g){super(A,{typeName:g?.typeName??zr(A,"ContainerNodeStruct"),...g,getContainerTreeViewClass:o2,getContainerTreeViewDUClass:n2}),this.fields=A;for(const{fieldName:B,fieldType:e}of this.fieldsEntries)if(NI(e)&&e.isViewMutable)throw Error(`ContainerNodeStructType field '${String(B)}' ${e.typeName} view is mutable`)}static named(A,g){return new(dI(K,g.typeName))(A,g)}tree_serializedSize(A){return this.value_serializedSize(A.value)}tree_serializeToBytes(A,g,B){const{value:e}=B;return this.value_serializeToBytes(A,g,e)}tree_deserializeFromBytes(A,g,B){const e=this.value_deserializeFromBytes(A,g,B);return new MC(this.valueToTree.bind(this),e)}getPropertyGindex(){return null}tree_fromProofNode(A){const g=new Uint8Array(super.tree_serializedSize(A)),B=new DataView(g.buffer,g.byteOffset,g.byteLength);super.tree_serializeToBytes({uint8Array:g,dataView:B},0,A);const e=this.value_deserializeFromBytes({uint8Array:g,dataView:B},0,g.length);return{node:new MC(this.valueToTree.bind(this),e),done:!0}}tree_toValue(A){return A.value}value_toTree(A){return new MC(this.valueToTree.bind(this),A)}valueToTree(A){const g=new Uint8Array(this.value_serializedSize(A)),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return this.value_serializeToBytes({uint8Array:g,dataView:B},0,A),super.tree_deserializeFromBytes({uint8Array:g,dataView:B},0,g.length)}}class vr extends zB{type;tree;constructor(A,g){super(),this.type=A,this.tree=g}get length(){return this.type.tree_getLength(this.tree.rootNode)}get node(){return this.tree.rootNode}get(A){const g=Math.floor(A/this.type.itemsPerChunk),B=this.tree.getNodeAtDepth(this.type.depth,g);return this.type.elementType.tree_getFromPackedNode(B,A)}set(A,g){const B=this.length;if(A>=B)throw Error(`Error setting index over length ${A} > ${B}`);const e=Math.floor(A/this.type.itemsPerChunk),Q=this.tree.getNodeAtDepth(this.type.depth,e).clone();this.type.elementType.tree_setToPackedNode(Q,A,g),this.tree.setNodeAtDepth(this.type.depth,e,Q)}getAll(A){if(A&&A.length!==this.length)throw Error(`Expected ${this.length} values, got ${A.length}`);const g=this.length,B=this.type.tree_getChunksNode(this.node),e=Math.ceil(g/this.type.itemsPerChunk),Q=tI(B,this.type.chunkDepth,0,e);A=A??new Array(g);const C=this.type.itemsPerChunk,i=Math.floor(g/C),o=g%C;for(let D=0;D<i;D++){const a=Q[D];for(let U=0;U<C;U++)A[D*C+U]=this.type.elementType.tree_getFromPackedNode(a,U)}if(o>0){const D=Q[i];for(let a=0;a<o;a++)A[i*C+a]=this.type.elementType.tree_getFromPackedNode(D,a)}return A}}class s2 extends vr{type;tree;constructor(A,g){super(A,g),this.type=A,this.tree=g}push(A){const g=this.length;if(g>=this.type.limit)throw Error("Error pushing over limit");if(this.type.tree_setLength(this.tree,g+1),g%this.type.itemsPerChunk===0){const B=qA.fromZero();this.type.elementType.tree_setToPackedNode(B,g,A);const e=Math.floor(g/this.type.itemsPerChunk);this.tree.setNodeAtDepth(this.type.depth,e,B)}else this.set(g,A)}}class Wr extends JC{type;_rootNode;nodes;nodesChanged=new Set;_length;dirtyLength=!1;nodesPopulated;constructor(A,g,B){super(),this.type=A,this._rootNode=g,B?(this.nodes=B.nodes,this._length=B.length,this.nodesPopulated=B.nodesPopulated):(this.nodes=[],this._length=this.type.tree_getLength(g),this.nodesPopulated=!1)}get length(){return this._length}get node(){return this._rootNode}get cache(){return{nodes:this.nodes,length:this._length,nodesPopulated:this.nodesPopulated}}get(A){const g=Math.floor(A/this.type.itemsPerChunk);let B=this.nodes[g];return B===void 0&&(B=YI(this._rootNode,this.type.depth,g),this.nodes[g]=B),this.type.elementType.tree_getFromPackedNode(B,A)}set(A,g){if(A>=this._length)throw Error(`Error setting index over length ${A} > ${this._length}`);const B=Math.floor(A/this.type.itemsPerChunk);let e;this.nodesChanged.has(B)?e=this.nodes[B]:(e=(this.nodes[B]??YI(this._rootNode,this.type.depth,B)).clone(),this.nodes[B]=e,this.nodesChanged.add(B)),this.type.elementType.tree_setToPackedNode(e,A,g)}getAll(A){if(A&&A.length!==this._length)throw Error(`Expected ${this._length} values, got ${A.length}`);if(!this.nodesPopulated){const Q=this.nodes,C=this.type.tree_getChunksNode(this.node),i=Math.ceil(this._length/this.type.itemsPerChunk);this.nodes=tI(C,this.type.chunkDepth,0,i);for(const o of this.nodesChanged)this.nodes[o]=Q[o];this.nodesPopulated=!0}A=A??new Array(this._length);const g=this.type.itemsPerChunk,B=Math.floor(this._length/g),e=this._length%g;for(let Q=0;Q<B;Q++){const C=this.nodes[Q];for(let i=0;i<g;i++)A[Q*g+i]=this.type.elementType.tree_getFromPackedNode(C,i)}if(e>0){const Q=this.nodes[B];for(let C=0;C<e;C++)A[B*g+C]=this.type.elementType.tree_getFromPackedNode(Q,C)}return A}commit(A=0,g=null){const B=this._rootNode.h0!==null;if(this.nodesChanged.size===0){!B&&g!==null&&iI(this._rootNode,A,g);return}const e=Array.from(this.nodesChanged.keys()).sort((a,U)=>a-U),Q=new Array(e.length);for(let a=0;a<e.length;a++)Q[a]=this.nodes[e[a]];const C=this.type.tree_getChunksNode(this._rootNode),i=A+this.type.tree_chunksNodeOffset(),o=g!=null&&B?g:null,D=FC(C,this.type.chunkDepth,e,Q,i,o);this._rootNode=this.type.tree_setChunksNode(this._rootNode,D,this.dirtyLength?this._length:null,A,B?g:null),!B&&g!==null&&iI(this._rootNode,A,g),this.nodesChanged.clear(),this.dirtyLength=!1}clearCache(){this.nodes=[],this.nodesPopulated=!1,this.nodesChanged.clear(),this.dirtyLength&&(this._length=this.type.tree_getLength(this._rootNode),this.dirtyLength=!1)}}class h2 extends Wr{type;_rootNode;constructor(A,g,B){super(A,g,B),this.type=A,this._rootNode=g}push(A){if(this._length>=this.type.limit)throw Error("Error pushing over limit");this.dirtyLength=!0;const g=this._length++;if(g%this.type.itemsPerChunk===0){const B=Math.floor(g/this.type.itemsPerChunk);this.nodes[B]=Yg(0)}this.set(g,A)}sliceTo(A){if(A<0)throw new Error(`Does not support sliceTo() with negative index ${A}`);if(this.commit(),A>=this._length-1)return this;const g=this._rootNode,B=Math.floor(A/this.type.itemsPerChunk),e=this.nodes[B]??YI(g,this.type.depth,B),Q=qA.fromZero();for(let a=B*this.type.itemsPerChunk;a<=A;a++){const U=this.type.elementType.tree_getFromPackedNode(e,a);this.type.elementType.tree_setToPackedNode(Q,a,U)}const C=this.type.tree_getChunksNode(this._rootNode);let i=FC(C,this.type.chunkDepth,[B],[Q]);i=Fr(i,this.type.chunkDepth,B);const o=A+1,D=this.type.tree_setChunksNode(g,i,o);return this.type.getViewDU(D)}serializeToBytes(A,g){this.commit();const{nodes:B,nodesPopulated:e}=this.cache,Q=this.type.tree_getChunksNode(this._rootNode);return di(this.type.elementType,this._length,this.type.chunkDepth,A,g,Q,e?B:null)}}class FQ extends pC{elementType;constructor(A,g){super(g),this.elementType=A}defaultValue(){return vf(this.elementType,this.defaultLen)}getPropertyType(){return this.elementType}getPropertyGindex(A){if(typeof A!="number")throw Error(`Invalid array index: ${A}`);const g=Math.floor(A/this.itemsPerChunk);return mg(this.depth,BigInt(g))}getIndexProperty(A){return A}tree_getLeafGindices(A,g){let B;if(this.isList){if(!g)throw new Error("List type requires tree argument to get leaves");B=this.tree_getLength(g)}else B=this.tree_getLength(null);const e=[];if(NI(this.elementType)){const Q=mg(this.depth,BigInt(0)),C=Q+BigInt(B),i=yI([A,Q]);if(this.elementType.fixedSize===null){if(!g)throw new Error("Array of variable size requires tree argument to get leaves");for(let o=Q,D=i;o<C;o++,D++)e.push(...this.elementType.tree_getLeafGindices(D,kC(g,o)))}else for(let o=0,D=i;o<B;o++,D++)e.push(...this.elementType.tree_getLeafGindices(D))}else{const Q=Math.ceil(B/this.itemsPerChunk),C=yI([A,mg(this.depth,BigInt(0))]),i=C+BigInt(Q);for(let o=C;o<i;o++)e.push(o)}return this.isList&&e.push(yI([A,Ri])),e}fromJson(A){return Pf(this.elementType,A,this)}toJson(A){return Of(this.elementType,A,this)}clone(A){return xf(this.elementType,A)}equals(A,g){return zf(this.elementType,A,g)}}class bI extends FQ{elementType;limit;typeName;itemsPerChunk;depth;chunkDepth;maxChunkCount;fixedSize=null;minSize;maxSize;isList=!0;isViewMutable=!0;mixInLengthBlockBytes=new Uint8Array(64);mixInLengthBuffer=vA.from(this.mixInLengthBlockBytes.buffer,this.mixInLengthBlockBytes.byteOffset,this.mixInLengthBlockBytes.byteLength);defaultLen=0;constructor(A,g,B){if(super(A,B?.cachePermanentRootStruct),this.elementType=A,this.limit=g,!A.isBasic)throw Error("elementType must be basic");if(g===0)throw Error("List limit must be > 0");this.typeName=B?.typeName??`List[${A.typeName}, ${g}]`,this.itemsPerChunk=32/A.byteLength,this.maxChunkCount=Math.ceil(this.limit*A.byteLength/32),this.chunkDepth=Sg(this.maxChunkCount),this.depth=this.chunkDepth+1,this.minSize=0,this.maxSize=this.limit*A.maxSize}static named(A,g,B){return new(dI(bI,B.typeName))(A,g,B)}getView(A){return new s2(this,A)}getViewDU(A,g){return new h2(this,A,g)}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}cacheOfViewDU(A){return A.cache}value_serializedSize(A){return A.length*this.elementType.byteLength}value_serializeToBytes(A,g,B){return NQ(this.elementType,B.length,A,g,B)}value_deserializeFromBytes(A,g,B){return mr(this.elementType,A,g,B,this)}tree_serializedSize(A){return this.tree_getLength(A)*this.elementType.byteLength}tree_serializeToBytes(A,g,B){const e=this.tree_getChunksNode(B),Q=this.tree_getLength(B);return di(this.elementType,Q,this.chunkDepth,A,g,e)}tree_deserializeFromBytes(A,g,B){return Lr(this.elementType,this.chunkDepth,A,g,B,this)}tree_getLength(A){return A.right.getUint(4,0)}tree_setLength(A,g){A.rootNode=qg(A.rootNode.left,g)}tree_getChunksNode(A){return A.left}tree_chunksNodeOffset(){return 1}tree_setChunksNode(A,g,B,e=0,Q=null){return Mr(A,g,B,e,Q)}hashTreeRoot(A){if(this.cachePermanentRootStruct){const B=A[Tg];if(B)return B}const g=oB(32);return this.hashTreeRootInto(A,g,0,!0),g}hashTreeRootInto(A,g,B,e=!1){if(this.cachePermanentRootStruct){const Q=A[Tg];if(Q){g.set(Q,B);return}}super.hashTreeRootInto(A,this.mixInLengthBlockBytes,0),this.mixInLengthBuffer.writeUIntLE(A.length,32,6),xB(this.mixInLengthBlockBytes,2,g,B),this.cachePermanentRootStruct&&wi(A,g,B,e)}getBlocksBytes(A){const g=this.value_serializedSize(A),B=Math.ceil(g/64)*64;g>this.blocksBuffer.length&&(this.blocksBuffer=new Uint8Array(B));const e=this.blocksBuffer.subarray(0,B),Q=e.subarray(0,g),C=new DataView(Q.buffer,Q.byteOffset,Q.byteLength);return NQ(this.elementType,A.length,{uint8Array:Q,dataView:C},0,A),this.blocksBuffer.subarray(g,B).fill(0),e}}class Xr extends zB{type;tree;constructor(A,g){super(),this.type=A,this.tree=g}get length(){return this.type.tree_getLength(this.tree.rootNode)}get node(){return this.tree.rootNode}get(A){const g=ii(this.type.depth,A),B=this.tree.getSubtree(g);return this.type.elementType.getView(B)}getReadonly(A){const g=ii(this.type.depth,A),B=new GI(this.tree.getNode(g));return this.type.elementType.getView(B)}set(A,g){const B=this.length;if(A>=B)throw Error(`Error setting index over length ${A} > ${B}`);const e=this.type.elementType.commitView(g);this.tree.setNodeAtDepth(this.type.depth,A,e)}getAllReadonly(A){if(A&&A.length!==this.length)throw Error(`Expected ${this.length} views, got ${A.length}`);const g=this.length,B=this.type.tree_getChunksNode(this.node),e=tI(B,this.type.chunkDepth,0,g);A=A??new Array(g);for(let Q=0;Q<g;Q++)A[Q]=this.type.elementType.getView(new GI(e[Q]));return A}getAllReadonlyValues(A){if(A&&A.length!==this.length)throw Error(`Expected ${this.length} values, got ${A.length}`);const g=this.length,B=this.type.tree_getChunksNode(this.node),e=tI(B,this.type.chunkDepth,0,g);A=A??new Array(g);for(let Q=0;Q<g;Q++)A[Q]=this.type.elementType.tree_toValue(e[Q]);return A}}class l2 extends Xr{type;tree;constructor(A,g){super(A,g),this.type=A,this.tree=g}push(A){const g=this.length;if(g>=this.type.limit)throw Error("Error pushing over limit");this.type.tree_setLength(this.tree,g+1),this.set(g,A)}}function c2(I,A){return I.fixedSize===null?A*(4+I.minSize):A*I.minSize}function $r(I,A){return I.fixedSize===null?A*(4+I.maxSize):A*I.maxSize}function An(I,A,g){if(I.fixedSize===null){let B=0;for(let e=0;e<A;e++)B+=4+I.value_serializedSize(g[e]);return B}return A*I.fixedSize}function In(I,A,g,B,e){if(I.fixedSize===null){let Q=B+A*4;for(let C=0;C<A;C++)g.dataView.setUint32(B+C*4,Q-B,!0),Q=I.value_serializeToBytes(g,Q,e[C]);return Q}for(let Q=0;Q<A;Q++)I.value_serializeToBytes(g,B+Q*I.fixedSize,e[Q]);return B+A*I.fixedSize}function gn(I,A,g,B,e){const Q=Qn(I.fixedSize,A.dataView,g,B,e),C=Q.length,i=new Array(C);for(let o=0;o<C;o++){const D=g+Q[o],a=o===C-1?B:g+Q[o+1];i[o]=I.value_deserializeFromBytes(A,D,a)}return i}function Bn(I,A,g,B){if(I.fixedSize===null){const e=tI(B,g,0,A);let Q=0;for(let C=0;C<e.length;C++)Q+=4+I.tree_serializedSize(e[C]);return Q}return A*I.fixedSize}function Fi(I,A,g,B,e,Q,C=null){const i=C??tI(B,g,0,A);if(I.fixedSize===null){let o=Q+A*4;const{dataView:D}=e;for(let a=0;a<i.length;a++)D.setUint32(Q+a*4,o-Q,!0),o=I.tree_serializeToBytes(e,o,i[a]);return o}for(let o=0;o<i.length;o++)Q=I.tree_serializeToBytes(e,Q,i[o]);return Q}function Cn(I,A,g,B,e,Q){const C=Qn(I.fixedSize,g.dataView,B,e,Q),i=C.length,o=new Array(i);for(let a=0;a<i;a++){const U=B+C[a],J=a===i-1?e:B+C[a+1];o[a]=I.tree_deserializeFromBytes(g,U,J)}const D=uC(o,A);return Q.isList?qg(D,i):D}function D2(I,A,g,B){const e=Math.ceil(A/2)*64;if(e>B.length)throw new Error(`blocksBuffer is too small: ${B.length} < ${e}`);const Q=B.subarray(0,e);for(let C=0;C<A;C++)I.hashTreeRootInto(g[C],Q,C*32);return A%2===1&&Q.subarray(A*32,e).fill(0),Q}function Qn(I,A,g,B,e){const Q=B-g;let C;if(I===null)C=U2(A,g,Q);else{if(I===0)throw Error("element fixed length is 0");if(Q%I!==0)throw Error(`size ${Q} is not multiple of element fixedSize ${I}`);const i=Q/I;C=new Uint32Array(i);for(let o=0;o<i;o++)C[o]=o*I}return uQ(C.length,e),C}function U2(I,A,g){if(g===0)return new Uint32Array(0);const B=I.getUint32(A,!0),e=B;if(B===0)throw Error("First offset must be > 0");if(e%4!==0)throw Error("Offset data length not multiple of 4");const Q=e/4,C=new Uint32Array(Q);C[0]=B;for(let i=1;i<Q;i++){const o=I.getUint32(A+i*4,!0);if(C[i]=o,o>g)throw new Error(`Offset out of bounds ${o} > ${g}`);if(o<C[i-1])throw new Error(`Offsets must be increasing ${o} < ${C[i-1]}`)}return C}function f2(I){return{finalized:[],count:0,root:_f(OB(I),OB(0))}}class en extends JC{type;_rootNode;nodes;caches;viewsChanged=new Map;_length;dirtyLength=!1;nodesPopulated;constructor(A,g,B){super(),this.type=A,this._rootNode=g,B?(this.nodes=B.nodes,this.caches=B.caches,this._length=B.length,this.nodesPopulated=B.nodesPopulated):(this.nodes=[],this.caches=[],this._length=this.type.tree_getLength(g),this.nodesPopulated=this._length===0)}get length(){return this._length}get node(){return this._rootNode}get cache(){return{nodes:this.nodes,caches:this.caches,length:this._length,nodesPopulated:this.nodesPopulated}}get(A){const g=this.viewsChanged.get(A);if(g)return g;let B=this.nodes[A];B===void 0&&(B=YI(this._rootNode,this.type.depth,A),this.nodes[A]=B);const e=this.type.elementType.getViewDU(B,this.caches[A]);return this.type.elementType.isViewMutable&&this.viewsChanged.set(A,e),e}getReadonly(A){const g=this.viewsChanged.get(A);if(g)return g;let B=this.nodes[A];return B===void 0&&(B=YI(this._rootNode,this.type.depth,A),this.nodes[A]=B),this.type.elementType.getViewDU(B,this.caches[A])}set(A,g){if(A>=this._length)throw Error(`Error setting index over length ${A} > ${this._length}`);this.viewsChanged.set(A,g)}getAllReadonly(A){if(A&&A.length!==this._length)throw Error(`Expected ${this._length} views, got ${A.length}`);this.populateAllOldNodes(),A=A??new Array(this._length);for(let g=0;g<this._length;g++)A[g]=this.getReadonly(g);return A}forEach(A){this.populateAllOldNodes();for(let g=0;g<this._length;g++)A(this.getReadonly(g),g)}getAllReadonlyValues(A){if(A&&A.length!==this._length)throw Error(`Expected ${this._length} values, got ${A.length}`);this.populateAllNodes(),A=A??new Array(this._length);for(let g=0;g<this._length;g++)A[g]=this.type.elementType.tree_toValue(this.nodes[g]);return A}forEachValue(A){this.populateAllNodes();for(let g=0;g<this._length;g++)A(this.type.elementType.tree_toValue(this.nodes[g]),g)}getReadonlyByRange(A,g){if(A<0)throw Error(`Error getting by range, startIndex < 0: ${A}`);if(g<=0)throw Error(`Error getting by range, count <= 0: ${g}`);const B=this.dirtyLength?this.type.tree_getLength(this._rootNode):this._length;if(A>=B)throw Error(`Error getting by range, startIndex >= length: ${A} >= ${B}`);g=Math.min(g,B-A);let e=!0;for(let C=A;C<A+g;C++)if(this.nodes[C]==null){e=!1;break}if(!e){const C=tI(this._rootNode,this.type.depth,A,g);for(const[i,o]of C.entries())this.nodes[A+i]=o}const Q=new Array(g);for(let C=0;C<g;C++)Q[C]=this.getReadonly(A+C);return Q}commit(A=0,g=null){const B=this._rootNode.h0!==null;if(this.viewsChanged.size===0){!B&&g!==null&&iI(this._rootNode,A,g);return}const e=A+this.type.depth,Q=g!=null&&B?g:null,C=[];for(const[y,S]of this.viewsChanged){const R=this.type.elementType.commitViewDU(S,e,Q);this.nodes[y]!==R&&(this.nodes[y]=R,C.push({index:y,node:R}));const N=this.type.elementType.cacheOfViewDU(S);N&&(this.caches[y]=N)}const i=C.sort((y,S)=>y.index-S.index),o=i.map(y=>y.index),D=i.map(y=>y.node),a=this.type.tree_getChunksNode(this._rootNode),U=A+this.type.tree_chunksNodeOffset(),J=g!=null&&B?g:null,f=FC(a,this.type.chunkDepth,o,D,U,J);this._rootNode=this.type.tree_setChunksNode(this._rootNode,f,this.dirtyLength?this._length:null,A,g),!B&&g!==null&&iI(this._rootNode,A,g),this.viewsChanged.clear(),this.dirtyLength=!1}clearCache(){this.nodes=[],this.caches=[],this.nodesPopulated=!1,this.viewsChanged.clear(),this.dirtyLength&&(this._length=this.type.tree_getLength(this._rootNode),this.dirtyLength=!1)}populateAllNodes(){if(this.viewsChanged.size>0)throw Error("Must commit changes before reading all nodes");this.nodesPopulated||(this.nodes=tI(this._rootNode,this.type.depth,0,this.length),this.nodesPopulated=!0)}populateAllOldNodes(){if(!this.nodesPopulated){const A=this.dirtyLength?this.type.tree_getLength(this._rootNode):this._length;this.nodes=tI(this._rootNode,this.type.depth,0,A),this.nodesPopulated=!0}}}class S2 extends en{type;_rootNode;constructor(A,g,B){super(A,g,B),this.type=A,this._rootNode=g}push(A){if(this._length>=this.type.limit)throw Error("Error pushing over limit");this.dirtyLength=!0;const g=this._length++;this.set(g,A)}sliceTo(A){this.commit();const g=this._rootNode,B=this._length;if(A>=B-1)return this;const e=this.type.tree_getChunksNode(g),Q=Fr(e,this.type.chunkDepth,A),C=A+1,i=this.type.tree_setChunksNode(g,Q,C);return this.rootNodeToViewDU(i)}sliceFrom(A){if(this.commit(),this.populateAllNodes(),A<0&&(A+=this.nodes.length),A<=0)return this;let g,B;if(A>=this.nodes.length)g=Yg(this.type.chunkDepth),B=0;else{const Q=this.nodes.slice(A);g=uC(Q,this.type.chunkDepth),B=Q.length}const e=this.type.tree_setChunksNode(this._rootNode,g,B);return this.rootNodeToViewDU(e)}toSnapshot(A){if(this.commit(),A<0||A>this._length)throw Error(`Invalid count ${A}, length is ${this._length}`);if(A===0)return f2(this.type.chunkDepth);const g=this.sliceTo(A-1)._rootNode,B=this.type.tree_getChunksNode(g);return{...Vf(B,this.type.chunkDepth,A),root:g.root}}serializeToBytes(A,g){this.commit(),this.populateAllNodes();const B=this.type.tree_getChunksNode(this._rootNode);return Fi(this.type.elementType,this._length,this.type.chunkDepth,B,A,g,this.nodes)}rootNodeToViewDU(A){return this.type.getViewDU(A)}}class wA extends FQ{elementType;limit;typeName;itemsPerChunk=1;depth;chunkDepth;maxChunkCount;fixedSize=null;minSize;maxSize;isList=!0;isViewMutable=!0;blockArray=[];mixInLengthBlockBytes=new Uint8Array(64);mixInLengthBuffer=vA.from(this.mixInLengthBlockBytes.buffer,this.mixInLengthBlockBytes.byteOffset,this.mixInLengthBlockBytes.byteLength);defaultLen=0;constructor(A,g,B){if(super(A,B?.cachePermanentRootStruct),this.elementType=A,this.limit=g,A.isBasic)throw Error("elementType must not be basic");if(g===0)throw Error("List limit must be > 0");this.typeName=B?.typeName??`List[${A.typeName}, ${g}]`,this.maxChunkCount=this.limit,this.chunkDepth=Sg(this.maxChunkCount),this.depth=this.chunkDepth+1,this.minSize=0,this.maxSize=$r(A,this.limit)}static named(A,g,B){return new(dI(wA,B.typeName))(A,g,B)}getView(A){return new l2(this,A)}getViewDU(A,g){return new S2(this,A,g)}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}cacheOfViewDU(A){return A.cache}value_serializedSize(A){return An(this.elementType,A.length,A)}value_serializeToBytes(A,g,B){return In(this.elementType,B.length,A,g,B)}value_deserializeFromBytes(A,g,B){return gn(this.elementType,A,g,B,this)}tree_serializedSize(A){const g=this.tree_getChunksNode(A),B=this.tree_getLength(A);return Bn(this.elementType,B,this.chunkDepth,g)}tree_serializeToBytes(A,g,B){const e=this.tree_getChunksNode(B),Q=this.tree_getLength(B);return Fi(this.elementType,Q,this.chunkDepth,e,A,g)}tree_deserializeFromBytes(A,g,B){return Cn(this.elementType,this.chunkDepth,A,g,B,this)}tree_getLength(A){return eg(A)}tree_setLength(A,g){A.rootNode=qg(A.rootNode.left,g)}tree_getChunksNode(A){return A.left}tree_chunksNodeOffset(){return 1}tree_setChunksNode(A,g,B,e=0,Q=null){return Mr(A,g,B,e,Q)}hashTreeRoot(A){if(this.cachePermanentRootStruct){const B=A[Tg];if(B)return B}const g=oB(32);return this.hashTreeRootInto(A,g,0,!0),g}hashTreeRootInto(A,g,B,e=!1){if(this.cachePermanentRootStruct){const C=A[Tg];if(C){g.set(C,B);return}}if(A.length>this.blockArray.length){const C=A.length-this.blockArray.length,i=new Uint8Array(C*64);for(let o=0;o<C;o++)this.blockArray.push(i.subarray(o*64,(o+1)*64))}for(let C=0;C<A.length;C++){const i=this.blockArray[Math.floor(C/2)],o=C%2===0?0:32;this.elementType.hashTreeRootInto(A[C],i,o)}const Q=Math.ceil(A.length/2);A.length%2===1&&this.blockArray[Q-1].fill(0,32),wr(this.blockArray,Q,this.maxChunkCount,this.mixInLengthBlockBytes,0),this.mixInLengthBuffer.writeUIntLE(A.length,32,6),xB(this.mixInLengthBlockBytes,2,g,B),this.cachePermanentRootStruct&&wi(A,g,B,e)}getBlocksBytes(){throw Error("getBlockBytes should not be called for ListCompositeType")}}const w2=BigInt(Number.MAX_SAFE_INTEGER),Ji=BigInt(2)**BigInt(64),y2=BigInt(2)**BigInt(128),d2=BigInt(2)**BigInt(192),tn=2**32,En=4294967295;class tg extends kQ{byteLength;typeName;itemsPerChunk;fixedSize;minSize;maxSize;maxDecimalStr;clipInfinity;setBitwiseOR;constructor(A,g){if(super(),this.byteLength=A,A>8)throw Error("UintNumber byteLength limit is 8");if(Math.log2(A)%1!==0)throw Error("byteLength must be a power of 2");this.typeName=g?.typeName??`uint${A*8}`,g?.clipInfinity&&(this.typeName+="Inf"),g?.setBitwiseOR&&(this.typeName+="OR"),this.itemsPerChunk=32/this.byteLength,this.fixedSize=A,this.minSize=A,this.maxSize=A,this.maxDecimalStr=(BigInt(2)**BigInt(this.byteLength*8)-BigInt(1)).toString(10),this.clipInfinity=g?.clipInfinity===!0,this.setBitwiseOR=g?.setBitwiseOR===!0}static named(A,g){return new(dI(tg,g.typeName))(A,g)}defaultValue(){return 0}value_serializeToBytes({dataView:A},g,B){switch(this.byteLength){case 1:A.setInt8(g,B);break;case 2:A.setUint16(g,B,!0);break;case 4:A.setUint32(g,B,!0);break;case 8:B===1/0?(A.setUint32(g,4294967295),A.setUint32(g+4,4294967295)):(A.setUint32(g,B&4294967295,!0),A.setUint32(g+4,B/tn&4294967295,!0));break}return g+this.byteLength}value_deserializeFromBytes({dataView:A},g,B){switch(this.assertValidSize(B-g),this.byteLength){case 1:return A.getUint8(g);case 2:return A.getUint16(g,!0);case 4:return A.getUint32(g,!0);case 8:{const e=A.getUint32(g,!0),Q=A.getUint32(g+4,!0);return Q===En&&e===En&&this.clipInfinity?1/0:Q*tn+e}}}value_toTree(A){const g=qA.fromZero();return g.setUint(this.byteLength,0,A,this.clipInfinity),g}tree_serializeToBytes(A,g,B){const e=B.getUint(this.byteLength,0,this.clipInfinity);return this.value_serializeToBytes(A,g,e),g+this.byteLength}tree_deserializeFromBytes(A,g,B){this.assertValidSize(B-g);const e=this.value_deserializeFromBytes(A,g,B),Q=qA.fromZero();return Q.setUint(this.byteLength,0,e,this.clipInfinity),Q}tree_getFromNode(A){return A.getUint(this.byteLength,0,this.clipInfinity)}tree_setToNode(A,g){this.tree_setToPackedNode(A,0,g)}tree_getFromPackedNode(A,g){const B=this.byteLength*(g%this.itemsPerChunk);return A.getUint(this.byteLength,B,this.clipInfinity)}tree_setToPackedNode(A,g,B){const e=this.byteLength*(g%this.itemsPerChunk);this.setBitwiseOR?A.bitwiseOrUint(this.byteLength,e,B):A.setUint(this.byteLength,e,B,this.clipInfinity)}fromJson(A){if(typeof A=="number")return A;if(typeof A=="string"){if(this.clipInfinity&&A===this.maxDecimalStr)return 1/0;const g=Number.parseInt(A,10);if(Number.isNaN(g))throw Error("JSON invalid number isNaN");if(g>Number.MAX_SAFE_INTEGER)throw Error("JSON invalid number > MAX_SAFE_INTEGER");return g}if(typeof A=="bigint"){if(A>w2)throw Error("JSON invalid number > MAX_SAFE_INTEGER_BN");return Number(A)}throw Error(`JSON invalid type ${typeof A} expected number`)}toJson(A){return A===1/0?this.maxDecimalStr:A.toString(10)}}class mC extends kQ{byteLength;typeName;itemsPerChunk;fixedSize;minSize;maxSize;constructor(A,g){if(super(),this.byteLength=A,A>32)throw Error("UintBigint byteLength limit is 32");if(Math.log2(A)%1!==0)throw Error("byteLength must be a power of 2");this.typeName=g?.typeName??`uintBigint${A*8}`,this.byteLength=A,this.itemsPerChunk=32/this.byteLength,this.fixedSize=A,this.minSize=A,this.maxSize=A}static named(A,g){return new(dI(mC,g.typeName))(A,g)}defaultValue(){return BigInt(0)}value_serializeToBytes({dataView:A},g,B){switch(this.byteLength){case 1:A.setInt8(g,Number(B));break;case 2:A.setUint16(g,Number(B),!0);break;case 4:A.setUint32(g,Number(B),!0);break;case 8:A.setBigUint64(g,B,!0);break;default:for(let e=0;e<this.byteLength;e+=8){e>0&&(B=B/Ji);const Q=BigInt.asUintN(64,B);A.setBigUint64(g+e,Q,!0)}}return g+this.byteLength}value_deserializeFromBytes({dataView:A},g,B){const e=B-g;if(e!==this.byteLength)throw Error(`Invalid size ${e} expected ${this.byteLength}`);switch(this.byteLength){case 1:return BigInt(A.getUint8(g));case 2:return BigInt(A.getUint16(g,!0));case 4:return BigInt(A.getUint32(g,!0));case 8:return A.getBigUint64(g,!0);case 16:{const Q=A.getBigUint64(g,!0);return A.getBigUint64(g+8,!0)*Ji+Q}case 32:{const Q=A.getBigUint64(g,!0),C=A.getBigUint64(g+8,!0),i=A.getBigUint64(g+16,!0);return A.getBigUint64(g+24,!0)*d2+i*y2+C*Ji+Q}}}tree_serializeToBytes(A,g,B){const e=B.getUintBigint(this.byteLength,0);return this.value_serializeToBytes(A,g,e),g+this.byteLength}tree_deserializeFromBytes(A,g,B){const e=B-g;if(e!==this.byteLength)throw Error(`Invalid size ${e} expected ${this.byteLength}`);const Q=this.value_deserializeFromBytes(A,g,B),C=qA.fromZero();return C.setUintBigint(this.byteLength,0,Q),C}tree_getFromNode(A){return A.getUintBigint(this.byteLength,0)}tree_setToNode(A,g){this.tree_setToPackedNode(A,0,g)}tree_getFromPackedNode(A,g){const B=this.byteLength*(g%this.itemsPerChunk);return A.getUintBigint(this.byteLength,B)}tree_setToPackedNode(A,g,B){const e=this.byteLength*(g%this.itemsPerChunk);A.setUintBigint(this.byteLength,e,B)}fromJson(A){if(typeof A=="bigint")return A;if(typeof A=="string"||typeof A=="number")return BigInt(A);throw Error(`JSON invalid type ${typeof A} expected bigint`)}toJson(A){return A.toString(10)}}BigInt(2),BigInt(3);const pi=BigInt(2),on=BigInt(3);class JQ extends pC{elementType;typeName;depth;maxChunkCount;fixedSize=null;minSize;maxSize;isList=!0;isViewMutable=!0;mixInLengthBlockBytes=new Uint8Array(64);mixInLengthBuffer=vA.from(this.mixInLengthBlockBytes.buffer,this.mixInLengthBlockBytes.byteOffset,this.mixInLengthBlockBytes.byteLength);constructor(A,g){super(),this.elementType=A,this.typeName=g?.typeName??`Optional[${A.typeName}]`,this.maxChunkCount=1,this.depth=A.depth+1,this.minSize=0,this.maxSize=A.maxSize+1,this.blocksBuffer=new Uint8Array(32)}static named(A,g){return new(dI(JQ,g.typeName))(A,g)}defaultValue(){return null}getView(A){return this.tree_toValue(A.rootNode)}getViewDU(A){return this.tree_toValue(A)}commitView(A){return this.value_toTree(A)}commitViewDU(A,g=0,B=null){const e=this.value_toTree(A);return B!==null&&e.h0===null&&iI(e,g,B),e}cacheOfViewDU(){}value_serializedSize(A){return A!==null?1+this.elementType.value_serializedSize(A):0}value_serializeToBytes(A,g,B){return B!==null?(A.uint8Array[g]=1,this.elementType.value_serializeToBytes(A,g+1,B)):g}value_deserializeFromBytes(A,g,B){if(g===B)return null;const e=A.uint8Array[g];if(e!==1)throw new Error(`Invalid selector for Optional type: ${e}`);return this.elementType.value_deserializeFromBytes(A,g+1,B)}tree_serializedSize(A){const g=eg(A);if(g===0)return 0;if(g===1)return 1+this.elementType.value_serializedSize(A.left);throw new Error(`Invalid selector for Optional type: ${g}`)}tree_serializeToBytes(A,g,B){const e=eg(B);if(e===0)return g;if(e===1)return A.uint8Array[g]=1,this.elementType.tree_serializeToBytes(A,g+1,B.left);throw new Error(`Invalid selector for Optional type: ${e}`)}tree_deserializeFromBytes(A,g,B){let e,Q;if(g===B)Q=0,e=Yg(0);else{if(Q=A.uint8Array[g],Q!==1)throw new Error(`Invalid selector for Optional type: ${Q}`);e=this.elementType.tree_deserializeFromBytes(A,g+1,B)}return qg(e,Q)}hashTreeRoot(A){const g=oB(32);return this.hashTreeRootInto(A,g,0),g}hashTreeRootInto(A,g,B){super.hashTreeRootInto(A,this.mixInLengthBlockBytes,0);const e=A===null?0:1;this.mixInLengthBuffer.writeUIntLE(e,32,6),xB(this.mixInLengthBlockBytes,2,g,B)}getBlocksBytes(A){return A===null?this.blocksBuffer.fill(0):this.elementType.hashTreeRootInto(A,this.blocksBuffer,0),this.blocksBuffer}getPropertyGindex(A){if(NI(this.elementType)){const g=this.elementType.getPropertyGindex(A);return g===null?g:yI([pi,g])}throw new Error("not applicable for Optional basic type")}getPropertyType(A){if(NI(this.elementType))return this.elementType.getPropertyType(A);throw new Error("not applicable for Optional basic type")}getIndexProperty(A){if(NI(this.elementType))return this.elementType.getIndexProperty(A);throw new Error("not applicable for Optional basic type")}tree_createProofGindexes(A,g){if(NI(this.elementType))return super.tree_createProofGindexes(A,g);throw new Error("not applicable for Optional basic type")}tree_getLeafGindices(A,g){if(!g)throw new Error("Optional type requires rootNode argument to get leaves");const B=eg(g);if(NI(this.elementType)&&B===1)return[...this.elementType.tree_getLeafGindices(yI([A,pi]),g.left),yI([A,on])];if(B===0||B===1)return[yI([A,pi]),yI([A,on])];throw new Error(`Invalid selector for Optional type: ${B}`)}fromJson(A){return A===null?null:this.elementType.fromJson(A)}toJson(A){return A===null?null:this.elementType.toJson(A)}clone(A){return A===null?null:this.elementType.clone(A)}equals(A,g){return A===null&&g===null?!0:A===null||g===null?!1:this.elementType.equals(A,g)}}class pQ extends FQ{elementType;length;typeName;itemsPerChunk;depth;chunkDepth;maxChunkCount;fixedSize;minSize;maxSize;isList=!1;isViewMutable=!0;defaultLen;constructor(A,g,B){if(super(A),this.elementType=A,this.length=g,!A.isBasic)throw Error("elementType must be basic");if(g===0)throw Error("Vector length must be > 0");this.typeName=B?.typeName??`Vector[${A.typeName}, ${g}]`,this.itemsPerChunk=32/A.byteLength,this.maxChunkCount=Math.ceil(g*A.byteLength/32),this.chunkDepth=Sg(this.maxChunkCount),this.depth=this.chunkDepth,this.fixedSize=g*A.byteLength,this.minSize=this.fixedSize,this.maxSize=this.fixedSize,this.defaultLen=g,this.blocksBuffer=new Uint8Array(Math.ceil(this.maxChunkCount/2)*64)}static named(A,g,B){return new(dI(pQ,B.typeName))(A,g,B)}getView(A){return new vr(this,A)}getViewDU(A,g){return new Wr(this,A,g)}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}cacheOfViewDU(A){return A.cache}value_serializedSize(){return this.fixedSize}value_serializeToBytes(A,g,B){return NQ(this.elementType,this.length,A,g,B)}value_deserializeFromBytes(A,g,B){return mr(this.elementType,A,g,B,this)}tree_serializedSize(){return this.fixedSize}tree_serializeToBytes(A,g,B){return di(this.elementType,this.length,this.depth,A,g,B)}tree_deserializeFromBytes(A,g,B){return Lr(this.elementType,this.depth,A,g,B,this)}tree_getLength(){return this.length}tree_setLength(){}tree_getChunksNode(A){return A}tree_chunksNodeOffset(){return 0}tree_setChunksNode(A,g){return g}getBlocksBytes(A){const g=this.blocksBuffer.subarray(0,this.fixedSize),B=new DataView(g.buffer,g.byteOffset,g.byteLength);return NQ(this.elementType,this.length,{uint8Array:g,dataView:B},0,A),this.blocksBuffer}}class EI extends FQ{elementType;length;typeName;itemsPerChunk=1;depth;chunkDepth;maxChunkCount;fixedSize;minSize;maxSize;isList=!1;isViewMutable=!0;defaultLen;constructor(A,g,B){if(super(A),this.elementType=A,this.length=g,A.isBasic)throw Error("elementType must not be basic");if(g===0)throw Error("Vector length must be > 0");this.typeName=B?.typeName??`Vector[${A.typeName}, ${g}]`,this.maxChunkCount=g,this.chunkDepth=Sg(this.maxChunkCount),this.depth=this.chunkDepth,this.fixedSize=A.fixedSize===null?null:g*A.fixedSize,this.minSize=c2(A,g),this.maxSize=$r(A,g),this.defaultLen=g,this.blocksBuffer=new Uint8Array(Math.ceil(this.maxChunkCount/2)*64)}static named(A,g,B){return new(dI(EI,B.typeName))(A,g,B)}getView(A){return new Xr(this,A)}getViewDU(A,g){return new en(this,A,g)}commitView(A){return A.node}commitViewDU(A,g=0,B=null){return A.commit(g,B),A.node}cacheOfViewDU(A){return A.cache}value_serializedSize(A){return An(this.elementType,this.length,A)}value_serializeToBytes(A,g,B){return In(this.elementType,this.length,A,g,B)}value_deserializeFromBytes(A,g,B){return gn(this.elementType,A,g,B,this)}tree_serializedSize(A){return Bn(this.elementType,this.length,this.depth,A)}tree_serializeToBytes(A,g,B){return Fi(this.elementType,this.length,this.depth,B,A,g)}tree_deserializeFromBytes(A,g,B){return Cn(this.elementType,this.depth,A,g,B,this)}tree_getLength(){return this.length}tree_setLength(){}tree_getChunksNode(A){return A}tree_chunksNodeOffset(){return 0}tree_setChunksNode(A,g){return g}getBlocksBytes(A){return D2(this.elementType,this.length,A,this.blocksBuffer)}}class N2 extends bI{constructor(A,g){super(new tg(8),A,g)}toViewDU(A){const{treeNode:g,leafNodes:B}=this.packedUintNum64sToNode(A);return this.getViewDU(g,{nodes:B,length:A.length,nodesPopulated:!0})}value_toTree(A){const{treeNode:g}=this.packedUintNum64sToNode(A);return g}packedUintNum64sToNode(A){if(A.length>this.limit)throw new Error(`Exceeds limit: ${A.length} > ${this.limit}`);const g=yf(A),B=uC([...g],this.chunkDepth);return{treeNode:qg(B,A.length),leafNodes:g}}}new Uint8Array(64).subarray(32);function LC(I){if(!Number.isSafeInteger(I)||I<0)throw new Error(`positive integer expected, not ${I}`)}function u2(I){if(typeof I!="boolean")throw new Error(`boolean expected, not ${I}`)}function R2(I){return I instanceof Uint8Array||I!=null&&typeof I=="object"&&I.constructor.name==="Uint8Array"}function HQ(I,...A){if(!R2(I))throw new Error("Uint8Array expected");if(A.length>0&&!A.includes(I.length))throw new Error(`Uint8Array expected of length ${A}, not of length=${I.length}`)}function G2(I){if(typeof I!="function"||typeof I.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");LC(I.outputLen),LC(I.blockLen)}function Hi(I,A=!0){if(I.destroyed)throw new Error("Hash instance has been destroyed");if(A&&I.finished)throw new Error("Hash#digest() has already been called")}function rn(I,A){HQ(I);const g=A.outputLen;if(I.length<g)throw new Error(`digestInto() expects output buffer of length at least ${g}`)}const k2={number:LC,bool:u2,bytes:HQ,hash:G2,exists:Hi,output:rn},MQ=BigInt(2**32-1),nn=BigInt(32);function F2(I,A=!1){return A?{h:Number(I&MQ),l:Number(I>>nn&MQ)}:{h:Number(I>>nn&MQ)|0,l:Number(I&MQ)|0}}function J2(I,A=!1){let g=new Uint32Array(I.length),B=new Uint32Array(I.length);for(let e=0;e<I.length;e++){const{h:Q,l:C}=F2(I[e],A);[g[e],B[e]]=[Q,C]}return[g,B]}const p2=(I,A,g)=>I<<g|A>>>32-g,H2=(I,A,g)=>A<<g|I>>>32-g,M2=(I,A,g)=>A<<g-32|I>>>64-g,m2=(I,A,g)=>I<<g-32|A>>>64-g,L2=I=>new Uint32Array(I.buffer,I.byteOffset,Math.floor(I.byteLength/4)),an=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,K2=I=>I<<24&4278190080|I<<8&16711680|I>>>8&65280|I>>>24&255;function sn(I){for(let A=0;A<I.length;A++)I[A]=K2(I[A])}function Y2(I){if(typeof I!="string")throw new Error(`utf8ToBytes expected string, got ${typeof I}`);return new Uint8Array(new TextEncoder().encode(I))}function hn(I){return typeof I=="string"&&(I=Y2(I)),HQ(I),I}class b2{clone(){return this._cloneInto()}}function T2(I){const A=B=>I().update(hn(B)).digest(),g=I();return A.outputLen=g.outputLen,A.blockLen=g.blockLen,A.create=()=>I(),A}const ln=[],cn=[],Dn=[],q2=BigInt(0),KC=BigInt(1),V2=BigInt(2),j2=BigInt(7),_2=BigInt(256),Z2=BigInt(113);for(let I=0,A=KC,g=1,B=0;I<24;I++){[g,B]=[B,(2*g+3*B)%5],ln.push(2*(5*B+g)),cn.push((I+1)*(I+2)/2%64);let e=q2;for(let Q=0;Q<7;Q++)A=(A<<KC^(A>>j2)*Z2)%_2,A&V2&&(e^=KC<<(KC<<BigInt(Q))-KC);Dn.push(e)}const[P2,O2]=J2(Dn,!0),Un=(I,A,g)=>g>32?M2(I,A,g):p2(I,A,g),fn=(I,A,g)=>g>32?m2(I,A,g):H2(I,A,g);function x2(I,A=24){const g=new Uint32Array(10);for(let B=24-A;B<24;B++){for(let C=0;C<10;C++)g[C]=I[C]^I[C+10]^I[C+20]^I[C+30]^I[C+40];for(let C=0;C<10;C+=2){const i=(C+8)%10,o=(C+2)%10,D=g[o],a=g[o+1],U=Un(D,a,1)^g[i],J=fn(D,a,1)^g[i+1];for(let f=0;f<50;f+=10)I[C+f]^=U,I[C+f+1]^=J}let e=I[2],Q=I[3];for(let C=0;C<24;C++){const i=cn[C],o=Un(e,Q,i),D=fn(e,Q,i),a=ln[C];e=I[a],Q=I[a+1],I[a]=o,I[a+1]=D}for(let C=0;C<50;C+=10){for(let i=0;i<10;i++)g[i]=I[C+i];for(let i=0;i<10;i++)I[C+i]^=~g[(i+2)%10]&g[(i+4)%10]}I[0]^=P2[B],I[1]^=O2[B]}g.fill(0)}class Mi extends b2{constructor(A,g,B,e=!1,Q=24){if(super(),this.blockLen=A,this.suffix=g,this.outputLen=B,this.enableXOF=e,this.rounds=Q,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,LC(B),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=L2(this.state)}keccak(){an||sn(this.state32),x2(this.state32,this.rounds),an||sn(this.state32),this.posOut=0,this.pos=0}update(A){Hi(this);const{blockLen:g,state:B}=this;A=hn(A);const e=A.length;for(let Q=0;Q<e;){const C=Math.min(g-this.pos,e-Q);for(let i=0;i<C;i++)B[this.pos++]^=A[Q++];this.pos===g&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:A,suffix:g,pos:B,blockLen:e}=this;A[B]^=g,g&128&&B===e-1&&this.keccak(),A[e-1]^=128,this.keccak()}writeInto(A){Hi(this,!1),HQ(A),this.finish();const g=this.state,{blockLen:B}=this;for(let e=0,Q=A.length;e<Q;){this.posOut>=B&&this.keccak();const C=Math.min(B-this.posOut,Q-e);A.set(g.subarray(this.posOut,this.posOut+C),e),this.posOut+=C,e+=C}return A}xofInto(A){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(A)}xof(A){return LC(A),this.xofInto(new Uint8Array(A))}digestInto(A){if(rn(A,this),this.finished)throw new Error("digest() was already called");return this.writeInto(A),this.destroy(),A}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(A){const{blockLen:g,suffix:B,outputLen:e,rounds:Q,enableXOF:C}=this;return A||(A=new Mi(g,B,e,C,Q)),A.state32.set(this.state32),A.pos=this.pos,A.posOut=this.posOut,A.finished=this.finished,A.rounds=Q,A.suffix=B,A.outputLen=e,A.enableXOF=C,A.destroyed=this.destroyed,A}}const z2=(I,A,g)=>T2(()=>new Mi(A,I,g)),Sn=z2(1,136,256/8);function v2(I){return A=>(k2.bytes(A),I(A))}(()=>{const I=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,A=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);return{node:A&&!I?A("crypto"):void 0,web:I}})();const W2=(()=>{const I=v2(Sn);return I.create=Sn.create,I})();class X2 extends kI{constructor(){super(20,{typeName:"ExecutionAddress"})}toJson(A){const g=super.toJson(A);return AS(g)}}function $2(I){return/^(0x)?[0-9a-f]{40}$/i.test(I)}function AS(I){if(!$2(I))throw Error(`Invalid address: ${I}`);const A=(I.startsWith("0x")?I.slice(2):I).toLowerCase(),g=A.split(""),B=new Uint8Array(g.length);for(let Q=0;Q<B.length;Q++)B[Q]=A[Q].charCodeAt(0);const e=W2(B);for(let Q=0;Q<g.length;Q+=2)e[Q>>1]>>4>=8&&(g[Q]=g[Q].toUpperCase()),(e[Q>>1]&15)>=8&&(g[Q+1]=g[Q+1].toUpperCase());return"0x"+g.join("")}const BI=new ki,wn=new tg(1),YC=new kI(4),mi=new kI(8),yn=new kI(20),Li=new kI(32),Ki=new kI(48),Yi=new kI(96),dn=new tg(1),Nn=new tg(2),bi=new tg(4),RA=new tg(8),mQ=new tg(8,{clipInfinity:!0}),cB=new mC(8),un=new mC(16),Ti=new mC(32),KA=RA,PI=RA,Rn=mQ,Gn=RA,DB=RA,qi=RA,kn=mQ,XA=RA,Fn=RA,Jn=cB,pn=cB,Hn=Ti,UB=new kI(32),Vi=RA,Mn=YC,mn=YC,ji=YC,vB=Ki,LQ=Yi,Ln=Li,Kn=new tg(1,{setBitwiseOR:!0}),_i=new X2,Zi=RA,Yn=RA,bn=RA,Eg=Object.freeze(Object.defineProperty({__proto__:null,BLSPubkey:vB,BLSSignature:LQ,BlobIndex:Vi,Boolean:BI,BuilderIndex:kn,Byte:wn,Bytes20:yn,Bytes32:Li,Bytes4:YC,Bytes48:Ki,Bytes8:mi,Bytes96:Yi,ColumnIndex:Zi,CommitteeIndex:DB,CustodyIndex:Yn,DepositIndex:Jn,Domain:Ln,DomainType:mn,Epoch:PI,EpochInf:Rn,ExecutionAddress:_i,ForkDigest:ji,Gwei:pn,ParticipationFlags:Kn,Root:UB,RowIndex:bn,Slot:KA,SubcommitteeIndex:qi,SyncPeriod:Gn,Uint16:Nn,Uint32:bi,Uint8:dn,UintBn128:un,UintBn256:Ti,UintBn64:cB,UintNum64:RA,UintNumInf64:mQ,ValidatorIndex:XA,Version:Mn,Wei:Hn,WithdrawalIndex:Fn},Symbol.toStringTag,{value:"Module"})),{Boolean:IS,Bytes32:gS,UintNum64:BS,BLSPubkey:CS,EpochInf:KQ}=Eg,Tn=2**32,WB=4,QS=48,eS=32,iS=1,tS={pubkey:CS,withdrawalCredentials:gS,effectiveBalance:BS,slashed:IS,activationEligibilityEpoch:KQ,activationEpoch:KQ,exitEpoch:KQ,withdrawableEpoch:KQ};class ES extends a2{constructor(){super(tS,{typeName:"Validator",jsonCase:"eth2"})}value_serializeToBytes({uint8Array:A,dataView:g},B,e){A.set(e.pubkey,B),B+=QS,A.set(e.withdrawalCredentials,B),B+=eS;const{effectiveBalance:Q,activationEligibilityEpoch:C,activationEpoch:i,exitEpoch:o,withdrawableEpoch:D}=e;return g.setUint32(B,Q&4294967295,!0),B+=WB,g.setUint32(B,Q/Tn&4294967295,!0),B+=WB,A[B]=e.slashed?1:0,B+=iS,B=YQ(g,B,C),B=YQ(g,B,i),B=YQ(g,B,o),B=YQ(g,B,D),B}}function YQ(I,A,g){return g===1/0?(I.setUint32(A,4294967295,!0),A+=WB,I.setUint32(A,4294967295,!0),A+=WB):(I.setUint32(A,g&4294967295,!0),A+=WB,I.setUint32(A,g/Tn&4294967295,!0),A+=WB),A}const qn=new ES,{Bytes32:fB,UintNum64:cI,UintBn64:SB,Slot:Vg,Epoch:bC,CommitteeIndex:Vn,ValidatorIndex:wB,Root:MA,Version:TC,ForkDigest:jn,BLSPubkey:_n,BLSSignature:OI,Domain:oS}=Eg,Pi=new ig(Jc),TI=new K({slot:Vg,proposerIndex:wB,parentRoot:MA,stateRoot:MA,bodyRoot:MA},{typeName:"BeaconBlockHeader",jsonCase:"eth2",cachePermanentRootStruct:!0}),Zn=new K({slot:SB,proposerIndex:wB,parentRoot:MA,stateRoot:MA,bodyRoot:MA},{typeName:"BeaconBlockHeader",jsonCase:"eth2",cachePermanentRootStruct:!0}),Oi=new K({message:TI,signature:OI},{typeName:"SignedBeaconBlockHeader",jsonCase:"eth2"}),xi=new K({message:Zn,signature:OI},{typeName:"SignedBeaconBlockHeader",jsonCase:"eth2"}),jA=new K({epoch:bC,root:MA},{typeName:"Checkpoint",jsonCase:"eth2"}),zi=new K({epoch:SB,root:MA},{typeName:"Checkpoint",jsonCase:"eth2"}),vi=new GQ(UC),bQ=new bI(wB,UC),rS=new K({pubkey:_n,withdrawalCredentials:fB,amount:cI},{typeName:"DepositMessage",jsonCase:"eth2"}),Wi=new K({pubkey:_n,withdrawalCredentials:fB,amount:cI,signature:OI},{typeName:"DepositData",jsonCase:"eth2"}),nS=new wA(MA,2**Ho),aS=new K({depositData:Wi,blockNumber:cI,index:cI},{typeName:"DepositEvent",jsonCase:"eth2"}),og=new K({depositRoot:MA,depositCount:cI,blockHash:fB},{typeName:"Eth1Data",jsonCase:"eth2"}),jg=new wA(og,$1*wI),sS=new K({depositRoot:MA,depositCount:cI,blockHash:fB,blockNumber:cI},{typeName:"Eth1DataOrdered",jsonCase:"eth2"}),hS=new K({timestamp:cI,depositRoot:MA,depositCount:cI},{typeName:"Eth1Block",jsonCase:"eth2"}),_g=new K({previousVersion:TC,currentVersion:TC,epoch:bC},{typeName:"Fork",jsonCase:"eth2"}),lS=new K({currentVersion:TC,genesisValidatorsRoot:MA},{typeName:"ForkData",jsonCase:"eth2"}),cS=new K({forkDigest:jn,nextForkVersion:TC,nextForkEpoch:bC},{typeName:"ENRForkID",jsonCase:"eth2"}),yg=new EI(MA,Oe),dg=new EI(MA,Oe),DS=new K({blockRoots:yg,stateRoots:dg},{typeName:"HistoricalBatch",jsonCase:"eth2"}),US=new K({blockRoots:MA,stateRoots:MA},{typeName:"HistoricalBatchRoots",jsonCase:"eth2"}),fS=qn,Zg=new wA(qn,fC),Pg=new N2(fC),Og=new EI(fB,Ac),xg=new pQ(cI,Ic),zg=new ig(kc),yB=new K({slot:Vg,index:Vn,beaconBlockRoot:MA,source:jA,target:jA},{typeName:"AttestationData",jsonCase:"eth2",cachePermanentRootStruct:!0}),Xi=new K({slot:SB,index:SB,beaconBlockRoot:MA,source:zi,target:zi},{typeName:"AttestationData",jsonCase:"eth2",cachePermanentRootStruct:!0}),SS=new K({attestingIndices:bQ,data:yB,signature:OI},{typeName:"IndexedAttestation",jsonCase:"eth2"}),$i=new K({attestingIndices:bQ,data:Xi,signature:OI},{typeName:"IndexedAttestation",jsonCase:"eth2"}),Pn=new K({aggregationBits:vi,data:yB,inclusionDelay:Vg,proposerIndex:wB},{typeName:"PendingAttestation",jsonCase:"eth2"}),wS=new K({objectRoot:MA,domain:oS},{typeName:"SigningData",jsonCase:"eth2"}),TQ=new K({aggregationBits:vi,data:yB,signature:OI},{typeName:"Attestation",jsonCase:"eth2"}),yS=TQ,On=new K({attestation1:$i,attestation2:$i},{typeName:"AttesterSlashing",jsonCase:"eth2"}),xn=new K({proof:new EI(fB,Ho+1),data:Wi},{typeName:"Deposit",jsonCase:"eth2"}),zn=new K({signedHeader1:xi,signedHeader2:xi},{typeName:"ProposerSlashing",jsonCase:"eth2"}),vn=new K({epoch:bC,validatorIndex:wB},{typeName:"VoluntaryExit",jsonCase:"eth2",cachePermanentRootStruct:!0}),Wn=new K({message:vn,signature:OI},{typeName:"SignedVoluntaryExit",jsonCase:"eth2"}),$A=new K({randaoReveal:OI,eth1Data:og,graffiti:fB,proposerSlashings:new wA(zn,gc),attesterSlashings:new wA(On,Bc),attestations:new wA(TQ,Go),deposits:new wA(xn,Cc),voluntaryExits:new wA(Wn,Qc)},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),Xn=new K({slot:Vg,proposerIndex:wB,parentRoot:MA,stateRoot:MA,body:$A},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),dS=new K({message:Xn,signature:OI},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),At=new wA(Pn,Go*wI),NS=new K({genesisTime:cI,genesisValidatorsRoot:MA,slot:Vg,fork:_g,latestBlockHeader:TI,blockRoots:yg,stateRoots:dg,historicalRoots:new wA(MA,Jg),eth1Data:og,eth1DataVotes:jg,eth1DepositIndex:cI,validators:Zg,balances:Pg,randaoMixes:Og,slashings:xg,previousEpochAttestations:At,currentEpochAttestations:At,justificationBits:zg,previousJustifiedCheckpoint:jA,currentJustifiedCheckpoint:jA,finalizedCheckpoint:jA},{typeName:"BeaconState",jsonCase:"eth2"}),uS=new K({validators:bQ,committeeIndex:Vn,slot:Vg},{typeName:"CommitteeAssignment",jsonCase:"eth2"}),$n=new K({aggregatorIndex:wB,aggregate:TQ,selectionProof:OI},{typeName:"AggregateAndProof",jsonCase:"eth2",cachePermanentRootStruct:!0}),RS=new K({message:$n,signature:OI},{typeName:"SignedAggregateAndProof",jsonCase:"eth2"}),Aa=new K({forkDigest:jn,finalizedRoot:MA,finalizedEpoch:bC,headRoot:MA,headSlot:Vg},{typeName:"Status",jsonCase:"eth2"}),GS=SB,kS=SB,FS=new K({seqNumber:SB,attnets:Pi},{typeName:"Metadata",jsonCase:"eth2"}),JS=new K({startSlot:Vg,count:cI,step:cI},{typeName:"BeaconBlocksByRangeRequest",jsonCase:"eth2"}),pS=new K({genesisValidatorsRoot:MA,genesisTime:cI,genesisForkVersion:TC},{typeName:"Genesis",jsonCase:"eth2"}),vg=Object.freeze(Object.defineProperty({__proto__:null,AggregateAndProof:$n,Attestation:TQ,AttestationData:yB,AttestationDataBigint:Xi,AttestationSubnets:Pi,AttesterSlashing:On,Balances:Pg,BeaconBlock:Xn,BeaconBlockBody:$A,BeaconBlockHeader:TI,BeaconBlockHeaderBigint:Zn,BeaconBlocksByRangeRequest:JS,BeaconState:NS,Checkpoint:jA,CheckpointBigint:zi,CommitteeAssignment:uS,CommitteeBits:vi,CommitteeIndices:bQ,Deposit:xn,DepositData:Wi,DepositDataRootList:nS,DepositEvent:aS,DepositMessage:rS,ENRForkID:cS,EpochAttestations:At,Eth1Block:hS,Eth1Data:og,Eth1DataOrdered:sS,Eth1DataVotes:jg,Fork:_g,ForkData:lS,Genesis:pS,Goodbye:GS,HistoricalBatch:DS,HistoricalBatchRoots:US,HistoricalBlockRoots:yg,HistoricalStateRoots:dg,IndexedAttestation:SS,IndexedAttestationBigint:$i,JustificationBits:zg,Metadata:FS,PendingAttestation:Pn,Ping:kS,ProposerSlashing:zn,RandaoMixes:Og,SignedAggregateAndProof:RS,SignedBeaconBlock:dS,SignedBeaconBlockHeader:Oi,SignedBeaconBlockHeaderBigint:xi,SignedVoluntaryExit:Wn,SigningData:wS,SingleAttestation:yS,Slashings:xg,Status:Aa,Validator:fS,Validators:Zg,VoluntaryExit:vn},Symbol.toStringTag,{value:"Module"})),{Bytes32:It,UintNum64:qC,UintBn64:HS,Slot:Wg,SubcommitteeIndex:Ia,ValidatorIndex:gt,Root:XB,BLSPubkey:ga,BLSSignature:$B,ParticipationFlags:MS}=Eg,Ba=new ig(Lo),Bt=new EI(It,VB),Ca=new EI(It,Hc),Qa=new EI(It,hQ),ea=new K({seqNumber:HS,attnets:Pi,syncnets:Ba},{typeName:"Metadata",jsonCase:"eth2"}),AI=new K({pubkeys:new EI(ga,pg),aggregatePubkey:ga},{typeName:"SyncCommittee",jsonCase:"eth2"}),mS=new K({slot:Wg,beaconBlockRoot:XB,validatorIndex:gt,signature:$B},{typeName:"SyncCommitteeMessage",jsonCase:"eth2"}),ia=new K({slot:Wg,beaconBlockRoot:XB,subcommitteeIndex:Ia,aggregationBits:new ig(pg/Lo),signature:$B},{typeName:"SyncCommitteeContribution",jsonCase:"eth2"}),ta=new K({aggregatorIndex:gt,contribution:ia,selectionProof:$B},{typeName:"ContributionAndProof",jsonCase:"eth2",cachePermanentRootStruct:!0}),LS=new K({message:ta,signature:$B},{typeName:"SignedContributionAndProof",jsonCase:"eth2"}),KS=new K({slot:Wg,subcommitteeIndex:Ia},{typeName:"SyncAggregatorSelectionData",jsonCase:"eth2"}),Ea=new ig(pg),DI=new K({syncCommitteeBits:Ea,syncCommitteeSignature:$B},{typeName:"SyncCommitteeBits",jsonCase:"eth2"}),rg=new K({...$A.fields,syncAggregate:DI},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),oa=new K({slot:Wg,proposerIndex:gt,parentRoot:XB,stateRoot:XB,body:rg},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),YS=new K({message:oa,signature:$B},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),FI=new bI(MS,fC),dB=new bI(qC,fC),bS=new K({genesisTime:qC,genesisValidatorsRoot:XB,slot:Wg,fork:_g,latestBlockHeader:TI,blockRoots:yg,stateRoots:dg,historicalRoots:new wA(XB,Jg),eth1Data:og,eth1DataVotes:jg,eth1DepositIndex:qC,validators:Zg,balances:Pg,randaoMixes:Og,slashings:xg,previousEpochParticipation:FI,currentEpochParticipation:FI,justificationBits:zg,previousJustifiedCheckpoint:jA,currentJustifiedCheckpoint:jA,finalizedCheckpoint:jA,inactivityScores:dB,currentSyncCommittee:AI,nextSyncCommittee:AI},{typeName:"BeaconState",jsonCase:"eth2"}),NB=new K({beacon:TI},{typeName:"LightClientHeader",jsonCase:"eth2"}),qQ=new K({header:NB,currentSyncCommittee:AI,currentSyncCommitteeBranch:Ca},{typeName:"LightClientBootstrap",jsonCase:"eth2"}),AC=new K({attestedHeader:NB,nextSyncCommittee:AI,nextSyncCommitteeBranch:Qa,finalizedHeader:NB,finalityBranch:Bt,syncAggregate:DI,signatureSlot:Wg},{typeName:"LightClientUpdate",jsonCase:"eth2"}),Ct=new K({attestedHeader:NB,finalizedHeader:NB,finalityBranch:Bt,syncAggregate:DI,signatureSlot:Wg},{typeName:"LightClientFinalityUpdate",jsonCase:"eth2"}),TS=new K({attestedHeader:NB,syncAggregate:DI,signatureSlot:Wg},{typeName:"LightClientOptimisticUpdate",jsonCase:"eth2"}),qS=new K({startPeriod:qC,count:qC},{typeName:"LightClientUpdatesByRange",jsonCase:"eth2"}),VS=new K({snapshot:qQ,validUpdates:new wA(AC,Hg*wI)},{typeName:"LightClientStore",jsonCase:"eth2"}),uB=Object.freeze(Object.defineProperty({__proto__:null,BeaconBlock:oa,BeaconBlockBody:rg,BeaconState:bS,ContributionAndProof:ta,CurrentSyncCommitteeBranch:Ca,EpochParticipation:FI,FinalityBranch:Bt,InactivityScores:dB,LightClientBootstrap:qQ,LightClientFinalityUpdate:Ct,LightClientHeader:NB,LightClientOptimisticUpdate:TS,LightClientStore:VS,LightClientUpdate:AC,LightClientUpdatesByRange:qS,Metadata:ea,NextSyncCommitteeBranch:Qa,SignedBeaconBlock:YS,SignedContributionAndProof:LS,SyncAggregate:DI,SyncAggregatorSelectionData:KS,SyncCommittee:AI,SyncCommitteeBits:Ea,SyncCommitteeContribution:ia,SyncCommitteeMessage:mS,SyncSubnets:Ba},Symbol.toStringTag,{value:"Module"}));class Xg extends kQ{typeName="string";byteLength=0;fixedSize=0;minSize=0;maxSize=0;defaultValue(){return""}value_serializeToBytes(){throw Error("Not supported in String type")}value_deserializeFromBytes(){throw Error("Not supported in String type")}tree_serializeToBytes(){throw Error("Not supported in String type")}tree_deserializeFromBytes(){throw Error("Not supported in String type")}tree_getFromNode(){throw Error("Not supported in String type")}tree_setToNode(){throw Error("Not supported in String type")}tree_getFromPackedNode(){throw Error("Not supported in String type")}tree_setToPackedNode(){throw Error("Not supported in String type")}fromJson(A){if(typeof A!="string")throw Error(`JSON invalid type ${typeof A} expected string`);return A}toJson(A){return A}}const xI=new Xg,{Bytes32:VQ,UintNum64:zI,Slot:Qt,ValidatorIndex:ra,Root:JI,BLSSignature:jQ,UintBn256:et,BLSPubkey:na,ExecutionAddress:aa}=Eg,sa=new HC(ic),ha=new wA(sa,tc),it=new K({parentHash:JI,feeRecipient:aa,stateRoot:VQ,receiptsRoot:VQ,logsBloom:new kI(Ec),prevRandao:VQ,blockNumber:zI,gasLimit:zI,gasUsed:zI,timestamp:zI,extraData:new HC(oc),baseFeePerGas:et,blockHash:JI}),tt=new K({...it.fields,transactions:ha},{typeName:"ExecutionPayload",jsonCase:"eth2"}),VC=new K({...it.fields,transactionsRoot:JI},{typeName:"ExecutionPayloadHeader",jsonCase:"eth2"}),la=new K({...rg.fields,executionPayload:tt},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),ca=new K({slot:Qt,proposerIndex:ra,parentRoot:JI,stateRoot:JI,body:la},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),jS=new K({message:ca,signature:jQ},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),_S=new K({blockHash:JI,parentHash:JI,totalDifficulty:et},{typeName:"PowBlock",jsonCase:"eth2"}),ZS=new K({genesisTime:zI,genesisValidatorsRoot:JI,slot:KA,fork:_g,latestBlockHeader:TI,blockRoots:yg,stateRoots:dg,historicalRoots:new wA(JI,Jg),eth1Data:og,eth1DataVotes:jg,eth1DepositIndex:zI,validators:Zg,balances:Pg,randaoMixes:Og,slashings:xg,previousEpochParticipation:FI,currentEpochParticipation:FI,justificationBits:zg,previousJustifiedCheckpoint:jA,currentJustifiedCheckpoint:jA,finalizedCheckpoint:jA,inactivityScores:dB,currentSyncCommittee:AI,nextSyncCommittee:AI,latestExecutionPayloadHeader:VC},{typeName:"BeaconState",jsonCase:"eth2"}),Da=new K({...rg.fields,executionPayloadHeader:VC},{typeName:"BlindedBeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),Et=new K({slot:Qt,proposerIndex:ra,parentRoot:JI,stateRoot:JI,body:Da},{typeName:"BlindedBeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),PS=new K({message:Et,signature:jQ},{typeName:"SignedBlindedBeaconBlock",jsonCase:"eth2"}),Ua=new K({feeRecipient:aa,gasLimit:zI,timestamp:zI,pubkey:na},{typeName:"ValidatorRegistrationV1",jsonCase:"eth2"}),OS=new K({message:Ua,signature:jQ},{typeName:"SignedValidatorRegistrationV1",jsonCase:"eth2"}),fa=new K({header:VC,value:et,pubkey:na},{typeName:"BuilderBid",jsonCase:"eth2"}),xS=new K({message:fa,signature:jQ},{typeName:"SignedBuilderBid",jsonCase:"eth2"}),ot=new K({timestamp:zI,prevRandao:VQ,suggestedFeeRecipient:xI},{typeName:"PayloadAttributes",jsonCase:"eth2"}),jC=new K({proposerIndex:zI,proposalSlot:Qt,parentBlockNumber:zI,parentBlockRoot:JI,parentBlockHash:JI},{typeName:"SSEPayloadAttributesCommon",jsonCase:"eth2"}),zS=new K({...jC.fields,payloadAttributes:ot},{typeName:"SSEPayloadAttributes",jsonCase:"eth2"}),IC=Object.freeze(Object.defineProperty({__proto__:null,BeaconBlock:ca,BeaconBlockBody:la,BeaconState:ZS,BlindedBeaconBlock:Et,BlindedBeaconBlockBody:Da,BuilderBid:fa,CommonExecutionPayloadType:it,ExecutionPayload:tt,ExecutionPayloadHeader:VC,PayloadAttributes:ot,PowBlock:_S,SSEPayloadAttributes:zS,SSEPayloadAttributesCommon:jC,SignedBeaconBlock:jS,SignedBlindedBeaconBlock:PS,SignedBuilderBid:xS,SignedValidatorRegistrationV1:OS,Transaction:sa,Transactions:ha,ValidatorRegistrationV1:Ua},Symbol.toStringTag,{value:"Module"})),{UintNum64:Sa,Slot:_Q,ValidatorIndex:ZQ,WithdrawalIndex:wa,Root:RB,BLSSignature:PQ,BLSPubkey:ya,ExecutionAddress:da,Gwei:vS,UintBn256:WS,Bytes32:XS}=Eg,Na=new EI(XS,Yo),ua=new K({index:wa,validatorIndex:ZQ,address:da,amount:vS},{typeName:"Withdrawal",jsonCase:"eth2"}),Ra=new K({validatorIndex:ZQ,fromBlsPubkey:ya,toExecutionAddress:da},{typeName:"BLSToExecutionChange",jsonCase:"eth2"}),Ga=new K({message:Ra,signature:PQ},{typeName:"SignedBLSToExecutionChange",jsonCase:"eth2"}),OQ=new wA(ua,nc),rt=new K({...tt.fields,withdrawals:OQ},{typeName:"ExecutionPayload",jsonCase:"eth2"}),gC=new K({...VC.fields,withdrawalsRoot:RB},{typeName:"ExecutionPayloadHeader",jsonCase:"eth2"}),nt=new wA(Ga,rc),GB=new K({...rg.fields,executionPayload:rt,blsToExecutionChanges:nt},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),at=new K({slot:_Q,proposerIndex:ZQ,parentRoot:RB,stateRoot:RB,body:GB},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),$S=new K({message:at,signature:PQ},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),ka=new K({header:gC,value:WS,pubkey:ya},{typeName:"BuilderBid",jsonCase:"eth2"}),Aw=new K({message:ka,signature:PQ},{typeName:"SignedBuilderBid",jsonCase:"eth2"}),Fa=new K({blockSummaryRoot:RB,stateSummaryRoot:RB},{typeName:"HistoricalSummary",jsonCase:"eth2"}),Ja=new wA(Fa,Jg,{typeName:"HistoricalSummaries"}),ng=new K({genesisTime:Sa,genesisValidatorsRoot:RB,slot:KA,fork:_g,latestBlockHeader:TI,blockRoots:yg,stateRoots:dg,historicalRoots:new wA(RB,Jg),eth1Data:og,eth1DataVotes:jg,eth1DepositIndex:Sa,validators:Zg,balances:Pg,randaoMixes:Og,slashings:xg,previousEpochParticipation:FI,currentEpochParticipation:FI,justificationBits:zg,previousJustifiedCheckpoint:jA,currentJustifiedCheckpoint:jA,finalizedCheckpoint:jA,inactivityScores:dB,currentSyncCommittee:AI,nextSyncCommittee:AI,latestExecutionPayloadHeader:gC,nextWithdrawalIndex:wa,nextWithdrawalValidatorIndex:ZQ,historicalSummaries:Ja},{typeName:"BeaconState",jsonCase:"eth2"}),pa=new K({...rg.fields,executionPayloadHeader:gC,blsToExecutionChanges:nt},{typeName:"BlindedBeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),st=new K({...Et.fields,body:pa},{typeName:"BlindedBeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),Iw=new K({message:st,signature:PQ},{typeName:"SignedBlindedBeaconBlock",jsonCase:"eth2"}),$g=new K({beacon:TI,execution:gC,executionBranch:Na},{typeName:"LightClientHeader",jsonCase:"eth2"}),Ha=new K({header:$g,currentSyncCommittee:AI,currentSyncCommitteeBranch:qQ.fields.currentSyncCommitteeBranch},{typeName:"LightClientBootstrap",jsonCase:"eth2"}),Ma=new K({attestedHeader:$g,nextSyncCommittee:AI,nextSyncCommitteeBranch:AC.fields.nextSyncCommitteeBranch,finalizedHeader:$g,finalityBranch:AC.fields.finalityBranch,syncAggregate:DI,signatureSlot:_Q},{typeName:"LightClientUpdate",jsonCase:"eth2"}),gw=new K({attestedHeader:$g,finalizedHeader:$g,finalityBranch:Ct.fields.finalityBranch,syncAggregate:DI,signatureSlot:_Q},{typeName:"LightClientFinalityUpdate",jsonCase:"eth2"}),Bw=new K({attestedHeader:$g,syncAggregate:DI,signatureSlot:_Q},{typeName:"LightClientOptimisticUpdate",jsonCase:"eth2"}),Cw=new K({snapshot:Ha,validUpdates:new wA(Ma,Hg*wI)},{typeName:"LightClientStore",jsonCase:"eth2"}),xQ=new K({...ot.fields,withdrawals:OQ},{typeName:"PayloadAttributes",jsonCase:"eth2"}),Qw=new K({...jC.fields,payloadAttributes:xQ},{typeName:"SSEPayloadAttributes",jsonCase:"eth2"}),_C=Object.freeze(Object.defineProperty({__proto__:null,BLSToExecutionChange:Ra,BLSToExecutionChanges:nt,BeaconBlock:at,BeaconBlockBody:GB,BeaconState:ng,BlindedBeaconBlock:st,BlindedBeaconBlockBody:pa,BuilderBid:ka,ExecutionBranch:Na,ExecutionPayload:rt,ExecutionPayloadHeader:gC,HistoricalSummaries:Ja,HistoricalSummary:Fa,LightClientBootstrap:Ha,LightClientFinalityUpdate:gw,LightClientHeader:$g,LightClientOptimisticUpdate:Bw,LightClientStore:Cw,LightClientUpdate:Ma,PayloadAttributes:xQ,SSEPayloadAttributes:Qw,SignedBLSToExecutionChange:Ga,SignedBeaconBlock:$S,SignedBlindedBeaconBlock:Iw,SignedBuilderBid:Aw,Withdrawal:ua,Withdrawals:OQ},Symbol.toStringTag,{value:"Module"})),{UintNum64:ht,Slot:zQ,Root:vQ,BLSSignature:lt,UintBn64:WQ,UintBn256:ew,Bytes32:XQ,Bytes48:ct,Bytes96:iw,BLSPubkey:tw,BlobIndex:ma}=Eg,Ew=ct,ow=iw,rw=XQ,Dt=ct,BC=ct,$Q=new kI(To*ac),Ng=new wA($Q,Ug),La=XQ,nw=new wA(La,Ug),aw=XQ,ug=new wA(Dt,Ug),kB=new wA(BC,Ug),sw=new K({startSlot:zQ,count:ht},{typeName:"BlobSidecarsByRangeRequest",jsonCase:"eth2"}),hw=new K({blockRoot:vQ,index:ma},{typeName:"BlobIdentifier",jsonCase:"eth2"}),Ae=new K({...rt.fields,blobGasUsed:WQ,excessBlobGas:WQ},{typeName:"ExecutionPayload",jsonCase:"eth2"}),CC=new K({...gC.fields,blobGasUsed:WQ,excessBlobGas:WQ},{typeName:"ExecutionPayloadHeader",jsonCase:"eth2"}),Ie=new K({...rg.fields,executionPayload:Ae,blsToExecutionChanges:GB.fields.blsToExecutionChanges,blobKzgCommitments:ug},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),ge=new K({...at.fields,body:Ie},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),Ka=new K({message:ge,signature:lt},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),Ya=new EI(XQ,sc),ba=new K({index:ma,blob:$Q,kzgCommitment:Dt,kzgProof:BC,signedBlockHeader:Oi,kzgCommitmentInclusionProof:Ya},{typeName:"BlobSidecar",jsonCase:"eth2"}),lw=new wA(ba,Ug),Ta=new K({commitments:ug,proofs:kB,blobs:Ng},{typeName:"BlobsBundle",jsonCase:"eth2"}),qa=new K({...rg.fields,executionPayloadHeader:CC,blsToExecutionChanges:GB.fields.blsToExecutionChanges,blobKzgCommitments:ug},{typeName:"BlindedBeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),Ut=new K({...st.fields,body:qa},{typeName:"BlindedBeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),cw=new K({message:Ut,signature:lt},{typeName:"SignedBlindedBeaconBlock",jsonCase:"eth2"}),Va=new K({header:CC,blobKzgCommitments:ug,value:ew,pubkey:tw},{typeName:"BuilderBid",jsonCase:"eth2"}),Dw=new K({message:Va,signature:lt},{typeName:"SignedBuilderBid",jsonCase:"eth2"}),Uw=new K({executionPayload:Ae,blobsBundle:Ta},{typeName:"ExecutionPayloadAndBlobsBundle",jsonCase:"eth2"}),fw=new K({genesisTime:ht,genesisValidatorsRoot:vQ,slot:KA,fork:_g,latestBlockHeader:TI,blockRoots:yg,stateRoots:dg,historicalRoots:new wA(vQ,Jg),eth1Data:og,eth1DataVotes:jg,eth1DepositIndex:ht,validators:Zg,balances:Pg,randaoMixes:Og,slashings:xg,previousEpochParticipation:FI,currentEpochParticipation:FI,justificationBits:zg,previousJustifiedCheckpoint:jA,currentJustifiedCheckpoint:jA,finalizedCheckpoint:jA,inactivityScores:dB,currentSyncCommittee:AI,nextSyncCommittee:AI,latestExecutionPayloadHeader:CC,nextWithdrawalIndex:ng.fields.nextWithdrawalIndex,nextWithdrawalValidatorIndex:ng.fields.nextWithdrawalValidatorIndex,historicalSummaries:ng.fields.historicalSummaries},{typeName:"BeaconState",jsonCase:"eth2"}),pI=new K({beacon:TI,execution:CC,executionBranch:$g.fields.executionBranch},{typeName:"LightClientHeader",jsonCase:"eth2"}),ja=new K({header:pI,currentSyncCommittee:AI,currentSyncCommitteeBranch:qQ.fields.currentSyncCommitteeBranch},{typeName:"LightClientBootstrap",jsonCase:"eth2"}),_a=new K({attestedHeader:pI,nextSyncCommittee:AI,nextSyncCommitteeBranch:AC.fields.nextSyncCommitteeBranch,finalizedHeader:pI,finalityBranch:AC.fields.finalityBranch,syncAggregate:DI,signatureSlot:zQ},{typeName:"LightClientUpdate",jsonCase:"eth2"}),Sw=new K({attestedHeader:pI,finalizedHeader:pI,finalityBranch:Ct.fields.finalityBranch,syncAggregate:DI,signatureSlot:zQ},{typeName:"LightClientFinalityUpdate",jsonCase:"eth2"}),ww=new K({attestedHeader:pI,syncAggregate:DI,signatureSlot:zQ},{typeName:"LightClientOptimisticUpdate",jsonCase:"eth2"}),yw=new K({snapshot:ja,validUpdates:new wA(_a,Hg*wI)},{typeName:"LightClientStore",jsonCase:"eth2"}),Za=new K({...xQ.fields,parentBeaconBlockRoot:vQ},{typeName:"PayloadAttributes",jsonCase:"eth2"}),dw=new K({...jC.fields,payloadAttributes:Za},{typeName:"SSEPayloadAttributes",jsonCase:"eth2"}),Nw=new K({block:ge,kzgProofs:kB,blobs:Ng},{typeName:"BlockContents",jsonCase:"eth2"}),uw=new K({signedBlock:Ka,kzgProofs:kB,blobs:Ng},{typeName:"SignedBlockContents",jsonCase:"eth2"}),Be=Object.freeze(Object.defineProperty({__proto__:null,BLSFieldElement:rw,BeaconBlock:ge,BeaconBlockBody:Ie,BeaconState:fw,BlindedBeaconBlock:Ut,BlindedBeaconBlockBody:qa,BlindedBlob:La,BlindedBlobs:nw,Blob:$Q,BlobIdentifier:hw,BlobKzgCommitments:ug,BlobSidecar:ba,BlobSidecars:lw,BlobSidecarsByRangeRequest:sw,Blobs:Ng,BlobsBundle:Ta,BlockContents:Nw,BuilderBid:Va,ExecutionPayload:Ae,ExecutionPayloadAndBlobsBundle:Uw,ExecutionPayloadHeader:CC,G1Point:Ew,G2Point:ow,KZGCommitment:Dt,KZGProof:BC,KZGProofs:kB,KzgCommitmentInclusionProof:Ya,LightClientBootstrap:ja,LightClientFinalityUpdate:Sw,LightClientHeader:pI,LightClientOptimisticUpdate:ww,LightClientStore:yw,LightClientUpdate:_a,PayloadAttributes:Za,SSEPayloadAttributes:dw,SignedBeaconBlock:Ka,SignedBlindedBeaconBlock:cw,SignedBlockContents:uw,SignedBuilderBid:Dw,VersionedHash:aw},Symbol.toStringTag,{value:"Module"})),{Epoch:ft,Gwei:ZC,UintNum64:Ce,Slot:Qe,Root:St,BLSSignature:vI,UintBn256:Rw,Bytes32:PC,BLSPubkey:QC,DepositIndex:Gw,UintBn64:kw,ExecutionAddress:Pa,ValidatorIndex:eC,CommitteeIndex:Fw}=Eg,Oa=new EI(PC,mc),wt=new EI(PC,Mg),xa=new EI(PC,lQ),za=new GQ(UC*Pe),va=new ig(Pe),yt=new bI(eC,UC*Pe),ee=new K({aggregationBits:za,data:yB,signature:vI,committeeBits:va},{typeName:"Attestation",jsonCase:"eth2"}),Jw=new K({committeeIndex:Fw,attesterIndex:eC,data:yB,signature:vI},{typeName:"SingleAttestation",jsonCase:"eth2"}),pw=new K({attestingIndices:yt,data:yB,signature:vI},{typeName:"IndexedAttestation",jsonCase:"eth2"}),dt=new K({attestingIndices:yt,data:Xi,signature:vI},{typeName:"IndexedAttestation",jsonCase:"eth2"}),Nt=new K({attestation1:dt,attestation2:dt},{typeName:"AttesterSlashing",jsonCase:"eth2"}),Wa=new K({aggregatorIndex:eC,aggregate:ee,selectionProof:vI},{typeName:"AggregateAndProof",jsonCase:"eth2",cachePermanentRootStruct:!0}),Hw=new K({message:Wa,signature:vI},{typeName:"SignedAggregateAndProof",jsonCase:"eth2"}),Xa=new K({pubkey:QC,withdrawalCredentials:PC,amount:Ce,signature:vI,index:Gw},{typeName:"DepositRequest",jsonCase:"eth2"}),$a=new wA(Xa,Uc),As=new K({sourceAddress:Pa,validatorPubkey:QC,amount:ZC},{typeName:"WithdrawalRequest",jsonCase:"eth2"}),Is=new wA(As,fc),gs=new K({sourceAddress:Pa,sourcePubkey:QC,targetPubkey:QC},{typeName:"ConsolidationRequest",jsonCase:"eth2"}),Bs=new wA(gs,Dc),OC=new K({deposits:$a,withdrawals:Is,consolidations:Bs},{typeName:"ExecutionRequests",jsonCase:"eth2"}),ie=CC,te=Ae,Ee=new K({randaoReveal:$A.fields.randaoReveal,eth1Data:$A.fields.eth1Data,graffiti:$A.fields.graffiti,proposerSlashings:$A.fields.proposerSlashings,attesterSlashings:new wA(Nt,Fo),attestations:new wA(ee,Jo),deposits:$A.fields.deposits,voluntaryExits:$A.fields.voluntaryExits,syncAggregate:rg.fields.syncAggregate,executionPayload:te,blsToExecutionChanges:GB.fields.blsToExecutionChanges,blobKzgCommitments:Ie.fields.blobKzgCommitments,executionRequests:OC},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),xC=new K({...ge.fields,body:Ee},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),oe=new K({message:xC,signature:vI},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),Cs=new K({randaoReveal:$A.fields.randaoReveal,eth1Data:$A.fields.eth1Data,graffiti:$A.fields.graffiti,proposerSlashings:$A.fields.proposerSlashings,attesterSlashings:new wA(Nt,Fo),attestations:new wA(ee,Jo),deposits:$A.fields.deposits,voluntaryExits:$A.fields.voluntaryExits,syncAggregate:DI,executionPayloadHeader:ie,blsToExecutionChanges:GB.fields.blsToExecutionChanges,blobKzgCommitments:Ie.fields.blobKzgCommitments,executionRequests:OC},{typeName:"BlindedBeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),Qs=new K({...Ut.fields,body:Cs},{typeName:"BlindedBeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),Mw=new K({message:Qs,signature:vI},{typeName:"SignedBlindedBeaconBlock",jsonCase:"eth2"}),es=new K({header:ie,blobKzgCommitments:ug,executionRequests:OC,value:Rw,pubkey:QC},{typeName:"BuilderBid",jsonCase:"eth2"}),mw=new K({message:es,signature:vI},{typeName:"SignedBuilderBid",jsonCase:"eth2"}),is=new K({pubkey:QC,withdrawalCredentials:PC,amount:Ce,signature:vI,slot:Qe},{typeName:"PendingDeposit",jsonCase:"eth2"}),ts=new wA(is,hc),Es=new K({validatorIndex:eC,amount:ZC,withdrawableEpoch:ft},{typeName:"PendingPartialWithdrawal",jsonCase:"eth2"}),os=new wA(Es,lc),rs=new K({sourceIndex:eC,targetIndex:eC},{typeName:"PendingConsolidation",jsonCase:"eth2"}),ns=new wA(rs,cc),zC=new K({genesisTime:Ce,genesisValidatorsRoot:St,slot:KA,fork:_g,latestBlockHeader:TI,blockRoots:yg,stateRoots:dg,historicalRoots:new wA(St,Jg),eth1Data:og,eth1DataVotes:jg,eth1DepositIndex:Ce,validators:Zg,balances:Pg,randaoMixes:Og,slashings:xg,previousEpochParticipation:FI,currentEpochParticipation:FI,justificationBits:zg,previousJustifiedCheckpoint:jA,currentJustifiedCheckpoint:jA,finalizedCheckpoint:jA,inactivityScores:dB,currentSyncCommittee:AI,nextSyncCommittee:AI,latestExecutionPayloadHeader:ie,nextWithdrawalIndex:ng.fields.nextWithdrawalIndex,nextWithdrawalValidatorIndex:ng.fields.nextWithdrawalValidatorIndex,historicalSummaries:ng.fields.historicalSummaries,depositRequestsStartIndex:kw,depositBalanceToConsume:ZC,exitBalanceToConsume:ZC,earliestExitEpoch:ft,consolidationBalanceToConsume:ZC,earliestConsolidationEpoch:ft,pendingDeposits:ts,pendingPartialWithdrawals:os,pendingConsolidations:ns},{typeName:"BeaconState",jsonCase:"eth2"}),as=new K({header:pI,currentSyncCommittee:AI,currentSyncCommitteeBranch:Oa},{typeName:"LightClientBootstrap",jsonCase:"eth2"}),ss=new K({attestedHeader:pI,nextSyncCommittee:AI,nextSyncCommitteeBranch:xa,finalizedHeader:pI,finalityBranch:wt,syncAggregate:DI,signatureSlot:Qe},{typeName:"LightClientUpdate",jsonCase:"eth2"}),Lw=new K({attestedHeader:pI,finalizedHeader:pI,finalityBranch:wt,syncAggregate:DI,signatureSlot:Qe},{typeName:"LightClientFinalityUpdate",jsonCase:"eth2"}),Kw=new K({attestedHeader:pI,syncAggregate:DI,signatureSlot:Qe},{typeName:"LightClientOptimisticUpdate",jsonCase:"eth2"}),Yw=new K({snapshot:as,validUpdates:new wA(ss,Hg*wI)},{typeName:"LightClientStore",jsonCase:"eth2"}),hs=new K({...xQ.fields,parentBeaconBlockRoot:St},{typeName:"PayloadAttributes",jsonCase:"eth2"}),bw=new K({...jC.fields,payloadAttributes:hs},{typeName:"SSEPayloadAttributes",jsonCase:"eth2"}),Tw=new K({block:xC,kzgProofs:kB,blobs:Ng},{typeName:"BlockContents",jsonCase:"eth2"}),qw=new K({signedBlock:oe,kzgProofs:kB,blobs:Ng},{typeName:"BlockContents",jsonCase:"eth2"}),ut=Object.freeze(Object.defineProperty({__proto__:null,AggregateAndProof:Wa,AggregationBits:za,Attestation:ee,AttesterSlashing:Nt,AttestingIndices:yt,BeaconBlock:xC,BeaconBlockBody:Ee,BeaconState:zC,BlindedBeaconBlock:Qs,BlindedBeaconBlockBody:Cs,BlockContents:Tw,BuilderBid:es,CommitteeBits:va,ConsolidationRequest:gs,ConsolidationRequests:Bs,CurrentSyncCommitteeBranch:Oa,DepositRequest:Xa,DepositRequests:$a,ExecutionPayload:te,ExecutionPayloadHeader:ie,ExecutionRequests:OC,FinalityBranch:wt,IndexedAttestation:pw,IndexedAttestationBigint:dt,LightClientBootstrap:as,LightClientFinalityUpdate:Lw,LightClientOptimisticUpdate:Kw,LightClientStore:Yw,LightClientUpdate:ss,NextSyncCommitteeBranch:xa,PayloadAttributes:hs,PendingConsolidation:rs,PendingConsolidations:ns,PendingDeposit:is,PendingDeposits:ts,PendingPartialWithdrawal:Es,PendingPartialWithdrawals:os,SSEPayloadAttributes:bw,SignedAggregateAndProof:Hw,SignedBeaconBlock:oe,SignedBlindedBeaconBlock:Mw,SignedBlockContents:qw,SignedBuilderBid:mw,SingleAttestation:Jw,WithdrawalRequest:As,WithdrawalRequests:Is},Symbol.toStringTag,{value:"Module"})),{Root:Vw,ColumnIndex:re,RowIndex:jw,Bytes32:_w,Slot:ls,UintNum64:cs,ValidatorIndex:Zw}=Eg,Pw=BC,Ow=$Q,xw=new K({...ea.fields,custodyGroupCount:cs},{typeName:"Metadata",jsonCase:"eth2"}),zw=new K({...Aa.fields,earliestAvailableSlot:ls},{typeName:"Status",jsonCase:"eth2"}),ne=new kI(To*Sc),Rt=new wA(ne,Ug),vw=new wA(Rt,qB),Ww=new wA(ne,Ug*qB),Ds=new EI(_w,yc),ae=new wA(BC,wc*Ug),Us=new pQ(Zw,(X1+1)*wI),vC=new K({index:re,column:Rt,kzgCommitments:ug,kzgProofs:kB,signedBlockHeader:Oi,kzgCommitmentsInclusionProof:Ds},{typeName:"DataColumnSidecar",jsonCase:"eth2"}),Xw=new wA(vC,qB),$w=new K({cell:ne,kzgProof:BC,columnIndex:re,rowIndex:jw},{typeName:"MatrixEntry",jsonCase:"eth2"}),Ay=new K({blockRoot:Vw,columns:new bI(re,qB)},{typeName:"DataColumnsByRootIdentifier",jsonCase:"eth2"}),Iy=new K({startSlot:ls,count:cs,columns:new bI(re,qB)},{typeName:"DataColumnSidecarsByRangeRequest",jsonCase:"eth2"}),Ss=xC,gy=oe,ws=new K({commitments:ug,proofs:ae,blobs:Ng},{typeName:"BlobsBundle",jsonCase:"eth2"}),By=new K({executionPayload:te,blobsBundle:ws},{typeName:"ExecutionPayloadAndBlobsBundle",jsonCase:"eth2"}),ys=new K({...zC.fields,proposerLookahead:Us},{typeName:"BeaconState",jsonCase:"eth2"}),Cy=new K({block:xC,kzgProofs:ae,blobs:Ng},{typeName:"BlockContents",jsonCase:"eth2"}),Qy=new K({signedBlock:oe,kzgProofs:ae,blobs:Ng},{typeName:"SignedBlockContents",jsonCase:"eth2"}),ds=Object.freeze(Object.defineProperty({__proto__:null,BeaconBlock:Ss,BeaconState:ys,Blob:Ow,BlobsBundle:ws,BlockContents:Cy,Cell:ne,DataColumn:Rt,DataColumnSidecar:vC,DataColumnSidecars:Xw,DataColumnSidecarsByRangeRequest:Iy,DataColumns:vw,DataColumnsByRootIdentifier:Ay,ExecutionPayloadAndBlobsBundle:By,ExtendedMatrix:Ww,KZGProof:Pw,KZGProofs:ae,KzgCommitmentsInclusionProof:Ds,MatrixEntry:$w,Metadata:xw,ProposerLookahead:Us,SignedBeaconBlock:gy,SignedBlockContents:Qy,Status:zw},Symbol.toStringTag,{value:"Module"})),{Boolean:Ns}=Eg,{Gwei:Gt,ExecutionAddress:se,ValidatorIndex:kt,Epoch:us,BLSSignature:FB,Bytes32:he,Root:JB,Slot:WC,UintBn64:Rs,UintNum64:AB,BLSPubkey:ey,Uint8:iy,BuilderIndex:le,EpochInf:Gs}=Eg,ks=new K({pubkey:ey,version:iy,executionAddress:se,balance:AB,depositEpoch:Gs,withdrawableEpoch:Gs},{typeName:"Builder",jsonCase:"eth2"}),Ft=new K({feeRecipient:se,amount:AB,builderIndex:le},{typeName:"BuilderPendingWithdrawal",jsonCase:"eth2"}),Fs=new K({weight:AB,withdrawal:Ft},{typeName:"BuilderPendingPayment",jsonCase:"eth2"}),ce=new K({beaconBlockRoot:JB,slot:WC,payloadPresent:Ns,blobDataAvailable:Ns},{typeName:"PayloadAttestationData",jsonCase:"eth2"}),Js=new K({aggregationBits:new ig(po),data:ce,signature:FB},{typeName:"PayloadAttestation",jsonCase:"eth2"}),ty=new K({validatorIndex:kt,data:ce,signature:FB},{typeName:"PayloadAttestationMessage",jsonCase:"eth2"}),Ey=new K({attestingIndices:new bI(kt,po),data:ce,signature:FB},{typeName:"IndexedPayloadAttestation",jsonCase:"eth2"}),ps=new K({proposalSlot:WC,validatorIndex:kt,feeRecipient:se,gasLimit:AB},{typeName:"ProposerPreferences",jsonCase:"eth2"}),oy=new K({message:ps,signature:FB},{typeName:"SignedProposerPreferences",jsonCase:"eth2"}),Jt=new K({parentBlockHash:he,parentBlockRoot:JB,blockHash:he,prevRandao:he,feeRecipient:se,gasLimit:Rs,builderIndex:le,slot:WC,value:AB,executionPayment:AB,blobKzgCommitments:ug},{typeName:"ExecutionPayloadBid",jsonCase:"eth2"}),Hs=new K({message:Jt,signature:FB},{typeName:"SignedExecutionPayloadBid",jsonCase:"eth2"}),Ms=new K({payload:te,executionRequests:OC,builderIndex:le,beaconBlockRoot:JB,slot:WC,stateRoot:JB},{typeName:"ExecutionPayloadEnvelope",jsonCase:"eth2"}),ry=new K({message:Ms,signature:FB},{typeName:"SignedExecutionPayloadEnvelope",jsonCase:"eth2"}),ms=new K({randaoReveal:$A.fields.randaoReveal,eth1Data:$A.fields.eth1Data,graffiti:$A.fields.graffiti,proposerSlashings:$A.fields.proposerSlashings,attesterSlashings:Ee.fields.attesterSlashings,attestations:Ee.fields.attestations,deposits:$A.fields.deposits,voluntaryExits:$A.fields.voluntaryExits,syncAggregate:rg.fields.syncAggregate,blsToExecutionChanges:GB.fields.blsToExecutionChanges,signedExecutionPayloadBid:Hs,payloadAttestations:new wA(Js,dc)},{typeName:"BeaconBlockBody",jsonCase:"eth2",cachePermanentRootStruct:!0}),Ls=new K({...Ss.fields,body:ms},{typeName:"BeaconBlock",jsonCase:"eth2",cachePermanentRootStruct:!0}),ny=new K({message:Ls,signature:FB},{typeName:"SignedBeaconBlock",jsonCase:"eth2"}),ay=new K({genesisTime:AB,genesisValidatorsRoot:JB,slot:KA,fork:_g,latestBlockHeader:TI,blockRoots:yg,stateRoots:dg,historicalRoots:new wA(JB,Jg),eth1Data:og,eth1DataVotes:jg,eth1DepositIndex:AB,validators:Zg,balances:Pg,randaoMixes:Og,slashings:xg,previousEpochParticipation:FI,currentEpochParticipation:FI,justificationBits:zg,previousJustifiedCheckpoint:jA,currentJustifiedCheckpoint:jA,finalizedCheckpoint:jA,inactivityScores:dB,currentSyncCommittee:AI,nextSyncCommittee:AI,latestExecutionPayloadBid:Jt,nextWithdrawalIndex:ng.fields.nextWithdrawalIndex,nextWithdrawalValidatorIndex:ng.fields.nextWithdrawalValidatorIndex,historicalSummaries:ng.fields.historicalSummaries,depositRequestsStartIndex:Rs,depositBalanceToConsume:Gt,exitBalanceToConsume:Gt,earliestExitEpoch:us,consolidationBalanceToConsume:Gt,earliestConsolidationEpoch:us,pendingDeposits:zC.fields.pendingDeposits,pendingPartialWithdrawals:zC.fields.pendingPartialWithdrawals,pendingConsolidations:zC.fields.pendingConsolidations,proposerLookahead:ys.fields.proposerLookahead,builders:new wA(ks,Nc),nextWithdrawalBuilderIndex:le,executionPayloadAvailability:new ig(Oe),builderPendingPayments:new EI(Fs,2*wI),builderPendingWithdrawals:new wA(Ft,uc),latestBlockHash:he,payloadExpectedWithdrawals:OQ},{typeName:"BeaconState",jsonCase:"eth2"}),Ks=new K({index:vC.fields.index,column:vC.fields.column,kzgProofs:vC.fields.kzgProofs,slot:WC,beaconBlockRoot:JB},{typeName:"DataColumnSidecar",jsonCase:"eth2"}),sy=new wA(Ks,qB),hy=Object.freeze(Object.defineProperty({__proto__:null,BeaconBlock:Ls,BeaconBlockBody:ms,BeaconState:ay,Builder:ks,BuilderPendingPayment:Fs,BuilderPendingWithdrawal:Ft,DataColumnSidecar:Ks,DataColumnSidecars:sy,ExecutionPayloadBid:Jt,ExecutionPayloadEnvelope:Ms,IndexedPayloadAttestation:Ey,PayloadAttestation:Js,PayloadAttestationData:ce,PayloadAttestationMessage:ty,ProposerPreferences:ps,SignedBeaconBlock:ny,SignedExecutionPayloadBid:Hs,SignedExecutionPayloadEnvelope:ry,SignedProposerPreferences:oy},Symbol.toStringTag,{value:"Module"}));var iC;(function(I){I.builder="builder",I.engine="engine"})(iC||(iC={}));const Rg={[nA.phase0]:{...vg},[nA.altair]:{...vg,...uB},[nA.bellatrix]:{...vg,...uB,...IC},[nA.capella]:{...vg,...uB,...IC,..._C},[nA.deneb]:{...vg,...uB,...IC,..._C,...Be},[nA.electra]:{...vg,...uB,...IC,..._C,...Be,...ut},[nA.fulu]:{...vg,...uB,...IC,..._C,...Be,...ut,...ds},[nA.gloas]:{...vg,...uB,...IC,..._C,...Be,...ut,...ds,...hy}},yA=Rg[nA.phase0],WI=Rg[nA.altair],Ys=Rg[nA.bellatrix],ag=Rg[nA.capella],XC=Rg[nA.deneb],uI=Rg[nA.electra],pt=Rg[nA.fulu],bs=Rg[nA.gloas];function pA(I,A){const g=Rg[I];if(g===void 0)throw Error(`SSZ types for fork ${I} are not defined`);return A===void 0?g:g[A]}const RI=Object.freeze(Object.defineProperty({__proto__:null,BLSPubkey:vB,BLSSignature:LQ,BlobIndex:Vi,Boolean:BI,BuilderIndex:kn,Byte:wn,Bytes20:yn,Bytes32:Li,Bytes4:YC,Bytes48:Ki,Bytes8:mi,Bytes96:Yi,ColumnIndex:Zi,CommitteeIndex:DB,CustodyIndex:Yn,DepositIndex:Jn,Domain:Ln,DomainType:mn,Epoch:PI,EpochInf:Rn,ExecutionAddress:_i,ForkDigest:ji,Gwei:pn,ParticipationFlags:Kn,Root:UB,RowIndex:bn,Slot:KA,SubcommitteeIndex:qi,SyncPeriod:Gn,Uint16:Nn,Uint32:bi,Uint8:dn,UintBn128:un,UintBn256:Ti,UintBn64:cB,UintNum64:RA,UintNumInf64:mQ,ValidatorIndex:XA,Version:Mn,Wei:Hn,WithdrawalIndex:Fn,altair:WI,bellatrix:Ys,capella:ag,deneb:XC,electra:uI,fulu:pt,gloas:bs,phase0:yA,sszTypesFor:pA},Symbol.toStringTag,{value:"Module"}));function dA(I,A=1/0){if(NI(I))return new wA(I,A);if(Gi(I))return new bI(I,A);throw Error(`Unknown type ${I.typeName}`)}const ly=new K({proposerIndex:XA,total:RA,attestations:RA,syncAggregate:RA,proposerSlashings:RA,attesterSlashings:RA},{jsonCase:"eth2"}),Ts=new K({head:RA,target:RA,source:RA,inclusionDelay:RA,inactivity:RA},{jsonCase:"eth2"}),cy=new K({...Ts.fields,effectiveBalance:RA},{jsonCase:"eth2"}),Dy=new K({...Ts.fields,validatorIndex:XA},{jsonCase:"eth2"}),Uy=new K({idealRewards:dA(cy),totalRewards:dA(Dy)},{jsonCase:"eth2"}),fy=dA(new K({validatorIndex:XA,reward:RA},{jsonCase:"eth2"}));function Gg(I){const A=I;return A.finalityBranch!==void 0&&A.finalityBranch.length===Mg}function qs(I){const A=I;return A.finalityBranch!==void 0&&A.finalityBranch.length===Mg}function Sy(I){const A={name:nA.phase0,seq:LA.phase0,epoch:Gc,version:I.GENESIS_FORK_VERSION,prevVersion:I.GENESIS_FORK_VERSION,prevForkName:nA.phase0},g={name:nA.altair,seq:LA.altair,epoch:I.ALTAIR_FORK_EPOCH,version:I.ALTAIR_FORK_VERSION,prevVersion:I.GENESIS_FORK_VERSION,prevForkName:nA.phase0},B={name:nA.bellatrix,seq:LA.bellatrix,epoch:I.BELLATRIX_FORK_EPOCH,version:I.BELLATRIX_FORK_VERSION,prevVersion:I.ALTAIR_FORK_VERSION,prevForkName:nA.altair},e={name:nA.capella,seq:LA.capella,epoch:I.CAPELLA_FORK_EPOCH,version:I.CAPELLA_FORK_VERSION,prevVersion:I.BELLATRIX_FORK_VERSION,prevForkName:nA.bellatrix},Q={name:nA.deneb,seq:LA.deneb,epoch:I.DENEB_FORK_EPOCH,version:I.DENEB_FORK_VERSION,prevVersion:I.CAPELLA_FORK_VERSION,prevForkName:nA.capella},C={name:nA.electra,seq:LA.electra,epoch:I.ELECTRA_FORK_EPOCH,version:I.ELECTRA_FORK_VERSION,prevVersion:I.DENEB_FORK_VERSION,prevForkName:nA.deneb},i={name:nA.fulu,seq:LA.fulu,epoch:I.FULU_FORK_EPOCH,version:I.FULU_FORK_VERSION,prevVersion:I.ELECTRA_FORK_VERSION,prevForkName:nA.electra},o={name:nA.gloas,seq:LA.gloas,epoch:I.GLOAS_FORK_EPOCH,version:I.GLOAS_FORK_VERSION,prevVersion:I.FULU_FORK_VERSION,prevForkName:nA.fulu},D={phase0:A,altair:g,bellatrix:B,capella:e,deneb:Q,electra:C,fulu:i,gloas:o},a=Object.values(D),U=Object.values(D).reverse(),J=[...I.BLOB_SCHEDULE].sort((S,R)=>R.EPOCH-S.EPOCH),f=[...a.map(S=>({fork:S.name,epoch:S.epoch})),...I.BLOB_SCHEDULE.map(S=>({fork:U.find(R=>S.EPOCH>=R.epoch)?.name??A.name,epoch:S.EPOCH}))].filter(({epoch:S})=>S!==1/0).sort((S,R)=>S.epoch-R.epoch),y=[...f].reverse();return{forks:D,forksAscendingEpochOrder:a,forksDescendingEpochOrder:U,forkBoundariesAscendingEpochOrder:f,forkBoundariesDescendingEpochOrder:y,getForkInfo(S){const R=Math.floor(Math.max(S,0)/wI);return this.getForkInfoAtEpoch(R)},getForkInfoAtEpoch(S){return D[this.getForkBoundaryAtEpoch(S).fork]},getForkBoundaryAtEpoch(S){S<0&&(S=0);for(const R of y)if(S>=R.epoch)return R;throw Error("Unreachable as phase0 is scheduled at epoch 0")},getForkName(S){return this.getForkInfo(S).name},getForkSeq(S){return this.getForkInfo(S).seq},getForkSeqAtEpoch(S){return this.getForkInfoAtEpoch(S).seq},getForkVersion(S){return this.getForkInfo(S).version},getForkTypes(S){return pA(this.getForkName(S))},getPostBellatrixForkTypes(S){const R=this.getForkName(S);if(!aQ(R))throw Error(`Invalid slot=${S} fork=${R} for post-bellatrix fork types`);return pA(R)},getPostAltairForkTypes(S){const R=this.getForkName(S);if(!Ze(R))throw Error(`Invalid slot=${S} fork=${R} for post-altair fork types`);return pA(R)},getPostDenebForkTypes(S){const R=this.getForkName(S);if(!SI(R))throw Error(`Invalid slot=${S} fork=${R} for post-deneb fork types`);return pA(R)},getMaxBlobsPerBlock(S){switch(this.getForkInfoAtEpoch(S).name){case nA.electra:return I.MAX_BLOBS_PER_BLOCK_ELECTRA;case nA.deneb:return I.MAX_BLOBS_PER_BLOCK}return this.getBlobParameters(S).maxBlobsPerBlock},getBlobParameters(S){if(S<I.FULU_FORK_EPOCH)throw Error(`getBlobParameters is not available pre-fulu epoch=${S}`);for(const R of J)if(S>=R.EPOCH)return{epoch:R.EPOCH,maxBlobsPerBlock:R.MAX_BLOBS_PER_BLOCK};return{epoch:I.ELECTRA_FORK_EPOCH,maxBlobsPerBlock:I.MAX_BLOBS_PER_BLOCK_ELECTRA}},getAttestationDueMs(S){return Dg(S)?this.getSlotComponentDurationMs(I.ATTESTATION_DUE_BPS_GLOAS):this.getSlotComponentDurationMs(I.ATTESTATION_DUE_BPS)},getAggregateDueMs(S){return Dg(S)?this.getSlotComponentDurationMs(I.AGGREGATE_DUE_BPS_GLOAS):this.getSlotComponentDurationMs(I.AGGREGATE_DUE_BPS)},getSyncMessageDueMs(S){return Dg(S)?this.getSlotComponentDurationMs(I.SYNC_MESSAGE_DUE_BPS_GLOAS):this.getSlotComponentDurationMs(I.SYNC_MESSAGE_DUE_BPS)},getSyncContributionDueMs(S){return Dg(S)?this.getSlotComponentDurationMs(I.CONTRIBUTION_DUE_BPS_GLOAS):this.getSlotComponentDurationMs(I.CONTRIBUTION_DUE_BPS)},getProposerReorgCutoffMs(S){return this.getSlotComponentDurationMs(I.PROPOSER_REORG_CUTOFF_BPS)},getSlotComponentDurationMs(S){return Math.round(S*I.SLOT_DURATION_MS/Mc)}}}function wy(I,A){const g=new Map,B=new Map,e=new Map,Q=new Map,{forkBoundariesAscendingEpochOrder:C}=I;for(let i=0;i<C.length;i++){const o=C[i],D=C[i+1],a=o.epoch,U=D!==void 0?D.epoch:1/0;if(a===U)continue;const J=yy(I,A,a),f=De(J);Q.set(f,a),B.set(a,J),e.set(a,f)}return{genesisValidatorsRoot:A,getDomain(i,o,D){const a=Math.floor((D??i)/wI),U=I.getForkInfo(i),J=a<U.epoch?U.prevForkName:U.name,f=I.forks[J];let y=g.get(f.name);y||(y=new Map,g.set(f.name,y));let S=y.get(o);return S||(S=Vs(o,f.version,A),y.set(o,S)),S},getDomainAtFork(i,o){const D=I.forks[i];let a=g.get(D.name);a||(a=new Map,g.set(D.name,a));let U=a.get(o);return U||(U=Vs(o,D.version,A),a.set(o,U)),U},getDomainForVoluntaryExit(i,o){return i<I.DENEB_FORK_EPOCH*wI?this.getDomain(i,Mo,o):this.getDomainAtFork(nA.capella,Mo)},forkDigest2ForkBoundary(i){const o=De(i),D=Q.get(o);if(D==null)throw Error(`Unknown forkDigest ${o}`);return I.getForkBoundaryAtEpoch(D)},forkDigest2ForkBoundaryOption(i){const o=De(i),D=Q.get(o);return D==null?null:I.getForkBoundaryAtEpoch(D)},forkBoundary2ForkDigest(i){const o=B.get(i.epoch);if(!o)throw Error(`No precomputed forkDigest for ${i.epoch}`);return o},forkBoundary2ForkDigestHex(i){const o=e.get(i.epoch);if(!o)throw Error(`No precomputed forkDigest for ${i.epoch}`);return De(o)}}}function Vs(I,A,g){const B=js(A,g),e=new Uint8Array(32);return e.set(I,0),e.set(B.slice(0,28),4),e}function js(I,A){const g={currentVersion:I,genesisValidatorsRoot:A};return yA.ForkData.hashTreeRoot(g)}function De(I){return BD(typeof I=="string"?I:fg(I))}function yy(I,A,g){const B=I.getForkInfoAtEpoch(g),e=js(B.version,A);if(B.seq<LA.fulu)return e.slice(0,4);const Q=I.getBlobParameters(g);return _c(e,wD(vA.concat([Wo(Q.epoch,8,"le"),Wo(Q.maxBlobsPerBlock,8,"le")]))).slice(0,4)}function Ht(I){const A=$U(I);return{...A,...Sy(A)}}function _s(I,A){const g=Ht(I);return{...g,...wy(g,A)}}let CI;Fg=(I=>(I.lightClientOptimisticHeader="light_client_optimistic_header",I.lightClientFinalityHeader="light_client_finality_header",I.statusChange="light_client_status_change",I))(Fg||{}),function(I){I.ContentType="content-type",I.Accept="accept",I.Authorization="authorization",I.ExposeHeaders="access-control-expose-headers"}(CI||(CI={}));var HI;(function(I){I.json="application/json",I.ssz="application/octet-stream"})(HI||(HI={}));const dy=Object.values(HI);function Ny(I,A){return I!==null&&A.includes(I)}function uy(I){if(!I)return null;const A=I.split(";",1)[0].trim().toLowerCase();return Ny(A,dy)?A:null}function Ry(I,A,{bearerToken:g}){g&&!A.has(CI.Authorization)&&A.set(CI.Authorization,`Bearer ${g}`),(I.username||I.password)&&(A.has(CI.Authorization)||A.set(CI.Authorization,`Basic ${Pc(decodeURIComponent(`${I.username}:${I.password}`))}`),I.username="",I.password="")}function Mt(...I){const A=new Headers;for(const g of I)if(g)if(Array.isArray(g))for(const[B,e]of g)A.set(B,e);else if(g instanceof Headers)for(const[B,e]of g)A.set(B,e);else for(const[B,e]of Object.entries(g))A.set(B,e);return A}function sI(I,A,g=!0){const B=I[A.toLowerCase()];if(B===void 0&&g)throw Error(`${A} header is required`);return B}class Gy extends Headers{getRequired(A){const g=this.get(A);if(g===null)throw Error(`${A} header is required in response`);return g}getOrDefault(A,g){return this.get(A)??g}}var NA;(function(I){I.json="json",I.ssz="ssz"})(NA||(NA={}));function ky(I){switch(I){case HI.json:return NA.json;case HI.ssz:return NA.ssz}}const kA={writeReq:()=>({}),parseReq:()=>{},schema:{}};function tC(I){return{...I,writeReqSsz:()=>{throw Error("Not implemented")},parseReqSsz:()=>{throw Error("Not implemented")},onlySupport:NA.json}}const Fy={toJson:()=>{},fromJson:()=>{},serialize:()=>new Uint8Array,deserialize:()=>{}},VA={toJson:()=>{},fromJson:()=>{},toHeadersObject:()=>({}),fromHeaders:()=>{}},YA={data:Fy,meta:VA,isEmpty:!0};function MI(I){return{toJson:(A,g)=>I(g.version).toJson(A),fromJson:(A,g)=>I(g.version).fromJson(A),serialize:(A,g)=>I(g.version).serialize(A),deserialize:(A,g)=>I(g.version).deserialize(A)}}function Jy(I){return{...I,data:{...I.data,serialize:()=>{throw Error("Not implemented")},deserialize:()=>{throw Error("Not implemented")}},onlySupport:NA.json}}const PA={data:{toJson:I=>UQ(I,"snake"),fromJson:I=>{if(typeof I!="object"||I===null)throw Error("JSON must be of type object");return UQ(I,"camel")},serialize:()=>{throw Error("Not implemented")},deserialize:()=>{throw Error("Not implemented")}},meta:VA,onlySupport:NA.json};function OA(I){if(I=I.toLowerCase(),!(I in nA))throw Error(`Invalid version ${I}`);return I}function kg(I){if(!Ze(I))throw Error(`Invalid fork=${I} for post-altair fork types`);return pA(I)}function mI(I){if(!aQ(I))throw Error(`Invalid fork=${I} for post-bellatrix fork types`);return pA(I)}function $C(I){if(!Dg(I))throw Error(`Invalid fork=${I} for post-gloas fork types`);return pA(I)}var gA;(function(I){I[I.Uint=0]="Uint",I[I.UintRequired=1]="UintRequired",I[I.UintArray=2]="UintArray",I[I.String=3]="String",I[I.StringRequired=4]="StringRequired",I[I.StringArray=5]="StringArray",I[I.StringArrayRequired=6]="StringArrayRequired",I[I.UintOrStringRequired=7]="UintOrStringRequired",I[I.UintOrStringArray=8]="UintOrStringArray",I[I.Object=9]="Object",I[I.ObjectArray=10]="ObjectArray",I[I.AnyArray=11]="AnyArray",I[I.Boolean=12]="Boolean"})(gA||(gA={}));function py(I){return I.method==="GET"||I.req.schema.body===void 0}var IB;(function(I){I.String="String",I.Variable="Variable"})(IB||(IB={}));function Hy(I){const A=[];let g=0,B=!1;for(let e=0,Q=I.length;e<Q;e++)switch(I[e]){case"{":{if(B)throw Error(`Invalid path variable not closed: ${I}`);e>g&&A.push({type:IB.String,str:I.slice(g,e)}),g=e+1,B=!0;break}case"}":{if(!B)throw Error(`Invalid path variable not open: ${I}`);if(g===e)throw Error(`Empty variable: ${I}`);A.push({type:IB.Variable,var:I.slice(g,e)}),B=!1,g=e+1;break}}if(B)throw Error(`Invalid path variable not closed: ${I}`);return g<I.length&&A.push({type:IB.String,str:I.slice(g)}),A}function My(I){const A=Hy(I);if(A.length===1&&A[0].type===IB.String)return()=>I;const g=A.map(B=>{switch(B.type){case IB.String:return()=>B.str;case IB.Variable:{const e=B.var;return Q=>Q[e]}}});return function(B){let e="";for(const Q of g)e+=Q(B);return e}}function my(I){const A=parseInt(I,10);if(!Number.isFinite(A))throw Error(`Invalid uin64 ${I}`);return A}function Ly(I){return I.toString(10)}function AQ(I){return I?.map(A=>typeof A=="string"?A:Ly(A))}function IQ(I){return I?.map(A=>typeof A=="string"&&A.startsWith("0x")?A:my(A))}const Ue=66;function Zs(I){if(I===void 0)return;const A=fg(new TextEncoder().encode(I));return A.length>Ue?A.slice(0,Ue):A.length<Ue?A.padEnd(Ue,"0"):A}function Ps(I){if(I!==void 0)try{return new TextDecoder("utf8").decode(sA(I))}catch{return I}}function pB(I){if(I=I.toLowerCase(),I!=="true"&&I!=="false")throw Error(`Invalid boolean ${I}`);return I==="true"}const gB=new K({version:new Xg});gB.fields.version.fromJson=I=>OA(xI.fromJson(I));const gQ=new K({executionOptimistic:BI},{jsonCase:"eth2"}),mt=new K({...gQ.fields,finalized:BI},{jsonCase:"eth2"});new K({...gQ.fields,...gB.fields},{jsonCase:"eth2"});const Os=new K({...mt.fields,...gB.fields},{jsonCase:"eth2"}),xs=new K({...gQ.fields,dependentRoot:xI},{jsonCase:"eth2"});var aA;(function(I){I.Version="Eth-Consensus-Version",I.ConsensusBlockValue="Eth-Consensus-Block-Value",I.ExecutionPayloadBlinded="Eth-Execution-Payload-Blinded",I.ExecutionPayloadValue="Eth-Execution-Payload-Value",I.Finalized="Eth-Consensus-Finalized",I.DependentRoot="Eth-Consensus-Dependent-Root",I.ExecutionOptimistic="Eth-Execution-Optimistic",I.ExecutionPayloadSource="Eth-Execution-Payload-Source"})(aA||(aA={}));const Ky={toJson:I=>gQ.toJson(I),fromJson:I=>gQ.fromJson(I),toHeadersObject:I=>({[aA.ExecutionOptimistic]:I.executionOptimistic.toString(),[CI.ExposeHeaders]:aA.ExecutionOptimistic}),fromHeaders:I=>({executionOptimistic:pB(I.getOrDefault(aA.ExecutionOptimistic,"false"))})},sg={toJson:I=>gB.toJson(I),fromJson:I=>gB.fromJson(I),toHeadersObject:I=>({[aA.Version]:I.version,[CI.ExposeHeaders]:aA.Version}),fromHeaders:I=>({version:OA(I.getRequired(aA.Version))})},gI={toJson:I=>mt.toJson(I),fromJson:I=>mt.fromJson(I),toHeadersObject:I=>({[aA.ExecutionOptimistic]:I.executionOptimistic.toString(),[aA.Finalized]:I.finalized.toString(),[CI.ExposeHeaders]:[aA.ExecutionOptimistic,aA.Finalized].toString()}),fromHeaders:I=>({executionOptimistic:pB(I.getOrDefault(aA.ExecutionOptimistic,"false")),finalized:pB(I.getOrDefault(aA.Finalized,"false"))})},XI={toJson:I=>Os.toJson(I),fromJson:I=>Os.fromJson(I),toHeadersObject:I=>({[aA.ExecutionOptimistic]:I.executionOptimistic.toString(),[aA.Finalized]:I.finalized.toString(),[aA.Version]:I.version,[CI.ExposeHeaders]:[aA.ExecutionOptimistic,aA.Finalized,aA.Version].toString()}),fromHeaders:I=>({executionOptimistic:pB(I.getOrDefault(aA.ExecutionOptimistic,"false")),finalized:pB(I.getOrDefault(aA.Finalized,"false")),version:OA(I.getRequired(aA.Version))})},Lt={toJson:I=>xs.toJson(I),fromJson:I=>xs.fromJson(I),toHeadersObject:I=>({[aA.ExecutionOptimistic]:I.executionOptimistic.toString(),[aA.DependentRoot]:I.dependentRoot,[CI.ExposeHeaders]:[aA.ExecutionOptimistic,aA.DependentRoot].toString()}),fromHeaders:I=>({executionOptimistic:pB(I.getOrDefault(aA.ExecutionOptimistic,"false")),dependentRoot:I.getRequired(aA.DependentRoot)})},zs=new K({root:UB,canonical:BI,header:yA.SignedBeaconBlockHeader}),Yy=new wA(zs,1e3),vs=new K({root:UB});var Ws;(function(I){I.none="none",I.gossip="gossip",I.consensus="consensus",I.consensusAndEquivocation="consensus_and_equivocation"})(Ws||(Ws={}));const EC={writeReq:({blockId:I})=>({params:{block_id:I.toString()}}),parseReq:({params:I})=>({blockId:I.block_id}),schema:{params:{block_id:gA.StringRequired}}};function by(I){return{getBlockV2:{url:"/eth/v2/beacon/blocks/{block_id}",method:"GET",req:EC,resp:{data:MI(A=>RI[A].SignedBeaconBlock),meta:XI}},getBlindedBlock:{url:"/eth/v1/beacon/blinded_blocks/{block_id}",method:"GET",req:EC,resp:{data:MI(A=>aQ(A)?RI[A].SignedBlindedBeaconBlock:RI[A].SignedBeaconBlock),meta:XI}},getBlockAttestations:{url:"/eth/v1/beacon/blocks/{block_id}/attestations",method:"GET",req:EC,resp:{data:yA.BeaconBlockBody.fields.attestations,meta:gI}},getBlockAttestationsV2:{url:"/eth/v2/beacon/blocks/{block_id}/attestations",method:"GET",req:EC,resp:{data:MI(A=>RI[A].BeaconBlockBody.fields.attestations),meta:XI}},getBlockHeader:{url:"/eth/v1/beacon/headers/{block_id}",method:"GET",req:EC,resp:{data:zs,meta:gI}},getBlockHeaders:{url:"/eth/v1/beacon/headers",method:"GET",req:{writeReq:({slot:A,parentRoot:g})=>({query:{slot:A,parent_root:g}}),parseReq:({query:A})=>({slot:A.slot,parentRoot:A.parent_root}),schema:{query:{slot:gA.Uint,parent_root:gA.String}}},resp:{data:Yy,meta:gI}},getBlockRoot:{url:"/eth/v1/beacon/blocks/{block_id}/root",method:"GET",req:EC,resp:{data:vs,meta:gI}},publishBlock:{url:"/eth/v1/beacon/blocks",method:"POST",req:{writeReqJson:({signedBlockContents:A})=>{const g=A.signedBlock.message.slot,B=I.getForkName(g);return{body:SI(B)?pA(B).SignedBlockContents.toJson(A):pA(B).SignedBeaconBlock.toJson(A.signedBlock),headers:{[aA.Version]:I.getForkName(g)}}},parseReqJson:({body:A,headers:g})=>{let B;const e=sI(g,aA.Version,!1);return e!==void 0?B=OA(e):B=I.getForkName(A.signed_block!==void 0?A.signed_block.message.slot:A.message.slot),{signedBlockContents:SI(B)?pA(B).SignedBlockContents.fromJson(A):{signedBlock:RI[B].SignedBeaconBlock.fromJson(A)}}},writeReqSsz:({signedBlockContents:A})=>{const g=A.signedBlock.message.slot,B=I.getForkName(g);return{body:SI(B)?pA(B).SignedBlockContents.serialize(A):pA(B).SignedBeaconBlock.serialize(A.signedBlock),headers:{[aA.Version]:I.getForkName(g)}}},parseReqSsz:({body:A,headers:g})=>{const B=OA(sI(g,aA.Version));return{signedBlockContents:SI(B)?pA(B).SignedBlockContents.deserialize(A):{signedBlock:RI[B].SignedBeaconBlock.deserialize(A)}}},schema:{body:gA.Object,headers:{[aA.Version]:gA.String}}},resp:YA,init:{requestWireFormat:NA.ssz}},publishBlockV2:{url:"/eth/v2/beacon/blocks",method:"POST",req:{writeReqJson:({signedBlockContents:A,broadcastValidation:g})=>{const B=A.signedBlock.message.slot,e=I.getForkName(B);return{body:SI(e)&&!Dg(e)?pA(e).SignedBlockContents.toJson(A):pA(e).SignedBeaconBlock.toJson(A.signedBlock),headers:{[aA.Version]:e},query:{broadcast_validation:g}}},parseReqJson:({body:A,headers:g,query:B})=>{const e=OA(sI(g,aA.Version));return{signedBlockContents:SI(e)&&!Dg(e)?pA(e).SignedBlockContents.fromJson(A):{signedBlock:RI[e].SignedBeaconBlock.fromJson(A)},broadcastValidation:B.broadcast_validation}},writeReqSsz:({signedBlockContents:A,broadcastValidation:g})=>{const B=A.signedBlock.message.slot,e=I.getForkName(B);return{body:SI(e)&&!Dg(e)?pA(e).SignedBlockContents.serialize(A):pA(e).SignedBeaconBlock.serialize(A.signedBlock),headers:{[aA.Version]:e},query:{broadcast_validation:g}}},parseReqSsz:({body:A,headers:g,query:B})=>{const e=OA(sI(g,aA.Version));return{signedBlockContents:SI(e)&&!Dg(e)?pA(e).SignedBlockContents.deserialize(A):{signedBlock:RI[e].SignedBeaconBlock.deserialize(A)},broadcastValidation:B.broadcast_validation}},schema:{body:gA.Object,query:{broadcast_validation:gA.String},headers:{[aA.Version]:gA.String}}},resp:YA,init:{requestWireFormat:NA.ssz}},publishBlindedBlock:{url:"/eth/v1/beacon/blinded_blocks",method:"POST",req:{writeReqJson:({signedBlindedBlock:A})=>{const g=I.getForkName(A.message.slot);return{body:mI(g).SignedBlindedBeaconBlock.toJson(A),headers:{[aA.Version]:g}}},parseReqJson:({body:A,headers:g})=>{let B;const e=sI(g,aA.Version,!1);return e!==void 0?B=OA(e):B=I.getForkName(A.message.slot),{signedBlindedBlock:mI(B).SignedBlindedBeaconBlock.fromJson(A)}},writeReqSsz:({signedBlindedBlock:A})=>{const g=I.getForkName(A.message.slot);return{body:mI(g).SignedBlindedBeaconBlock.serialize(A),headers:{[aA.Version]:g}}},parseReqSsz:({body:A,headers:g})=>{const B=OA(sI(g,aA.Version));return{signedBlindedBlock:mI(B).SignedBlindedBeaconBlock.deserialize(A)}},schema:{body:gA.Object,headers:{[aA.Version]:gA.String}}},resp:YA,init:{requestWireFormat:NA.ssz}},publishBlindedBlockV2:{url:"/eth/v2/beacon/blinded_blocks",method:"POST",req:{writeReqJson:({signedBlindedBlock:A,broadcastValidation:g})=>{const B=I.getForkName(A.message.slot);return{body:mI(B).SignedBlindedBeaconBlock.toJson(A),headers:{[aA.Version]:B},query:{broadcast_validation:g}}},parseReqJson:({body:A,headers:g,query:B})=>{const e=OA(sI(g,aA.Version));return{signedBlindedBlock:mI(e).SignedBlindedBeaconBlock.fromJson(A),broadcastValidation:B.broadcast_validation}},writeReqSsz:({signedBlindedBlock:A,broadcastValidation:g})=>{const B=I.getForkName(A.message.slot);return{body:mI(B).SignedBlindedBeaconBlock.serialize(A),headers:{[aA.Version]:B},query:{broadcast_validation:g}}},parseReqSsz:({body:A,headers:g,query:B})=>{const e=OA(sI(g,aA.Version));return{signedBlindedBlock:mI(e).SignedBlindedBeaconBlock.deserialize(A),broadcastValidation:B.broadcast_validation}},schema:{body:gA.Object,query:{broadcast_validation:gA.String},headers:{[aA.Version]:gA.String}}},resp:YA,init:{requestWireFormat:NA.ssz}},publishExecutionPayloadEnvelope:{url:"/eth/v1/beacon/execution_payload_envelope",method:"POST",req:{writeReqJson:({signedExecutionPayloadEnvelope:A})=>{const g=I.getForkName(A.message.slot);return{body:$C(g).SignedExecutionPayloadEnvelope.toJson(A),headers:{[aA.Version]:g}}},parseReqJson:({body:A,headers:g})=>{const B=OA(sI(g,aA.Version));return{signedExecutionPayloadEnvelope:$C(B).SignedExecutionPayloadEnvelope.fromJson(A)}},writeReqSsz:({signedExecutionPayloadEnvelope:A})=>{const g=I.getForkName(A.message.slot);return{body:$C(g).SignedExecutionPayloadEnvelope.serialize(A),headers:{[aA.Version]:g}}},parseReqSsz:({body:A,headers:g})=>{const B=OA(sI(g,aA.Version));return{signedExecutionPayloadEnvelope:$C(B).SignedExecutionPayloadEnvelope.deserialize(A)}},schema:{body:gA.Object,headers:{[aA.Version]:gA.String}}},resp:YA,init:{requestWireFormat:NA.ssz}},getBlobSidecars:{url:"/eth/v1/beacon/blob_sidecars/{block_id}",method:"GET",req:{writeReq:({blockId:A,indices:g})=>({params:{block_id:A.toString()},query:{indices:g}}),parseReq:({params:A,query:g})=>({blockId:A.block_id,indices:g.indices}),schema:{params:{block_id:gA.StringRequired},query:{indices:gA.UintArray}}},resp:{data:XC.BlobSidecars,meta:XI}},getBlobs:{url:"/eth/v1/beacon/blobs/{block_id}",method:"GET",req:{writeReq:({blockId:A,versionedHashes:g})=>({params:{block_id:A.toString()},query:{versioned_hashes:g}}),parseReq:({params:A,query:g})=>({blockId:A.block_id,versionedHashes:g.versioned_hashes?.map(B=>B.toLowerCase())}),schema:{params:{block_id:gA.StringRequired},query:{versioned_hashes:gA.StringArray}}},resp:{data:XC.Blobs,meta:gI}}}}const BB=dA(yA.Attestation),fe=dA(uI.SingleAttestation),Xs=dA(yA.Attestation),Ty=dA(uI.Attestation),$s=dA(yA.AttesterSlashing),qy=dA(uI.AttesterSlashing),Vy=dA(yA.ProposerSlashing),jy=dA(yA.SignedVoluntaryExit),BQ=dA(ag.SignedBLSToExecutionChange),Se=dA(WI.SyncCommitteeMessage);function _y(I){return{getPoolAttestations:{url:"/eth/v1/beacon/pool/attestations",method:"GET",req:{writeReq:({slot:A,committeeIndex:g})=>({query:{slot:A,committee_index:g}}),parseReq:({query:A})=>({slot:A.slot,committeeIndex:A.committee_index}),schema:{query:{slot:gA.Uint,committee_index:gA.Uint}}},resp:{data:Xs,meta:VA}},getPoolAttestationsV2:{url:"/eth/v2/beacon/pool/attestations",method:"GET",req:{writeReq:({slot:A,committeeIndex:g})=>({query:{slot:A,committee_index:g}}),parseReq:({query:A})=>({slot:A.slot,committeeIndex:A.committee_index}),schema:{query:{slot:gA.Uint,committee_index:gA.Uint}}},resp:{data:MI(A=>WA(A)?Ty:Xs),meta:sg}},getPoolAttesterSlashings:{url:"/eth/v1/beacon/pool/attester_slashings",method:"GET",req:kA,resp:{data:$s,meta:VA}},getPoolAttesterSlashingsV2:{url:"/eth/v2/beacon/pool/attester_slashings",method:"GET",req:kA,resp:{data:MI(A=>WA(A)?qy:$s),meta:sg}},getPoolProposerSlashings:{url:"/eth/v1/beacon/pool/proposer_slashings",method:"GET",req:kA,resp:{data:Vy,meta:VA}},getPoolVoluntaryExits:{url:"/eth/v1/beacon/pool/voluntary_exits",method:"GET",req:kA,resp:{data:jy,meta:VA}},getPoolBLSToExecutionChanges:{url:"/eth/v1/beacon/pool/bls_to_execution_changes",method:"GET",req:kA,resp:{data:BQ,meta:VA}},submitPoolAttestations:{url:"/eth/v1/beacon/pool/attestations",method:"POST",req:{writeReqJson:({signedAttestations:A})=>({body:BB.toJson(A)}),parseReqJson:({body:A})=>({signedAttestations:BB.fromJson(A)}),writeReqSsz:({signedAttestations:A})=>({body:BB.serialize(A)}),parseReqSsz:({body:A})=>({signedAttestations:BB.deserialize(A)}),schema:{body:gA.ObjectArray}},resp:YA},submitPoolAttestationsV2:{url:"/eth/v2/beacon/pool/attestations",method:"POST",req:{writeReqJson:({signedAttestations:A})=>{const g=I.getForkName(A[0]?.data.slot??0);return{body:WA(g)?fe.toJson(A):BB.toJson(A),headers:{[aA.Version]:g}}},parseReqJson:({body:A,headers:g})=>{const B=OA(sI(g,aA.Version));return{signedAttestations:WA(B)?fe.fromJson(A):BB.fromJson(A)}},writeReqSsz:({signedAttestations:A})=>{const g=I.getForkName(A[0]?.data.slot??0);return{body:WA(g)?fe.serialize(A):BB.serialize(A),headers:{[aA.Version]:g}}},parseReqSsz:({body:A,headers:g})=>{const B=OA(sI(g,aA.Version));return{signedAttestations:WA(B)?fe.deserialize(A):BB.deserialize(A)}},schema:{body:gA.ObjectArray,headers:{[aA.Version]:gA.String}}},resp:YA},submitPoolAttesterSlashings:{url:"/eth/v1/beacon/pool/attester_slashings",method:"POST",req:{writeReqJson:({attesterSlashing:A})=>({body:yA.AttesterSlashing.toJson(A)}),parseReqJson:({body:A})=>({attesterSlashing:yA.AttesterSlashing.fromJson(A)}),writeReqSsz:({attesterSlashing:A})=>({body:yA.AttesterSlashing.serialize(A)}),parseReqSsz:({body:A})=>({attesterSlashing:yA.AttesterSlashing.deserialize(A)}),schema:{body:gA.Object}},resp:YA},submitPoolAttesterSlashingsV2:{url:"/eth/v2/beacon/pool/attester_slashings",method:"POST",req:{writeReqJson:({attesterSlashing:A})=>{const g=I.getForkName(Number(A.attestation1.data.slot));return{body:WA(g)?uI.AttesterSlashing.toJson(A):yA.AttesterSlashing.toJson(A),headers:{[aA.Version]:g}}},parseReqJson:({body:A,headers:g})=>{const B=OA(sI(g,aA.Version));return{attesterSlashing:WA(B)?uI.AttesterSlashing.fromJson(A):yA.AttesterSlashing.fromJson(A)}},writeReqSsz:({attesterSlashing:A})=>{const g=I.getForkName(Number(A.attestation1.data.slot));return{body:WA(g)?uI.AttesterSlashing.serialize(A):yA.AttesterSlashing.serialize(A),headers:{[aA.Version]:g}}},parseReqSsz:({body:A,headers:g})=>{const B=OA(sI(g,aA.Version));return{attesterSlashing:WA(B)?uI.AttesterSlashing.deserialize(A):yA.AttesterSlashing.deserialize(A)}},schema:{body:gA.Object,headers:{[aA.Version]:gA.String}}},resp:YA},submitPoolProposerSlashings:{url:"/eth/v1/beacon/pool/proposer_slashings",method:"POST",req:{writeReqJson:({proposerSlashing:A})=>({body:yA.ProposerSlashing.toJson(A)}),parseReqJson:({body:A})=>({proposerSlashing:yA.ProposerSlashing.fromJson(A)}),writeReqSsz:({proposerSlashing:A})=>({body:yA.ProposerSlashing.serialize(A)}),parseReqSsz:({body:A})=>({proposerSlashing:yA.ProposerSlashing.deserialize(A)}),schema:{body:gA.Object}},resp:YA},submitPoolVoluntaryExit:{url:"/eth/v1/beacon/pool/voluntary_exits",method:"POST",req:{writeReqJson:({signedVoluntaryExit:A})=>({body:yA.SignedVoluntaryExit.toJson(A)}),parseReqJson:({body:A})=>({signedVoluntaryExit:yA.SignedVoluntaryExit.fromJson(A)}),writeReqSsz:({signedVoluntaryExit:A})=>({body:yA.SignedVoluntaryExit.serialize(A)}),parseReqSsz:({body:A})=>({signedVoluntaryExit:yA.SignedVoluntaryExit.deserialize(A)}),schema:{body:gA.Object}},resp:YA},submitPoolBLSToExecutionChange:{url:"/eth/v1/beacon/pool/bls_to_execution_changes",method:"POST",req:{writeReqJson:({blsToExecutionChanges:A})=>({body:BQ.toJson(A)}),parseReqJson:({body:A})=>({blsToExecutionChanges:BQ.fromJson(A)}),writeReqSsz:({blsToExecutionChanges:A})=>({body:BQ.serialize(A)}),parseReqSsz:({body:A})=>({blsToExecutionChanges:BQ.deserialize(A)}),schema:{body:gA.ObjectArray}},resp:YA},submitPoolSyncCommitteeSignatures:{url:"/eth/v1/beacon/pool/sync_committees",method:"POST",req:{writeReqJson:({signatures:A})=>({body:Se.toJson(A)}),parseReqJson:({body:A})=>({signatures:Se.fromJson(A)}),writeReqSsz:({signatures:A})=>({body:Se.serialize(A)}),parseReqSsz:({body:A})=>({signatures:Se.deserialize(A)}),schema:{body:gA.ObjectArray}},resp:YA}}}function Zy(I){return{getBlockRewards:{url:"/eth/v1/beacon/rewards/blocks/{block_id}",method:"GET",req:{writeReq:({blockId:A})=>({params:{block_id:A.toString()}}),parseReq:({params:A})=>({blockId:A.block_id}),schema:{params:{block_id:gA.StringRequired}}},resp:{data:ly,meta:gI}},getAttestationsRewards:{url:"/eth/v1/beacon/rewards/attestations/{epoch}",method:"POST",req:tC({writeReqJson:({epoch:A,validatorIds:g})=>({params:{epoch:A},body:AQ(g)||[]}),parseReqJson:({params:A,body:g})=>({epoch:A.epoch,validatorIds:IQ(g)}),schema:{params:{epoch:gA.UintRequired},body:gA.UintOrStringArray}}),resp:{data:Uy,meta:gI}},getSyncCommitteeRewards:{url:"/eth/v1/beacon/rewards/sync_committee/{block_id}",method:"POST",req:tC({writeReqJson:({blockId:A,validatorIds:g})=>({params:{block_id:A.toString()},body:AQ(g)||[]}),parseReqJson:({params:A,body:g})=>({blockId:A.block_id,validatorIds:IQ(g)}),schema:{params:{block_id:gA.StringRequired},body:gA.UintOrStringArray}}),resp:{data:fy,meta:gI}}}}const Py=new K({randao:UB}),Oy=new K({previousJustified:yA.Checkpoint,currentJustified:yA.Checkpoint,finalized:yA.Checkpoint},{jsonCase:"eth2"}),A0=new K({index:XA,balance:RA,status:new Xg,validator:yA.Validator}),xy=new K({index:XA,pubkey:vB,activationEpoch:RA},{jsonCase:"eth2"}),zy=new K({index:DB,slot:KA,validators:dA(XA,UC)}),vy=new K({index:XA,balance:RA}),Wy=new K({validators:dA(XA),validatorAggregates:dA(dA(XA))},{jsonCase:"eth2"}),I0=dA(A0),Xy=dA(xy),$y=dA(zy),g0=dA(vy),HB={writeReq:({stateId:I})=>({params:{state_id:I.toString()}}),parseReq:({params:I})=>({stateId:I.state_id}),schema:{params:{state_id:gA.StringRequired}}};function Ad(I){return{getEpochCommittees:{url:"/eth/v1/beacon/states/{state_id}/committees",method:"GET",req:{writeReq:({stateId:A,epoch:g,index:B,slot:e})=>({params:{state_id:A.toString()},query:{epoch:g,index:B,slot:e}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,epoch:g.epoch,index:g.index,slot:g.slot}),schema:{params:{state_id:gA.StringRequired},query:{slot:gA.Uint,epoch:gA.Uint,index:gA.Uint}}},resp:{data:$y,meta:gI}},getEpochSyncCommittees:{url:"/eth/v1/beacon/states/{state_id}/sync_committees",method:"GET",req:{writeReq:({stateId:A,epoch:g})=>({params:{state_id:A.toString()},query:{epoch:g}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,epoch:g.epoch}),schema:{params:{state_id:gA.StringRequired},query:{epoch:gA.Uint}}},resp:{data:Wy,meta:gI}},getStateFinalityCheckpoints:{url:"/eth/v1/beacon/states/{state_id}/finality_checkpoints",method:"GET",req:HB,resp:{data:Oy,meta:gI}},getStateFork:{url:"/eth/v1/beacon/states/{state_id}/fork",method:"GET",req:HB,resp:{data:yA.Fork,meta:gI}},getStateRoot:{url:"/eth/v1/beacon/states/{state_id}/root",method:"GET",req:HB,resp:{data:vs,meta:gI}},getStateRandao:{url:"/eth/v1/beacon/states/{state_id}/randao",method:"GET",req:{writeReq:({stateId:A,epoch:g})=>({params:{state_id:A.toString()},query:{epoch:g}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,epoch:g.epoch}),schema:{params:{state_id:gA.StringRequired},query:{epoch:gA.Uint}}},resp:{data:Py,meta:gI}},getStateValidator:{url:"/eth/v1/beacon/states/{state_id}/validators/{validator_id}",method:"GET",req:{writeReq:({stateId:A,validatorId:g})=>({params:{state_id:A.toString(),validator_id:g}}),parseReq:({params:A})=>({stateId:A.state_id,validatorId:A.validator_id}),schema:{params:{state_id:gA.StringRequired,validator_id:gA.StringRequired}}},resp:{onlySupport:NA.json,data:A0,meta:gI}},getStateValidators:{url:"/eth/v1/beacon/states/{state_id}/validators",method:"GET",req:{writeReq:({stateId:A,validatorIds:g,statuses:B})=>({params:{state_id:A.toString()},query:{id:g,status:B}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,validatorIds:g.id,statuses:g.status}),schema:{params:{state_id:gA.StringRequired},query:{id:gA.UintOrStringArray,status:gA.StringArray}}},resp:{onlySupport:NA.json,data:I0,meta:gI}},postStateValidators:{url:"/eth/v1/beacon/states/{state_id}/validators",method:"POST",req:tC({writeReqJson:({stateId:A,validatorIds:g,statuses:B})=>({params:{state_id:A.toString()},body:{ids:AQ(g),statuses:B}}),parseReqJson:({params:A,body:g={}})=>({stateId:A.state_id,validatorIds:IQ(g.ids),statuses:g.statuses??void 0}),schema:{params:{state_id:gA.StringRequired},body:gA.Object}}),resp:{onlySupport:NA.json,data:I0,meta:gI}},postStateValidatorIdentities:{url:"/eth/v1/beacon/states/{state_id}/validator_identities",method:"POST",req:tC({writeReqJson:({stateId:A,validatorIds:g})=>({params:{state_id:A.toString()},body:AQ(g)||[]}),parseReqJson:({params:A,body:g=[]})=>({stateId:A.state_id,validatorIds:IQ(g)}),schema:{params:{state_id:gA.StringRequired},body:gA.UintOrStringArray}}),resp:{data:Xy,meta:gI}},getStateValidatorBalances:{url:"/eth/v1/beacon/states/{state_id}/validator_balances",method:"GET",req:{writeReq:({stateId:A,validatorIds:g})=>({params:{state_id:A.toString()},query:{id:g}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,validatorIds:g.id}),schema:{params:{state_id:gA.StringRequired},query:{id:gA.UintOrStringArray}}},resp:{data:g0,meta:gI}},postStateValidatorBalances:{url:"/eth/v1/beacon/states/{state_id}/validator_balances",method:"POST",req:tC({writeReqJson:({stateId:A,validatorIds:g})=>({params:{state_id:A.toString()},body:AQ(g)||[]}),parseReqJson:({params:A,body:g=[]})=>({stateId:A.state_id,validatorIds:IQ(g)}),schema:{params:{state_id:gA.StringRequired},body:gA.UintOrStringArray}}),resp:{data:g0,meta:gI}},getPendingDeposits:{url:"/eth/v1/beacon/states/{state_id}/pending_deposits",method:"GET",req:HB,resp:{data:uI.PendingDeposits,meta:XI}},getPendingPartialWithdrawals:{url:"/eth/v1/beacon/states/{state_id}/pending_partial_withdrawals",method:"GET",req:HB,resp:{data:uI.PendingPartialWithdrawals,meta:XI}},getPendingConsolidations:{url:"/eth/v1/beacon/states/{state_id}/pending_consolidations",method:"GET",req:HB,resp:{data:uI.PendingConsolidations,meta:XI}},getProposerLookahead:{url:"/eth/v1/beacon/states/{state_id}/proposer_lookahead",method:"GET",req:HB,resp:{data:pt.ProposerLookahead,meta:XI}}}}function Id(I){return{getGenesis:{url:"/eth/v1/beacon/genesis",method:"GET",req:kA,resp:{data:yA.Genesis,meta:VA}},...by(I),..._y(I),...Ad(),...Zy()}}const gd=new K({chainId:RA,address:_i},{jsonCase:"eth2"}),Bd=dA(yA.Fork);function Cd(I){return{getDepositContract:{url:"/eth/v1/config/deposit_contract",method:"GET",req:kA,resp:{data:gd,meta:VA}},getForkSchedule:{url:"/eth/v1/config/fork_schedule",method:"GET",req:kA,resp:{data:Bd,meta:VA}},getSpec:{url:"/eth/v1/config/spec",method:"GET",req:kA,resp:Jy({data:{toJson:A=>A,fromJson:A=>{if(typeof A!="object"||A===null)throw Error("JSON must be of type object");return A}},meta:VA})}}}const oI=new Xg,Qd=new K({executionPayloadBlockHash:oI,executionPayloadNumber:RA,executionStatus:oI,slot:KA,blockRoot:oI,parentRoot:oI,stateRoot:oI,targetRoot:oI,timeliness:BI,justifiedEpoch:PI,justifiedRoot:oI,finalizedEpoch:PI,finalizedRoot:oI,unrealizedJustifiedEpoch:PI,unrealizedJustifiedRoot:oI,unrealizedFinalizedEpoch:PI,unrealizedFinalizedRoot:oI,parent:oI,weight:bi,bestChild:oI,bestDescendant:oI},{jsonCase:"eth2"}),ed=new K({slot:KA,root:oI,executionOptimistic:BI},{jsonCase:"eth2"}),id=new K({slot:KA,blockRoot:oI,parentRoot:oI,justifiedEpoch:PI,finalizedEpoch:PI,weight:RA,validity:new Xg,executionBlockHash:oI},{jsonCase:"eth2"}),td=new K({justifiedCheckpoint:yA.Checkpoint,finalizedCheckpoint:yA.Checkpoint,forkChoiceNodes:dA(id)},{jsonCase:"eth2"}),Ed=dA(Qd),od=dA(ed);function rd(I){return{getDebugChainHeadsV2:{url:"/eth/v2/debug/beacon/heads",method:"GET",req:kA,resp:{data:od,meta:VA,onlySupport:NA.json}},getDebugForkChoice:{url:"/eth/v1/debug/fork_choice",method:"GET",req:kA,resp:{data:td,meta:VA,onlySupport:NA.json,transform:{toResponse:A=>({...A}),fromResponse:A=>({data:A})}}},getProtoArrayNodes:{url:"/eth/v0/debug/forkchoice",method:"GET",req:kA,resp:{data:Ed,meta:VA,onlySupport:NA.json}},getStateV2:{url:"/eth/v2/debug/beacon/states/{state_id}",method:"GET",req:{writeReq:({stateId:A})=>({params:{state_id:A.toString()}}),parseReq:({params:A})=>({stateId:A.state_id}),schema:{params:{state_id:gA.StringRequired}}},resp:{data:MI(A=>RI[A].BeaconState),meta:XI},init:{timeoutMs:3e5}},getDebugDataColumnSidecars:{url:"/eth/v1/debug/beacon/data_column_sidecars/{block_id}",method:"GET",req:{writeReq:({blockId:A,indices:g})=>({params:{block_id:A.toString()},query:{indices:g}}),parseReq:({params:A,query:g})=>({blockId:A.block_id,indices:g.indices}),schema:{params:{block_id:gA.StringRequired},query:{indices:gA.UintArray}}},resp:{data:MI(A=>Ro(A)?pA(A).DataColumnSidecars:pt.DataColumnSidecars),meta:XI}}}}const rI=new Xg,nd=new K({blockRoot:rI,index:Vi,slot:KA,kzgCommitment:rI,versionedHash:rI},{typeName:"BlobSidecarSSE",jsonCase:"eth2"}),ad=new K({blockRoot:rI,index:Zi,slot:KA,kzgCommitments:new bI(rI,Ug)},{typeName:"DataColumnSidecarSSE",jsonCase:"eth2"});var fA;(function(I){I.head="head",I.block="block",I.blockGossip="block_gossip",I.attestation="attestation",I.singleAttestation="single_attestation",I.voluntaryExit="voluntary_exit",I.proposerSlashing="proposer_slashing",I.attesterSlashing="attester_slashing",I.blsToExecutionChange="bls_to_execution_change",I.finalizedCheckpoint="finalized_checkpoint",I.chainReorg="chain_reorg",I.contributionAndProof="contribution_and_proof",I.lightClientOptimisticUpdate="light_client_optimistic_update",I.lightClientFinalityUpdate="light_client_finality_update",I.payloadAttributes="payload_attributes",I.blobSidecar="blob_sidecar",I.dataColumnSidecar="data_column_sidecar"})(fA||(fA={})),fA.head+"",fA.head,fA.block+"",fA.block,fA.blockGossip+"",fA.blockGossip,fA.attestation+"",fA.attestation,fA.singleAttestation+"",fA.singleAttestation,fA.voluntaryExit+"",fA.voluntaryExit,fA.proposerSlashing+"",fA.proposerSlashing,fA.attesterSlashing+"",fA.attesterSlashing,fA.blsToExecutionChange+"",fA.blsToExecutionChange,fA.finalizedCheckpoint+"",fA.finalizedCheckpoint,fA.chainReorg+"",fA.chainReorg,fA.contributionAndProof+"",fA.contributionAndProof,fA.lightClientOptimisticUpdate+"",fA.lightClientOptimisticUpdate,fA.lightClientFinalityUpdate+"",fA.lightClientFinalityUpdate,fA.payloadAttributes+"",fA.payloadAttributes,fA.blobSidecar+"",fA.blobSidecar,fA.dataColumnSidecar+"",fA.dataColumnSidecar;function sd(I){return{eventstream:{url:"/eth/v1/events",method:"GET",req:{writeReq:({topics:A})=>({query:{topics:A}}),parseReq:({query:A})=>({topics:A.topics}),schema:{query:{topics:gA.StringArrayRequired}}},resp:YA}}}function hd(I){const A=g=>({toJson:({data:B,version:e})=>({data:g(e).toJson(B),version:e}),fromJson:B=>{const{version:e}=gB.fromJson(B);return{data:g(e).fromJson(B.data),version:e}}});return{[fA.head]:new K({slot:KA,block:rI,state:rI,epochTransition:BI,previousDutyDependentRoot:rI,currentDutyDependentRoot:rI,executionOptimistic:BI},{jsonCase:"eth2"}),[fA.block]:new K({slot:KA,block:rI,executionOptimistic:BI},{jsonCase:"eth2"}),[fA.blockGossip]:new K({slot:KA,block:rI},{jsonCase:"eth2"}),[fA.attestation]:{toJson:g=>{const B=I.getForkName(g.data.slot);return pA(B).Attestation.toJson(g)},fromJson:g=>{const B=I.getForkName(g.data.slot);return pA(B).Attestation.fromJson(g)}},[fA.singleAttestation]:uI.SingleAttestation,[fA.voluntaryExit]:yA.SignedVoluntaryExit,[fA.proposerSlashing]:yA.ProposerSlashing,[fA.attesterSlashing]:{toJson:g=>{const B=I.getForkName(Number(g.attestation1.data.slot));return pA(B).AttesterSlashing.toJson(g)},fromJson:g=>{const B=I.getForkName(Number(g.attestation1.data.slot));return pA(B).AttesterSlashing.fromJson(g)}},[fA.blsToExecutionChange]:ag.SignedBLSToExecutionChange,[fA.finalizedCheckpoint]:new K({block:rI,state:rI,epoch:PI,executionOptimistic:BI},{jsonCase:"eth2"}),[fA.chainReorg]:new K({slot:KA,depth:RA,oldHeadBlock:rI,newHeadBlock:rI,oldHeadState:rI,newHeadState:rI,epoch:PI,executionOptimistic:BI},{jsonCase:"eth2"}),[fA.contributionAndProof]:WI.SignedContributionAndProof,[fA.payloadAttributes]:A(g=>mI(g).SSEPayloadAttributes),[fA.blobSidecar]:nd,[fA.dataColumnSidecar]:ad,[fA.lightClientOptimisticUpdate]:A(g=>kg(g).LightClientOptimisticUpdate),[fA.lightClientFinalityUpdate]:A(g=>kg(g).LightClientFinalityUpdate)}}function ld(I){const A=hd(I);return{toJson:g=>A[g.type].toJson(g.message),fromJson:(g,B)=>A[g].fromJson(B)}}const B0={...aB,PRESET_BASE:KI.gnosis,CONFIG_NAME:"gnosis",TERMINAL_TOTAL_DIFFICULTY:BigInt("8626000000000000000000058750000000000000000000"),SECONDS_PER_SLOT:5,SLOT_DURATION_MS:5e3,SECONDS_PER_ETH1_BLOCK:6,ETH1_FOLLOW_DISTANCE:1024,CHURN_LIMIT_QUOTIENT:4096,MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT:2,DEPOSIT_CHAIN_ID:100,DEPOSIT_NETWORK_ID:100,DEPOSIT_CONTRACT_ADDRESS:sA("0x0b98057ea310f4d31f2a452b414647007d1645d9"),MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS:16384,MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS:16384,MIN_GENESIS_TIME:1638968400,MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:4096,GENESIS_FORK_VERSION:sA("0x00000064"),GENESIS_DELAY:6e3,ALTAIR_FORK_VERSION:sA("0x01000064"),ALTAIR_FORK_EPOCH:512,BELLATRIX_FORK_VERSION:sA("0x02000064"),BELLATRIX_FORK_EPOCH:385536,CAPELLA_FORK_VERSION:sA("0x03000064"),CAPELLA_FORK_EPOCH:648704,DENEB_FORK_VERSION:sA("0x04000064"),DENEB_FORK_EPOCH:889856,ELECTRA_FORK_VERSION:sA("0x05000064"),ELECTRA_FORK_EPOCH:1337856,FULU_FORK_VERSION:sA("0x06000064"),FULU_FORK_EPOCH:1714688,GLOAS_FORK_VERSION:sA("0x07000064"),GLOAS_FORK_EPOCH:1/0,MAX_BLOBS_PER_BLOCK:2,MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT:64e9,BLOB_SIDECAR_SUBNET_COUNT_ELECTRA:2,MAX_BLOBS_PER_BLOCK_ELECTRA:2,MAX_REQUEST_BLOB_SIDECARS_ELECTRA:256,BLOB_SCHEDULE:[]},cd={...B0,CONFIG_NAME:"chiado",TERMINAL_TOTAL_DIFFICULTY:BigInt("231707791542740786049188744689299064356246512"),DEPOSIT_CHAIN_ID:10200,DEPOSIT_NETWORK_ID:10200,DEPOSIT_CONTRACT_ADDRESS:sA("0xb97036A26259B7147018913bD58a774cf91acf25"),MIN_GENESIS_TIME:1665396e3,MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:6e3,GENESIS_FORK_VERSION:sA("0x0000006f"),GENESIS_DELAY:300,ALTAIR_FORK_VERSION:sA("0x0100006f"),ALTAIR_FORK_EPOCH:90,BELLATRIX_FORK_VERSION:sA("0x0200006f"),BELLATRIX_FORK_EPOCH:180,CAPELLA_FORK_VERSION:sA("0x0300006f"),CAPELLA_FORK_EPOCH:244224,DENEB_FORK_VERSION:sA("0x0400006f"),DENEB_FORK_EPOCH:516608,ELECTRA_FORK_VERSION:sA("0x0500006f"),ELECTRA_FORK_EPOCH:948224,FULU_FORK_VERSION:sA("0x0600006f"),FULU_FORK_EPOCH:1353216,GLOAS_FORK_VERSION:sA("0x0700006f"),GLOAS_FORK_EPOCH:1/0,BLOB_SCHEDULE:[]},CQ={...aB,CONFIG_NAME:"ephemery",MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:64,MIN_GENESIS_TIME:1638471600,GENESIS_FORK_VERSION:sA("0x1000101b"),GENESIS_DELAY:300,ALTAIR_FORK_VERSION:sA("0x2000101b"),ALTAIR_FORK_EPOCH:0,BELLATRIX_FORK_VERSION:sA("0x3000101b"),BELLATRIX_FORK_EPOCH:0,TERMINAL_TOTAL_DIFFICULTY:BigInt("0"),CAPELLA_FORK_VERSION:sA("0x4000101b"),CAPELLA_FORK_EPOCH:0,DENEB_FORK_VERSION:sA("0x5000101b"),DENEB_FORK_EPOCH:0,ELECTRA_FORK_VERSION:sA("0x6000101b"),ELECTRA_FORK_EPOCH:0,FULU_FORK_VERSION:sA("0x7000101b"),FULU_FORK_EPOCH:0,GLOAS_FORK_VERSION:sA("0x8000101b"),GLOAS_FORK_EPOCH:1/0,DEPOSIT_CHAIN_ID:39438e3,DEPOSIT_NETWORK_ID:39438e3,ETH1_FOLLOW_DISTANCE:12,BLOB_SCHEDULE:[{EPOCH:2048,MAX_BLOBS_PER_BLOCK:12},{EPOCH:4096,MAX_BLOBS_PER_BLOCK:15}]},C0=6048e5,Kt=Math.floor(Date.now()-CQ.MIN_GENESIS_TIME)/C0,Yt={...CQ,MIN_GENESIS_TIME:C0*Kt+CQ.MIN_GENESIS_TIME,DEPOSIT_CHAIN_ID:CQ.DEPOSIT_CHAIN_ID+Kt,DEPOSIT_NETWORK_ID:CQ.DEPOSIT_NETWORK_ID+Kt},Dd={...aB,CONFIG_NAME:"hoodi",MIN_GENESIS_TIME:1742212800,GENESIS_DELAY:600,GENESIS_FORK_VERSION:sA("0x10000910"),ALTAIR_FORK_VERSION:sA("0x20000910"),ALTAIR_FORK_EPOCH:0,BELLATRIX_FORK_VERSION:sA("0x30000910"),BELLATRIX_FORK_EPOCH:0,TERMINAL_TOTAL_DIFFICULTY:BigInt("0"),CAPELLA_FORK_VERSION:sA("0x40000910"),CAPELLA_FORK_EPOCH:0,DENEB_FORK_VERSION:sA("0x50000910"),DENEB_FORK_EPOCH:0,ELECTRA_FORK_VERSION:sA("0x60000910"),ELECTRA_FORK_EPOCH:2048,FULU_FORK_VERSION:sA("0x70000910"),FULU_FORK_EPOCH:50688,GLOAS_FORK_VERSION:sA("0x80000910"),GLOAS_FORK_EPOCH:1/0,SECONDS_PER_ETH1_BLOCK:12,DEPOSIT_CHAIN_ID:560048,DEPOSIT_NETWORK_ID:560048,BLOB_SCHEDULE:[{EPOCH:52480,MAX_BLOBS_PER_BLOCK:15},{EPOCH:54016,MAX_BLOBS_PER_BLOCK:21}]},Ud={...aB,CONFIG_NAME:"mainnet",DEPOSIT_CONTRACT_ADDRESS:sA("0x00000000219ab540356cBB839Cbe05303d7705Fa"),DEPOSIT_CHAIN_ID:1,DEPOSIT_NETWORK_ID:1,MIN_GENESIS_TIME:1606824e3,GENESIS_DELAY:604800},fd={...aB,CONFIG_NAME:"sepolia",MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:1300,MIN_GENESIS_TIME:1655647200,GENESIS_FORK_VERSION:sA("0x90000069"),GENESIS_DELAY:86400,ALTAIR_FORK_VERSION:sA("0x90000070"),ALTAIR_FORK_EPOCH:50,BELLATRIX_FORK_VERSION:sA("0x90000071"),BELLATRIX_FORK_EPOCH:100,TERMINAL_TOTAL_DIFFICULTY:BigInt("17000000000000000"),CAPELLA_FORK_VERSION:sA("0x90000072"),CAPELLA_FORK_EPOCH:56832,DENEB_FORK_VERSION:sA("0x90000073"),DENEB_FORK_EPOCH:132608,ELECTRA_FORK_VERSION:sA("0x90000074"),ELECTRA_FORK_EPOCH:222464,FULU_FORK_VERSION:sA("0x90000075"),FULU_FORK_EPOCH:272640,GLOAS_FORK_VERSION:sA("0x90000076"),GLOAS_FORK_EPOCH:1/0,DEPOSIT_CHAIN_ID:11155111,DEPOSIT_NETWORK_ID:11155111,DEPOSIT_CONTRACT_ADDRESS:sA("0x7f02C3E3c98b133055B8B348B2Ac625669Ed295D"),BLOB_SCHEDULE:[{EPOCH:274176,MAX_BLOBS_PER_BLOCK:15},{EPOCH:275712,MAX_BLOBS_PER_BLOCK:21}]},oC={mainnet:Ud,gnosis:B0,sepolia:fd,hoodi:Dd,chiado:cd,ephemery:Yt},Sd={mainnet:{genesisTime:1606824023,genesisValidatorsRoot:"0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95"},gnosis:{genesisTime:1638993340,genesisValidatorsRoot:"0xf5dcb5564e829aab27264b9becd5dfaa017085611224cb3036f573368dbb9d47"},sepolia:{genesisTime:1655733600,genesisValidatorsRoot:"0xd8ea171f3c94aea21ebc42a1ed61052acf3f9209c00e4efbaaddac09ed9b8078"},hoodi:{genesisTime:1742213400,genesisValidatorsRoot:"0x212f13fc4df078b6cb7db228f1c8307566dcecf900867401a92023d7ba99cb5f"},chiado:{genesisTime:1665396300,genesisValidatorsRoot:"0x9d642dac73058fbf39c0ae41ab1e34e4d889043cb199851ded7095bc99eb4c1e"},ephemery:{genesisTime:Yt.MIN_GENESIS_TIME+Yt.GENESIS_DELAY,genesisValidatorsRoot:"0x0000000000000000000000000000000000000000000000000000000000000000"}},wd=new wA(UB,1e4);function yd(I){let A;const g=()=>{if(A===void 0){const B=Sd[I.CONFIG_NAME]?.genesisValidatorsRoot;A=_s(I,B?sA(B):Fc)}return A};return{getLightClientUpdatesByRange:{url:"/eth/v1/beacon/light_client/updates",method:"GET",req:{writeReq:({startPeriod:B,count:e})=>({query:{start_period:B,count:e}}),parseReq:({query:B})=>({startPeriod:B.start_period,count:B.count}),schema:{query:{start_period:gA.UintRequired,count:gA.UintRequired}}},resp:{data:{toJson:(B,e)=>{const Q=[];for(const[C,i]of B.entries())Q.push(kg(e.versions[C]).LightClientUpdate.toJson(i));return Q},fromJson:(B,e)=>{const Q=B,C=[];for(let i=0;i<Q.length;i++){const o=e.versions[i];C.push(kg(o).LightClientUpdate.fromJson(Q[i]))}return C},serialize:(B,e)=>{const Q=[];for(const[C,i]of B.entries()){const o=e.versions[C],D=g(),a=Math.floor(i.attestedHeader.beacon.slot/wI),U=D.forkBoundary2ForkDigest(D.getForkBoundaryAtEpoch(a)),J=kg(o).LightClientUpdate.serialize(i),f=RA.serialize(4+J.length);Q.push(f,U,J)}return vA.concat(Q)},deserialize:B=>{let e=0;const Q=[];for(;e<B.length;){const C=RA.deserialize(B.subarray(e,e+8)),i=ji.deserialize(B.subarray(e+8,e+12)),{fork:o}=g().forkDigest2ForkBoundary(i);Q.push(kg(o).LightClientUpdate.deserialize(B.subarray(e+12,e+8+C))),e+=8+C}return Q}},meta:{toJson:B=>B,fromJson:B=>B,toHeadersObject:B=>({[aA.Version]:B.versions.join(",")}),fromHeaders:B=>{const e=B.getOrDefault(aA.Version,"");return{versions:e===""?[]:e.split(",")}}},transform:{toResponse:(B,e)=>{const Q=B,C=[];for(let i=0;i<Q.length;i++)C.push({data:Q[i],version:e.versions[i]});return C},fromResponse:B=>{if(!Array.isArray(B))throw Error("JSON is not an array");const e=[],Q={versions:[]};for(const{data:C,version:i}of B)e.push(C),Q.versions.push(OA(i));return{data:e,meta:Q}}}}},getLightClientOptimisticUpdate:{url:"/eth/v1/beacon/light_client/optimistic_update",method:"GET",req:kA,resp:{data:MI(B=>kg(B).LightClientOptimisticUpdate),meta:sg}},getLightClientFinalityUpdate:{url:"/eth/v1/beacon/light_client/finality_update",method:"GET",req:kA,resp:{data:MI(B=>kg(B).LightClientFinalityUpdate),meta:sg}},getLightClientBootstrap:{url:"/eth/v1/beacon/light_client/bootstrap/{block_root}",method:"GET",req:{writeReq:({blockRoot:B})=>({params:{block_root:B}}),parseReq:({params:B})=>({blockRoot:B.block_root}),schema:{params:{block_root:gA.StringRequired}}},resp:{data:MI(B=>kg(B).LightClientBootstrap),meta:sg}},getLightClientCommitteeRoot:{url:"/eth/v0/beacon/light_client/committee_root",method:"GET",req:{writeReq:({startPeriod:B,count:e})=>({query:{start_period:B,count:e}}),parseReq:({query:B})=>({startPeriod:B.start_period,count:B.count}),schema:{query:{start_period:gA.UintRequired,count:gA.UintRequired}}},resp:{data:wd,meta:VA}}}}const dd=new K({slot:KA,historicalSummaries:ag.HistoricalSummaries,proof:dA(mi)},{jsonCase:"eth2"});function Nd(I){return{writeHeapdump:{url:"/eth/v1/lodestar/write_heapdump",method:"POST",req:{writeReq:({thread:A,dirpath:g})=>({query:{thread:A,dirpath:g}}),parseReq:({query:A})=>({thread:A.thread,dirpath:A.dirpath}),schema:{query:{thread:gA.String,dirpath:gA.String}}},resp:PA},writeProfile:{url:"/eth/v1/lodestar/write_profile",method:"POST",req:{writeReq:({thread:A,duration:g,dirpath:B})=>({query:{thread:A,duration:g,dirpath:B}}),parseReq:({query:A})=>({thread:A.thread,duration:A.duration,dirpath:A.dirpath}),schema:{query:{thread:gA.String,duration:gA.Uint,dirpath:gA.String}}},resp:PA},getLatestWeakSubjectivityCheckpointEpoch:{url:"/eth/v1/lodestar/ws_epoch",method:"GET",req:kA,resp:PA},getSyncChainsDebugState:{url:"/eth/v1/lodestar/sync_chains_debug_state",method:"GET",req:kA,resp:PA},getGossipQueueItems:{url:"/eth/v1/lodestar/gossip_queue_items/:gossipType",method:"GET",req:{writeReq:({gossipType:A})=>({params:{gossipType:A}}),parseReq:({params:A})=>({gossipType:A.gossipType}),schema:{params:{gossipType:gA.StringRequired}}},resp:PA},getRegenQueueItems:{url:"/eth/v1/lodestar/regen_queue_items",method:"GET",req:kA,resp:PA},getBlockProcessorQueueItems:{url:"/eth/v1/lodestar/block_processor_queue_items",method:"GET",req:kA,resp:PA},getStateCacheItems:{url:"/eth/v1/lodestar/state_cache_items",method:"GET",req:kA,resp:PA},getGossipPeerScoreStats:{url:"/eth/v1/lodestar/gossip_peer_score_stats",method:"GET",req:kA,resp:PA},getLodestarPeerScoreStats:{url:"/eth/v1/lodestar/lodestar_peer_score_stats",method:"GET",req:kA,resp:PA},runGC:{url:"/eth/v1/lodestar/gc",method:"POST",req:kA,resp:YA},dropStateCache:{url:"/eth/v1/lodestar/drop_state_cache",method:"POST",req:kA,resp:YA},connectPeer:{url:"/eth/v1/lodestar/connect_peer",method:"POST",req:{writeReq:({peerId:A,multiaddrs:g})=>({query:{peerId:A,multiaddr:g}}),parseReq:({query:A})=>({peerId:A.peerId,multiaddrs:A.multiaddr}),schema:{query:{peerId:gA.StringRequired,multiaddr:gA.StringArray}}},resp:YA},disconnectPeer:{url:"/eth/v1/lodestar/disconnect_peer",method:"POST",req:{writeReq:({peerId:A})=>({query:{peerId:A}}),parseReq:({query:A})=>({peerId:A.peerId}),schema:{query:{peerId:gA.StringRequired}}},resp:YA},addDirectPeer:{url:"/eth/v1/lodestar/direct_peers",method:"POST",req:{writeReq:({peer:A})=>({query:{peer:A}}),parseReq:({query:A})=>({peer:A.peer}),schema:{query:{peer:gA.StringRequired}}},resp:PA},removeDirectPeer:{url:"/eth/v1/lodestar/direct_peers",method:"DELETE",req:{writeReq:({peerId:A})=>({query:{peerId:A}}),parseReq:({query:A})=>({peerId:A.peerId}),schema:{query:{peerId:gA.StringRequired}}},resp:PA},getDirectPeers:{url:"/eth/v1/lodestar/direct_peers",method:"GET",req:kA,resp:PA},getPeers:{url:"/eth/v1/lodestar/peers",method:"GET",req:{writeReq:({state:A,direction:g})=>({query:{state:A,direction:g}}),parseReq:({query:A})=>({state:A.state,direction:A.direction}),schema:{query:{state:gA.StringArray,direction:gA.StringArray}}},resp:PA},getBlacklistedBlocks:{url:"/eth/v1/lodestar/blacklisted_blocks",method:"GET",req:kA,resp:PA},getHistoricalSummaries:{url:"/eth/v1/lodestar/states/{state_id}/historical_summaries",method:"GET",req:{writeReq:({stateId:A})=>({params:{state_id:A.toString()}}),parseReq:({params:A})=>({stateId:A.state_id}),schema:{params:{state_id:gA.StringRequired}}},resp:{data:dd,meta:XI}},getPersistedCheckpointState:{url:"/eth/v1/lodestar/persisted_checkpoint_state",method:"GET",req:{writeReq:({checkpointId:A})=>({query:{checkpoint_id:A}}),parseReq:({query:A})=>({checkpointId:A.checkpoint_id}),schema:{query:{checkpoint_id:gA.String}}},resp:{data:MI(A=>RI[A].BeaconState),meta:sg},init:{timeoutMs:3e5}},getMonitoredValidatorIndices:{url:"/eth/v1/lodestar/monitored_validators",method:"GET",req:kA,resp:PA},discv5GetKadValues:{url:"/eth/v1/debug/discv5_kad_values",method:"GET",req:kA,resp:PA},dumpDbBucketKeys:{url:"/eth/v1/debug/dump_db_bucket_keys/:bucket",method:"GET",req:{writeReq:({bucket:A})=>({params:{bucket:A}}),parseReq:({params:A})=>({bucket:A.bucket}),schema:{params:{bucket:gA.String}}},resp:PA},dumpDbStateIndex:{url:"/eth/v1/debug/dump_db_state_index",method:"GET",req:kA,resp:PA},getCustodyInfo:{url:"/eth/v1/lodestar/custody_info",method:"GET",req:kA,resp:PA}}}var MB;(function(I){I[I.CONTINUE=100]="CONTINUE",I[I.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",I[I.PROCESSING=102]="PROCESSING",I[I.OK=200]="OK",I[I.CREATED=201]="CREATED",I[I.ACCEPTED=202]="ACCEPTED",I[I.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",I[I.NO_CONTENT=204]="NO_CONTENT",I[I.RESET_CONTENT=205]="RESET_CONTENT",I[I.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",I[I.MULTI_STATUS=207]="MULTI_STATUS",I[I.ALREADY_REPORTED=208]="ALREADY_REPORTED",I[I.IM_USED=226]="IM_USED",I[I.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",I[I.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",I[I.FOUND=302]="FOUND",I[I.SEE_OTHER=303]="SEE_OTHER",I[I.NOT_MODIFIED=304]="NOT_MODIFIED",I[I.USE_PROXY=305]="USE_PROXY",I[I.SWITCH_PROXY=306]="SWITCH_PROXY",I[I.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",I[I.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",I[I.BAD_REQUEST=400]="BAD_REQUEST",I[I.UNAUTHORIZED=401]="UNAUTHORIZED",I[I.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",I[I.FORBIDDEN=403]="FORBIDDEN",I[I.NOT_FOUND=404]="NOT_FOUND",I[I.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",I[I.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",I[I.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",I[I.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",I[I.CONFLICT=409]="CONFLICT",I[I.GONE=410]="GONE",I[I.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",I[I.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",I[I.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",I[I.URI_TOO_LONG=414]="URI_TOO_LONG",I[I.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",I[I.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",I[I.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",I[I.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",I[I.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",I[I.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",I[I.LOCKED=423]="LOCKED",I[I.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",I[I.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",I[I.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",I[I.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",I[I.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",I[I.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",I[I.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",I[I.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",I[I.BAD_GATEWAY=502]="BAD_GATEWAY",I[I.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",I[I.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",I[I.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",I[I.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",I[I.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",I[I.LOOP_DETECTED=508]="LOOP_DETECTED",I[I.NOT_EXTENDED=510]="NOT_EXTENDED",I[I.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(MB||(MB={}));const Q0=new K({peerId:xI,enr:xI,p2pAddresses:dA(xI),discoveryAddresses:dA(xI),metadata:WI.Metadata},{jsonCase:"eth2"}),ud=new K({disconnected:RA,connecting:RA,connected:RA,disconnecting:RA},{jsonCase:"eth2"}),Rd=new K({headSlot:KA,syncDistance:KA,isSyncing:BI,isOptimistic:BI,elOffline:BI},{jsonCase:"eth2"}),e0=new K({peerId:xI,enr:new JQ(xI),lastSeenP2pAddress:xI,state:new Xg,direction:new JQ(new Xg)},{jsonCase:"eth2"}),Gd=dA(e0);var i0;(function(I){I.READY=MB.OK,typeof I.READY!="string"&&(I[I.READY]="READY"),I.SYNCING=MB.PARTIAL_CONTENT,typeof I.SYNCING!="string"&&(I[I.SYNCING]="SYNCING"),I.NOT_INITIALIZED_OR_ISSUES=MB.SERVICE_UNAVAILABLE,typeof I.NOT_INITIALIZED_OR_ISSUES!="string"&&(I[I.NOT_INITIALIZED_OR_ISSUES]="NOT_INITIALIZED_OR_ISSUES")})(i0||(i0={}));var t0;(function(I){I.BU="BU",I.EJ="EJ",I.EG="EG",I.GE="GE",I.GR="GR",I.LH="LH",I.LS="LS",I.NM="NM",I.NB="NB",I.TE="TE",I.TK="TK",I.PM="PM",I.RH="RH",I.XX="XX"})(t0||(t0={}));function kd(I){return{getNetworkIdentity:{url:"/eth/v1/node/identity",method:"GET",req:kA,resp:{onlySupport:NA.json,data:{...PA.data,toJson:A=>{const g=Q0.toJson(A),{custodyGroupCount:B}=A.metadata;return g.metadata.custody_group_count=B!==void 0?String(B):void 0,g},fromJson:A=>{const g=Q0.fromJson(A),{metadata:{custody_group_count:B}}=A;return g.metadata.custodyGroupCount=B!==void 0?parseInt(B):void 0,g}},meta:VA}},getPeers:{url:"/eth/v1/node/peers",method:"GET",req:{writeReq:({state:A,direction:g})=>({query:{state:A,direction:g}}),parseReq:({query:A})=>({state:A.state,direction:A.direction}),schema:{query:{state:gA.StringArray,direction:gA.StringArray}}},resp:{data:Gd,meta:{toJson:A=>A,fromJson:A=>({count:A.count}),toHeadersObject:()=>({}),fromHeaders:()=>({})},transform:{toResponse:(A,g)=>({data:A,meta:g}),fromResponse:A=>A},onlySupport:NA.json}},getPeer:{url:"/eth/v1/node/peers/{peer_id}",method:"GET",req:{writeReq:({peerId:A})=>({params:{peer_id:A}}),parseReq:({params:A})=>({peerId:A.peer_id}),schema:{params:{peer_id:gA.StringRequired}}},resp:{data:e0,meta:VA,onlySupport:NA.json}},getPeerCount:{url:"/eth/v1/node/peer_count",method:"GET",req:kA,resp:{data:ud,meta:VA}},getNodeVersion:{url:"/eth/v1/node/version",method:"GET",req:kA,resp:PA},getNodeVersionV2:{url:"/eth/v2/node/version",method:"GET",req:kA,resp:PA},getSyncingStatus:{url:"/eth/v1/node/syncing",method:"GET",req:kA,resp:{data:Rd,meta:VA}},getHealth:{url:"/eth/v1/node/health",method:"GET",req:{writeReq:({syncingStatus:A})=>({query:{syncing_status:A}}),parseReq:({query:A})=>({syncingStatus:A.syncing_status}),schema:{query:{syncing_status:gA.Uint}}},resp:YA}}}const CB=new K({leaves:dA(UB,1e4),descriptor:new HC(2048)});function Fd(I){return{getStateProof:{url:"/eth/v0/beacon/proof/state/{state_id}",method:"GET",req:{writeReq:({stateId:A,descriptor:g})=>({params:{state_id:A},query:{format:fg(g)}}),parseReq:({params:A,query:g})=>({stateId:A.state_id,descriptor:sA(g.format)}),schema:{params:{state_id:gA.StringRequired},query:{format:gA.StringRequired}}},resp:{data:{toJson:A=>CB.toJson(A),fromJson:A=>({...CB.fromJson(A),type:ZA.compactMulti}),serialize:A=>CB.serialize(A),deserialize:A=>({...CB.deserialize(A),type:ZA.compactMulti})},meta:sg}},getBlockProof:{url:"/eth/v0/beacon/proof/block/{block_id}",method:"GET",req:{writeReq:({blockId:A,descriptor:g})=>({params:{block_id:A},query:{format:fg(g)}}),parseReq:({params:A,query:g})=>({blockId:A.block_id,descriptor:sA(g.format)}),schema:{params:{block_id:gA.StringRequired},query:{format:gA.StringRequired}}},resp:{data:{toJson:A=>CB.toJson(A),fromJson:A=>({...CB.fromJson(A),type:ZA.compactMulti}),serialize:A=>CB.serialize(A),deserialize:A=>({...CB.deserialize(A),type:ZA.compactMulti})},meta:sg}}}}var E0;(function(I){I.Default="default",I.BuilderAlways="builderalways",I.ExecutionAlways="executionalways",I.MaxProfit="maxprofit",I.BuilderOnly="builderonly",I.ExecutionOnly="executiononly"})(E0||(E0={}));const o0=new K({...gB.fields,executionPayloadBlinded:BI,executionPayloadValue:cB,consensusBlockValue:cB},{jsonCase:"eth2"}),r0=new K({...gB.fields,consensusBlockValue:cB},{jsonCase:"eth2"}),Jd=new K({pubkey:vB,validatorIndex:XA,committeeIndex:DB,committeeLength:RA,committeesAtSlot:RA,validatorCommitteeIndex:RA,slot:KA},{jsonCase:"eth2"}),pd=new K({slot:KA,validatorIndex:XA,pubkey:vB},{jsonCase:"eth2"}),Hd=new K({pubkey:vB,validatorIndex:XA,validatorSyncCommitteeIndices:dA(DB)},{jsonCase:"eth2"}),Md=new K({validatorIndex:XA,committeeIndex:DB,committeesAtSlot:KA,slot:KA,isAggregator:BI},{jsonCase:"eth2"}),md=new K({validatorIndex:XA,syncCommitteeIndices:dA(DB),untilEpoch:PI},{jsonCase:"eth2"}),Ld=new K({validatorIndex:XA,feeRecipient:xI},{jsonCase:"eth2"}),Kd=new K({validatorIndex:XA,slot:KA,selectionProof:LQ},{jsonCase:"eth2"}),Yd=new K({validatorIndex:XA,slot:KA,subcommitteeIndex:qi,selectionProof:LQ},{jsonCase:"eth2"}),bd=new K({index:XA,isLive:BI},{jsonCase:"eth2"}),qI=dA(XA),Td=dA(Jd),n0=dA(pd),qd=dA(Hd),QB=dA(yA.SignedAggregateAndProof),we=dA(uI.SignedAggregateAndProof),ye=dA(WI.SignedContributionAndProof),de=dA(Md),Ne=dA(md),a0=dA(Ld),QQ=dA(Kd),eQ=dA(Yd),Vd=dA(bd),ue=dA(Ys.SignedValidatorRegistrationV1,fC);function jd(I){return{getAttesterDuties:{url:"/eth/v1/validator/duties/attester/{epoch}",method:"POST",req:{writeReqJson:({epoch:A,indices:g})=>({params:{epoch:A},body:qI.toJson(g)}),parseReqJson:({params:A,body:g})=>({epoch:A.epoch,indices:qI.fromJson(g)}),writeReqSsz:({epoch:A,indices:g})=>({params:{epoch:A},body:qI.serialize(g)}),parseReqSsz:({params:A,body:g})=>({epoch:A.epoch,indices:qI.deserialize(g)}),schema:{params:{epoch:gA.UintRequired},body:gA.StringArray}},resp:{data:Td,meta:Lt}},getProposerDuties:{url:"/eth/v1/validator/duties/proposer/{epoch}",method:"GET",req:{writeReq:({epoch:A})=>({params:{epoch:A}}),parseReq:({params:A})=>({epoch:A.epoch}),schema:{params:{epoch:gA.UintRequired}}},resp:{data:n0,meta:Lt}},getProposerDutiesV2:{url:"/eth/v2/validator/duties/proposer/{epoch}",method:"GET",req:{writeReq:({epoch:A})=>({params:{epoch:A}}),parseReq:({params:A})=>({epoch:A.epoch}),schema:{params:{epoch:gA.UintRequired}}},resp:{data:n0,meta:Lt}},getSyncCommitteeDuties:{url:"/eth/v1/validator/duties/sync/{epoch}",method:"POST",req:{writeReqJson:({epoch:A,indices:g})=>({params:{epoch:A},body:qI.toJson(g)}),parseReqJson:({params:A,body:g})=>({epoch:A.epoch,indices:qI.fromJson(g)}),writeReqSsz:({epoch:A,indices:g})=>({params:{epoch:A},body:qI.serialize(g)}),parseReqSsz:({params:A,body:g})=>({epoch:A.epoch,indices:qI.deserialize(g)}),schema:{params:{epoch:gA.UintRequired},body:gA.StringArray}},resp:{data:qd,meta:Ky}},produceBlockV3:{url:"/eth/v3/validator/blocks/{slot}",method:"GET",req:{writeReq:({slot:A,randaoReveal:g,graffiti:B,skipRandaoVerification:e,feeRecipient:Q,builderSelection:C,builderBoostFactor:i,strictFeeRecipientCheck:o,blindedLocal:D})=>({params:{slot:A},query:{randao_reveal:fg(g),graffiti:Zs(B),skip_randao_verification:h0(e),fee_recipient:Q,builder_selection:C,builder_boost_factor:i?.toString(),strict_fee_recipient_check:o,blinded_local:D}}),parseReq:({params:A,query:g})=>({slot:A.slot,randaoReveal:sA(g.randao_reveal),graffiti:Ps(g.graffiti),skipRandaoVerification:l0(g.skip_randao_verification),feeRecipient:g.fee_recipient,builderSelection:g.builder_selection,builderBoostFactor:s0(g.builder_boost_factor),strictFeeRecipientCheck:g.strict_fee_recipient_check,blindedLocal:g.blinded_local}),schema:{params:{slot:gA.UintRequired},query:{randao_reveal:gA.StringRequired,graffiti:gA.String,skip_randao_verification:gA.String,fee_recipient:gA.String,builder_selection:gA.String,builder_boost_factor:gA.String,strict_fee_recipient_check:gA.Boolean,blinded_local:gA.Boolean}}},resp:{data:{toJson(A,{executionPayloadBlinded:g,version:B}){return g?mI(B).BlindedBeaconBlock.toJson(A):SI(B)?pA(B).BlockContents.toJson(A):RI[B].BeaconBlock.toJson(A.block)},fromJson(A,{executionPayloadBlinded:g,version:B}){return g?mI(B).BlindedBeaconBlock.fromJson(A):SI(B)?pA(B).BlockContents.fromJson(A):{block:RI[B].BeaconBlock.fromJson(A)}},serialize(A,{executionPayloadBlinded:g,version:B}){return g?mI(B).BlindedBeaconBlock.serialize(A):SI(B)?pA(B).BlockContents.serialize(A):RI[B].BeaconBlock.serialize(A.block)},deserialize(A,{executionPayloadBlinded:g,version:B}){return g?mI(B).BlindedBeaconBlock.deserialize(A):SI(B)?pA(B).BlockContents.deserialize(A):{block:RI[B].BeaconBlock.deserialize(A)}}},meta:{toJson:A=>({...o0.toJson(A),execution_payload_source:A.executionPayloadSource}),fromJson:A=>{const{executionPayloadBlinded:g,...B}=o0.fromJson(A),e=A.execution_payload_source??(g===!0?iC.builder:iC.engine);return{...B,executionPayloadBlinded:g,executionPayloadSource:e}},toHeadersObject:A=>({[aA.Version]:A.version,[aA.ExecutionPayloadBlinded]:A.executionPayloadBlinded.toString(),[aA.ExecutionPayloadSource]:A.executionPayloadSource.toString(),[aA.ExecutionPayloadValue]:A.executionPayloadValue.toString(),[aA.ConsensusBlockValue]:A.consensusBlockValue.toString()}),fromHeaders:A=>{const g=pB(A.getRequired(aA.ExecutionPayloadBlinded)),B=A.get(aA.ExecutionPayloadSource)??(g===!0?iC.builder:iC.engine);return{version:OA(A.getRequired(aA.Version)),executionPayloadBlinded:g,executionPayloadSource:B,executionPayloadValue:BigInt(A.getRequired(aA.ExecutionPayloadValue)),consensusBlockValue:BigInt(A.getRequired(aA.ConsensusBlockValue))}}}}},produceBlockV4:{url:"/eth/v4/validator/blocks/{slot}",method:"GET",req:{writeReq:({slot:A,randaoReveal:g,graffiti:B,skipRandaoVerification:e,feeRecipient:Q,builderSelection:C,builderBoostFactor:i,strictFeeRecipientCheck:o})=>({params:{slot:A},query:{randao_reveal:fg(g),graffiti:Zs(B),skip_randao_verification:h0(e),fee_recipient:Q,builder_selection:C,builder_boost_factor:i?.toString(),strict_fee_recipient_check:o}}),parseReq:({params:A,query:g})=>({slot:A.slot,randaoReveal:sA(g.randao_reveal),graffiti:Ps(g.graffiti),skipRandaoVerification:l0(g.skip_randao_verification),feeRecipient:g.fee_recipient,builderSelection:g.builder_selection,builderBoostFactor:s0(g.builder_boost_factor),strictFeeRecipientCheck:g.strict_fee_recipient_check}),schema:{params:{slot:gA.UintRequired},query:{randao_reveal:gA.StringRequired,graffiti:gA.String,skip_randao_verification:gA.String,fee_recipient:gA.String,builder_selection:gA.String,builder_boost_factor:gA.String,strict_fee_recipient_check:gA.Boolean}}},resp:{data:MI(A=>$C(A).BeaconBlock),meta:{toJson:A=>r0.toJson(A),fromJson:A=>r0.fromJson(A),toHeadersObject:A=>({[aA.Version]:A.version,[aA.ConsensusBlockValue]:A.consensusBlockValue.toString()}),fromHeaders:A=>({version:OA(A.getRequired(aA.Version)),consensusBlockValue:BigInt(A.getRequired(aA.ConsensusBlockValue))})}}},getExecutionPayloadEnvelope:{url:"/eth/v1/validator/execution_payload_envelope/{slot}/{beacon_block_root}",method:"GET",req:{writeReq:({slot:A,beaconBlockRoot:g})=>({params:{slot:A,beacon_block_root:DQ(g)}}),parseReq:({params:A})=>({slot:A.slot,beaconBlockRoot:sA(A.beacon_block_root)}),schema:{params:{slot:gA.UintRequired,beacon_block_root:gA.StringRequired}}},resp:{data:bs.ExecutionPayloadEnvelope,meta:sg}},produceAttestationData:{url:"/eth/v1/validator/attestation_data",method:"GET",req:{writeReq:({committeeIndex:A,slot:g})=>({query:{slot:g,committee_index:A}}),parseReq:({query:A})=>({committeeIndex:A.committee_index,slot:A.slot}),schema:{query:{slot:gA.UintRequired,committee_index:gA.Uint}}},resp:{data:yA.AttestationData,meta:VA}},produceSyncCommitteeContribution:{url:"/eth/v1/validator/sync_committee_contribution",method:"GET",req:{writeReq:({slot:A,subcommitteeIndex:g,beaconBlockRoot:B})=>({query:{slot:A,subcommittee_index:g,beacon_block_root:DQ(B)}}),parseReq:({query:A})=>({slot:A.slot,subcommitteeIndex:A.subcommittee_index,beaconBlockRoot:sA(A.beacon_block_root)}),schema:{query:{slot:gA.UintRequired,subcommittee_index:gA.UintRequired,beacon_block_root:gA.StringRequired}}},resp:{data:WI.SyncCommitteeContribution,meta:VA}},getAggregatedAttestation:{url:"/eth/v1/validator/aggregate_attestation",method:"GET",req:{writeReq:({attestationDataRoot:A,slot:g})=>({query:{attestation_data_root:DQ(A),slot:g}}),parseReq:({query:A})=>({attestationDataRoot:sA(A.attestation_data_root),slot:A.slot}),schema:{query:{attestation_data_root:gA.StringRequired,slot:gA.UintRequired}}},resp:{data:yA.Attestation,meta:VA}},getAggregatedAttestationV2:{url:"/eth/v2/validator/aggregate_attestation",method:"GET",req:{writeReq:({attestationDataRoot:A,slot:g,committeeIndex:B})=>({query:{attestation_data_root:fg(A),slot:g,committee_index:B}}),parseReq:({query:A})=>({attestationDataRoot:sA(A.attestation_data_root),slot:A.slot,committeeIndex:A.committee_index}),schema:{query:{attestation_data_root:gA.StringRequired,slot:gA.UintRequired,committee_index:gA.UintRequired}}},resp:{data:MI(A=>WA(A)?uI.Attestation:yA.Attestation),meta:sg}},publishAggregateAndProofs:{url:"/eth/v1/validator/aggregate_and_proofs",method:"POST",req:{writeReqJson:({signedAggregateAndProofs:A})=>({body:QB.toJson(A)}),parseReqJson:({body:A})=>({signedAggregateAndProofs:QB.fromJson(A)}),writeReqSsz:({signedAggregateAndProofs:A})=>({body:QB.serialize(A)}),parseReqSsz:({body:A})=>({signedAggregateAndProofs:QB.deserialize(A)}),schema:{body:gA.ObjectArray}},resp:YA},publishAggregateAndProofsV2:{url:"/eth/v2/validator/aggregate_and_proofs",method:"POST",req:{writeReqJson:({signedAggregateAndProofs:A})=>{const g=I.getForkName(A[0]?.message.aggregate.data.slot??0);return{body:WA(g)?we.toJson(A):QB.toJson(A),headers:{[aA.Version]:g}}},parseReqJson:({body:A,headers:g})=>{const B=OA(sI(g,aA.Version));return{signedAggregateAndProofs:WA(B)?we.fromJson(A):QB.fromJson(A)}},writeReqSsz:({signedAggregateAndProofs:A})=>{const g=I.getForkName(A[0]?.message.aggregate.data.slot??0);return{body:WA(g)?we.serialize(A):QB.serialize(A),headers:{[aA.Version]:g}}},parseReqSsz:({body:A,headers:g})=>{const B=OA(sI(g,aA.Version));return{signedAggregateAndProofs:WA(B)?we.deserialize(A):QB.deserialize(A)}},schema:{body:gA.ObjectArray,headers:{[aA.Version]:gA.String}}},resp:YA},publishContributionAndProofs:{url:"/eth/v1/validator/contribution_and_proofs",method:"POST",req:{writeReqJson:({contributionAndProofs:A})=>({body:ye.toJson(A)}),parseReqJson:({body:A})=>({contributionAndProofs:ye.fromJson(A)}),writeReqSsz:({contributionAndProofs:A})=>({body:ye.serialize(A)}),parseReqSsz:({body:A})=>({contributionAndProofs:ye.deserialize(A)}),schema:{body:gA.ObjectArray}},resp:YA},prepareBeaconCommitteeSubnet:{url:"/eth/v1/validator/beacon_committee_subscriptions",method:"POST",req:{writeReqJson:({subscriptions:A})=>({body:de.toJson(A)}),parseReqJson:({body:A})=>({subscriptions:de.fromJson(A)}),writeReqSsz:({subscriptions:A})=>({body:de.serialize(A)}),parseReqSsz:({body:A})=>({subscriptions:de.deserialize(A)}),schema:{body:gA.ObjectArray}},resp:YA},prepareSyncCommitteeSubnets:{url:"/eth/v1/validator/sync_committee_subscriptions",method:"POST",req:{writeReqJson:({subscriptions:A})=>({body:Ne.toJson(A)}),parseReqJson:({body:A})=>({subscriptions:Ne.fromJson(A)}),writeReqSsz:({subscriptions:A})=>({body:Ne.serialize(A)}),parseReqSsz:({body:A})=>({subscriptions:Ne.deserialize(A)}),schema:{body:gA.ObjectArray}},resp:YA},prepareBeaconProposer:{url:"/eth/v1/validator/prepare_beacon_proposer",method:"POST",req:tC({writeReqJson:({proposers:A})=>({body:a0.toJson(A)}),parseReqJson:({body:A})=>({proposers:a0.fromJson(A)}),schema:{body:gA.ObjectArray}}),resp:YA},submitBeaconCommitteeSelections:{url:"/eth/v1/validator/beacon_committee_selections",method:"POST",req:{writeReqJson:({selections:A})=>({body:QQ.toJson(A)}),parseReqJson:({body:A})=>({selections:QQ.fromJson(A)}),writeReqSsz:({selections:A})=>({body:QQ.serialize(A)}),parseReqSsz:({body:A})=>({selections:QQ.deserialize(A)}),schema:{body:gA.ObjectArray}},resp:{data:QQ,meta:VA}},submitSyncCommitteeSelections:{url:"/eth/v1/validator/sync_committee_selections",method:"POST",req:{writeReqJson:({selections:A})=>({body:eQ.toJson(A)}),parseReqJson:({body:A})=>({selections:eQ.fromJson(A)}),writeReqSsz:({selections:A})=>({body:eQ.serialize(A)}),parseReqSsz:({body:A})=>({selections:eQ.deserialize(A)}),schema:{body:gA.ObjectArray}},resp:{data:eQ,meta:VA}},getLiveness:{url:"/eth/v1/validator/liveness/{epoch}",method:"POST",req:{writeReqJson:({epoch:A,indices:g})=>({params:{epoch:A},body:qI.toJson(g)}),parseReqJson:({params:A,body:g})=>({epoch:A.epoch,indices:qI.fromJson(g)}),writeReqSsz:({epoch:A,indices:g})=>({params:{epoch:A},body:qI.serialize(g)}),parseReqSsz:({params:A,body:g})=>({epoch:A.epoch,indices:qI.deserialize(g)}),schema:{params:{epoch:gA.UintRequired},body:gA.StringArray}},resp:{data:Vd,meta:VA}},registerValidator:{url:"/eth/v1/validator/register_validator",method:"POST",req:{writeReqJson:({registrations:A})=>({body:ue.toJson(A)}),parseReqJson:({body:A})=>({registrations:ue.fromJson(A)}),writeReqSsz:({registrations:A})=>({body:ue.serialize(A)}),parseReqSsz:({body:A})=>({registrations:ue.deserialize(A)}),schema:{body:gA.ObjectArray}},resp:YA,init:{requestWireFormat:NA.ssz}}}}function s0(I){return I!==void 0?BigInt(I):void 0}function h0(I){return I===!0?"":void 0}function l0(I){return I!==void 0&&I===""}class _d extends Error{status;operationId;constructor(A,g,B){super(`${B} failed with status ${g}: ${A}`),this.status=g,this.operationId=B}}var c0,D0;function rC(){return D0||(D0=1,c0=TypeError),c0}const bt=QD(xc);var Tt,U0;function Re(){if(U0)return Tt;U0=1;var I=typeof Map=="function"&&Map.prototype,A=Object.getOwnPropertyDescriptor&&I?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,g=I&&A&&typeof A.get=="function"?A.get:null,B=I&&Map.prototype.forEach,e=typeof Set=="function"&&Set.prototype,Q=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,C=e&&Q&&typeof Q.get=="function"?Q.get:null,i=e&&Set.prototype.forEach,o=typeof WeakMap=="function"&&WeakMap.prototype,D=o?WeakMap.prototype.has:null,a=typeof WeakSet=="function"&&WeakSet.prototype,U=a?WeakSet.prototype.has:null,J=typeof WeakRef=="function"&&WeakRef.prototype,f=J?WeakRef.prototype.deref:null,y=Boolean.prototype.valueOf,S=Object.prototype.toString,R=Function.prototype.toString,N=String.prototype.match,G=String.prototype.slice,H=String.prototype.replace,Z=String.prototype.toUpperCase,W=String.prototype.toLowerCase,x=RegExp.prototype.test,X=Array.prototype.concat,m=Array.prototype.join,z=Array.prototype.slice,q=Math.floor,iA=typeof BigInt=="function"?BigInt.prototype.valueOf:null,hA=Object.getOwnPropertySymbols,DA=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,p=typeof Symbol=="function"&&typeof Symbol.iterator=="object",T=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===p||!0)?Symbol.toStringTag:null,$=Object.prototype.propertyIsEnumerable,j=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(M){return M.__proto__}:null);function P(M,_){if(M===1/0||M===-1/0||M!==M||M&&M>-1e3&&M<1e3||x.call(/e/,_))return _;var E=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof M=="number"){var s=M<0?-q(-M):q(M);if(s!==M){var d=String(s),O=G.call(_,d.length+1);return H.call(d,E,"$&_")+"."+H.call(H.call(O,/([0-9]{3})/g,"$&_"),/_$/,"")}}return H.call(_,E,"$&_")}var EA=bt,CA=EA.custom,L=tA(CA)?CA:null,V={__proto__:null,double:'"',single:"'"},AA={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Tt=function M(_,E,s,d){var O=E||{};if(UA(O,"quoteStyle")&&!UA(V,O.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(UA(O,"maxStringLength")&&(typeof O.maxStringLength=="number"?O.maxStringLength<0&&O.maxStringLength!==1/0:O.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var GA=UA(O,"customInspect")?O.customInspect:!0;if(typeof GA!="boolean"&&GA!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(UA(O,"indent")&&O.indent!==null&&O.indent!==" "&&!(parseInt(O.indent,10)===O.indent&&O.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(UA(O,"numericSeparator")&&typeof O.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var Ag=O.numericSeparator;if(typeof _>"u")return"undefined";if(_===null)return"null";if(typeof _=="boolean")return _?"true":"false";if(typeof _=="string")return r(_,O);if(typeof _=="number"){if(_===0)return 1/0/_>0?"0":"-0";var nI=String(_);return Ag?P(_,nI):nI}if(typeof _=="bigint"){var jI=String(_)+"n";return Ag?P(_,jI):jI}var EQ=typeof O.depth>"u"?5:O.depth;if(typeof s>"u"&&(s=0),s>=EQ&&EQ>0&&typeof _=="object")return b(_)?"[Array]":"[Object]";var cC=F(O,s);if(typeof d>"u")d=[];else if(FA(d,_)>=0)return"[Circular]";function Ig(DC,Ye,aR){if(Ye&&(d=z.call(d),d.push(Ye)),aR){var H1={depth:O.depth};return UA(O,"quoteStyle")&&(H1.quoteStyle=O.quoteStyle),M(DC,H1,s+1,d)}return M(DC,O,s+1,d)}if(typeof _=="function"&&!eA(_)){var u1=xA(_),R1=IA(_,Ig);return"[Function"+(u1?": "+u1:" (anonymous)")+"]"+(R1.length>0?" { "+m.call(R1,", ")+" }":"")}if(tA(_)){var G1=p?H.call(String(_),/^(Symbol\(.*\))_[^)]*$/,"$1"):DA.call(_);return typeof _=="object"&&!p?w(G1):G1}if(fI(_)){for(var oQ="<"+W.call(String(_.nodeName)),io=_.attributes||[],Ke=0;Ke<io.length;Ke++)oQ+=" "+io[Ke].name+"="+QA(oA(io[Ke].value),"double",O);return oQ+=">",_.childNodes&&_.childNodes.length&&(oQ+="..."),oQ+="</"+W.call(String(_.nodeName))+">",oQ}if(b(_)){if(_.length===0)return"[]";var to=IA(_,Ig);return cC&&!h(to)?"["+c(to,cC)+"]":"[ "+m.call(to,", ")+" ]"}if(rA(_)){var Eo=IA(_,Ig);return!("cause"in Error.prototype)&&"cause"in _&&!$.call(_,"cause")?"{ ["+String(_)+"] "+m.call(X.call("[cause]: "+Ig(_.cause),Eo),", ")+" }":Eo.length===0?"["+String(_)+"]":"{ ["+String(_)+"] "+m.call(Eo,", ")+" }"}if(typeof _=="object"&&GA){if(L&&typeof _[L]=="function"&&EA)return EA(_,{depth:EQ-s});if(GA!=="symbol"&&typeof _.inspect=="function")return _.inspect()}if(bA(_)){var k1=[];return B&&B.call(_,function(DC,Ye){k1.push(Ig(Ye,_,!0)+" => "+Ig(DC,_))}),n("Map",g.call(_),k1,cC)}if(UI(_)){var F1=[];return i&&i.call(_,function(DC){F1.push(Ig(DC,_))}),n("Set",C.call(_),F1,cC)}if(JA(_))return t("WeakMap");if(HA(_))return t("WeakSet");if(mA(_))return t("WeakRef");if(k(_))return w(Ig(Number(_)));if(cA(_))return w(Ig(iA.call(_)));if(BA(_))return w(y.call(_));if(u(_))return w(Ig(String(_)));if(typeof window<"u"&&_===window)return"{ [object Window] }";if(typeof globalThis<"u"&&_===globalThis||typeof TA<"u"&&_===TA)return"{ [object globalThis] }";if(!v(_)&&!eA(_)){var oo=IA(_,Ig),J1=j?j(_)===Object.prototype:_ instanceof Object||_.constructor===Object,ro=_ instanceof Object?"":"null prototype",p1=!J1&&T&&Object(_)===_&&T in _?G.call(uA(_),8,-1):ro?"Object":"",nR=J1||typeof _.constructor!="function"?"":_.constructor.name?_.constructor.name+" ":"",no=nR+(p1||ro?"["+m.call(X.call([],p1||[],ro||[]),": ")+"] ":"");return oo.length===0?no+"{}":cC?no+"{"+c(oo,cC)+"}":no+"{ "+m.call(oo,", ")+" }"}return String(_)};function QA(M,_,E){var s=E.quoteStyle||_,d=V[s];return d+M+d}function oA(M){return H.call(String(M),/"/g,"&quot;")}function Y(M){return!T||!(typeof M=="object"&&(T in M||typeof M[T]<"u"))}function b(M){return uA(M)==="[object Array]"&&Y(M)}function v(M){return uA(M)==="[object Date]"&&Y(M)}function eA(M){return uA(M)==="[object RegExp]"&&Y(M)}function rA(M){return uA(M)==="[object Error]"&&Y(M)}function u(M){return uA(M)==="[object String]"&&Y(M)}function k(M){return uA(M)==="[object Number]"&&Y(M)}function BA(M){return uA(M)==="[object Boolean]"&&Y(M)}function tA(M){if(p)return M&&typeof M=="object"&&M instanceof Symbol;if(typeof M=="symbol")return!0;if(!M||typeof M!="object"||!DA)return!1;try{return DA.call(M),!0}catch{}return!1}function cA(M){if(!M||typeof M!="object"||!iA)return!1;try{return iA.call(M),!0}catch{}return!1}var lA=Object.prototype.hasOwnProperty||function(M){return M in this};function UA(M,_){return lA.call(M,_)}function uA(M){return S.call(M)}function xA(M){if(M.name)return M.name;var _=N.call(R.call(M),/^function\s*([\w$]+)/);return _?_[1]:null}function FA(M,_){if(M.indexOf)return M.indexOf(_);for(var E=0,s=M.length;E<s;E++)if(M[E]===_)return E;return-1}function bA(M){if(!g||!M||typeof M!="object")return!1;try{g.call(M);try{C.call(M)}catch{return!0}return M instanceof Map}catch{}return!1}function JA(M){if(!D||!M||typeof M!="object")return!1;try{D.call(M,D);try{U.call(M,U)}catch{return!0}return M instanceof WeakMap}catch{}return!1}function mA(M){if(!f||!M||typeof M!="object")return!1;try{return f.call(M),!0}catch{}return!1}function UI(M){if(!C||!M||typeof M!="object")return!1;try{C.call(M);try{g.call(M)}catch{return!0}return M instanceof Set}catch{}return!1}function HA(M){if(!U||!M||typeof M!="object")return!1;try{U.call(M,U);try{D.call(M,D)}catch{return!0}return M instanceof WeakSet}catch{}return!1}function fI(M){return!M||typeof M!="object"?!1:typeof HTMLElement<"u"&&M instanceof HTMLElement?!0:typeof M.nodeName=="string"&&typeof M.getAttribute=="function"}function r(M,_){if(M.length>_.maxStringLength){var E=M.length-_.maxStringLength,s="... "+E+" more character"+(E>1?"s":"");return r(G.call(M,0,_.maxStringLength),_)+s}var d=AA[_.quoteStyle||"single"];d.lastIndex=0;var O=H.call(H.call(M,d,"\\$1"),/[\x00-\x1f]/g,l);return QA(O,"single",_)}function l(M){var _=M.charCodeAt(0),E={8:"b",9:"t",10:"n",12:"f",13:"r"}[_];return E?"\\"+E:"\\x"+(_<16?"0":"")+Z.call(_.toString(16))}function w(M){return"Object("+M+")"}function t(M){return M+" { ? }"}function n(M,_,E,s){var d=s?c(E,s):m.call(E,", ");return M+" ("+_+") {"+d+"}"}function h(M){for(var _=0;_<M.length;_++)if(FA(M[_],`
6
6
  `)>=0)return!1;return!0}function F(M,_){var E;if(M.indent===" ")E=" ";else if(typeof M.indent=="number"&&M.indent>0)E=m.call(Array(M.indent+1)," ");else return null;return{base:E,prev:m.call(Array(_+1),E)}}function c(M,_){if(M.length===0)return"";var E=`
7
7
  `+_.prev+_.base;return E+m.call(M,","+E)+`
8
8
  `+_.prev}function IA(M,_){var E=b(M),s=[];if(E){s.length=M.length;for(var d=0;d<M.length;d++)s[d]=UA(M,d)?_(M[d],M):""}var O=typeof hA=="function"?hA(M):[],GA;if(p){GA={};for(var Ag=0;Ag<O.length;Ag++)GA["$"+O[Ag]]=O[Ag]}for(var nI in M)UA(M,nI)&&(E&&String(Number(nI))===nI&&nI<M.length||p&&GA["$"+nI]instanceof Symbol||(x.call(/[^\w$]/,nI)?s.push(_(nI,M)+": "+_(M[nI],M)):s.push(nI+": "+_(M[nI],M))));if(typeof hA=="function")for(var jI=0;jI<O.length;jI++)$.call(M,O[jI])&&s.push("["+_(O[jI])+"]: "+_(M[O[jI]],M));return s}return Tt}var qt,f0;function Zd(){if(f0)return qt;f0=1;var I=Re(),A=rC(),g=function(i,o,D){for(var a=i,U;(U=a.next)!=null;a=U)if(U.key===o)return a.next=U.next,D||(U.next=i.next,i.next=U),U},B=function(i,o){if(i){var D=g(i,o);return D&&D.value}},e=function(i,o,D){var a=g(i,o);a?a.value=D:i.next={key:o,next:i.next,value:D}},Q=function(i,o){return i?!!g(i,o):!1},C=function(i,o){if(i)return g(i,o,!0)};return qt=function(){var i,o={assert:function(D){if(!o.has(D))throw new A("Side channel does not contain "+I(D))},delete:function(D){var a=i&&i.next,U=C(i,D);return U&&a&&a===U&&(i=void 0),!!U},get:function(D){return B(i,D)},has:function(D){return Q(i,D)},set:function(D,a){i||(i={next:void 0}),e(i,D,a)}};return o},qt}var S0,w0;function y0(){return w0||(w0=1,S0=Object),S0}var d0,N0;function Pd(){return N0||(N0=1,d0=Error),d0}var u0,R0;function Od(){return R0||(R0=1,u0=EvalError),u0}var G0,k0;function xd(){return k0||(k0=1,G0=RangeError),G0}var F0,J0;function zd(){return J0||(J0=1,F0=ReferenceError),F0}var p0,H0;function vd(){return H0||(H0=1,p0=SyntaxError),p0}var M0,m0;function Wd(){return m0||(m0=1,M0=URIError),M0}var L0,K0;function Xd(){return K0||(K0=1,L0=Math.abs),L0}var Y0,b0;function $d(){return b0||(b0=1,Y0=Math.floor),Y0}var T0,q0;function AN(){return q0||(q0=1,T0=Math.max),T0}var V0,j0;function IN(){return j0||(j0=1,V0=Math.min),V0}var _0,Z0;function gN(){return Z0||(Z0=1,_0=Math.pow),_0}var P0,O0;function BN(){return O0||(O0=1,P0=Math.round),P0}var x0,z0;function CN(){return z0||(z0=1,x0=Number.isNaN||function(I){return I!==I}),x0}var Vt,v0;function QN(){if(v0)return Vt;v0=1;var I=CN();return Vt=function(A){return I(A)||A===0?A:A<0?-1:1},Vt}var W0,X0;function eN(){return X0||(X0=1,W0=Object.getOwnPropertyDescriptor),W0}var jt,$0;function Ah(){if($0)return jt;$0=1;var I=eN();if(I)try{I([],"length")}catch{I=null}return jt=I,jt}var _t,Ih;function iN(){if(Ih)return _t;Ih=1;var I=Object.defineProperty||!1;if(I)try{I({},"a",{value:1})}catch{I=!1}return _t=I,_t}var gh,Bh;function tN(){return Bh||(Bh=1,gh=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var I={},A=Symbol("test"),g=Object(A);if(typeof A=="string"||Object.prototype.toString.call(A)!=="[object Symbol]"||Object.prototype.toString.call(g)!=="[object Symbol]")return!1;var B=42;I[A]=B;for(var e in I)return!1;if(typeof Object.keys=="function"&&Object.keys(I).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(I).length!==0)return!1;var Q=Object.getOwnPropertySymbols(I);if(Q.length!==1||Q[0]!==A||!Object.prototype.propertyIsEnumerable.call(I,A))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var C=Object.getOwnPropertyDescriptor(I,A);if(C.value!==B||C.enumerable!==!0)return!1}return!0}),gh}var Zt,Ch;function EN(){if(Ch)return Zt;Ch=1;var I=typeof Symbol<"u"&&Symbol,A=tN();return Zt=function(){return typeof I!="function"||typeof Symbol!="function"||typeof I("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:A()},Zt}var Qh,eh;function ih(){return eh||(eh=1,Qh=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Qh}var Pt,th;function Eh(){if(th)return Pt;th=1;var I=y0();return Pt=I.getPrototypeOf||null,Pt}var Ot,oh;function oN(){if(oh)return Ot;oh=1;var I="Function.prototype.bind called on incompatible ",A=Object.prototype.toString,g=Math.max,B="[object Function]",e=function(i,o){for(var D=[],a=0;a<i.length;a+=1)D[a]=i[a];for(var U=0;U<o.length;U+=1)D[U+i.length]=o[U];return D},Q=function(i,o){for(var D=[],a=o,U=0;a<i.length;a+=1,U+=1)D[U]=i[a];return D},C=function(i,o){for(var D="",a=0;a<i.length;a+=1)D+=i[a],a+1<i.length&&(D+=o);return D};return Ot=function(i){var o=this;if(typeof o!="function"||A.apply(o)!==B)throw new TypeError(I+o);for(var D=Q(arguments,1),a,U=function(){if(this instanceof a){var R=o.apply(this,e(D,arguments));return Object(R)===R?R:this}return o.apply(i,e(D,arguments))},J=g(0,o.length-D.length),f=[],y=0;y<J;y++)f[y]="$"+y;if(a=Function("binder","return function ("+C(f,",")+"){ return binder.apply(this,arguments); }")(U),o.prototype){var S=function(){};S.prototype=o.prototype,a.prototype=new S,S.prototype=null}return a},Ot}var xt,rh;function Ge(){if(rh)return xt;rh=1;var I=oN();return xt=Function.prototype.bind||I,xt}var nh,ah;function zt(){return ah||(ah=1,nh=Function.prototype.call),nh}var sh,hh;function lh(){return hh||(hh=1,sh=Function.prototype.apply),sh}var ch,Dh;function rN(){return Dh||(Dh=1,ch=typeof Reflect<"u"&&Reflect&&Reflect.apply),ch}var vt,Uh;function nN(){if(Uh)return vt;Uh=1;var I=Ge(),A=lh(),g=zt(),B=rN();return vt=B||I.call(g,A),vt}var Wt,fh;function Sh(){if(fh)return Wt;fh=1;var I=Ge(),A=rC(),g=zt(),B=nN();return Wt=function(e){if(e.length<1||typeof e[0]!="function")throw new A("a function is required");return B(I,g,e)},Wt}var Xt,wh;function aN(){if(wh)return Xt;wh=1;var I=Sh(),A=Ah(),g;try{g=[].__proto__===Array.prototype}catch(C){if(!C||typeof C!="object"||!("code"in C)||C.code!=="ERR_PROTO_ACCESS")throw C}var B=!!g&&A&&A(Object.prototype,"__proto__"),e=Object,Q=e.getPrototypeOf;return Xt=B&&typeof B.get=="function"?I([B.get]):typeof Q=="function"?function(C){return Q(C==null?C:e(C))}:!1,Xt}var $t,yh;function sN(){if(yh)return $t;yh=1;var I=ih(),A=Eh(),g=aN();return $t=I?function(B){return I(B)}:A?function(B){if(!B||typeof B!="object"&&typeof B!="function")throw new TypeError("getProto: not an object");return A(B)}:g?function(B){return g(B)}:null,$t}var AE,dh;function hN(){if(dh)return AE;dh=1;var I=Function.prototype.call,A=Object.prototype.hasOwnProperty,g=Ge();return AE=g.call(I,A),AE}var IE,Nh;function gE(){if(Nh)return IE;Nh=1;var I,A=y0(),g=Pd(),B=Od(),e=xd(),Q=zd(),C=vd(),i=rC(),o=Wd(),D=Xd(),a=$d(),U=AN(),J=IN(),f=gN(),y=BN(),S=QN(),R=Function,N=function(eA){try{return R('"use strict"; return ('+eA+").constructor;")()}catch{}},G=Ah(),H=iN(),Z=function(){throw new i},W=G?function(){try{return arguments.callee,Z}catch{try{return G(arguments,"callee").get}catch{return Z}}}():Z,x=EN()(),X=sN(),m=Eh(),z=ih(),q=lh(),iA=zt(),hA={},DA=typeof Uint8Array>"u"||!X?I:X(Uint8Array),p={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?I:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?I:ArrayBuffer,"%ArrayIteratorPrototype%":x&&X?X([][Symbol.iterator]()):I,"%AsyncFromSyncIteratorPrototype%":I,"%AsyncFunction%":hA,"%AsyncGenerator%":hA,"%AsyncGeneratorFunction%":hA,"%AsyncIteratorPrototype%":hA,"%Atomics%":typeof Atomics>"u"?I:Atomics,"%BigInt%":typeof BigInt>"u"?I:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?I:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?I:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?I:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":g,"%eval%":eval,"%EvalError%":B,"%Float16Array%":typeof Float16Array>"u"?I:Float16Array,"%Float32Array%":typeof Float32Array>"u"?I:Float32Array,"%Float64Array%":typeof Float64Array>"u"?I:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?I:FinalizationRegistry,"%Function%":R,"%GeneratorFunction%":hA,"%Int8Array%":typeof Int8Array>"u"?I:Int8Array,"%Int16Array%":typeof Int16Array>"u"?I:Int16Array,"%Int32Array%":typeof Int32Array>"u"?I:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":x&&X?X(X([][Symbol.iterator]())):I,"%JSON%":typeof JSON=="object"?JSON:I,"%Map%":typeof Map>"u"?I:Map,"%MapIteratorPrototype%":typeof Map>"u"||!x||!X?I:X(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":A,"%Object.getOwnPropertyDescriptor%":G,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?I:Promise,"%Proxy%":typeof Proxy>"u"?I:Proxy,"%RangeError%":e,"%ReferenceError%":Q,"%Reflect%":typeof Reflect>"u"?I:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?I:Set,"%SetIteratorPrototype%":typeof Set>"u"||!x||!X?I:X(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?I:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":x&&X?X(""[Symbol.iterator]()):I,"%Symbol%":x?Symbol:I,"%SyntaxError%":C,"%ThrowTypeError%":W,"%TypedArray%":DA,"%TypeError%":i,"%Uint8Array%":typeof Uint8Array>"u"?I:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?I:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?I:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?I:Uint32Array,"%URIError%":o,"%WeakMap%":typeof WeakMap>"u"?I:WeakMap,"%WeakRef%":typeof WeakRef>"u"?I:WeakRef,"%WeakSet%":typeof WeakSet>"u"?I:WeakSet,"%Function.prototype.call%":iA,"%Function.prototype.apply%":q,"%Object.defineProperty%":H,"%Object.getPrototypeOf%":m,"%Math.abs%":D,"%Math.floor%":a,"%Math.max%":U,"%Math.min%":J,"%Math.pow%":f,"%Math.round%":y,"%Math.sign%":S,"%Reflect.getPrototypeOf%":z};if(X)try{null.error}catch(eA){var T=X(X(eA));p["%Error.prototype%"]=T}var $=function eA(rA){var u;if(rA==="%AsyncFunction%")u=N("async function () {}");else if(rA==="%GeneratorFunction%")u=N("function* () {}");else if(rA==="%AsyncGeneratorFunction%")u=N("async function* () {}");else if(rA==="%AsyncGenerator%"){var k=eA("%AsyncGeneratorFunction%");k&&(u=k.prototype)}else if(rA==="%AsyncIteratorPrototype%"){var BA=eA("%AsyncGenerator%");BA&&X&&(u=X(BA.prototype))}return p[rA]=u,u},j={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},P=Ge(),EA=hN(),CA=P.call(iA,Array.prototype.concat),L=P.call(q,Array.prototype.splice),V=P.call(iA,String.prototype.replace),AA=P.call(iA,String.prototype.slice),QA=P.call(iA,RegExp.prototype.exec),oA=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Y=/\\(\\)?/g,b=function(eA){var rA=AA(eA,0,1),u=AA(eA,-1);if(rA==="%"&&u!=="%")throw new C("invalid intrinsic syntax, expected closing `%`");if(u==="%"&&rA!=="%")throw new C("invalid intrinsic syntax, expected opening `%`");var k=[];return V(eA,oA,function(BA,tA,cA,lA){k[k.length]=cA?V(lA,Y,"$1"):tA||BA}),k},v=function(eA,rA){var u=eA,k;if(EA(j,u)&&(k=j[u],u="%"+k[0]+"%"),EA(p,u)){var BA=p[u];if(BA===hA&&(BA=$(u)),typeof BA>"u"&&!rA)throw new i("intrinsic "+eA+" exists, but is not available. Please file an issue!");return{alias:k,name:u,value:BA}}throw new C("intrinsic "+eA+" does not exist!")};return IE=function(eA,rA){if(typeof eA!="string"||eA.length===0)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof rA!="boolean")throw new i('"allowMissing" argument must be a boolean');if(QA(/^%?[^%]*%?$/,eA)===null)throw new C("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var u=b(eA),k=u.length>0?u[0]:"",BA=v("%"+k+"%",rA),tA=BA.name,cA=BA.value,lA=!1,UA=BA.alias;UA&&(k=UA[0],L(u,CA([0,1],UA)));for(var uA=1,xA=!0;uA<u.length;uA+=1){var FA=u[uA],bA=AA(FA,0,1),JA=AA(FA,-1);if((bA==='"'||bA==="'"||bA==="`"||JA==='"'||JA==="'"||JA==="`")&&bA!==JA)throw new C("property names with quotes must have matching quotes");if((FA==="constructor"||!xA)&&(lA=!0),k+="."+FA,tA="%"+k+"%",EA(p,tA))cA=p[tA];else if(cA!=null){if(!(FA in cA)){if(!rA)throw new i("base intrinsic for "+eA+" exists, but the property is not available.");return}if(G&&uA+1>=u.length){var mA=G(cA,FA);xA=!!mA,xA&&"get"in mA&&!("originalValue"in mA.get)?cA=mA.get:cA=cA[FA]}else xA=EA(cA,FA),cA=cA[FA];xA&&!lA&&(p[tA]=cA)}}return cA},IE}var BE,uh;function Rh(){if(uh)return BE;uh=1;var I=gE(),A=Sh(),g=A([I("%String.prototype.indexOf%")]);return BE=function(B,e){var Q=I(B,!!e);return typeof Q=="function"&&g(B,".prototype.")>-1?A([Q]):Q},BE}var CE,Gh;function kh(){if(Gh)return CE;Gh=1;var I=gE(),A=Rh(),g=Re(),B=rC(),e=I("%Map%",!0),Q=A("Map.prototype.get",!0),C=A("Map.prototype.set",!0),i=A("Map.prototype.has",!0),o=A("Map.prototype.delete",!0),D=A("Map.prototype.size",!0);return CE=!!e&&function(){var a,U={assert:function(J){if(!U.has(J))throw new B("Side channel does not contain "+g(J))},delete:function(J){if(a){var f=o(a,J);return D(a)===0&&(a=void 0),f}return!1},get:function(J){if(a)return Q(a,J)},has:function(J){return a?i(a,J):!1},set:function(J,f){a||(a=new e),C(a,J,f)}};return U},CE}var QE,Fh;function lN(){if(Fh)return QE;Fh=1;var I=gE(),A=Rh(),g=Re(),B=kh(),e=rC(),Q=I("%WeakMap%",!0),C=A("WeakMap.prototype.get",!0),i=A("WeakMap.prototype.set",!0),o=A("WeakMap.prototype.has",!0),D=A("WeakMap.prototype.delete",!0);return QE=Q?function(){var a,U,J={assert:function(f){if(!J.has(f))throw new e("Side channel does not contain "+g(f))},delete:function(f){if(Q&&f&&(typeof f=="object"||typeof f=="function")){if(a)return D(a,f)}else if(B&&U)return U.delete(f);return!1},get:function(f){return Q&&f&&(typeof f=="object"||typeof f=="function")&&a?C(a,f):U&&U.get(f)},has:function(f){return Q&&f&&(typeof f=="object"||typeof f=="function")&&a?o(a,f):!!U&&U.has(f)},set:function(f,y){Q&&f&&(typeof f=="object"||typeof f=="function")?(a||(a=new Q),i(a,f,y)):B&&(U||(U=B()),U.set(f,y))}};return J}:B,QE}var eE,Jh;function ph(){if(Jh)return eE;Jh=1;var I=rC(),A=Re(),g=Zd(),B=kh(),e=lN(),Q=e||B||g;return eE=function(){var C,i={assert:function(o){if(!i.has(o))throw new I("Side channel does not contain "+A(o))},delete:function(o){return!!C&&C.delete(o)},get:function(o){return C&&C.get(o)},has:function(o){return!!C&&C.has(o)},set:function(o,D){C||(C=Q()),C.set(o,D)}};return i},eE}var iE,Hh;function tE(){if(Hh)return iE;Hh=1;var I=String.prototype.replace,A=/%20/g,g={RFC1738:"RFC1738",RFC3986:"RFC3986"};return iE={default:g.RFC3986,formatters:{RFC1738:function(B){return I.call(B,A,"+")},RFC3986:function(B){return String(B)}},RFC1738:g.RFC1738,RFC3986:g.RFC3986},iE}var EE,Mh;function mh(){if(Mh)return EE;Mh=1;var I=tE(),A=ph(),g=Object.prototype.hasOwnProperty,B=Array.isArray,e=A(),Q=function(x,X){return e.set(x,X),x},C=function(x){return e.has(x)},i=function(x){return e.get(x)},o=function(x,X){e.set(x,X)},D=function(){for(var x=[],X=0;X<256;++X)x.push("%"+((X<16?"0":"")+X.toString(16)).toUpperCase());return x}(),a=function(x){for(;x.length>1;){var X=x.pop(),m=X.obj[X.prop];if(B(m)){for(var z=[],q=0;q<m.length;++q)typeof m[q]<"u"&&z.push(m[q]);X.obj[X.prop]=z}}},U=function(x,X){for(var m=X&&X.plainObjects?{__proto__:null}:{},z=0;z<x.length;++z)typeof x[z]<"u"&&(m[z]=x[z]);return m},J=function x(X,m,z){if(!m)return X;if(typeof m!="object"&&typeof m!="function"){if(B(X))X.push(m);else if(X&&typeof X=="object")if(C(X)){var q=i(X)+1;X[q]=m,o(X,q)}else(z&&(z.plainObjects||z.allowPrototypes)||!g.call(Object.prototype,m))&&(X[m]=!0);else return[X,m];return X}if(!X||typeof X!="object"){if(C(m)){for(var iA=Object.keys(m),hA=z&&z.plainObjects?{__proto__:null,0:X}:{0:X},DA=0;DA<iA.length;DA++){var p=parseInt(iA[DA],10);hA[p+1]=m[iA[DA]]}return Q(hA,i(m)+1)}return[X].concat(m)}var T=X;return B(X)&&!B(m)&&(T=U(X,z)),B(X)&&B(m)?(m.forEach(function($,j){if(g.call(X,j)){var P=X[j];P&&typeof P=="object"&&$&&typeof $=="object"?X[j]=x(P,$,z):X.push($)}else X[j]=$}),X):Object.keys(m).reduce(function($,j){var P=m[j];return g.call($,j)?$[j]=x($[j],P,z):$[j]=P,$},T)},f=function(x,X){return Object.keys(X).reduce(function(m,z){return m[z]=X[z],m},x)},y=function(x,X,m){var z=x.replace(/\+/g," ");if(m==="iso-8859-1")return z.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(z)}catch{return z}},S=1024,R=function(x,X,m,z,q){if(x.length===0)return x;var iA=x;if(typeof x=="symbol"?iA=Symbol.prototype.toString.call(x):typeof x!="string"&&(iA=String(x)),m==="iso-8859-1")return escape(iA).replace(/%u[0-9a-f]{4}/gi,function(P){return"%26%23"+parseInt(P.slice(2),16)+"%3B"});for(var hA="",DA=0;DA<iA.length;DA+=S){for(var p=iA.length>=S?iA.slice(DA,DA+S):iA,T=[],$=0;$<p.length;++$){var j=p.charCodeAt($);if(j===45||j===46||j===95||j===126||j>=48&&j<=57||j>=65&&j<=90||j>=97&&j<=122||q===I.RFC1738&&(j===40||j===41)){T[T.length]=p.charAt($);continue}if(j<128){T[T.length]=D[j];continue}if(j<2048){T[T.length]=D[192|j>>6]+D[128|j&63];continue}if(j<55296||j>=57344){T[T.length]=D[224|j>>12]+D[128|j>>6&63]+D[128|j&63];continue}$+=1,j=65536+((j&1023)<<10|p.charCodeAt($)&1023),T[T.length]=D[240|j>>18]+D[128|j>>12&63]+D[128|j>>6&63]+D[128|j&63]}hA+=T.join("")}return hA},N=function(x){for(var X=[{obj:{o:x},prop:"o"}],m=[],z=0;z<X.length;++z)for(var q=X[z],iA=q.obj[q.prop],hA=Object.keys(iA),DA=0;DA<hA.length;++DA){var p=hA[DA],T=iA[p];typeof T=="object"&&T!==null&&m.indexOf(T)===-1&&(X.push({obj:iA,prop:p}),m.push(T))}return a(X),x},G=function(x){return Object.prototype.toString.call(x)==="[object RegExp]"},H=function(x){return!x||typeof x!="object"?!1:!!(x.constructor&&x.constructor.isBuffer&&x.constructor.isBuffer(x))},Z=function(x,X,m,z){if(C(x)){var q=i(x)+1;return x[q]=X,o(x,q),x}var iA=[].concat(x,X);return iA.length>m?Q(U(iA,{plainObjects:z}),iA.length-1):iA},W=function(x,X){if(B(x)){for(var m=[],z=0;z<x.length;z+=1)m.push(X(x[z]));return m}return X(x)};return EE={arrayToObject:U,assign:f,combine:Z,compact:N,decode:y,encode:R,isBuffer:H,isOverflow:C,isRegExp:G,maybeMap:W,merge:J},EE}var oE,Lh;function cN(){if(Lh)return oE;Lh=1;var I=ph(),A=mh(),g=tE(),B=Object.prototype.hasOwnProperty,e={brackets:function(S){return S+"[]"},comma:"comma",indices:function(S,R){return S+"["+R+"]"},repeat:function(S){return S}},Q=Array.isArray,C=Array.prototype.push,i=function(S,R){C.apply(S,Q(R)?R:[R])},o=Date.prototype.toISOString,D=g.default,a={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:A.encode,encodeValuesOnly:!1,filter:void 0,format:D,formatter:g.formatters[D],indices:!1,serializeDate:function(S){return o.call(S)},skipNulls:!1,strictNullHandling:!1},U=function(S){return typeof S=="string"||typeof S=="number"||typeof S=="boolean"||typeof S=="symbol"||typeof S=="bigint"},J={},f=function S(R,N,G,H,Z,W,x,X,m,z,q,iA,hA,DA,p,T,$,j){for(var P=R,EA=j,CA=0,L=!1;(EA=EA.get(J))!==void 0&&!L;){var V=EA.get(R);if(CA+=1,typeof V<"u"){if(V===CA)throw new RangeError("Cyclic object value");L=!0}typeof EA.get(J)>"u"&&(CA=0)}if(typeof z=="function"?P=z(N,P):P instanceof Date?P=hA(P):G==="comma"&&Q(P)&&(P=A.maybeMap(P,function(cA){return cA instanceof Date?hA(cA):cA})),P===null){if(W)return m&&!T?m(N,a.encoder,$,"key",DA):N;P=""}if(U(P)||A.isBuffer(P)){if(m){var AA=T?N:m(N,a.encoder,$,"key",DA);return[p(AA)+"="+p(m(P,a.encoder,$,"value",DA))]}return[p(N)+"="+p(String(P))]}var QA=[];if(typeof P>"u")return QA;var oA;if(G==="comma"&&Q(P))T&&m&&(P=A.maybeMap(P,m)),oA=[{value:P.length>0?P.join(",")||null:void 0}];else if(Q(z))oA=z;else{var Y=Object.keys(P);oA=q?Y.sort(q):Y}var b=X?String(N).replace(/\./g,"%2E"):String(N),v=H&&Q(P)&&P.length===1?b+"[]":b;if(Z&&Q(P)&&P.length===0)return v+"[]";for(var eA=0;eA<oA.length;++eA){var rA=oA[eA],u=typeof rA=="object"&&rA&&typeof rA.value<"u"?rA.value:P[rA];if(!(x&&u===null)){var k=iA&&X?String(rA).replace(/\./g,"%2E"):String(rA),BA=Q(P)?typeof G=="function"?G(v,k):v:v+(iA?"."+k:"["+k+"]");j.set(R,CA);var tA=I();tA.set(J,j),i(QA,S(u,BA,G,H,Z,W,x,X,G==="comma"&&T&&Q(P)?null:m,z,q,iA,hA,DA,p,T,$,tA))}}return QA},y=function(S){if(!S)return a;if(typeof S.allowEmptyArrays<"u"&&typeof S.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof S.encodeDotInKeys<"u"&&typeof S.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(S.encoder!==null&&typeof S.encoder<"u"&&typeof S.encoder!="function")throw new TypeError("Encoder has to be a function.");var R=S.charset||a.charset;if(typeof S.charset<"u"&&S.charset!=="utf-8"&&S.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var N=g.default;if(typeof S.format<"u"){if(!B.call(g.formatters,S.format))throw new TypeError("Unknown format option provided.");N=S.format}var G=g.formatters[N],H=a.filter;(typeof S.filter=="function"||Q(S.filter))&&(H=S.filter);var Z;if(S.arrayFormat in e?Z=S.arrayFormat:"indices"in S?Z=S.indices?"indices":"repeat":Z=a.arrayFormat,"commaRoundTrip"in S&&typeof S.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var W=typeof S.allowDots>"u"?S.encodeDotInKeys===!0?!0:a.allowDots:!!S.allowDots;return{addQueryPrefix:typeof S.addQueryPrefix=="boolean"?S.addQueryPrefix:a.addQueryPrefix,allowDots:W,allowEmptyArrays:typeof S.allowEmptyArrays=="boolean"?!!S.allowEmptyArrays:a.allowEmptyArrays,arrayFormat:Z,charset:R,charsetSentinel:typeof S.charsetSentinel=="boolean"?S.charsetSentinel:a.charsetSentinel,commaRoundTrip:!!S.commaRoundTrip,delimiter:typeof S.delimiter>"u"?a.delimiter:S.delimiter,encode:typeof S.encode=="boolean"?S.encode:a.encode,encodeDotInKeys:typeof S.encodeDotInKeys=="boolean"?S.encodeDotInKeys:a.encodeDotInKeys,encoder:typeof S.encoder=="function"?S.encoder:a.encoder,encodeValuesOnly:typeof S.encodeValuesOnly=="boolean"?S.encodeValuesOnly:a.encodeValuesOnly,filter:H,format:N,formatter:G,serializeDate:typeof S.serializeDate=="function"?S.serializeDate:a.serializeDate,skipNulls:typeof S.skipNulls=="boolean"?S.skipNulls:a.skipNulls,sort:typeof S.sort=="function"?S.sort:null,strictNullHandling:typeof S.strictNullHandling=="boolean"?S.strictNullHandling:a.strictNullHandling}};return oE=function(S,R){var N=S,G=y(R),H,Z;typeof G.filter=="function"?(Z=G.filter,N=Z("",N)):Q(G.filter)&&(Z=G.filter,H=Z);var W=[];if(typeof N!="object"||N===null)return"";var x=e[G.arrayFormat],X=x==="comma"&&G.commaRoundTrip;H||(H=Object.keys(N)),G.sort&&H.sort(G.sort);for(var m=I(),z=0;z<H.length;++z){var q=H[z],iA=N[q];G.skipNulls&&iA===null||i(W,f(iA,q,x,X,G.allowEmptyArrays,G.strictNullHandling,G.skipNulls,G.encodeDotInKeys,G.encode?G.encoder:null,G.filter,G.sort,G.allowDots,G.serializeDate,G.format,G.formatter,G.encodeValuesOnly,G.charset,m))}var hA=W.join(G.delimiter),DA=G.addQueryPrefix===!0?"?":"";return G.charsetSentinel&&(G.charset==="iso-8859-1"?DA+="utf8=%26%2310003%3B&":DA+="utf8=%E2%9C%93&"),hA.length>0?DA+hA:""},oE}var rE,Kh;function DN(){if(Kh)return rE;Kh=1;var I=mh(),A=Object.prototype.hasOwnProperty,g=Array.isArray,B={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:I.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},e=function(f){return f.replace(/&#(\d+);/g,function(y,S){return String.fromCharCode(parseInt(S,10))})},Q=function(f,y,S){if(f&&typeof f=="string"&&y.comma&&f.indexOf(",")>-1)return f.split(",");if(y.throwOnLimitExceeded&&S>=y.arrayLimit)throw new RangeError("Array limit exceeded. Only "+y.arrayLimit+" element"+(y.arrayLimit===1?"":"s")+" allowed in an array.");return f},C="utf8=%26%2310003%3B",i="utf8=%E2%9C%93",o=function(f,y){var S={__proto__:null},R=y.ignoreQueryPrefix?f.replace(/^\?/,""):f;R=R.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var N=y.parameterLimit===1/0?void 0:y.parameterLimit,G=R.split(y.delimiter,y.throwOnLimitExceeded?N+1:N);if(y.throwOnLimitExceeded&&G.length>N)throw new RangeError("Parameter limit exceeded. Only "+N+" parameter"+(N===1?"":"s")+" allowed.");var H=-1,Z,W=y.charset;if(y.charsetSentinel)for(Z=0;Z<G.length;++Z)G[Z].indexOf("utf8=")===0&&(G[Z]===i?W="utf-8":G[Z]===C&&(W="iso-8859-1"),H=Z,Z=G.length);for(Z=0;Z<G.length;++Z)if(Z!==H){var x=G[Z],X=x.indexOf("]="),m=X===-1?x.indexOf("="):X+1,z,q;if(m===-1?(z=y.decoder(x,B.decoder,W,"key"),q=y.strictNullHandling?null:""):(z=y.decoder(x.slice(0,m),B.decoder,W,"key"),z!==null&&(q=I.maybeMap(Q(x.slice(m+1),y,g(S[z])?S[z].length:0),function(hA){return y.decoder(hA,B.decoder,W,"value")}))),q&&y.interpretNumericEntities&&W==="iso-8859-1"&&(q=e(String(q))),x.indexOf("[]=")>-1&&(q=g(q)?[q]:q),z!==null){var iA=A.call(S,z);iA&&y.duplicates==="combine"?S[z]=I.combine(S[z],q,y.arrayLimit,y.plainObjects):(!iA||y.duplicates==="last")&&(S[z]=q)}}return S},D=function(f,y,S,R){var N=0;if(f.length>0&&f[f.length-1]==="[]"){var G=f.slice(0,-1).join("");N=Array.isArray(y)&&y[G]?y[G].length:0}for(var H=R?y:Q(y,S,N),Z=f.length-1;Z>=0;--Z){var W,x=f[Z];if(x==="[]"&&S.parseArrays)I.isOverflow(H)?W=H:W=S.allowEmptyArrays&&(H===""||S.strictNullHandling&&H===null)?[]:I.combine([],H,S.arrayLimit,S.plainObjects);else{W=S.plainObjects?{__proto__:null}:{};var X=x.charAt(0)==="["&&x.charAt(x.length-1)==="]"?x.slice(1,-1):x,m=S.decodeDotInKeys?X.replace(/%2E/g,"."):X,z=parseInt(m,10);!S.parseArrays&&m===""?W={0:H}:!isNaN(z)&&x!==m&&String(z)===m&&z>=0&&S.parseArrays&&z<=S.arrayLimit?(W=[],W[z]=H):m!=="__proto__"&&(W[m]=H)}H=W}return H},a=function(f,y){var S=y.allowDots?f.replace(/\.([^.[]+)/g,"[$1]"):f;if(y.depth<=0)return!y.plainObjects&&A.call(Object.prototype,S)&&!y.allowPrototypes?void 0:[S];var R=/(\[[^[\]]*])/,N=/(\[[^[\]]*])/g,G=R.exec(S),H=G?S.slice(0,G.index):S,Z=[];if(H){if(!y.plainObjects&&A.call(Object.prototype,H)&&!y.allowPrototypes)return;Z.push(H)}for(var W=0;(G=N.exec(S))!==null&&W<y.depth;){W+=1;var x=G[1].slice(1,-1);if(!y.plainObjects&&A.call(Object.prototype,x)&&!y.allowPrototypes)return;Z.push(G[1])}if(G){if(y.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+y.depth+" and strictDepth is true");Z.push("["+S.slice(G.index)+"]")}return Z},U=function(f,y,S,R){if(f){var N=a(f,S);if(N)return D(N,y,S,R)}},J=function(f){if(!f)return B;if(typeof f.allowEmptyArrays<"u"&&typeof f.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof f.decodeDotInKeys<"u"&&typeof f.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(f.decoder!==null&&typeof f.decoder<"u"&&typeof f.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof f.charset<"u"&&f.charset!=="utf-8"&&f.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof f.throwOnLimitExceeded<"u"&&typeof f.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var y=typeof f.charset>"u"?B.charset:f.charset,S=typeof f.duplicates>"u"?B.duplicates:f.duplicates;if(S!=="combine"&&S!=="first"&&S!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var R=typeof f.allowDots>"u"?f.decodeDotInKeys===!0?!0:B.allowDots:!!f.allowDots;return{allowDots:R,allowEmptyArrays:typeof f.allowEmptyArrays=="boolean"?!!f.allowEmptyArrays:B.allowEmptyArrays,allowPrototypes:typeof f.allowPrototypes=="boolean"?f.allowPrototypes:B.allowPrototypes,allowSparse:typeof f.allowSparse=="boolean"?f.allowSparse:B.allowSparse,arrayLimit:typeof f.arrayLimit=="number"?f.arrayLimit:B.arrayLimit,charset:y,charsetSentinel:typeof f.charsetSentinel=="boolean"?f.charsetSentinel:B.charsetSentinel,comma:typeof f.comma=="boolean"?f.comma:B.comma,decodeDotInKeys:typeof f.decodeDotInKeys=="boolean"?f.decodeDotInKeys:B.decodeDotInKeys,decoder:typeof f.decoder=="function"?f.decoder:B.decoder,delimiter:typeof f.delimiter=="string"||I.isRegExp(f.delimiter)?f.delimiter:B.delimiter,depth:typeof f.depth=="number"||f.depth===!1?+f.depth:B.depth,duplicates:S,ignoreQueryPrefix:f.ignoreQueryPrefix===!0,interpretNumericEntities:typeof f.interpretNumericEntities=="boolean"?f.interpretNumericEntities:B.interpretNumericEntities,parameterLimit:typeof f.parameterLimit=="number"?f.parameterLimit:B.parameterLimit,parseArrays:f.parseArrays!==!1,plainObjects:typeof f.plainObjects=="boolean"?f.plainObjects:B.plainObjects,strictDepth:typeof f.strictDepth=="boolean"?!!f.strictDepth:B.strictDepth,strictNullHandling:typeof f.strictNullHandling=="boolean"?f.strictNullHandling:B.strictNullHandling,throwOnLimitExceeded:typeof f.throwOnLimitExceeded=="boolean"?f.throwOnLimitExceeded:!1}};return rE=function(f,y){var S=J(y);if(f===""||f===null||typeof f>"u")return S.plainObjects?{__proto__:null}:{};for(var R=typeof f=="string"?o(f,S):f,N=S.plainObjects?{__proto__:null}:{},G=Object.keys(R),H=0;H<G.length;++H){var Z=G[H],W=U(Z,R[Z],S,typeof f=="string");N=I.merge(N,W,S)}return S.allowSparse===!0?N:I.compact(N)},rE}var nE,Yh;function UN(){if(Yh)return nE;Yh=1;var I=cN(),A=DN(),g=tE();return nE={formats:g,parse:A,stringify:I},nE}var fN=UN();function bh(I){return fN.stringify(I,{arrayFormat:"repeat"})}function Th(...I){return I.join("/").replace(/([^:]\/)\/+/g,"$1").replace(/^(\/)+/,"/")}function SN(I,A,g){const B=new Headers;let e;if(py(I))e=I.req.writeReq(A);else{const i=I.req.onlySupport??g.requestWireFormat;switch(i){case NA.json:e=I.req.writeReqJson(A),e.body&&(e.body=JSON.stringify(e.body),B.set(CI.ContentType,HI.json));break;case NA.ssz:e=I.req.writeReqSsz(A),e.body&&B.set(CI.ContentType,HI.ssz);break;default:throw Error(`Invalid requestWireFormat: ${i}`)}}const Q=e.query?bh(e.query):"",C=new URL(Th(g.baseUrl,I.urlFormatter(e.params??{}))+(Q?`?${Q}`:""));if(Ry(C,B,g),!I.resp.isEmpty)if(I.resp.onlySupport!==void 0)switch(I.resp.onlySupport){case NA.json:B.set(CI.Accept,HI.json);break;case NA.ssz:B.set(CI.Accept,HI.ssz);break}else switch(g.responseWireFormat){case NA.json:B.set(CI.Accept,`${HI.json};q=1,${HI.ssz};q=0.9`);break;case NA.ssz:B.set(CI.Accept,`${HI.ssz};q=1,${HI.json};q=0.9`);break;default:throw Error(`Invalid responseWireFormat: ${g.responseWireFormat}`)}return new Request(C,{...g,method:I.method,headers:Mt(B,e.headers,g.headers),body:e.body})}class qh extends Response{definition;_wireFormat;_rawBody;_errorBody;_meta;_value;constructor(A,g,B){super(g,B),this.definition=A}wireFormat(){if(this._wireFormat===void 0){if(this.definition.resp.isEmpty)return this._wireFormat=null,this._wireFormat;const A=this.headers.get(CI.ContentType);if(A===null){if(this.status===MB.NO_CONTENT)return this._wireFormat=null,this._wireFormat;throw Error("Content-Type header is required in response")}const g=uy(A);if(g===null)throw Error(`Unsupported response media type: ${A.split(";",1)[0]}`);const B=ky(g),{onlySupport:e}=this.definition.resp;if(e!==void 0&&B!==e)throw Error(`Method only supports ${e.toUpperCase()} responses`);this._wireFormat=B}return this._wireFormat}async rawBody(){if(this.assertOk(),!this._rawBody)switch(this.wireFormat()){case NA.json:this._rawBody={type:NA.json,value:await super.json()};break;case NA.ssz:this._rawBody={type:NA.ssz,value:new Uint8Array(await this.arrayBuffer())};break;default:this._rawBody={}}return this._rawBody}meta(){if(this.assertOk(),!this._meta)switch(this.wireFormat()){case NA.json:{const A=this.resolvedRawBody(),g=this.definition.resp.transform?this.definition.resp.transform.fromResponse(A.value).meta:A.value;this._meta=this.definition.resp.meta.fromJson(g);break}case NA.ssz:this._meta=this.definition.resp.meta.fromHeaders(new Gy(this.headers));break}return this._meta}value(){if(this.assertOk(),!this._value){const A=this.resolvedRawBody(),g=this.meta();switch(A.type){case NA.json:{const B=this.definition.resp.transform?this.definition.resp.transform.fromResponse(A.value).data:A.value?.data;this._value=this.definition.resp.data.fromJson(B,g);break}case NA.ssz:this._value=this.definition.resp.data.deserialize(A.value,g);break}}return this._value}ssz(){this.assertOk();const A=this.resolvedRawBody();switch(A.type){case NA.json:return this.definition.resp.data.serialize(this.value(),this.meta());case NA.ssz:return A.value;default:return new Uint8Array}}json(){this.assertOk();const A=this.resolvedRawBody();switch(A.type){case NA.json:return A.value;case NA.ssz:return this.definition.resp.data.toJson(this.value(),this.meta());default:return{}}}assertOk(){if(!this.ok)throw this.error()}error(){return this.ok?null:new _d(this.getErrorMessage(),this.status,this.definition.operationId)}async errorBody(){return this._errorBody===void 0&&(this._errorBody=await this.text()),this._errorBody}resolvedRawBody(){if(!this._rawBody)throw Error("rawBody() must be called first");return this._rawBody}resolvedErrorBody(){if(this._errorBody===void 0)throw Error("errorBody() must be called first");return this._errorBody}getErrorMessage(){const A=this.resolvedErrorBody();try{const g=JSON.parse(A);return g.message?g.failures?`${g.message}