@sentio/sdk-bundle 2.44.2-rc.1 → 2.44.2-rc.2

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.
Files changed (75) hide show
  1. package/lib/aptos/builtin/0x1.js +1 -1
  2. package/lib/aptos/builtin/0x3.js +1 -1
  3. package/lib/aptos/builtin/index.js +1 -1
  4. package/lib/aptos/ext/index.js +1 -1
  5. package/lib/aptos/index.js +1 -1
  6. package/lib/btc/index.js +1 -1
  7. package/lib/{chunk-4WDJVFCT.js → chunk-4MFZRYCX.js} +2 -2
  8. package/lib/{chunk-PNVZOHKE.js → chunk-5MSYUYPI.js} +2 -2
  9. package/lib/chunk-AYDIUTOB.js +5 -0
  10. package/lib/chunk-AYDIUTOB.js.map +1 -0
  11. package/lib/{chunk-7U2L6S24.js → chunk-D7FQ4Y4M.js} +2 -2
  12. package/lib/{chunk-SKCEVA75.js → chunk-DJMQHR3M.js} +2 -2
  13. package/lib/{chunk-UJ4VVXPL.js → chunk-GBDIVT34.js} +2 -2
  14. package/lib/{chunk-RVQA7LMH.js → chunk-GC6A2XT6.js} +2 -2
  15. package/lib/{chunk-CGNU33OD.js → chunk-H5O7SNUY.js} +2 -2
  16. package/lib/{chunk-UPELIPCN.js → chunk-IAICSOJ4.js} +2 -2
  17. package/lib/chunk-KCSKNUVW.js +943 -0
  18. package/lib/chunk-KCSKNUVW.js.map +1 -0
  19. package/lib/{chunk-4AW2JS23.js → chunk-KTTAMLWK.js} +2 -2
  20. package/lib/{chunk-ALU3XXNT.js → chunk-LBNDEGPJ.js} +2 -2
  21. package/lib/{chunk-P47UBUIP.js → chunk-SJDMVS3T.js} +2 -2
  22. package/lib/{chunk-ARF3CNRW.js → chunk-TSGE2F43.js} +2 -2
  23. package/lib/{chunk-CIL76VDH.js → chunk-U6J55JCD.js} +2 -2
  24. package/lib/{chunk-2U75NKG7.js → chunk-VO4S7Q4P.js} +2 -2
  25. package/lib/{chunk-S2Q6XTBC.js → chunk-XJOCMTJY.js} +2 -2
  26. package/lib/{chunk-E74OKQE6.js → chunk-YJ64AKDD.js} +2 -2
  27. package/lib/{chunk-YNF6DPGW.js → chunk-ZVKPIFWH.js} +2 -2
  28. package/lib/core/index.js +1 -1
  29. package/lib/eth/builtin/eacaggregatorproxy.js +1 -1
  30. package/lib/eth/builtin/erc1155.js +1 -1
  31. package/lib/eth/builtin/erc20.js +1 -1
  32. package/lib/eth/builtin/erc721.js +1 -1
  33. package/lib/eth/builtin/index.js +1 -1
  34. package/lib/eth/builtin/weth9.js +1 -1
  35. package/lib/eth/codegen/index.js +1 -1
  36. package/lib/eth/index.js +1 -1
  37. package/lib/fuel/codegen/index.js +2 -2
  38. package/lib/fuel/codegen/index.js.map +1 -1
  39. package/lib/fuel/index.js +1 -1
  40. package/lib/index.js +1 -1
  41. package/lib/move/index.js +1 -1
  42. package/lib/solana/builtin/index.js +1 -1
  43. package/lib/solana/index.js +1 -1
  44. package/lib/stark/index.js +1 -1
  45. package/lib/store/index.js +1 -1
  46. package/lib/sui/builtin/0x1.js +1 -1
  47. package/lib/sui/builtin/0x2.js +1 -1
  48. package/lib/sui/builtin/0x3.js +1 -1
  49. package/lib/sui/builtin/index.js +1 -1
  50. package/lib/sui/ext/index.js +1 -1
  51. package/lib/sui/index.js +1 -1
  52. package/lib/testing/index.js +1 -1
  53. package/lib/utils/index.js +1 -1
  54. package/package.json +2 -2
  55. package/lib/chunk-6TCLX2EB.js +0 -5
  56. package/lib/chunk-6TCLX2EB.js.map +0 -1
  57. package/lib/chunk-HD2PF2IU.js +0 -1057
  58. package/lib/chunk-HD2PF2IU.js.map +0 -1
  59. /package/lib/{chunk-4WDJVFCT.js.map → chunk-4MFZRYCX.js.map} +0 -0
  60. /package/lib/{chunk-PNVZOHKE.js.map → chunk-5MSYUYPI.js.map} +0 -0
  61. /package/lib/{chunk-7U2L6S24.js.map → chunk-D7FQ4Y4M.js.map} +0 -0
  62. /package/lib/{chunk-SKCEVA75.js.map → chunk-DJMQHR3M.js.map} +0 -0
  63. /package/lib/{chunk-UJ4VVXPL.js.map → chunk-GBDIVT34.js.map} +0 -0
  64. /package/lib/{chunk-RVQA7LMH.js.map → chunk-GC6A2XT6.js.map} +0 -0
  65. /package/lib/{chunk-CGNU33OD.js.map → chunk-H5O7SNUY.js.map} +0 -0
  66. /package/lib/{chunk-UPELIPCN.js.map → chunk-IAICSOJ4.js.map} +0 -0
  67. /package/lib/{chunk-4AW2JS23.js.map → chunk-KTTAMLWK.js.map} +0 -0
  68. /package/lib/{chunk-ALU3XXNT.js.map → chunk-LBNDEGPJ.js.map} +0 -0
  69. /package/lib/{chunk-P47UBUIP.js.map → chunk-SJDMVS3T.js.map} +0 -0
  70. /package/lib/{chunk-ARF3CNRW.js.map → chunk-TSGE2F43.js.map} +0 -0
  71. /package/lib/{chunk-CIL76VDH.js.map → chunk-U6J55JCD.js.map} +0 -0
  72. /package/lib/{chunk-2U75NKG7.js.map → chunk-VO4S7Q4P.js.map} +0 -0
  73. /package/lib/{chunk-S2Q6XTBC.js.map → chunk-XJOCMTJY.js.map} +0 -0
  74. /package/lib/{chunk-E74OKQE6.js.map → chunk-YJ64AKDD.js.map} +0 -0
  75. /package/lib/{chunk-YNF6DPGW.js.map → chunk-ZVKPIFWH.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
2
- import{b as Rd}from"./chunk-DEW7KMCM.js";import{a as Bd,b as j0}from"./chunk-3RFIQSEL.js";import{b as Yc,c as H0,d as Id,e as V0,h as eo,i as Ld}from"./chunk-EBOI7P4R.js";import{r as Gc,x as Ni,y as Ad}from"./chunk-DJQ5RDDN.js";import{a as Ed}from"./chunk-L4PAFISV.js";import{D as jc,Sc as kd,W as Sd,Yb as W0,Zb as Oi,ec as vd,wc as K0}from"./chunk-HD2PF2IU.js";import{e as Rn}from"./chunk-6TCLX2EB.js";import{a as xd,c as $0}from"./chunk-NMFPLO65.js";import{a as be,b as qe,c as pe,d as fs,e as ue,f as Qs,g as _d}from"./chunk-LLHU72AA.js";var Fi={};fs(Fi,{abytes:()=>ds,bitGet:()=>ob,bitLen:()=>sb,bitMask:()=>to,bitSet:()=>ib,bytesToHex:()=>Pr,bytesToNumberBE:()=>Or,bytesToNumberLE:()=>nn,concatBytes:()=>Nr,createHmacDrbg:()=>eu,ensureBytes:()=>Qe,equalBytes:()=>rb,hexToBytes:()=>Tn,hexToNumber:()=>Qc,isBytes:()=>rn,numberToBytesBE:()=>sn,numberToBytesLE:()=>Pn,numberToHexUnpadded:()=>Md,numberToVarBytesBE:()=>tb,utf8ToBytes:()=>nb,validateObject:()=>fr});function rn(n){return n instanceof Uint8Array||n!=null&&typeof n=="object"&&n.constructor.name==="Uint8Array"}function ds(n){if(!rn(n))throw new Error("Uint8Array expected")}function Pr(n){ds(n);let e="";for(let t=0;t<n.length;t++)e+=eb[n[t]];return e}function Md(n){let e=n.toString(16);return e.length&1?`0${e}`:e}function Qc(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);return BigInt(n===""?"0":`0x${n}`)}function Ud(n){if(n>=Tr._0&&n<=Tr._9)return n-Tr._0;if(n>=Tr._A&&n<=Tr._F)return n-(Tr._A-10);if(n>=Tr._a&&n<=Tr._f)return n-(Tr._a-10)}function Tn(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);let e=n.length,t=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let r=new Uint8Array(t);for(let o=0,s=0;o<t;o++,s+=2){let i=Ud(n.charCodeAt(s)),c=Ud(n.charCodeAt(s+1));if(i===void 0||c===void 0){let u=n[s]+n[s+1];throw new Error('hex string expected, got non-hex character "'+u+'" at index '+s)}r[o]=i*16+c}return r}function Or(n){return Qc(Pr(n))}function nn(n){return ds(n),Qc(Pr(Uint8Array.from(n).reverse()))}function sn(n,e){return Tn(n.toString(16).padStart(e*2,"0"))}function Pn(n,e){return sn(n,e).reverse()}function tb(n){return Tn(Md(n))}function Qe(n,e,t){let r;if(typeof e=="string")try{r=Tn(e)}catch(s){throw new Error(`${n} must be valid hex string, got "${e}". Cause: ${s}`)}else if(rn(e))r=Uint8Array.from(e);else throw new Error(`${n} must be hex string or Uint8Array`);let o=r.length;if(typeof t=="number"&&o!==t)throw new Error(`${n} expected ${t} bytes, got ${o}`);return r}function Nr(...n){let e=0;for(let r=0;r<n.length;r++){let o=n[r];ds(o),e+=o.length}let t=new Uint8Array(e);for(let r=0,o=0;r<n.length;r++){let s=n[r];t.set(s,o),o+=s.length}return t}function rb(n,e){if(n.length!==e.length)return!1;let t=0;for(let r=0;r<n.length;r++)t|=n[r]^e[r];return t===0}function nb(n){if(typeof n!="string")throw new Error(`utf8ToBytes expected string, got ${typeof n}`);return new Uint8Array(new TextEncoder().encode(n))}function sb(n){let e;for(e=0;n>Fd;n>>=Di,e+=1);return e}function ob(n,e){return n>>BigInt(e)&Di}function ib(n,e,t){return n|(t?Di:Fd)<<BigInt(e)}function eu(n,e,t){if(typeof n!="number"||n<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let r=Jc(n),o=Jc(n),s=0,i=()=>{r.fill(1),o.fill(0),s=0},c=(...y)=>t(o,r,...y),u=(y=Jc())=>{o=c(Dd([0]),y),r=c(),y.length!==0&&(o=c(Dd([1]),y),r=c())},h=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let y=0,S=[];for(;y<e;){r=c();let g=r.slice();S.push(g),y+=r.length}return Nr(...S)};return(y,S)=>{i(),u(y);let g;for(;!(g=S(h()));)u();return i(),g}}function fr(n,e,t={}){let r=(o,s,i)=>{let c=ab[s];if(typeof c!="function")throw new Error(`Invalid validator "${s}", expected function`);let u=n[o];if(!(i&&u===void 0)&&!c(u,n))throw new Error(`Invalid param ${String(o)}=${u} (${typeof u}), expected ${s}`)};for(let[o,s]of Object.entries(e))r(o,s,!1);for(let[o,s]of Object.entries(t))r(o,s,!0);return n}var Fd,Di,Q0,eb,Tr,to,Jc,Dd,ab,On=qe(()=>{Fd=BigInt(0),Di=BigInt(1),Q0=BigInt(2);eb=Array.from({length:256},(n,e)=>e.toString(16).padStart(2,"0"));Tr={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};to=n=>(Q0<<BigInt(n-1))-Di,Jc=n=>new Uint8Array(n),Dd=n=>Uint8Array.from(n);ab={bigint:n=>typeof n=="bigint",function:n=>typeof n=="function",boolean:n=>typeof n=="boolean",string:n=>typeof n=="string",stringOrUint8Array:n=>typeof n=="string"||rn(n),isSafeInteger:n=>Number.isSafeInteger(n),array:n=>Array.isArray(n),field:(n,e)=>e.Fp.isValid(n),hash:n=>typeof n=="function"&&Number.isSafeInteger(n.outputLen)}});function Fe(n,e){let t=n%e;return t>=ct?t:e+t}function fb(n,e,t){if(t<=ct||e<ct)throw new Error("Expected power/modulo > 0");if(t===Ve)return ct;let r=Ve;for(;e>ct;)e&Ve&&(r=r*n%t),n=n*n%t,e>>=Ve;return r}function je(n,e,t){let r=n;for(;e-- >ct;)r*=r,r%=t;return r}function Mi(n,e){if(n===ct||e<=ct)throw new Error(`invert: expected positive integers, got n=${n} mod=${e}`);let t=Fe(n,e),r=e,o=ct,s=Ve,i=Ve,c=ct;for(;t!==ct;){let h=r/t,f=r%t,y=o-i*h,S=s-c*h;r=t,t=f,o=i,s=c,i=y,c=S}if(r!==Ve)throw new Error("invert: does not exist");return Fe(o,e)}function db(n){let e=(n-Ve)/Nn,t,r,o;for(t=n-Ve,r=0;t%Nn===ct;t/=Nn,r++);for(o=Nn;o<n&&fb(o,e,n)!==n-Ve;o++);if(r===1){let i=(n+Ve)/tu;return function(u,h){let f=u.pow(h,i);if(!u.eql(u.sqr(f),h))throw new Error("Cannot find square root");return f}}let s=(t+Ve)/Nn;return function(c,u){if(c.pow(u,e)===c.neg(c.ONE))throw new Error("Cannot find square root");let h=r,f=c.pow(c.mul(c.ONE,o),t),y=c.pow(u,s),S=c.pow(u,t);for(;!c.eql(S,c.ONE);){if(c.eql(S,c.ZERO))return c.ZERO;let g=1;for(let b=c.sqr(S);g<h&&!c.eql(b,c.ONE);g++)b=c.sqr(b);let x=c.pow(f,Ve<<BigInt(h-g-1));f=c.sqr(x),y=c.mul(y,x),S=c.mul(S,f),h=g}return y}}function hb(n){if(n%tu===cb){let e=(n+Ve)/tu;return function(r,o){let s=r.pow(o,e);if(!r.eql(r.sqr(s),o))throw new Error("Cannot find square root");return s}}if(n%zd===qd){let e=(n-qd)/zd;return function(r,o){let s=r.mul(o,Nn),i=r.pow(s,e),c=r.mul(o,i),u=r.mul(r.mul(c,Nn),i),h=r.mul(c,r.sub(u,r.ONE));if(!r.eql(r.sqr(h),o))throw new Error("Cannot find square root");return h}}return n%lb,db(n)}function ru(n){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=pb.reduce((r,o)=>(r[o]="function",r),e);return fr(n,t)}function yb(n,e,t){if(t<ct)throw new Error("Expected power > 0");if(t===ct)return n.ONE;if(t===Ve)return e;let r=n.ONE,o=e;for(;t>ct;)t&Ve&&(r=n.mul(r,o)),o=n.sqr(o),t>>=Ve;return r}function mb(n,e){let t=new Array(e.length),r=e.reduce((s,i,c)=>n.is0(i)?s:(t[c]=s,n.mul(s,i)),n.ONE),o=n.inv(r);return e.reduceRight((s,i,c)=>n.is0(i)?s:(t[c]=n.mul(s,t[c]),n.mul(s,i)),o),t}function nu(n,e){let t=e!==void 0?e:n.toString(2).length,r=Math.ceil(t/8);return{nBitLength:t,nByteLength:r}}function qi(n,e,t=!1,r={}){if(n<=ct)throw new Error(`Expected Field ORDER > 0, got ${n}`);let{nBitLength:o,nByteLength:s}=nu(n,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let i=hb(n),c=Object.freeze({ORDER:n,BITS:o,BYTES:s,MASK:to(o),ZERO:ct,ONE:Ve,create:u=>Fe(u,n),isValid:u=>{if(typeof u!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof u}`);return ct<=u&&u<n},is0:u=>u===ct,isOdd:u=>(u&Ve)===Ve,neg:u=>Fe(-u,n),eql:(u,h)=>u===h,sqr:u=>Fe(u*u,n),add:(u,h)=>Fe(u+h,n),sub:(u,h)=>Fe(u-h,n),mul:(u,h)=>Fe(u*h,n),pow:(u,h)=>yb(c,u,h),div:(u,h)=>Fe(u*Mi(h,n),n),sqrN:u=>u*u,addN:(u,h)=>u+h,subN:(u,h)=>u-h,mulN:(u,h)=>u*h,inv:u=>Mi(u,n),sqrt:r.sqrt||(u=>i(c,u)),invertBatch:u=>mb(c,u),cmov:(u,h,f)=>f?h:u,toBytes:u=>t?Pn(u,s):sn(u,s),fromBytes:u=>{if(u.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${u.length}`);return t?nn(u):Or(u)}});return Object.freeze(c)}function Wd(n){if(typeof n!="bigint")throw new Error("field order must be bigint");let e=n.toString(2).length;return Math.ceil(e/8)}function su(n){let e=Wd(n);return e+Math.ceil(e/2)}function Kd(n,e,t=!1){let r=n.length,o=Wd(e),s=su(e);if(r<16||r<s||r>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${r}`);let i=t?Or(n):nn(n),c=Fe(i,e-Ve)+Ve;return t?Pn(c,o):sn(c,o)}var ct,Ve,Nn,cb,tu,qd,zd,ub,lb,$d,pb,hs=qe(()=>{On();ct=BigInt(0),Ve=BigInt(1),Nn=BigInt(2),cb=BigInt(3),tu=BigInt(4),qd=BigInt(5),zd=BigInt(8),ub=BigInt(9),lb=BigInt(16);$d=(n,e)=>(Fe(n,e)&Ve)===Ve,pb=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function zi(n,e){let t=(o,s)=>{let i=s.negate();return o?i:s},r=o=>{let s=Math.ceil(e/o)+1,i=2**(o-1);return{windows:s,windowSize:i}};return{constTimeNegate:t,unsafeLadder(o,s){let i=n.ZERO,c=o;for(;s>bb;)s&ou&&(i=i.add(c)),c=c.double(),s>>=ou;return i},precomputeWindow(o,s){let{windows:i,windowSize:c}=r(s),u=[],h=o,f=h;for(let y=0;y<i;y++){f=h,u.push(f);for(let S=1;S<c;S++)f=f.add(h),u.push(f);h=f.double()}return u},wNAF(o,s,i){let{windows:c,windowSize:u}=r(o),h=n.ZERO,f=n.BASE,y=BigInt(2**o-1),S=2**o,g=BigInt(o);for(let x=0;x<c;x++){let b=x*u,v=Number(i&y);i>>=g,v>u&&(v-=S,i+=ou);let k=b,B=b+Math.abs(v)-1,R=x%2!==0,D=v<0;v===0?f=f.add(t(R,s[k])):h=h.add(t(D,s[B]))}return{p:h,f}},wNAFCached(o,s,i,c){let u=o._WINDOW_SIZE||1,h=s.get(o);return h||(h=this.precomputeWindow(o,u),u!==1&&s.set(o,c(h))),this.wNAF(u,h,i)}}}function ro(n){return ru(n.Fp),fr(n,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...nu(n.n,n.nBitLength),...n,p:n.Fp.ORDER})}var bb,ou,iu=qe(()=>{hs();On();bb=BigInt(0),ou=BigInt(1)});function Sb(n){let e=ro(n);return fr(n,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function Hd(n){let e=Sb(n),{Fp:t,n:r,prehash:o,hash:s,randomBytes:i,nByteLength:c,h:u}=e,h=$i<<BigInt(c*8)-Ut,f=t.create,y=e.uvRatio||(($,T)=>{try{return{isValid:!0,value:t.sqrt($*t.inv(T))}}catch{return{isValid:!1,value:sr}}}),S=e.adjustScalarBytes||($=>$),g=e.domain||(($,T,Y)=>{if(T.length||Y)throw new Error("Contexts/pre-hash are not supported");return $}),x=$=>typeof $=="bigint"&&sr<$,b=($,T)=>x($)&&x(T)&&$<T,v=$=>$===sr||b($,h);function k($,T){if(b($,T))return $;throw new Error(`Expected valid scalar < ${T}, got ${typeof $} ${$}`)}function B($){return $===sr?$:k($,r)}let R=new Map;function D($){if(!($ instanceof P))throw new Error("ExtendedPoint expected")}class P{constructor(T,Y,re,ae){if(this.ex=T,this.ey=Y,this.ez=re,this.et=ae,!v(T))throw new Error("x required");if(!v(Y))throw new Error("y required");if(!v(re))throw new Error("z required");if(!v(ae))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(T){if(T instanceof P)throw new Error("extended point not allowed");let{x:Y,y:re}=T||{};if(!v(Y)||!v(re))throw new Error("invalid affine point");return new P(Y,re,Ut,f(Y*re))}static normalizeZ(T){let Y=t.invertBatch(T.map(re=>re.ez));return T.map((re,ae)=>re.toAffine(Y[ae])).map(P.fromAffine)}_setWindowSize(T){this._WINDOW_SIZE=T,R.delete(this)}assertValidity(){let{a:T,d:Y}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:re,ey:ae,ez:me,et:ge}=this,Ee=f(re*re),ve=f(ae*ae),Ae=f(me*me),Je=f(Ae*Ae),He=f(Ee*T),it=f(Ae*f(He+ve)),at=f(Je+f(Y*f(Ee*ve)));if(it!==at)throw new Error("bad point: equation left != right (1)");let tt=f(re*ae),lt=f(me*ge);if(tt!==lt)throw new Error("bad point: equation left != right (2)")}equals(T){D(T);let{ex:Y,ey:re,ez:ae}=this,{ex:me,ey:ge,ez:Ee}=T,ve=f(Y*Ee),Ae=f(me*ae),Je=f(re*Ee),He=f(ge*ae);return ve===Ae&&Je===He}is0(){return this.equals(P.ZERO)}negate(){return new P(f(-this.ex),this.ey,this.ez,f(-this.et))}double(){let{a:T}=e,{ex:Y,ey:re,ez:ae}=this,me=f(Y*Y),ge=f(re*re),Ee=f($i*f(ae*ae)),ve=f(T*me),Ae=Y+re,Je=f(f(Ae*Ae)-me-ge),He=ve+ge,it=He-Ee,at=ve-ge,tt=f(Je*it),lt=f(He*at),nr=f(Je*at),Rr=f(it*He);return new P(tt,lt,Rr,nr)}add(T){D(T);let{a:Y,d:re}=e,{ex:ae,ey:me,ez:ge,et:Ee}=this,{ex:ve,ey:Ae,ez:Je,et:He}=T;if(Y===BigInt(-1)){let vi=f((me-ae)*(Ae+ve)),Hs=f((me+ae)*(Ae-ve)),Vs=f(Hs-vi);if(Vs===sr)return this.double();let ki=f(ge*$i*He),js=f(Ee*$i*Je),Ei=js+ki,Ai=Hs+vi,Ii=js-ki,Uc=f(Ei*Vs),Dc=f(Ai*Ii),Fc=f(Ei*Ii),Bi=f(Vs*Ai);return new P(Uc,Dc,Bi,Fc)}let it=f(ae*ve),at=f(me*Ae),tt=f(Ee*re*He),lt=f(ge*Je),nr=f((ae+me)*(ve+Ae)-it-at),Rr=lt-tt,Cr=lt+tt,cs=f(at-Y*it),Si=f(nr*Rr),Bn=f(Cr*cs),Ln=f(nr*cs),xi=f(Rr*Cr);return new P(Si,Bn,xi,Ln)}subtract(T){return this.add(T.negate())}wNAF(T){return J.wNAFCached(this,R,T,P.normalizeZ)}multiply(T){let{p:Y,f:re}=this.wNAF(k(T,r));return P.normalizeZ([Y,re])[0]}multiplyUnsafe(T){let Y=B(T);return Y===sr?H:this.equals(H)||Y===Ut?this:this.equals(F)?this.wNAF(Y).p:J.unsafeLadder(this,Y)}isSmallOrder(){return this.multiplyUnsafe(u).is0()}isTorsionFree(){return J.unsafeLadder(this,r).is0()}toAffine(T){let{ex:Y,ey:re,ez:ae}=this,me=this.is0();T==null&&(T=me?wb:t.inv(ae));let ge=f(Y*T),Ee=f(re*T),ve=f(ae*T);if(me)return{x:sr,y:Ut};if(ve!==Ut)throw new Error("invZ was invalid");return{x:ge,y:Ee}}clearCofactor(){let{h:T}=e;return T===Ut?this:this.multiplyUnsafe(T)}static fromHex(T,Y=!1){let{d:re,a:ae}=e,me=t.BYTES;T=Qe("pointHex",T,me);let ge=T.slice(),Ee=T[me-1];ge[me-1]=Ee&-129;let ve=nn(ge);ve===sr||(Y?k(ve,h):k(ve,t.ORDER));let Ae=f(ve*ve),Je=f(Ae-Ut),He=f(re*Ae-ae),{isValid:it,value:at}=y(Je,He);if(!it)throw new Error("Point.fromHex: invalid y coordinate");let tt=(at&Ut)===Ut,lt=(Ee&128)!==0;if(!Y&&at===sr&&lt)throw new Error("Point.fromHex: x=0 and x_0=1");return lt!==tt&&(at=f(-at)),P.fromAffine({x:at,y:ve})}static fromPrivateKey(T){return de(T).point}toRawBytes(){let{x:T,y:Y}=this.toAffine(),re=Pn(Y,t.BYTES);return re[re.length-1]|=T&Ut?128:0,re}toHex(){return Pr(this.toRawBytes())}}P.BASE=new P(e.Gx,e.Gy,Ut,f(e.Gx*e.Gy)),P.ZERO=new P(sr,Ut,Ut,sr);let{BASE:F,ZERO:H}=P,J=zi(P,c*8);function De($){return Fe($,r)}function fe($){return De(nn($))}function de($){let T=c;$=Qe("private key",$,T);let Y=Qe("hashed private key",s($),2*T),re=S(Y.slice(0,T)),ae=Y.slice(T,2*T),me=fe(re),ge=F.multiply(me),Ee=ge.toRawBytes();return{head:re,prefix:ae,scalar:me,point:ge,pointBytes:Ee}}function Ke($){return de($).pointBytes}function ot($=new Uint8Array,...T){let Y=Nr(...T);return fe(s(g(Y,Qe("context",$),!!o)))}function Pt($,T,Y={}){$=Qe("message",$),o&&($=o($));let{prefix:re,scalar:ae,pointBytes:me}=de(T),ge=ot(Y.context,re,$),Ee=F.multiply(ge).toRawBytes(),ve=ot(Y.context,Ee,me,$),Ae=De(ge+ve*ae);B(Ae);let Je=Nr(Ee,Pn(Ae,t.BYTES));return Qe("result",Je,c*2)}let z=_b;function Z($,T,Y,re=z){let{context:ae,zip215:me}=re,ge=t.BYTES;$=Qe("signature",$,2*ge),T=Qe("message",T),o&&(T=o(T));let Ee=nn($.slice(ge,2*ge)),ve,Ae,Je;try{ve=P.fromHex(Y,me),Ae=P.fromHex($.slice(0,ge),me),Je=F.multiplyUnsafe(Ee)}catch{return!1}if(!me&&ve.isSmallOrder())return!1;let He=ot(ae,Ae.toRawBytes(),ve.toRawBytes(),T);return Ae.add(ve.multiplyUnsafe(He)).subtract(Je).clearCofactor().equals(P.ZERO)}return F._setWindowSize(8),{CURVE:e,getPublicKey:Ke,sign:Pt,verify:Z,ExtendedPoint:P,utils:{getExtendedPublicKey:de,randomPrivateKey:()=>i(t.BYTES),precompute($=8,T=P.BASE){return T._setWindowSize($),T.multiply(BigInt(3)),T}}}}var sr,Ut,$i,wb,_b,Vd=qe(()=>{iu();hs();On();On();sr=BigInt(0),Ut=BigInt(1),$i=BigInt(2),wb=BigInt(8),_b={zip215:!0}});function Eb(n){let e=BigInt(10),t=BigInt(20),r=BigInt(40),o=BigInt(80),s=au,c=n*n%s*n%s,u=je(c,Gd,s)*c%s,h=je(u,xb,s)*n%s,f=je(h,vb,s)*h%s,y=je(f,e,s)*f%s,S=je(y,t,s)*y%s,g=je(S,r,s)*S%s,x=je(g,o,s)*g%s,b=je(x,o,s)*g%s,v=je(b,e,s)*f%s;return{pow_p_5_8:je(v,Gd,s)*n%s,b2:c}}function Ab(n){return n[0]&=248,n[31]&=127,n[31]|=64,n}function Ib(n,e){let t=au,r=Fe(e*e*e,t),o=Fe(r*r*e,t),s=Eb(n*o).pow_p_5_8,i=Fe(n*r*s,t),c=Fe(e*i*i,t),u=i,h=Fe(i*jd,t),f=c===n,y=c===Fe(-n,t),S=c===Fe(-n*jd,t);return f&&(i=u),(y||S)&&(i=h),$d(i,t)&&(i=Fe(-i,t)),{isValid:f||y,value:i}}var au,jd,Dk,xb,Gd,Fk,vb,kb,Bb,Lb,Un,Yd=qe(()=>{j0();Ad();Vd();hs();au=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),jd=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),Dk=BigInt(0),xb=BigInt(1),Gd=BigInt(2),Fk=BigInt(3),vb=BigInt(5),kb=BigInt(8);Bb=(()=>qi(au,void 0,!0))(),Lb=(()=>({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Bb,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:kb,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:Bd,randomBytes:Ni,adjustScalarBytes:Ab,uvRatio:Ib}))(),Un=(()=>Hd(Lb))()});var Jd=pe((cu,Zd)=>{var Wi=be("buffer"),dr=Wi.Buffer;function Xd(n,e){for(var t in n)e[t]=n[t]}dr.from&&dr.alloc&&dr.allocUnsafe&&dr.allocUnsafeSlow?Zd.exports=Wi:(Xd(Wi,cu),cu.Buffer=Dn);function Dn(n,e,t){return dr(n,e,t)}Dn.prototype=Object.create(dr.prototype);Xd(dr,Dn);Dn.from=function(n,e,t){if(typeof n=="number")throw new TypeError("Argument must not be a number");return dr(n,e,t)};Dn.alloc=function(n,e,t){if(typeof n!="number")throw new TypeError("Argument must be a number");var r=dr(n);return e!==void 0?typeof t=="string"?r.fill(e,t):r.fill(e):r.fill(0),r};Dn.allocUnsafe=function(n){if(typeof n!="number")throw new TypeError("Argument must be a number");return dr(n)};Dn.allocUnsafeSlow=function(n){if(typeof n!="number")throw new TypeError("Argument must be a number");return Wi.SlowBuffer(n)}});var eh=pe((qk,Qd)=>{"use strict";var Ki=Jd().Buffer;function Rb(n){if(n.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),t=0;t<e.length;t++)e[t]=255;for(var r=0;r<n.length;r++){var o=n.charAt(r),s=o.charCodeAt(0);if(e[s]!==255)throw new TypeError(o+" is ambiguous");e[s]=r}var i=n.length,c=n.charAt(0),u=Math.log(i)/Math.log(256),h=Math.log(256)/Math.log(i);function f(g){if((Array.isArray(g)||g instanceof Uint8Array)&&(g=Ki.from(g)),!Ki.isBuffer(g))throw new TypeError("Expected Buffer");if(g.length===0)return"";for(var x=0,b=0,v=0,k=g.length;v!==k&&g[v]===0;)v++,x++;for(var B=(k-v)*h+1>>>0,R=new Uint8Array(B);v!==k;){for(var D=g[v],P=0,F=B-1;(D!==0||P<b)&&F!==-1;F--,P++)D+=256*R[F]>>>0,R[F]=D%i>>>0,D=D/i>>>0;if(D!==0)throw new Error("Non-zero carry");b=P,v++}for(var H=B-b;H!==B&&R[H]===0;)H++;for(var J=c.repeat(x);H<B;++H)J+=n.charAt(R[H]);return J}function y(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return Ki.alloc(0);for(var x=0,b=0,v=0;g[x]===c;)b++,x++;for(var k=(g.length-x)*u+1>>>0,B=new Uint8Array(k);g[x];){var R=e[g.charCodeAt(x)];if(R===255)return;for(var D=0,P=k-1;(R!==0||D<v)&&P!==-1;P--,D++)R+=i*B[P]>>>0,B[P]=R%256>>>0,R=R/256>>>0;if(R!==0)throw new Error("Non-zero carry");v=D,x++}for(var F=k-v;F!==k&&B[F]===0;)F++;var H=Ki.allocUnsafe(b+(k-F));H.fill(0,0,b);for(var J=b;F!==k;)H[J++]=B[F++];return H}function S(g){var x=y(g);if(x)return x;throw new Error("Non-base"+i+" character")}return{encode:f,decodeUnsafe:y,decode:S}}Qd.exports=Rb});var ps=pe((zk,th)=>{var Cb=eh(),Tb="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";th.exports=Cb(Tb)});var rh=pe(fu=>{"use strict";function Ur(n,e,t){return e<=n&&n<=t}function Yi(n){if(n===void 0)return{};if(n===Object(n))return n;throw TypeError("Could not convert argument to dictionary")}function Pb(n){for(var e=String(n),t=e.length,r=0,o=[];r<t;){var s=e.charCodeAt(r);if(s<55296||s>57343)o.push(s);else if(56320<=s&&s<=57343)o.push(65533);else if(55296<=s&&s<=56319)if(r===t-1)o.push(65533);else{var i=n.charCodeAt(r+1);if(56320<=i&&i<=57343){var c=s&1023,u=i&1023;o.push(65536+(c<<10)+u),r+=1}else o.push(65533)}r+=1}return o}function Ob(n){for(var e="",t=0;t<n.length;++t){var r=n[t];r<=65535?e+=String.fromCharCode(r):(r-=65536,e+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return e}var Hi=-1;function lu(n){this.tokens=[].slice.call(n)}lu.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():Hi},prepend:function(n){if(Array.isArray(n))for(var e=n;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(n)},push:function(n){if(Array.isArray(n))for(var e=n;e.length;)this.tokens.push(e.shift());else this.tokens.push(n)}};var ys=-1;function uu(n,e){if(n)throw TypeError("Decoder error");return e||65533}var Vi="utf-8";function ji(n,e){if(!(this instanceof ji))return new ji(n,e);if(n=n!==void 0?String(n).toLowerCase():Vi,n!==Vi)throw new Error("Encoding not supported. Only utf-8 is supported");e=Yi(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!e.fatal,this._ignoreBOM=!!e.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}ji.prototype={decode:function(e,t){var r;typeof e=="object"&&e instanceof ArrayBuffer?r=new Uint8Array(e):typeof e=="object"&&"buffer"in e&&e.buffer instanceof ArrayBuffer?r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):r=new Uint8Array(0),t=Yi(t),this._streaming||(this._decoder=new Nb({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!t.stream;for(var o=new lu(r),s=[],i;!o.endOfStream()&&(i=this._decoder.handler(o,o.read()),i!==ys);)i!==null&&(Array.isArray(i)?s.push.apply(s,i):s.push(i));if(!this._streaming){do{if(i=this._decoder.handler(o,o.read()),i===ys)break;i!==null&&(Array.isArray(i)?s.push.apply(s,i):s.push(i))}while(!o.endOfStream());this._decoder=null}return s.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(s[0]===65279?(this._BOMseen=!0,s.shift()):this._BOMseen=!0),Ob(s)}};function Gi(n,e){if(!(this instanceof Gi))return new Gi(n,e);if(n=n!==void 0?String(n).toLowerCase():Vi,n!==Vi)throw new Error("Encoding not supported. Only utf-8 is supported");e=Yi(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}Gi.prototype={encode:function(e,t){e=e?String(e):"",t=Yi(t),this._streaming||(this._encoder=new Ub(this._options)),this._streaming=!!t.stream;for(var r=[],o=new lu(Pb(e)),s;!o.endOfStream()&&(s=this._encoder.handler(o,o.read()),s!==ys);)Array.isArray(s)?r.push.apply(r,s):r.push(s);if(!this._streaming){for(;s=this._encoder.handler(o,o.read()),s!==ys;)Array.isArray(s)?r.push.apply(r,s):r.push(s);this._encoder=null}return new Uint8Array(r)}};function Nb(n){var e=n.fatal,t=0,r=0,o=0,s=128,i=191;this.handler=function(c,u){if(u===Hi&&o!==0)return o=0,uu(e);if(u===Hi)return ys;if(o===0){if(Ur(u,0,127))return u;if(Ur(u,194,223))o=1,t=u-192;else if(Ur(u,224,239))u===224&&(s=160),u===237&&(i=159),o=2,t=u-224;else if(Ur(u,240,244))u===240&&(s=144),u===244&&(i=143),o=3,t=u-240;else return uu(e);return t=t<<6*o,null}if(!Ur(u,s,i))return t=o=r=0,s=128,i=191,c.prepend(u),uu(e);if(s=128,i=191,r+=1,t+=u-128<<6*(o-r),r!==o)return null;var h=t;return t=o=r=0,h}}function Ub(n){var e=n.fatal;this.handler=function(t,r){if(r===Hi)return ys;if(Ur(r,0,127))return r;var o,s;Ur(r,128,2047)?(o=1,s=192):Ur(r,2048,65535)?(o=2,s=224):Ur(r,65536,1114111)&&(o=3,s=240);for(var i=[(r>>6*o)+s];o>0;){var c=r>>6*(o-1);i.push(128|c&63),o-=1}return i}}fu.TextEncoder=Gi;fu.TextDecoder=ji});var ah=pe(Me=>{"use strict";var Db=Me&&Me.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t),Object.defineProperty(n,r,{enumerable:!0,get:function(){return e[t]}})}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),Fb=Me&&Me.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),hr=Me&&Me.__decorate||function(n,e,t,r){var o=arguments.length,s=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(i=n[c])&&(s=(o<3?i(s):o>3?i(e,t,s):i(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Mb=Me&&Me.__importStar||function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)t!=="default"&&Object.hasOwnProperty.call(n,t)&&Db(e,n,t);return Fb(e,n),e},nh=Me&&Me.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Me,"__esModule",{value:!0});Me.deserializeUnchecked=Me.deserialize=Me.serialize=Me.BinaryReader=Me.BinaryWriter=Me.BorshError=Me.baseDecode=Me.baseEncode=void 0;var on=nh(Rn()),sh=nh(ps()),qb=Mb(rh()),zb=typeof TextDecoder!="function"?qb.TextDecoder:TextDecoder,$b=new zb("utf-8",{fatal:!0});function Wb(n){return typeof n=="string"&&(n=Buffer.from(n,"utf8")),sh.default.encode(Buffer.from(n))}Me.baseEncode=Wb;function Kb(n){return Buffer.from(sh.default.decode(n))}Me.baseDecode=Kb;var du=1024,gt=class extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}};Me.BorshError=gt;var Xi=class{constructor(){this.buf=Buffer.alloc(du),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(du)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(Buffer.from(new on.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(Buffer.from(new on.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(Buffer.from(new on.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(Buffer.from(new on.default(e).toArray("le",64)))}writeBuffer(e){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),e,Buffer.alloc(du)]),this.length+=e.length}writeString(e){this.maybeResize();let t=Buffer.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}writeFixedArray(e){this.writeBuffer(Buffer.from(e))}writeArray(e,t){this.maybeResize(),this.writeU32(e.length);for(let r of e)this.maybeResize(),t(r)}toArray(){return this.buf.subarray(0,this.length)}};Me.BinaryWriter=Xi;function pr(n,e,t){let r=t.value;t.value=function(...o){try{return r.apply(this,o)}catch(s){if(s instanceof RangeError){let i=s.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(i)>=0)throw new gt("Reached the end of buffer when deserializing")}throw s}}}var vt=class{constructor(e){this.buf=e,this.offset=0}readU8(){let e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){let e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){let e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){let e=this.readBuffer(8);return new on.default(e,"le")}readU128(){let e=this.readBuffer(16);return new on.default(e,"le")}readU256(){let e=this.readBuffer(32);return new on.default(e,"le")}readU512(){let e=this.readBuffer(64);return new on.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new gt(`Expected buffer length ${e} isn't within bounds`);let t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){let e=this.readU32(),t=this.readBuffer(e);try{return $b.decode(t)}catch(r){throw new gt(`Error decoding UTF-8 string: ${r}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){let t=this.readU32(),r=Array();for(let o=0;o<t;++o)r.push(e());return r}};hr([pr],vt.prototype,"readU8",null);hr([pr],vt.prototype,"readU16",null);hr([pr],vt.prototype,"readU32",null);hr([pr],vt.prototype,"readU64",null);hr([pr],vt.prototype,"readU128",null);hr([pr],vt.prototype,"readU256",null);hr([pr],vt.prototype,"readU512",null);hr([pr],vt.prototype,"readString",null);hr([pr],vt.prototype,"readFixedArray",null);hr([pr],vt.prototype,"readArray",null);Me.BinaryReader=vt;function oh(n){return n.charAt(0).toUpperCase()+n.slice(1)}function Fn(n,e,t,r,o){try{if(typeof r=="string")o[`write${oh(r)}`](t);else if(r instanceof Array)if(typeof r[0]=="number"){if(t.length!==r[0])throw new gt(`Expecting byte array of length ${r[0]}, but got ${t.length} bytes`);o.writeFixedArray(t)}else if(r.length===2&&typeof r[1]=="number"){if(t.length!==r[1])throw new gt(`Expecting byte array of length ${r[1]}, but got ${t.length} bytes`);for(let s=0;s<r[1];s++)Fn(n,null,t[s],r[0],o)}else o.writeArray(t,s=>{Fn(n,e,s,r[0],o)});else if(r.kind!==void 0)switch(r.kind){case"option":{t==null?o.writeU8(0):(o.writeU8(1),Fn(n,e,t,r.type,o));break}case"map":{o.writeU32(t.size),t.forEach((s,i)=>{Fn(n,e,i,r.key,o),Fn(n,e,s,r.value,o)});break}default:throw new gt(`FieldType ${r} unrecognized`)}else ih(n,t,o)}catch(s){throw s instanceof gt&&s.addToFieldPath(e),s}}function ih(n,e,t){if(typeof e.borshSerialize=="function"){e.borshSerialize(t);return}let r=n.get(e.constructor);if(!r)throw new gt(`Class ${e.constructor.name} is missing in schema`);if(r.kind==="struct")r.fields.map(([o,s])=>{Fn(n,o,e[o],s,t)});else if(r.kind==="enum"){let o=e[r.field];for(let s=0;s<r.values.length;++s){let[i,c]=r.values[s];if(i===o){t.writeU8(s),Fn(n,i,e[i],c,t);break}}}else throw new gt(`Unexpected schema kind: ${r.kind} for ${e.constructor.name}`)}function Hb(n,e,t=Xi){let r=new t;return ih(n,e,r),r.toArray()}Me.serialize=Hb;function Mn(n,e,t,r){try{if(typeof t=="string")return r[`read${oh(t)}`]();if(t instanceof Array){if(typeof t[0]=="number")return r.readFixedArray(t[0]);if(typeof t[1]=="number"){let o=[];for(let s=0;s<t[1];s++)o.push(Mn(n,null,t[0],r));return o}else return r.readArray(()=>Mn(n,e,t[0],r))}if(t.kind==="option")return r.readU8()?Mn(n,e,t.type,r):void 0;if(t.kind==="map"){let o=new Map,s=r.readU32();for(let i=0;i<s;i++){let c=Mn(n,e,t.key,r),u=Mn(n,e,t.value,r);o.set(c,u)}return o}return hu(n,t,r)}catch(o){throw o instanceof gt&&o.addToFieldPath(e),o}}function hu(n,e,t){if(typeof e.borshDeserialize=="function")return e.borshDeserialize(t);let r=n.get(e);if(!r)throw new gt(`Class ${e.name} is missing in schema`);if(r.kind==="struct"){let o={};for(let[s,i]of n.get(e).fields)o[s]=Mn(n,s,i,t);return new e(o)}if(r.kind==="enum"){let o=t.readU8();if(o>=r.values.length)throw new gt(`Enum index: ${o} is out of range`);let[s,i]=r.values[o],c=Mn(n,s,i,t);return new e({[s]:c})}throw new gt(`Unexpected schema kind: ${r.kind} for ${e.constructor.name}`)}function Vb(n,e,t,r=vt){let o=new r(t),s=hu(n,e,o);if(o.offset<t.length)throw new gt(`Unexpected ${t.length-o.offset} bytes after deserialized data`);return s}Me.deserialize=Vb;function jb(n,e,t,r=vt){let o=new r(t);return hu(n,e,o)}Me.deserializeUnchecked=jb});var gu=pe(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.s16=I.s8=I.nu64be=I.u48be=I.u40be=I.u32be=I.u24be=I.u16be=I.nu64=I.u48=I.u40=I.u32=I.u24=I.u16=I.u8=I.offset=I.greedy=I.Constant=I.UTF8=I.CString=I.Blob=I.Boolean=I.BitField=I.BitStructure=I.VariantLayout=I.Union=I.UnionLayoutDiscriminator=I.UnionDiscriminator=I.Structure=I.Sequence=I.DoubleBE=I.Double=I.FloatBE=I.Float=I.NearInt64BE=I.NearInt64=I.NearUInt64BE=I.NearUInt64=I.IntBE=I.Int=I.UIntBE=I.UInt=I.OffsetLayout=I.GreedyCount=I.ExternalLayout=I.bindConstructorLayout=I.nameWithProperty=I.Layout=I.uint8ArrayToBuffer=I.checkUint8Array=void 0;I.constant=I.utf8=I.cstr=I.blob=I.unionLayoutDiscriminator=I.union=I.seq=I.bits=I.struct=I.f64be=I.f64=I.f32be=I.f32=I.ns64be=I.s48be=I.s40be=I.s32be=I.s24be=I.s16be=I.ns64=I.s48=I.s40=I.s32=I.s24=void 0;var yu=be("buffer");function bs(n){if(!(n instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}I.checkUint8Array=bs;function Le(n){return bs(n),yu.Buffer.from(n.buffer,n.byteOffset,n.length)}I.uint8ArrayToBuffer=Le;var Te=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){let t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}};I.Layout=Te;function mu(n,e){return e.property?n+"["+e.property+"]":n}I.nameWithProperty=mu;function Gb(n,e){if(typeof n!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(n,"layout_"))throw new Error("Class is already bound to a layout");if(!(e&&e instanceof Te))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(e,"boundConstructor_"))throw new Error("layout is already bound to a constructor");n.layout_=e,e.boundConstructor_=n,e.makeDestinationObject=()=>new n,Object.defineProperty(n.prototype,"encode",{value(t,r){return e.encode(this,t,r)},writable:!0}),Object.defineProperty(n,"decode",{value(t,r){return e.decode(t,r)},writable:!0})}I.bindConstructorLayout=Gb;var wt=class extends Te{isCount(){throw new Error("ExternalLayout is abstract")}};I.ExternalLayout=wt;var Zi=class extends wt{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){bs(e);let r=e.length-t;return Math.floor(r/this.elementSpan)}encode(e,t,r){return 0}};I.GreedyCount=Zi;var no=class extends wt{constructor(e,t=0,r){if(!(e instanceof Te))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 It||this.layout instanceof Dt}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)}};I.OffsetLayout=no;var It=class extends Te{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return Le(e).readUIntLE(t,this.span)}encode(e,t,r=0){return Le(t).writeUIntLE(e,r,this.span),this.span}};I.UInt=It;var Dt=class extends Te{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return Le(e).readUIntBE(t,this.span)}encode(e,t,r=0){return Le(t).writeUIntBE(e,r,this.span),this.span}};I.UIntBE=Dt;var Dr=class extends Te{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return Le(e).readIntLE(t,this.span)}encode(e,t,r=0){return Le(t).writeIntLE(e,r,this.span),this.span}};I.Int=Dr;var an=class extends Te{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return Le(e).readIntBE(t,this.span)}encode(e,t,r=0){return Le(t).writeIntBE(e,r,this.span),this.span}};I.IntBE=an;var pu=Math.pow(2,32);function pa(n){let e=Math.floor(n/pu),t=n-e*pu;return{hi32:e,lo32:t}}function ya(n,e){return n*pu+e}var Ji=class extends Te{constructor(e){super(8,e)}decode(e,t=0){let r=Le(e),o=r.readUInt32LE(t),s=r.readUInt32LE(t+4);return ya(s,o)}encode(e,t,r=0){let o=pa(e),s=Le(t);return s.writeUInt32LE(o.lo32,r),s.writeUInt32LE(o.hi32,r+4),8}};I.NearUInt64=Ji;var Qi=class extends Te{constructor(e){super(8,e)}decode(e,t=0){let r=Le(e),o=r.readUInt32BE(t),s=r.readUInt32BE(t+4);return ya(o,s)}encode(e,t,r=0){let o=pa(e),s=Le(t);return s.writeUInt32BE(o.hi32,r),s.writeUInt32BE(o.lo32,r+4),8}};I.NearUInt64BE=Qi;var ea=class extends Te{constructor(e){super(8,e)}decode(e,t=0){let r=Le(e),o=r.readUInt32LE(t),s=r.readInt32LE(t+4);return ya(s,o)}encode(e,t,r=0){let o=pa(e),s=Le(t);return s.writeUInt32LE(o.lo32,r),s.writeInt32LE(o.hi32,r+4),8}};I.NearInt64=ea;var ta=class extends Te{constructor(e){super(8,e)}decode(e,t=0){let r=Le(e),o=r.readInt32BE(t),s=r.readUInt32BE(t+4);return ya(o,s)}encode(e,t,r=0){let o=pa(e),s=Le(t);return s.writeInt32BE(o.hi32,r),s.writeUInt32BE(o.lo32,r+4),8}};I.NearInt64BE=ta;var ra=class extends Te{constructor(e){super(4,e)}decode(e,t=0){return Le(e).readFloatLE(t)}encode(e,t,r=0){return Le(t).writeFloatLE(e,r),4}};I.Float=ra;var na=class extends Te{constructor(e){super(4,e)}decode(e,t=0){return Le(e).readFloatBE(t)}encode(e,t,r=0){return Le(t).writeFloatBE(e,r),4}};I.FloatBE=na;var sa=class extends Te{constructor(e){super(8,e)}decode(e,t=0){return Le(e).readDoubleLE(t)}encode(e,t,r=0){return Le(t).writeDoubleLE(e,r),8}};I.Double=sa;var oa=class extends Te{constructor(e){super(8,e)}decode(e,t=0){return Le(e).readDoubleBE(t)}encode(e,t,r=0){return Le(t).writeDoubleBE(e,r),8}};I.DoubleBE=oa;var ia=class extends Te{constructor(e,t,r){if(!(e instanceof Te))throw new TypeError("elementLayout must be a Layout");if(!(t instanceof wt&&t.isCount()||Number.isInteger(t)&&0<=t))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let o=-1;!(t instanceof wt)&&0<e.span&&(o=t*e.span),super(o,r),this.elementLayout=e,this.count=t}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0,o=this.count;if(o instanceof wt&&(o=o.decode(e,t)),0<this.elementLayout.span)r=o*this.elementLayout.span;else{let s=0;for(;s<o;)r+=this.elementLayout.getSpan(e,t+r),++s}return r}decode(e,t=0){let r=[],o=0,s=this.count;for(s instanceof wt&&(s=s.decode(e,t));o<s;)r.push(this.elementLayout.decode(e,t)),t+=this.elementLayout.getSpan(e,t),o+=1;return r}encode(e,t,r=0){let o=this.elementLayout,s=e.reduce((i,c)=>i+o.encode(c,t,r+i),0);return this.count instanceof wt&&this.count.encode(e.length,t,r),s}};I.Sequence=ia;var aa=class extends Te{constructor(e,t,r){if(!(Array.isArray(e)&&e.reduce((s,i)=>s&&i instanceof Te,!0)))throw new TypeError("fields must be array of Layout instances");typeof t=="boolean"&&r===void 0&&(r=t,t=void 0);for(let s of e)if(0>s.span&&s.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let o=-1;try{o=e.reduce((s,i)=>s+i.getSpan(),0)}catch{}super(o,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((o,s)=>{let i=s.getSpan(e,t);return t+=i,o+i},0)}catch{throw new RangeError("indeterminate span")}return r}decode(e,t=0){bs(e);let r=this.makeDestinationObject();for(let o of this.fields)if(o.property!==void 0&&(r[o.property]=o.decode(e,t)),t+=o.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return r}encode(e,t,r=0){let o=r,s=0,i=0;for(let c of this.fields){let u=c.span;if(i=0<u?u:0,c.property!==void 0){let h=e[c.property];h!==void 0&&(i=c.encode(h,t,r),0>u&&(u=c.getSpan(t,r)))}s=r,r+=u}return s+i-o}fromArray(e){let t=this.makeDestinationObject();for(let r of this.fields)r.property!==void 0&&0<e.length&&(t[r.property]=e.shift());return t}layoutFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(let t of this.fields)if(t.property===e)return t}offsetOf(e){if(typeof e!="string")throw new TypeError("property must be string");let t=0;for(let r of this.fields){if(r.property===e)return t;0>r.span?t=-1:0<=t&&(t+=r.span)}}};I.Structure=aa;var so=class{constructor(e){this.property=e}decode(e,t){throw new Error("UnionDiscriminator is abstract")}encode(e,t,r){throw new Error("UnionDiscriminator is abstract")}};I.UnionDiscriminator=so;var gs=class extends so{constructor(e,t){if(!(e instanceof wt&&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)}};I.UnionLayoutDiscriminator=gs;var oo=class extends Te{constructor(e,t,r){let o;if(e instanceof It||e instanceof Dt)o=new gs(new no(e));else if(e instanceof wt&&e.isCount())o=new gs(e);else if(e instanceof so)o=e;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(t===void 0&&(t=null),!(t===null||t instanceof Te))throw new TypeError("defaultLayout must be null or a Layout");if(t!==null){if(0>t.span)throw new Error("defaultLayout must have constant span");t.property===void 0&&(t=t.replicate("content"))}let s=-1;t&&(s=t.span,0<=s&&(e instanceof It||e instanceof Dt)&&(s+=o.layout.span)),super(s,r),this.discriminator=o,this.usesPrefixDiscriminator=e instanceof It||e instanceof Dt,this.defaultLayout=t,this.registry={};let i=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(c){return i(c)},this.configGetSourceVariant=function(c){i=c.bind(this)}}getSpan(e,t=0){if(0<=this.span)return this.span;let 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;let t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(let t in this.registry){let 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,o=this.discriminator,s=o.decode(e,t),i=this.registry[s];if(i===void 0){let c=this.defaultLayout,u=0;this.usesPrefixDiscriminator&&(u=o.layout.span),r=this.makeDestinationObject(),r[o.property]=s,r[c.property]=c.decode(e,t+u)}else r=i.decode(e,t);return r}encode(e,t,r=0){let o=this.getSourceVariant(e);if(o===void 0){let s=this.discriminator,i=this.defaultLayout,c=0;return this.usesPrefixDiscriminator&&(c=s.layout.span),s.encode(e[s.property],t,r),c+i.encode(e[i.property],t,r+c)}return o.encode(e,t,r)}addVariant(e,t,r){let o=new ca(this,e,t,r);return this.registry[e]=o,o}getVariant(e,t=0){let r;return e instanceof Uint8Array?r=this.discriminator.decode(e,t):r=e,this.registry[r]}};I.Union=oo;var ca=class extends Te{constructor(e,t,r,o){if(!(e instanceof oo))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(typeof r=="string"&&o===void 0&&(o=r,r=null),r){if(!(r instanceof Te))throw new TypeError("layout must be a Layout");if(e.defaultLayout!==null&&0<=r.span&&r.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof o!="string")throw new TypeError("variant must have a String property")}let s=e.span;0>e.span&&(s=r?r.span:0,0<=s&&e.usesPrefixDiscriminator&&(s+=e.discriminator.layout.span)),super(s,o),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 o=0;return this.layout&&(o=this.layout.getSpan(e,t+r)),r+o}decode(e,t=0){let r=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))throw new Error("variant mismatch");let o=0;return this.union.usesPrefixDiscriminator&&(o=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(e,t+o):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(e,t,r=0){let o=0;if(this.union.usesPrefixDiscriminator&&(o=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 s=o;if(this.layout&&(this.layout.encode(e[this.property],t,r+o),s+=this.layout.getSpan(t,r+o),0<=this.union.span&&s>this.union.span))throw new Error("encoded variant overruns containing union");return s}fromArray(e){if(this.layout)return this.layout.fromArray(e)}};I.VariantLayout=ca;function ms(n){return 0>n&&(n+=4294967296),n}var io=class extends Te{constructor(e,t,r){if(!(e instanceof It||e instanceof Dt))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof t=="string"&&r===void 0&&(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 o=0;this._packedSetValue=function(s){return o=ms(s),this},this._packedGetValue=function(){return o}}decode(e,t=0){let r=this.makeDestinationObject(),o=this.word.decode(e,t);this._packedSetValue(o);for(let s of this.fields)s.property!==void 0&&(r[s.property]=s.decode(e));return r}encode(e,t,r=0){let o=this.word.decode(t,r);this._packedSetValue(o);for(let s of this.fields)if(s.property!==void 0){let i=e[s.property];i!==void 0&&s.encode(i)}return this.word.encode(this._packedGetValue(),t,r)}addField(e,t){let r=new ao(this,e,t);return this.fields.push(r),r}addBoolean(e){let t=new ua(this,e);return this.fields.push(t),t}fieldFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(let t of this.fields)if(t.property===e)return t}};I.BitStructure=io;var ao=class{constructor(e,t,r){if(!(e instanceof io))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(t)||0>=t)throw new TypeError("bits must be positive integer");let o=8*e.span,s=e.fields.reduce((i,c)=>i+c.bits,0);if(t+s>o)throw new Error("bits too long for span remainder ("+(o-s)+" of "+o+" remain)");this.container=e,this.bits=t,this.valueMask=(1<<t)-1,t===32&&(this.valueMask=4294967295),this.start=s,this.container.msb&&(this.start=o-s-t),this.wordMask=ms(this.valueMask<<this.start),this.property=r}decode(e,t){let r=this.container._packedGetValue();return ms(r&this.wordMask)>>>this.start}encode(e){if(typeof e!="number"||!Number.isInteger(e)||e!==ms(e&this.valueMask))throw new TypeError(mu("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let t=this.container._packedGetValue(),r=ms(e<<this.start);this.container._packedSetValue(ms(t&~this.wordMask)|r)}};I.BitField=ao;var ua=class extends ao{constructor(e,t){super(e,1,t)}decode(e,t){return!!super.decode(e,t)}encode(e){typeof e=="boolean"&&(e=+e),super.encode(e)}};I.Boolean=ua;var la=class extends Te{constructor(e,t){if(!(e instanceof wt&&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 wt||(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)),Le(e).slice(t,t+r)}encode(e,t,r){let o=this.length;if(this.length instanceof wt&&(o=e.length),!(e instanceof Uint8Array&&o===e.length))throw new TypeError(mu("Blob.encode",this)+" requires (length "+o+") Uint8Array as src");if(r+o>t.length)throw new RangeError("encoding overruns Uint8Array");let s=Le(e);return Le(t).write(s.toString("hex"),r,o,"hex"),this.length instanceof wt&&this.length.encode(o,t,r),o}};I.Blob=la;var fa=class extends Te{constructor(e){super(-1,e)}getSpan(e,t=0){bs(e);let r=t;for(;r<e.length&&e[r]!==0;)r+=1;return 1+r-t}decode(e,t=0){let r=this.getSpan(e,t);return Le(e).slice(t,t+r-1).toString("utf-8")}encode(e,t,r=0){typeof e!="string"&&(e=String(e));let o=yu.Buffer.from(e,"utf8"),s=o.length;if(r+s>t.length)throw new RangeError("encoding overruns Buffer");let i=Le(t);return o.copy(i,r),i[r+s]=0,s+1}};I.CString=fa;var da=class extends Te{constructor(e,t){if(typeof e=="string"&&t===void 0&&(t=e,e=void 0),e===void 0)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 bs(e),e.length-t}decode(e,t=0){let r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpan<r)throw new RangeError("text length exceeds maxSpan");return Le(e).slice(t,t+r).toString("utf-8")}encode(e,t,r=0){typeof e!="string"&&(e=String(e));let o=yu.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(Le(t),r),s}};I.UTF8=da;var ha=class extends Te{constructor(e,t){super(0,t),this.value=e}decode(e,t){return this.value}encode(e,t,r){return 0}};I.Constant=ha;I.greedy=(n,e)=>new Zi(n,e);I.offset=(n,e,t)=>new no(n,e,t);I.u8=n=>new It(1,n);I.u16=n=>new It(2,n);I.u24=n=>new It(3,n);I.u32=n=>new It(4,n);I.u40=n=>new It(5,n);I.u48=n=>new It(6,n);I.nu64=n=>new Ji(n);I.u16be=n=>new Dt(2,n);I.u24be=n=>new Dt(3,n);I.u32be=n=>new Dt(4,n);I.u40be=n=>new Dt(5,n);I.u48be=n=>new Dt(6,n);I.nu64be=n=>new Qi(n);I.s8=n=>new Dr(1,n);I.s16=n=>new Dr(2,n);I.s24=n=>new Dr(3,n);I.s32=n=>new Dr(4,n);I.s40=n=>new Dr(5,n);I.s48=n=>new Dr(6,n);I.ns64=n=>new ea(n);I.s16be=n=>new an(2,n);I.s24be=n=>new an(3,n);I.s32be=n=>new an(4,n);I.s40be=n=>new an(5,n);I.s48be=n=>new an(6,n);I.ns64be=n=>new ta(n);I.f32=n=>new ra(n);I.f32be=n=>new na(n);I.f64=n=>new sa(n);I.f64be=n=>new oa(n);I.struct=(n,e,t)=>new aa(n,e,t);I.bits=(n,e,t)=>new io(n,e,t);I.seq=(n,e,t)=>new ia(n,e,t);I.union=(n,e,t)=>new oo(n,e,t);I.unionLayoutDiscriminator=(n,e)=>new gs(n,e);I.blob=(n,e)=>new la(n,e);I.cstr=n=>new fa(n);I.utf8=(n,e)=>new da(n,e);I.constant=(n,e)=>new ha(n,e)});var uh=pe((Hk,ch)=>{var ma=be("path").sep||"/";ch.exports=Yb;function Yb(n){if(typeof n!="string"||n.length<=7||n.substring(0,7)!="file://")throw new TypeError("must pass in a file:// URI to convert to a file path");var e=decodeURI(n.substring(7)),t=e.indexOf("/"),r=e.substring(0,t),o=e.substring(t+1);return r=="localhost"&&(r=""),r&&(r=ma+ma+r),o=o.replace(/^(.+)\|/,"$1:"),ma=="\\"&&(o=o.replace(/\//g,"\\")),/^.+\:/.test(o)||(o=ma+o),r+o}});var hh=pe((ws,dh)=>{var bu=be("fs"),ba=be("path"),Xb=uh(),ga=ba.join,Zb=ba.dirname,lh=bu.accessSync&&function(n){try{bu.accessSync(n)}catch{return!1}return!0}||bu.existsSync||ba.existsSync,fh={arrow:process.env.NODE_BINDINGS_ARROW||" \u2192 ",compiled:process.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:process.platform,arch:process.arch,nodePreGyp:"node-v"+process.versions.modules+"-"+process.platform+"-"+process.arch,version:process.versions.node,bindings:"bindings.node",try:[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"],["module_root","addon-build","release","install-root","bindings"],["module_root","addon-build","debug","install-root","bindings"],["module_root","addon-build","default","install-root","bindings"],["module_root","lib","binding","nodePreGyp","bindings"]]};function Jb(n){typeof n=="string"?n={bindings:n}:n||(n={}),Object.keys(fh).map(function(u){u in n||(n[u]=fh[u])}),n.module_root||(n.module_root=ws.getRoot(ws.getFileName())),ba.extname(n.bindings)!=".node"&&(n.bindings+=".node");for(var e=typeof __webpack_require__=="function"?__non_webpack_require__:be,t=[],r=0,o=n.try.length,s,i,c;r<o;r++){s=ga.apply(null,n.try[r].map(function(u){return n[u]||u})),t.push(s);try{return i=n.path?e.resolve(s):e(s),n.path||(i.path=s),i}catch(u){if(u.code!=="MODULE_NOT_FOUND"&&u.code!=="QUALIFIED_PATH_RESOLUTION_FAILED"&&!/not find/i.test(u.message))throw u}}throw c=new Error(`Could not locate the bindings file. Tried:
2
+ import{b as Rd}from"./chunk-DEW7KMCM.js";import{a as Bd,b as j0}from"./chunk-3RFIQSEL.js";import{b as Yc,c as H0,d as Id,e as V0,h as eo,i as Ld}from"./chunk-EBOI7P4R.js";import{r as Gc,x as Ni,y as Ad}from"./chunk-DJQ5RDDN.js";import{a as Ed}from"./chunk-L4PAFISV.js";import{D as jc,Sc as kd,W as Sd,Yb as W0,Zb as Oi,ec as vd,wc as K0}from"./chunk-KCSKNUVW.js";import{e as Rn}from"./chunk-AYDIUTOB.js";import{a as xd,c as $0}from"./chunk-NMFPLO65.js";import{a as be,b as qe,c as pe,d as fs,e as ue,f as Qs,g as _d}from"./chunk-LLHU72AA.js";var Fi={};fs(Fi,{abytes:()=>ds,bitGet:()=>ob,bitLen:()=>sb,bitMask:()=>to,bitSet:()=>ib,bytesToHex:()=>Pr,bytesToNumberBE:()=>Or,bytesToNumberLE:()=>nn,concatBytes:()=>Nr,createHmacDrbg:()=>eu,ensureBytes:()=>Qe,equalBytes:()=>rb,hexToBytes:()=>Tn,hexToNumber:()=>Qc,isBytes:()=>rn,numberToBytesBE:()=>sn,numberToBytesLE:()=>Pn,numberToHexUnpadded:()=>Md,numberToVarBytesBE:()=>tb,utf8ToBytes:()=>nb,validateObject:()=>fr});function rn(n){return n instanceof Uint8Array||n!=null&&typeof n=="object"&&n.constructor.name==="Uint8Array"}function ds(n){if(!rn(n))throw new Error("Uint8Array expected")}function Pr(n){ds(n);let e="";for(let t=0;t<n.length;t++)e+=eb[n[t]];return e}function Md(n){let e=n.toString(16);return e.length&1?`0${e}`:e}function Qc(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);return BigInt(n===""?"0":`0x${n}`)}function Ud(n){if(n>=Tr._0&&n<=Tr._9)return n-Tr._0;if(n>=Tr._A&&n<=Tr._F)return n-(Tr._A-10);if(n>=Tr._a&&n<=Tr._f)return n-(Tr._a-10)}function Tn(n){if(typeof n!="string")throw new Error("hex string expected, got "+typeof n);let e=n.length,t=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let r=new Uint8Array(t);for(let o=0,s=0;o<t;o++,s+=2){let i=Ud(n.charCodeAt(s)),c=Ud(n.charCodeAt(s+1));if(i===void 0||c===void 0){let u=n[s]+n[s+1];throw new Error('hex string expected, got non-hex character "'+u+'" at index '+s)}r[o]=i*16+c}return r}function Or(n){return Qc(Pr(n))}function nn(n){return ds(n),Qc(Pr(Uint8Array.from(n).reverse()))}function sn(n,e){return Tn(n.toString(16).padStart(e*2,"0"))}function Pn(n,e){return sn(n,e).reverse()}function tb(n){return Tn(Md(n))}function Qe(n,e,t){let r;if(typeof e=="string")try{r=Tn(e)}catch(s){throw new Error(`${n} must be valid hex string, got "${e}". Cause: ${s}`)}else if(rn(e))r=Uint8Array.from(e);else throw new Error(`${n} must be hex string or Uint8Array`);let o=r.length;if(typeof t=="number"&&o!==t)throw new Error(`${n} expected ${t} bytes, got ${o}`);return r}function Nr(...n){let e=0;for(let r=0;r<n.length;r++){let o=n[r];ds(o),e+=o.length}let t=new Uint8Array(e);for(let r=0,o=0;r<n.length;r++){let s=n[r];t.set(s,o),o+=s.length}return t}function rb(n,e){if(n.length!==e.length)return!1;let t=0;for(let r=0;r<n.length;r++)t|=n[r]^e[r];return t===0}function nb(n){if(typeof n!="string")throw new Error(`utf8ToBytes expected string, got ${typeof n}`);return new Uint8Array(new TextEncoder().encode(n))}function sb(n){let e;for(e=0;n>Fd;n>>=Di,e+=1);return e}function ob(n,e){return n>>BigInt(e)&Di}function ib(n,e,t){return n|(t?Di:Fd)<<BigInt(e)}function eu(n,e,t){if(typeof n!="number"||n<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let r=Jc(n),o=Jc(n),s=0,i=()=>{r.fill(1),o.fill(0),s=0},c=(...y)=>t(o,r,...y),u=(y=Jc())=>{o=c(Dd([0]),y),r=c(),y.length!==0&&(o=c(Dd([1]),y),r=c())},h=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let y=0,S=[];for(;y<e;){r=c();let g=r.slice();S.push(g),y+=r.length}return Nr(...S)};return(y,S)=>{i(),u(y);let g;for(;!(g=S(h()));)u();return i(),g}}function fr(n,e,t={}){let r=(o,s,i)=>{let c=ab[s];if(typeof c!="function")throw new Error(`Invalid validator "${s}", expected function`);let u=n[o];if(!(i&&u===void 0)&&!c(u,n))throw new Error(`Invalid param ${String(o)}=${u} (${typeof u}), expected ${s}`)};for(let[o,s]of Object.entries(e))r(o,s,!1);for(let[o,s]of Object.entries(t))r(o,s,!0);return n}var Fd,Di,Q0,eb,Tr,to,Jc,Dd,ab,On=qe(()=>{Fd=BigInt(0),Di=BigInt(1),Q0=BigInt(2);eb=Array.from({length:256},(n,e)=>e.toString(16).padStart(2,"0"));Tr={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};to=n=>(Q0<<BigInt(n-1))-Di,Jc=n=>new Uint8Array(n),Dd=n=>Uint8Array.from(n);ab={bigint:n=>typeof n=="bigint",function:n=>typeof n=="function",boolean:n=>typeof n=="boolean",string:n=>typeof n=="string",stringOrUint8Array:n=>typeof n=="string"||rn(n),isSafeInteger:n=>Number.isSafeInteger(n),array:n=>Array.isArray(n),field:(n,e)=>e.Fp.isValid(n),hash:n=>typeof n=="function"&&Number.isSafeInteger(n.outputLen)}});function Fe(n,e){let t=n%e;return t>=ct?t:e+t}function fb(n,e,t){if(t<=ct||e<ct)throw new Error("Expected power/modulo > 0");if(t===Ve)return ct;let r=Ve;for(;e>ct;)e&Ve&&(r=r*n%t),n=n*n%t,e>>=Ve;return r}function je(n,e,t){let r=n;for(;e-- >ct;)r*=r,r%=t;return r}function Mi(n,e){if(n===ct||e<=ct)throw new Error(`invert: expected positive integers, got n=${n} mod=${e}`);let t=Fe(n,e),r=e,o=ct,s=Ve,i=Ve,c=ct;for(;t!==ct;){let h=r/t,f=r%t,y=o-i*h,S=s-c*h;r=t,t=f,o=i,s=c,i=y,c=S}if(r!==Ve)throw new Error("invert: does not exist");return Fe(o,e)}function db(n){let e=(n-Ve)/Nn,t,r,o;for(t=n-Ve,r=0;t%Nn===ct;t/=Nn,r++);for(o=Nn;o<n&&fb(o,e,n)!==n-Ve;o++);if(r===1){let i=(n+Ve)/tu;return function(u,h){let f=u.pow(h,i);if(!u.eql(u.sqr(f),h))throw new Error("Cannot find square root");return f}}let s=(t+Ve)/Nn;return function(c,u){if(c.pow(u,e)===c.neg(c.ONE))throw new Error("Cannot find square root");let h=r,f=c.pow(c.mul(c.ONE,o),t),y=c.pow(u,s),S=c.pow(u,t);for(;!c.eql(S,c.ONE);){if(c.eql(S,c.ZERO))return c.ZERO;let g=1;for(let b=c.sqr(S);g<h&&!c.eql(b,c.ONE);g++)b=c.sqr(b);let x=c.pow(f,Ve<<BigInt(h-g-1));f=c.sqr(x),y=c.mul(y,x),S=c.mul(S,f),h=g}return y}}function hb(n){if(n%tu===cb){let e=(n+Ve)/tu;return function(r,o){let s=r.pow(o,e);if(!r.eql(r.sqr(s),o))throw new Error("Cannot find square root");return s}}if(n%zd===qd){let e=(n-qd)/zd;return function(r,o){let s=r.mul(o,Nn),i=r.pow(s,e),c=r.mul(o,i),u=r.mul(r.mul(c,Nn),i),h=r.mul(c,r.sub(u,r.ONE));if(!r.eql(r.sqr(h),o))throw new Error("Cannot find square root");return h}}return n%lb,db(n)}function ru(n){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=pb.reduce((r,o)=>(r[o]="function",r),e);return fr(n,t)}function yb(n,e,t){if(t<ct)throw new Error("Expected power > 0");if(t===ct)return n.ONE;if(t===Ve)return e;let r=n.ONE,o=e;for(;t>ct;)t&Ve&&(r=n.mul(r,o)),o=n.sqr(o),t>>=Ve;return r}function mb(n,e){let t=new Array(e.length),r=e.reduce((s,i,c)=>n.is0(i)?s:(t[c]=s,n.mul(s,i)),n.ONE),o=n.inv(r);return e.reduceRight((s,i,c)=>n.is0(i)?s:(t[c]=n.mul(s,t[c]),n.mul(s,i)),o),t}function nu(n,e){let t=e!==void 0?e:n.toString(2).length,r=Math.ceil(t/8);return{nBitLength:t,nByteLength:r}}function qi(n,e,t=!1,r={}){if(n<=ct)throw new Error(`Expected Field ORDER > 0, got ${n}`);let{nBitLength:o,nByteLength:s}=nu(n,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let i=hb(n),c=Object.freeze({ORDER:n,BITS:o,BYTES:s,MASK:to(o),ZERO:ct,ONE:Ve,create:u=>Fe(u,n),isValid:u=>{if(typeof u!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof u}`);return ct<=u&&u<n},is0:u=>u===ct,isOdd:u=>(u&Ve)===Ve,neg:u=>Fe(-u,n),eql:(u,h)=>u===h,sqr:u=>Fe(u*u,n),add:(u,h)=>Fe(u+h,n),sub:(u,h)=>Fe(u-h,n),mul:(u,h)=>Fe(u*h,n),pow:(u,h)=>yb(c,u,h),div:(u,h)=>Fe(u*Mi(h,n),n),sqrN:u=>u*u,addN:(u,h)=>u+h,subN:(u,h)=>u-h,mulN:(u,h)=>u*h,inv:u=>Mi(u,n),sqrt:r.sqrt||(u=>i(c,u)),invertBatch:u=>mb(c,u),cmov:(u,h,f)=>f?h:u,toBytes:u=>t?Pn(u,s):sn(u,s),fromBytes:u=>{if(u.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${u.length}`);return t?nn(u):Or(u)}});return Object.freeze(c)}function Wd(n){if(typeof n!="bigint")throw new Error("field order must be bigint");let e=n.toString(2).length;return Math.ceil(e/8)}function su(n){let e=Wd(n);return e+Math.ceil(e/2)}function Kd(n,e,t=!1){let r=n.length,o=Wd(e),s=su(e);if(r<16||r<s||r>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${r}`);let i=t?Or(n):nn(n),c=Fe(i,e-Ve)+Ve;return t?Pn(c,o):sn(c,o)}var ct,Ve,Nn,cb,tu,qd,zd,ub,lb,$d,pb,hs=qe(()=>{On();ct=BigInt(0),Ve=BigInt(1),Nn=BigInt(2),cb=BigInt(3),tu=BigInt(4),qd=BigInt(5),zd=BigInt(8),ub=BigInt(9),lb=BigInt(16);$d=(n,e)=>(Fe(n,e)&Ve)===Ve,pb=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function zi(n,e){let t=(o,s)=>{let i=s.negate();return o?i:s},r=o=>{let s=Math.ceil(e/o)+1,i=2**(o-1);return{windows:s,windowSize:i}};return{constTimeNegate:t,unsafeLadder(o,s){let i=n.ZERO,c=o;for(;s>bb;)s&ou&&(i=i.add(c)),c=c.double(),s>>=ou;return i},precomputeWindow(o,s){let{windows:i,windowSize:c}=r(s),u=[],h=o,f=h;for(let y=0;y<i;y++){f=h,u.push(f);for(let S=1;S<c;S++)f=f.add(h),u.push(f);h=f.double()}return u},wNAF(o,s,i){let{windows:c,windowSize:u}=r(o),h=n.ZERO,f=n.BASE,y=BigInt(2**o-1),S=2**o,g=BigInt(o);for(let x=0;x<c;x++){let b=x*u,v=Number(i&y);i>>=g,v>u&&(v-=S,i+=ou);let k=b,B=b+Math.abs(v)-1,R=x%2!==0,D=v<0;v===0?f=f.add(t(R,s[k])):h=h.add(t(D,s[B]))}return{p:h,f}},wNAFCached(o,s,i,c){let u=o._WINDOW_SIZE||1,h=s.get(o);return h||(h=this.precomputeWindow(o,u),u!==1&&s.set(o,c(h))),this.wNAF(u,h,i)}}}function ro(n){return ru(n.Fp),fr(n,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...nu(n.n,n.nBitLength),...n,p:n.Fp.ORDER})}var bb,ou,iu=qe(()=>{hs();On();bb=BigInt(0),ou=BigInt(1)});function Sb(n){let e=ro(n);return fr(n,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function Hd(n){let e=Sb(n),{Fp:t,n:r,prehash:o,hash:s,randomBytes:i,nByteLength:c,h:u}=e,h=$i<<BigInt(c*8)-Ut,f=t.create,y=e.uvRatio||(($,T)=>{try{return{isValid:!0,value:t.sqrt($*t.inv(T))}}catch{return{isValid:!1,value:sr}}}),S=e.adjustScalarBytes||($=>$),g=e.domain||(($,T,Y)=>{if(T.length||Y)throw new Error("Contexts/pre-hash are not supported");return $}),x=$=>typeof $=="bigint"&&sr<$,b=($,T)=>x($)&&x(T)&&$<T,v=$=>$===sr||b($,h);function k($,T){if(b($,T))return $;throw new Error(`Expected valid scalar < ${T}, got ${typeof $} ${$}`)}function B($){return $===sr?$:k($,r)}let R=new Map;function D($){if(!($ instanceof P))throw new Error("ExtendedPoint expected")}class P{constructor(T,Y,re,ae){if(this.ex=T,this.ey=Y,this.ez=re,this.et=ae,!v(T))throw new Error("x required");if(!v(Y))throw new Error("y required");if(!v(re))throw new Error("z required");if(!v(ae))throw new Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(T){if(T instanceof P)throw new Error("extended point not allowed");let{x:Y,y:re}=T||{};if(!v(Y)||!v(re))throw new Error("invalid affine point");return new P(Y,re,Ut,f(Y*re))}static normalizeZ(T){let Y=t.invertBatch(T.map(re=>re.ez));return T.map((re,ae)=>re.toAffine(Y[ae])).map(P.fromAffine)}_setWindowSize(T){this._WINDOW_SIZE=T,R.delete(this)}assertValidity(){let{a:T,d:Y}=e;if(this.is0())throw new Error("bad point: ZERO");let{ex:re,ey:ae,ez:me,et:ge}=this,Ee=f(re*re),ve=f(ae*ae),Ae=f(me*me),Je=f(Ae*Ae),He=f(Ee*T),it=f(Ae*f(He+ve)),at=f(Je+f(Y*f(Ee*ve)));if(it!==at)throw new Error("bad point: equation left != right (1)");let tt=f(re*ae),lt=f(me*ge);if(tt!==lt)throw new Error("bad point: equation left != right (2)")}equals(T){D(T);let{ex:Y,ey:re,ez:ae}=this,{ex:me,ey:ge,ez:Ee}=T,ve=f(Y*Ee),Ae=f(me*ae),Je=f(re*Ee),He=f(ge*ae);return ve===Ae&&Je===He}is0(){return this.equals(P.ZERO)}negate(){return new P(f(-this.ex),this.ey,this.ez,f(-this.et))}double(){let{a:T}=e,{ex:Y,ey:re,ez:ae}=this,me=f(Y*Y),ge=f(re*re),Ee=f($i*f(ae*ae)),ve=f(T*me),Ae=Y+re,Je=f(f(Ae*Ae)-me-ge),He=ve+ge,it=He-Ee,at=ve-ge,tt=f(Je*it),lt=f(He*at),nr=f(Je*at),Rr=f(it*He);return new P(tt,lt,Rr,nr)}add(T){D(T);let{a:Y,d:re}=e,{ex:ae,ey:me,ez:ge,et:Ee}=this,{ex:ve,ey:Ae,ez:Je,et:He}=T;if(Y===BigInt(-1)){let vi=f((me-ae)*(Ae+ve)),Hs=f((me+ae)*(Ae-ve)),Vs=f(Hs-vi);if(Vs===sr)return this.double();let ki=f(ge*$i*He),js=f(Ee*$i*Je),Ei=js+ki,Ai=Hs+vi,Ii=js-ki,Uc=f(Ei*Vs),Dc=f(Ai*Ii),Fc=f(Ei*Ii),Bi=f(Vs*Ai);return new P(Uc,Dc,Bi,Fc)}let it=f(ae*ve),at=f(me*Ae),tt=f(Ee*re*He),lt=f(ge*Je),nr=f((ae+me)*(ve+Ae)-it-at),Rr=lt-tt,Cr=lt+tt,cs=f(at-Y*it),Si=f(nr*Rr),Bn=f(Cr*cs),Ln=f(nr*cs),xi=f(Rr*Cr);return new P(Si,Bn,xi,Ln)}subtract(T){return this.add(T.negate())}wNAF(T){return J.wNAFCached(this,R,T,P.normalizeZ)}multiply(T){let{p:Y,f:re}=this.wNAF(k(T,r));return P.normalizeZ([Y,re])[0]}multiplyUnsafe(T){let Y=B(T);return Y===sr?H:this.equals(H)||Y===Ut?this:this.equals(F)?this.wNAF(Y).p:J.unsafeLadder(this,Y)}isSmallOrder(){return this.multiplyUnsafe(u).is0()}isTorsionFree(){return J.unsafeLadder(this,r).is0()}toAffine(T){let{ex:Y,ey:re,ez:ae}=this,me=this.is0();T==null&&(T=me?wb:t.inv(ae));let ge=f(Y*T),Ee=f(re*T),ve=f(ae*T);if(me)return{x:sr,y:Ut};if(ve!==Ut)throw new Error("invZ was invalid");return{x:ge,y:Ee}}clearCofactor(){let{h:T}=e;return T===Ut?this:this.multiplyUnsafe(T)}static fromHex(T,Y=!1){let{d:re,a:ae}=e,me=t.BYTES;T=Qe("pointHex",T,me);let ge=T.slice(),Ee=T[me-1];ge[me-1]=Ee&-129;let ve=nn(ge);ve===sr||(Y?k(ve,h):k(ve,t.ORDER));let Ae=f(ve*ve),Je=f(Ae-Ut),He=f(re*Ae-ae),{isValid:it,value:at}=y(Je,He);if(!it)throw new Error("Point.fromHex: invalid y coordinate");let tt=(at&Ut)===Ut,lt=(Ee&128)!==0;if(!Y&&at===sr&&lt)throw new Error("Point.fromHex: x=0 and x_0=1");return lt!==tt&&(at=f(-at)),P.fromAffine({x:at,y:ve})}static fromPrivateKey(T){return de(T).point}toRawBytes(){let{x:T,y:Y}=this.toAffine(),re=Pn(Y,t.BYTES);return re[re.length-1]|=T&Ut?128:0,re}toHex(){return Pr(this.toRawBytes())}}P.BASE=new P(e.Gx,e.Gy,Ut,f(e.Gx*e.Gy)),P.ZERO=new P(sr,Ut,Ut,sr);let{BASE:F,ZERO:H}=P,J=zi(P,c*8);function De($){return Fe($,r)}function fe($){return De(nn($))}function de($){let T=c;$=Qe("private key",$,T);let Y=Qe("hashed private key",s($),2*T),re=S(Y.slice(0,T)),ae=Y.slice(T,2*T),me=fe(re),ge=F.multiply(me),Ee=ge.toRawBytes();return{head:re,prefix:ae,scalar:me,point:ge,pointBytes:Ee}}function Ke($){return de($).pointBytes}function ot($=new Uint8Array,...T){let Y=Nr(...T);return fe(s(g(Y,Qe("context",$),!!o)))}function Pt($,T,Y={}){$=Qe("message",$),o&&($=o($));let{prefix:re,scalar:ae,pointBytes:me}=de(T),ge=ot(Y.context,re,$),Ee=F.multiply(ge).toRawBytes(),ve=ot(Y.context,Ee,me,$),Ae=De(ge+ve*ae);B(Ae);let Je=Nr(Ee,Pn(Ae,t.BYTES));return Qe("result",Je,c*2)}let z=_b;function Z($,T,Y,re=z){let{context:ae,zip215:me}=re,ge=t.BYTES;$=Qe("signature",$,2*ge),T=Qe("message",T),o&&(T=o(T));let Ee=nn($.slice(ge,2*ge)),ve,Ae,Je;try{ve=P.fromHex(Y,me),Ae=P.fromHex($.slice(0,ge),me),Je=F.multiplyUnsafe(Ee)}catch{return!1}if(!me&&ve.isSmallOrder())return!1;let He=ot(ae,Ae.toRawBytes(),ve.toRawBytes(),T);return Ae.add(ve.multiplyUnsafe(He)).subtract(Je).clearCofactor().equals(P.ZERO)}return F._setWindowSize(8),{CURVE:e,getPublicKey:Ke,sign:Pt,verify:Z,ExtendedPoint:P,utils:{getExtendedPublicKey:de,randomPrivateKey:()=>i(t.BYTES),precompute($=8,T=P.BASE){return T._setWindowSize($),T.multiply(BigInt(3)),T}}}}var sr,Ut,$i,wb,_b,Vd=qe(()=>{iu();hs();On();On();sr=BigInt(0),Ut=BigInt(1),$i=BigInt(2),wb=BigInt(8),_b={zip215:!0}});function Eb(n){let e=BigInt(10),t=BigInt(20),r=BigInt(40),o=BigInt(80),s=au,c=n*n%s*n%s,u=je(c,Gd,s)*c%s,h=je(u,xb,s)*n%s,f=je(h,vb,s)*h%s,y=je(f,e,s)*f%s,S=je(y,t,s)*y%s,g=je(S,r,s)*S%s,x=je(g,o,s)*g%s,b=je(x,o,s)*g%s,v=je(b,e,s)*f%s;return{pow_p_5_8:je(v,Gd,s)*n%s,b2:c}}function Ab(n){return n[0]&=248,n[31]&=127,n[31]|=64,n}function Ib(n,e){let t=au,r=Fe(e*e*e,t),o=Fe(r*r*e,t),s=Eb(n*o).pow_p_5_8,i=Fe(n*r*s,t),c=Fe(e*i*i,t),u=i,h=Fe(i*jd,t),f=c===n,y=c===Fe(-n,t),S=c===Fe(-n*jd,t);return f&&(i=u),(y||S)&&(i=h),$d(i,t)&&(i=Fe(-i,t)),{isValid:f||y,value:i}}var au,jd,Dk,xb,Gd,Fk,vb,kb,Bb,Lb,Un,Yd=qe(()=>{j0();Ad();Vd();hs();au=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),jd=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),Dk=BigInt(0),xb=BigInt(1),Gd=BigInt(2),Fk=BigInt(3),vb=BigInt(5),kb=BigInt(8);Bb=(()=>qi(au,void 0,!0))(),Lb=(()=>({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Bb,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:kb,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:Bd,randomBytes:Ni,adjustScalarBytes:Ab,uvRatio:Ib}))(),Un=(()=>Hd(Lb))()});var Jd=pe((cu,Zd)=>{var Wi=be("buffer"),dr=Wi.Buffer;function Xd(n,e){for(var t in n)e[t]=n[t]}dr.from&&dr.alloc&&dr.allocUnsafe&&dr.allocUnsafeSlow?Zd.exports=Wi:(Xd(Wi,cu),cu.Buffer=Dn);function Dn(n,e,t){return dr(n,e,t)}Dn.prototype=Object.create(dr.prototype);Xd(dr,Dn);Dn.from=function(n,e,t){if(typeof n=="number")throw new TypeError("Argument must not be a number");return dr(n,e,t)};Dn.alloc=function(n,e,t){if(typeof n!="number")throw new TypeError("Argument must be a number");var r=dr(n);return e!==void 0?typeof t=="string"?r.fill(e,t):r.fill(e):r.fill(0),r};Dn.allocUnsafe=function(n){if(typeof n!="number")throw new TypeError("Argument must be a number");return dr(n)};Dn.allocUnsafeSlow=function(n){if(typeof n!="number")throw new TypeError("Argument must be a number");return Wi.SlowBuffer(n)}});var eh=pe((qk,Qd)=>{"use strict";var Ki=Jd().Buffer;function Rb(n){if(n.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),t=0;t<e.length;t++)e[t]=255;for(var r=0;r<n.length;r++){var o=n.charAt(r),s=o.charCodeAt(0);if(e[s]!==255)throw new TypeError(o+" is ambiguous");e[s]=r}var i=n.length,c=n.charAt(0),u=Math.log(i)/Math.log(256),h=Math.log(256)/Math.log(i);function f(g){if((Array.isArray(g)||g instanceof Uint8Array)&&(g=Ki.from(g)),!Ki.isBuffer(g))throw new TypeError("Expected Buffer");if(g.length===0)return"";for(var x=0,b=0,v=0,k=g.length;v!==k&&g[v]===0;)v++,x++;for(var B=(k-v)*h+1>>>0,R=new Uint8Array(B);v!==k;){for(var D=g[v],P=0,F=B-1;(D!==0||P<b)&&F!==-1;F--,P++)D+=256*R[F]>>>0,R[F]=D%i>>>0,D=D/i>>>0;if(D!==0)throw new Error("Non-zero carry");b=P,v++}for(var H=B-b;H!==B&&R[H]===0;)H++;for(var J=c.repeat(x);H<B;++H)J+=n.charAt(R[H]);return J}function y(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return Ki.alloc(0);for(var x=0,b=0,v=0;g[x]===c;)b++,x++;for(var k=(g.length-x)*u+1>>>0,B=new Uint8Array(k);g[x];){var R=e[g.charCodeAt(x)];if(R===255)return;for(var D=0,P=k-1;(R!==0||D<v)&&P!==-1;P--,D++)R+=i*B[P]>>>0,B[P]=R%256>>>0,R=R/256>>>0;if(R!==0)throw new Error("Non-zero carry");v=D,x++}for(var F=k-v;F!==k&&B[F]===0;)F++;var H=Ki.allocUnsafe(b+(k-F));H.fill(0,0,b);for(var J=b;F!==k;)H[J++]=B[F++];return H}function S(g){var x=y(g);if(x)return x;throw new Error("Non-base"+i+" character")}return{encode:f,decodeUnsafe:y,decode:S}}Qd.exports=Rb});var ps=pe((zk,th)=>{var Cb=eh(),Tb="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";th.exports=Cb(Tb)});var rh=pe(fu=>{"use strict";function Ur(n,e,t){return e<=n&&n<=t}function Yi(n){if(n===void 0)return{};if(n===Object(n))return n;throw TypeError("Could not convert argument to dictionary")}function Pb(n){for(var e=String(n),t=e.length,r=0,o=[];r<t;){var s=e.charCodeAt(r);if(s<55296||s>57343)o.push(s);else if(56320<=s&&s<=57343)o.push(65533);else if(55296<=s&&s<=56319)if(r===t-1)o.push(65533);else{var i=n.charCodeAt(r+1);if(56320<=i&&i<=57343){var c=s&1023,u=i&1023;o.push(65536+(c<<10)+u),r+=1}else o.push(65533)}r+=1}return o}function Ob(n){for(var e="",t=0;t<n.length;++t){var r=n[t];r<=65535?e+=String.fromCharCode(r):(r-=65536,e+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return e}var Hi=-1;function lu(n){this.tokens=[].slice.call(n)}lu.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():Hi},prepend:function(n){if(Array.isArray(n))for(var e=n;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(n)},push:function(n){if(Array.isArray(n))for(var e=n;e.length;)this.tokens.push(e.shift());else this.tokens.push(n)}};var ys=-1;function uu(n,e){if(n)throw TypeError("Decoder error");return e||65533}var Vi="utf-8";function ji(n,e){if(!(this instanceof ji))return new ji(n,e);if(n=n!==void 0?String(n).toLowerCase():Vi,n!==Vi)throw new Error("Encoding not supported. Only utf-8 is supported");e=Yi(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!e.fatal,this._ignoreBOM=!!e.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}ji.prototype={decode:function(e,t){var r;typeof e=="object"&&e instanceof ArrayBuffer?r=new Uint8Array(e):typeof e=="object"&&"buffer"in e&&e.buffer instanceof ArrayBuffer?r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):r=new Uint8Array(0),t=Yi(t),this._streaming||(this._decoder=new Nb({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!t.stream;for(var o=new lu(r),s=[],i;!o.endOfStream()&&(i=this._decoder.handler(o,o.read()),i!==ys);)i!==null&&(Array.isArray(i)?s.push.apply(s,i):s.push(i));if(!this._streaming){do{if(i=this._decoder.handler(o,o.read()),i===ys)break;i!==null&&(Array.isArray(i)?s.push.apply(s,i):s.push(i))}while(!o.endOfStream());this._decoder=null}return s.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(s[0]===65279?(this._BOMseen=!0,s.shift()):this._BOMseen=!0),Ob(s)}};function Gi(n,e){if(!(this instanceof Gi))return new Gi(n,e);if(n=n!==void 0?String(n).toLowerCase():Vi,n!==Vi)throw new Error("Encoding not supported. Only utf-8 is supported");e=Yi(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}Gi.prototype={encode:function(e,t){e=e?String(e):"",t=Yi(t),this._streaming||(this._encoder=new Ub(this._options)),this._streaming=!!t.stream;for(var r=[],o=new lu(Pb(e)),s;!o.endOfStream()&&(s=this._encoder.handler(o,o.read()),s!==ys);)Array.isArray(s)?r.push.apply(r,s):r.push(s);if(!this._streaming){for(;s=this._encoder.handler(o,o.read()),s!==ys;)Array.isArray(s)?r.push.apply(r,s):r.push(s);this._encoder=null}return new Uint8Array(r)}};function Nb(n){var e=n.fatal,t=0,r=0,o=0,s=128,i=191;this.handler=function(c,u){if(u===Hi&&o!==0)return o=0,uu(e);if(u===Hi)return ys;if(o===0){if(Ur(u,0,127))return u;if(Ur(u,194,223))o=1,t=u-192;else if(Ur(u,224,239))u===224&&(s=160),u===237&&(i=159),o=2,t=u-224;else if(Ur(u,240,244))u===240&&(s=144),u===244&&(i=143),o=3,t=u-240;else return uu(e);return t=t<<6*o,null}if(!Ur(u,s,i))return t=o=r=0,s=128,i=191,c.prepend(u),uu(e);if(s=128,i=191,r+=1,t+=u-128<<6*(o-r),r!==o)return null;var h=t;return t=o=r=0,h}}function Ub(n){var e=n.fatal;this.handler=function(t,r){if(r===Hi)return ys;if(Ur(r,0,127))return r;var o,s;Ur(r,128,2047)?(o=1,s=192):Ur(r,2048,65535)?(o=2,s=224):Ur(r,65536,1114111)&&(o=3,s=240);for(var i=[(r>>6*o)+s];o>0;){var c=r>>6*(o-1);i.push(128|c&63),o-=1}return i}}fu.TextEncoder=Gi;fu.TextDecoder=ji});var ah=pe(Me=>{"use strict";var Db=Me&&Me.__createBinding||(Object.create?function(n,e,t,r){r===void 0&&(r=t),Object.defineProperty(n,r,{enumerable:!0,get:function(){return e[t]}})}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}),Fb=Me&&Me.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),hr=Me&&Me.__decorate||function(n,e,t,r){var o=arguments.length,s=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(i=n[c])&&(s=(o<3?i(s):o>3?i(e,t,s):i(e,t))||s);return o>3&&s&&Object.defineProperty(e,t,s),s},Mb=Me&&Me.__importStar||function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)t!=="default"&&Object.hasOwnProperty.call(n,t)&&Db(e,n,t);return Fb(e,n),e},nh=Me&&Me.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Me,"__esModule",{value:!0});Me.deserializeUnchecked=Me.deserialize=Me.serialize=Me.BinaryReader=Me.BinaryWriter=Me.BorshError=Me.baseDecode=Me.baseEncode=void 0;var on=nh(Rn()),sh=nh(ps()),qb=Mb(rh()),zb=typeof TextDecoder!="function"?qb.TextDecoder:TextDecoder,$b=new zb("utf-8",{fatal:!0});function Wb(n){return typeof n=="string"&&(n=Buffer.from(n,"utf8")),sh.default.encode(Buffer.from(n))}Me.baseEncode=Wb;function Kb(n){return Buffer.from(sh.default.decode(n))}Me.baseDecode=Kb;var du=1024,gt=class extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+": "+this.fieldPath.join(".")}};Me.BorshError=gt;var Xi=class{constructor(){this.buf=Buffer.alloc(du),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(du)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(Buffer.from(new on.default(e).toArray("le",8)))}writeU128(e){this.maybeResize(),this.writeBuffer(Buffer.from(new on.default(e).toArray("le",16)))}writeU256(e){this.maybeResize(),this.writeBuffer(Buffer.from(new on.default(e).toArray("le",32)))}writeU512(e){this.maybeResize(),this.writeBuffer(Buffer.from(new on.default(e).toArray("le",64)))}writeBuffer(e){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),e,Buffer.alloc(du)]),this.length+=e.length}writeString(e){this.maybeResize();let t=Buffer.from(e,"utf8");this.writeU32(t.length),this.writeBuffer(t)}writeFixedArray(e){this.writeBuffer(Buffer.from(e))}writeArray(e,t){this.maybeResize(),this.writeU32(e.length);for(let r of e)this.maybeResize(),t(r)}toArray(){return this.buf.subarray(0,this.length)}};Me.BinaryWriter=Xi;function pr(n,e,t){let r=t.value;t.value=function(...o){try{return r.apply(this,o)}catch(s){if(s instanceof RangeError){let i=s.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(i)>=0)throw new gt("Reached the end of buffer when deserializing")}throw s}}}var vt=class{constructor(e){this.buf=e,this.offset=0}readU8(){let e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){let e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){let e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){let e=this.readBuffer(8);return new on.default(e,"le")}readU128(){let e=this.readBuffer(16);return new on.default(e,"le")}readU256(){let e=this.readBuffer(32);return new on.default(e,"le")}readU512(){let e=this.readBuffer(64);return new on.default(e,"le")}readBuffer(e){if(this.offset+e>this.buf.length)throw new gt(`Expected buffer length ${e} isn't within bounds`);let t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){let e=this.readU32(),t=this.readBuffer(e);try{return $b.decode(t)}catch(r){throw new gt(`Error decoding UTF-8 string: ${r}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){let t=this.readU32(),r=Array();for(let o=0;o<t;++o)r.push(e());return r}};hr([pr],vt.prototype,"readU8",null);hr([pr],vt.prototype,"readU16",null);hr([pr],vt.prototype,"readU32",null);hr([pr],vt.prototype,"readU64",null);hr([pr],vt.prototype,"readU128",null);hr([pr],vt.prototype,"readU256",null);hr([pr],vt.prototype,"readU512",null);hr([pr],vt.prototype,"readString",null);hr([pr],vt.prototype,"readFixedArray",null);hr([pr],vt.prototype,"readArray",null);Me.BinaryReader=vt;function oh(n){return n.charAt(0).toUpperCase()+n.slice(1)}function Fn(n,e,t,r,o){try{if(typeof r=="string")o[`write${oh(r)}`](t);else if(r instanceof Array)if(typeof r[0]=="number"){if(t.length!==r[0])throw new gt(`Expecting byte array of length ${r[0]}, but got ${t.length} bytes`);o.writeFixedArray(t)}else if(r.length===2&&typeof r[1]=="number"){if(t.length!==r[1])throw new gt(`Expecting byte array of length ${r[1]}, but got ${t.length} bytes`);for(let s=0;s<r[1];s++)Fn(n,null,t[s],r[0],o)}else o.writeArray(t,s=>{Fn(n,e,s,r[0],o)});else if(r.kind!==void 0)switch(r.kind){case"option":{t==null?o.writeU8(0):(o.writeU8(1),Fn(n,e,t,r.type,o));break}case"map":{o.writeU32(t.size),t.forEach((s,i)=>{Fn(n,e,i,r.key,o),Fn(n,e,s,r.value,o)});break}default:throw new gt(`FieldType ${r} unrecognized`)}else ih(n,t,o)}catch(s){throw s instanceof gt&&s.addToFieldPath(e),s}}function ih(n,e,t){if(typeof e.borshSerialize=="function"){e.borshSerialize(t);return}let r=n.get(e.constructor);if(!r)throw new gt(`Class ${e.constructor.name} is missing in schema`);if(r.kind==="struct")r.fields.map(([o,s])=>{Fn(n,o,e[o],s,t)});else if(r.kind==="enum"){let o=e[r.field];for(let s=0;s<r.values.length;++s){let[i,c]=r.values[s];if(i===o){t.writeU8(s),Fn(n,i,e[i],c,t);break}}}else throw new gt(`Unexpected schema kind: ${r.kind} for ${e.constructor.name}`)}function Hb(n,e,t=Xi){let r=new t;return ih(n,e,r),r.toArray()}Me.serialize=Hb;function Mn(n,e,t,r){try{if(typeof t=="string")return r[`read${oh(t)}`]();if(t instanceof Array){if(typeof t[0]=="number")return r.readFixedArray(t[0]);if(typeof t[1]=="number"){let o=[];for(let s=0;s<t[1];s++)o.push(Mn(n,null,t[0],r));return o}else return r.readArray(()=>Mn(n,e,t[0],r))}if(t.kind==="option")return r.readU8()?Mn(n,e,t.type,r):void 0;if(t.kind==="map"){let o=new Map,s=r.readU32();for(let i=0;i<s;i++){let c=Mn(n,e,t.key,r),u=Mn(n,e,t.value,r);o.set(c,u)}return o}return hu(n,t,r)}catch(o){throw o instanceof gt&&o.addToFieldPath(e),o}}function hu(n,e,t){if(typeof e.borshDeserialize=="function")return e.borshDeserialize(t);let r=n.get(e);if(!r)throw new gt(`Class ${e.name} is missing in schema`);if(r.kind==="struct"){let o={};for(let[s,i]of n.get(e).fields)o[s]=Mn(n,s,i,t);return new e(o)}if(r.kind==="enum"){let o=t.readU8();if(o>=r.values.length)throw new gt(`Enum index: ${o} is out of range`);let[s,i]=r.values[o],c=Mn(n,s,i,t);return new e({[s]:c})}throw new gt(`Unexpected schema kind: ${r.kind} for ${e.constructor.name}`)}function Vb(n,e,t,r=vt){let o=new r(t),s=hu(n,e,o);if(o.offset<t.length)throw new gt(`Unexpected ${t.length-o.offset} bytes after deserialized data`);return s}Me.deserialize=Vb;function jb(n,e,t,r=vt){let o=new r(t);return hu(n,e,o)}Me.deserializeUnchecked=jb});var gu=pe(I=>{"use strict";Object.defineProperty(I,"__esModule",{value:!0});I.s16=I.s8=I.nu64be=I.u48be=I.u40be=I.u32be=I.u24be=I.u16be=I.nu64=I.u48=I.u40=I.u32=I.u24=I.u16=I.u8=I.offset=I.greedy=I.Constant=I.UTF8=I.CString=I.Blob=I.Boolean=I.BitField=I.BitStructure=I.VariantLayout=I.Union=I.UnionLayoutDiscriminator=I.UnionDiscriminator=I.Structure=I.Sequence=I.DoubleBE=I.Double=I.FloatBE=I.Float=I.NearInt64BE=I.NearInt64=I.NearUInt64BE=I.NearUInt64=I.IntBE=I.Int=I.UIntBE=I.UInt=I.OffsetLayout=I.GreedyCount=I.ExternalLayout=I.bindConstructorLayout=I.nameWithProperty=I.Layout=I.uint8ArrayToBuffer=I.checkUint8Array=void 0;I.constant=I.utf8=I.cstr=I.blob=I.unionLayoutDiscriminator=I.union=I.seq=I.bits=I.struct=I.f64be=I.f64=I.f32be=I.f32=I.ns64be=I.s48be=I.s40be=I.s32be=I.s24be=I.s16be=I.ns64=I.s48=I.s40=I.s32=I.s24=void 0;var yu=be("buffer");function bs(n){if(!(n instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}I.checkUint8Array=bs;function Le(n){return bs(n),yu.Buffer.from(n.buffer,n.byteOffset,n.length)}I.uint8ArrayToBuffer=Le;var Te=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){let t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}};I.Layout=Te;function mu(n,e){return e.property?n+"["+e.property+"]":n}I.nameWithProperty=mu;function Gb(n,e){if(typeof n!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(n,"layout_"))throw new Error("Class is already bound to a layout");if(!(e&&e instanceof Te))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(e,"boundConstructor_"))throw new Error("layout is already bound to a constructor");n.layout_=e,e.boundConstructor_=n,e.makeDestinationObject=()=>new n,Object.defineProperty(n.prototype,"encode",{value(t,r){return e.encode(this,t,r)},writable:!0}),Object.defineProperty(n,"decode",{value(t,r){return e.decode(t,r)},writable:!0})}I.bindConstructorLayout=Gb;var wt=class extends Te{isCount(){throw new Error("ExternalLayout is abstract")}};I.ExternalLayout=wt;var Zi=class extends wt{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){bs(e);let r=e.length-t;return Math.floor(r/this.elementSpan)}encode(e,t,r){return 0}};I.GreedyCount=Zi;var no=class extends wt{constructor(e,t=0,r){if(!(e instanceof Te))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 It||this.layout instanceof Dt}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)}};I.OffsetLayout=no;var It=class extends Te{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return Le(e).readUIntLE(t,this.span)}encode(e,t,r=0){return Le(t).writeUIntLE(e,r,this.span),this.span}};I.UInt=It;var Dt=class extends Te{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return Le(e).readUIntBE(t,this.span)}encode(e,t,r=0){return Le(t).writeUIntBE(e,r,this.span),this.span}};I.UIntBE=Dt;var Dr=class extends Te{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return Le(e).readIntLE(t,this.span)}encode(e,t,r=0){return Le(t).writeIntLE(e,r,this.span),this.span}};I.Int=Dr;var an=class extends Te{constructor(e,t){if(super(e,t),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(e,t=0){return Le(e).readIntBE(t,this.span)}encode(e,t,r=0){return Le(t).writeIntBE(e,r,this.span),this.span}};I.IntBE=an;var pu=Math.pow(2,32);function pa(n){let e=Math.floor(n/pu),t=n-e*pu;return{hi32:e,lo32:t}}function ya(n,e){return n*pu+e}var Ji=class extends Te{constructor(e){super(8,e)}decode(e,t=0){let r=Le(e),o=r.readUInt32LE(t),s=r.readUInt32LE(t+4);return ya(s,o)}encode(e,t,r=0){let o=pa(e),s=Le(t);return s.writeUInt32LE(o.lo32,r),s.writeUInt32LE(o.hi32,r+4),8}};I.NearUInt64=Ji;var Qi=class extends Te{constructor(e){super(8,e)}decode(e,t=0){let r=Le(e),o=r.readUInt32BE(t),s=r.readUInt32BE(t+4);return ya(o,s)}encode(e,t,r=0){let o=pa(e),s=Le(t);return s.writeUInt32BE(o.hi32,r),s.writeUInt32BE(o.lo32,r+4),8}};I.NearUInt64BE=Qi;var ea=class extends Te{constructor(e){super(8,e)}decode(e,t=0){let r=Le(e),o=r.readUInt32LE(t),s=r.readInt32LE(t+4);return ya(s,o)}encode(e,t,r=0){let o=pa(e),s=Le(t);return s.writeUInt32LE(o.lo32,r),s.writeInt32LE(o.hi32,r+4),8}};I.NearInt64=ea;var ta=class extends Te{constructor(e){super(8,e)}decode(e,t=0){let r=Le(e),o=r.readInt32BE(t),s=r.readUInt32BE(t+4);return ya(o,s)}encode(e,t,r=0){let o=pa(e),s=Le(t);return s.writeInt32BE(o.hi32,r),s.writeUInt32BE(o.lo32,r+4),8}};I.NearInt64BE=ta;var ra=class extends Te{constructor(e){super(4,e)}decode(e,t=0){return Le(e).readFloatLE(t)}encode(e,t,r=0){return Le(t).writeFloatLE(e,r),4}};I.Float=ra;var na=class extends Te{constructor(e){super(4,e)}decode(e,t=0){return Le(e).readFloatBE(t)}encode(e,t,r=0){return Le(t).writeFloatBE(e,r),4}};I.FloatBE=na;var sa=class extends Te{constructor(e){super(8,e)}decode(e,t=0){return Le(e).readDoubleLE(t)}encode(e,t,r=0){return Le(t).writeDoubleLE(e,r),8}};I.Double=sa;var oa=class extends Te{constructor(e){super(8,e)}decode(e,t=0){return Le(e).readDoubleBE(t)}encode(e,t,r=0){return Le(t).writeDoubleBE(e,r),8}};I.DoubleBE=oa;var ia=class extends Te{constructor(e,t,r){if(!(e instanceof Te))throw new TypeError("elementLayout must be a Layout");if(!(t instanceof wt&&t.isCount()||Number.isInteger(t)&&0<=t))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let o=-1;!(t instanceof wt)&&0<e.span&&(o=t*e.span),super(o,r),this.elementLayout=e,this.count=t}getSpan(e,t=0){if(0<=this.span)return this.span;let r=0,o=this.count;if(o instanceof wt&&(o=o.decode(e,t)),0<this.elementLayout.span)r=o*this.elementLayout.span;else{let s=0;for(;s<o;)r+=this.elementLayout.getSpan(e,t+r),++s}return r}decode(e,t=0){let r=[],o=0,s=this.count;for(s instanceof wt&&(s=s.decode(e,t));o<s;)r.push(this.elementLayout.decode(e,t)),t+=this.elementLayout.getSpan(e,t),o+=1;return r}encode(e,t,r=0){let o=this.elementLayout,s=e.reduce((i,c)=>i+o.encode(c,t,r+i),0);return this.count instanceof wt&&this.count.encode(e.length,t,r),s}};I.Sequence=ia;var aa=class extends Te{constructor(e,t,r){if(!(Array.isArray(e)&&e.reduce((s,i)=>s&&i instanceof Te,!0)))throw new TypeError("fields must be array of Layout instances");typeof t=="boolean"&&r===void 0&&(r=t,t=void 0);for(let s of e)if(0>s.span&&s.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let o=-1;try{o=e.reduce((s,i)=>s+i.getSpan(),0)}catch{}super(o,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((o,s)=>{let i=s.getSpan(e,t);return t+=i,o+i},0)}catch{throw new RangeError("indeterminate span")}return r}decode(e,t=0){bs(e);let r=this.makeDestinationObject();for(let o of this.fields)if(o.property!==void 0&&(r[o.property]=o.decode(e,t)),t+=o.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return r}encode(e,t,r=0){let o=r,s=0,i=0;for(let c of this.fields){let u=c.span;if(i=0<u?u:0,c.property!==void 0){let h=e[c.property];h!==void 0&&(i=c.encode(h,t,r),0>u&&(u=c.getSpan(t,r)))}s=r,r+=u}return s+i-o}fromArray(e){let t=this.makeDestinationObject();for(let r of this.fields)r.property!==void 0&&0<e.length&&(t[r.property]=e.shift());return t}layoutFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(let t of this.fields)if(t.property===e)return t}offsetOf(e){if(typeof e!="string")throw new TypeError("property must be string");let t=0;for(let r of this.fields){if(r.property===e)return t;0>r.span?t=-1:0<=t&&(t+=r.span)}}};I.Structure=aa;var so=class{constructor(e){this.property=e}decode(e,t){throw new Error("UnionDiscriminator is abstract")}encode(e,t,r){throw new Error("UnionDiscriminator is abstract")}};I.UnionDiscriminator=so;var gs=class extends so{constructor(e,t){if(!(e instanceof wt&&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)}};I.UnionLayoutDiscriminator=gs;var oo=class extends Te{constructor(e,t,r){let o;if(e instanceof It||e instanceof Dt)o=new gs(new no(e));else if(e instanceof wt&&e.isCount())o=new gs(e);else if(e instanceof so)o=e;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(t===void 0&&(t=null),!(t===null||t instanceof Te))throw new TypeError("defaultLayout must be null or a Layout");if(t!==null){if(0>t.span)throw new Error("defaultLayout must have constant span");t.property===void 0&&(t=t.replicate("content"))}let s=-1;t&&(s=t.span,0<=s&&(e instanceof It||e instanceof Dt)&&(s+=o.layout.span)),super(s,r),this.discriminator=o,this.usesPrefixDiscriminator=e instanceof It||e instanceof Dt,this.defaultLayout=t,this.registry={};let i=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(c){return i(c)},this.configGetSourceVariant=function(c){i=c.bind(this)}}getSpan(e,t=0){if(0<=this.span)return this.span;let 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;let t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(let t in this.registry){let 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,o=this.discriminator,s=o.decode(e,t),i=this.registry[s];if(i===void 0){let c=this.defaultLayout,u=0;this.usesPrefixDiscriminator&&(u=o.layout.span),r=this.makeDestinationObject(),r[o.property]=s,r[c.property]=c.decode(e,t+u)}else r=i.decode(e,t);return r}encode(e,t,r=0){let o=this.getSourceVariant(e);if(o===void 0){let s=this.discriminator,i=this.defaultLayout,c=0;return this.usesPrefixDiscriminator&&(c=s.layout.span),s.encode(e[s.property],t,r),c+i.encode(e[i.property],t,r+c)}return o.encode(e,t,r)}addVariant(e,t,r){let o=new ca(this,e,t,r);return this.registry[e]=o,o}getVariant(e,t=0){let r;return e instanceof Uint8Array?r=this.discriminator.decode(e,t):r=e,this.registry[r]}};I.Union=oo;var ca=class extends Te{constructor(e,t,r,o){if(!(e instanceof oo))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(typeof r=="string"&&o===void 0&&(o=r,r=null),r){if(!(r instanceof Te))throw new TypeError("layout must be a Layout");if(e.defaultLayout!==null&&0<=r.span&&r.span>e.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof o!="string")throw new TypeError("variant must have a String property")}let s=e.span;0>e.span&&(s=r?r.span:0,0<=s&&e.usesPrefixDiscriminator&&(s+=e.discriminator.layout.span)),super(s,o),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 o=0;return this.layout&&(o=this.layout.getSpan(e,t+r)),r+o}decode(e,t=0){let r=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))throw new Error("variant mismatch");let o=0;return this.union.usesPrefixDiscriminator&&(o=this.union.discriminator.layout.span),this.layout?r[this.property]=this.layout.decode(e,t+o):this.property?r[this.property]=!0:this.union.usesPrefixDiscriminator&&(r[this.union.discriminator.property]=this.variant),r}encode(e,t,r=0){let o=0;if(this.union.usesPrefixDiscriminator&&(o=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 s=o;if(this.layout&&(this.layout.encode(e[this.property],t,r+o),s+=this.layout.getSpan(t,r+o),0<=this.union.span&&s>this.union.span))throw new Error("encoded variant overruns containing union");return s}fromArray(e){if(this.layout)return this.layout.fromArray(e)}};I.VariantLayout=ca;function ms(n){return 0>n&&(n+=4294967296),n}var io=class extends Te{constructor(e,t,r){if(!(e instanceof It||e instanceof Dt))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof t=="string"&&r===void 0&&(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 o=0;this._packedSetValue=function(s){return o=ms(s),this},this._packedGetValue=function(){return o}}decode(e,t=0){let r=this.makeDestinationObject(),o=this.word.decode(e,t);this._packedSetValue(o);for(let s of this.fields)s.property!==void 0&&(r[s.property]=s.decode(e));return r}encode(e,t,r=0){let o=this.word.decode(t,r);this._packedSetValue(o);for(let s of this.fields)if(s.property!==void 0){let i=e[s.property];i!==void 0&&s.encode(i)}return this.word.encode(this._packedGetValue(),t,r)}addField(e,t){let r=new ao(this,e,t);return this.fields.push(r),r}addBoolean(e){let t=new ua(this,e);return this.fields.push(t),t}fieldFor(e){if(typeof e!="string")throw new TypeError("property must be string");for(let t of this.fields)if(t.property===e)return t}};I.BitStructure=io;var ao=class{constructor(e,t,r){if(!(e instanceof io))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(t)||0>=t)throw new TypeError("bits must be positive integer");let o=8*e.span,s=e.fields.reduce((i,c)=>i+c.bits,0);if(t+s>o)throw new Error("bits too long for span remainder ("+(o-s)+" of "+o+" remain)");this.container=e,this.bits=t,this.valueMask=(1<<t)-1,t===32&&(this.valueMask=4294967295),this.start=s,this.container.msb&&(this.start=o-s-t),this.wordMask=ms(this.valueMask<<this.start),this.property=r}decode(e,t){let r=this.container._packedGetValue();return ms(r&this.wordMask)>>>this.start}encode(e){if(typeof e!="number"||!Number.isInteger(e)||e!==ms(e&this.valueMask))throw new TypeError(mu("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);let t=this.container._packedGetValue(),r=ms(e<<this.start);this.container._packedSetValue(ms(t&~this.wordMask)|r)}};I.BitField=ao;var ua=class extends ao{constructor(e,t){super(e,1,t)}decode(e,t){return!!super.decode(e,t)}encode(e){typeof e=="boolean"&&(e=+e),super.encode(e)}};I.Boolean=ua;var la=class extends Te{constructor(e,t){if(!(e instanceof wt&&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 wt||(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)),Le(e).slice(t,t+r)}encode(e,t,r){let o=this.length;if(this.length instanceof wt&&(o=e.length),!(e instanceof Uint8Array&&o===e.length))throw new TypeError(mu("Blob.encode",this)+" requires (length "+o+") Uint8Array as src");if(r+o>t.length)throw new RangeError("encoding overruns Uint8Array");let s=Le(e);return Le(t).write(s.toString("hex"),r,o,"hex"),this.length instanceof wt&&this.length.encode(o,t,r),o}};I.Blob=la;var fa=class extends Te{constructor(e){super(-1,e)}getSpan(e,t=0){bs(e);let r=t;for(;r<e.length&&e[r]!==0;)r+=1;return 1+r-t}decode(e,t=0){let r=this.getSpan(e,t);return Le(e).slice(t,t+r-1).toString("utf-8")}encode(e,t,r=0){typeof e!="string"&&(e=String(e));let o=yu.Buffer.from(e,"utf8"),s=o.length;if(r+s>t.length)throw new RangeError("encoding overruns Buffer");let i=Le(t);return o.copy(i,r),i[r+s]=0,s+1}};I.CString=fa;var da=class extends Te{constructor(e,t){if(typeof e=="string"&&t===void 0&&(t=e,e=void 0),e===void 0)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 bs(e),e.length-t}decode(e,t=0){let r=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpan<r)throw new RangeError("text length exceeds maxSpan");return Le(e).slice(t,t+r).toString("utf-8")}encode(e,t,r=0){typeof e!="string"&&(e=String(e));let o=yu.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(Le(t),r),s}};I.UTF8=da;var ha=class extends Te{constructor(e,t){super(0,t),this.value=e}decode(e,t){return this.value}encode(e,t,r){return 0}};I.Constant=ha;I.greedy=(n,e)=>new Zi(n,e);I.offset=(n,e,t)=>new no(n,e,t);I.u8=n=>new It(1,n);I.u16=n=>new It(2,n);I.u24=n=>new It(3,n);I.u32=n=>new It(4,n);I.u40=n=>new It(5,n);I.u48=n=>new It(6,n);I.nu64=n=>new Ji(n);I.u16be=n=>new Dt(2,n);I.u24be=n=>new Dt(3,n);I.u32be=n=>new Dt(4,n);I.u40be=n=>new Dt(5,n);I.u48be=n=>new Dt(6,n);I.nu64be=n=>new Qi(n);I.s8=n=>new Dr(1,n);I.s16=n=>new Dr(2,n);I.s24=n=>new Dr(3,n);I.s32=n=>new Dr(4,n);I.s40=n=>new Dr(5,n);I.s48=n=>new Dr(6,n);I.ns64=n=>new ea(n);I.s16be=n=>new an(2,n);I.s24be=n=>new an(3,n);I.s32be=n=>new an(4,n);I.s40be=n=>new an(5,n);I.s48be=n=>new an(6,n);I.ns64be=n=>new ta(n);I.f32=n=>new ra(n);I.f32be=n=>new na(n);I.f64=n=>new sa(n);I.f64be=n=>new oa(n);I.struct=(n,e,t)=>new aa(n,e,t);I.bits=(n,e,t)=>new io(n,e,t);I.seq=(n,e,t)=>new ia(n,e,t);I.union=(n,e,t)=>new oo(n,e,t);I.unionLayoutDiscriminator=(n,e)=>new gs(n,e);I.blob=(n,e)=>new la(n,e);I.cstr=n=>new fa(n);I.utf8=(n,e)=>new da(n,e);I.constant=(n,e)=>new ha(n,e)});var uh=pe((Hk,ch)=>{var ma=be("path").sep||"/";ch.exports=Yb;function Yb(n){if(typeof n!="string"||n.length<=7||n.substring(0,7)!="file://")throw new TypeError("must pass in a file:// URI to convert to a file path");var e=decodeURI(n.substring(7)),t=e.indexOf("/"),r=e.substring(0,t),o=e.substring(t+1);return r=="localhost"&&(r=""),r&&(r=ma+ma+r),o=o.replace(/^(.+)\|/,"$1:"),ma=="\\"&&(o=o.replace(/\//g,"\\")),/^.+\:/.test(o)||(o=ma+o),r+o}});var hh=pe((ws,dh)=>{var bu=be("fs"),ba=be("path"),Xb=uh(),ga=ba.join,Zb=ba.dirname,lh=bu.accessSync&&function(n){try{bu.accessSync(n)}catch{return!1}return!0}||bu.existsSync||ba.existsSync,fh={arrow:process.env.NODE_BINDINGS_ARROW||" \u2192 ",compiled:process.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:process.platform,arch:process.arch,nodePreGyp:"node-v"+process.versions.modules+"-"+process.platform+"-"+process.arch,version:process.versions.node,bindings:"bindings.node",try:[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"],["module_root","addon-build","release","install-root","bindings"],["module_root","addon-build","debug","install-root","bindings"],["module_root","addon-build","default","install-root","bindings"],["module_root","lib","binding","nodePreGyp","bindings"]]};function Jb(n){typeof n=="string"?n={bindings:n}:n||(n={}),Object.keys(fh).map(function(u){u in n||(n[u]=fh[u])}),n.module_root||(n.module_root=ws.getRoot(ws.getFileName())),ba.extname(n.bindings)!=".node"&&(n.bindings+=".node");for(var e=typeof __webpack_require__=="function"?__non_webpack_require__:be,t=[],r=0,o=n.try.length,s,i,c;r<o;r++){s=ga.apply(null,n.try[r].map(function(u){return n[u]||u})),t.push(s);try{return i=n.path?e.resolve(s):e(s),n.path||(i.path=s),i}catch(u){if(u.code!=="MODULE_NOT_FOUND"&&u.code!=="QUALIFIED_PATH_RESOLUTION_FAILED"&&!/not find/i.test(u.message))throw u}}throw c=new Error(`Could not locate the bindings file. Tried:
3
3
  `+t.map(function(u){return n.arrow+u}).join(`
4
4
  `)),c.tries=t,c}dh.exports=ws=Jb;ws.getFileName=function(e){var t=Error.prepareStackTrace,r=Error.stackTraceLimit,o={},s;Error.stackTraceLimit=10,Error.prepareStackTrace=function(c,u){for(var h=0,f=u.length;h<f;h++)if(s=u[h].getFileName(),s!==__filename)if(e){if(s!==e)return}else return},Error.captureStackTrace(o),o.stack,Error.prepareStackTrace=t,Error.stackTraceLimit=r;var i="file://";return s.indexOf(i)===0&&(s=Xb(s)),s};ws.getRoot=function(e){for(var t=Zb(e),r;;){if(t==="."&&(t=process.cwd()),lh(ga(t,"package.json"))||lh(ga(t,"node_modules")))return t;if(r===t)throw new Error('Could not find module root given file: "'+e+'". Do you have a `package.json` file? ');r=t,t=ga(t,"..")}}});var ph=pe(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});var Fr;try{Fr=hh()("bigint_buffer")}catch{console.warn("bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?)")}function Qb(n){if(Fr===void 0){let e=Buffer.from(n);e.reverse();let t=e.toString("hex");return t.length===0?BigInt(0):BigInt(`0x${t}`)}return Fr.toBigInt(n,!1)}_s.toBigIntLE=Qb;function ew(n){if(Fr===void 0){let e=n.toString("hex");return e.length===0?BigInt(0):BigInt(`0x${e}`)}return Fr.toBigInt(n,!0)}_s.toBigIntBE=ew;function tw(n,e){if(Fr===void 0){let t=n.toString(16),r=Buffer.from(t.padStart(e*2,"0").slice(0,e*2),"hex");return r.reverse(),r}return Fr.fromBigInt(n,Buffer.allocUnsafe(e),!1)}_s.toBufferLE=tw;function rw(n,e){if(Fr===void 0){let t=n.toString(16);return Buffer.from(t.padStart(e*2,"0").slice(0,e*2),"hex")}return Fr.fromBigInt(n,Buffer.allocUnsafe(e),!0)}_s.toBufferBE=rw});function nw(n){return cn(n)&&typeof n[Symbol.iterator]=="function"}function cn(n){return typeof n=="object"&&n!=null}function or(n){return typeof n=="string"?JSON.stringify(n):""+n}function sw(n){let{done:e,value:t}=n.next();return e?void 0:t}function ow(n,e,t,r){if(n===!0)return;n===!1?n={}:typeof n=="string"&&(n={message:n});let{path:o,branch:s}=e,{type:i}=t,{refinement:c,message:u="Expected a value of type `"+i+"`"+(c?" with refinement `"+c+"`":"")+", but received: `"+or(r)+"`"}=n;return{value:r,type:i,refinement:c,key:o[o.length-1],path:o,branch:s,...n,message:u}}function*yh(n,e,t,r){nw(n)||(n=[n]);for(let o of n){let s=ow(o,e,t,r);s&&(yield s)}}function*_u(n,e,t={}){let{path:r=[],branch:o=[n],coerce:s=!1,mask:i=!1}=t,c={path:r,branch:o};if(s&&(n=e.coercer(n,c),i&&e.type!=="type"&&cn(e.schema)&&cn(n)&&!Array.isArray(n)))for(let h in n)e.schema[h]===void 0&&delete n[h];let u=!0;for(let h of e.validator(n,c))u=!1,yield[h,void 0];for(let[h,f,y]of e.entries(n,c)){let S=_u(f,y,{path:h===void 0?r:[...r,h],branch:h===void 0?o:[...o,f],coerce:s,mask:i});for(let g of S)g[0]?(u=!1,yield[g[0],void 0]):s&&(f=g[1],h===void 0?n=f:n instanceof Map?n.set(h,f):n instanceof Set?n.add(f):cn(n)&&(n[h]=f))}if(u)for(let h of e.refiner(n,c))u=!1,yield[h,void 0];u&&(yield[void 0,n])}function Su(n,e){let t=co(n,e);if(t[0])throw t[0]}function W(n,e){let t=co(n,e,{coerce:!0});if(t[0])throw t[0];return t[1]}function iw(n,e){let t=co(n,e,{coerce:!0,mask:!0});if(t[0])throw t[0];return t[1]}function mh(n,e){return!co(n,e)[0]}function co(n,e,t={}){let r=_u(n,e,t),o=sw(r);return o[0]?[new wu(o[0],function*(){for(let i of r)i[0]&&(yield i[0])}),void 0]:[void 0,o[1]]}function qn(n,e){return new jt({type:n,schema:null,validator:e})}function gh(){return qn("any",()=>!0)}function j(n){return new jt({type:"array",schema:n,*entries(e){if(n&&Array.isArray(e))for(let[t,r]of e.entries())yield[t,r,n]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||"Expected an array value, but received: "+or(e)}})}function ir(){return qn("boolean",n=>typeof n=="boolean")}function wa(n){return qn("instance",e=>e instanceof n||"Expected a `"+n.name+"` instance, but received: "+or(e))}function Ge(n){let e=or(n),t=typeof n;return new jt({type:"literal",schema:t==="string"||t==="number"||t==="boolean"?n:null,validator(r){return r===n||"Expected the literal `"+e+"`, but received: "+or(r)}})}function aw(){return qn("never",()=>!1)}function V(n){return new jt({...n,validator:(e,t)=>e===null||n.validator(e,t),refiner:(e,t)=>e===null||n.refiner(e,t)})}function E(){return qn("number",n=>typeof n=="number"&&!isNaN(n)||"Expected a number, but received: "+or(n))}function oe(n){return new jt({...n,validator:(e,t)=>e===void 0||n.validator(e,t),refiner:(e,t)=>e===void 0||n.refiner(e,t)})}function xu(n,e){return new jt({type:"record",schema:null,*entries(t){if(cn(t))for(let r in t){let o=t[r];yield[r,r,n],yield[r,o,e]}},validator(t){return cn(t)||"Expected an object, but received: "+or(t)}})}function q(){return qn("string",n=>typeof n=="string"||"Expected a string, but received: "+or(n))}function _a(n){let e=aw();return new jt({type:"tuple",schema:null,*entries(t){if(Array.isArray(t)){let r=Math.max(n.length,t.length);for(let o=0;o<r;o++)yield[o,t[o],n[o]||e]}},validator(t){return Array.isArray(t)||"Expected an array, but received: "+or(t)}})}function N(n){let e=Object.keys(n);return new jt({type:"type",schema:n,*entries(t){if(cn(t))for(let r of e)yield[r,t[r],n[r]]},validator(t){return cn(t)||"Expected an object, but received: "+or(t)}})}function kt(n){let e=n.map(t=>t.type).join(" | ");return new jt({type:"union",schema:null,validator(t,r){let o=[];for(let s of n){let[...i]=_u(t,s,r),[c]=i;if(c[0])for(let[u]of i)u&&o.push(u);else return[]}return["Expected the value to satisfy a union of `"+e+"`, but received: "+or(t),...o]}})}function Ss(){return qn("unknown",()=>!0)}function xs(n,e,t){return new jt({...n,coercer:(r,o)=>mh(r,e)?n.coercer(t(r,o),o):n.coercer(r,o)})}var wu,jt,bh=qe(()=>{wu=class extends TypeError{constructor(e,t){let r,{message:o,...s}=e,{path:i}=e,c=i.length===0?o:"At path: "+i.join(".")+" -- "+o;super(c),Object.assign(this,s),this.name=this.constructor.name,this.failures=()=>{var u;return(u=r)!=null?u:r=[e,...t()]}}};jt=class{constructor(e){let{type:t,schema:r,validator:o,refiner:s,coercer:i=u=>u,entries:c=function*(){}}=e;this.type=t,this.schema=r,this.entries=c,this.coercer=i,o?this.validator=(u,h)=>{let f=o(u,h);return yh(f,h,this,u)}:this.validator=()=>[],s?this.refiner=(u,h)=>{let f=s(u,h);return yh(f,h,this,u)}:this.refiner=()=>[]}assert(e){return Su(e,this)}create(e){return W(e,this)}is(e){return mh(e,this)}mask(e){return iw(e,this)}validate(e,t={}){return co(e,this,t)}}});import cw from"crypto";function uo(){return Sa>xa.length-16&&(cw.randomFillSync(xa),Sa=0),xa.slice(Sa,Sa+=16)}var xa,Sa,vu=qe(()=>{xa=new Uint8Array(256),Sa=xa.length});var wh,_h=qe(()=>{wh=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i});function uw(n){return typeof n=="string"&&wh.test(n)}var un,lo=qe(()=>{_h();un=uw});function lw(n,e=0){let t=(bt[n[e+0]]+bt[n[e+1]]+bt[n[e+2]]+bt[n[e+3]]+"-"+bt[n[e+4]]+bt[n[e+5]]+"-"+bt[n[e+6]]+bt[n[e+7]]+"-"+bt[n[e+8]]+bt[n[e+9]]+"-"+bt[n[e+10]]+bt[n[e+11]]+bt[n[e+12]]+bt[n[e+13]]+bt[n[e+14]]+bt[n[e+15]]).toLowerCase();if(!un(t))throw TypeError("Stringified UUID is invalid");return t}var bt,ln,fo=qe(()=>{lo();bt=[];for(let n=0;n<256;++n)bt.push((n+256).toString(16).substr(1));ln=lw});function fw(n,e,t){let r=e&&t||0,o=e||new Array(16);n=n||{};let s=n.node||Sh,i=n.clockseq!==void 0?n.clockseq:ku;if(s==null||i==null){let S=n.random||(n.rng||uo)();s==null&&(s=Sh=[S[0]|1,S[1],S[2],S[3],S[4],S[5]]),i==null&&(i=ku=(S[6]<<8|S[7])&16383)}let c=n.msecs!==void 0?n.msecs:Date.now(),u=n.nsecs!==void 0?n.nsecs:Au+1,h=c-Eu+(u-Au)/1e4;if(h<0&&n.clockseq===void 0&&(i=i+1&16383),(h<0||c>Eu)&&n.nsecs===void 0&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Eu=c,Au=u,ku=i,c+=122192928e5;let f=((c&268435455)*1e4+u)%4294967296;o[r++]=f>>>24&255,o[r++]=f>>>16&255,o[r++]=f>>>8&255,o[r++]=f&255;let y=c/4294967296*1e4&268435455;o[r++]=y>>>8&255,o[r++]=y&255,o[r++]=y>>>24&15|16,o[r++]=y>>>16&255,o[r++]=i>>>8|128,o[r++]=i&255;for(let S=0;S<6;++S)o[r+S]=s[S];return e||ln(o)}var Sh,ku,Eu,Au,xh,vh=qe(()=>{vu();fo();Eu=0,Au=0;xh=fw});function dw(n){if(!un(n))throw TypeError("Invalid UUID");let e,t=new Uint8Array(16);return t[0]=(e=parseInt(n.slice(0,8),16))>>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t[4]=(e=parseInt(n.slice(9,13),16))>>>8,t[5]=e&255,t[6]=(e=parseInt(n.slice(14,18),16))>>>8,t[7]=e&255,t[8]=(e=parseInt(n.slice(19,23),16))>>>8,t[9]=e&255,t[10]=(e=parseInt(n.slice(24,36),16))/1099511627776&255,t[11]=e/4294967296&255,t[12]=e>>>24&255,t[13]=e>>>16&255,t[14]=e>>>8&255,t[15]=e&255,t}var va,Iu=qe(()=>{lo();va=dw});function hw(n){n=unescape(encodeURIComponent(n));let e=[];for(let t=0;t<n.length;++t)e.push(n.charCodeAt(t));return e}function ka(n,e,t){function r(o,s,i,c){if(typeof o=="string"&&(o=hw(o)),typeof s=="string"&&(s=va(s)),s.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+o.length);if(u.set(s),u.set(o,s.length),u=t(u),u[6]=u[6]&15|e,u[8]=u[8]&63|128,i){c=c||0;for(let h=0;h<16;++h)i[c+h]=u[h];return i}return ln(u)}try{r.name=n}catch{}return r.DNS=pw,r.URL=yw,r}var pw,yw,Bu=qe(()=>{fo();Iu();pw="6ba7b810-9dad-11d1-80b4-00c04fd430c8",yw="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});import mw from"crypto";function gw(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),mw.createHash("md5").update(n).digest()}var kh,Eh=qe(()=>{kh=gw});var bw,Ah,Ih=qe(()=>{Bu();Eh();bw=ka("v3",48,kh),Ah=bw});function ww(n,e,t){n=n||{};let r=n.random||(n.rng||uo)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){t=t||0;for(let o=0;o<16;++o)e[t+o]=r[o];return e}return ln(r)}var Bh,Lh=qe(()=>{vu();fo();Bh=ww});import _w from"crypto";function Sw(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),_w.createHash("sha1").update(n).digest()}var Rh,Ch=qe(()=>{Rh=Sw});var xw,Th,Ph=qe(()=>{Bu();Ch();xw=ka("v5",80,Rh),Th=xw});var Oh,Nh=qe(()=>{Oh="00000000-0000-0000-0000-000000000000"});function vw(n){if(!un(n))throw TypeError("Invalid UUID");return parseInt(n.substr(14,1),16)}var Uh,Dh=qe(()=>{lo();Uh=vw});var Lu={};fs(Lu,{NIL:()=>Oh,parse:()=>va,stringify:()=>ln,v1:()=>xh,v3:()=>Ah,v4:()=>Bh,v5:()=>Th,validate:()=>un,version:()=>Uh});var Ru=qe(()=>{vh();Ih();Lh();Ph();Nh();Dh();lo();fo();Iu()});var Mh=pe((NE,Fh)=>{"use strict";var kw=(Ru(),Qs(Lu)).v4,Ew=function(n,e,t,r){if(typeof n!="string")throw new TypeError(n+" must be a string");r=r||{};let o=typeof r.version=="number"?r.version:2;if(o!==1&&o!==2)throw new TypeError(o+" must be 1 or 2");let s={method:n};if(o===2&&(s.jsonrpc="2.0"),e){if(typeof e!="object"&&!Array.isArray(e))throw new TypeError(e+" must be an object, array or omitted");s.params=e}if(typeof t>"u"){let i=typeof r.generator=="function"?r.generator:function(){return kw()};s.id=i(s,r)}else o===2&&t===null?r.notificationIdNull&&(s.id=null):s.id=t;return s};Fh.exports=Ew});var zh=pe((UE,qh)=>{"use strict";var Aw=(Ru(),Qs(Lu)).v4,Iw=Mh(),ho=function(n,e){if(!(this instanceof ho))return new ho(n,e);e||(e={}),this.options={reviver:typeof e.reviver<"u"?e.reviver:null,replacer:typeof e.replacer<"u"?e.replacer:null,generator:typeof e.generator<"u"?e.generator:function(){return Aw()},version:typeof e.version<"u"?e.version:2,notificationIdNull:typeof e.notificationIdNull=="boolean"?e.notificationIdNull:!1},this.callServer=n};qh.exports=ho;ho.prototype.request=function(n,e,t,r){let o=this,s=null,i=Array.isArray(n)&&typeof e=="function";if(this.options.version===1&&i)throw new TypeError("JSON-RPC 1.0 does not support batching");if(i||!i&&n&&typeof n=="object"&&typeof e=="function")r=e,s=n;else{typeof t=="function"&&(r=t,t=void 0);let h=typeof r=="function";try{s=Iw(n,e,t,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(f){if(h)return r(f);throw f}if(!h)return s}let u;try{u=JSON.stringify(s,this.options.replacer)}catch(h){return r(h)}return this.callServer(u,function(h,f){o._parseResponse(h,f,r)}),s};ho.prototype._parseResponse=function(n,e,t){if(n){t(n);return}if(!e)return t();let r;try{r=JSON.parse(e,this.options.reviver)}catch(o){return t(o)}if(t.length===3)if(Array.isArray(r)){let o=function(i){return typeof i.error<"u"},s=function(i){return!o(i)};return t(null,r.filter(o),r.filter(s))}else return t(null,r.error,r.result);t(null,r)}});var Aa=pe((DE,Cu)=>{"use strict";var Bw=Object.prototype.hasOwnProperty,Et="~";function po(){}Object.create&&(po.prototype=Object.create(null),new po().__proto__||(Et=!1));function Lw(n,e,t){this.fn=n,this.context=e,this.once=t||!1}function $h(n,e,t,r,o){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new Lw(t,r||n,o),i=Et?Et+e:e;return n._events[i]?n._events[i].fn?n._events[i]=[n._events[i],s]:n._events[i].push(s):(n._events[i]=s,n._eventsCount++),n}function Ea(n,e){--n._eventsCount===0?n._events=new po:delete n._events[e]}function _t(){this._events=new po,this._eventsCount=0}_t.prototype.eventNames=function(){var e=[],t,r;if(this._eventsCount===0)return e;for(r in t=this._events)Bw.call(t,r)&&e.push(Et?r.slice(1):r);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};_t.prototype.listeners=function(e){var t=Et?Et+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,s=r.length,i=new Array(s);o<s;o++)i[o]=r[o].fn;return i};_t.prototype.listenerCount=function(e){var t=Et?Et+e:e,r=this._events[t];return r?r.fn?1:r.length:0};_t.prototype.emit=function(e,t,r,o,s,i){var c=Et?Et+e:e;if(!this._events[c])return!1;var u=this._events[c],h=arguments.length,f,y;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,o),!0;case 5:return u.fn.call(u.context,t,r,o,s),!0;case 6:return u.fn.call(u.context,t,r,o,s,i),!0}for(y=1,f=new Array(h-1);y<h;y++)f[y-1]=arguments[y];u.fn.apply(u.context,f)}else{var S=u.length,g;for(y=0;y<S;y++)switch(u[y].once&&this.removeListener(e,u[y].fn,void 0,!0),h){case 1:u[y].fn.call(u[y].context);break;case 2:u[y].fn.call(u[y].context,t);break;case 3:u[y].fn.call(u[y].context,t,r);break;case 4:u[y].fn.call(u[y].context,t,r,o);break;default:if(!f)for(g=1,f=new Array(h-1);g<h;g++)f[g-1]=arguments[g];u[y].fn.apply(u[y].context,f)}}return!0};_t.prototype.on=function(e,t,r){return $h(this,e,t,r,!1)};_t.prototype.once=function(e,t,r){return $h(this,e,t,r,!0)};_t.prototype.removeListener=function(e,t,r,o){var s=Et?Et+e:e;if(!this._events[s])return this;if(!t)return Ea(this,s),this;var i=this._events[s];if(i.fn)i.fn===t&&(!o||i.once)&&(!r||i.context===r)&&Ea(this,s);else{for(var c=0,u=[],h=i.length;c<h;c++)(i[c].fn!==t||o&&!i[c].once||r&&i[c].context!==r)&&u.push(i[c]);u.length?this._events[s]=u.length===1?u[0]:u:Ea(this,s)}return this};_t.prototype.removeAllListeners=function(e){var t;return e?(t=Et?Et+e:e,this._events[t]&&Ea(this,t)):(this._events=new po,this._eventsCount=0),this};_t.prototype.off=_t.prototype.removeListener;_t.prototype.addListener=_t.prototype.on;_t.prefixed=Et;_t.EventEmitter=_t;typeof Cu<"u"&&(Cu.exports=_t)});var Wh=pe(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.createError=vs.DefaultDataPack=void 0;var Rw=new Map([[-32e3,"Event not provided"],[-32600,"Invalid Request"],[-32601,"Method not found"],[-32602,"Invalid params"],[-32603,"Internal error"],[-32604,"Params not found"],[-32605,"Method forbidden"],[-32606,"Event forbidden"],[-32700,"Parse error"]]),Tu=class{encode(e){return JSON.stringify(e)}decode(e){return JSON.parse(e)}};vs.DefaultDataPack=Tu;function Cw(n,e){let t={code:n,message:Rw.get(n)||"Internal Server Error"};return e&&(t.data=e),t}vs.createError=Cw});var Kh=pe(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});var Tw=Aa(),Pw=Wh(),Pu=class extends Tw.EventEmitter{address;rpc_id;queue;options;autoconnect;ready;reconnect;reconnect_timer_id;reconnect_interval;max_reconnects;rest_options;current_reconnects;generate_request_id;socket;webSocketFactory;dataPack;constructor(e,t="ws://localhost:8080",{autoconnect:r=!0,reconnect:o=!0,reconnect_interval:s=1e3,max_reconnects:i=5,...c}={},u,h){super(),this.webSocketFactory=e,this.queue={},this.rpc_id=0,this.address=t,this.autoconnect=r,this.ready=!1,this.reconnect=o,this.reconnect_timer_id=void 0,this.reconnect_interval=s,this.max_reconnects=i,this.rest_options=c,this.current_reconnects=0,this.generate_request_id=u||(()=>++this.rpc_id),h?this.dataPack=h:this.dataPack=new Pw.DefaultDataPack,this.autoconnect&&this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}connect(){this.socket||this._connect(this.address,{autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects,...this.rest_options})}call(e,t,r,o){return!o&&typeof r=="object"&&(o=r,r=null),new Promise((s,i)=>{if(!this.ready)return i(new Error("socket not ready"));let c=this.generate_request_id(e,t),u={jsonrpc:"2.0",method:e,params:t||void 0,id:c};this.socket.send(this.dataPack.encode(u),o,h=>{if(h)return i(h);this.queue[c]={promise:[s,i]},r&&(this.queue[c].timeout=setTimeout(()=>{delete this.queue[c],i(new Error("reply timeout"))},r))})})}async login(e){let t=await this.call("rpc.login",e);if(!t)throw new Error("authentication failed");return t}async listMethods(){return await this.call("__listMethods")}notify(e,t){return new Promise((r,o)=>{if(!this.ready)return o(new Error("socket not ready"));let s={jsonrpc:"2.0",method:e,params:t};this.socket.send(this.dataPack.encode(s),i=>{if(i)return o(i);r()})})}async subscribe(e){typeof e=="string"&&(e=[e]);let t=await this.call("rpc.on",e);if(typeof e=="string"&&t[e]!=="ok")throw new Error("Failed subscribing to an event '"+e+"' with: "+t[e]);return t}async unsubscribe(e){typeof e=="string"&&(e=[e]);let t=await this.call("rpc.off",e);if(typeof e=="string"&&t[e]!=="ok")throw new Error("Failed unsubscribing from an event with: "+t);return t}close(e,t){this.socket.close(e||1e3,t)}setAutoReconnect(e){this.reconnect=e}setReconnectInterval(e){this.reconnect_interval=e}setMaxReconnects(e){this.max_reconnects=e}_connect(e,t){clearTimeout(this.reconnect_timer_id),this.socket=this.webSocketFactory(e,t),this.socket.addEventListener("open",()=>{this.ready=!0,this.emit("open"),this.current_reconnects=0}),this.socket.addEventListener("message",({data:r})=>{r instanceof ArrayBuffer&&(r=Buffer.from(r).toString());try{r=this.dataPack.decode(r)}catch{return}if(r.notification&&this.listeners(r.notification).length){if(!Object.keys(r.params).length)return this.emit(r.notification);let o=[r.notification];if(r.params.constructor===Object)o.push(r.params);else for(let s=0;s<r.params.length;s++)o.push(r.params[s]);return Promise.resolve().then(()=>{this.emit.apply(this,o)})}if(!this.queue[r.id])return r.method?Promise.resolve().then(()=>{this.emit(r.method,r?.params)}):void 0;"error"in r=="result"in r&&this.queue[r.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),this.queue[r.id].timeout&&clearTimeout(this.queue[r.id].timeout),r.error?this.queue[r.id].promise[1](r.error):this.queue[r.id].promise[0](r.result),delete this.queue[r.id]}),this.socket.addEventListener("error",r=>this.emit("error",r)),this.socket.addEventListener("close",({code:r,reason:o})=>{this.ready&&setTimeout(()=>this.emit("close",r,o),0),this.ready=!1,this.socket=void 0,r!==1e3&&(this.current_reconnects++,this.reconnect&&(this.max_reconnects>this.current_reconnects||this.max_reconnects===0)&&(this.reconnect_timer_id=setTimeout(()=>this._connect(e,t),this.reconnect_interval)))})}};Ou.default=Pu});var fn=pe((qE,Hh)=>{"use strict";Hh.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var ap=pe((zE,ip)=>{var Yh=be("fs"),Mr=be("path"),Xh=be("os"),Zh=typeof __webpack_require__=="function"?__non_webpack_require__:be,Ow=process.config&&process.config.variables||{},Nw=!!process.env.PREBUILDS_ONLY,Vh=process.versions.modules,Nu=Fw()?"electron":Dw()?"node-webkit":"node",Uu=process.env.npm_config_arch||Xh.arch(),Du=process.env.npm_config_platform||Xh.platform(),Jh=process.env.LIBC||(Mw(Du)?"musl":"glibc"),Fu=process.env.ARM_VERSION||(Uu==="arm64"?"8":Ow.arm_version)||"",Qh=(process.versions.uv||"").split(".")[0];ip.exports=yr;function yr(n){return Zh(yr.resolve(n))}yr.resolve=yr.path=function(n){n=Mr.resolve(n||".");try{var e=Zh(Mr.join(n,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(n=process.env[e+"_PREBUILD"])}catch{}if(!Nw){var t=jh(Mr.join(n,"build/Release"),Gh);if(t)return t;var r=jh(Mr.join(n,"build/Debug"),Gh);if(r)return r}var o=c(n);if(o)return o;var s=c(Mr.dirname(process.execPath));if(s)return s;var i=["platform="+Du,"arch="+Uu,"runtime="+Nu,"abi="+Vh,"uv="+Qh,Fu?"armv="+Fu:"","libc="+Jh,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"",typeof __webpack_require__=="function"?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+i+`
5
5
  loaded from: `+n+`
@@ -286,4 +286,4 @@ buffer-layout/lib/Layout.js:
286
286
  * @see {@link https://github.com/pabigot/buffer-layout|buffer-layout on GitHub}
287
287
  *)
288
288
  */
289
- //# sourceMappingURL=chunk-E74OKQE6.js.map
289
+ //# sourceMappingURL=chunk-YJ64AKDD.js.map