1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c2f7b228-1cdd-4f32-83bd-ef32d286240a",e._sentryDebugIdIdentifier="sentry-dbid-c2f7b228-1cdd-4f32-83bd-ef32d286240a")}catch(o){}import"./abort-controller-MJeV0szj.js";import{a as e}from"./buffer-qOi9eeJ4.js";var t,r={};var n=function(){if(t)return r;t=1,Object.defineProperty(r,"__esModule",{value:!0}),r.s16=r.s8=r.nu64be=r.u48be=r.u40be=r.u32be=r.u24be=r.u16be=r.nu64=r.u48=r.u40=r.u32=r.u24=r.u16=r.u8=r.offset=r.greedy=r.Constant=r.UTF8=r.CString=r.Blob=r.Boolean=r.BitField=r.BitStructure=r.VariantLayout=r.Union=r.UnionLayoutDiscriminator=r.UnionDiscriminator=r.Structure=r.Sequence=r.DoubleBE=r.Double=r.FloatBE=r.Float=r.NearInt64BE=r.NearInt64=r.NearUInt64BE=r.NearUInt64=r.IntBE=r.Int=r.UIntBE=r.UInt=r.OffsetLayout=r.GreedyCount=r.ExternalLayout=r.bindConstructorLayout=r.nameWithProperty=r.Layout=r.uint8ArrayToBuffer=r.checkUint8Array=void 0,r.constant=r.utf8=r.cstr=r.blob=r.unionLayoutDiscriminator=r.union=r.seq=r.bits=r.struct=r.f64be=r.f64=r.f32be=r.f32=r.ns64be=r.s48be=r.s40be=r.s32be=r.s24be=r.s16be=r.ns64=r.s48=r.s40=r.s32=r.s24=void 0;const n=e();function s(e){if(!(e instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}function i(e){return s(e),n.Buffer.from(e.buffer,e.byteOffset,e.length)}r.checkUint8Array=s,r.uint8ArrayToBuffer=i;let a=class{constructor(e,t){if(!Number.isInteger(e))throw new TypeError("span must be an integer");this.span=e,this.property=t}makeDestinationObject(){return{}}getSpan(e,t){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(e){const t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}};function u(e,t){return t.property?e+"["+t.property+"]":e}r.Layout=a,r.nameWithProperty=u,r.bindConstructorLayout=function(e,t){if("function"!=typeof e)throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(e,"layout_"))throw new Error("Class is already bound to a layout");if(!(t&&t instanceof a))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(t,"boundConstructor_"))throw new Error("layout is already bound to a constructor");e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=()=>new e,Object.defineProperty(e.prototype,"encode",{value(e,r){return t.encode(this,e,r)},writable:!0}),Object.defineProperty(e,"decode",{value:(e,r)=>t.decode(e,r),writable:!0})};class c extends a{isCount(){throw new Error("ExternalLayout is abstract")}}r.ExternalLayout=c;class d extends c{constructor(e=1,t){if(!Number.isInteger(e)||0>=e)throw new TypeError("elementSpan must be a (positive) integer");super(-1,t),this.elementSpan=e}isCount(){return!0}decode(e,t=0){s(e);const r=e.length-t;return Math.floor(r/this.elementSpan)}encode(e,t,r){return 0}}r.GreedyCount=d;class p extends c{constructor(e,t=0,r){if(!(e instanceof a))throw new TypeError("layout must be a Layout");if(!Number.isInteger(t))throw new TypeError("offset must be integer or undefined");super(e.span,r||e.property),this.layout=e,this.offset=t}isCount(){return this.layout instanceof h||this.layout instanceof l}decode(e,t=0){return this.layout.decode(e,t+this.offset)}encode(e,t,r=0){return this.layout.encode(e,t,r+this.offset)}}r.OffsetLayout=p;class h extends a{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return i(e).readUIntLE(t,this.span)}encode(e,t,r=0){return i(t).writeUIntLE(e,r,this.span),this.span}}r.UInt=h;class l extends a{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return i(e).readUIntBE(t,this.span)}encode(e,t,r=0){return i(t).writeUIntBE(e,r,this.span),this.span}}r.UIntBE=l;class f extends a{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return i(e).readIntLE(t,this.span)}encode(e,t,r=0){return i(t).writeIntLE(e,r,this.span),this.span}}r.Int=f;class y extends a{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return i(e).readIntBE(t,this.span)}encode(e,t,r=0){return i(t).writeIntBE(e,r,this.span),this.span}}r.IntBE=y;const w=Math.pow(2,32);function b(e){const t=Math.floor(e/w);return{hi32:t,lo32:e-t*w}}function g(e,t){return e*w+t}class m extends a{constructor(e){super(8,e)}decode(e,t=0){const r=i(e),n=r.readUInt32LE(t);return g(r.readUInt32LE(t+4),n)}encode(e,t,r=0){const n=b(e),o=i(t);return o.writeUInt32LE(n.lo32,r),o.writeUInt32LE(n.hi32,r+4),8}}r.NearUInt64=m;class E extends a{constructor(e){super(8,e)}decode(e,t=0){const r=i(e);return g(r.readUInt32BE(t),r.readUInt32BE(t+4))}encode(e,t,r=0){const n=b(e),o=i(t);return o.writeUInt32BE(n.hi32,r),o.writeUInt32BE(n.lo32,r+4),8}}r.NearUInt64BE=E;class x extends a{constructor(e){super(8,e)}decode(e,t=0){const r=i(e),n=r.readUInt32LE(t);return g(r.readInt32LE(t+4),n)}encode(e,t,r=0){const n=b(e),o=i(t);return o.writeUInt32LE(n.lo32,r),o.writeInt32LE(n.hi32,r+4),8}}
1r.NearInt64=x;class L extends a{constructor(e){super(8,e)}decode(e,t=0){const r=i(e);return g(r.readInt32BE(t),r.readUInt32BE(t+4))}encode(e,t,r=0){const n=b(e),o=i(t);return o.writeInt32BE(n.hi32,r),o.writeUInt32BE(n.lo32,r+4),8}}r.NearInt64BE=L;class v extends a{constructor(e){super(4,e)}decode(e,t=0){return i(e).readFloatLE(t)}encode(e,t,r=0){return i(t).writeFloatLE(e,r),4}}r.Float=v;class I extends a{constructor(e){super(4,e)}decode(e,t=0){return i(e).readFloatBE(t)}encode(e,t,r=0){return i(t).writeFloatBE(e,r),4}}r.FloatBE=I;class S extends a{constructor(e){super(8,e)}decode(e,t=0){return i(e).readDoubleLE(t)}encode(e,t,r=0){return i(t).writeDoubleLE(e,r),8}}r.Double=S;class B extends a{constructor(e){super(8,e)}decode(e,t=0){return i(e).readDoubleBE(t)}encode(e,t,r=0){return i(t).writeDoubleBE(e,r),8}}r.DoubleBE=B;class U extends a{constructor(e,t,r){if(!(e instanceof a))throw new TypeError("elementLayout must be a Layout");if(!(t instanceof c&&t.isCount()||Number.isInteger(t)&&0<=t))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let n=-1;!(t instanceof c)&&0<e.span&&(n=t*e.span),super(n,r),this.elementLayout=e,this.count=t}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0,n=this.count;if(n instanceof c&&(n=n.decode(e,t)),0<this.elementLayout.span)r=n*this.elementLayout.span;else{let o=0;for(;o<n;)r+=this.elementLayout.getSpan(e,t+r),++o}return r}decode(e,t=0){const r=[];let n=0,o=this.count;for(o instanceof c&&(o=o.decode(e,t));n<o;)r.push(this.elementLayout.decode(e,t)),t+=this.elementLayout.getSpan(e,t),n+=1;return r}encode(e,t,r=0){const n=this.elementLayout,o=e.reduce((e,o)=>e+n.encode(o,t,r+e),0);return this.count instanceof c&&this.count.encode(e.length,t,r),o}}r.Sequence=U;class D extends a{constructor(e,t,r){if(!Array.isArray(e)||!e.reduce((e,t)=>e&&t instanceof a,!0))throw new TypeError("fields must be array of Layout instances");"boolean"==typeof t&&void 0===r&&(r=t,t=void 0);for(const o of e)if(0>o.span&&void 0===o.property)throw new Error("fields cannot contain unnamed variable-length layout");let n=-1;try{n=e.reduce((e,t)=>e+t.getSpan(),0)}catch(o){}super(n,t),this.fields=e,this.decodePrefixes=!!r}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0;try{r=this.fields.reduce((r,n)=>{const o=n.getSpan(e,t);return t+=o,r+o},0)}catch(o){throw new RangeError("indeterminate span")}return r}decode(e,t=0){s(e);const r=this.makeDestinationObject();for(const n of this.fields)if(void 0!==n.property&&(r[n.property]=n.decode(e,t)),t+=n.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return r}encode(e,t,r=0){const n=r;let o=0,s=0;for(const i of this.fields){let n=i.span;if(s=0<n?n:0,void 0!==i.property){const o=e[i.property];void 0!==o&&(s=i.encode(o,t,r),0>n&&(n=i.getSpan(t,r)))}o=r,r+=n}return o+s-n}fromArray(e){const t=this.makeDestinationObject();for(const r of this.fields)void 0!==r.property&&0<e.length&&(t[r.property]=e.shift());return t}layoutFor(e){if("string"!=typeof e)throw new TypeError("property must be string");for(const t of this.fields)if(t.property===e)return t}offsetOf(e){if("string"!=typeof e)throw new TypeError("property must be string");let t=0;for(const r of this.fields){if(r.property===e)return t;0>r.span?t=-1:0<=t&&(t+=r.span)}}}r.Structure=D;class T{constructor(e){this.property=e}decode(e,t){throw new Error("UnionDiscriminator is abstract")}encode(e,t,r){throw new Error("UnionDiscriminator is abstract")}}r.UnionDiscriminator=T;class O extends T{constructor(e,t){if(!(e instanceof c&&e.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(t||e.property||"variant"),this.layout=e}decode(e,t){return this.layout.decode(e,t)}encode(e,t,r){return this.layout.encode(e,t,r)}}r.UnionLayoutDiscriminator=O;class k extends a{constructor(e,t,r){let n;if(e instanceof h||e instanceof l)n=new O(new p(e));else if(e instanceof c&&e.isCount())n=new O(e);else{if(!(e instanceof T))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");n=e}if(void 0===t&&(t=null),!(null===t||t instanceof a))throw new TypeError("defaultLayout must be null or a Layout");if(null!==t){if(0>t.span)throw new Error("defaultLayout must have constant span");void 0===t.property&&(t=t.replicate("content"))}let o=-1;t&&(o=t.span,0<=o&&(e instanceof h||e instanceof l)&&(o+=n.layout.span)),super(o,r),this.discriminator=n,this.usesPrefixDiscriminator=e instanceof h||e instanceof l,this.defaultLayout=t,this.registry={};let s=this.defaultGetSourceVariant.bind(this);
1this.getSourceVariant=function(e){return s(e)},this.configGetSourceVariant=function(e){s=e.bind(this)}}getSpan(e,t=0){if(0<=this.span)return this.span;const r=this.getVariant(e,t);if(!r)throw new Error("unable to determine span for unrecognized variant");return r.getSpan(e,t)}defaultGetSourceVariant(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;const t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(const t in this.registry){const r=this.registry[t];if(r.property&&Object.prototype.hasOwnProperty.call(e,r.property))return r}throw new Error("unable to infer src variant")}decode(e,t=0){let r;const n=this.discriminator,o=n.decode(e,t),s=this.registry[o];if(void 0===s){const s=this.defaultLayout;let i=0;this.usesPrefixDiscriminator&&(i=n.layout.span),r=this.makeDestinationObject(),r[n.property]=o,r[s.property]=s.decode(e,t+i)}else r=s.decode(e,t);return r}encode(e,t,r=0){const n=this.getSourceVariant(e);if(void 0===n){const n=this.discriminator,o=this.defaultLayout;let s=0;return this.usesPrefixDiscriminator&&(s=n.layout.span),n.encode(e[n.property],t,r),s+o.encode(e[o.property],t,r+s)}return n.encode(e,t,r)}addVariant(e,t,r){const n=new P(this,e,t,r);return this.registry[e]=n,n}getVariant(e,t=0){let r;return r=e instanceof Uint8Array?this.discriminator.decode(e,t):e,this.registry[r]}}r.Union=k;class P extends a{constructor(e,t,r,n){if(!(e instanceof k))throw new TypeError("union must be a Union");if(!Number.isInteger(t)||0>t)throw new TypeError("variant must be a (non-negative) integer");if("string"==typeof r&&void 0===n&&(n=r,r=null),r){if(!(r instanceof a))throw new TypeError("layout must be a Layout");if(null!==e.defaultLayout&&0<=r.span&&r.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!=typeof n)throw new TypeError("variant must have a String property")}let o=e.span;0>e.span&&(o=r?r.span:0,0<=o&&e.usesPrefixDiscriminator&&(o+=e.discriminator.layout.span)),super(o,n),this.union=e,this.variant=t,this.layout=r||null}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0;this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span);let n=0;return this.layout&&(n=this.layout.getSpan(e,t+r)),r+n}decode(e,t=0){const r=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))throw new Error("variant mismatch");let n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(e,t+n):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(e,t,r=0){let n=0;if(this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,t,r);let o=n;if(this.layout&&(this.layout.encode(e[this.property],t,r+n),o+=this.layout.getSpan(t,r+n),0<=this.union.span&&o>this.union.span))throw new Error("encoded variant overruns containing union");return o}fromArray(e){if(this.layout)return this.layout.fromArray(e)}}function j(e){return 0>e&&(e+=4294967296),e}r.VariantLayout=P;class C extends a{constructor(e,t,r){if(!(e instanceof h||e instanceof l))throw new TypeError("word must be a UInt or UIntBE layout");if("string"==typeof t&&void 0===r&&(r=t,t=!1),4<e.span)throw new RangeError("word cannot exceed 32 bits");super(e.span,r),this.word=e,this.msb=!!t,this.fields=[];let n=0;this._packedSetValue=function(e){return n=j(e),this},this._packedGetValue=function(){return n}}decode(e,t=0){const r=this.makeDestinationObject(),n=this.word.decode(e,t);this._packedSetValue(n);for(const o of this.fields)void 0!==o.property&&(r[o.property]=o.decode(e));return r}encode(e,t,r=0){const n=this.word.decode(t,r);this._packedSetValue(n);for(const o of this.fields)if(void 0!==o.property){const t=e[o.property];void 0!==t&&o.encode(t)}return this.word.encode(this._packedGetValue(),t,r)}addField(e,t){const r=new V(this,e,t);return this.fields.push(r),r}addBoolean(e){const t=new _(this,e);return this.fields.push(t),t}fieldFor(e){if("string"!=typeof e)throw new TypeError("property must be string");for(const t of this.fields)if(t.property===e)return t}}r.BitStructure=C;class V{constructor(e,t,r){if(!(e instanceof C))throw new TypeError("container must be a BitStructure");
1if(!Number.isInteger(t)||0>=t)throw new TypeError("bits must be positive integer");const n=8*e.span,o=e.fields.reduce((e,t)=>e+t.bits,0);if(t+o>n)throw new Error("bits too long for span remainder ("+(n-o)+" of "+n+" remain)");this.container=e,this.bits=t,this.valueMask=(1<<t)-1,32===t&&(this.valueMask=4294967295),this.start=o,this.container.msb&&(this.start=n-o-t),this.wordMask=j(this.valueMask<<this.start),this.property=r}decode(e,t){return j(this.container._packedGetValue()&this.wordMask)>>>this.start}encode(e){if("number"!=typeof e||!Number.isInteger(e)||e!==j(e&this.valueMask))throw new TypeError(u("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const t=this.container._packedGetValue(),r=j(e<<this.start);this.container._packedSetValue(j(t&~this.wordMask)|r)}}r.BitField=V;class _ extends V{constructor(e,t){super(e,1,t)}decode(e,t){return!!super.decode(e,t)}encode(e){"boolean"==typeof e&&(e=+e),super.encode(e)}}r.Boolean=_;class N extends a{constructor(e,t){if(!(e instanceof c&&e.isCount()||Number.isInteger(e)&&0<=e))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let r=-1;e instanceof c||(r=e),super(r,t),this.length=e}getSpan(e,t){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),r}decode(e,t=0){let r=this.span;return 0>r&&(r=this.length.decode(e,t)),i(e).slice(t,t+r)}encode(e,t,r){let n=this.length;if(this.length instanceof c&&(n=e.length),!(e instanceof Uint8Array&&n===e.length))throw new TypeError(u("Blob.encode",this)+" requires (length "+n+") Uint8Array as src");if(r+n>t.length)throw new RangeError("encoding overruns Uint8Array");const o=i(e);return i(t).write(o.toString("hex"),r,n,"hex"),this.length instanceof c&&this.length.encode(n,t,r),n}}r.Blob=N;class A extends a{constructor(e){super(-1,e)}getSpan(e,t=0){s(e);let r=t;for(;r<e.length&&0!==e[r];)r+=1;return 1+r-t}decode(e,t=0){const r=this.getSpan(e,t);return i(e).slice(t,t+r-1).toString("utf-8")}encode(e,t,r=0){"string"!=typeof e&&(e=String(e));const o=n.Buffer.from(e,"utf8"),s=o.length;if(r+s>t.length)throw new RangeError("encoding overruns Buffer");const a=i(t);return o.copy(a,r),a[r+s]=0,s+1}}r.CString=A;class F extends a{constructor(e,t){if("string"==typeof e&&void 0===t&&(t=e,e=void 0),void 0===e)e=-1;else if(!Number.isInteger(e))throw new TypeError("maxSpan must be an integer");super(-1,t),this.maxSpan=e}getSpan(e,t=0){return s(e),e.length-t}decode(e,t=0){const r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpan<r)throw new RangeError("text length exceeds maxSpan");return i(e).slice(t,t+r).toString("utf-8")}encode(e,t,r=0){"string"!=typeof e&&(e=String(e));const o=n.Buffer.from(e,"utf8"),s=o.length;if(0<=this.maxSpan&&this.maxSpan<s)throw new RangeError("text length exceeds maxSpan");if(r+s>t.length)throw new RangeError("encoding overruns Buffer");return o.copy(i(t),r),s}}r.UTF8=F;class M extends a{constructor(e,t){super(0,t),this.value=e}decode(e,t){return this.value}encode(e,t,r){return 0}}return r.Constant=M,r.greedy=(e,t)=>new d(e,t),r.offset=(e,t,r)=>new p(e,t,r),r.u8=e=>new h(1,e),r.u16=e=>new h(2,e),r.u24=e=>new h(3,e),r.u32=e=>new h(4,e),r.u40=e=>new h(5,e),r.u48=e=>new h(6,e),r.nu64=e=>new m(e),r.u16be=e=>new l(2,e),r.u24be=e=>new l(3,e),r.u32be=e=>new l(4,e),r.u40be=e=>new l(5,e),r.u48be=e=>new l(6,e),r.nu64be=e=>new E(e),r.s8=e=>new f(1,e),r.s16=e=>new f(2,e),r.s24=e=>new f(3,e),r.s32=e=>new f(4,e),r.s40=e=>new f(5,e),r.s48=e=>new f(6,e),r.ns64=e=>new x(e),r.s16be=e=>new y(2,e),r.s24be=e=>new y(3,e),r.s32be=e=>new y(4,e),r.s40be=e=>new y(5,e),r.s48be=e=>new y(6,e),r.ns64be=e=>new L(e),r.f32=e=>new v(e),r.f32be=e=>new I(e),r.f64=e=>new S(e),r.f64be=e=>new B(e),r.struct=(e,t,r)=>new D(e,t,r),r.bits=(e,t,r)=>new C(e,t,r),r.seq=(e,t,r)=>new U(e,t,r),r.union=(e,t,r)=>new k(e,t,r),r.unionLayoutDiscriminator=(e,t)=>new O(e,t),r.blob=(e,t)=>new N(e,t),r.cstr=e=>new A(e),r.utf8=(e,t)=>new F(e,t),r.constant=(e,t)=>new M(e,t),r}();export{n as L}; 2//# sourceMappingURL=solana_buffer-layout-xCeoPgpw.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.