-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkinetic-sdk.js
134 lines (124 loc) · 843 KB
/
kinetic-sdk.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
(()=>{"use strict";var e,r,t,o={},n={};function a(e){var r=n[e];if(void 0!==r)return r.exports;var t=n[e]={id:e,loaded:!1,exports:{}};return o[e].call(t.exports,t,t.exports,a),t.loaded=!0,t.exports}a.m=o,e=[],a.O=(r,t,o,n)=>{if(!t){var f=1/0;for(d=0;d<e.length;d++){for(var[t,o,n]=e[d],l=!0,i=0;i<t.length;i++)(!1&n||f>=n)&&Object.keys(a.O).every((e=>a.O[e](t[i])))?t.splice(i--,1):(l=!1,n<f&&(f=n));if(l){e.splice(d--,1);var u=o();void 0!==u&&(r=u)}}return r}n=n||0;for(var d=e.length;d>0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[t,o,n]},a.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return a.d(r,{a:r}),r},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var n=Object.create(null);a.r(n);var f={};r=r||[null,t({}),t([]),t(t)];for(var l=2&o&&e;"object"==typeof l&&!~r.indexOf(l);l=t(l))Object.getOwnPropertyNames(l).forEach((r=>f[r]=()=>e[r]));return f.default=()=>e,a.d(n,f),n},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e={666:0};a.O.j=r=>0===e[r];var r=(r,t)=>{var o,n,[f,l,i]=t,u=0;if(f.some((r=>0!==e[r]))){for(o in l)a.o(l,o)&&(a.m[o]=l[o]);if(i)var d=i(a)}for(r&&r(t);u<f.length;u++)n=f[u],a.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return a.O(d)},t=self.webpackChunk=self.webpackChunk||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})()})();(self.webpackChunk=self.webpackChunk||[]).push([[429],{41913:(t,r,e)=>{"use strict";e(634),e(96882),e(64844),e(40225),e(71686),e(68223),e(27072),e(84870),e(39529),e(15735),e(43108),e(9731),e(49992),e(43430),e(67694),e(53985),e(65388),e(72994),e(39509),e(48836),e(77208),e(61657),e(43105),e(37846),e(16635),e(81804),e(42586),e(43045),e(13489),e(68995),e(73439),e(21515),e(98738),e(17368),e(77950),e(90103),e(88233),e(96708),e(31235),e(74069),e(90977),e(35734),e(85940),e(94908),e(48319),e(44112),e(45794),e(18827),e(41715),e(81382),e(91982),e(73229),e(24074),e(64696),e(13675),e(36920),e(13161),e(90723),e(38857),e(26618),e(49527),e(65688),e(70315),e(50556),e(6886),e(46106),e(19866),e(14121),e(85371),e(60523)},70982:()=>{!function(){var t=document.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var r=!1;document.addEventListener("beforeload",(function(e){if(e.target===t)r=!0;else if(!e.target.hasAttribute("nomodule")||!r)return;e.preventDefault()}),!0),t.type="module",t.src=".",document.head.appendChild(t),t.remove()}}()},77111:(t,r,e)=>{var n=e(26733),o=e(59821),i=TypeError;t.exports=function(t){if(n(t))return t;throw i(o(t)+" is not a function")}},57988:(t,r,e)=>{var n=e(82359),o=e(59821),i=TypeError;t.exports=function(t){if(n(t))return t;throw i(o(t)+" is not a constructor")}},88505:(t,r,e)=>{var n=e(26733),o=String,i=TypeError;t.exports=function(t){if("object"==typeof t||n(t))return t;throw i("Can't set "+o(t)+" as a prototype")}},9736:(t,r,e)=>{var n=e(70095),o=e(22391),i=e(31787).f,a=n("unscopables"),u=Array.prototype;null==u[a]&&i(u,a,{configurable:!0,value:o(null)}),t.exports=function(t){u[a][t]=!0}},36637:(t,r,e)=>{"use strict";var n=e(30966).charAt;t.exports=function(t,r,e){return r+(e?n(t,r).length:1)}},57728:(t,r,e)=>{var n=e(91321),o=TypeError;t.exports=function(t,r){if(n(r,t))return t;throw o("Incorrect invocation")}},21176:(t,r,e)=>{var n=e(85052),o=String,i=TypeError;t.exports=function(t){if(n(t))return t;throw i(o(t)+" is not an object")}},9772:t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},9918:(t,r,e)=>{"use strict";var n,o,i,a=e(9772),u=e(7400),s=e(9859),c=e(26733),f=e(85052),l=e(98270),p=e(81589),h=e(59821),v=e(75762),d=e(14768),g=e(31787).f,y=e(91321),m=e(67567),b=e(56540),x=e(70095),w=e(81441),S=e(56407),A=S.enforce,R=S.get,E=s.Int8Array,O=E&&E.prototype,I=s.Uint8ClampedArray,P=I&&I.prototype,T=E&&m(E),L=O&&m(O),j=Object.prototype,U=s.TypeError,k=x("toStringTag"),C=w("TYPED_ARRAY_TAG"),_="TypedArrayConstructor",M=a&&!!b&&"Opera"!==p(s.opera),B=!1,F={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},N={BigInt64Array:8,BigUint64Array:8},D=function(t){var r=m(t);if(f(r)){var e=R(r);return e&&l(e,_)?e.TypedArrayConstructor:D(r)}},H=function(t){if(!f(t))return!1;var r=p(t);return l(F,r)||l(N,r)};for(n in F)(i=(o=s[n])&&o.prototype)?A(i).TypedArrayConstructor=o:M=!1;for(n in N)(i=(o=s[n])&&o.prototype)&&(A(i).TypedArrayConstructor=o);if((!M||!c(T)||T===Function.prototype)&&(T=function(){throw U("Incorrect invocation")},M))for(n in F)s[n]&&b(s[n],T);if((!M||!L||L===j)&&(L=T.prototype,M))for(n in F)s[n]&&b(s[n].prototype,L);if(M&&m(P)!==L&&b(P,L),u&&!l(L,k))for(n in B=!0,g(L,k,{get:function(){return f(this)?this[C]:void 0}}),F)s[n]&&v(s[n],C,n);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:M,TYPED_ARRAY_TAG:B&&C,aTypedArray:function(t){if(H(t))return t;throw U("Target is not a typed array")},aTypedArrayConstructor:function(t){if(c(t)&&(!b||y(T,t)))return t;throw U(h(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,r,e,n){if(u){if(e)for(var o in F){var i=s[o];if(i&&l(i.prototype,t))try{delete i.prototype[t]}catch(a){try{i.prototype[t]=r}catch(c){}}}L[t]&&!e||d(L,t,e?r:M&&O[t]||r,n)}},exportTypedArrayStaticMethod:function(t,r,e){var n,o;if(u){if(b){if(e)for(n in F)if((o=s[n])&&l(o,t))try{delete o[t]}catch(i){}if(T[t]&&!e)return;try{return d(T,t,e?r:M&&T[t]||r)}catch(i){}}for(n in F)!(o=s[n])||o[t]&&!e||d(o,t,r)}},getTypedArrayConstructor:D,isView:function(t){if(!f(t))return!1;var r=p(t);return"DataView"===r||l(F,r)||l(N,r)},isTypedArray:H,TypedArray:T,TypedArrayPrototype:L}},53816:(t,r,e)=>{"use strict";var n=e(9859),o=e(65968),i=e(7400),a=e(9772),u=e(51805),s=e(75762),c=e(8312),f=e(24229),l=e(57728),p=e(43329),h=e(34237),v=e(7331),d=e(56201),g=e(67567),y=e(56540),m=e(78151).f,b=e(31787).f,x=e(97065),w=e(69794),S=e(54555),A=e(56407),R=u.PROPER,E=u.CONFIGURABLE,O=A.get,I=A.set,P="ArrayBuffer",T="DataView",L="Wrong index",j=n.ArrayBuffer,U=j,k=U&&U.prototype,C=n.DataView,_=C&&C.prototype,M=Object.prototype,B=n.Array,F=n.RangeError,N=o(x),D=o([].reverse),H=d.pack,q=d.unpack,G=function(t){return[255&t]},V=function(t){return[255&t,t>>8&255]},W=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},$=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},Y=function(t){return H(t,23,4)},z=function(t){return H(t,52,8)},K=function(t,r){b(t.prototype,r,{get:function(){return O(this)[r]}})},J=function(t,r,e,n){var o=v(e),i=O(t);if(o+r>i.byteLength)throw F(L);var a=O(i.buffer).bytes,u=o+i.byteOffset,s=w(a,u,u+r);return n?s:D(s)},Q=function(t,r,e,n,o,i){var a=v(e),u=O(t);if(a+r>u.byteLength)throw F(L);for(var s=O(u.buffer).bytes,c=a+u.byteOffset,f=n(+o),l=0;l<r;l++)s[c+l]=f[i?l:r-l-1]};if(a){var X=R&&j.name!==P;if(f((function(){j(1)}))&&f((function(){new j(-1)}))&&!f((function(){return new j,new j(1.5),new j(NaN),1!=j.length||X&&!E})))X&&E&&s(j,"name",P);else{(U=function(t){return l(this,k),new j(v(t))}).prototype=k;for(var Z,tt=m(j),rt=0;tt.length>rt;)(Z=tt[rt++])in U||s(U,Z,j[Z]);k.constructor=U}y&&g(_)!==M&&y(_,M);var et=new C(new U(2)),nt=o(_.setInt8);et.setInt8(0,2147483648),et.setInt8(1,2147483649),!et.getInt8(0)&&et.getInt8(1)||c(_,{setInt8:function(t,r){nt(this,t,r<<24>>24)},setUint8:function(t,r){nt(this,t,r<<24>>24)}},{unsafe:!0})}else k=(U=function(t){l(this,k);var r=v(t);I(this,{bytes:N(B(r),0),byteLength:r}),i||(this.byteLength=r)}).prototype,_=(C=function(t,r,e){l(this,_),l(t,k);var n=O(t).byteLength,o=p(r);if(o<0||o>n)throw F("Wrong offset");if(o+(e=void 0===e?n-o:h(e))>n)throw F("Wrong length");I(this,{buffer:t,byteLength:e,byteOffset:o}),i||(this.buffer=t,this.byteLength=e,this.byteOffset=o)}).prototype,i&&(K(U,"byteLength"),K(C,"buffer"),K(C,"byteLength"),K(C,"byteOffset")),c(_,{getInt8:function(t){return J(this,1,t)[0]<<24>>24},getUint8:function(t){return J(this,1,t)[0]},getInt16:function(t){var r=J(this,2,t,arguments.length>1?arguments[1]:void 0);return(r[1]<<8|r[0])<<16>>16},getUint16:function(t){var r=J(this,2,t,arguments.length>1?arguments[1]:void 0);return r[1]<<8|r[0]},getInt32:function(t){return $(J(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return $(J(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return q(J(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return q(J(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,r){Q(this,1,t,G,r)},setUint8:function(t,r){Q(this,1,t,G,r)},setInt16:function(t,r){Q(this,2,t,V,r,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,r){Q(this,2,t,V,r,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,r){Q(this,4,t,W,r,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,r){Q(this,4,t,W,r,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,r){Q(this,4,t,Y,r,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,r){Q(this,8,t,z,r,arguments.length>2?arguments[2]:void 0)}});S(U,P),S(C,T),t.exports={ArrayBuffer:U,DataView:C}},97065:(t,r,e)=>{"use strict";var n=e(92991),o=e(43231),i=e(39646);t.exports=function(t){for(var r=n(this),e=i(r),a=arguments.length,u=o(a>1?arguments[1]:void 0,e),s=a>2?arguments[2]:void 0,c=void 0===s?e:o(s,e);c>u;)r[u++]=t;return r}},10507:(t,r,e)=>{"use strict";var n=e(97636),o=e(20266),i=e(92991),a=e(64960),u=e(91943),s=e(82359),c=e(39646),f=e(62324),l=e(28403),p=e(78830),h=Array;t.exports=function(t){var r=i(t),e=s(this),v=arguments.length,d=v>1?arguments[1]:void 0,g=void 0!==d;g&&(d=n(d,v>2?arguments[2]:void 0));var y,m,b,x,w,S,A=p(r),R=0;if(!A||this===h&&u(A))for(y=c(r),m=e?new this(y):h(y);y>R;R++)S=g?d(r[R],R):r[R],f(m,R,S);else for(w=(x=l(r,A)).next,m=e?new this:[];!(b=o(w,x)).done;R++)S=g?a(x,d,[b.value,R],!0):b.value,f(m,R,S);return m.length=R,m}},19540:(t,r,e)=>{var n=e(10905),o=e(43231),i=e(39646),a=function(t){return function(r,e,a){var u,s=n(r),c=i(s),f=o(a,c);if(t&&e!=e){for(;c>f;)if((u=s[f++])!=u)return!0}else for(;c>f;f++)if((t||f in s)&&s[f]===e)return t||f||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},89996:(t,r,e)=>{var n=e(97636),o=e(65968),i=e(9337),a=e(92991),u=e(39646),s=e(87501),c=o([].push),f=function(t){var r=1==t,e=2==t,o=3==t,f=4==t,l=6==t,p=7==t,h=5==t||l;return function(v,d,g,y){for(var m,b,x=a(v),w=i(x),S=n(d,g),A=u(w),R=0,E=y||s,O=r?E(v,A):e||p?E(v,0):void 0;A>R;R++)if((h||R in w)&&(b=S(m=w[R],R,x),t))if(r)O[R]=b;else if(b)switch(t){case 3:return!0;case 5:return m;case 6:return R;case 2:c(O,m)}else switch(t){case 4:return!1;case 7:c(O,m)}return l?-1:o||f?f:O}};t.exports={forEach:f(0),map:f(1),filter:f(2),some:f(3),every:f(4),find:f(5),findIndex:f(6),filterReject:f(7)}},96038:(t,r,e)=>{"use strict";var n=e(24229);t.exports=function(t,r){var e=[][t];return!!e&&n((function(){e.call(null,r||function(){return 1},1)}))}},43143:(t,r,e)=>{var n=e(77111),o=e(92991),i=e(9337),a=e(39646),u=TypeError,s=function(t){return function(r,e,s,c){n(e);var f=o(r),l=i(f),p=a(f),h=t?p-1:0,v=t?-1:1;if(s<2)for(;;){if(h in l){c=l[h],h+=v;break}if(h+=v,t?h<0:p<=h)throw u("Reduce of empty array with no initial value")}for(;t?h>=0:p>h;h+=v)h in l&&(c=e(c,l[h],h,f));return c}};t.exports={left:s(!1),right:s(!0)}},69794:(t,r,e)=>{var n=e(43231),o=e(39646),i=e(62324),a=Array,u=Math.max;t.exports=function(t,r,e){for(var s=o(t),c=n(r,s),f=n(void 0===e?s:e,s),l=a(u(f-c,0)),p=0;c<f;c++,p++)i(l,p,t[c]);return l.length=p,l}},1909:(t,r,e)=>{var n=e(65968);t.exports=n([].slice)},33867:(t,r,e)=>{var n=e(69794),o=Math.floor,i=function(t,r){var e=t.length,s=o(e/2);return e<8?a(t,r):u(t,i(n(t,0,s),r),i(n(t,s),r),r)},a=function(t,r){for(var e,n,o=t.length,i=1;i<o;){for(n=i,e=t[i];n&&r(t[n-1],e)>0;)t[n]=t[--n];n!==i++&&(t[n]=e)}return t},u=function(t,r,e,n){for(var o=r.length,i=e.length,a=0,u=0;a<o||u<i;)t[a+u]=a<o&&u<i?n(r[a],e[u])<=0?r[a++]:e[u++]:a<o?r[a++]:e[u++];return t};t.exports=i},18760:(t,r,e)=>{var n=e(33718),o=e(82359),i=e(85052),a=e(70095)("species"),u=Array;t.exports=function(t){var r;return n(t)&&(r=t.constructor,(o(r)&&(r===u||n(r.prototype))||i(r)&&null===(r=r[a]))&&(r=void 0)),void 0===r?u:r}},87501:(t,r,e)=>{var n=e(18760);t.exports=function(t,r){return new(n(t))(0===r?0:r)}},64960:(t,r,e)=>{var n=e(21176),o=e(57281);t.exports=function(t,r,e,i){try{return i?r(n(e)[0],e[1]):r(e)}catch(a){o(t,"throw",a)}}},74575:(t,r,e)=>{var n=e(70095)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(u){}t.exports=function(t,r){if(!r&&!o)return!1;var e=!1;try{var i={};i[n]=function(){return{next:function(){return{done:e=!0}}}},t(i)}catch(u){}return e}},27079:(t,r,e)=>{var n=e(65968),o=n({}.toString),i=n("".slice);t.exports=function(t){return i(o(t),8,-1)}},81589:(t,r,e)=>{var n=e(71601),o=e(26733),i=e(27079),a=e(70095)("toStringTag"),u=Object,s="Arguments"==i(function(){return arguments}());t.exports=n?i:function(t){var r,e,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,r){try{return t[r]}catch(e){}}(r=u(t),a))?e:s?i(r):"Object"==(n=i(r))&&o(r.callee)?"Arguments":n}},77081:(t,r,e)=>{var n=e(98270),o=e(4826),i=e(97933),a=e(31787);t.exports=function(t,r,e){for(var u=o(r),s=a.f,c=i.f,f=0;f<u.length;f++){var l=u[f];n(t,l)||e&&n(e,l)||s(t,l,c(r,l))}}},48127:(t,r,e)=>{var n=e(70095)("match");t.exports=function(t){var r=/./;try{"/./"[t](r)}catch(e){try{return r[n]=!1,"/./"[t](r)}catch(o){}}return!1}},27528:(t,r,e)=>{var n=e(24229);t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},33684:t=>{t.exports=function(t,r){return{value:t,done:r}}},75762:(t,r,e)=>{var n=e(7400),o=e(31787),i=e(65358);t.exports=n?function(t,r,e){return o.f(t,r,i(1,e))}:function(t,r,e){return t[r]=e,t}},65358:t=>{t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},62324:(t,r,e)=>{"use strict";var n=e(39310),o=e(31787),i=e(65358);t.exports=function(t,r,e){var a=n(r);a in t?o.f(t,a,i(0,e)):t[a]=e}},96616:(t,r,e)=>{var n=e(16039),o=e(31787);t.exports=function(t,r,e){return e.get&&n(e.get,r,{getter:!0}),e.set&&n(e.set,r,{setter:!0}),o.f(t,r,e)}},14768:(t,r,e)=>{var n=e(26733),o=e(31787),i=e(16039),a=e(18400);t.exports=function(t,r,e,u){u||(u={});var s=u.enumerable,c=void 0!==u.name?u.name:r;if(n(e)&&i(e,c,u),u.global)s?t[r]=e:a(r,e);else{try{u.unsafe?t[r]&&(s=!0):delete t[r]}catch(f){}s?t[r]=e:o.f(t,r,{value:e,enumerable:!1,configurable:!u.nonConfigurable,writable:!u.nonWritable})}return t}},8312:(t,r,e)=>{var n=e(14768);t.exports=function(t,r,e){for(var o in r)n(t,o,r[o],e);return t}},18400:(t,r,e)=>{var n=e(9859),o=Object.defineProperty;t.exports=function(t,r){try{o(n,t,{value:r,configurable:!0,writable:!0})}catch(e){n[t]=r}return r}},79563:(t,r,e)=>{"use strict";var n=e(59821),o=TypeError;t.exports=function(t,r){if(!delete t[r])throw o("Cannot delete property "+n(r)+" of "+n(t))}},7400:(t,r,e)=>{var n=e(24229);t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},63777:t=>{var r="object"==typeof document&&document.all,e=void 0===r&&void 0!==r;t.exports={all:r,IS_HTMLDDA:e}},22635:(t,r,e)=>{var n=e(9859),o=e(85052),i=n.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},13064:t=>{var r=TypeError;t.exports=function(t){if(t>9007199254740991)throw r("Maximum allowed index exceeded");return t}},95694:t=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},18865:(t,r,e)=>{var n=e(22635)("span").classList,o=n&&n.constructor&&n.constructor.prototype;t.exports=o===Object.prototype?void 0:o},22671:(t,r,e)=>{var n=e(80598).match(/firefox\/(\d+)/i);t.exports=!!n&&+n[1]},48639:(t,r,e)=>{var n=e(95189),o=e(28801);t.exports=!n&&!o&&"object"==typeof window&&"object"==typeof document},95189:t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},48506:(t,r,e)=>{var n=e(80598);t.exports=/MSIE|Trident/.test(n)},8983:(t,r,e)=>{var n=e(80598),o=e(9859);t.exports=/ipad|iphone|ipod/i.test(n)&&void 0!==o.Pebble},32023:(t,r,e)=>{var n=e(80598);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},28801:(t,r,e)=>{var n=e(27079),o=e(9859);t.exports="process"==n(o.process)},10263:(t,r,e)=>{var n=e(80598);t.exports=/web0s(?!.*chrome)/i.test(n)},80598:(t,r,e)=>{var n=e(31333);t.exports=n("navigator","userAgent")||""},6358:(t,r,e)=>{var n,o,i=e(9859),a=e(80598),u=i.process,s=i.Deno,c=u&&u.versions||s&&s.version,f=c&&c.v8;f&&(o=(n=f.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),t.exports=o},49811:(t,r,e)=>{var n=e(80598).match(/AppleWebKit\/(\d+)\./);t.exports=!!n&&+n[1]},13837:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},23103:(t,r,e)=>{var n=e(9859),o=e(97933).f,i=e(75762),a=e(14768),u=e(18400),s=e(77081),c=e(46541);t.exports=function(t,r){var e,f,l,p,h,v=t.target,d=t.global,g=t.stat;if(e=d?n:g?n[v]||u(v,{}):(n[v]||{}).prototype)for(f in r){if(p=r[f],l=t.dontCallGetSet?(h=o(e,f))&&h.value:e[f],!c(d?f:v+(g?".":"#")+f,t.forced)&&void 0!==l){if(typeof p==typeof l)continue;s(p,l)}(t.sham||l&&l.sham)&&i(p,"sham",!0),a(e,f,p,t)}}},24229:t=>{t.exports=function(t){try{return!!t()}catch(r){return!0}}},94954:(t,r,e)=>{"use strict";e(77950);var n=e(65968),o=e(14768),i=e(63466),a=e(24229),u=e(70095),s=e(75762),c=u("species"),f=RegExp.prototype;t.exports=function(t,r,e,l){var p=u(t),h=!a((function(){var r={};return r[p]=function(){return 7},7!=""[t](r)})),v=h&&!a((function(){var r=!1,e=/a/;return"split"===t&&((e={}).constructor={},e.constructor[c]=function(){return e},e.flags="",e[p]=/./[p]),e.exec=function(){return r=!0,null},e[p](""),!r}));if(!h||!v||e){var d=n(/./[p]),g=r(p,""[t],(function(t,r,e,o,a){var u=n(t),s=r.exec;return s===i||s===f.exec?h&&!a?{done:!0,value:d(r,e,o)}:{done:!0,value:u(e,r,o)}:{done:!1}}));o(String.prototype,t,g[0]),o(f,p,g[1])}l&&s(f[p],"sham",!0)}},34990:(t,r,e)=>{"use strict";var n=e(33718),o=e(39646),i=e(13064),a=e(97636),u=function(t,r,e,s,c,f,l,p){for(var h,v,d=c,g=0,y=!!l&&a(l,p);g<s;)g in e&&(h=y?y(e[g],g,r):e[g],f>0&&n(h)?(v=o(h),d=u(t,r,h,v,d,f-1)-1):(i(d+1),t[d]=h),d++),g++;return d};t.exports=u},53171:(t,r,e)=>{var n=e(57188),o=Function.prototype,i=o.apply,a=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(i):function(){return a.apply(i,arguments)})},97636:(t,r,e)=>{var n=e(65968),o=e(77111),i=e(57188),a=n(n.bind);t.exports=function(t,r){return o(t),void 0===r?t:i?a(t,r):function(){return t.apply(r,arguments)}}},57188:(t,r,e)=>{var n=e(24229);t.exports=!n((function(){var t=(function(){}).bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},20266:(t,r,e)=>{var n=e(57188),o=Function.prototype.call;t.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},51805:(t,r,e)=>{var n=e(7400),o=e(98270),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,u=o(i,"name"),s=u&&"something"===(function(){}).name,c=u&&(!n||n&&a(i,"name").configurable);t.exports={EXISTS:u,PROPER:s,CONFIGURABLE:c}},65968:(t,r,e)=>{var n=e(57188),o=Function.prototype,i=o.bind,a=o.call,u=n&&i.bind(a,a);t.exports=n?function(t){return t&&u(t)}:function(t){return t&&function(){return a.apply(t,arguments)}}},31333:(t,r,e)=>{var n=e(9859),o=e(26733),i=function(t){return o(t)?t:void 0};t.exports=function(t,r){return arguments.length<2?i(n[t]):n[t]&&n[t][r]}},78830:(t,r,e)=>{var n=e(81589),o=e(55300),i=e(9650),a=e(45495),u=e(70095)("iterator");t.exports=function(t){if(!i(t))return o(t,u)||o(t,"@@iterator")||a[n(t)]}},28403:(t,r,e)=>{var n=e(20266),o=e(77111),i=e(21176),a=e(59821),u=e(78830),s=TypeError;t.exports=function(t,r){var e=arguments.length<2?u(t):r;if(o(e))return i(n(e,t));throw s(a(t)+" is not iterable")}},55300:(t,r,e)=>{var n=e(77111),o=e(9650);t.exports=function(t,r){var e=t[r];return o(e)?void 0:n(e)}},70017:(t,r,e)=>{var n=e(65968),o=e(92991),i=Math.floor,a=n("".charAt),u=n("".replace),s=n("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,f=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,r,e,n,l,p){var h=e+t.length,v=n.length,d=f;return void 0!==l&&(l=o(l),d=c),u(p,d,(function(o,u){var c;switch(a(u,0)){case"$":return"$";case"&":return t;case"`":return s(r,0,e);case"'":return s(r,h);case"<":c=l[s(u,1,-1)];break;default:var f=+u;if(0===f)return o;if(f>v){var p=i(f/10);return 0===p?o:p<=v?void 0===n[p-1]?a(u,1):n[p-1]+a(u,1):o}c=n[f-1]}return void 0===c?"":c}))}},9859:t=>{var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof global&&global)||function(){return this}()||Function("return this")()},98270:(t,r,e)=>{var n=e(65968),o=e(92991),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,r){return i(o(t),r)}},95977:t=>{t.exports={}},14665:(t,r,e)=>{var n=e(9859);t.exports=function(t,r){var e=n.console;e&&e.error&&(1==arguments.length?e.error(t):e.error(t,r))}},53777:(t,r,e)=>{var n=e(31333);t.exports=n("document","documentElement")},64394:(t,r,e)=>{var n=e(7400),o=e(24229),i=e(22635);t.exports=!n&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},56201:t=>{var r=Array,e=Math.abs,n=Math.pow,o=Math.floor,i=Math.log,a=Math.LN2;t.exports={pack:function(t,u,s){var c,f,l,p=r(s),h=8*s-u-1,v=(1<<h)-1,d=v>>1,g=23===u?n(2,-24)-n(2,-77):0,y=t<0||0===t&&1/t<0?1:0,m=0;for((t=e(t))!=t||t===1/0?(f=t!=t?1:0,c=v):(c=o(i(t)/a),t*(l=n(2,-c))<1&&(c--,l*=2),(t+=c+d>=1?g/l:g*n(2,1-d))*l>=2&&(c++,l/=2),c+d>=v?(f=0,c=v):c+d>=1?(f=(t*l-1)*n(2,u),c+=d):(f=t*n(2,d-1)*n(2,u),c=0));u>=8;)p[m++]=255&f,f/=256,u-=8;for(c=c<<u|f,h+=u;h>0;)p[m++]=255&c,c/=256,h-=8;return p[--m]|=128*y,p},unpack:function(t,r){var e,o=t.length,i=8*o-r-1,a=(1<<i)-1,u=a>>1,s=i-7,c=o-1,f=t[c--],l=127&f;for(f>>=7;s>0;)l=256*l+t[c--],s-=8;for(e=l&(1<<-s)-1,l>>=-s,s+=r;s>0;)e=256*e+t[c--],s-=8;if(0===l)l=1-u;else{if(l===a)return e?NaN:f?-1/0:1/0;e+=n(2,r),l-=u}return(f?-1:1)*e*n(2,l-r)}}},9337:(t,r,e)=>{var n=e(65968),o=e(24229),i=e(27079),a=Object,u=n("".split);t.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?u(t,""):a(t)}:a},20835:(t,r,e)=>{var n=e(26733),o=e(85052),i=e(56540);t.exports=function(t,r,e){var a,u;return i&&n(a=r.constructor)&&a!==e&&o(u=a.prototype)&&u!==e.prototype&&i(t,u),t}},8511:(t,r,e)=>{var n=e(65968),o=e(26733),i=e(85353),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},56407:(t,r,e)=>{var n,o,i,a=e(51180),u=e(9859),s=e(65968),c=e(85052),f=e(75762),l=e(98270),p=e(85353),h=e(44399),v=e(95977),d="Object already initialized",g=u.TypeError,y=u.WeakMap;if(a||p.state){var m=p.state||(p.state=new y),b=s(m.get),x=s(m.has),w=s(m.set);n=function(t,r){if(x(m,t))throw g(d);return r.facade=t,w(m,t,r),r},o=function(t){return b(m,t)||{}},i=function(t){return x(m,t)}}else{var S=h("state");v[S]=!0,n=function(t,r){if(l(t,S))throw g(d);return r.facade=t,f(t,S,r),r},o=function(t){return l(t,S)?t[S]:{}},i=function(t){return l(t,S)}}t.exports={set:n,get:o,has:i,enforce:function(t){return i(t)?o(t):n(t,{})},getterFor:function(t){return function(r){var e;if(!c(r)||(e=o(r)).type!==t)throw g("Incompatible receiver, "+t+" required");return e}}}},91943:(t,r,e)=>{var n=e(70095),o=e(45495),i=n("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||a[i]===t)}},33718:(t,r,e)=>{var n=e(27079);t.exports=Array.isArray||function(t){return"Array"==n(t)}},79098:(t,r,e)=>{var n=e(81589),o=e(65968)("".slice);t.exports=function(t){return"Big"===o(n(t),0,3)}},26733:(t,r,e)=>{var n=e(63777),o=n.all;t.exports=n.IS_HTMLDDA?function(t){return"function"==typeof t||t===o}:function(t){return"function"==typeof t}},82359:(t,r,e)=>{var n=e(65968),o=e(24229),i=e(26733),a=e(81589),u=e(31333),s=e(8511),c=function(){},f=[],l=u("Reflect","construct"),p=/^\s*(?:class|function)\b/,h=n(p.exec),v=!p.exec(c),d=function(t){if(!i(t))return!1;try{return l(c,f,t),!0}catch(r){return!1}},g=function(t){if(!i(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return v||!!h(p,s(t))}catch(r){return!0}};g.sham=!0,t.exports=!l||o((function(){var t;return d(d.call)||!d(Object)||!d((function(){t=!0}))||t}))?g:d},90193:(t,r,e)=>{var n=e(98270);t.exports=function(t){return void 0!==t&&(n(t,"value")||n(t,"writable"))}},46541:(t,r,e)=>{var n=e(24229),o=e(26733),i=/#|\.prototype\./,a=function(t,r){var e=s[u(t)];return e==f||e!=c&&(o(r)?n(r):!!r)},u=a.normalize=function(t){return String(t).replace(i,".").toLowerCase()},s=a.data={},c=a.NATIVE="N",f=a.POLYFILL="P";t.exports=a},82292:(t,r,e)=>{var n=e(85052),o=Math.floor;t.exports=Number.isInteger||function(t){return!n(t)&&isFinite(t)&&o(t)===t}},9650:t=>{t.exports=function(t){return null==t}},85052:(t,r,e)=>{var n=e(26733),o=e(63777),i=o.all;t.exports=o.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:n(t)||t===i}:function(t){return"object"==typeof t?null!==t:n(t)}},24231:t=>{t.exports=!1},48311:(t,r,e)=>{var n=e(85052),o=e(27079),i=e(70095)("match");t.exports=function(t){var r;return n(t)&&(void 0!==(r=t[i])?!!r:"RegExp"==o(t))}},49395:(t,r,e)=>{var n=e(31333),o=e(26733),i=e(91321),a=e(66969),u=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var r=n("Symbol");return o(r)&&i(r.prototype,u(t))}},89003:(t,r,e)=>{var n=e(97636),o=e(20266),i=e(21176),a=e(59821),u=e(91943),s=e(39646),c=e(91321),f=e(28403),l=e(78830),p=e(57281),h=TypeError,v=function(t,r){this.stopped=t,this.result=r},d=v.prototype;t.exports=function(t,r,e){var g,y,m,b,x,w,S,A=e&&e.that,R=!(!e||!e.AS_ENTRIES),E=!(!e||!e.IS_RECORD),O=!(!e||!e.IS_ITERATOR),I=!(!e||!e.INTERRUPTED),P=n(r,A),T=function(t){return g&&p(g,"normal",t),new v(!0,t)},L=function(t){return R?(i(t),I?P(t[0],t[1],T):P(t[0],t[1])):I?P(t,T):P(t)};if(E)g=t.iterator;else if(O)g=t;else{if(!(y=l(t)))throw h(a(t)+" is not iterable");if(u(y)){for(m=0,b=s(t);b>m;m++)if((x=L(t[m]))&&c(d,x))return x;return new v(!1)}g=f(t,y)}for(w=E?t.next:g.next;!(S=o(w,g)).done;){try{x=L(S.value)}catch(j){p(g,"throw",j)}if("object"==typeof x&&x&&c(d,x))return x}return new v(!1)}},57281:(t,r,e)=>{var n=e(20266),o=e(21176),i=e(55300);t.exports=function(t,r,e){var a,u;o(t);try{if(!(a=i(t,"return"))){if("throw"===r)throw e;return e}a=n(a,t)}catch(s){u=!0,a=s}if("throw"===r)throw e;if(u)throw a;return o(a),e}},42247:(t,r,e)=>{"use strict";var n=e(60693).IteratorPrototype,o=e(22391),i=e(65358),a=e(54555),u=e(45495),s=function(){return this};t.exports=function(t,r,e,c){var f=r+" Iterator";return t.prototype=o(n,{next:i(+!c,e)}),a(t,f,!1,!0),u[f]=s,t}},12707:(t,r,e)=>{"use strict";var n=e(23103),o=e(20266),i=e(24231),a=e(51805),u=e(26733),s=e(42247),c=e(67567),f=e(56540),l=e(54555),p=e(75762),h=e(14768),v=e(70095),d=e(45495),g=e(60693),y=a.PROPER,m=a.CONFIGURABLE,b=g.IteratorPrototype,x=g.BUGGY_SAFARI_ITERATORS,w=v("iterator"),S="keys",A="values",R="entries",E=function(){return this};t.exports=function(t,r,e,a,v,g,O){s(e,r,a);var I,P,T,L=function(t){if(t===v&&_)return _;if(!x&&t in k)return k[t];switch(t){case S:case A:case R:return function(){return new e(this,t)}}return function(){return new e(this)}},j=r+" Iterator",U=!1,k=t.prototype,C=k[w]||k["@@iterator"]||v&&k[v],_=!x&&C||L(v),M="Array"==r&&k.entries||C;if(M&&(I=c(M.call(new t)))!==Object.prototype&&I.next&&(i||c(I)===b||(f?f(I,b):u(I[w])||h(I,w,E)),l(I,j,!0,!0),i&&(d[j]=E)),y&&v==A&&C&&C.name!==A&&(!i&&m?p(k,"name",A):(U=!0,_=function(){return o(C,this)})),v)if(P={values:L(A),keys:g?_:L(S),entries:L(R)},O)for(T in P)(x||U||!(T in k))&&h(k,T,P[T]);else n({target:r,proto:!0,forced:x||U},P);return i&&!O||k[w]===_||h(k,w,_,{name:v}),d[r]=_,P}},60693:(t,r,e)=>{"use strict";var n,o,i,a=e(24229),u=e(26733),s=e(85052),c=e(22391),f=e(67567),l=e(14768),p=e(70095),h=e(24231),v=p("iterator"),d=!1;[].keys&&("next"in(i=[].keys())?(o=f(f(i)))!==Object.prototype&&(n=o):d=!0),!s(n)||a((function(){var t={};return n[v].call(t)!==t}))?n={}:h&&(n=c(n)),u(n[v])||l(n,v,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:d}},45495:t=>{t.exports={}},39646:(t,r,e)=>{var n=e(34237);t.exports=function(t){return n(t.length)}},16039:(t,r,e)=>{var n=e(24229),o=e(26733),i=e(98270),a=e(7400),u=e(51805).CONFIGURABLE,s=e(8511),c=e(56407),f=c.enforce,l=c.get,p=Object.defineProperty,h=a&&!n((function(){return 8!==p((function(){}),"length",{value:8}).length})),v=String(String).split("String"),d=t.exports=function(t,r,e){"Symbol("===String(r).slice(0,7)&&(r="["+String(r).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),e&&e.getter&&(r="get "+r),e&&e.setter&&(r="set "+r),(!i(t,"name")||u&&t.name!==r)&&(a?p(t,"name",{value:r,configurable:!0}):t.name=r),h&&e&&i(e,"arity")&&t.length!==e.arity&&p(t,"length",{value:e.arity});try{e&&i(e,"constructor")&&e.constructor?a&&p(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(o){}var n=f(t);return i(n,"source")||(n.source=v.join("string"==typeof r?r:"")),t};Function.prototype.toString=d((function(){return o(this)&&l(this).source||s(this)}),"toString")},50917:t=>{var r=Math.ceil,e=Math.floor;t.exports=Math.trunc||function(t){var n=+t;return(n>0?e:r)(n)}},24794:(t,r,e)=>{var n,o,i,a,u,s,c,f,l=e(9859),p=e(97636),h=e(97933).f,v=e(55795).set,d=e(32023),g=e(8983),y=e(10263),m=e(28801),b=l.MutationObserver||l.WebKitMutationObserver,x=l.document,w=l.process,S=l.Promise,A=h(l,"queueMicrotask"),R=A&&A.value;R||(n=function(){var t,r;for(m&&(t=w.domain)&&t.exit();o;){r=o.fn,o=o.next;try{r()}catch(e){throw o?a():i=void 0,e}}i=void 0,t&&t.enter()},d||m||y||!b||!x?!g&&S&&S.resolve?((c=S.resolve(void 0)).constructor=S,f=p(c.then,c),a=function(){f(n)}):m?a=function(){w.nextTick(n)}:(v=p(v,l),a=function(){v(n)}):(u=!0,s=x.createTextNode(""),new b(n).observe(s,{characterData:!0}),a=function(){s.data=u=!u})),t.exports=R||function(t){var r={fn:t,next:void 0};i&&(i.next=r),o||(o=r,a()),i=r}},16485:(t,r,e)=>{"use strict";var n=e(77111),o=TypeError,i=function(t){var r,e;this.promise=new t((function(t,n){if(void 0!==r||void 0!==e)throw o("Bad Promise constructor");r=t,e=n})),this.resolve=n(r),this.reject=n(e)};t.exports.f=function(t){return new i(t)}},47272:(t,r,e)=>{var n=e(48311),o=TypeError;t.exports=function(t){if(n(t))throw o("The method doesn't accept regular expressions");return t}},45496:(t,r,e)=>{var n=e(9859),o=e(24229),i=e(65968),a=e(83326),u=e(1017).trim,s=e(41647),c=i("".charAt),f=n.parseFloat,l=n.Symbol,p=l&&l.iterator,h=1/f(s+"-0")!=-1/0||p&&!o((function(){f(Object(p))}));t.exports=h?function(t){var r=u(a(t)),e=f(r);return 0===e&&"-"==c(r,0)?-0:e}:f},36596:(t,r,e)=>{var n=e(9859),o=e(24229),i=e(65968),a=e(83326),u=e(1017).trim,s=e(41647),c=n.parseInt,f=n.Symbol,l=f&&f.iterator,p=/^[+-]?0x/i,h=i(p.exec),v=8!==c(s+"08")||22!==c(s+"0x16")||l&&!o((function(){c(Object(l))}));t.exports=v?function(t,r){var e=u(a(t));return c(e,r>>>0||(h(p,e)?16:10))}:c},47:(t,r,e)=>{"use strict";var n=e(7400),o=e(65968),i=e(20266),a=e(24229),u=e(65632),s=e(10894),c=e(19195),f=e(92991),l=e(9337),p=Object.assign,h=Object.defineProperty,v=o([].concat);t.exports=!p||a((function(){if(n&&1!==p({b:1},p(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},r={},e=Symbol(),o="abcdefghijklmnopqrst";return t[e]=7,o.split("").forEach((function(t){r[t]=t})),7!=p({},t)[e]||u(p({},r)).join("")!=o}))?function(t,r){for(var e=f(t),o=arguments.length,a=1,p=s.f,h=c.f;o>a;)for(var d,g=l(arguments[a++]),y=p?v(u(g),p(g)):u(g),m=y.length,b=0;m>b;)d=y[b++],n&&!i(h,g,d)||(e[d]=g[d]);return e}:p},22391:(t,r,e)=>{var n,o=e(21176),i=e(90219),a=e(13837),u=e(95977),s=e(53777),c=e(22635),f=e(44399),l=f("IE_PROTO"),p=function(){},h=function(t){return"<script>"+t+"</"+"script>"},v=function(t){t.write(h("")),t.close();var r=t.parentWindow.Object;return t=null,r},d=function(){try{n=new ActiveXObject("htmlfile")}catch(o){}var t,r;d="undefined"!=typeof document?document.domain&&n?v(n):((r=c("iframe")).style.display="none",s.appendChild(r),r.src=String("javascript:"),(t=r.contentWindow.document).open(),t.write(h("document.F=Object")),t.close(),t.F):v(n);for(var e=a.length;e--;)delete d.prototype[a[e]];return d()};u[l]=!0,t.exports=Object.create||function(t,r){var e;return null!==t?(p.prototype=o(t),e=new p,p.prototype=null,e[l]=t):e=d(),void 0===r?e:i.f(e,r)}},90219:(t,r,e)=>{var n=e(7400),o=e(17137),i=e(31787),a=e(21176),u=e(10905),s=e(65632);r.f=n&&!o?Object.defineProperties:function(t,r){a(t);for(var e,n=u(r),o=s(r),c=o.length,f=0;c>f;)i.f(t,e=o[f++],n[e]);return t}},31787:(t,r,e)=>{var n=e(7400),o=e(64394),i=e(17137),a=e(21176),u=e(39310),s=TypeError,c=Object.defineProperty,f=Object.getOwnPropertyDescriptor,l="enumerable",p="configurable",h="writable";r.f=n?i?function(t,r,e){if(a(t),r=u(r),a(e),"function"==typeof t&&"prototype"===r&&"value"in e&&h in e&&!e.writable){var n=f(t,r);n&&n.writable&&(t[r]=e.value,e={configurable:p in e?e.configurable:n.configurable,enumerable:l in e?e.enumerable:n.enumerable,writable:!1})}return c(t,r,e)}:c:function(t,r,e){if(a(t),r=u(r),a(e),o)try{return c(t,r,e)}catch(n){}if("get"in e||"set"in e)throw s("Accessors not supported");return"value"in e&&(t[r]=e.value),t}},97933:(t,r,e)=>{var n=e(7400),o=e(20266),i=e(19195),a=e(65358),u=e(10905),s=e(39310),c=e(98270),f=e(64394),l=Object.getOwnPropertyDescriptor;r.f=n?l:function(t,r){if(t=u(t),r=s(r),f)try{return l(t,r)}catch(e){}if(c(t,r))return a(!o(i.f,t,r),t[r])}},78151:(t,r,e)=>{var n=e(90140),o=e(13837).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},10894:(t,r)=>{r.f=Object.getOwnPropertySymbols},67567:(t,r,e)=>{var n=e(98270),o=e(26733),i=e(92991),a=e(44399),u=e(27528),s=a("IE_PROTO"),c=Object,f=c.prototype;t.exports=u?c.getPrototypeOf:function(t){var r=i(t);if(n(r,s))return r[s];var e=r.constructor;return o(e)&&r instanceof e?e.prototype:r instanceof c?f:null}},91321:(t,r,e)=>{var n=e(65968);t.exports=n({}.isPrototypeOf)},90140:(t,r,e)=>{var n=e(65968),o=e(98270),i=e(10905),a=e(19540).indexOf,u=e(95977),s=n([].push);t.exports=function(t,r){var e,n=i(t),c=0,f=[];for(e in n)!o(u,e)&&o(n,e)&&s(f,e);for(;r.length>c;)o(n,e=r[c++])&&(~a(f,e)||s(f,e));return f}},65632:(t,r,e)=>{var n=e(90140),o=e(13837);t.exports=Object.keys||function(t){return n(t,o)}},19195:(t,r)=>{"use strict";var e={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!e.call({1:2},1);r.f=o?function(t){var r=n(this,t);return!!r&&r.enumerable}:e},15020:(t,r,e)=>{"use strict";var n=e(24231),o=e(9859),i=e(24229),a=e(49811);t.exports=n||!i((function(){if(!(a&&a<535)){var t=Math.random();__defineSetter__.call(null,t,(function(){})),delete o[t]}}))},56540:(t,r,e)=>{var n=e(65968),o=e(21176),i=e(88505);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,r=!1,e={};try{(t=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(e,[]),r=e instanceof Array}catch(a){}return function(e,n){return o(e),i(n),r?t(e,n):e.__proto__=n,e}}():void 0)},32914:(t,r,e)=>{var n=e(20266),o=e(26733),i=e(85052),a=TypeError;t.exports=function(t,r){var e,u;if("string"===r&&o(e=t.toString)&&!i(u=n(e,t)))return u;if(o(e=t.valueOf)&&!i(u=n(e,t)))return u;if("string"!==r&&o(e=t.toString)&&!i(u=n(e,t)))return u;throw a("Can't convert object to primitive value")}},4826:(t,r,e)=>{var n=e(31333),o=e(65968),i=e(78151),a=e(10894),u=e(21176),s=o([].concat);t.exports=n("Reflect","ownKeys")||function(t){var r=i.f(u(t)),e=a.f;return e?s(r,e(t)):r}},49276:(t,r,e)=>{var n=e(9859);t.exports=n},64624:t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(r){return{error:!0,value:r}}}},38321:(t,r,e)=>{var n=e(9859),o=e(74473),i=e(26733),a=e(46541),u=e(8511),s=e(70095),c=e(48639),f=e(95189),l=e(24231),p=e(6358),h=o&&o.prototype,v=s("species"),d=!1,g=i(n.PromiseRejectionEvent),y=a("Promise",(function(){var t=u(o),r=t!==String(o);if(!r&&66===p)return!0;if(l&&(!h.catch||!h.finally))return!0;if(!p||p<51||!/native code/.test(t)){var e=new o((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};if((e.constructor={})[v]=n,!(d=e.then((function(){}))instanceof n))return!0}return!r&&(c||f)&&!g}));t.exports={CONSTRUCTOR:y,REJECTION_EVENT:g,SUBCLASSING:d}},74473:(t,r,e)=>{var n=e(9859);t.exports=n.Promise},62391:(t,r,e)=>{var n=e(21176),o=e(85052),i=e(16485);t.exports=function(t,r){if(n(t),o(r)&&r.constructor===t)return r;var e=i.f(t);return(0,e.resolve)(r),e.promise}},96866:(t,r,e)=>{var n=e(74473),o=e(74575),i=e(38321).CONSTRUCTOR;t.exports=i||!o((function(t){n.all(t).then(void 0,(function(){}))}))},26060:(t,r,e)=>{var n=e(31787).f;t.exports=function(t,r,e){e in t||n(t,e,{configurable:!0,get:function(){return r[e]},set:function(t){r[e]=t}})}},93358:t=>{var r=function(){this.head=null,this.tail=null};r.prototype={add:function(t){var r={item:t,next:null};this.head?this.tail.next=r:this.head=r,this.tail=r},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}},t.exports=r},98115:(t,r,e)=>{var n=e(20266),o=e(21176),i=e(26733),a=e(27079),u=e(63466),s=TypeError;t.exports=function(t,r){var e=t.exec;if(i(e)){var c=n(e,t,r);return null!==c&&o(c),c}if("RegExp"===a(t))return n(u,t,r);throw s("RegExp#exec called on incompatible receiver")}},63466:(t,r,e)=>{"use strict";var n,o,i=e(20266),a=e(65968),u=e(83326),s=e(30895),c=e(25650),f=e(33036),l=e(22391),p=e(56407).get,h=e(42926),v=e(10461),d=f("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,y=g,m=a("".charAt),b=a("".indexOf),x=a("".replace),w=a("".slice),S=(o=/b*/g,i(g,n=/a/,"a"),i(g,o,"a"),0!==n.lastIndex||0!==o.lastIndex),A=c.BROKEN_CARET,R=void 0!==/()??/.exec("")[1];(S||R||A||h||v)&&(y=function(t){var r,e,n,o,a,c,f,h=this,v=p(h),E=u(t),O=v.raw;if(O)return O.lastIndex=h.lastIndex,r=i(y,O,E),h.lastIndex=O.lastIndex,r;var I=v.groups,P=A&&h.sticky,T=i(s,h),L=h.source,j=0,U=E;if(P&&(T=x(T,"y",""),-1===b(T,"g")&&(T+="g"),U=w(E,h.lastIndex),h.lastIndex>0&&(!h.multiline||h.multiline&&"\n"!==m(E,h.lastIndex-1))&&(L="(?: "+L+")",U=" "+U,j++),e=new RegExp("^(?:"+L+")",T)),R&&(e=new RegExp("^"+L+"$(?!\\s)",T)),S&&(n=h.lastIndex),o=i(g,P?e:h,U),P?o?(o.input=w(o.input,j),o[0]=w(o[0],j),o.index=h.lastIndex,h.lastIndex+=o[0].length):h.lastIndex=0:S&&o&&(h.lastIndex=h.global?o.index+o[0].length:n),R&&o&&o.length>1&&i(d,o[0],e,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(o[a]=void 0)})),o&&I)for(o.groups=c=l(null),a=0;a<I.length;a++)c[(f=I[a])[0]]=o[f[1]];return o}),t.exports=y},30895:(t,r,e)=>{"use strict";var n=e(21176);t.exports=function(){var t=n(this),r="";return t.hasIndices&&(r+="d"),t.global&&(r+="g"),t.ignoreCase&&(r+="i"),t.multiline&&(r+="m"),t.dotAll&&(r+="s"),t.unicode&&(r+="u"),t.unicodeSets&&(r+="v"),t.sticky&&(r+="y"),r}},83349:(t,r,e)=>{var n=e(20266),o=e(98270),i=e(91321),a=e(30895),u=RegExp.prototype;t.exports=function(t){var r=t.flags;return void 0!==r||"flags"in u||o(t,"flags")||!i(u,t)?r:n(a,t)}},25650:(t,r,e)=>{var n=e(24229),o=e(9859).RegExp,i=n((function(){var t=o("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),a=i||n((function(){return!o("a","y").sticky})),u=i||n((function(){var t=o("^r","gy");return t.lastIndex=2,null!=t.exec("str")}));t.exports={BROKEN_CARET:u,MISSED_STICKY:a,UNSUPPORTED_Y:i}},42926:(t,r,e)=>{var n=e(24229),o=e(9859).RegExp;t.exports=n((function(){var t=o(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},10461:(t,r,e)=>{var n=e(24229),o=e(9859).RegExp;t.exports=n((function(){var t=o("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},58885:(t,r,e)=>{var n=e(9650),o=TypeError;t.exports=function(t){if(n(t))throw o("Can't call method on "+t);return t}},72101:t=>{t.exports=Object.is||function(t,r){return t===r?0!==t||1/t==1/r:t!=t&&r!=r}},71832:(t,r,e)=>{"use strict";var n=e(31333),o=e(31787),i=e(70095),a=e(7400),u=i("species");t.exports=function(t){var r=n(t),e=o.f;a&&r&&!r[u]&&e(r,u,{configurable:!0,get:function(){return this}})}},54555:(t,r,e)=>{var n=e(31787).f,o=e(98270),i=e(70095)("toStringTag");t.exports=function(t,r,e){t&&!e&&(t=t.prototype),t&&!o(t,i)&&n(t,i,{configurable:!0,value:r})}},44399:(t,r,e)=>{var n=e(33036),o=e(81441),i=n("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},85353:(t,r,e)=>{var n=e(9859),o=e(18400),i="__core-js_shared__",a=n[i]||o(i,{});t.exports=a},33036:(t,r,e)=>{var n=e(24231),o=e(85353);(t.exports=function(t,r){return o[t]||(o[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.25.2",mode:n?"pure":"global",copyright:"\xa9 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.2/LICENSE",source:"https://github.com/zloirock/core-js"})},37942:(t,r,e)=>{var n=e(21176),o=e(57988),i=e(9650),a=e(70095)("species");t.exports=function(t,r){var e,u=n(t).constructor;return void 0===u||i(e=n(u)[a])?r:o(e)}},30966:(t,r,e)=>{var n=e(65968),o=e(43329),i=e(83326),a=e(58885),u=n("".charAt),s=n("".charCodeAt),c=n("".slice),f=function(t){return function(r,e){var n,f,l=i(a(r)),p=o(e),h=l.length;return p<0||p>=h?t?"":void 0:(n=s(l,p))<55296||n>56319||p+1===h||(f=s(l,p+1))<56320||f>57343?t?u(l,p):n:t?c(l,p,p+2):f-56320+(n-55296<<10)+65536}};t.exports={codeAt:f(!1),charAt:f(!0)}},57456:(t,r,e)=>{var n=e(80598);t.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(n)},46650:(t,r,e)=>{var n=e(65968),o=e(34237),i=e(83326),a=e(93124),u=e(58885),s=n(a),c=n("".slice),f=Math.ceil,l=function(t){return function(r,e,n){var a,l,p=i(u(r)),h=o(e),v=p.length,d=void 0===n?" ":i(n);return h<=v||""==d?p:((l=s(d,f((a=h-v)/d.length))).length>a&&(l=c(l,0,a)),t?p+l:l+p)}};t.exports={start:l(!1),end:l(!0)}},77321:(t,r,e)=>{"use strict";var n=e(65968),o=2147483647,i=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,u="Overflow: input needs wider integers to process",s=RangeError,c=n(a.exec),f=Math.floor,l=String.fromCharCode,p=n("".charCodeAt),h=n([].join),v=n([].push),d=n("".replace),g=n("".split),y=n("".toLowerCase),m=function(t){return t+22+75*(t<26)},b=function(t,r,e){var n=0;for(t=e?f(t/700):t>>1,t+=f(t/r);t>455;)t=f(t/35),n+=36;return f(n+36*t/(t+38))},x=function(t){var r=[];t=function(t){for(var r=[],e=0,n=t.length;e<n;){var o=p(t,e++);if(o>=55296&&o<=56319&&e<n){var i=p(t,e++);56320==(64512&i)?v(r,((1023&o)<<10)+(1023&i)+65536):(v(r,o),e--)}else v(r,o)}return r}(t);var e,n,i=t.length,a=128,c=0,d=72;for(e=0;e<t.length;e++)(n=t[e])<128&&v(r,l(n));var g=r.length,y=g;for(g&&v(r,"-");y<i;){var x=o;for(e=0;e<t.length;e++)(n=t[e])>=a&&n<x&&(x=n);var w=y+1;if(x-a>f((o-c)/w))throw s(u);for(c+=(x-a)*w,a=x,e=0;e<t.length;e++){if((n=t[e])<a&&++c>o)throw s(u);if(n==a){for(var S=c,A=36;;){var R=A<=d?1:A>=d+26?26:A-d;if(S<R)break;var E=S-R,O=36-R;v(r,l(m(R+E%O))),S=f(E/O),A+=36}v(r,l(m(S))),d=b(c,w,y==g),c=0,y++}}c++,a++}return h(r,"")};t.exports=function(t){var r,e,n=[],o=g(d(y(t),a,"."),".");for(r=0;r<o.length;r++)e=o[r],v(n,c(i,e)?"xn--"+x(e):e);return h(n,".")}},93124:(t,r,e)=>{"use strict";var n=e(43329),o=e(83326),i=e(58885),a=RangeError;t.exports=function(t){var r=o(i(this)),e="",u=n(t);if(u<0||u==1/0)throw a("Wrong number of repetitions");for(;u>0;(u>>>=1)&&(r+=r))1&u&&(e+=r);return e}},61466:(t,r,e)=>{"use strict";var n=e(1017).end,o=e(9445);t.exports=o("trimEnd")?function(){return n(this)}:"".trimEnd},9445:(t,r,e)=>{var n=e(51805).PROPER,o=e(24229),i=e(41647);t.exports=function(t){return o((function(){return!!i[t]()||"\u200b\x85\u180e"!=="\u200b\x85\u180e"[t]()||n&&i[t].name!==t}))}},58747:(t,r,e)=>{"use strict";var n=e(1017).start,o=e(9445);t.exports=o("trimStart")?function(){return n(this)}:"".trimStart},1017:(t,r,e)=>{var n=e(65968),o=e(58885),i=e(83326),a=e(41647),u=n("".replace),s="["+a+"]",c=RegExp("^"+s+s+"*"),f=RegExp(s+s+"*$"),l=function(t){return function(r){var e=i(o(r));return 1&t&&(e=u(e,c,"")),2&t&&(e=u(e,f,"")),e}};t.exports={start:l(1),end:l(2),trim:l(3)}},44860:(t,r,e)=>{var n=e(6358),o=e(24229);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},55795:(t,r,e)=>{var n,o,i,a,u=e(9859),s=e(53171),c=e(97636),f=e(26733),l=e(98270),p=e(24229),h=e(53777),v=e(1909),d=e(22635),g=e(77579),y=e(32023),m=e(28801),b=u.setImmediate,x=u.clearImmediate,w=u.process,S=u.Dispatch,A=u.Function,R=u.MessageChannel,E=u.String,O=0,I={},P="onreadystatechange";try{n=u.location}catch(k){}var T=function(t){if(l(I,t)){var r=I[t];delete I[t],r()}},L=function(t){return function(){T(t)}},j=function(t){T(t.data)},U=function(t){u.postMessage(E(t),n.protocol+"//"+n.host)};b&&x||(b=function(t){g(arguments.length,1);var r=f(t)?t:A(t),e=v(arguments,1);return I[++O]=function(){s(r,void 0,e)},o(O),O},x=function(t){delete I[t]},m?o=function(t){w.nextTick(L(t))}:S&&S.now?o=function(t){S.now(L(t))}:R&&!y?(a=(i=new R).port2,i.port1.onmessage=j,o=c(a.postMessage,a)):u.addEventListener&&f(u.postMessage)&&!u.importScripts&&n&&"file:"!==n.protocol&&!p(U)?(o=U,u.addEventListener("message",j,!1)):o=P in d("script")?function(t){h.appendChild(d("script")).onreadystatechange=function(){h.removeChild(this),T(t)}}:function(t){setTimeout(L(t),0)}),t.exports={set:b,clear:x}},90143:(t,r,e)=>{var n=e(65968);t.exports=n(1..valueOf)},43231:(t,r,e)=>{var n=e(43329),o=Math.max,i=Math.min;t.exports=function(t,r){var e=n(t);return e<0?o(e+r,0):i(e,r)}},19123:(t,r,e)=>{var n=e(92066),o=TypeError;t.exports=function(t){var r=n(t,"number");if("number"==typeof r)throw o("Can't convert number to bigint");return BigInt(r)}},7331:(t,r,e)=>{var n=e(43329),o=e(34237),i=RangeError;t.exports=function(t){if(void 0===t)return 0;var r=n(t),e=o(r);if(r!==e)throw i("Wrong length or index");return e}},10905:(t,r,e)=>{var n=e(9337),o=e(58885);t.exports=function(t){return n(o(t))}},43329:(t,r,e)=>{var n=e(50917);t.exports=function(t){var r=+t;return r!=r||0===r?0:n(r)}},34237:(t,r,e)=>{var n=e(43329),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},92991:(t,r,e)=>{var n=e(58885),o=Object;t.exports=function(t){return o(n(t))}},84262:(t,r,e)=>{var n=e(72002),o=RangeError;t.exports=function(t,r){var e=n(t);if(e%r)throw o("Wrong offset");return e}},72002:(t,r,e)=>{var n=e(43329),o=RangeError;t.exports=function(t){var r=n(t);if(r<0)throw o("The argument can't be less than 0");return r}},92066:(t,r,e)=>{var n=e(20266),o=e(85052),i=e(49395),a=e(55300),u=e(32914),s=e(70095),c=TypeError,f=s("toPrimitive");t.exports=function(t,r){if(!o(t)||i(t))return t;var e,s=a(t,f);if(s){if(void 0===r&&(r="default"),e=n(s,t,r),!o(e)||i(e))return e;throw c("Can't convert object to primitive value")}return void 0===r&&(r="number"),u(t,r)}},39310:(t,r,e)=>{var n=e(92066),o=e(49395);t.exports=function(t){var r=n(t,"string");return o(r)?r:r+""}},71601:(t,r,e)=>{var n={};n[e(70095)("toStringTag")]="z",t.exports="[object z]"===String(n)},83326:(t,r,e)=>{var n=e(81589),o=String;t.exports=function(t){if("Symbol"===n(t))throw TypeError("Cannot convert a Symbol value to a string");return o(t)}},59821:t=>{var r=String;t.exports=function(t){try{return r(t)}catch(e){return"Object"}}},42574:(t,r,e)=>{"use strict";var n=e(23103),o=e(9859),i=e(20266),a=e(7400),u=e(48200),s=e(9918),c=e(53816),f=e(57728),l=e(65358),p=e(75762),h=e(82292),v=e(34237),d=e(7331),g=e(84262),y=e(39310),m=e(98270),b=e(81589),x=e(85052),w=e(49395),S=e(22391),A=e(91321),R=e(56540),E=e(78151).f,O=e(35215),I=e(89996).forEach,P=e(71832),T=e(31787),L=e(97933),j=e(56407),U=e(20835),k=j.get,C=j.set,_=j.enforce,M=T.f,B=L.f,F=Math.round,N=o.RangeError,D=c.ArrayBuffer,H=D.prototype,q=c.DataView,G=s.NATIVE_ARRAY_BUFFER_VIEWS,V=s.TYPED_ARRAY_TAG,W=s.TypedArray,$=s.TypedArrayPrototype,Y=s.aTypedArrayConstructor,z=s.isTypedArray,K="BYTES_PER_ELEMENT",J="Wrong length",Q=function(t,r){Y(t);for(var e=0,n=r.length,o=new t(n);n>e;)o[e]=r[e++];return o},X=function(t,r){M(t,r,{get:function(){return k(this)[r]}})},Z=function(t){var r;return A(H,t)||"ArrayBuffer"==(r=b(t))||"SharedArrayBuffer"==r},tt=function(t,r){return z(t)&&!w(r)&&r in t&&h(+r)&&r>=0},rt=function(t,r){return r=y(r),tt(t,r)?l(2,t[r]):B(t,r)},et=function(t,r,e){return r=y(r),!(tt(t,r)&&x(e)&&m(e,"value"))||m(e,"get")||m(e,"set")||e.configurable||m(e,"writable")&&!e.writable||m(e,"enumerable")&&!e.enumerable?M(t,r,e):(t[r]=e.value,t)};a?(G||(L.f=rt,T.f=et,X($,"buffer"),X($,"byteOffset"),X($,"byteLength"),X($,"length")),n({target:"Object",stat:!0,forced:!G},{getOwnPropertyDescriptor:rt,defineProperty:et}),t.exports=function(t,r,e){var a=t.match(/\d+$/)[0]/8,s=t+(e?"Clamped":"")+"Array",c="get"+t,l="set"+t,h=o[s],y=h,m=y&&y.prototype,b={},w=function(t,r){M(t,r,{get:function(){return function(t,r){var e=k(t);return e.view[c](r*a+e.byteOffset,!0)}(this,r)},set:function(t){return function(t,r,n){var o=k(t);e&&(n=(n=F(n))<0?0:n>255?255:255&n),o.view[l](r*a+o.byteOffset,n,!0)}(this,r,t)},enumerable:!0})};G?u&&(y=r((function(t,r,e,n){return f(t,m),U(x(r)?Z(r)?void 0!==n?new h(r,g(e,a),n):void 0!==e?new h(r,g(e,a)):new h(r):z(r)?Q(y,r):i(O,y,r):new h(d(r)),t,y)})),R&&R(y,W),I(E(h),(function(t){t in y||p(y,t,h[t])})),y.prototype=m):(y=r((function(t,r,e,n){f(t,m);var o,u,s,c=0,l=0;if(x(r)){if(!Z(r))return z(r)?Q(y,r):i(O,y,r);o=r,l=g(e,a);var p=r.byteLength;if(void 0===n){if(p%a)throw N(J);if((u=p-l)<0)throw N(J)}else if((u=v(n)*a)+l>p)throw N(J);s=u/a}else s=d(r),o=new D(u=s*a);for(C(t,{buffer:o,byteOffset:l,byteLength:u,length:s,view:new q(o)});c<s;)w(t,c++)})),R&&R(y,W),m=y.prototype=S($)),m.constructor!==y&&p(m,"constructor",y),_(m).TypedArrayConstructor=y,V&&p(m,V,s);var A=y!=h;b[s]=y,n({global:!0,constructor:!0,forced:A,sham:!G},b),K in y||p(y,K,a),K in m||p(m,K,a),P(s)}):t.exports=function(){}},48200:(t,r,e)=>{var n=e(9859),o=e(24229),i=e(74575),a=e(9918).NATIVE_ARRAY_BUFFER_VIEWS,u=n.ArrayBuffer,s=n.Int8Array;t.exports=!a||!o((function(){s(1)}))||!o((function(){new s(-1)}))||!i((function(t){new s,new s(null),new s(1.5),new s(t)}),!0)||o((function(){return 1!==new s(new u(2),1,void 0).length}))},35215:(t,r,e)=>{var n=e(97636),o=e(20266),i=e(57988),a=e(92991),u=e(39646),s=e(28403),c=e(78830),f=e(91943),l=e(79098),p=e(9918).aTypedArrayConstructor,h=e(19123);t.exports=function(t){var r,e,v,d,g,y,m,b,x=i(this),w=a(t),S=arguments.length,A=S>1?arguments[1]:void 0,R=void 0!==A,E=c(w);if(E&&!f(E))for(b=(m=s(w,E)).next,w=[];!(y=o(b,m)).done;)w.push(y.value);for(R&&S>2&&(A=n(A,arguments[2])),e=u(w),v=new(p(x))(e),d=l(v),r=0;e>r;r++)g=R?A(w[r],r):w[r],v[r]=d?h(g):+g;return v}},81441:(t,r,e)=>{var n=e(65968),o=0,i=Math.random(),a=n(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++o+i,36)}},34144:(t,r,e)=>{var n=e(24229),o=e(70095),i=e(24231),a=o("iterator");t.exports=!n((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),r=t.searchParams,e="";return t.pathname="c%20d",r.forEach((function(t,n){r.delete("b"),e+=n+t})),i&&!t.toJSON||!r.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==r.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!r[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://\u0442\u0435\u0441\u0442").host||"#%D0%B1"!==new URL("http://a#\u0431").hash||"a1c3"!==e||"x"!==new URL("http://x",void 0).host}))},66969:(t,r,e)=>{var n=e(44860);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},17137:(t,r,e)=>{var n=e(7400),o=e(24229);t.exports=n&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},77579:t=>{var r=TypeError;t.exports=function(t,e){if(t<e)throw r("Not enough arguments");return t}},51180:(t,r,e)=>{var n=e(9859),o=e(26733),i=n.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},63524:(t,r,e)=>{var n=e(49276),o=e(98270),i=e(55391),a=e(31787).f;t.exports=function(t){var r=n.Symbol||(n.Symbol={});o(r,t)||a(r,t,{value:i.f(t)})}},55391:(t,r,e)=>{var n=e(70095);r.f=n},70095:(t,r,e)=>{var n=e(9859),o=e(33036),i=e(98270),a=e(81441),u=e(44860),s=e(66969),c=o("wks"),f=n.Symbol,l=f&&f.for,p=s?f:f&&f.withoutSetter||a;t.exports=function(t){if(!i(c,t)||!u&&"string"!=typeof c[t]){var r="Symbol."+t;u&&i(f,t)?c[t]=f[t]:c[t]=s&&l?l(r):p(r)}return c[t]}},41647:t=>{t.exports="\t\n\v\f\r \xa0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff"},65388:(t,r,e)=>{"use strict";var n=e(23103),o=e(9859),i=e(53816),a=e(71832),u="ArrayBuffer",s=i.ArrayBuffer;n({global:!0,constructor:!0,forced:o.ArrayBuffer!==s},{ArrayBuffer:s}),a(u)},72994:(t,r,e)=>{"use strict";var n=e(23103),o=e(65968),i=e(24229),a=e(53816),u=e(21176),s=e(43231),c=e(34237),f=e(37942),l=a.ArrayBuffer,p=a.DataView,h=p.prototype,v=o(l.prototype.slice),d=o(h.getUint8),g=o(h.setUint8);n({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:i((function(){return!new l(2).slice(1,void 0).byteLength}))},{slice:function(t,r){if(v&&void 0===r)return v(u(this),t);for(var e=u(this).byteLength,n=s(t,e),o=s(void 0===r?e:r,e),i=new(f(this,l))(c(o-n)),a=new p(this),h=new p(i),y=0;n<o;)g(h,y++,d(a,n++));return i}})},84870:(t,r,e)=>{"use strict";var n=e(23103),o=e(34990),i=e(77111),a=e(92991),u=e(39646),s=e(87501);n({target:"Array",proto:!0},{flatMap:function(t){var r,e=a(this),n=u(e);return i(t),(r=s(e,0)).length=o(r,e,e,n,0,1,t,arguments.length>1?arguments[1]:void 0),r}})},27072:(t,r,e)=>{"use strict";var n=e(23103),o=e(34990),i=e(92991),a=e(39646),u=e(43329),s=e(87501);n({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,r=i(this),e=a(r),n=s(r,0);return n.length=o(n,r,r,e,0,void 0===t?1:u(t)),n}})},39529:(t,r,e)=>{"use strict";var n=e(23103),o=e(19540).includes,i=e(24229),a=e(9736);n({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),a("includes")},15735:(t,r,e)=>{"use strict";var n=e(10905),o=e(9736),i=e(45495),a=e(56407),u=e(31787).f,s=e(12707),c=e(33684),f=e(24231),l=e(7400),p="Array Iterator",h=a.set,v=a.getterFor(p);t.exports=s(Array,"Array",(function(t,r){h(this,{type:p,target:n(t),index:0,kind:r})}),(function(){var t=v(this),r=t.target,e=t.kind,n=t.index++;return!r||n>=r.length?(t.target=void 0,c(void 0,!0)):c("keys"==e?n:"values"==e?r[n]:[n,r[n]],!1)}),"values");var d=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!f&&l&&"values"!==d.name)try{u(d,"name",{value:"values"})}catch(g){}},9731:(t,r,e)=>{"use strict";var n=e(23103),o=e(43143).right,i=e(96038),a=e(6358),u=e(28801);n({target:"Array",proto:!0,forced:!i("reduceRight")||!u&&a>79&&a<83},{reduceRight:function(t){return o(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}})},43108:(t,r,e)=>{"use strict";var n=e(23103),o=e(43143).left,i=e(96038),a=e(6358),u=e(28801);n({target:"Array",proto:!0,forced:!i("reduce")||!u&&a>79&&a<83},{reduce:function(t){var r=arguments.length;return o(this,t,r,r>1?arguments[1]:void 0)}})},49992:(t,r,e)=>{"use strict";var n=e(23103),o=e(65968),i=e(33718),a=o([].reverse),u=[1,2];n({target:"Array",proto:!0,forced:String(u)===String(u.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),a(this)}})},43430:(t,r,e)=>{"use strict";var n=e(23103),o=e(65968),i=e(77111),a=e(92991),u=e(39646),s=e(79563),c=e(83326),f=e(24229),l=e(33867),p=e(96038),h=e(22671),v=e(48506),d=e(6358),g=e(49811),y=[],m=o(y.sort),b=o(y.push),x=f((function(){y.sort(void 0)})),w=f((function(){y.sort(null)})),S=p("sort"),A=!f((function(){if(d)return d<70;if(!(h&&h>3)){if(v)return!0;if(g)return g<603;var t,r,e,n,o="";for(t=65;t<76;t++){switch(r=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:e=3;break;case 68:case 71:e=4;break;default:e=2}for(n=0;n<47;n++)y.push({k:r+n,v:e})}for(y.sort((function(t,r){return r.v-t.v})),n=0;n<y.length;n++)r=y[n].k.charAt(0),o.charAt(o.length-1)!==r&&(o+=r);return"DGBEFHACIJK"!==o}}));n({target:"Array",proto:!0,forced:x||!w||!S||!A},{sort:function(t){void 0!==t&&i(t);var r=a(this);if(A)return void 0===t?m(r):m(r,t);var e,n,o=[],f=u(r);for(n=0;n<f;n++)n in r&&b(o,r[n]);for(l(o,function(t){return function(r,e){return void 0===e?-1:void 0===r?1:void 0!==t?+t(r,e)||0:c(r)>c(e)?1:-1}}(t)),e=u(o),n=0;n<e;)r[n]=o[n++];for(;n<f;)s(r,n++);return r}})},53985:(t,r,e)=>{e(9736)("flatMap")},67694:(t,r,e)=>{e(9736)("flat")},39509:(t,r,e)=>{var n=e(23103),o=Math.hypot,i=Math.abs,a=Math.sqrt;n({target:"Math",stat:!0,arity:2,forced:!!o&&o(1/0,NaN)!==1/0},{hypot:function(t,r){for(var e,n,o=0,u=0,s=arguments.length,c=0;u<s;)c<(e=i(arguments[u++]))?(o=o*(n=c/e)*n+1,c=e):o+=e>0?(n=e/c)*n:e;return c===1/0?1/0:c*a(o)}})},48836:(t,r,e)=>{var n=e(23103),o=e(45496);n({target:"Number",stat:!0,forced:Number.parseFloat!=o},{parseFloat:o})},77208:(t,r,e)=>{var n=e(23103),o=e(36596);n({target:"Number",stat:!0,forced:Number.parseInt!=o},{parseInt:o})},61657:(t,r,e)=>{"use strict";var n=e(23103),o=e(65968),i=e(43329),a=e(90143),u=e(93124),s=e(24229),c=RangeError,f=String,l=Math.floor,p=o(u),h=o("".slice),v=o(1..toFixed),d=function(t,r,e){return 0===r?e:r%2==1?d(t,r-1,e*t):d(t*t,r/2,e)},g=function(t,r,e){for(var n=-1,o=e;++n<6;)o+=r*t[n],t[n]=o%1e7,o=l(o/1e7)},y=function(t,r){for(var e=6,n=0;--e>=0;)n+=t[e],t[e]=l(n/r),n=n%r*1e7},m=function(t){for(var r=6,e="";--r>=0;)if(""!==e||0===r||0!==t[r]){var n=f(t[r]);e=""===e?n:e+p("0",7-n.length)+n}return e};n({target:"Number",proto:!0,forced:s((function(){return"0.000"!==v(8e-5,3)||"1"!==v(.9,0)||"1.25"!==v(1.255,2)||"1000000000000000128"!==v(0xde0b6b3a7640080,0)}))||!s((function(){v({})}))},{toFixed:function(t){var r,e,n,o,u=a(this),s=i(t),l=[0,0,0,0,0,0],v="",b="0";if(s<0||s>20)throw c("Incorrect fraction digits");if(u!=u)return"NaN";if(u<=-1e21||u>=1e21)return f(u);if(u<0&&(v="-",u=-u),u>1e-21)if(e=(r=function(t){for(var r=0,e=t;e>=4096;)r+=12,e/=4096;for(;e>=2;)r+=1,e/=2;return r}(u*d(2,69,1))-69)<0?u*d(2,-r,1):u/d(2,r,1),e*=4503599627370496,(r=52-r)>0){for(g(l,0,e),n=s;n>=7;)g(l,1e7,0),n-=7;for(g(l,d(10,n,1),0),n=r-1;n>=23;)y(l,1<<23),n-=23;y(l,1<<n),g(l,1,1),y(l,2),b=m(l)}else g(l,0,e),g(l,1<<-r,0),b=m(l)+p("0",s);return b=s>0?v+((o=b.length)<=s?"0."+p("0",s-o)+b:h(b,0,o-s)+"."+h(b,o-s)):v+b}})},43105:(t,r,e)=>{var n=e(23103),o=e(47);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==o},{assign:o})},37846:(t,r,e)=>{"use strict";var n=e(23103),o=e(7400),i=e(15020),a=e(77111),u=e(92991),s=e(31787);o&&n({target:"Object",proto:!0,forced:i},{__defineGetter__:function(t,r){s.f(u(this),t,{get:a(r),enumerable:!0,configurable:!0})}})},16635:(t,r,e)=>{"use strict";var n=e(23103),o=e(7400),i=e(15020),a=e(77111),u=e(92991),s=e(31787);o&&n({target:"Object",proto:!0,forced:i},{__defineSetter__:function(t,r){s.f(u(this),t,{set:a(r),enumerable:!0,configurable:!0})}})},81804:(t,r,e)=>{var n=e(23103),o=e(89003),i=e(62324);n({target:"Object",stat:!0},{fromEntries:function(t){var r={};return o(t,(function(t,e){i(r,t,e)}),{AS_ENTRIES:!0}),r}})},42586:(t,r,e)=>{"use strict";var n=e(23103),o=e(7400),i=e(15020),a=e(92991),u=e(39310),s=e(67567),c=e(97933).f;o&&n({target:"Object",proto:!0,forced:i},{__lookupGetter__:function(t){var r,e=a(this),n=u(t);do{if(r=c(e,n))return r.get}while(e=s(e))}})},43045:(t,r,e)=>{"use strict";var n=e(23103),o=e(7400),i=e(15020),a=e(92991),u=e(39310),s=e(67567),c=e(97933).f;o&&n({target:"Object",proto:!0,forced:i},{__lookupSetter__:function(t){var r,e=a(this),n=u(t);do{if(r=c(e,n))return r.set}while(e=s(e))}})},13489:(t,r,e)=>{var n=e(23103),o=e(45496);n({global:!0,forced:parseFloat!=o},{parseFloat:o})},68995:(t,r,e)=>{var n=e(23103),o=e(36596);n({global:!0,forced:parseInt!=o},{parseInt:o})},56032:(t,r,e)=>{"use strict";var n=e(23103),o=e(20266),i=e(77111),a=e(16485),u=e(64624),s=e(89003);n({target:"Promise",stat:!0,forced:e(96866)},{all:function(t){var r=this,e=a.f(r),n=e.resolve,c=e.reject,f=u((function(){var e=i(r.resolve),a=[],u=0,f=1;s(t,(function(t){var i=u++,s=!1;f++,o(e,r,t).then((function(t){s||(s=!0,a[i]=t,--f||n(a))}),c)})),--f||n(a)}));return f.error&&c(f.value),e.promise}})},6135:(t,r,e)=>{"use strict";var n=e(23103),o=e(24231),i=e(38321).CONSTRUCTOR,a=e(74473),u=e(31333),s=e(26733),c=e(14768),f=a&&a.prototype;if(n({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(t){return this.then(void 0,t)}}),!o&&s(a)){var l=u("Promise").prototype.catch;f.catch!==l&&c(f,"catch",l,{unsafe:!0})}},86087:(t,r,e)=>{"use strict";var n,o,i,a=e(23103),u=e(24231),s=e(28801),c=e(9859),f=e(20266),l=e(14768),p=e(56540),h=e(54555),v=e(71832),d=e(77111),g=e(26733),y=e(85052),m=e(57728),b=e(37942),x=e(55795).set,w=e(24794),S=e(14665),A=e(64624),R=e(93358),E=e(56407),O=e(74473),I=e(38321),P=e(16485),T="Promise",L=I.CONSTRUCTOR,j=I.REJECTION_EVENT,U=I.SUBCLASSING,k=E.getterFor(T),C=E.set,_=O&&O.prototype,M=O,B=_,F=c.TypeError,N=c.document,D=c.process,H=P.f,q=H,G=!!(N&&N.createEvent&&c.dispatchEvent),V="unhandledrejection",W=function(t){var r;return!(!y(t)||!g(r=t.then))&&r},$=function(t,r){var e,n,o,i=r.value,a=1==r.state,u=a?t.ok:t.fail,s=t.resolve,c=t.reject,l=t.domain;try{u?(a||(2===r.rejection&&Q(r),r.rejection=1),!0===u?e=i:(l&&l.enter(),e=u(i),l&&(l.exit(),o=!0)),e===t.promise?c(F("Promise-chain cycle")):(n=W(e))?f(n,e,s,c):s(e)):c(i)}catch(p){l&&!o&&l.exit(),c(p)}},Y=function(t,r){t.notified||(t.notified=!0,w((function(){for(var e,n=t.reactions;e=n.get();)$(e,t);t.notified=!1,r&&!t.rejection&&K(t)})))},z=function(t,r,e){var n,o;G?((n=N.createEvent("Event")).promise=r,n.reason=e,n.initEvent(t,!1,!0),c.dispatchEvent(n)):n={promise:r,reason:e},!j&&(o=c["on"+t])?o(n):t===V&&S("Unhandled promise rejection",e)},K=function(t){f(x,c,(function(){var r,e=t.facade,n=t.value;if(J(t)&&(r=A((function(){s?D.emit("unhandledRejection",n,e):z(V,e,n)})),t.rejection=s||J(t)?2:1,r.error))throw r.value}))},J=function(t){return 1!==t.rejection&&!t.parent},Q=function(t){f(x,c,(function(){var r=t.facade;s?D.emit("rejectionHandled",r):z("rejectionhandled",r,t.value)}))},X=function(t,r,e){return function(n){t(r,n,e)}},Z=function(t,r,e){t.done||(t.done=!0,e&&(t=e),t.value=r,t.state=2,Y(t,!0))},tt=function(t,r,e){if(!t.done){t.done=!0,e&&(t=e);try{if(t.facade===r)throw F("Promise can't be resolved itself");var n=W(r);n?w((function(){var e={done:!1};try{f(n,r,X(tt,e,t),X(Z,e,t))}catch(o){Z(e,o,t)}})):(t.value=r,t.state=1,Y(t,!1))}catch(o){Z({done:!1},o,t)}}};if(L&&(B=(M=function(t){m(this,B),d(t),f(n,this);var r=k(this);try{t(X(tt,r),X(Z,r))}catch(e){Z(r,e)}}).prototype,(n=function(t){C(this,{type:T,done:!1,notified:!1,parent:!1,reactions:new R,rejection:!1,state:0,value:void 0})}).prototype=l(B,"then",(function(t,r){var e=k(this),n=H(b(this,M));return e.parent=!0,n.ok=!g(t)||t,n.fail=g(r)&&r,n.domain=s?D.domain:void 0,0==e.state?e.reactions.add(n):w((function(){$(n,e)})),n.promise})),o=function(){var t=new n,r=k(t);this.promise=t,this.resolve=X(tt,r),this.reject=X(Z,r)},P.f=H=function(t){return t===M||undefined===t?new o(t):q(t)},!u&&g(O)&&_!==Object.prototype)){i=_.then,U||l(_,"then",(function(t,r){var e=this;return new M((function(t,r){f(i,e,t,r)})).then(t,r)}),{unsafe:!0});try{delete _.constructor}catch(rt){}p&&p(_,B)}a({global:!0,constructor:!0,wrap:!0,forced:L},{Promise:M}),h(M,T,!1,!0),v(T)},21515:(t,r,e)=>{"use strict";var n=e(23103),o=e(24231),i=e(74473),a=e(24229),u=e(31333),s=e(26733),c=e(37942),f=e(62391),l=e(14768),p=i&&i.prototype;if(n({target:"Promise",proto:!0,real:!0,forced:!!i&&a((function(){p.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var r=c(this,u("Promise")),e=s(t);return this.then(e?function(e){return f(r,t()).then((function(){return e}))}:t,e?function(e){return f(r,t()).then((function(){throw e}))}:t)}}),!o&&s(i)){var h=u("Promise").prototype.finally;p.finally!==h&&l(p,"finally",h,{unsafe:!0})}},73439:(t,r,e)=>{e(86087),e(56032),e(6135),e(26767),e(39320),e(52047)},26767:(t,r,e)=>{"use strict";var n=e(23103),o=e(20266),i=e(77111),a=e(16485),u=e(64624),s=e(89003);n({target:"Promise",stat:!0,forced:e(96866)},{race:function(t){var r=this,e=a.f(r),n=e.reject,c=u((function(){var a=i(r.resolve);s(t,(function(t){o(a,r,t).then(e.resolve,n)}))}));return c.error&&n(c.value),e.promise}})},39320:(t,r,e)=>{"use strict";var n=e(23103),o=e(20266),i=e(16485);n({target:"Promise",stat:!0,forced:e(38321).CONSTRUCTOR},{reject:function(t){var r=i.f(this);return o(r.reject,void 0,t),r.promise}})},52047:(t,r,e)=>{"use strict";var n=e(23103),o=e(31333),i=e(24231),a=e(74473),u=e(38321).CONSTRUCTOR,s=e(62391),c=o("Promise"),f=i&&!u;n({target:"Promise",stat:!0,forced:i||u},{resolve:function(t){return s(f&&this===c?a:this,t)}})},98738:(t,r,e)=>{var n=e(23103),o=e(20266),i=e(21176),a=e(85052),u=e(90193),s=e(24229),c=e(31787),f=e(97933),l=e(67567),p=e(65358);n({target:"Reflect",stat:!0,forced:s((function(){var t=function(){},r=c.f(new t,"a",{configurable:!0});return!1!==Reflect.set(t.prototype,"a",1,r)}))},{set:function t(r,e,n){var s,h,v,d=arguments.length<4?r:arguments[3],g=f.f(i(r),e);if(!g){if(a(h=l(r)))return t(h,e,n,d);g=p(0)}if(u(g)){if(!1===g.writable||!a(d))return!1;if(s=f.f(d,e)){if(s.get||s.set||!1===s.writable)return!1;s.value=n,c.f(d,e,s)}else c.f(d,e,p(0,n))}else{if(void 0===(v=g.set))return!1;o(v,d,n)}return!0}})},17368:(t,r,e)=>{var n=e(7400),o=e(9859),i=e(65968),a=e(46541),u=e(20835),s=e(75762),c=e(78151).f,f=e(91321),l=e(48311),p=e(83326),h=e(83349),v=e(25650),d=e(26060),g=e(14768),y=e(24229),m=e(98270),b=e(56407).enforce,x=e(71832),w=e(70095),S=e(42926),A=e(10461),R=w("match"),E=o.RegExp,O=E.prototype,I=o.SyntaxError,P=i(O.exec),T=i("".charAt),L=i("".replace),j=i("".indexOf),U=i("".slice),k=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,C=/a/g,_=/a/g,M=new E(C)!==C,B=v.MISSED_STICKY,F=v.UNSUPPORTED_Y,N=n&&(!M||B||S||A||y((function(){return _[R]=!1,E(C)!=C||E(_)==_||"/a/i"!=E(C,"i")})));if(a("RegExp",N)){for(var D=function(t,r){var e,n,o,i,a,c,v=f(O,this),d=l(t),g=void 0===r,y=[],x=t;if(!v&&d&&g&&t.constructor===D)return t;if((d||f(O,t))&&(t=t.source,g&&(r=h(x))),t=void 0===t?"":p(t),r=void 0===r?"":p(r),x=t,S&&"dotAll"in C&&(n=!!r&&j(r,"s")>-1)&&(r=L(r,/s/g,"")),e=r,B&&"sticky"in C&&(o=!!r&&j(r,"y")>-1)&&F&&(r=L(r,/y/g,"")),A&&(i=function(t){for(var r,e=t.length,n=0,o="",i=[],a={},u=!1,s=!1,c=0,f="";n<=e;n++){if("\\"===(r=T(t,n)))r+=T(t,++n);else if("]"===r)u=!1;else if(!u)switch(!0){case"["===r:u=!0;break;case"("===r:P(k,U(t,n+1))&&(n+=2,s=!0),o+=r,c++;continue;case">"===r&&s:if(""===f||m(a,f))throw new I("Invalid capture group name");a[f]=!0,i[i.length]=[f,c],s=!1,f="";continue}s?f+=r:o+=r}return[o,i]}(t),t=i[0],y=i[1]),a=u(E(t,r),v?this:O,D),(n||o||y.length)&&(c=b(a),n&&(c.dotAll=!0,c.raw=D(function(t){for(var r,e=t.length,n=0,o="",i=!1;n<=e;n++)"\\"!==(r=T(t,n))?i||"."!==r?("["===r?i=!0:"]"===r&&(i=!1),o+=r):o+="[\\s\\S]":o+=r+T(t,++n);return o}(t),e)),o&&(c.sticky=!0),y.length&&(c.groups=y)),t!==x)try{s(a,"source",""===x?"(?:)":x)}catch(w){}return a},H=c(E),q=0;H.length>q;)d(D,E,H[q++]);O.constructor=D,D.prototype=O,g(o,"RegExp",D,{constructor:!0})}x("RegExp")},77950:(t,r,e)=>{"use strict";var n=e(23103),o=e(63466);n({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},90103:(t,r,e)=>{var n=e(9859),o=e(7400),i=e(96616),a=e(30895),u=e(24229),s=n.RegExp,c=s.prototype;o&&u((function(){var t=!0;try{s(".","d")}catch(u){t=!1}var r={},e="",n=t?"dgimsy":"gimsy",o=function(t,n){Object.defineProperty(r,t,{get:function(){return e+=n,!0}})},i={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var a in t&&(i.hasIndices="d"),i)o(a,i[a]);return Object.getOwnPropertyDescriptor(c,"flags").get.call(r)!==n||e!==n}))&&i(c,"flags",{configurable:!0,get:a})},88233:(t,r,e)=>{"use strict";var n=e(51805).PROPER,o=e(14768),i=e(21176),a=e(83326),u=e(24229),s=e(83349),c="toString",f=RegExp.prototype.toString,l=u((function(){return"/a/b"!=f.call({source:"a",flags:"b"})})),p=n&&f.name!=c;(l||p)&&o(RegExp.prototype,c,(function(){var t=i(this);return"/"+a(t.source)+"/"+a(s(t))}),{unsafe:!0})},96708:(t,r,e)=>{"use strict";var n,o=e(23103),i=e(65968),a=e(97933).f,u=e(34237),s=e(83326),c=e(47272),f=e(58885),l=e(48127),p=e(24231),h=i("".endsWith),v=i("".slice),d=Math.min,g=l("endsWith");o({target:"String",proto:!0,forced:!!(p||g||(n=a(String.prototype,"endsWith"),!n||n.writable))&&!g},{endsWith:function(t){var r=s(f(this));c(t);var e=arguments.length>1?arguments[1]:void 0,n=r.length,o=void 0===e?n:d(u(e),n),i=s(t);return h?h(r,i,o):v(r,o-i.length,o)===i}})},31235:(t,r,e)=>{"use strict";var n=e(23103),o=e(65968),i=e(47272),a=e(58885),u=e(83326),s=e(48127),c=o("".indexOf);n({target:"String",proto:!0,forced:!s("includes")},{includes:function(t){return!!~c(u(a(this)),u(i(t)),arguments.length>1?arguments[1]:void 0)}})},28673:(t,r,e)=>{"use strict";var n=e(30966).charAt,o=e(83326),i=e(56407),a=e(12707),u=e(33684),s="String Iterator",c=i.set,f=i.getterFor(s);a(String,"String",(function(t){c(this,{type:s,string:o(t),index:0})}),(function(){var t,r=f(this),e=r.string,o=r.index;return o>=e.length?u(void 0,!0):(t=n(e,o),r.index+=t.length,u(t,!1))}))},74069:(t,r,e)=>{"use strict";var n=e(20266),o=e(94954),i=e(21176),a=e(9650),u=e(34237),s=e(83326),c=e(58885),f=e(55300),l=e(36637),p=e(98115);o("match",(function(t,r,e){return[function(r){var e=c(this),o=a(r)?void 0:f(r,t);return o?n(o,r,e):new RegExp(r)[t](s(e))},function(t){var n=i(this),o=s(t),a=e(r,n,o);if(a.done)return a.value;if(!n.global)return p(n,o);var c=n.unicode;n.lastIndex=0;for(var f,h=[],v=0;null!==(f=p(n,o));){var d=s(f[0]);h[v]=d,""===d&&(n.lastIndex=l(o,u(n.lastIndex),c)),v++}return 0===v?null:h}]}))},90977:(t,r,e)=>{"use strict";var n=e(23103),o=e(46650).end;n({target:"String",proto:!0,forced:e(57456)},{padEnd:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},35734:(t,r,e)=>{"use strict";var n=e(23103),o=e(46650).start;n({target:"String",proto:!0,forced:e(57456)},{padStart:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},85940:(t,r,e)=>{"use strict";var n=e(53171),o=e(20266),i=e(65968),a=e(94954),u=e(24229),s=e(21176),c=e(26733),f=e(9650),l=e(43329),p=e(34237),h=e(83326),v=e(58885),d=e(36637),g=e(55300),y=e(70017),m=e(98115),b=e(70095)("replace"),x=Math.max,w=Math.min,S=i([].concat),A=i([].push),R=i("".indexOf),E=i("".slice),O="$0"==="a".replace(/./,"$0"),I=!!/./[b]&&""===/./[b]("a","$0");a("replace",(function(t,r,e){var i=I?"$":"$0";return[function(t,e){var n=v(this),i=f(t)?void 0:g(t,b);return i?o(i,t,n,e):o(r,h(n),t,e)},function(t,o){var a=s(this),u=h(t);if("string"==typeof o&&-1===R(o,i)&&-1===R(o,"$<")){var f=e(r,a,u,o);if(f.done)return f.value}var v=c(o);v||(o=h(o));var g=a.global;if(g){var b=a.unicode;a.lastIndex=0}for(var O=[];;){var I=m(a,u);if(null===I)break;if(A(O,I),!g)break;""===h(I[0])&&(a.lastIndex=d(u,p(a.lastIndex),b))}for(var P,T="",L=0,j=0;j<O.length;j++){for(var U=h((I=O[j])[0]),k=x(w(l(I.index),u.length),0),C=[],_=1;_<I.length;_++)A(C,void 0===(P=I[_])?P:String(P));var M=I.groups;if(v){var B=S([U],C,k,u);void 0!==M&&A(B,M);var F=h(n(o,void 0,B))}else F=y(U,u,k,C,M,o);k>=L&&(T+=E(u,L,k)+F,L=k+U.length)}return T+E(u,L)}]}),!!u((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!O||I)},94908:(t,r,e)=>{"use strict";var n=e(20266),o=e(94954),i=e(21176),a=e(9650),u=e(58885),s=e(72101),c=e(83326),f=e(55300),l=e(98115);o("search",(function(t,r,e){return[function(r){var e=u(this),o=a(r)?void 0:f(r,t);return o?n(o,r,e):new RegExp(r)[t](c(e))},function(t){var n=i(this),o=c(t),a=e(r,n,o);if(a.done)return a.value;var u=n.lastIndex;s(u,0)||(n.lastIndex=0);var f=l(n,o);return s(n.lastIndex,u)||(n.lastIndex=u),null===f?-1:f.index}]}))},48319:(t,r,e)=>{"use strict";var n=e(53171),o=e(20266),i=e(65968),a=e(94954),u=e(21176),s=e(9650),c=e(48311),f=e(58885),l=e(37942),p=e(36637),h=e(34237),v=e(83326),d=e(55300),g=e(69794),y=e(98115),m=e(63466),b=e(25650),x=e(24229),w=b.UNSUPPORTED_Y,S=4294967295,A=Math.min,R=[].push,E=i(/./.exec),O=i(R),I=i("".slice);a("split",(function(t,r,e){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,e){var i=v(f(this)),a=void 0===e?S:e>>>0;if(0===a)return[];if(void 0===t)return[i];if(!c(t))return o(r,i,t,a);for(var u,s,l,p=[],h=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),d=0,y=new RegExp(t.source,h+"g");(u=o(m,y,i))&&!((s=y.lastIndex)>d&&(O(p,I(i,d,u.index)),u.length>1&&u.index<i.length&&n(R,p,g(u,1)),l=u[0].length,d=s,p.length>=a));)y.lastIndex===u.index&&y.lastIndex++;return d===i.length?!l&&E(y,"")||O(p,""):O(p,I(i,d)),p.length>a?g(p,0,a):p}:"0".split(void 0,0).length?function(t,e){return void 0===t&&0===e?[]:o(r,this,t,e)}:r,[function(r,e){var n=f(this),a=s(r)?void 0:d(r,t);return a?o(a,r,n,e):o(i,v(n),r,e)},function(t,n){var o=u(this),a=v(t),s=e(i,o,a,n,i!==r);if(s.done)return s.value;var c=l(o,RegExp),f=o.unicode,d=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(w?"g":"y"),g=new c(w?"^(?:"+o.source+")":o,d),m=void 0===n?S:n>>>0;if(0===m)return[];if(0===a.length)return null===y(g,a)?[a]:[];for(var b=0,x=0,R=[];x<a.length;){g.lastIndex=w?0:x;var E,P=y(g,w?I(a,x):a);if(null===P||(E=A(h(g.lastIndex+(w?x:0)),a.length))===b)x=p(a,x,f);else{if(O(R,I(a,b,x)),R.length===m)return R;for(var T=1;T<=P.length-1;T++)if(O(R,P[T]),R.length===m)return R;x=b=E}}return O(R,I(a,b)),R}]}),!!x((function(){var t=/(?:)/,r=t.exec;t.exec=function(){return r.apply(this,arguments)};var e="ab".split(t);return 2!==e.length||"a"!==e[0]||"b"!==e[1]})),w)},44112:(t,r,e)=>{"use strict";var n,o=e(23103),i=e(65968),a=e(97933).f,u=e(34237),s=e(83326),c=e(47272),f=e(58885),l=e(48127),p=e(24231),h=i("".startsWith),v=i("".slice),d=Math.min,g=l("startsWith");o({target:"String",proto:!0,forced:!!(p||g||(n=a(String.prototype,"startsWith"),!n||n.writable))&&!g},{startsWith:function(t){var r=s(f(this));c(t);var e=u(d(arguments.length>1?arguments[1]:void 0,r.length)),n=s(t);return h?h(r,n,e):v(r,e,e+n.length)===n}})},18827:(t,r,e)=>{e(65625);var n=e(23103),o=e(61466);n({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==o},{trimEnd:o})},18763:(t,r,e)=>{var n=e(23103),o=e(58747);n({target:"String",proto:!0,name:"trimStart",forced:"".trimLeft!==o},{trimLeft:o})},65625:(t,r,e)=>{var n=e(23103),o=e(61466);n({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==o},{trimRight:o})},41715:(t,r,e)=>{e(18763);var n=e(23103),o=e(58747);n({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==o},{trimStart:o})},45794:(t,r,e)=>{"use strict";var n=e(23103),o=e(1017).trim;n({target:"String",proto:!0,forced:e(9445)("trim")},{trim:function(){return o(this)}})},96882:(t,r,e)=>{e(63524)("asyncIterator")},634:(t,r,e)=>{"use strict";var n=e(23103),o=e(7400),i=e(9859),a=e(65968),u=e(98270),s=e(26733),c=e(91321),f=e(83326),l=e(31787).f,p=e(77081),h=i.Symbol,v=h&&h.prototype;if(o&&s(h)&&(!("description"in v)||void 0!==h().description)){var d={},g=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:f(arguments[0]),r=c(v,this)?new h(t):void 0===t?h():h(t);return""===t&&(d[r]=!0),r};p(g,h),g.prototype=v,v.constructor=g;var y="Symbol(test)"==String(h("test")),m=a(v.valueOf),b=a(v.toString),x=/^Symbol\((.*)\)[^)]+$/,w=a("".replace),S=a("".slice);l(v,"description",{configurable:!0,get:function(){var t=m(this);if(u(d,t))return"";var r=b(t),e=y?S(r,7,-1):w(r,x,"$1");return""===e?void 0:e}}),n({global:!0,constructor:!0,forced:!0},{Symbol:g})}},64844:(t,r,e)=>{e(63524)("match")},40225:(t,r,e)=>{e(63524)("replace")},71686:(t,r,e)=>{e(63524)("search")},68223:(t,r,e)=>{e(63524)("split")},38857:(t,r,e)=>{"use strict";var n=e(9918),o=e(97065),i=e(19123),a=e(81589),u=e(20266),s=e(65968),c=e(24229),f=n.aTypedArray,l=n.exportTypedArrayMethod,p=s("".slice);l("fill",(function(t){var r=arguments.length;f(this);var e="Big"===p(a(this),0,3)?i(t):+t;return u(o,this,e,r>1?arguments[1]:void 0,r>2?arguments[2]:void 0)}),c((function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),1!==t})))},81382:(t,r,e)=>{e(42574)("Float32",(function(t){return function(r,e,n){return t(this,r,e,n)}}))},91982:(t,r,e)=>{e(42574)("Float64",(function(t){return function(r,e,n){return t(this,r,e,n)}}))},26618:(t,r,e)=>{"use strict";var n=e(48200);(0,e(9918).exportTypedArrayStaticMethod)("from",e(35215),n)},24074:(t,r,e)=>{e(42574)("Int16",(function(t){return function(r,e,n){return t(this,r,e,n)}}))},64696:(t,r,e)=>{e(42574)("Int32",(function(t){return function(r,e,n){return t(this,r,e,n)}}))},73229:(t,r,e)=>{e(42574)("Int8",(function(t){return function(r,e,n){return t(this,r,e,n)}}))},49527:(t,r,e)=>{"use strict";var n=e(9918),o=e(48200),i=n.aTypedArrayConstructor;(0,n.exportTypedArrayStaticMethod)("of",(function(){for(var t=0,r=arguments.length,e=new(i(this))(r);r>t;)e[t]=arguments[t++];return e}),o)},65688:(t,r,e)=>{"use strict";var n=e(9859),o=e(20266),i=e(9918),a=e(39646),u=e(84262),s=e(92991),c=e(24229),f=n.RangeError,l=n.Int8Array,p=l&&l.prototype,h=p&&p.set,v=i.aTypedArray,d=i.exportTypedArrayMethod,g=!c((function(){var t=new Uint8ClampedArray(2);return o(h,t,{length:1,0:3},1),3!==t[1]})),y=g&&i.NATIVE_ARRAY_BUFFER_VIEWS&&c((function(){var t=new l(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]}));d("set",(function(t){v(this);var r=u(arguments.length>1?arguments[1]:void 0,1),e=s(t);if(g)return o(h,this,e,r);var n=this.length,i=a(e),c=0;if(i+r>n)throw f("Wrong length");for(;c<i;)this[r+c]=e[c++]}),!g||y)},70315:(t,r,e)=>{"use strict";var n=e(9859),o=e(65968),i=e(24229),a=e(77111),u=e(33867),s=e(9918),c=e(22671),f=e(48506),l=e(6358),p=e(49811),h=s.aTypedArray,v=s.exportTypedArrayMethod,d=n.Uint16Array,g=d&&o(d.prototype.sort),y=!(!g||i((function(){g(new d(2),null)}))&&i((function(){g(new d(2),{})}))),m=!!g&&!i((function(){if(l)return l<74;if(c)return c<67;if(f)return!0;if(p)return p<602;var t,r,e=new d(516),n=Array(516);for(t=0;t<516;t++)r=t%4,e[t]=515-t,n[t]=t-2*r+3;for(g(e,(function(t,r){return(t/4|0)-(r/4|0)})),t=0;t<516;t++)if(e[t]!==n[t])return!0}));v("sort",(function(t){return void 0!==t&&a(t),m?g(this,t):u(h(this),function(t){return function(r,e){return void 0!==t?+t(r,e)||0:e!=e?-1:r!=r?1:0===r&&0===e?1/r>0&&1/e<0?1:-1:r>e}}(t))}),!m||y)},50556:(t,r,e)=>{"use strict";var n=e(9859),o=e(53171),i=e(9918),a=e(24229),u=e(1909),s=n.Int8Array,c=i.aTypedArray,f=i.exportTypedArrayMethod,l=[].toLocaleString,p=!!s&&a((function(){l.call(new s(1))}));f("toLocaleString",(function(){return o(l,p?u(c(this)):c(this),u(arguments))}),a((function(){return[1,2].toLocaleString()!=new s([1,2]).toLocaleString()}))||!a((function(){s.prototype.toLocaleString.call([1,2])})))},13161:(t,r,e)=>{e(42574)("Uint16",(function(t){return function(r,e,n){return t(this,r,e,n)}}))},90723:(t,r,e)=>{e(42574)("Uint32",(function(t){return function(r,e,n){return t(this,r,e,n)}}))},13675:(t,r,e)=>{e(42574)("Uint8",(function(t){return function(r,e,n){return t(this,r,e,n)}}))},36920:(t,r,e)=>{e(42574)("Uint8",(function(t){return function(r,e,n){return t(this,r,e,n)}}),!0)},78596:(t,r,e)=>{var n=e(23103),o=e(9859),i=e(55795).clear;n({global:!0,bind:!0,enumerable:!0,forced:o.clearImmediate!==i},{clearImmediate:i})},6886:(t,r,e)=>{var n=e(9859),o=e(95694),i=e(18865),a=e(15735),u=e(75762),s=e(70095),c=s("iterator"),f=s("toStringTag"),l=a.values,p=function(t,r){if(t){if(t[c]!==l)try{u(t,c,l)}catch(n){t[c]=l}if(t[f]||u(t,f,r),o[r])for(var e in a)if(t[e]!==a[e])try{u(t,e,a[e])}catch(n){t[e]=a[e]}}};for(var h in o)p(n[h]&&n[h].prototype,h);p(i,"DOMTokenList")},46106:(t,r,e)=>{e(78596),e(86471)},19866:(t,r,e)=>{var n=e(23103),o=e(9859),i=e(24794),a=e(77111),u=e(77579),s=e(28801),c=o.process;n({global:!0,enumerable:!0,dontCallGetSet:!0},{queueMicrotask:function(t){u(arguments.length,1),a(t);var r=s&&c.domain;i(r?r.bind(t):t)}})},86471:(t,r,e)=>{var n=e(23103),o=e(9859),i=e(55795).set;n({global:!0,bind:!0,enumerable:!0,forced:o.setImmediate!==i},{setImmediate:i})},62653:(t,r,e)=>{"use strict";e(15735);var n=e(23103),o=e(9859),i=e(20266),a=e(65968),u=e(7400),s=e(34144),c=e(14768),f=e(8312),l=e(54555),p=e(42247),h=e(56407),v=e(57728),d=e(26733),g=e(98270),y=e(97636),m=e(81589),b=e(21176),x=e(85052),w=e(83326),S=e(22391),A=e(65358),R=e(28403),E=e(78830),O=e(77579),I=e(70095),P=e(33867),T=I("iterator"),L="URLSearchParams",j="URLSearchParamsIterator",U=h.set,k=h.getterFor(L),C=h.getterFor(j),_=Object.getOwnPropertyDescriptor,M=function(t){if(!u)return o[t];var r=_(o,t);return r&&r.value},B=M("fetch"),F=M("Request"),N=M("Headers"),D=F&&F.prototype,H=N&&N.prototype,q=o.RegExp,G=o.TypeError,V=o.decodeURIComponent,W=o.encodeURIComponent,$=a("".charAt),Y=a([].join),z=a([].push),K=a("".replace),J=a([].shift),Q=a([].splice),X=a("".split),Z=a("".slice),tt=/\+/g,rt=Array(4),et=function(t){return rt[t-1]||(rt[t-1]=q("((?:%[\\da-f]{2}){"+t+"})","gi"))},nt=function(t){try{return V(t)}catch(r){return t}},ot=function(t){var r=K(t,tt," "),e=4;try{return V(r)}catch(n){for(;e;)r=K(r,et(e--),nt);return r}},it=/[!'()~]|%20/g,at={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ut=function(t){return at[t]},st=function(t){return K(W(t),it,ut)},ct=p((function(t,r){U(this,{type:j,iterator:R(k(t).entries),kind:r})}),"Iterator",(function(){var t=C(this),r=t.kind,e=t.iterator.next(),n=e.value;return e.done||(e.value="keys"===r?n.key:"values"===r?n.value:[n.key,n.value]),e}),!0),ft=function(t){this.entries=[],this.url=null,void 0!==t&&(x(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===$(t,0)?Z(t,1):t:w(t)))};ft.prototype={type:L,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var r,e,n,o,a,u,s,c=E(t);if(c)for(e=(r=R(t,c)).next;!(n=i(e,r)).done;){if(a=(o=R(b(n.value))).next,(u=i(a,o)).done||(s=i(a,o)).done||!i(a,o).done)throw G("Expected sequence with length 2");z(this.entries,{key:w(u.value),value:w(s.value)})}else for(var f in t)g(t,f)&&z(this.entries,{key:f,value:w(t[f])})},parseQuery:function(t){if(t)for(var r,e,n=X(t,"&"),o=0;o<n.length;)(r=n[o++]).length&&(e=X(r,"="),z(this.entries,{key:ot(J(e)),value:ot(Y(e,"="))}))},serialize:function(){for(var t,r=this.entries,e=[],n=0;n<r.length;)t=r[n++],z(e,st(t.key)+"="+st(t.value));return Y(e,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var lt=function(){v(this,pt);var t=arguments.length>0?arguments[0]:void 0;U(this,new ft(t))},pt=lt.prototype;if(f(pt,{append:function(t,r){O(arguments.length,2);var e=k(this);z(e.entries,{key:w(t),value:w(r)}),e.updateURL()},delete:function(t){O(arguments.length,1);for(var r=k(this),e=r.entries,n=w(t),o=0;o<e.length;)e[o].key===n?Q(e,o,1):o++;r.updateURL()},get:function(t){O(arguments.length,1);for(var r=k(this).entries,e=w(t),n=0;n<r.length;n++)if(r[n].key===e)return r[n].value;return null},getAll:function(t){O(arguments.length,1);for(var r=k(this).entries,e=w(t),n=[],o=0;o<r.length;o++)r[o].key===e&&z(n,r[o].value);return n},has:function(t){O(arguments.length,1);for(var r=k(this).entries,e=w(t),n=0;n<r.length;)if(r[n++].key===e)return!0;return!1},set:function(t,r){O(arguments.length,1);for(var e,n=k(this),o=n.entries,i=!1,a=w(t),u=w(r),s=0;s<o.length;s++)(e=o[s]).key===a&&(i?Q(o,s--,1):(i=!0,e.value=u));i||z(o,{key:a,value:u}),n.updateURL()},sort:function(){var t=k(this);P(t.entries,(function(t,r){return t.key>r.key?1:-1})),t.updateURL()},forEach:function(t){for(var r,e=k(this).entries,n=y(t,arguments.length>1?arguments[1]:void 0),o=0;o<e.length;)n((r=e[o++]).value,r.key,this)},keys:function(){return new ct(this,"keys")},values:function(){return new ct(this,"values")},entries:function(){return new ct(this,"entries")}},{enumerable:!0}),c(pt,T,pt.entries,{name:"entries"}),c(pt,"toString",(function(){return k(this).serialize()}),{enumerable:!0}),l(lt,L),n({global:!0,constructor:!0,forced:!s},{URLSearchParams:lt}),!s&&d(N)){var ht=a(H.has),vt=a(H.set),dt=function(t){if(x(t)){var r,e=t.body;if(m(e)===L)return r=t.headers?new N(t.headers):new N,ht(r,"content-type")||vt(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),S(t,{body:A(0,w(e)),headers:A(0,r)})}return t};if(d(B)&&n({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return B(t,arguments.length>1?dt(arguments[1]):{})}}),d(F)){var gt=function(t){return v(this,D),new F(t,arguments.length>1?dt(arguments[1]):{})};D.constructor=gt,gt.prototype=D,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:gt})}}t.exports={URLSearchParams:lt,getState:k}},60523:(t,r,e)=>{e(62653)},95340:(t,r,e)=>{"use strict";e(28673);var n,o=e(23103),i=e(7400),a=e(34144),u=e(9859),s=e(97636),c=e(65968),f=e(14768),l=e(96616),p=e(57728),h=e(98270),v=e(47),d=e(10507),g=e(69794),y=e(30966).codeAt,m=e(77321),b=e(83326),x=e(54555),w=e(77579),S=e(62653),A=e(56407),R=A.set,E=A.getterFor("URL"),O=S.URLSearchParams,I=S.getState,P=u.URL,T=u.TypeError,L=u.parseInt,j=Math.floor,U=Math.pow,k=c("".charAt),C=c(/./.exec),_=c([].join),M=c(1..toString),B=c([].pop),F=c([].push),N=c("".replace),D=c([].shift),H=c("".split),q=c("".slice),G=c("".toLowerCase),V=c([].unshift),W="Invalid scheme",$="Invalid host",Y="Invalid port",z=/[a-z]/i,K=/[\d+-.a-z]/i,J=/\d/,Q=/^0x/i,X=/^[0-7]+$/,Z=/^\d+$/,tt=/^[\da-f]+$/i,rt=/[\0\t\n\r #%/:<>?@[\\\]^|]/,et=/[\0\t\n\r #/:<>?@[\\\]^|]/,nt=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,ot=/[\t\n\r]/g,it=function(t){var r,e,n,o;if("number"==typeof t){for(r=[],e=0;e<4;e++)V(r,t%256),t=j(t/256);return _(r,".")}if("object"==typeof t){for(r="",n=function(t){for(var r=null,e=1,n=null,o=0,i=0;i<8;i++)0!==t[i]?(o>e&&(r=n,e=o),n=null,o=0):(null===n&&(n=i),++o);return o>e&&(r=n,e=o),r}(t),e=0;e<8;e++)o&&0===t[e]||(o&&(o=!1),n===e?(r+=e?":":"::",o=!0):(r+=M(t[e],16),e<7&&(r+=":")));return"["+r+"]"}return t},at={},ut=v({},at,{" ":1,'"':1,"<":1,">":1,"`":1}),st=v({},ut,{"#":1,"?":1,"{":1,"}":1}),ct=v({},st,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ft=function(t,r){var e=y(t,0);return e>32&&e<127&&!h(r,t)?t:encodeURIComponent(t)},lt={ftp:21,file:null,http:80,https:443,ws:80,wss:443},pt=function(t,r){var e;return 2==t.length&&C(z,k(t,0))&&(":"==(e=k(t,1))||!r&&"|"==e)},ht=function(t){var r;return t.length>1&&pt(q(t,0,2))&&(2==t.length||"/"===(r=k(t,2))||"\\"===r||"?"===r||"#"===r)},vt=function(t){return"."===t||"%2e"===G(t)},dt={},gt={},yt={},mt={},bt={},xt={},wt={},St={},At={},Rt={},Et={},Ot={},It={},Pt={},Tt={},Lt={},jt={},Ut={},kt={},Ct={},_t={},Mt=function(t,r,e){var n,o,i,a=b(t);if(r){if(o=this.parse(a))throw T(o);this.searchParams=null}else{if(void 0!==e&&(n=new Mt(e,!0)),o=this.parse(a,null,n))throw T(o);(i=I(new O)).bindURL(this),this.searchParams=i}};Mt.prototype={type:"URL",parse:function(t,r,e){var o,i,a,u,s,c=this,f=r||dt,l=0,p="",v=!1,y=!1,m=!1;for(t=b(t),r||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,t=N(t,nt,"")),t=N(t,ot,""),o=d(t);l<=o.length;){switch(i=o[l],f){case dt:if(!i||!C(z,i)){if(r)return W;f=yt;continue}p+=G(i),f=gt;break;case gt:if(i&&(C(K,i)||"+"==i||"-"==i||"."==i))p+=G(i);else{if(":"!=i){if(r)return W;p="",f=yt,l=0;continue}if(r&&(c.isSpecial()!=h(lt,p)||"file"==p&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=p,r)return void(c.isSpecial()&<[c.scheme]==c.port&&(c.port=null));p="","file"==c.scheme?f=Pt:c.isSpecial()&&e&&e.scheme==c.scheme?f=mt:c.isSpecial()?f=St:"/"==o[l+1]?(f=bt,l++):(c.cannotBeABaseURL=!0,F(c.path,""),f=kt)}break;case yt:if(!e||e.cannotBeABaseURL&&"#"!=i)return W;if(e.cannotBeABaseURL&&"#"==i){c.scheme=e.scheme,c.path=g(e.path),c.query=e.query,c.fragment="",c.cannotBeABaseURL=!0,f=_t;break}f="file"==e.scheme?Pt:xt;continue;case mt:if("/"!=i||"/"!=o[l+1]){f=xt;continue}f=At,l++;break;case bt:if("/"==i){f=Rt;break}f=Ut;continue;case xt:if(c.scheme=e.scheme,i==n)c.username=e.username,c.password=e.password,c.host=e.host,c.port=e.port,c.path=g(e.path),c.query=e.query;else if("/"==i||"\\"==i&&c.isSpecial())f=wt;else if("?"==i)c.username=e.username,c.password=e.password,c.host=e.host,c.port=e.port,c.path=g(e.path),c.query="",f=Ct;else{if("#"!=i){c.username=e.username,c.password=e.password,c.host=e.host,c.port=e.port,c.path=g(e.path),c.path.length--,f=Ut;continue}c.username=e.username,c.password=e.password,c.host=e.host,c.port=e.port,c.path=g(e.path),c.query=e.query,c.fragment="",f=_t}break;case wt:if(!c.isSpecial()||"/"!=i&&"\\"!=i){if("/"!=i){c.username=e.username,c.password=e.password,c.host=e.host,c.port=e.port,f=Ut;continue}f=Rt}else f=At;break;case St:if(f=At,"/"!=i||"/"!=k(p,l+1))continue;l++;break;case At:if("/"!=i&&"\\"!=i){f=Rt;continue}break;case Rt:if("@"==i){v&&(p="%40"+p),v=!0,a=d(p);for(var x=0;x<a.length;x++){var w=a[x];if(":"!=w||m){var S=ft(w,ct);m?c.password+=S:c.username+=S}else m=!0}p=""}else if(i==n||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()){if(v&&""==p)return"Invalid authority";l-=d(p).length+1,p="",f=Et}else p+=i;break;case Et:case Ot:if(r&&"file"==c.scheme){f=Lt;continue}if(":"!=i||y){if(i==n||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()){if(c.isSpecial()&&""==p)return $;if(r&&""==p&&(c.includesCredentials()||null!==c.port))return;if(u=c.parseHost(p))return u;if(p="",f=jt,r)return;continue}"["==i?y=!0:"]"==i&&(y=!1),p+=i}else{if(""==p)return $;if(u=c.parseHost(p))return u;if(p="",f=It,r==Ot)return}break;case It:if(!C(J,i)){if(i==n||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()||r){if(""!=p){var A=L(p,10);if(A>65535)return Y;c.port=c.isSpecial()&&A===lt[c.scheme]?null:A,p=""}if(r)return;f=jt;continue}return Y}p+=i;break;case Pt:if(c.scheme="file","/"==i||"\\"==i)f=Tt;else{if(!e||"file"!=e.scheme){f=Ut;continue}if(i==n)c.host=e.host,c.path=g(e.path),c.query=e.query;else if("?"==i)c.host=e.host,c.path=g(e.path),c.query="",f=Ct;else{if("#"!=i){ht(_(g(o,l),""))||(c.host=e.host,c.path=g(e.path),c.shortenPath()),f=Ut;continue}c.host=e.host,c.path=g(e.path),c.query=e.query,c.fragment="",f=_t}}break;case Tt:if("/"==i||"\\"==i){f=Lt;break}e&&"file"==e.scheme&&!ht(_(g(o,l),""))&&(pt(e.path[0],!0)?F(c.path,e.path[0]):c.host=e.host),f=Ut;continue;case Lt:if(i==n||"/"==i||"\\"==i||"?"==i||"#"==i){if(!r&&pt(p))f=Ut;else if(""==p){if(c.host="",r)return;f=jt}else{if(u=c.parseHost(p))return u;if("localhost"==c.host&&(c.host=""),r)return;p="",f=jt}continue}p+=i;break;case jt:if(c.isSpecial()){if(f=Ut,"/"!=i&&"\\"!=i)continue}else if(r||"?"!=i)if(r||"#"!=i){if(i!=n&&(f=Ut,"/"!=i))continue}else c.fragment="",f=_t;else c.query="",f=Ct;break;case Ut:if(i==n||"/"==i||"\\"==i&&c.isSpecial()||!r&&("?"==i||"#"==i)){if(".."===(s=G(s=p))||"%2e."===s||".%2e"===s||"%2e%2e"===s?(c.shortenPath(),"/"==i||"\\"==i&&c.isSpecial()||F(c.path,"")):vt(p)?"/"==i||"\\"==i&&c.isSpecial()||F(c.path,""):("file"==c.scheme&&!c.path.length&&pt(p)&&(c.host&&(c.host=""),p=k(p,0)+":"),F(c.path,p)),p="","file"==c.scheme&&(i==n||"?"==i||"#"==i))for(;c.path.length>1&&""===c.path[0];)D(c.path);"?"==i?(c.query="",f=Ct):"#"==i&&(c.fragment="",f=_t)}else p+=ft(i,st);break;case kt:"?"==i?(c.query="",f=Ct):"#"==i?(c.fragment="",f=_t):i!=n&&(c.path[0]+=ft(i,at));break;case Ct:r||"#"!=i?i!=n&&("'"==i&&c.isSpecial()?c.query+="%27":c.query+="#"==i?"%23":ft(i,at)):(c.fragment="",f=_t);break;case _t:i!=n&&(c.fragment+=ft(i,ut))}l++}},parseHost:function(t){var r,e,n;if("["==k(t,0)){if("]"!=k(t,t.length-1))return $;if(r=function(t){var r,e,n,o,i,a,u,s=[0,0,0,0,0,0,0,0],c=0,f=null,l=0,p=function(){return k(t,l)};if(":"==p()){if(":"!=k(t,1))return;l+=2,f=++c}for(;p();){if(8==c)return;if(":"!=p()){for(r=e=0;e<4&&C(tt,p());)r=16*r+L(p(),16),l++,e++;if("."==p()){if(0==e)return;if(l-=e,c>6)return;for(n=0;p();){if(o=null,n>0){if(!("."==p()&&n<4))return;l++}if(!C(J,p()))return;for(;C(J,p());){if(i=L(p(),10),null===o)o=i;else{if(0==o)return;o=10*o+i}if(o>255)return;l++}s[c]=256*s[c]+o,2!=++n&&4!=n||c++}if(4!=n)return;break}if(":"==p()){if(l++,!p())return}else if(p())return;s[c++]=r}else{if(null!==f)return;l++,f=++c}}if(null!==f)for(a=c-f,c=7;0!=c&&a>0;)u=s[c],s[c--]=s[f+a-1],s[f+--a]=u;else if(8!=c)return;return s}(q(t,1,-1)),!r)return $;this.host=r}else if(this.isSpecial()){if(t=m(t),C(rt,t))return $;if(r=function(t){var r,e,n,o,i,a,u,s=H(t,".");if(s.length&&""==s[s.length-1]&&s.length--,(r=s.length)>4)return t;for(e=[],n=0;n<r;n++){if(""==(o=s[n]))return t;if(i=10,o.length>1&&"0"==k(o,0)&&(i=C(Q,o)?16:8,o=q(o,8==i?1:2)),""===o)a=0;else{if(!C(10==i?Z:8==i?X:tt,o))return t;a=L(o,i)}F(e,a)}for(n=0;n<r;n++)if(a=e[n],n==r-1){if(a>=U(256,5-r))return null}else if(a>255)return null;for(u=B(e),n=0;n<e.length;n++)u+=e[n]*U(256,3-n);return u}(t),null===r)return $;this.host=r}else{if(C(et,t))return $;for(r="",e=d(t),n=0;n<e.length;n++)r+=ft(e[n],at);this.host=r}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return h(lt,this.scheme)},shortenPath:function(){var t=this.path,r=t.length;!r||"file"==this.scheme&&1==r&&pt(t[0],!0)||t.length--},serialize:function(){var t=this,r=t.scheme,e=t.username,n=t.password,o=t.host,i=t.port,a=t.path,u=t.query,s=t.fragment,c=r+":";return null!==o?(c+="//",t.includesCredentials()&&(c+=e+(n?":"+n:"")+"@"),c+=it(o),null!==i&&(c+=":"+i)):"file"==r&&(c+="//"),c+=t.cannotBeABaseURL?a[0]:a.length?"/"+_(a,"/"):"",null!==u&&(c+="?"+u),null!==s&&(c+="#"+s),c},setHref:function(t){var r=this.parse(t);if(r)throw T(r);this.searchParams.update()},getOrigin:function(){var t=this.scheme,r=this.port;if("blob"==t)try{return new Bt(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&this.isSpecial()?t+"://"+it(this.host)+(null!==r?":"+r:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(b(t)+":",dt)},getUsername:function(){return this.username},setUsername:function(t){var r=d(b(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var e=0;e<r.length;e++)this.username+=ft(r[e],ct)}},getPassword:function(){return this.password},setPassword:function(t){var r=d(b(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var e=0;e<r.length;e++)this.password+=ft(r[e],ct)}},getHost:function(){var t=this.host,r=this.port;return null===t?"":null===r?it(t):it(t)+":"+r},setHost:function(t){this.cannotBeABaseURL||this.parse(t,Et)},getHostname:function(){var t=this.host;return null===t?"":it(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,Ot)},getPort:function(){var t=this.port;return null===t?"":b(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(""==(t=b(t))?this.port=null:this.parse(t,It))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+_(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,jt))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){""==(t=b(t))?this.query=null:("?"==k(t,0)&&(t=q(t,1)),this.query="",this.parse(t,Ct)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){""!=(t=b(t))?("#"==k(t,0)&&(t=q(t,1)),this.fragment="",this.parse(t,_t)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Bt=function(t){var r=p(this,Ft),e=w(arguments.length,1)>1?arguments[1]:void 0,n=R(r,new Mt(t,!1,e));i||(r.href=n.serialize(),r.origin=n.getOrigin(),r.protocol=n.getProtocol(),r.username=n.getUsername(),r.password=n.getPassword(),r.host=n.getHost(),r.hostname=n.getHostname(),r.port=n.getPort(),r.pathname=n.getPathname(),r.search=n.getSearch(),r.searchParams=n.getSearchParams(),r.hash=n.getHash())},Ft=Bt.prototype,Nt=function(t,r){return{get:function(){return E(this)[t]()},set:r&&function(t){return E(this)[r](t)},configurable:!0,enumerable:!0}};if(i&&(l(Ft,"href",Nt("serialize","setHref")),l(Ft,"origin",Nt("getOrigin")),l(Ft,"protocol",Nt("getProtocol","setProtocol")),l(Ft,"username",Nt("getUsername","setUsername")),l(Ft,"password",Nt("getPassword","setPassword")),l(Ft,"host",Nt("getHost","setHost")),l(Ft,"hostname",Nt("getHostname","setHostname")),l(Ft,"port",Nt("getPort","setPort")),l(Ft,"pathname",Nt("getPathname","setPathname")),l(Ft,"search",Nt("getSearch","setSearch")),l(Ft,"searchParams",Nt("getSearchParams")),l(Ft,"hash",Nt("getHash","setHash"))),f(Ft,"toJSON",(function(){return E(this).serialize()}),{enumerable:!0}),f(Ft,"toString",(function(){return E(this).serialize()}),{enumerable:!0}),P){var Dt=P.createObjectURL,Ht=P.revokeObjectURL;Dt&&f(Bt,"createObjectURL",s(Dt,P)),Ht&&f(Bt,"revokeObjectURL",s(Ht,P))}x(Bt,"URL"),o({global:!0,constructor:!0,forced:!a,sham:!i},{URL:Bt})},14121:(t,r,e)=>{e(95340)},85371:(t,r,e)=>{"use strict";var n=e(23103),o=e(20266);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return o(URL.prototype.toString,this)}})}},t=>{var r=r=>t(t.s=r);r(70982),r(41913)}]);/*! For license information please see main.ba61719e379f223e.js.LICENSE.txt */
(self.webpackChunk=self.webpackChunk||[]).push([[179],{63279:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(5163);n(43847),r.__exportStar(n(71889),e),r.__exportStar(n(55825),e)},43847:(t,e,n)=>{"undefined"!=typeof window&&void 0===window.global&&"undefined"==typeof Buffer&&(window.global=window,global.Buffer=n(48834).Buffer),"undefined"!=typeof TextEncoder&&"undefined"!=typeof window||(global.TextEncoder=n(43335).TextEncoder)},71889:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Keypair=e.SolanaPublicKey=e.SolanaKeypair=void 0;const r=n(5163),i=r.__importStar(n(55796)),o=n(68050),s=n(27158);Object.defineProperty(e,"SolanaKeypair",{enumerable:!0,get:function(){return s.Keypair}}),Object.defineProperty(e,"SolanaPublicKey",{enumerable:!0,get:function(){return s.PublicKey}});const a=r.__importStar(n(17022)),c=n(90394);class u{constructor(t){this.solanaKeypair=s.Keypair.fromSecretKey(a.decode(t)),this.publicKey=this.solanaKeypair.publicKey.toBase58(),this.secretKey=a.encode(this.solanaKeypair.secretKey)}get solana(){return this.solanaKeypair}get solanaPublicKey(){return this.solanaKeypair.publicKey}get solanaSecretKey(){return this.solanaKeypair.secretKey}static fromByteArray(t){return this.fromSecretKey(a.encode(Uint8Array.from(t)))}static fromMnemonic(t){return this.fromMnemonicSet(t)[0]}static fromMnemonicSet(t,e=0,n=1){n=n<=(e=e<0?0:e)?e+1:n;const r=i.mnemonicToSeedSync(t,""),o=[];for(let i=e;i<n;i++){const e=`m/44'/501'/${i}'/0'`,n=this.derive(Buffer.from(r),e);n.mnemonic=t,o.push(n)}return o}static derive(t,e){const n=c.HDKey.fromMasterSeed(t.toString("hex"));return u.fromSeed(Buffer.from(n.derive(e).privateKey))}static fromSeed(t){return this.fromSecretKey(a.encode(s.Keypair.fromSeed(t).secretKey))}static fromSecret(t){let e;if(e=this.isMnemonic(t)?u.fromMnemonic(t):this.isByteArray(t)?this.parseByteArray(t):u.fromSecretKey(t),!e)throw new Error("Invalid secret");return e}static fromSecretKey(t){return new u(t)}static random(){const t=this.generateMnemonic();return this.fromMnemonic(t)}static generateMnemonic(t=128){return i.generateMnemonic(o.wordlist,t)}static isMnemonic(t){return 12===t.split(" ").length||24===t.split(" ").length}static isByteArray(t){return t.startsWith("[")&&t.endsWith("]")}static parseByteArray(t){try{const e=JSON.parse(t);return u.fromByteArray(e)}catch(e){throw new Error("Error parsing byte array")}}}e.Keypair=u},55825:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION=e.NAME=void 0,e.NAME="@kin-kinetic/keypair",e.VERSION="1.0.0-rc.8"},53773:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TransactionApi=e.TransactionApiFactory=e.TransactionApiFp=e.TransactionApiAxiosParamCreator=e.AppApi=e.AppApiFactory=e.AppApiFp=e.AppApiAxiosParamCreator=e.AirdropApi=e.AirdropApiFactory=e.AirdropApiFp=e.AirdropApiAxiosParamCreator=e.AccountApi=e.AccountApiFactory=e.AccountApiFp=e.AccountApiAxiosParamCreator=e.TransactionStatus=e.TransactionErrorType=e.SignatureStatusConfirmationStatusEnum=e.Commitment=e.ClusterType=void 0;const r=n(5163),i=n(89644),o=n(44340),s=n(61617);e.ClusterType={Custom:"Custom",SolanaDevnet:"SolanaDevnet",SolanaMainnet:"SolanaMainnet",SolanaTestnet:"SolanaTestnet"},e.Commitment={Confirmed:"Confirmed",Finalized:"Finalized",Processed:"Processed"},e.SignatureStatusConfirmationStatusEnum={Processed:"processed",Confirmed:"confirmed",Finalized:"finalized"},e.TransactionErrorType={BadNonce:"BadNonce",InvalidAccount:"InvalidAccount",SomeError:"SomeError",Timeout:"Timeout",Unknown:"Unknown",WebhookFailed:"WebhookFailed"},e.TransactionStatus={Committed:"Committed",Confirmed:"Confirmed",Failed:"Failed",Finalized:"Finalized",Processing:"Processing"};e.AccountApiAxiosParamCreator=function(t){return{createAccount:(e,n={})=>r.__awaiter(this,void 0,void 0,(function*(){(0,o.assertParamExists)("createAccount","createAccountRequest",e);const r=new URL("/api/account/create",o.DUMMY_BASE_URL);let i;t&&(i=t.baseOptions);const s=Object.assign(Object.assign({method:"POST"},i),n),a={};a["Content-Type"]="application/json",(0,o.setSearchParams)(r,{});let c=i&&i.headers?i.headers:{};return s.headers=Object.assign(Object.assign(Object.assign({},a),c),n.headers),s.data=(0,o.serializeDataIfNeeded)(e,s,t),{url:(0,o.toPathString)(r),options:s}})),getAccountInfo:(e,n,i,s={})=>r.__awaiter(this,void 0,void 0,(function*(){(0,o.assertParamExists)("getAccountInfo","environment",e),(0,o.assertParamExists)("getAccountInfo","index",n),(0,o.assertParamExists)("getAccountInfo","accountId",i);const r="/api/account/info/{environment}/{index}/{accountId}".replace("{environment}",encodeURIComponent(String(e))).replace("{index}",encodeURIComponent(String(n))).replace("{accountId}",encodeURIComponent(String(i))),a=new URL(r,o.DUMMY_BASE_URL);let c;t&&(c=t.baseOptions);const u=Object.assign(Object.assign({method:"GET"},c),s);(0,o.setSearchParams)(a,{});let l=c&&c.headers?c.headers:{};return u.headers=Object.assign(Object.assign(Object.assign({},{}),l),s.headers),{url:(0,o.toPathString)(a),options:u}})),getBalance:(e,n,i,s={})=>r.__awaiter(this,void 0,void 0,(function*(){(0,o.assertParamExists)("getBalance","environment",e),(0,o.assertParamExists)("getBalance","index",n),(0,o.assertParamExists)("getBalance","accountId",i);const r="/api/account/balance/{environment}/{index}/{accountId}".replace("{environment}",encodeURIComponent(String(e))).replace("{index}",encodeURIComponent(String(n))).replace("{accountId}",encodeURIComponent(String(i))),a=new URL(r,o.DUMMY_BASE_URL);let c;t&&(c=t.baseOptions);const u=Object.assign(Object.assign({method:"GET"},c),s);(0,o.setSearchParams)(a,{});let l=c&&c.headers?c.headers:{};return u.headers=Object.assign(Object.assign(Object.assign({},{}),l),s.headers),{url:(0,o.toPathString)(a),options:u}})),getHistory:(e,n,i,s,a={})=>r.__awaiter(this,void 0,void 0,(function*(){(0,o.assertParamExists)("getHistory","environment",e),(0,o.assertParamExists)("getHistory","index",n),(0,o.assertParamExists)("getHistory","accountId",i),(0,o.assertParamExists)("getHistory","mint",s);const r="/api/account/history/{environment}/{index}/{accountId}/{mint}".replace("{environment}",encodeURIComponent(String(e))).replace("{index}",encodeURIComponent(String(n))).replace("{accountId}",encodeURIComponent(String(i))).replace("{mint}",encodeURIComponent(String(s))),c=new URL(r,o.DUMMY_BASE_URL);let u;t&&(u=t.baseOptions);const l=Object.assign(Object.assign({method:"GET"},u),a);(0,o.setSearchParams)(c,{});let d=u&&u.headers?u.headers:{};return l.headers=Object.assign(Object.assign(Object.assign({},{}),d),a.headers),{url:(0,o.toPathString)(c),options:l}})),getTokenAccounts:(e,n,i,s,a={})=>r.__awaiter(this,void 0,void 0,(function*(){(0,o.assertParamExists)("getTokenAccounts","environment",e),(0,o.assertParamExists)("getTokenAccounts","index",n),(0,o.assertParamExists)("getTokenAccounts","accountId",i),(0,o.assertParamExists)("getTokenAccounts","mint",s);const r="/api/account/token-accounts/{environment}/{index}/{accountId}/{mint}".replace("{environment}",encodeURIComponent(String(e))).replace("{index}",encodeURIComponent(String(n))).replace("{accountId}",encodeURIComponent(String(i))).replace("{mint}",encodeURIComponent(String(s))),c=new URL(r,o.DUMMY_BASE_URL);let u;t&&(u=t.baseOptions);const l=Object.assign(Object.assign({method:"GET"},u),a);(0,o.setSearchParams)(c,{});let d=u&&u.headers?u.headers:{};return l.headers=Object.assign(Object.assign(Object.assign({},{}),d),a.headers),{url:(0,o.toPathString)(c),options:l}}))}};e.AccountApiFp=function(t){const n=(0,e.AccountApiAxiosParamCreator)(t);return{createAccount(e,a){return r.__awaiter(this,void 0,void 0,(function*(){const r=yield n.createAccount(e,a);return(0,o.createRequestFunction)(r,i.default,s.BASE_PATH,t)}))},getAccountInfo(e,a,c,u){return r.__awaiter(this,void 0,void 0,(function*(){const r=yield n.getAccountInfo(e,a,c,u);return(0,o.createRequestFunction)(r,i.default,s.BASE_PATH,t)}))},getBalance(e,a,c,u){return r.__awaiter(this,void 0,void 0,(function*(){const r=yield n.getBalance(e,a,c,u);return(0,o.createRequestFunction)(r,i.default,s.BASE_PATH,t)}))},getHistory(e,a,c,u,l){return r.__awaiter(this,void 0,void 0,(function*(){const r=yield n.getHistory(e,a,c,u,l);return(0,o.createRequestFunction)(r,i.default,s.BASE_PATH,t)}))},getTokenAccounts(e,a,c,u,l){return r.__awaiter(this,void 0,void 0,(function*(){const r=yield n.getTokenAccounts(e,a,c,u,l);return(0,o.createRequestFunction)(r,i.default,s.BASE_PATH,t)}))}}};e.AccountApiFactory=function(t,n,r){const i=(0,e.AccountApiFp)(t);return{createAccount:(t,e)=>i.createAccount(t,e).then((t=>t(r,n))),getAccountInfo:(t,e,o,s)=>i.getAccountInfo(t,e,o,s).then((t=>t(r,n))),getBalance:(t,e,o,s)=>i.getBalance(t,e,o,s).then((t=>t(r,n))),getHistory:(t,e,o,s,a)=>i.getHistory(t,e,o,s,a).then((t=>t(r,n))),getTokenAccounts:(t,e,o,s,a)=>i.getTokenAccounts(t,e,o,s,a).then((t=>t(r,n)))}};class a extends s.BaseAPI{createAccount(t,n){return(0,e.AccountApiFp)(this.configuration).createAccount(t,n).then((t=>t(this.axios,this.basePath)))}getAccountInfo(t,n,r,i){return(0,e.AccountApiFp)(this.configuration).getAccountInfo(t,n,r,i).then((t=>t(this.axios,this.basePath)))}getBalance(t,n,r,i){return(0,e.AccountApiFp)(this.configuration).getBalance(t,n,r,i).then((t=>t(this.axios,this.basePath)))}getHistory(t,n,r,i,o){return(0,e.AccountApiFp)(this.configuration).getHistory(t,n,r,i,o).then((t=>t(this.axios,this.basePath)))}getTokenAccounts(t,n,r,i,o){return(0,e.AccountApiFp)(this.configuration).getTokenAccounts(t,n,r,i,o).then((t=>t(this.axios,this.basePath)))}}e.AccountApi=a;e.AirdropApiAxiosParamCreator=function(t){return{requestAirdrop:(e,n={})=>r.__awaiter(this,void 0,void 0,(function*(){(0,o.assertParamExists)("requestAirdrop","requestAirdropRequest",e);const r=new URL("/api/airdrop",o.DUMMY_BASE_URL);let i;t&&(i=t.baseOptions);const s=Object.assign(Object.assign({method:"POST"},i),n),a={};a["Content-Type"]="application/json",(0,o.setSearchParams)(r,{});let c=i&&i.headers?i.headers:{};return s.headers=Object.assign(Object.assign(Object.assign({},a),c),n.headers),s.data=(0,o.serializeDataIfNeeded)(e,s,t),{url:(0,o.toPathString)(r),options:s}}))}};e.AirdropApiFp=function(t){const n=(0,e.AirdropApiAxiosParamCreator)(t);return{requestAirdrop(e,a){return r.__awaiter(this,void 0,void 0,(function*(){const r=yield n.requestAirdrop(e,a);return(0,o.createRequestFunction)(r,i.default,s.BASE_PATH,t)}))}}};e.AirdropApiFactory=function(t,n,r){const i=(0,e.AirdropApiFp)(t);return{requestAirdrop:(t,e)=>i.requestAirdrop(t,e).then((t=>t(r,n)))}};class c extends s.BaseAPI{requestAirdrop(t,n){return(0,e.AirdropApiFp)(this.configuration).requestAirdrop(t,n).then((t=>t(this.axios,this.basePath)))}}e.AirdropApi=c;e.AppApiAxiosParamCreator=function(t){return{getAppConfig:(e,n,i={})=>r.__awaiter(this,void 0,void 0,(function*(){(0,o.assertParamExists)("getAppConfig","environment",e),(0,o.assertParamExists)("getAppConfig","index",n);const r="/api/app/{environment}/{index}/config".replace("{environment}",encodeURIComponent(String(e))).replace("{index}",encodeURIComponent(String(n))),s=new URL(r,o.DUMMY_BASE_URL);let a;t&&(a=t.baseOptions);const c=Object.assign(Object.assign({method:"GET"},a),i);(0,o.setSearchParams)(s,{});let u=a&&a.headers?a.headers:{};return c.headers=Object.assign(Object.assign(Object.assign({},{}),u),i.headers),{url:(0,o.toPathString)(s),options:c}})),getAppHealth:(e,n,i={})=>r.__awaiter(this,void 0,void 0,(function*(){(0,o.assertParamExists)("getAppHealth","environment",e),(0,o.assertParamExists)("getAppHealth","index",n);const r="/api/app/{environment}/{index}/health".replace("{environment}",encodeURIComponent(String(e))).replace("{index}",encodeURIComponent(String(n))),s=new URL(r,o.DUMMY_BASE_URL);let a;t&&(a=t.baseOptions);const c=Object.assign(Object.assign({method:"GET"},a),i);(0,o.setSearchParams)(s,{});let u=a&&a.headers?a.headers:{};return c.headers=Object.assign(Object.assign(Object.assign({},{}),u),i.headers),{url:(0,o.toPathString)(s),options:c}}))}};e.AppApiFp=function(t){const n=(0,e.AppApiAxiosParamCreator)(t);return{getAppConfig(e,a,c){return r.__awaiter(this,void 0,void 0,(function*(){const r=yield n.getAppConfig(e,a,c);return(0,o.createRequestFunction)(r,i.default,s.BASE_PATH,t)}))},getAppHealth(e,a,c){return r.__awaiter(this,void 0,void 0,(function*(){const r=yield n.getAppHealth(e,a,c);return(0,o.createRequestFunction)(r,i.default,s.BASE_PATH,t)}))}}};e.AppApiFactory=function(t,n,r){const i=(0,e.AppApiFp)(t);return{getAppConfig:(t,e,o)=>i.getAppConfig(t,e,o).then((t=>t(r,n))),getAppHealth:(t,e,o)=>i.getAppHealth(t,e,o).then((t=>t(r,n)))}};class u extends s.BaseAPI{getAppConfig(t,n,r){return(0,e.AppApiFp)(this.configuration).getAppConfig(t,n,r).then((t=>t(this.axios,this.basePath)))}getAppHealth(t,n,r){return(0,e.AppApiFp)(this.configuration).getAppHealth(t,n,r).then((t=>t(this.axios,this.basePath)))}}e.AppApi=u;e.TransactionApiAxiosParamCreator=function(t){return{getLatestBlockhash:(e,n,i={})=>r.__awaiter(this,void 0,void 0,(function*(){(0,o.assertParamExists)("getLatestBlockhash","environment",e),(0,o.assertParamExists)("getLatestBlockhash","index",n);const r="/api/transaction/latest-blockhash/{environment}/{index}".replace("{environment}",encodeURIComponent(String(e))).replace("{index}",encodeURIComponent(String(n))),s=new URL(r,o.DUMMY_BASE_URL);let a;t&&(a=t.baseOptions);const c=Object.assign(Object.assign({method:"GET"},a),i);(0,o.setSearchParams)(s,{});let u=a&&a.headers?a.headers:{};return c.headers=Object.assign(Object.assign(Object.assign({},{}),u),i.headers),{url:(0,o.toPathString)(s),options:c}})),getMinimumRentExemptionBalance:(e,n,i,s={})=>r.__awaiter(this,void 0,void 0,(function*(){(0,o.assertParamExists)("getMinimumRentExemptionBalance","environment",e),(0,o.assertParamExists)("getMinimumRentExemptionBalance","index",n),(0,o.assertParamExists)("getMinimumRentExemptionBalance","dataLength",i);const r="/api/transaction/minimum-rent-exemption-balance/{environment}/{index}".replace("{environment}",encodeURIComponent(String(e))).replace("{index}",encodeURIComponent(String(n))),a=new URL(r,o.DUMMY_BASE_URL);let c;t&&(c=t.baseOptions);const u=Object.assign(Object.assign({method:"GET"},c),s),l={};void 0!==i&&(l.dataLength=i),(0,o.setSearchParams)(a,l);let d=c&&c.headers?c.headers:{};return u.headers=Object.assign(Object.assign(Object.assign({},{}),d),s.headers),{url:(0,o.toPathString)(a),options:u}})),getTransaction:(e,n,i,s={})=>r.__awaiter(this,void 0,void 0,(function*(){(0,o.assertParamExists)("getTransaction","environment",e),(0,o.assertParamExists)("getTransaction","index",n),(0,o.assertParamExists)("getTransaction","signature",i);const r="/api/transaction/transaction/{environment}/{index}/{signature}".replace("{environment}",encodeURIComponent(String(e))).replace("{index}",encodeURIComponent(String(n))).replace("{signature}",encodeURIComponent(String(i))),a=new URL(r,o.DUMMY_BASE_URL);let c;t&&(c=t.baseOptions);const u=Object.assign(Object.assign({method:"GET"},c),s);(0,o.setSearchParams)(a,{});let l=c&&c.headers?c.headers:{};return u.headers=Object.assign(Object.assign(Object.assign({},{}),l),s.headers),{url:(0,o.toPathString)(a),options:u}})),makeTransfer:(e,n={})=>r.__awaiter(this,void 0,void 0,(function*(){(0,o.assertParamExists)("makeTransfer","makeTransferRequest",e);const r=new URL("/api/transaction/make-transfer",o.DUMMY_BASE_URL);let i;t&&(i=t.baseOptions);const s=Object.assign(Object.assign({method:"POST"},i),n),a={};a["Content-Type"]="application/json",(0,o.setSearchParams)(r,{});let c=i&&i.headers?i.headers:{};return s.headers=Object.assign(Object.assign(Object.assign({},a),c),n.headers),s.data=(0,o.serializeDataIfNeeded)(e,s,t),{url:(0,o.toPathString)(r),options:s}}))}};e.TransactionApiFp=function(t){const n=(0,e.TransactionApiAxiosParamCreator)(t);return{getLatestBlockhash(e,a,c){return r.__awaiter(this,void 0,void 0,(function*(){const r=yield n.getLatestBlockhash(e,a,c);return(0,o.createRequestFunction)(r,i.default,s.BASE_PATH,t)}))},getMinimumRentExemptionBalance(e,a,c,u){return r.__awaiter(this,void 0,void 0,(function*(){const r=yield n.getMinimumRentExemptionBalance(e,a,c,u);return(0,o.createRequestFunction)(r,i.default,s.BASE_PATH,t)}))},getTransaction(e,a,c,u){return r.__awaiter(this,void 0,void 0,(function*(){const r=yield n.getTransaction(e,a,c,u);return(0,o.createRequestFunction)(r,i.default,s.BASE_PATH,t)}))},makeTransfer(e,a){return r.__awaiter(this,void 0,void 0,(function*(){const r=yield n.makeTransfer(e,a);return(0,o.createRequestFunction)(r,i.default,s.BASE_PATH,t)}))}}};e.TransactionApiFactory=function(t,n,r){const i=(0,e.TransactionApiFp)(t);return{getLatestBlockhash:(t,e,o)=>i.getLatestBlockhash(t,e,o).then((t=>t(r,n))),getMinimumRentExemptionBalance:(t,e,o,s)=>i.getMinimumRentExemptionBalance(t,e,o,s).then((t=>t(r,n))),getTransaction:(t,e,o,s)=>i.getTransaction(t,e,o,s).then((t=>t(r,n))),makeTransfer:(t,e)=>i.makeTransfer(t,e).then((t=>t(r,n)))}};class l extends s.BaseAPI{getLatestBlockhash(t,n,r){return(0,e.TransactionApiFp)(this.configuration).getLatestBlockhash(t,n,r).then((t=>t(this.axios,this.basePath)))}getMinimumRentExemptionBalance(t,n,r,i){return(0,e.TransactionApiFp)(this.configuration).getMinimumRentExemptionBalance(t,n,r,i).then((t=>t(this.axios,this.basePath)))}getTransaction(t,n,r,i){return(0,e.TransactionApiFp)(this.configuration).getTransaction(t,n,r,i).then((t=>t(this.axios,this.basePath)))}makeTransfer(t,n){return(0,e.TransactionApiFp)(this.configuration).makeTransfer(t,n).then((t=>t(this.axios,this.basePath)))}}e.TransactionApi=l},61617:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RequiredError=e.BaseAPI=e.COLLECTION_FORMATS=e.BASE_PATH=void 0;const r=n(89644);e.BASE_PATH="http://localhost:3000".replace(/\/+$/,""),e.COLLECTION_FORMATS={csv:",",ssv:" ",tsv:"\t",pipes:"|"};e.BaseAPI=class{constructor(t,n=e.BASE_PATH,i=r.default){this.basePath=n,this.axios=i,t&&(this.configuration=t,this.basePath=t.basePath||this.basePath)}};class i extends Error{constructor(t,e){super(e),this.field=t,this.name="RequiredError"}}e.RequiredError=i},44340:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createRequestFunction=e.toPathString=e.serializeDataIfNeeded=e.setSearchParams=e.setOAuthToObject=e.setBearerAuthToObject=e.setBasicAuthToObject=e.setApiKeyToObject=e.assertParamExists=e.DUMMY_BASE_URL=void 0;const r=n(5163),i=n(61617);e.DUMMY_BASE_URL="https://example.com";e.assertParamExists=function(t,e,n){if(null==n)throw new i.RequiredError(e,`Required parameter ${e} was null or undefined when calling ${t}.`)};e.setApiKeyToObject=function(t,e,n){return r.__awaiter(this,void 0,void 0,(function*(){if(n&&n.apiKey){const r="function"==typeof n.apiKey?yield n.apiKey(e):yield n.apiKey;t[e]=r}}))};e.setBasicAuthToObject=function(t,e){e&&(e.username||e.password)&&(t.auth={username:e.username,password:e.password})};e.setBearerAuthToObject=function(t,e){return r.__awaiter(this,void 0,void 0,(function*(){if(e&&e.accessToken){const n="function"==typeof e.accessToken?yield e.accessToken():yield e.accessToken;t.Authorization="Bearer "+n}}))};function o(t,e,n=""){"object"==typeof e?Array.isArray(e)?e.forEach((e=>o(t,e,n))):Object.keys(e).forEach((r=>o(t,e[r],`${n}${""!==n?".":""}${r}`))):t.has(n)?t.append(n,e):t.set(n,e)}e.setOAuthToObject=function(t,e,n,i){return r.__awaiter(this,void 0,void 0,(function*(){if(i&&i.accessToken){const r="function"==typeof i.accessToken?yield i.accessToken(e,n):yield i.accessToken;t.Authorization="Bearer "+r}}))};e.setSearchParams=function(t,...e){const n=new URLSearchParams(t.search);o(n,e),t.search=n.toString()};e.serializeDataIfNeeded=function(t,e,n){const r="string"!=typeof t;return(r&&n&&n.isJsonMime?n.isJsonMime(e.headers["Content-Type"]):r)?JSON.stringify(void 0!==t?t:{}):t||""};e.toPathString=function(t){return t.pathname+t.search+t.hash};e.createRequestFunction=function(t,e,n,r){return(i=e,o=n)=>{const s=Object.assign(Object.assign({},t.options),{url:((null==r?void 0:r.basePath)||o)+t.url});return i.request(s)}}},86367:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Configuration=void 0;e.Configuration=class{constructor(t={}){this.apiKey=t.apiKey,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.baseOptions=t.baseOptions,this.formDataCtor=t.formDataCtor}isJsonMime(t){const e=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==t&&(e.test(t)||"application/json-patch+json"===t.toLowerCase())}}},77117:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(5163);r.__exportStar(n(53773),e),r.__exportStar(n(86367),e)},48526:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(5163);r.__exportStar(n(44851),e),r.__exportStar(n(65442),e),r.__exportStar(n(20143),e),r.__exportStar(n(31144),e)},35164:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getSolanaRpcEndpoint=void 0,e.getSolanaRpcEndpoint=function(t){switch(t){case"devnet":return"devnet";case"mainnet":case"mainnet-beta":return"mainnet-beta";default:if(null==t?void 0:t.startsWith("http"))return t;throw new Error("Unknown http or https endpoint")}}},44851:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(5163);r.__exportStar(n(35164),e),r.__exportStar(n(30581),e)},30581:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.kinToQuarks=e.quarksToKin=e.removeDecimals=e.addDecimals=void 0;const r=n(30586);var i=n(30586);Object.defineProperty(e,"addDecimals",{enumerable:!0,get:function(){return i.addDecimals}}),Object.defineProperty(e,"removeDecimals",{enumerable:!0,get:function(){return i.removeDecimals}}),e.quarksToKin=function(t){return(0,r.removeDecimals)(t,5)},e.kinToQuarks=function(t){return(0,r.addDecimals)(t,5)}},69054:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.validateKineticSdkConfig=void 0,e.validateKineticSdkConfig=function(t){if(!t.endpoint)throw new Error("validateKineticSdkConfig: no endpoint configured.");if(!t.endpoint.startsWith("http"))throw new Error("validateKineticSdkConfig: the endpoint should start with http or https.");if(!t.environment)throw new Error("validateKineticSdkConfig: no environment configured.");if(!t.index)throw new Error("validateKineticSdkConfig: no index configured.");if(!Number.isInteger(t.index))throw new Error("validateKineticSdkConfig: index should be an integer.");return Object.assign(Object.assign({},t),{endpoint:(e=t.endpoint,e.replace(/\/+$/,""))});var e}},76087:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},70451:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},26942:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},85222:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},52459:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},65442:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(5163);r.__exportStar(n(76087),e),r.__exportStar(n(70451),e),r.__exportStar(n(26942),e),r.__exportStar(n(52459),e),r.__exportStar(n(65804),e),r.__exportStar(n(45418),e),r.__exportStar(n(34),e),r.__exportStar(n(58530),e),r.__exportStar(n(14220),e),r.__exportStar(n(5606),e),r.__exportStar(n(85222),e)},34:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},58530:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},65804:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},45418:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},14220:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5606:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},46288:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KineticSdkInternal=void 0;const r=n(5163),i=n(30586),o=n(77117),s=n(31144);e.KineticSdkInternal=class{constructor(t){this.sdkConfig=t;const e=new o.Configuration({baseOptions:this.apiBaseOptions(this.sdkConfig.headers),basePath:t.endpoint});this.accountApi=new o.AccountApi(e),this.airdropApi=new o.AirdropApi(e),this.appApi=new o.AppApi(e),this.transactionApi=new o.TransactionApi(e)}createAccount(t){var e;return r.__awaiter(this,void 0,void 0,(function*(){const n=this.ensureAppConfig(),r=this.getAppMint(n,null===(e=t.mint)||void 0===e?void 0:e.toString()),o=yield this.getTokenAccounts({account:t.owner.publicKey,mint:r.publicKey});if(null==o?void 0:o.length)throw new Error(`Owner ${t.owner.publicKey} already has an account for mint ${r.publicKey}.`);const s=t.commitment||i.Commitment.Confirmed,{blockhash:a,lastValidBlockHeight:c}=yield this.getBlockhash(),u=yield(0,i.generateCreateAccountTransaction)({addMemo:r.addMemo,blockhash:a,index:this.sdkConfig.index,lastValidBlockHeight:c,mintFeePayer:r.feePayer,mintPublicKey:r.publicKey,owner:t.owner.solana}),l={commitment:s,environment:this.sdkConfig.environment,index:this.sdkConfig.index,lastValidBlockHeight:c,mint:r.publicKey,referenceId:t.referenceId,referenceType:t.referenceType,tx:(0,i.serializeTransaction)(u)};return this.accountApi.createAccount(l).then((t=>t.data))}))}getAppConfig(t,e){return r.__awaiter(this,void 0,void 0,(function*(){const n=yield this.appApi.getAppConfig(t,e);return this.appConfig=n.data,this.appConfig}))}getBalance(t){return r.__awaiter(this,void 0,void 0,(function*(){return this.accountApi.getBalance(this.sdkConfig.environment,this.sdkConfig.index,t.account.toString()).then((t=>t.data))}))}getHistory(t){var e;const n=this.ensureAppConfig(),r=this.getAppMint(n,null===(e=t.mint)||void 0===e?void 0:e.toString());return this.accountApi.getHistory(this.sdkConfig.environment,this.sdkConfig.index,t.account.toString(),r.publicKey).then((t=>t.data))}getTokenAccounts(t){var e;const n=this.ensureAppConfig(),r=this.getAppMint(n,null===(e=t.mint)||void 0===e?void 0:e.toString());return this.accountApi.getTokenAccounts(this.sdkConfig.environment,this.sdkConfig.index,t.account.toString(),r.publicKey).then((t=>t.data))}getTransaction(t){return this.transactionApi.getTransaction(this.sdkConfig.environment,this.sdkConfig.index,t.signature).then((t=>t.data))}makeTransfer(t){var e;return r.__awaiter(this,void 0,void 0,(function*(){const n=this.ensureAppConfig(),r=this.getAppMint(n,null===(e=t.mint)||void 0===e?void 0:e.toString()),o=t.commitment||i.Commitment.Confirmed,s=t.destination.toString(),a=t.senderCreate||!1;this.validateDestination(n,s);const c=yield this.getTokenAccounts({account:s,mint:r.publicKey});if(!(null==c?void 0:c.length)&&!a)throw new Error("Destination account doesn't exist.");const{lastValidBlockHeight:u,blockhash:l}=yield this.getBlockhash(),d=yield(0,i.generateMakeTransferTransaction)({addMemo:r.addMemo,amount:t.amount,blockhash:l,destination:s,index:this.sdkConfig.index,lastValidBlockHeight:u,mintDecimals:r.decimals,mintFeePayer:r.feePayer,mintPublicKey:r.publicKey,owner:t.owner.solana,senderCreate:!(null==c?void 0:c.length)&&a,type:t.type||i.TransactionType.None});return this.makeTransferRequest({commitment:o,environment:this.sdkConfig.environment,index:this.sdkConfig.index,lastValidBlockHeight:u,mint:r.publicKey,referenceId:t.referenceId,referenceType:t.referenceType,tx:(0,i.serializeTransaction)(d)})}))}makeTransferBatch(t){var e;return r.__awaiter(this,void 0,void 0,(function*(){const n=this.ensureAppConfig(),r=this.getAppMint(n,null===(e=t.mint)||void 0===e?void 0:e.toString()),o=t.commitment||i.Commitment.Confirmed,s=t.destinations,a=t.referenceId||null,c=t.referenceType||null;this.validateDestinations(n,s);const{blockhash:u,lastValidBlockHeight:l}=yield this.getBlockhash(),d=yield(0,i.generateMakeTransferBatchTransaction)({addMemo:r.addMemo,blockhash:u,destinations:s,index:this.sdkConfig.index,lastValidBlockHeight:l,mintDecimals:r.decimals,mintFeePayer:r.feePayer,mintPublicKey:r.publicKey,owner:t.owner.solana,type:t.type||i.TransactionType.None});return this.makeTransferRequest({commitment:o,environment:this.sdkConfig.environment,index:this.sdkConfig.index,lastValidBlockHeight:l,mint:r.publicKey,referenceId:a,referenceType:c,tx:(0,i.serializeTransaction)(d)})}))}requestAirdrop(t){var e,n;const r=this.ensureAppConfig(),o=this.getAppMint(r,null===(e=t.mint)||void 0===e?void 0:e.toString());return this.airdropApi.requestAirdrop({account:null===(n=t.account)||void 0===n?void 0:n.toString(),amount:t.amount,commitment:t.commitment||i.Commitment.Finalized,environment:this.sdkConfig.environment,index:this.sdkConfig.index,mint:o.publicKey}).then((t=>t.data))}apiBaseOptions(t={}){return{headers:Object.assign(Object.assign({},t),{"kinetic-environment":`${this.sdkConfig.environment}`,"kinetic-index":`${this.sdkConfig.index}`,"kinetic-user-agent":`${s.NAME}@${s.VERSION}`})}}ensureAppConfig(){if(!this.appConfig)throw new Error("AppConfig not initialized");return this.appConfig}getAppMint(t,e){e=e||t.mint.publicKey;const n=t.mints.find((t=>t.publicKey===e));if(!n)throw new Error("Mint not found");return n}getBlockhash(){return r.__awaiter(this,void 0,void 0,(function*(){const{blockhash:t,lastValidBlockHeight:e}=yield this.transactionApi.getLatestBlockhash(this.sdkConfig.environment,this.sdkConfig.index).then((t=>t.data));return{blockhash:t,lastValidBlockHeight:e}}))}makeTransferRequest(t){return this.transactionApi.makeTransfer(t).then((t=>t.data))}validateDestination(t,e){if(t.mints.find((t=>t.publicKey===e)))throw new Error("Transfers to a mint are not allowed.")}validateDestinations(t,e){if((null==e?void 0:e.length)<1)throw new Error("At least 1 destination required");if((null==e?void 0:e.length)>15)throw new Error("Maximum number of destinations exceeded");e.forEach((e=>{var n;return this.validateDestination(t,null===(n=e.destination)||void 0===n?void 0:n.toString())}))}}},78242:(t,e,n)=>{"undefined"!=typeof window&&void 0===window.global&&"undefined"==typeof Buffer&&(window.global=window,global.Buffer=n(48834).Buffer)},20143:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KineticSdk=void 0;const r=n(5163),i=n(30586),o=n(31144),s=n(44851),a=n(69054),c=n(46288);n(78242);class u{constructor(t){this.sdkConfig=t,this.internal=new c.KineticSdkInternal(t)}get config(){return this.internal.appConfig}get endpoint(){return this.sdkConfig.endpoint}get solanaRpcEndpoint(){return this.sdkConfig.solanaRpcEndpoint}createAccount(t){return this.internal.createAccount(t)}getBalance(t){return this.internal.getBalance(t)}getExplorerUrl(t){var e,n,r,i;return null===(i=null===(r=null===(n=null===(e=this.internal)||void 0===e?void 0:e.appConfig)||void 0===n?void 0:n.environment)||void 0===r?void 0:r.explorer)||void 0===i?void 0:i.replace("{path}",t)}getHistory(t){return this.internal.getHistory(t)}getTokenAccounts(t){return this.internal.getTokenAccounts(t)}getTransaction(t){return this.internal.getTransaction(t)}makeTransfer(t){return this.internal.makeTransfer(t)}makeTransferBatch(t){return this.internal.makeTransferBatch(t)}requestAirdrop(t){return this.internal.requestAirdrop(t)}init(){var t,e,n,a,c,u,l;return r.__awaiter(this,void 0,void 0,(function*(){try{null===(e=null===(t=this.sdkConfig)||void 0===t?void 0:t.logger)||void 0===e||e.log(`${o.NAME}: initializing ${o.NAME}@${o.VERSION}`);const r=yield this.internal.getAppConfig(this.sdkConfig.environment,this.sdkConfig.index);return this.sdkConfig.solanaRpcEndpoint=this.sdkConfig.solanaRpcEndpoint?(0,s.getSolanaRpcEndpoint)(this.sdkConfig.solanaRpcEndpoint):(0,s.getSolanaRpcEndpoint)(r.environment.cluster.endpoint),this.solana=new i.Solana(this.sdkConfig.solanaRpcEndpoint,{logger:null===(n=this.sdkConfig)||void 0===n?void 0:n.logger}),null===(c=null===(a=this.sdkConfig)||void 0===a?void 0:a.logger)||void 0===c||c.log(`${o.NAME}: endpoint '${this.sdkConfig.endpoint}', environment '${this.sdkConfig.environment}', index: ${r.app.index}`),r}catch(r){throw null===(l=null===(u=this.sdkConfig)||void 0===u?void 0:u.logger)||void 0===l||l.error("Error initializing Server."),new Error("Error initializing Server.")}}))}static setup(t){var e;return r.__awaiter(this,void 0,void 0,(function*(){const n=new u((0,a.validateKineticSdkConfig)(t));try{return yield n.init().then((()=>{var e;return null===(e=t.logger)||void 0===e?void 0:e.log(`${o.NAME}: Setup done.`)})),n}catch(r){throw null===(e=t.logger)||void 0===e||e.error(`${o.NAME}: Error setting up SDK.`,r),new Error(`${o.NAME}: Error setting up SDK.`)}}))}}e.KineticSdk=u},31144:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION=e.NAME=void 0,e.NAME="@kin-kinetic/sdk",e.VERSION="1.0.0-rc.8"},30586:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(5163);r.__exportStar(n(51479),e),r.__exportStar(n(99302),e),r.__exportStar(n(64759),e),r.__exportStar(n(80160),e),r.__exportStar(n(66565),e)},2064:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.removeDecimals=e.addDecimals=void 0;const r=n(6391);e.addDecimals=function(t,e){return new r.default(t).decimalPlaces(e,r.default.ROUND_DOWN).multipliedBy(Math.pow(10,e))},e.removeDecimals=function(t,e){return new r.default(t).dividedBy(Math.pow(10,e)).toString()}},28970:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.convertCommitment=void 0;const r=n(99302);e.convertCommitment=function(t){switch(t){case r.Commitment.Confirmed:return"confirmed";case r.Commitment.Finalized:return"finalized";case r.Commitment.Processed:return"processed";default:return"finalized"}}},51373:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.generateCreateAccountTransaction=void 0;const r=n(5163),i=n(52828),o=n(27158),s=n(64759),a=n(78014),c=n(12116);e.generateCreateAccountTransaction=function({addMemo:t,blockhash:e,index:n,lastValidBlockHeight:u,mintFeePayer:l,mintPublicKey:d,owner:h}){return r.__awaiter(this,void 0,void 0,(function*(){const r=(0,c.getPublicKey)(d),f=(0,c.getPublicKey)(l),p=h.publicKey,y=yield(0,i.getAssociatedTokenAddress)(r,p),g=[];t&&g.push((0,a.generateKinMemoInstruction)({index:n,type:s.TransactionType.None})),g.push((0,i.createAssociatedTokenAccountInstruction)(f,y,p,r),(0,i.createSetAuthorityInstruction)(y,p,i.AuthorityType.CloseAccount,f));const m=new o.Transaction({blockhash:e,feePayer:(0,c.getPublicKey)(l),lastValidBlockHeight:u,signatures:[{publicKey:p,signature:null}]}).add(...g);return m.partialSign(h),m}))}},92154:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.generateMakeTransferBatchTransaction=void 0;const r=n(5163),i=n(52828),o=n(27158),s=n(78014),a=n(2064),c=n(12116);e.generateMakeTransferBatchTransaction=function({addMemo:t,blockhash:e,destinations:n,index:u,lastValidBlockHeight:l,mintDecimals:d,mintFeePayer:h,mintPublicKey:f,owner:p,type:y}){return r.__awaiter(this,void 0,void 0,(function*(){const g=(0,c.getPublicKey)(f),m=(0,c.getPublicKey)(h),b=p.publicKey,w=yield(0,i.getAssociatedTokenAddress)(g,b),k=yield Promise.all(n.map((({amount:t,destination:e})=>r.__awaiter(this,void 0,void 0,(function*(){return{amount:(0,a.addDecimals)(t,d).toNumber(),destination:yield(0,i.getAssociatedTokenAddress)(g,(0,c.getPublicKey)(e))}}))))),v=[];t&&v.push((0,s.generateKinMemoInstruction)({index:u,type:y})),k.map((({amount:t,destination:e})=>v.push((0,i.createTransferCheckedInstruction)(w,g,e,b,t,d,[],i.TOKEN_PROGRAM_ID))));const I=new o.Transaction({blockhash:e,feePayer:m,lastValidBlockHeight:l,signatures:[{publicKey:b,signature:null}]}).add(...v);return I.partialSign(p),I}))}},52981:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.generateMakeTransferTransaction=void 0;const r=n(5163),i=n(52828),o=n(27158),s=n(2064),a=n(78014),c=n(12116);e.generateMakeTransferTransaction=function({addMemo:t,amount:e,blockhash:n,destination:u,index:l,lastValidBlockHeight:d,mintDecimals:h,mintFeePayer:f,mintPublicKey:p,owner:y,senderCreate:g,type:m}){return r.__awaiter(this,void 0,void 0,(function*(){const r=(0,c.getPublicKey)(p),b=(0,c.getPublicKey)(f),w=y.publicKey,[k,v]=yield Promise.all([(0,i.getAssociatedTokenAddress)(r,w),(0,i.getAssociatedTokenAddress)(r,(0,c.getPublicKey)(u))]),I=[];t&&I.push((0,a.generateKinMemoInstruction)({index:l,type:m})),g&&I.push((0,i.createAssociatedTokenAccountInstruction)(b,v,(0,c.getPublicKey)(u),r)),I.push((0,i.createTransferCheckedInstruction)(k,r,v,w,(0,s.addDecimals)(e,h).toNumber(),h,[],i.TOKEN_PROGRAM_ID));const A=new o.Transaction({blockhash:n,feePayer:b,lastValidBlockHeight:d,signatures:[{publicKey:w,signature:null}]}).add(...I);return A.partialSign(y),A}))}},12116:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getPublicKey=void 0;const r=n(27158);e.getPublicKey=function(t){return"string"==typeof t?new r.PublicKey(t):t}},51479:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(5163);r.__exportStar(n(2064),e),r.__exportStar(n(28970),e),r.__exportStar(n(51373),e),r.__exportStar(n(92154),e),r.__exportStar(n(52981),e),r.__exportStar(n(12116),e),r.__exportStar(n(44018),e),r.__exportStar(n(96345),e),r.__exportStar(n(3197),e),r.__exportStar(n(21406),e),r.__exportStar(n(60067),e),r.__exportStar(n(68277),e)},44018:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseAndSignTokenTransfer=void 0;const r=n(52828),i=n(96345);e.parseAndSignTokenTransfer=function({tx:t,signer:e}){const{blockhash:n,feePayer:o,source:s,transaction:a}=(0,i.parseAndSignTransaction)({tx:t,signer:e}),c=a.instructions.find((t=>{var e;return(null===(e=null==t?void 0:t.programId)||void 0===e?void 0:e.toBase58())===(null===r.TOKEN_PROGRAM_ID||void 0===r.TOKEN_PROGRAM_ID?void 0:r.TOKEN_PROGRAM_ID.toBase58())}));if(!c)throw new Error("parseAndSignTokenTransfer: Can't find token transfer instruction");const{data:{amount:u},keys:{destination:l}}=(0,r.decodeTransferCheckedInstruction)(c,r.TOKEN_PROGRAM_ID);return{amount:u,blockhash:n,destination:l,feePayer:o,source:s,transaction:a}}},96345:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseAndSignTransaction=void 0;const r=n(27158);e.parseAndSignTransaction=function({tx:t,signer:e}){var n,i,o;const s=r.Transaction.from(Buffer.from(t));s.partialSign(e);const a=null===(n=null==s?void 0:s.feePayer)||void 0===n?void 0:n.toBase58();if(!a)throw new Error("parseAndSignTransaction: Can't find token feePayer");if(!s.recentBlockhash)throw new Error("parseAndSignTransaction: Can't find recentBlockhash");const c=null===(o=null===(i=s.signatures.find((t=>t.publicKey.toBase58()!==a)))||void 0===i?void 0:i.publicKey)||void 0===o?void 0:o.toBase58();if(!c)throw new Error("parseAndSignTransaction: Can't find transaction source");return{feePayer:a,blockhash:s.recentBlockhash.toString(),source:c,transaction:s}}},3197:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseEndpoint=void 0;const r=n(27158);e.parseEndpoint=function(t){return(null==t?void 0:t.startsWith("http"))?t:(0,r.clusterApiUrl)(t)}},21406:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseTransactionSimulation=void 0;const r=n(68277);function i(t){switch(t){case 1:return{type:"InsufficientFunds",message:"Insufficient funds."};case"InvalidAccountData":return{type:"InvalidAccountData",message:"Insufficient funds."};default:return{type:"Unknown",message:"Unknown error."}}}e.parseTransactionSimulation=function(t){const e=t.logs?t.logs:void 0;if((null==t?void 0:t.err)&&"object"==typeof t.err&&"InstructionError"in t.err){const n=t.err,[o,s]=n.InstructionError,{Custom:a}=s,c=i(void 0!==a?a:s);throw new r.TransactionError(c.message,e,c.type,o)}return t}},60067:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.serializeTransaction=void 0,e.serializeTransaction=function(t){return t.serialize({requireAllSignatures:!1,verifySignatures:!1}).toString("base64")}},68277:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TransactionError=void 0;const r=n(27158);class i extends r.SendTransactionError{constructor(t,e,n,r){super(t,e),this.logs=e,this.type=n,this.instruction=r}}e.TransactionError=i},34279:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},71992:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},72254:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},93959:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},49625:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Commitment=void 0,function(t){t.Confirmed="Confirmed",t.Finalized="Finalized",t.Processed="Processed"}(e.Commitment||(e.Commitment={}))},33423:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},42141:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},28424:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},41502:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},99302:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(5163);r.__exportStar(n(71992),e),r.__exportStar(n(34279),e),r.__exportStar(n(72254),e),r.__exportStar(n(93959),e),r.__exportStar(n(49625),e),r.__exportStar(n(33423),e),r.__exportStar(n(42141),e),r.__exportStar(n(28424),e),r.__exportStar(n(41502),e),r.__exportStar(n(56729),e),r.__exportStar(n(70810),e),r.__exportStar(n(7830),e),r.__exportStar(n(21332),e)},56729:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},70810:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},7830:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},21332:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},51566:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createKinMemo=void 0;const r=n(92528),i=n(80814);e.createKinMemo=function({index:t,memo:e,type:n=i.TransactionType.None}){let o=Buffer.alloc(29);return e&&(o=Buffer.from(e,"base64")),r.KinMemo.new(1,n,t,o).buffer.toString("base64")}},78014:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.generateKinMemoInstruction=e.MEMO_V1_TOKEN_ID=void 0;const r=n(51566),i=n(9345);e.MEMO_V1_TOKEN_ID="Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo",e.generateKinMemoInstruction=function({index:t,type:e}){const n=(0,r.createKinMemo)({index:t,type:e});return(0,i.generateMemoInstruction)(n)}},9345:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.generateMemoInstruction=void 0;const r=n(27158),i=n(78014);e.generateMemoInstruction=function(t){return new r.TransactionInstruction({keys:[],programId:new r.PublicKey(i.MEMO_V1_TOKEN_ID),data:Buffer.from(t)})}},64759:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(5163);r.__exportStar(n(51566),e),r.__exportStar(n(78014),e),r.__exportStar(n(9345),e),r.__exportStar(n(92528),e),r.__exportStar(n(57662),e),r.__exportStar(n(80814),e)},57662:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MAX_VERSION=e.MAX_APP_INDEX=e.MAX_TRANSACTION_TYPE=e.MAGIC_BYTE=void 0,e.MAGIC_BYTE=1,e.MAX_TRANSACTION_TYPE=3,e.MAX_APP_INDEX=Math.pow(2,16)-1,e.MAX_VERSION=1},92528:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KinMemo=void 0;const r=n(57662),i=n(80814);class o{constructor(t){this.buffer=t}static from(t){const e=Buffer.alloc(t.length);return t.copy(e),new this(e)}static fromB64String(t,e=!0){const n=Buffer.from(t,"base64"),r=o.from(n);if(!o.isValid(r,e))throw new Error("invalid memo");return r}static new(t,e,n,i){if(i.length>29)throw new Error("invalid foreign key length");if(t>7)throw new Error("invalid version");if(e<0)throw new Error("cannot use unknown transaction type");const o=Buffer.alloc(32);if(o[0]=r.MAGIC_BYTE,o[0]|=t<<2,o[0]|=(7&e)<<5,o[1]=(24&e)>>3,o[1]|=(63&n)<<2,o[2]=(16320&n)>>6,o[3]=(49152&n)>>14,i.byteLength>0){o[3]|=(63&i[0])<<2;for(let t=4;t<3+i.byteLength;t++)o[t]=i[t-4]>>6&3,o[t]|=(63&i[t-3])<<2;i.byteLength<29&&(o[i.byteLength+3]=i[i.byteLength-1]>>6&3)}return new this(o)}static isValid(t,e){return Number(3&t.buffer[0])==r.MAGIC_BYTE&&(-1!=t.transactionTypeRaw()&&(!e||!(t.version()>r.MAX_VERSION)&&(t.transactionType()>=0&&t.transactionType()<=r.MAX_TRANSACTION_TYPE)))}version(){return(28&this.buffer[0])>>2}transactionType(){const t=this.transactionTypeRaw();return t>=0&&t<=r.MAX_TRANSACTION_TYPE?t:i.TransactionType.Unknown}transactionTypeRaw(){return this.buffer[0]>>5|(3&this.buffer[1])<<3}index(){return Number(this.buffer[1])>>2|Number(this.buffer[2])<<6|Number(3&this.buffer[3])<<14}foreignKey(){const t=Buffer.alloc(29);for(let e=0;e<28;e++)t[e]|=this.buffer[e+3]>>2,t[e]|=(3&this.buffer[e+4])<<6;return t[28]=this.buffer[31]>>2,t}}e.KinMemo=o},80814:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TransactionType=void 0,function(t){t[t.Unknown=-1]="Unknown",t[t.None=0]="None",t[t.Earn=1]="Earn",t[t.Spend=2]="Spend",t[t.P2P=3]="P2P"}(e.TransactionType||(e.TransactionType={}))},80160:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Solana=void 0;const r=n(5163),i=n(27158),o=n(89644),s=n(6391),a=n(66565),c=n(51479),u=n(99302);e.Solana=class{constructor(t,e={}){var n;this.config=e,this.endpoint=(0,c.parseEndpoint)(t),this.connection=new i.Connection(this.endpoint),null===(n=e.logger)||void 0===n||n.log(`${a.NAME}: Solana RPC Endpoint: ${this.endpoint}`)}confirmTransaction({blockhash:t,lastValidBlockHeight:e,signature:n},r){return this.connection.confirmTransaction({blockhash:t,lastValidBlockHeight:e,signature:n},(0,c.convertCommitment)(r))}getAccountHistory(t){var e;return r.__awaiter(this,void 0,void 0,(function*(){null===(e=this.config.logger)||void 0===e||e.log(`Getting account history: ${(0,c.getPublicKey)(t)}`);try{const e=yield this.connection.getConfirmedSignaturesForAddress2((0,c.getPublicKey)(t));return{account:t,history:e}}catch(n){return console.log(n),n}}))}getAccountInfo(t,{commitment:e=u.Commitment.Confirmed}){var n;return null===(n=this.config.logger)||void 0===n||n.log(`Getting account info: ${t}`),this.connection.getParsedAccountInfo(new i.PublicKey(t),(0,c.convertCommitment)(e))}getBalance(t,e){var n;return r.__awaiter(this,void 0,void 0,(function*(){if(e=Array.isArray(e)?e:[e],null===(n=this.config.logger)||void 0===n||n.log(`Getting account balance summary: ${t} for mints ${e.map((t=>t.publicKey)).join(", ")}`),!e.length)throw new Error("getBalance: No mints provided.");const r=e[0];try{const n=[],i=(yield Promise.allSettled(e.map((e=>this.getTokenAccounts(t,e.publicKey).then((t=>({mint:e,accounts:t}))))))).filter((t=>"fulfilled"===t.status)).map((t=>t.value)),o=e.reduce(((t,e)=>{var n;return Object.assign(Object.assign({},t),{[e.publicKey]:(null===(n=i.find((t=>t.mint.publicKey===e.publicKey)))||void 0===n?void 0:n.accounts)||[]})}),{});for(const{mint:t,accounts:e}of i)for(const r of e){const{balance:e}=yield this.getTokenBalance(r);n.push({account:r,balance:(0,c.removeDecimals)(e,t.decimals).toString(),decimals:t.decimals,mint:t.publicKey})}const a=n.reduce(((t,{mint:e,balance:n})=>{const r=t[e]?t[e]:new s.default(0);return Object.assign(Object.assign({},t),{[e]:r.plus(n)})}),{});return{balance:(a[r.publicKey]?a[r.publicKey]:"0").toString(),mintMap:o,mints:a,tokens:n}}catch(i){throw new Error("No token accounts found for "+(e.length>1?`mints ${e.join(", ")}`:`mint ${r}`))}}))}getBalanceSol(t){var e;return r.__awaiter(this,void 0,void 0,(function*(){return null===(e=this.config.logger)||void 0===e||e.log(`Getting account balance: ${t} (SOL)`),this.connection.getBalance((0,c.getPublicKey)(t))}))}getMinimumBalanceForRentExemption(t){var e;return null===(e=this.config.logger)||void 0===e||e.log(`Getting minimum balance for rent exemption: ${t}`),this.connection.getMinimumBalanceForRentExemption(t)}getLatestBlockhash(){var t;return null===(t=this.config.logger)||void 0===t||t.log("Getting latest blockhash"),this.connection.getLatestBlockhash()}getTokenAccounts(t,e){var n;return r.__awaiter(this,void 0,void 0,(function*(){null===(n=this.config.logger)||void 0===n||n.log(`Getting token account: ${(0,c.getPublicKey)(t)} / mint: ${(0,c.getPublicKey)(e)}`);return(yield this.connection.getTokenAccountsByOwner((0,c.getPublicKey)(t),{mint:(0,c.getPublicKey)(e)})).value.map((({pubkey:t})=>t.toBase58()))}))}getTokenAccountsHistory(t){var e;return null===(e=this.config.logger)||void 0===e||e.log(`Getting token accounts history: ${t}`),Promise.all(t.map((t=>this.getAccountHistory(t))))}getTokenBalance(t){var e;return r.__awaiter(this,void 0,void 0,(function*(){null===(e=this.config.logger)||void 0===e||e.log(`Getting token balance: ${(0,c.getPublicKey)(t)}`);const n=yield this.connection.getTokenAccountBalance((0,c.getPublicKey)(t));return{account:t,balance:new s.default(n.value.amount)}}))}getTokenBalances(t,e){var n;return r.__awaiter(this,void 0,void 0,(function*(){null===(n=this.config.logger)||void 0===n||n.log(`Getting token balances: ${(0,c.getPublicKey)(t)}`);const i=yield this.getTokenAccounts(t,e);return Promise.all(i.map((t=>r.__awaiter(this,void 0,void 0,(function*(){return this.getTokenBalance(t)})))))}))}getTokenHistory(t,e){var n;return r.__awaiter(this,void 0,void 0,(function*(){return null===(n=this.config.logger)||void 0===n||n.log(`Getting token history: ${(0,c.getPublicKey)(t)} / ${(0,c.getPublicKey)(e)} `),this.getTokenAccounts(t,e).then((t=>this.getTokenAccountsHistory(t)))}))}getTransaction(t){var e;return r.__awaiter(this,void 0,void 0,(function*(){null===(e=this.config.logger)||void 0===e||e.log(`Getting transaction: ${t} `);const n=yield this.connection.getSignatureStatus(t,{searchTransactionHistory:!0}),r=yield this.connection.getTransaction(t);return{signature:t,status:n,transaction:r}}))}requestAirdrop(t,e){var n;return null===(n=this.config.logger)||void 0===n||n.log(`Request Airdrop: ${(0,c.getPublicKey)(t)} ${e}`),this.connection.requestAirdrop((0,c.getPublicKey)(t),e)}sendRawTransaction(t){var e;return r.__awaiter(this,void 0,void 0,(function*(){return yield this.simulateTransaction(t),null===(e=this.config.logger)||void 0===e||e.log("Send Raw Transaction"),this.connection.sendRawTransaction(t.serialize(),{skipPreflight:!1})}))}simulateTransaction(t){var e;return r.__awaiter(this,void 0,void 0,(function*(){null===(e=this.config.logger)||void 0===e||e.log("Simulate Transaction");const n=yield this.connection.simulateTransaction(t);return(0,c.parseTransactionSimulation)(n.value)}))}healthCheck(){var t;return r.__awaiter(this,void 0,void 0,(function*(){null===(t=this.config.logger)||void 0===t||t.log("Health check");return"ok"===(yield o.default.get(`${this.endpoint}/health`)).data.toString()}))}getRecentPerformanceSamples(t){return this.connection.getRecentPerformanceSamples(t)}}},66565:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION=e.NAME=void 0,e.NAME="@kin-kinetic/solana",e.VERSION="1.0.0-rc.8"},59696:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.utils=e.curve25519=e.getSharedSecret=e.sync=e.verify=e.sign=e.getPublicKey=e.Signature=e.Point=e.RistrettoPoint=e.ExtendedPoint=e.CURVE=void 0;const r=n(10868),i=BigInt(0),o=BigInt(1),s=BigInt(2),a=BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),c=Object.freeze({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),P:BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),l:a,n:a,h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960")});e.CURVE=c;const u=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),l=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),d=(BigInt("6853475219497561581579357271197624642482790079785650197046958215289687604742"),BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235")),h=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),f=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),p=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");class y{constructor(t,e,n,r){this.x=t,this.y=e,this.z=n,this.t=r}static fromAffine(t){if(!(t instanceof v))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return t.equals(v.ZERO)?y.ZERO:new y(t.x,t.y,o,M(t.x*t.y))}static toAffineBatch(t){const e=function(t,e=c.P){const n=new Array(t.length),r=C(t.reduce(((t,r,o)=>r===i?t:(n[o]=t,M(t*r,e))),o),e);return t.reduceRight(((t,r,o)=>r===i?t:(n[o]=M(t*n[o],e),M(t*r,e))),r),n}(t.map((t=>t.z)));return t.map(((t,n)=>t.toAffine(e[n])))}static normalizeZ(t){return this.toAffineBatch(t).map(this.fromAffine)}equals(t){g(t);const{x:e,y:n,z:r}=this,{x:i,y:o,z:s}=t,a=M(e*s),c=M(i*r),u=M(n*s),l=M(o*r);return a===c&&u===l}negate(){return new y(M(-this.x),this.y,this.z,M(-this.t))}double(){const{x:t,y:e,z:n}=this,{a:r}=c,i=M(t*t),o=M(e*e),a=M(s*M(n*n)),u=M(r*i),l=t+e,d=M(M(l*l)-i-o),h=u+o,f=h-a,p=u-o,g=M(d*f),m=M(h*p),b=M(d*p),w=M(f*h);return new y(g,m,w,b)}add(t){g(t);const{x:e,y:n,z:r,t:o}=this,{x:a,y:c,z:u,t:l}=t,d=M((n-e)*(c+a)),h=M((n+e)*(c-a)),f=M(h-d);if(f===i)return this.double();const p=M(r*s*l),m=M(o*s*u),b=m+p,w=h+d,k=m-p,v=M(b*f),I=M(w*k),A=M(b*k),_=M(f*w);return new y(v,I,_,A)}subtract(t){return this.add(t.negate())}precomputeWindow(t){const e=1+256/t,n=[];let r=this,i=r;for(let o=0;o<e;o++){i=r,n.push(i);for(let e=1;e<2**(t-1);e++)i=i.add(r),n.push(i);r=i.double()}return n}wNAF(t,e){!e&&this.equals(y.BASE)&&(e=v.BASE);const n=e&&e._WINDOW_SIZE||1;if(256%n)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let r=e&&k.get(e);r||(r=this.precomputeWindow(n),e&&1!==n&&(r=y.normalizeZ(r),k.set(e,r)));let i=y.ZERO,s=y.ZERO;const a=1+256/n,c=2**(n-1),u=BigInt(2**n-1),l=2**n,d=BigInt(n);for(let h=0;h<a;h++){const e=h*c;let n=Number(t&u);if(t>>=d,n>c&&(n-=l,t+=o),0===n){let t=r[e];h%2&&(t=t.negate()),s=s.add(t)}else{let t=r[e+Math.abs(n)-1];n<0&&(t=t.negate()),i=i.add(t)}}return y.normalizeZ([i,s])[0]}multiply(t,e){return this.wNAF(j(t,c.l),e)}multiplyUnsafe(t){let e=j(t,c.l,!1);const n=y.BASE,r=y.ZERO;if(e===i)return r;if(this.equals(r)||e===o)return this;if(this.equals(n))return this.wNAF(e);let s=r,a=this;for(;e>i;)e&o&&(s=s.add(a)),a=a.double(),e>>=o;return s}isSmallOrder(){return this.multiplyUnsafe(c.h).equals(y.ZERO)}isTorsionFree(){return this.multiplyUnsafe(c.l).equals(y.ZERO)}toAffine(t=C(this.z)){const{x:e,y:n,z:r}=this,i=M(e*t),s=M(n*t);if(M(r*t)!==o)throw new Error("invZ was invalid");return new v(i,s)}fromRistrettoBytes(){b()}toRistrettoBytes(){b()}fromRistrettoHash(){b()}}function g(t){if(!(t instanceof y))throw new TypeError("ExtendedPoint expected")}function m(t){if(!(t instanceof w))throw new TypeError("RistrettoPoint expected")}function b(){throw new Error("Legacy method: switch to RistrettoPoint")}e.ExtendedPoint=y,y.BASE=new y(c.Gx,c.Gy,o,M(c.Gx*c.Gy)),y.ZERO=new y(i,o,o,i);class w{constructor(t){this.ep=t}static calcElligatorRistrettoMap(t){const{d:e}=c,n=M(l*t*t),r=M((n+o)*f);let i=BigInt(-1);const s=M((i-e*n)*M(n+e));let{isValid:a,value:u}=L(r,s),h=M(u*t);P(h)||(h=M(-h)),a||(u=h),a||(i=n);const g=M(i*(n-o)*p-s),m=u*u,b=M((u+u)*s),w=M(g*d),k=M(o-m),v=M(o+m);return new y(M(b*v),M(k*w),M(w*v),M(b*k))}static hashToCurve(t){const e=R((t=D(t,64)).slice(0,32)),n=this.calcElligatorRistrettoMap(e),r=R(t.slice(32,64)),i=this.calcElligatorRistrettoMap(r);return new w(n.add(i))}static fromHex(t){t=D(t,32);const{a:e,d:n}=c,r="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",s=R(t);if(!function(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}(x(s),t)||P(s))throw new Error(r);const a=M(s*s),u=M(o+e*a),l=M(o-e*a),d=M(u*u),h=M(l*l),f=M(e*n*d-h),{isValid:p,value:g}=z(M(f*h)),m=M(g*l),b=M(g*m*f);let k=M((s+s)*m);P(k)&&(k=M(-k));const v=M(u*b),I=M(k*v);if(!p||P(I)||v===i)throw new Error(r);return new w(new y(k,v,o,I))}toRawBytes(){let{x:t,y:e,z:n,t:r}=this.ep;const i=M(M(n+e)*M(n-e)),o=M(t*e),s=M(o*o),{value:a}=z(M(i*s)),c=M(a*i),u=M(a*o),d=M(c*u*r);let f;if(P(r*d)){let n=M(e*l),r=M(t*l);t=n,e=r,f=M(c*h)}else f=u;P(t*d)&&(e=M(-e));let p=M((n-e)*f);return P(p)&&(p=M(-p)),x(p)}toHex(){return S(this.toRawBytes())}toString(){return this.toHex()}equals(t){m(t);const e=this.ep,n=t.ep,r=M(e.x*n.y)===M(e.y*n.x),i=M(e.y*n.y)===M(e.x*n.x);return r||i}add(t){return m(t),new w(this.ep.add(t.ep))}subtract(t){return m(t),new w(this.ep.subtract(t.ep))}multiply(t){return new w(this.ep.multiply(t))}multiplyUnsafe(t){return new w(this.ep.multiplyUnsafe(t))}}e.RistrettoPoint=w,w.BASE=new w(y.BASE),w.ZERO=new w(y.ZERO);const k=new WeakMap;class v{constructor(t,e){this.x=t,this.y=e}_setWindowSize(t){this._WINDOW_SIZE=t,k.delete(this)}static fromHex(t,e=!0){const{d:n,P:r}=c,i=(t=D(t,32)).slice();i[31]=-129&t[31];const s=B(i);if(e&&s>=r)throw new Error("Expected 0 < hex < P");if(!e&&s>=u)throw new Error("Expected 0 < hex < 2**256");const a=M(s*s),l=M(a-o),d=M(n*a+o);let{isValid:h,value:f}=L(l,d);if(!h)throw new Error("Point.fromHex: invalid y coordinate");const p=(f&o)===o;return 0!=(128&t[31])!==p&&(f=M(-f)),new v(f,s)}static async fromPrivateKey(t){return(await $(t)).point}toRawBytes(){const t=x(this.y);return t[31]|=this.x&o?128:0,t}toHex(){return S(this.toRawBytes())}toX25519(){const{y:t}=this;return x(M((o+t)*C(o-t)))}isTorsionFree(){return y.fromAffine(this).isTorsionFree()}equals(t){return this.x===t.x&&this.y===t.y}negate(){return new v(M(-this.x),this.y)}add(t){return y.fromAffine(this).add(y.fromAffine(t)).toAffine()}subtract(t){return this.add(t.negate())}multiply(t){return y.fromAffine(this).multiply(t,this).toAffine()}}e.Point=v,v.BASE=new v(c.Gx,c.Gy),v.ZERO=new v(i,o);class I{constructor(t,e){this.r=t,this.s=e,this.assertValidity()}static fromHex(t){const e=D(t,64),n=v.fromHex(e.slice(0,32),!1),r=B(e.slice(32,64));return new I(n,r)}assertValidity(){const{r:t,s:e}=this;if(!(t instanceof v))throw new Error("Expected Point instance");return j(e,c.l,!1),this}toRawBytes(){const t=new Uint8Array(64);return t.set(this.r.toRawBytes()),t.set(x(this.s),32),t}toHex(){return S(this.toRawBytes())}}function A(...t){if(!t.every((t=>t instanceof Uint8Array)))throw new Error("Expected Uint8Array list");if(1===t.length)return t[0];const e=t.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const e=t[r];n.set(e,i),i+=e.length}return n}e.Signature=I;const _=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function S(t){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");let e="";for(let n=0;n<t.length;n++)e+=_[t[n]];return e}function E(t){if("string"!=typeof t)throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const e=new Uint8Array(t.length/2);for(let n=0;n<e.length;n++){const r=2*n,i=t.slice(r,r+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");e[n]=o}return e}function T(t){return E(t.toString(16).padStart(64,"0"))}function x(t){return T(t).reverse()}function P(t){return(M(t)&o)===o}function B(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");return BigInt("0x"+S(Uint8Array.from(t).reverse()))}const O=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function R(t){return M(B(t)&O)}function M(t,e=c.P){const n=t%e;return n>=i?n:e+n}function C(t,e=c.P){if(t===i||e<=i)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=M(t,e),r=e,s=i,a=o,u=o,l=i;for(;n!==i;){const t=r/n,e=r%n,i=s-u*t,o=a-l*t;r=n,n=e,s=u,a=l,u=i,l=o}if(r!==o)throw new Error("invert: does not exist");return M(s,e)}function U(t,e){const{P:n}=c;let r=t;for(;e-- >i;)r*=r,r%=n;return r}function N(t){const{P:e}=c,n=BigInt(5),r=BigInt(10),i=BigInt(20),a=BigInt(40),u=BigInt(80),l=t*t%e*t%e,d=U(l,s)*l%e,h=U(d,o)*t%e,f=U(h,n)*h%e,p=U(f,r)*f%e,y=U(p,i)*p%e,g=U(y,a)*y%e,m=U(g,u)*g%e,b=U(m,u)*g%e,w=U(b,r)*f%e;return{pow_p_5_8:U(w,s)*t%e,b2:l}}function L(t,e){const n=M(e*e*e),r=M(n*n*e);let i=M(t*n*N(t*r).pow_p_5_8);const o=M(e*i*i),s=i,a=M(i*l),c=o===t,u=o===M(-t),d=o===M(-t*l);return c&&(i=s),(u||d)&&(i=a),P(i)&&(i=M(-i)),{isValid:c||u,value:i}}function z(t){return L(o,t)}function K(t){return M(B(t),c.l)}function D(t,e){const n=t instanceof Uint8Array?Uint8Array.from(t):E(t);if("number"==typeof e&&n.length!==e)throw new Error(`Expected ${e} bytes`);return n}function j(t,e,n=!0){if(!e)throw new TypeError("Specify max value");if("number"==typeof t&&Number.isSafeInteger(t)&&(t=BigInt(t)),"bigint"==typeof t&&t<e)if(n){if(i<t)return t}else if(i<=t)return t;throw new TypeError("Expected valid scalar: 0 < scalar < max")}function W(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function F(t){if(32!==(t="bigint"==typeof t||"number"==typeof t?T(j(t,u)):D(t)).length)throw new Error("Expected 32 bytes");return t}function G(t){const e=W(t.slice(0,32)),n=t.slice(32,64),r=K(e),i=v.BASE.multiply(r),o=i.toRawBytes();return{head:e,prefix:n,scalar:r,point:i,pointBytes:o}}let H;function q(...t){if("function"!=typeof H)throw new Error("utils.sha512Sync must be set to use sync methods");return H(...t)}async function $(t){return G(await e.utils.sha512(F(t)))}function Z(t){return G(q(F(t)))}function V(t,e,n){e=D(e),n instanceof v||(n=v.fromHex(n,!1));const{r,s:i}=t instanceof I?t.assertValidity():I.fromHex(t);return{r,s:i,SB:y.BASE.multiplyUnsafe(i),pub:n,msg:e}}function X(t,e,n,r){const i=K(r),o=y.fromAffine(t).multiplyUnsafe(i);return y.fromAffine(e).add(o).subtract(n).multiplyUnsafe(c.h).equals(y.ZERO)}function J(t,e,n){const r=M(t*(e-n));return[e=M(e-r),n=M(n+r)]}e.getPublicKey=async function(t){return(await $(t)).pointBytes},e.sign=async function(t,n){t=D(t);const{prefix:r,scalar:i,pointBytes:o}=await $(n),s=K(await e.utils.sha512(r,t)),a=v.BASE.multiply(s),u=M(s+K(await e.utils.sha512(a.toRawBytes(),o,t))*i,c.l);return new I(a,u).toRawBytes()},e.verify=async function(t,n,r){const{r:i,SB:o,msg:s,pub:a}=V(t,n,r),c=await e.utils.sha512(i.toRawBytes(),a.toRawBytes(),s);return X(a,i,o,c)},e.sync={getExtendedPublicKey:Z,getPublicKey:function(t){return Z(t).pointBytes},sign:function(t,e){t=D(t);const{prefix:n,scalar:r,pointBytes:i}=Z(e),o=K(q(n,t)),s=v.BASE.multiply(o),a=M(o+K(q(s.toRawBytes(),i,t))*r,c.l);return new I(s,a).toRawBytes()},verify:function(t,e,n){const{r,SB:i,msg:o,pub:s}=V(t,e,n),a=q(r.toRawBytes(),s.toRawBytes(),o);return X(s,r,i,a)}},e.getSharedSecret=async function(t,n){const{head:r}=await $(t),i=v.fromHex(n).toX25519();return e.curve25519.scalarMult(r,i)},v.BASE._setWindowSize(8),e.curve25519={BASE_POINT_U:"0900000000000000000000000000000000000000000000000000000000000000",scalarMult(t,e){const n=function(t,e){const{P:n}=c,r=j(t,n),s=j(e,n),a=BigInt(121665),u=r;let l,d=o,h=i,f=r,p=o,y=i;for(let c=BigInt(254);c>=i;c--){const t=s>>c&o;y^=t,l=J(y,d,f),d=l[0],f=l[1],l=J(y,h,p),h=l[0],p=l[1],y=t;const e=d+h,n=M(e*e),r=d-h,i=M(r*r),g=n-i,m=f+p,b=M((f-p)*e),w=M(m*r),k=b+w,v=b-w;f=M(k*k),p=M(u*M(v*v)),d=M(n*i),h=M(g*(n+M(a*g)))}l=J(y,d,f),d=l[0],f=l[1],l=J(y,h,p),h=l[0],p=l[1];const{pow_p_5_8:g,b2:m}=N(h),b=M(U(g,BigInt(3))*m);return M(d*b)}(function(t){const e=D(t,32);return e[31]&=127,B(e)}(e),B(W(D(t,32))));if(n===i)throw new Error("Invalid private or public key received");return function(t){return x(M(t,c.P))}(n)},scalarMultBase:t=>e.curve25519.scalarMult(t,e.curve25519.BASE_POINT_U)};const Y={node:r,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0};e.utils={bytesToHex:S,hexToBytes:E,concatBytes:A,getExtendedPublicKey:$,mod:M,invert:C,TORSION_SUBGROUP:["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],hashToPrivateScalar:t=>{if((t=D(t)).length<40||t.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return M(B(t),c.l-o)+o},randomBytes:(t=32)=>{if(Y.web)return Y.web.getRandomValues(new Uint8Array(t));if(Y.node){const{randomBytes:e}=Y.node;return new Uint8Array(e(t).buffer)}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>e.utils.randomBytes(32),sha512:async(...t)=>{const e=A(...t);if(Y.web){const t=await Y.web.subtle.digest("SHA-512",e.buffer);return new Uint8Array(t)}if(Y.node)return Uint8Array.from(Y.node.createHash("sha512").update(e).digest());throw new Error("The environment doesn't have sha512 function")},precompute(t=8,e=v.BASE){const n=e.equals(v.BASE)?e:new v(e.x,e.y);return n._setWindowSize(t),n.multiply(s),n},sha512Sync:void 0},Object.defineProperties(e.utils,{sha512Sync:{configurable:!1,get:()=>H,set(t){H||(H=t)}}})},53525:(t,e)=>{"use strict";function n(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function r(t){if("boolean"!=typeof t)throw new Error(`Expected boolean, not ${t}`)}function i(t,...e){if(!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new TypeError(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function o(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");n(t.outputLen),n(t.blockLen)}function s(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function a(t,e){i(t);const n=e.outputLen;if(t.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}Object.defineProperty(e,"__esModule",{value:!0}),e.output=e.exists=e.hash=e.bytes=e.bool=e.number=void 0,e.number=n,e.bool=r,e.bytes=i,e.hash=o,e.exists=s,e.output=a;const c={number:n,bool:r,bytes:i,hash:o,exists:s,output:a};e.default=c},99350:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SHA2=void 0;const r=n(53525),i=n(70064);class o extends i.Hash{constructor(t,e,n,r){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,i.createView)(this.buffer)}update(t){r.default.exists(this);const{view:e,buffer:n,blockLen:o}=this,s=(t=(0,i.toBytes)(t)).length;for(let r=0;r<s;){const a=Math.min(o-this.pos,s-r);if(a!==o)n.set(t.subarray(r,r+a),this.pos),this.pos+=a,r+=a,this.pos===o&&(this.process(e,0),this.pos=0);else{const e=(0,i.createView)(t);for(;o<=s-r;r+=o)this.process(e,r)}}return this.length+=t.length,this.roundClean(),this}digestInto(t){r.default.exists(this),r.default.output(t,this),this.finished=!0;const{buffer:e,view:n,blockLen:o,isLE:s}=this;let{pos:a}=this;e[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(n,0),a=0);for(let r=a;r<o;r++)e[r]=0;!function(t,e,n,r){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,n,r);const i=BigInt(32),o=BigInt(4294967295),s=Number(n>>i&o),a=Number(n&o),c=r?4:0,u=r?0:4;t.setUint32(e+c,s,r),t.setUint32(e+u,a,r)}(n,o-8,BigInt(8*this.length),s),this.process(n,0);const c=(0,i.createView)(t);this.get().forEach(((t,e)=>c.setUint32(4*e,t,s)))}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:n,length:r,finished:i,destroyed:o,pos:s}=this;return t.length=r,t.pos=s,t.finished=i,t.destroyed=o,r%e&&t.buffer.set(n),t}}e.SHA2=o},11655:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.add=e.toBig=e.split=e.fromBig=void 0;const n=BigInt(2**32-1),r=BigInt(32);function i(t,e=!1){return e?{h:Number(t&n),l:Number(t>>r&n)}:{h:0|Number(t>>r&n),l:0|Number(t&n)}}function o(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let o=0;o<t.length;o++){const{h:s,l:a}=i(t[o],e);[n[o],r[o]]=[s,a]}return[n,r]}e.fromBig=i,e.split=o;e.toBig=(t,e)=>BigInt(t>>>0)<<r|BigInt(e>>>0);function s(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:0|i}}e.add=s;const a={fromBig:i,split:o,toBig:e.toBig,shrSH:(t,e,n)=>t>>>n,shrSL:(t,e,n)=>t<<32-n|e>>>n,rotrSH:(t,e,n)=>t>>>n|e<<32-n,rotrSL:(t,e,n)=>t<<32-n|e>>>n,rotrBH:(t,e,n)=>t<<64-n|e>>>n-32,rotrBL:(t,e,n)=>t>>>n-32|e<<64-n,rotr32H:(t,e)=>e,rotr32L:(t,e)=>t,rotlSH:(t,e,n)=>t<<n|e>>>32-n,rotlSL:(t,e,n)=>e<<n|t>>>32-n,rotlBH:(t,e,n)=>e<<n-32|t>>>64-n,rotlBL:(t,e,n)=>t<<n-32|e>>>64-n,add:s,add3L:(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),add3H:(t,e,n,r)=>e+n+r+(t/2**32|0)|0,add4L:(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),add4H:(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,add5H:(t,e,n,r,i,o)=>e+n+r+i+o+(t/2**32|0)|0,add5L:(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0)};e.default=a},94661:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.crypto=void 0,e.crypto={node:void 0,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0}},41377:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hmac=void 0;const r=n(53525),i=n(70064);class o extends i.Hash{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,r.default.hash(t);const n=(0,i.toBytes)(e);if(this.iHash=t.create(),!(this.iHash instanceof i.Hash))throw new TypeError("Expected instance of class which extends utils.Hash");const o=this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;const s=new Uint8Array(o);s.set(n.length>this.iHash.blockLen?t.create().update(n).digest():n);for(let r=0;r<s.length;r++)s[r]^=54;this.iHash.update(s),this.oHash=t.create();for(let r=0;r<s.length;r++)s[r]^=106;this.oHash.update(s),s.fill(0)}update(t){return r.default.exists(this),this.iHash.update(t),this}digestInto(t){r.default.exists(this),r.default.bytes(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:n,finished:r,destroyed:i,blockLen:o,outputLen:s}=this;return t.finished=r,t.destroyed=i,t.blockLen=o,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}e.hmac=(t,e,n)=>new o(t,e).update(n).digest(),e.hmac.create=(t,e)=>new o(t,e)},99179:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.pbkdf2Async=e.pbkdf2=void 0;const r=n(53525),i=n(41377),o=n(70064);function s(t,e,n,s){r.default.hash(t);const a=(0,o.checkOpts)({dkLen:32,asyncTick:10},s),{c,dkLen:u,asyncTick:l}=a;if(r.default.number(c),r.default.number(u),r.default.number(l),c<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const d=(0,o.toBytes)(e),h=(0,o.toBytes)(n),f=new Uint8Array(u),p=i.hmac.create(t,d),y=p._cloneInto().update(h);return{c,dkLen:u,asyncTick:l,DK:f,PRF:p,PRFSalt:y}}function a(t,e,n,r,i){return t.destroy(),e.destroy(),r&&r.destroy(),i.fill(0),n}e.pbkdf2=function(t,e,n,r){const{c:i,dkLen:c,DK:u,PRF:l,PRFSalt:d}=s(t,e,n,r);let h;const f=new Uint8Array(4),p=(0,o.createView)(f),y=new Uint8Array(l.outputLen);for(let o=1,s=0;s<c;o++,s+=l.outputLen){const t=u.subarray(s,s+l.outputLen);p.setInt32(0,o,!1),(h=d._cloneInto(h)).update(f).digestInto(y),t.set(y.subarray(0,t.length));for(let e=1;e<i;e++){l._cloneInto(h).update(y).digestInto(y);for(let e=0;e<t.length;e++)t[e]^=y[e]}}return a(l,d,u,h,y)},e.pbkdf2Async=async function(t,e,n,r){const{c:i,dkLen:c,asyncTick:u,DK:l,PRF:d,PRFSalt:h}=s(t,e,n,r);let f;const p=new Uint8Array(4),y=(0,o.createView)(p),g=new Uint8Array(d.outputLen);for(let s=1,a=0;a<c;s++,a+=d.outputLen){const t=l.subarray(a,a+d.outputLen);y.setInt32(0,s,!1),(f=h._cloneInto(f)).update(p).digestInto(g),t.set(g.subarray(0,t.length)),await(0,o.asyncLoop)(i-1,u,(e=>{d._cloneInto(f).update(g).digestInto(g);for(let n=0;n<t.length;n++)t[n]^=g[n]}))}return a(d,h,l,f,g)}},80590:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ripemd160=e.RIPEMD160=void 0;const r=n(99350),i=n(70064),o=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),s=Uint8Array.from({length:16},((t,e)=>e)),a=s.map((t=>(9*t+5)%16));let c=[s],u=[a];for(let w=0;w<4;w++)for(let t of[c,u])t.push(t[w].map((t=>o[t])));const l=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((t=>new Uint8Array(t))),d=c.map(((t,e)=>t.map((t=>l[e][t])))),h=u.map(((t,e)=>t.map((t=>l[e][t])))),f=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),p=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),y=(t,e)=>t<<e|t>>>32-e;function g(t,e,n,r){return 0===t?e^n^r:1===t?e&n|~e&r:2===t?(e|~n)^r:3===t?e&r|n&~r:e^(n|~r)}const m=new Uint32Array(16);class b extends r.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:t,h1:e,h2:n,h3:r,h4:i}=this;return[t,e,n,r,i]}set(t,e,n,r,i){this.h0=0|t,this.h1=0|e,this.h2=0|n,this.h3=0|r,this.h4=0|i}process(t,e){for(let c=0;c<16;c++,e+=4)m[c]=t.getUint32(e,!0);let n=0|this.h0,r=n,i=0|this.h1,o=i,s=0|this.h2,a=s,l=0|this.h3,b=l,w=0|this.h4,k=w;for(let v=0;v<5;v++){const t=4-v,e=f[v],I=p[v],A=c[v],_=u[v],S=d[v],E=h[v];for(let r=0;r<16;r++){const t=y(n+g(v,i,s,l)+m[A[r]]+e,S[r])+w|0;n=w,w=l,l=0|y(s,10),s=i,i=t}for(let n=0;n<16;n++){const e=y(r+g(t,o,a,b)+m[_[n]]+I,E[n])+k|0;r=k,k=b,b=0|y(a,10),a=o,o=e}}this.set(this.h1+s+b|0,this.h2+l+k|0,this.h3+w+r|0,this.h4+n+o|0,this.h0+i+a|0)}roundClean(){m.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}e.RIPEMD160=b,e.ripemd160=(0,i.wrapConstructor)((()=>new b))},96053:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sha256=void 0;const r=n(99350),i=n(70064),o=(t,e,n)=>t&e^t&n^e&n,s=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint32Array(64);class u extends r.SHA2{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){const{A:t,B:e,C:n,D:r,E:i,F:o,G:s,H:a}=this;return[t,e,n,r,i,o,s,a]}set(t,e,n,r,i,o,s,a){this.A=0|t,this.B=0|e,this.C=0|n,this.D=0|r,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(t,e){for(let i=0;i<16;i++,e+=4)c[i]=t.getUint32(e,!1);for(let o=16;o<64;o++){const t=c[o-15],e=c[o-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,r=(0,i.rotr)(e,17)^(0,i.rotr)(e,19)^e>>>10;c[o]=r+c[o-7]+n+c[o-16]|0}let{A:n,B:r,C:a,D:u,E:l,F:d,G:h,H:f}=this;for(let y=0;y<64;y++){const t=f+((0,i.rotr)(l,6)^(0,i.rotr)(l,11)^(0,i.rotr)(l,25))+((p=l)&d^~p&h)+s[y]+c[y]|0,e=((0,i.rotr)(n,2)^(0,i.rotr)(n,13)^(0,i.rotr)(n,22))+o(n,r,a)|0;f=h,h=d,d=l,l=u+t|0,u=a,a=r,r=n,n=t+e|0}var p;n=n+this.A|0,r=r+this.B|0,a=a+this.C|0,u=u+this.D|0,l=l+this.E|0,d=d+this.F|0,h=h+this.G|0,f=f+this.H|0,this.set(n,r,a,u,l,d,h,f)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}e.sha256=(0,i.wrapConstructor)((()=>new u))},12540:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sha384=e.sha512_256=e.sha512=e.SHA512=void 0;const r=n(99350),i=n(11655),o=n(70064),[s,a]=i.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((t=>BigInt(t)))),c=new Uint32Array(80),u=new Uint32Array(80);class l extends r.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:e,Bh:n,Bl:r,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:u,Fh:l,Fl:d,Gh:h,Gl:f,Hh:p,Hl:y}=this;return[t,e,n,r,i,o,s,a,c,u,l,d,h,f,p,y]}set(t,e,n,r,i,o,s,a,c,u,l,d,h,f,p,y){this.Ah=0|t,this.Al=0|e,this.Bh=0|n,this.Bl=0|r,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|d,this.Gh=0|h,this.Gl=0|f,this.Hh=0|p,this.Hl=0|y}process(t,e){for(let i=0;i<16;i++,e+=4)c[i]=t.getUint32(e),u[i]=t.getUint32(e+=4);for(let s=16;s<80;s++){const t=0|c[s-15],e=0|u[s-15],n=i.default.rotrSH(t,e,1)^i.default.rotrSH(t,e,8)^i.default.shrSH(t,e,7),r=i.default.rotrSL(t,e,1)^i.default.rotrSL(t,e,8)^i.default.shrSL(t,e,7),o=0|c[s-2],a=0|u[s-2],l=i.default.rotrSH(o,a,19)^i.default.rotrBH(o,a,61)^i.default.shrSH(o,a,6),d=i.default.rotrSL(o,a,19)^i.default.rotrBL(o,a,61)^i.default.shrSL(o,a,6),h=i.default.add4L(r,d,u[s-7],u[s-16]),f=i.default.add4H(h,n,l,c[s-7],c[s-16]);c[s]=0|f,u[s]=0|h}let{Ah:n,Al:r,Bh:o,Bl:l,Ch:d,Cl:h,Dh:f,Dl:p,Eh:y,El:g,Fh:m,Fl:b,Gh:w,Gl:k,Hh:v,Hl:I}=this;for(let A=0;A<80;A++){const t=i.default.rotrSH(y,g,14)^i.default.rotrSH(y,g,18)^i.default.rotrBH(y,g,41),e=i.default.rotrSL(y,g,14)^i.default.rotrSL(y,g,18)^i.default.rotrBL(y,g,41),_=y&m^~y&w,S=g&b^~g&k,E=i.default.add5L(I,e,S,a[A],u[A]),T=i.default.add5H(E,v,t,_,s[A],c[A]),x=0|E,P=i.default.rotrSH(n,r,28)^i.default.rotrBH(n,r,34)^i.default.rotrBH(n,r,39),B=i.default.rotrSL(n,r,28)^i.default.rotrBL(n,r,34)^i.default.rotrBL(n,r,39),O=n&o^n&d^o&d,R=r&l^r&h^l&h;v=0|w,I=0|k,w=0|m,k=0|b,m=0|y,b=0|g,({h:y,l:g}=i.default.add(0|f,0|p,0|T,0|x)),f=0|d,p=0|h,d=0|o,h=0|l,o=0|n,l=0|r;const M=i.default.add3L(x,B,R);n=i.default.add3H(M,T,P,O),r=0|M}({h:n,l:r}=i.default.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:o,l}=i.default.add(0|this.Bh,0|this.Bl,0|o,0|l)),({h:d,l:h}=i.default.add(0|this.Ch,0|this.Cl,0|d,0|h)),({h:f,l:p}=i.default.add(0|this.Dh,0|this.Dl,0|f,0|p)),({h:y,l:g}=i.default.add(0|this.Eh,0|this.El,0|y,0|g)),({h:m,l:b}=i.default.add(0|this.Fh,0|this.Fl,0|m,0|b)),({h:w,l:k}=i.default.add(0|this.Gh,0|this.Gl,0|w,0|k)),({h:v,l:I}=i.default.add(0|this.Hh,0|this.Hl,0|v,0|I)),this.set(n,r,o,l,d,h,f,p,y,g,m,b,w,k,v,I)}roundClean(){c.fill(0),u.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}e.SHA512=l;class d extends l{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class h extends l{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}e.sha512=(0,o.wrapConstructor)((()=>new l)),e.sha512_256=(0,o.wrapConstructor)((()=>new d)),e.sha384=(0,o.wrapConstructor)((()=>new h))},70064:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.randomBytes=e.wrapConstructorWithOpts=e.wrapConstructor=e.checkOpts=e.Hash=e.concatBytes=e.toBytes=e.utf8ToBytes=e.asyncLoop=e.nextTick=e.hexToBytes=e.bytesToHex=e.isLE=e.rotr=e.createView=e.u32=e.u8=void 0;const r=n(94661);e.u8=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength);e.u32=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4));e.createView=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.rotr=(t,e)=>t<<32-e|t>>>e,e.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!e.isLE)throw new Error("Non little-endian hardware is not supported");const i=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));e.bytesToHex=function(t){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");let e="";for(let n=0;n<t.length;n++)e+=i[t[n]];return e},e.hexToBytes=function(t){if("string"!=typeof t)throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const e=new Uint8Array(t.length/2);for(let n=0;n<e.length;n++){const r=2*n,i=t.slice(r,r+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");e[n]=o}return e};function o(t){if("string"!=typeof t)throw new TypeError("utf8ToBytes expected string, got "+typeof t);return(new TextEncoder).encode(t)}function s(t){if("string"==typeof t&&(t=o(t)),!(t instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof t})`);return t}e.nextTick=async()=>{},e.asyncLoop=async function(t,n,r){let i=Date.now();for(let o=0;o<t;o++){r(o);const t=Date.now()-i;t>=0&&t<n||(await(0,e.nextTick)(),i+=t)}},e.utf8ToBytes=o,e.toBytes=s,e.concatBytes=function(...t){if(!t.every((t=>t instanceof Uint8Array)))throw new Error("Uint8Array list expected");if(1===t.length)return t[0];const e=t.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const e=t[r];n.set(e,i),i+=e.length}return n};e.Hash=class{clone(){return this._cloneInto()}};e.checkOpts=function(t,e){if(void 0!==e&&("object"!=typeof e||(n=e,"[object Object]"!==Object.prototype.toString.call(n)||n.constructor!==Object)))throw new TypeError("Options should be object or undefined");var n;return Object.assign(t,e)},e.wrapConstructor=function(t){const e=e=>t().update(s(e)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e},e.wrapConstructorWithOpts=function(t){const e=(e,n)=>t(n).update(s(e)).digest(),n=t({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=e=>t(e),e},e.randomBytes=function(t=32){if(r.crypto.web)return r.crypto.web.getRandomValues(new Uint8Array(t));if(r.crypto.node)return new Uint8Array(r.crypto.node.randomBytes(t).buffer);throw new Error("The environment doesn't have randomBytes function")}},76333:(t,e,n)=>{"use strict";var r=n(63279),i=n(48526);window.onload=()=>{const t=n(48834).Buffer;window.Buffer=t,window.global=window,window.global.Buffer=t,document.dispatchEvent(new CustomEvent("kinetic-sdk-ready",{detail:{Keypair:r.Keypair,KineticSdk:i.KineticSdk}}))}},36237:(t,e)=>{"use strict";function n(t){if(!Number.isSafeInteger(t))throw new Error(`Wrong integer: ${t}`)}function r(...t){const e=(t,e)=>n=>t(e(n));return{encode:Array.from(t).reverse().reduce(((t,n)=>t?e(t,n.encode):n.encode),void 0),decode:t.reduce(((t,n)=>t?e(t,n.decode):n.decode),void 0)}}function i(t){return{encode:e=>{if(!Array.isArray(e)||e.length&&"number"!=typeof e[0])throw new Error("alphabet.encode input should be an array of numbers");return e.map((e=>{if(n(e),e<0||e>=t.length)throw new Error(`Digit index outside alphabet: ${e} (alphabet: ${t.length})`);return t[e]}))},decode:e=>{if(!Array.isArray(e)||e.length&&"string"!=typeof e[0])throw new Error("alphabet.decode input should be array of strings");return e.map((e=>{if("string"!=typeof e)throw new Error(`alphabet.decode: not string element=${e}`);const n=t.indexOf(e);if(-1===n)throw new Error(`Unknown letter: "${e}". Allowed: ${t}`);return n}))}}}function o(t=""){if("string"!=typeof t)throw new Error("join separator should be string");return{encode:e=>{if(!Array.isArray(e)||e.length&&"string"!=typeof e[0])throw new Error("join.encode input should be array of strings");for(let t of e)if("string"!=typeof t)throw new Error(`join.encode: non-string input=${t}`);return e.join(t)},decode:e=>{if("string"!=typeof e)throw new Error("join.decode input should be string");return e.split(t)}}}function s(t,e="="){if(n(t),"string"!=typeof e)throw new Error("padding chr should be string");return{encode(n){if(!Array.isArray(n)||n.length&&"string"!=typeof n[0])throw new Error("padding.encode input should be array of strings");for(let t of n)if("string"!=typeof t)throw new Error(`padding.encode: non-string input=${t}`);for(;n.length*t%8;)n.push(e);return n},decode(n){if(!Array.isArray(n)||n.length&&"string"!=typeof n[0])throw new Error("padding.encode input should be array of strings");for(let t of n)if("string"!=typeof t)throw new Error(`padding.decode: non-string input=${t}`);let r=n.length;if(r*t%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;r>0&&n[r-1]===e;r--)if(!((r-1)*t%8))throw new Error("Invalid padding: string has too much padding");return n.slice(0,r)}}}function a(t){if("function"!=typeof t)throw new Error("normalize fn should be function");return{encode:t=>t,decode:e=>t(e)}}function c(t,e,r){if(e<2)throw new Error(`convertRadix: wrong from=${e}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: wrong to=${r}, base cannot be less than 2`);if(!Array.isArray(t))throw new Error("convertRadix: data should be array");if(!t.length)return[];let i=0;const o=[],s=Array.from(t);for(s.forEach((t=>{if(n(t),t<0||t>=e)throw new Error(`Wrong integer: ${t}`)}));;){let t=0,n=!0;for(let o=i;o<s.length;o++){const a=s[o],c=e*t+a;if(!Number.isSafeInteger(c)||e*t/e!==t||c-a!=e*t)throw new Error("convertRadix: carry overflow");if(t=c%r,s[o]=Math.floor(c/r),!Number.isSafeInteger(s[o])||s[o]*r+t!==c)throw new Error("convertRadix: carry overflow");n&&(s[o]?n=!1:i=o)}if(o.push(t),n)break}for(let n=0;n<t.length-1&&0===t[n];n++)o.push(0);return o.reverse()}Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e.bytesToString=e.hex=e.utf8=e.bech32m=e.bech32=e.base58check=e.base58xmr=e.base58xrp=e.base58flickr=e.base58=e.base64url=e.base64=e.base32crockford=e.base32hex=e.base32=e.base16=e.utils=e.assertNumber=void 0,e.assertNumber=n;const u=(t,e)=>e?u(e,t%e):t,l=(t,e)=>t+(e-u(t,e));function d(t,e,r,i){if(!Array.isArray(t))throw new Error("convertRadix2: data should be array");if(e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(l(e,r)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${r} carryBits=${l(e,r)}`);let o=0,s=0;const a=2**r-1,c=[];for(const u of t){if(n(u),u>=2**e)throw new Error(`convertRadix2: invalid data word=${u} from=${e}`);if(o=o<<e|u,s+e>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${e}`);for(s+=e;s>=r;s-=r)c.push((o>>s-r&a)>>>0);o&=2**s-1}if(o=o<<r-s&a,!i&&s>=e)throw new Error("Excess padding");if(!i&&o)throw new Error(`Non-zero padding: ${o}`);return i&&s>0&&c.push(o>>>0),c}function h(t){return n(t),{encode:e=>{if(!(e instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return c(Array.from(e),256,t)},decode:e=>{if(!Array.isArray(e)||e.length&&"number"!=typeof e[0])throw new Error("radix.decode input should be array of strings");return Uint8Array.from(c(e,t,256))}}}function f(t,e=!1){if(n(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(l(8,t)>32||l(t,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!(n instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return d(Array.from(n),8,t,!e)},decode:n=>{if(!Array.isArray(n)||n.length&&"number"!=typeof n[0])throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(d(n,t,8,e))}}}function p(t){if("function"!=typeof t)throw new Error("unsafeWrapper fn should be function");return function(...e){try{return t.apply(null,e)}catch(n){}}}function y(t,e){if(n(t),"function"!=typeof e)throw new Error("checksum fn should be function");return{encode(n){if(!(n instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");const r=e(n).slice(0,t),i=new Uint8Array(n.length+t);return i.set(n),i.set(r,n.length),i},decode(n){if(!(n instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");const r=n.slice(0,-t),i=e(r).slice(0,t),o=n.slice(-t);for(let e=0;e<t;e++)if(i[e]!==o[e])throw new Error("Invalid checksum");return r}}}e.utils={alphabet:i,chain:r,checksum:y,radix:h,radix2:f,join:o,padding:s},e.base16=r(f(4),i("0123456789ABCDEF"),o("")),e.base32=r(f(5),i("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),s(5),o("")),e.base32hex=r(f(5),i("0123456789ABCDEFGHIJKLMNOPQRSTUV"),s(5),o("")),e.base32crockford=r(f(5),i("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),o(""),a((t=>t.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")))),e.base64=r(f(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),s(6),o("")),e.base64url=r(f(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),s(6),o(""));const g=t=>r(h(58),i(t),o(""));e.base58=g("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),e.base58flickr=g("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),e.base58xrp=g("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const m=[0,2,3,5,6,7,9,10,11];e.base58xmr={encode(t){let n="";for(let r=0;r<t.length;r+=8){const i=t.subarray(r,r+8);n+=e.base58.encode(i).padStart(m[i.length],"1")}return n},decode(t){let n=[];for(let r=0;r<t.length;r+=11){const i=t.slice(r,r+11),o=m.indexOf(i.length),s=e.base58.decode(i);for(let t=0;t<s.length-o;t++)if(0!==s[t])throw new Error("base58xmr: wrong padding");n=n.concat(Array.from(s.slice(s.length-o)))}return Uint8Array.from(n)}};e.base58check=t=>r(y(4,(e=>t(t(e)))),e.base58);const b=r(i("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),o("")),w=[996825010,642813549,513874426,1027748829,705979059];function k(t){const e=t>>25;let n=(33554431&t)<<5;for(let r=0;r<w.length;r++)1==(e>>r&1)&&(n^=w[r]);return n}function v(t,e,n=1){const r=t.length;let i=1;for(let o=0;o<r;o++){const e=t.charCodeAt(o);if(e<33||e>126)throw new Error(`Invalid prefix (${t})`);i=k(i)^e>>5}i=k(i);for(let o=0;o<r;o++)i=k(i)^31&t.charCodeAt(o);for(let o of e)i=k(i)^o;for(let o=0;o<6;o++)i=k(i);return i^=n,b.encode(d([i%2**30],30,5,!1))}function I(t){const e="bech32"===t?1:734539939,n=f(5),r=n.decode,i=n.encode,o=p(r);function s(t,n=90){if("string"!=typeof t)throw new Error("bech32.decode input should be string, not "+typeof t);if(t.length<8||!1!==n&&t.length>n)throw new TypeError(`Wrong string length: ${t.length} (${t}). Expected (8..${n})`);const r=t.toLowerCase();if(t!==r&&t!==t.toUpperCase())throw new Error("String must be lowercase or uppercase");const i=(t=r).lastIndexOf("1");if(0===i||-1===i)throw new Error('Letter "1" must be present between prefix and data only');const o=t.slice(0,i),s=t.slice(i+1);if(s.length<6)throw new Error("Data must be at least 6 characters long");const a=b.decode(s).slice(0,-6),c=v(o,a,e);if(!s.endsWith(c))throw new Error(`Invalid checksum in ${t}: expected "${c}"`);return{prefix:o,words:a}}return{encode:function(t,n,r=90){if("string"!=typeof t)throw new Error("bech32.encode prefix should be string, not "+typeof t);if(!Array.isArray(n)||n.length&&"number"!=typeof n[0])throw new Error("bech32.encode words should be array of numbers, not "+typeof n);const i=t.length+7+n.length;if(!1!==r&&i>r)throw new TypeError(`Length ${i} exceeds limit ${r}`);return`${t=t.toLowerCase()}1${b.encode(n)}${v(t,n,e)}`},decode:s,decodeToBytes:function(t){const{prefix:e,words:n}=s(t,!1);return{prefix:e,words:n,bytes:r(n)}},decodeUnsafe:p(s),fromWords:r,fromWordsUnsafe:o,toWords:i}}e.bech32=I("bech32"),e.bech32m=I("bech32m"),e.utf8={encode:t=>(new TextDecoder).decode(t),decode:t=>(new TextEncoder).encode(t)},e.hex=r(f(4),i("0123456789abcdef"),o(""),a((t=>{if("string"!=typeof t||t.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof t} with length ${t.length}`);return t.toLowerCase()})));const A={utf8:e.utf8,hex:e.hex,base16:e.base16,base32:e.base32,base64:e.base64,base64url:e.base64url,base58:e.base58,base58xmr:e.base58xmr},_=`Invalid encoding type. Available types: ${Object.keys(A).join(", ")}`;e.bytesToString=(t,e)=>{if("string"!=typeof t||!A.hasOwnProperty(t))throw new TypeError(_);if(!(e instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return A[t].encode(e)},e.str=e.bytesToString;e.stringToBytes=(t,e)=>{if(!A.hasOwnProperty(t))throw new TypeError(_);if("string"!=typeof e)throw new TypeError("stringToBytes() expects string");return A[t].decode(e)},e.bytes=e.stringToBytes},55796:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mnemonicToSeedSync=e.mnemonicToSeed=e.validateMnemonic=e.entropyToMnemonic=e.mnemonicToEntropy=e.generateMnemonic=void 0;const r=n(53525),i=n(99179),o=n(96053),s=n(12540),a=n(70064),c=n(36237);function u(t){if("string"!=typeof t)throw new TypeError("Invalid mnemonic type: "+typeof t);return t.normalize("NFKD")}function l(t){const e=u(t),n=e.split(" ");if(![12,15,18,21,24].includes(n.length))throw new Error("Invalid mnemonic");return{nfkd:e,words:n}}function d(t){r.default.bytes(t,16,20,24,28,32)}e.generateMnemonic=function(t,e=128){if(r.default.number(e),e%32!=0||e>256)throw new TypeError("Invalid entropy");return y((0,a.randomBytes)(e/8),t)};const h=t=>{const e=8-t.length/4;return new Uint8Array([(0,o.sha256)(t)[0]>>e<<e])};function f(t){if(!Array.isArray(t)||2048!==t.length||"string"!=typeof t[0])throw new Error("Worlist: expected array of 2048 strings");return t.forEach((t=>{if("string"!=typeof t)throw new Error(`Wordlist: non-string element: ${t}`)})),c.utils.chain(c.utils.checksum(1,h),c.utils.radix2(11,!0),c.utils.alphabet(t))}function p(t,e){const{words:n}=l(t),r=f(e).decode(n);return d(r),r}function y(t,e){d(t);return f(e).encode(t).join((t=>"\u3042\u3044\u3053\u304f\u3057\u3093"===t[0])(e)?"\u3000":" ")}e.mnemonicToEntropy=p,e.entropyToMnemonic=y,e.validateMnemonic=function(t,e){try{p(t,e)}catch(n){return!1}return!0};const g=t=>u(`mnemonic${t}`);e.mnemonicToSeed=function(t,e=""){return(0,i.pbkdf2Async)(s.sha512,l(t).nfkd,g(e),{c:2048,dkLen:64})},e.mnemonicToSeedSync=function(t,e=""){return(0,i.pbkdf2)(s.sha512,l(t).nfkd,g(e),{c:2048,dkLen:64})}},68050:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.wordlist=void 0,e.wordlist="abandon\nability\nable\nabout\nabove\nabsent\nabsorb\nabstract\nabsurd\nabuse\naccess\naccident\naccount\naccuse\nachieve\nacid\nacoustic\nacquire\nacross\nact\naction\nactor\nactress\nactual\nadapt\nadd\naddict\naddress\nadjust\nadmit\nadult\nadvance\nadvice\naerobic\naffair\nafford\nafraid\nagain\nage\nagent\nagree\nahead\naim\nair\nairport\naisle\nalarm\nalbum\nalcohol\nalert\nalien\nall\nalley\nallow\nalmost\nalone\nalpha\nalready\nalso\nalter\nalways\namateur\namazing\namong\namount\namused\nanalyst\nanchor\nancient\nanger\nangle\nangry\nanimal\nankle\nannounce\nannual\nanother\nanswer\nantenna\nantique\nanxiety\nany\napart\napology\nappear\napple\napprove\napril\narch\narctic\narea\narena\nargue\narm\narmed\narmor\narmy\naround\narrange\narrest\narrive\narrow\nart\nartefact\nartist\nartwork\nask\naspect\nassault\nasset\nassist\nassume\nasthma\nathlete\natom\nattack\nattend\nattitude\nattract\nauction\naudit\naugust\naunt\nauthor\nauto\nautumn\naverage\navocado\navoid\nawake\naware\naway\nawesome\nawful\nawkward\naxis\nbaby\nbachelor\nbacon\nbadge\nbag\nbalance\nbalcony\nball\nbamboo\nbanana\nbanner\nbar\nbarely\nbargain\nbarrel\nbase\nbasic\nbasket\nbattle\nbeach\nbean\nbeauty\nbecause\nbecome\nbeef\nbefore\nbegin\nbehave\nbehind\nbelieve\nbelow\nbelt\nbench\nbenefit\nbest\nbetray\nbetter\nbetween\nbeyond\nbicycle\nbid\nbike\nbind\nbiology\nbird\nbirth\nbitter\nblack\nblade\nblame\nblanket\nblast\nbleak\nbless\nblind\nblood\nblossom\nblouse\nblue\nblur\nblush\nboard\nboat\nbody\nboil\nbomb\nbone\nbonus\nbook\nboost\nborder\nboring\nborrow\nboss\nbottom\nbounce\nbox\nboy\nbracket\nbrain\nbrand\nbrass\nbrave\nbread\nbreeze\nbrick\nbridge\nbrief\nbright\nbring\nbrisk\nbroccoli\nbroken\nbronze\nbroom\nbrother\nbrown\nbrush\nbubble\nbuddy\nbudget\nbuffalo\nbuild\nbulb\nbulk\nbullet\nbundle\nbunker\nburden\nburger\nburst\nbus\nbusiness\nbusy\nbutter\nbuyer\nbuzz\ncabbage\ncabin\ncable\ncactus\ncage\ncake\ncall\ncalm\ncamera\ncamp\ncan\ncanal\ncancel\ncandy\ncannon\ncanoe\ncanvas\ncanyon\ncapable\ncapital\ncaptain\ncar\ncarbon\ncard\ncargo\ncarpet\ncarry\ncart\ncase\ncash\ncasino\ncastle\ncasual\ncat\ncatalog\ncatch\ncategory\ncattle\ncaught\ncause\ncaution\ncave\nceiling\ncelery\ncement\ncensus\ncentury\ncereal\ncertain\nchair\nchalk\nchampion\nchange\nchaos\nchapter\ncharge\nchase\nchat\ncheap\ncheck\ncheese\nchef\ncherry\nchest\nchicken\nchief\nchild\nchimney\nchoice\nchoose\nchronic\nchuckle\nchunk\nchurn\ncigar\ncinnamon\ncircle\ncitizen\ncity\ncivil\nclaim\nclap\nclarify\nclaw\nclay\nclean\nclerk\nclever\nclick\nclient\ncliff\nclimb\nclinic\nclip\nclock\nclog\nclose\ncloth\ncloud\nclown\nclub\nclump\ncluster\nclutch\ncoach\ncoast\ncoconut\ncode\ncoffee\ncoil\ncoin\ncollect\ncolor\ncolumn\ncombine\ncome\ncomfort\ncomic\ncommon\ncompany\nconcert\nconduct\nconfirm\ncongress\nconnect\nconsider\ncontrol\nconvince\ncook\ncool\ncopper\ncopy\ncoral\ncore\ncorn\ncorrect\ncost\ncotton\ncouch\ncountry\ncouple\ncourse\ncousin\ncover\ncoyote\ncrack\ncradle\ncraft\ncram\ncrane\ncrash\ncrater\ncrawl\ncrazy\ncream\ncredit\ncreek\ncrew\ncricket\ncrime\ncrisp\ncritic\ncrop\ncross\ncrouch\ncrowd\ncrucial\ncruel\ncruise\ncrumble\ncrunch\ncrush\ncry\ncrystal\ncube\nculture\ncup\ncupboard\ncurious\ncurrent\ncurtain\ncurve\ncushion\ncustom\ncute\ncycle\ndad\ndamage\ndamp\ndance\ndanger\ndaring\ndash\ndaughter\ndawn\nday\ndeal\ndebate\ndebris\ndecade\ndecember\ndecide\ndecline\ndecorate\ndecrease\ndeer\ndefense\ndefine\ndefy\ndegree\ndelay\ndeliver\ndemand\ndemise\ndenial\ndentist\ndeny\ndepart\ndepend\ndeposit\ndepth\ndeputy\nderive\ndescribe\ndesert\ndesign\ndesk\ndespair\ndestroy\ndetail\ndetect\ndevelop\ndevice\ndevote\ndiagram\ndial\ndiamond\ndiary\ndice\ndiesel\ndiet\ndiffer\ndigital\ndignity\ndilemma\ndinner\ndinosaur\ndirect\ndirt\ndisagree\ndiscover\ndisease\ndish\ndismiss\ndisorder\ndisplay\ndistance\ndivert\ndivide\ndivorce\ndizzy\ndoctor\ndocument\ndog\ndoll\ndolphin\ndomain\ndonate\ndonkey\ndonor\ndoor\ndose\ndouble\ndove\ndraft\ndragon\ndrama\ndrastic\ndraw\ndream\ndress\ndrift\ndrill\ndrink\ndrip\ndrive\ndrop\ndrum\ndry\nduck\ndumb\ndune\nduring\ndust\ndutch\nduty\ndwarf\ndynamic\neager\neagle\nearly\nearn\nearth\neasily\neast\neasy\necho\necology\neconomy\nedge\nedit\neducate\neffort\negg\neight\neither\nelbow\nelder\nelectric\nelegant\nelement\nelephant\nelevator\nelite\nelse\nembark\nembody\nembrace\nemerge\nemotion\nemploy\nempower\nempty\nenable\nenact\nend\nendless\nendorse\nenemy\nenergy\nenforce\nengage\nengine\nenhance\nenjoy\nenlist\nenough\nenrich\nenroll\nensure\nenter\nentire\nentry\nenvelope\nepisode\nequal\nequip\nera\nerase\nerode\nerosion\nerror\nerupt\nescape\nessay\nessence\nestate\neternal\nethics\nevidence\nevil\nevoke\nevolve\nexact\nexample\nexcess\nexchange\nexcite\nexclude\nexcuse\nexecute\nexercise\nexhaust\nexhibit\nexile\nexist\nexit\nexotic\nexpand\nexpect\nexpire\nexplain\nexpose\nexpress\nextend\nextra\neye\neyebrow\nfabric\nface\nfaculty\nfade\nfaint\nfaith\nfall\nfalse\nfame\nfamily\nfamous\nfan\nfancy\nfantasy\nfarm\nfashion\nfat\nfatal\nfather\nfatigue\nfault\nfavorite\nfeature\nfebruary\nfederal\nfee\nfeed\nfeel\nfemale\nfence\nfestival\nfetch\nfever\nfew\nfiber\nfiction\nfield\nfigure\nfile\nfilm\nfilter\nfinal\nfind\nfine\nfinger\nfinish\nfire\nfirm\nfirst\nfiscal\nfish\nfit\nfitness\nfix\nflag\nflame\nflash\nflat\nflavor\nflee\nflight\nflip\nfloat\nflock\nfloor\nflower\nfluid\nflush\nfly\nfoam\nfocus\nfog\nfoil\nfold\nfollow\nfood\nfoot\nforce\nforest\nforget\nfork\nfortune\nforum\nforward\nfossil\nfoster\nfound\nfox\nfragile\nframe\nfrequent\nfresh\nfriend\nfringe\nfrog\nfront\nfrost\nfrown\nfrozen\nfruit\nfuel\nfun\nfunny\nfurnace\nfury\nfuture\ngadget\ngain\ngalaxy\ngallery\ngame\ngap\ngarage\ngarbage\ngarden\ngarlic\ngarment\ngas\ngasp\ngate\ngather\ngauge\ngaze\ngeneral\ngenius\ngenre\ngentle\ngenuine\ngesture\nghost\ngiant\ngift\ngiggle\nginger\ngiraffe\ngirl\ngive\nglad\nglance\nglare\nglass\nglide\nglimpse\nglobe\ngloom\nglory\nglove\nglow\nglue\ngoat\ngoddess\ngold\ngood\ngoose\ngorilla\ngospel\ngossip\ngovern\ngown\ngrab\ngrace\ngrain\ngrant\ngrape\ngrass\ngravity\ngreat\ngreen\ngrid\ngrief\ngrit\ngrocery\ngroup\ngrow\ngrunt\nguard\nguess\nguide\nguilt\nguitar\ngun\ngym\nhabit\nhair\nhalf\nhammer\nhamster\nhand\nhappy\nharbor\nhard\nharsh\nharvest\nhat\nhave\nhawk\nhazard\nhead\nhealth\nheart\nheavy\nhedgehog\nheight\nhello\nhelmet\nhelp\nhen\nhero\nhidden\nhigh\nhill\nhint\nhip\nhire\nhistory\nhobby\nhockey\nhold\nhole\nholiday\nhollow\nhome\nhoney\nhood\nhope\nhorn\nhorror\nhorse\nhospital\nhost\nhotel\nhour\nhover\nhub\nhuge\nhuman\nhumble\nhumor\nhundred\nhungry\nhunt\nhurdle\nhurry\nhurt\nhusband\nhybrid\nice\nicon\nidea\nidentify\nidle\nignore\nill\nillegal\nillness\nimage\nimitate\nimmense\nimmune\nimpact\nimpose\nimprove\nimpulse\ninch\ninclude\nincome\nincrease\nindex\nindicate\nindoor\nindustry\ninfant\ninflict\ninform\ninhale\ninherit\ninitial\ninject\ninjury\ninmate\ninner\ninnocent\ninput\ninquiry\ninsane\ninsect\ninside\ninspire\ninstall\nintact\ninterest\ninto\ninvest\ninvite\ninvolve\niron\nisland\nisolate\nissue\nitem\nivory\njacket\njaguar\njar\njazz\njealous\njeans\njelly\njewel\njob\njoin\njoke\njourney\njoy\njudge\njuice\njump\njungle\njunior\njunk\njust\nkangaroo\nkeen\nkeep\nketchup\nkey\nkick\nkid\nkidney\nkind\nkingdom\nkiss\nkit\nkitchen\nkite\nkitten\nkiwi\nknee\nknife\nknock\nknow\nlab\nlabel\nlabor\nladder\nlady\nlake\nlamp\nlanguage\nlaptop\nlarge\nlater\nlatin\nlaugh\nlaundry\nlava\nlaw\nlawn\nlawsuit\nlayer\nlazy\nleader\nleaf\nlearn\nleave\nlecture\nleft\nleg\nlegal\nlegend\nleisure\nlemon\nlend\nlength\nlens\nleopard\nlesson\nletter\nlevel\nliar\nliberty\nlibrary\nlicense\nlife\nlift\nlight\nlike\nlimb\nlimit\nlink\nlion\nliquid\nlist\nlittle\nlive\nlizard\nload\nloan\nlobster\nlocal\nlock\nlogic\nlonely\nlong\nloop\nlottery\nloud\nlounge\nlove\nloyal\nlucky\nluggage\nlumber\nlunar\nlunch\nluxury\nlyrics\nmachine\nmad\nmagic\nmagnet\nmaid\nmail\nmain\nmajor\nmake\nmammal\nman\nmanage\nmandate\nmango\nmansion\nmanual\nmaple\nmarble\nmarch\nmargin\nmarine\nmarket\nmarriage\nmask\nmass\nmaster\nmatch\nmaterial\nmath\nmatrix\nmatter\nmaximum\nmaze\nmeadow\nmean\nmeasure\nmeat\nmechanic\nmedal\nmedia\nmelody\nmelt\nmember\nmemory\nmention\nmenu\nmercy\nmerge\nmerit\nmerry\nmesh\nmessage\nmetal\nmethod\nmiddle\nmidnight\nmilk\nmillion\nmimic\nmind\nminimum\nminor\nminute\nmiracle\nmirror\nmisery\nmiss\nmistake\nmix\nmixed\nmixture\nmobile\nmodel\nmodify\nmom\nmoment\nmonitor\nmonkey\nmonster\nmonth\nmoon\nmoral\nmore\nmorning\nmosquito\nmother\nmotion\nmotor\nmountain\nmouse\nmove\nmovie\nmuch\nmuffin\nmule\nmultiply\nmuscle\nmuseum\nmushroom\nmusic\nmust\nmutual\nmyself\nmystery\nmyth\nnaive\nname\nnapkin\nnarrow\nnasty\nnation\nnature\nnear\nneck\nneed\nnegative\nneglect\nneither\nnephew\nnerve\nnest\nnet\nnetwork\nneutral\nnever\nnews\nnext\nnice\nnight\nnoble\nnoise\nnominee\nnoodle\nnormal\nnorth\nnose\nnotable\nnote\nnothing\nnotice\nnovel\nnow\nnuclear\nnumber\nnurse\nnut\noak\nobey\nobject\noblige\nobscure\nobserve\nobtain\nobvious\noccur\nocean\noctober\nodor\noff\noffer\noffice\noften\noil\nokay\nold\nolive\nolympic\nomit\nonce\none\nonion\nonline\nonly\nopen\nopera\nopinion\noppose\noption\norange\norbit\norchard\norder\nordinary\norgan\norient\noriginal\norphan\nostrich\nother\noutdoor\nouter\noutput\noutside\noval\noven\nover\nown\nowner\noxygen\noyster\nozone\npact\npaddle\npage\npair\npalace\npalm\npanda\npanel\npanic\npanther\npaper\nparade\nparent\npark\nparrot\nparty\npass\npatch\npath\npatient\npatrol\npattern\npause\npave\npayment\npeace\npeanut\npear\npeasant\npelican\npen\npenalty\npencil\npeople\npepper\nperfect\npermit\nperson\npet\nphone\nphoto\nphrase\nphysical\npiano\npicnic\npicture\npiece\npig\npigeon\npill\npilot\npink\npioneer\npipe\npistol\npitch\npizza\nplace\nplanet\nplastic\nplate\nplay\nplease\npledge\npluck\nplug\nplunge\npoem\npoet\npoint\npolar\npole\npolice\npond\npony\npool\npopular\nportion\nposition\npossible\npost\npotato\npottery\npoverty\npowder\npower\npractice\npraise\npredict\nprefer\nprepare\npresent\npretty\nprevent\nprice\npride\nprimary\nprint\npriority\nprison\nprivate\nprize\nproblem\nprocess\nproduce\nprofit\nprogram\nproject\npromote\nproof\nproperty\nprosper\nprotect\nproud\nprovide\npublic\npudding\npull\npulp\npulse\npumpkin\npunch\npupil\npuppy\npurchase\npurity\npurpose\npurse\npush\nput\npuzzle\npyramid\nquality\nquantum\nquarter\nquestion\nquick\nquit\nquiz\nquote\nrabbit\nraccoon\nrace\nrack\nradar\nradio\nrail\nrain\nraise\nrally\nramp\nranch\nrandom\nrange\nrapid\nrare\nrate\nrather\nraven\nraw\nrazor\nready\nreal\nreason\nrebel\nrebuild\nrecall\nreceive\nrecipe\nrecord\nrecycle\nreduce\nreflect\nreform\nrefuse\nregion\nregret\nregular\nreject\nrelax\nrelease\nrelief\nrely\nremain\nremember\nremind\nremove\nrender\nrenew\nrent\nreopen\nrepair\nrepeat\nreplace\nreport\nrequire\nrescue\nresemble\nresist\nresource\nresponse\nresult\nretire\nretreat\nreturn\nreunion\nreveal\nreview\nreward\nrhythm\nrib\nribbon\nrice\nrich\nride\nridge\nrifle\nright\nrigid\nring\nriot\nripple\nrisk\nritual\nrival\nriver\nroad\nroast\nrobot\nrobust\nrocket\nromance\nroof\nrookie\nroom\nrose\nrotate\nrough\nround\nroute\nroyal\nrubber\nrude\nrug\nrule\nrun\nrunway\nrural\nsad\nsaddle\nsadness\nsafe\nsail\nsalad\nsalmon\nsalon\nsalt\nsalute\nsame\nsample\nsand\nsatisfy\nsatoshi\nsauce\nsausage\nsave\nsay\nscale\nscan\nscare\nscatter\nscene\nscheme\nschool\nscience\nscissors\nscorpion\nscout\nscrap\nscreen\nscript\nscrub\nsea\nsearch\nseason\nseat\nsecond\nsecret\nsection\nsecurity\nseed\nseek\nsegment\nselect\nsell\nseminar\nsenior\nsense\nsentence\nseries\nservice\nsession\nsettle\nsetup\nseven\nshadow\nshaft\nshallow\nshare\nshed\nshell\nsheriff\nshield\nshift\nshine\nship\nshiver\nshock\nshoe\nshoot\nshop\nshort\nshoulder\nshove\nshrimp\nshrug\nshuffle\nshy\nsibling\nsick\nside\nsiege\nsight\nsign\nsilent\nsilk\nsilly\nsilver\nsimilar\nsimple\nsince\nsing\nsiren\nsister\nsituate\nsix\nsize\nskate\nsketch\nski\nskill\nskin\nskirt\nskull\nslab\nslam\nsleep\nslender\nslice\nslide\nslight\nslim\nslogan\nslot\nslow\nslush\nsmall\nsmart\nsmile\nsmoke\nsmooth\nsnack\nsnake\nsnap\nsniff\nsnow\nsoap\nsoccer\nsocial\nsock\nsoda\nsoft\nsolar\nsoldier\nsolid\nsolution\nsolve\nsomeone\nsong\nsoon\nsorry\nsort\nsoul\nsound\nsoup\nsource\nsouth\nspace\nspare\nspatial\nspawn\nspeak\nspecial\nspeed\nspell\nspend\nsphere\nspice\nspider\nspike\nspin\nspirit\nsplit\nspoil\nsponsor\nspoon\nsport\nspot\nspray\nspread\nspring\nspy\nsquare\nsqueeze\nsquirrel\nstable\nstadium\nstaff\nstage\nstairs\nstamp\nstand\nstart\nstate\nstay\nsteak\nsteel\nstem\nstep\nstereo\nstick\nstill\nsting\nstock\nstomach\nstone\nstool\nstory\nstove\nstrategy\nstreet\nstrike\nstrong\nstruggle\nstudent\nstuff\nstumble\nstyle\nsubject\nsubmit\nsubway\nsuccess\nsuch\nsudden\nsuffer\nsugar\nsuggest\nsuit\nsummer\nsun\nsunny\nsunset\nsuper\nsupply\nsupreme\nsure\nsurface\nsurge\nsurprise\nsurround\nsurvey\nsuspect\nsustain\nswallow\nswamp\nswap\nswarm\nswear\nsweet\nswift\nswim\nswing\nswitch\nsword\nsymbol\nsymptom\nsyrup\nsystem\ntable\ntackle\ntag\ntail\ntalent\ntalk\ntank\ntape\ntarget\ntask\ntaste\ntattoo\ntaxi\nteach\nteam\ntell\nten\ntenant\ntennis\ntent\nterm\ntest\ntext\nthank\nthat\ntheme\nthen\ntheory\nthere\nthey\nthing\nthis\nthought\nthree\nthrive\nthrow\nthumb\nthunder\nticket\ntide\ntiger\ntilt\ntimber\ntime\ntiny\ntip\ntired\ntissue\ntitle\ntoast\ntobacco\ntoday\ntoddler\ntoe\ntogether\ntoilet\ntoken\ntomato\ntomorrow\ntone\ntongue\ntonight\ntool\ntooth\ntop\ntopic\ntopple\ntorch\ntornado\ntortoise\ntoss\ntotal\ntourist\ntoward\ntower\ntown\ntoy\ntrack\ntrade\ntraffic\ntragic\ntrain\ntransfer\ntrap\ntrash\ntravel\ntray\ntreat\ntree\ntrend\ntrial\ntribe\ntrick\ntrigger\ntrim\ntrip\ntrophy\ntrouble\ntruck\ntrue\ntruly\ntrumpet\ntrust\ntruth\ntry\ntube\ntuition\ntumble\ntuna\ntunnel\nturkey\nturn\nturtle\ntwelve\ntwenty\ntwice\ntwin\ntwist\ntwo\ntype\ntypical\nugly\numbrella\nunable\nunaware\nuncle\nuncover\nunder\nundo\nunfair\nunfold\nunhappy\nuniform\nunique\nunit\nuniverse\nunknown\nunlock\nuntil\nunusual\nunveil\nupdate\nupgrade\nuphold\nupon\nupper\nupset\nurban\nurge\nusage\nuse\nused\nuseful\nuseless\nusual\nutility\nvacant\nvacuum\nvague\nvalid\nvalley\nvalve\nvan\nvanish\nvapor\nvarious\nvast\nvault\nvehicle\nvelvet\nvendor\nventure\nvenue\nverb\nverify\nversion\nvery\nvessel\nveteran\nviable\nvibrant\nvicious\nvictory\nvideo\nview\nvillage\nvintage\nviolin\nvirtual\nvirus\nvisa\nvisit\nvisual\nvital\nvivid\nvocal\nvoice\nvoid\nvolcano\nvolume\nvote\nvoyage\nwage\nwagon\nwait\nwalk\nwall\nwalnut\nwant\nwarfare\nwarm\nwarrior\nwash\nwasp\nwaste\nwater\nwave\nway\nwealth\nweapon\nwear\nweasel\nweather\nweb\nwedding\nweekend\nweird\nwelcome\nwest\nwet\nwhale\nwhat\nwheat\nwheel\nwhen\nwhere\nwhip\nwhisper\nwide\nwidth\nwife\nwild\nwill\nwin\nwindow\nwine\nwing\nwink\nwinner\nwinter\nwire\nwisdom\nwise\nwish\nwitness\nwolf\nwoman\nwonder\nwood\nwool\nword\nwork\nworld\nworry\nworth\nwrap\nwreck\nwrestle\nwrist\nwrite\nwrong\nyard\nyear\nyellow\nyou\nyoung\nyouth\nzebra\nzero\nzone\nzoo".split("\n")},70841:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Account:()=>U,AddressLookupTableAccount:()=>Wt,AddressLookupTableInstruction:()=>xn,AddressLookupTableProgram:()=>Pn,Authorized:()=>Kn,BLOCKHASH_CACHE_TIMEOUT_MS:()=>Vt,BPF_LOADER_DEPRECATED_PROGRAM_ID:()=>N,BPF_LOADER_PROGRAM_ID:()=>Bt,BpfLoader:()=>Ot,COMPUTE_BUDGET_INSTRUCTION_LAYOUTS:()=>On,ComputeBudgetInstruction:()=>Bn,ComputeBudgetProgram:()=>Rn,Connection:()=>Sn,Ed25519Program:()=>Cn,Enum:()=>P,EpochSchedule:()=>Lt,FeeCalculatorLayout:()=>wt,Keypair:()=>En,LAMPORTS_PER_SOL:()=>cr,LOOKUP_TABLE_INSTRUCTION_LAYOUTS:()=>Tn,Loader:()=>Pt,Lockup:()=>Dn,MAX_SEED_LENGTH:()=>O,Message:()=>J,MessageAccountKeys:()=>W,MessageV0:()=>Y,NONCE_ACCOUNT_LENGTH:()=>vt,NonceAccount:()=>It,PACKET_DATA_SIZE:()=>L,PUBLIC_KEY_LENGTH:()=>R,PublicKey:()=>C,SIGNATURE_LENGTH_IN_BYTES:()=>K,SOLANA_SCHEMA:()=>B,STAKE_CONFIG_ID:()=>zn,STAKE_INSTRUCTION_LAYOUTS:()=>Wn,SYSTEM_INSTRUCTION_LAYOUTS:()=>Et,SYSVAR_CLOCK_PUBKEY:()=>st,SYSVAR_EPOCH_SCHEDULE_PUBKEY:()=>at,SYSVAR_INSTRUCTIONS_PUBKEY:()=>ct,SYSVAR_RECENT_BLOCKHASHES_PUBKEY:()=>ut,SYSVAR_RENT_PUBKEY:()=>lt,SYSVAR_REWARDS_PUBKEY:()=>dt,SYSVAR_SLOT_HASHES_PUBKEY:()=>ht,SYSVAR_SLOT_HISTORY_PUBKEY:()=>ft,SYSVAR_STAKE_HISTORY_PUBKEY:()=>pt,Secp256k1Program:()=>Ln,SendTransactionError:()=>zt,SolanaJSONRPCError:()=>Dt,SolanaJSONRPCErrorCode:()=>Kt,StakeAuthorizationLayout:()=>Fn,StakeInstruction:()=>jn,StakeProgram:()=>Gn,Struct:()=>x,SystemInstruction:()=>St,SystemProgram:()=>Tt,Transaction:()=>rt,TransactionExpiredBlockheightExceededError:()=>D,TransactionExpiredTimeoutError:()=>j,TransactionInstruction:()=>nt,TransactionMessage:()=>it,TransactionStatus:()=>tt,VALIDATOR_INFO_KEY:()=>Xn,VERSION_PREFIX_MASK:()=>z,VOTE_PROGRAM_ID:()=>Qn,ValidatorInfo:()=>Yn,VersionedMessage:()=>Q,VersionedTransaction:()=>ot,VoteAccount:()=>er,VoteAuthorizationLayout:()=>Zn,VoteInit:()=>Hn,VoteInstruction:()=>qn,VoteProgram:()=>Vn,clusterApiUrl:()=>sr,sendAndConfirmRawTransaction:()=>ar,sendAndConfirmTransaction:()=>yt});var r=n(48834),i=n(8448),o=n(21686),s=n(62197),a=n.n(s),c=n(17022),u=n.n(c),l=n(53929),d=n(83871),h=n(96346),f=n(41528),p=n(50974),y=n(50714),g=n(87414),m=n.n(g),b=n(48796),w=n(10846),k=n(89580);o.P6.sha512Sync=(...t)=>(0,i.o)(o.P6.concatBytes(...t));const v=o.P6.randomPrivateKey,I=()=>{const t=o.P6.randomPrivateKey(),e=A(t),n=new Uint8Array(64);return n.set(t),n.set(e,32),{publicKey:e,secretKey:n}},A=o.Z_.getPublicKey;function _(t){try{return o.E9.fromHex(t,!0),!0}catch{return!1}}const S=(t,e)=>o.Z_.sign(t,e.slice(0,32)),E=o.Z_.verify,T=t=>r.Buffer.isBuffer(t)?t:t instanceof Uint8Array?r.Buffer.from(t.buffer,t.byteOffset,t.byteLength):r.Buffer.from(t);class x{constructor(t){Object.assign(this,t)}encode(){return r.Buffer.from((0,d.serialize)(B,this))}static decode(t){return(0,d.deserialize)(B,this,t)}static decodeUnchecked(t){return(0,d.deserializeUnchecked)(B,this,t)}}class P extends x{constructor(t){if(super(t),this.enum="",1!==Object.keys(t).length)throw new Error("Enum can only take single value");Object.keys(t).map((t=>{this.enum=t}))}}const B=new Map,O=32,R=32;let M=1;class C extends x{constructor(t){if(super({}),this._bn=void 0,function(t){return void 0!==t._bn}(t))this._bn=t._bn;else{if("string"==typeof t){const e=u().decode(t);if(e.length!=R)throw new Error("Invalid public key input");this._bn=new(a())(e)}else this._bn=new(a())(t);if(this._bn.byteLength()>32)throw new Error("Invalid public key input")}}static unique(){const t=new C(M);return M+=1,new C(t.toBuffer())}equals(t){return this._bn.eq(t._bn)}toBase58(){return u().encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){return this.toBuffer()}toBuffer(){const t=this._bn.toArrayLike(r.Buffer);if(t.length===R)return t;const e=r.Buffer.alloc(32);return t.copy(e,32-t.length),e}toString(){return this.toBase58()}static async createWithSeed(t,e,n){const i=r.Buffer.concat([t.toBuffer(),r.Buffer.from(e),n.toBuffer()]),o=(0,l.J)(i);return new C(o)}static createProgramAddressSync(t,e){let n=r.Buffer.alloc(0);t.forEach((function(t){if(t.length>O)throw new TypeError("Max seed length exceeded");n=r.Buffer.concat([n,T(t)])})),n=r.Buffer.concat([n,e.toBuffer(),r.Buffer.from("ProgramDerivedAddress")]);const i=(0,l.J)(n);if(_(i))throw new Error("Invalid seeds, address must fall off the curve");return new C(i)}static async createProgramAddress(t,e){return this.createProgramAddressSync(t,e)}static findProgramAddressSync(t,e){let n,i=255;for(;0!=i;){try{const o=t.concat(r.Buffer.from([i]));n=this.createProgramAddressSync(o,e)}catch(o){if(o instanceof TypeError)throw o;i--;continue}return[n,i]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(t,e){return this.findProgramAddressSync(t,e)}static isOnCurve(t){return _(new C(t).toBytes())}}C.default=new C("11111111111111111111111111111111"),B.set(C,{kind:"struct",fields:[["_bn","u256"]]});class U{constructor(t){if(this._publicKey=void 0,this._secretKey=void 0,t){const e=T(t);if(64!==t.length)throw new Error("bad secret key size");this._publicKey=e.slice(32,64),this._secretKey=e.slice(0,32)}else this._secretKey=T(v()),this._publicKey=T(A(this._secretKey))}get publicKey(){return new C(this._publicKey)}get secretKey(){return r.Buffer.concat([this._secretKey,this._publicKey],64)}}const N=new C("BPFLoader1111111111111111111111111111111111"),L=1232,z=127,K=64;class D extends Error{constructor(t){super(`Signature ${t} has expired: block height exceeded.`),this.signature=void 0,this.signature=t}}Object.defineProperty(D.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class j extends Error{constructor(t,e){super(`Transaction was not confirmed in ${e.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${t} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=t}}Object.defineProperty(j.prototype,"name",{value:"TransactionExpiredTimeoutError"});class W{constructor(t,e){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=e}keySegments(){const t=[this.staticAccountKeys];return this.accountKeysFromLookups&&(t.push(this.accountKeysFromLookups.writable),t.push(this.accountKeysFromLookups.readonly)),t}get(t){for(const e of this.keySegments()){if(t<e.length)return e[t];t-=e.length}}get length(){return this.keySegments().flat().length}compileInstructions(t){if(this.length>256)throw new Error("Account index overflow encountered during compilation");const e=new Map;this.keySegments().flat().forEach(((t,n)=>{e.set(t.toBase58(),n)}));const n=t=>{const n=e.get(t.toBase58());if(void 0===n)throw new Error("Encountered an unknown instruction account key during compilation");return n};return t.map((t=>({programIdIndex:n(t.programId),accountKeyIndexes:t.keys.map((t=>n(t.pubkey))),data:t.data})))}}const F=(t="publicKey")=>h.blob(32,t),G=(t="signature")=>h.blob(64,t),H=(t="string")=>{const e=h.struct([h.u32("length"),h.u32("lengthPadding"),h.blob(h.offset(h.u32(),-8),"chars")],t),n=e.decode.bind(e),i=e.encode.bind(e),o=e;return o.decode=(t,e)=>n(t,e).chars.toString(),o.encode=(t,e,n)=>{const o={chars:r.Buffer.from(t,"utf8")};return i(o,e,n)},o.alloc=t=>h.u32().span+h.u32().span+r.Buffer.from(t,"utf8").length,o};function q(t,e){const n=t=>{if(t.span>=0)return t.span;if("function"==typeof t.alloc)return t.alloc(e[t.property]);if("count"in t&&"elementLayout"in t){const r=e[t.property];if(Array.isArray(r))return r.length*n(t.elementLayout)}else if("fields"in t)return q({layout:t},e[t.property]);return 0};let r=0;return t.layout.fields.forEach((t=>{r+=n(t)})),r}function $(t){let e=0,n=0;for(;;){let r=t.shift();if(e|=(127&r)<<7*n,n+=1,0==(128&r))break}return e}function Z(t,e){let n=e;for(;;){let e=127&n;if(n>>=7,0==n){t.push(e);break}e|=128,t.push(e)}}function V(t,e){if(!t)throw new Error(e||"Assertion failed")}class X{constructor(t,e){this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=e}static compile(t,e){const n=new Map,r=t=>{const e=t.toBase58();let r=n.get(e);return void 0===r&&(r={isSigner:!1,isWritable:!1,isInvoked:!1},n.set(e,r)),r},i=r(e);i.isSigner=!0,i.isWritable=!0;for(const o of t){r(o.programId).isInvoked=!0;for(const t of o.keys){const e=r(t.pubkey);e.isSigner||(e.isSigner=t.isSigner),e.isWritable||(e.isWritable=t.isWritable)}}return new X(e,n)}getMessageComponents(){const t=[...this.keyMetaMap.entries()];V(t.length<=256,"Max static account keys length exceeded");const e=t.filter((([,t])=>t.isSigner&&t.isWritable)),n=t.filter((([,t])=>t.isSigner&&!t.isWritable)),r=t.filter((([,t])=>!t.isSigner&&t.isWritable)),i=t.filter((([,t])=>!t.isSigner&&!t.isWritable)),o={numRequiredSignatures:e.length+n.length,numReadonlySignedAccounts:n.length,numReadonlyUnsignedAccounts:i.length};{V(e.length>0,"Expected at least one writable signer key");const[t]=e[0];V(t===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}return[o,[...e.map((([t])=>new C(t))),...n.map((([t])=>new C(t))),...r.map((([t])=>new C(t))),...i.map((([t])=>new C(t)))]]}extractTableLookup(t){const[e,n]=this.drainKeysFoundInLookupTable(t.state.addresses,(t=>!t.isSigner&&!t.isInvoked&&t.isWritable)),[r,i]=this.drainKeysFoundInLookupTable(t.state.addresses,(t=>!t.isSigner&&!t.isInvoked&&!t.isWritable));if(0!==e.length||0!==r.length)return[{accountKey:t.key,writableIndexes:e,readonlyIndexes:r},{writable:n,readonly:i}]}drainKeysFoundInLookupTable(t,e){const n=new Array,r=new Array;for(const[i,o]of this.keyMetaMap.entries())if(e(o)){const e=new C(i),o=t.findIndex((t=>t.equals(e)));o>=0&&(V(o<256,"Max lookup table index exceeded"),n.push(o),r.push(e),this.keyMetaMap.delete(i))}return[n,r]}}class J{constructor(t){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map((t=>new C(t))),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach((t=>this.indexToProgramIds.set(t.programIdIndex,this.accountKeys[t.programIdIndex])))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map((t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:u().decode(t.data)})))}get addressTableLookups(){return[]}getAccountKeys(){return new W(this.staticAccountKeys)}static compile(t){const e=X.compile(t.instructions,t.payerKey),[n,r]=e.getMessageComponents(),i=new W(r).compileInstructions(t.instructions).map((t=>({programIdIndex:t.programIdIndex,accounts:t.accountKeyIndexes,data:u().encode(t.data)})));return new J({header:n,accountKeys:r,recentBlockhash:t.recentBlockhash,instructions:i})}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){const e=this.header.numRequiredSignatures;if(t>=this.header.numRequiredSignatures){return t-e<this.accountKeys.length-e-this.header.numReadonlyUnsignedAccounts}return t<e-this.header.numReadonlySignedAccounts}isProgramId(t){return this.indexToProgramIds.has(t)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter(((t,e)=>!this.isProgramId(e)))}serialize(){const t=this.accountKeys.length;let e=[];Z(e,t);const n=this.instructions.map((t=>{const{accounts:e,programIdIndex:n}=t,i=Array.from(u().decode(t.data));let o=[];Z(o,e.length);let s=[];return Z(s,i.length),{programIdIndex:n,keyIndicesCount:r.Buffer.from(o),keyIndices:e,dataLength:r.Buffer.from(s),data:i}}));let i=[];Z(i,n.length);let o=r.Buffer.alloc(L);r.Buffer.from(i).copy(o);let s=i.length;n.forEach((t=>{const e=h.struct([h.u8("programIdIndex"),h.blob(t.keyIndicesCount.length,"keyIndicesCount"),h.seq(h.u8("keyIndex"),t.keyIndices.length,"keyIndices"),h.blob(t.dataLength.length,"dataLength"),h.seq(h.u8("userdatum"),t.data.length,"data")]).encode(t,o,s);s+=e})),o=o.slice(0,s);const a=h.struct([h.blob(1,"numRequiredSignatures"),h.blob(1,"numReadonlySignedAccounts"),h.blob(1,"numReadonlyUnsignedAccounts"),h.blob(e.length,"keyCount"),h.seq(F("key"),t,"keys"),F("recentBlockhash")]),c={numRequiredSignatures:r.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:r.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:r.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:r.Buffer.from(e),keys:this.accountKeys.map((t=>T(t.toBytes()))),recentBlockhash:u().decode(this.recentBlockhash)};let l=r.Buffer.alloc(2048);const d=a.encode(c,l);return o.copy(l,d),l.slice(0,d+o.length)}static from(t){let e=[...t];const n=e.shift();if(n!==(n&z))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const i=e.shift(),o=e.shift(),s=$(e);let a=[];for(let u=0;u<s;u++){const t=e.slice(0,R);e=e.slice(R),a.push(new C(r.Buffer.from(t)))}const c=e.slice(0,R);e=e.slice(R);const l=$(e);let d=[];for(let f=0;f<l;f++){const t=e.shift(),n=$(e),i=e.slice(0,n);e=e.slice(n);const o=$(e),s=e.slice(0,o),a=u().encode(r.Buffer.from(s));e=e.slice(o),d.push({programIdIndex:t,accounts:i,data:a})}const h={header:{numRequiredSignatures:n,numReadonlySignedAccounts:i,numReadonlyUnsignedAccounts:o},recentBlockhash:u().encode(r.Buffer.from(c)),accountKeys:a,instructions:d};return new J(h)}}class Y{constructor(t){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=t.header,this.staticAccountKeys=t.staticAccountKeys,this.recentBlockhash=t.recentBlockhash,this.compiledInstructions=t.compiledInstructions,this.addressTableLookups=t.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let t=0;for(const e of this.addressTableLookups)t+=e.readonlyIndexes.length+e.writableIndexes.length;return t}getAccountKeys(t){let e;if(t&&"accountKeysFromLookups"in t){if(this.numAccountKeysFromLookups!=t.accountKeysFromLookups.writable.length+t.accountKeysFromLookups.readonly.length)throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");e=t.accountKeysFromLookups}else if(t&&"addressLookupTableAccounts"in t)e=this.resolveAddressTableLookups(t.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new W(this.staticAccountKeys,e)}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){const e=this.header.numRequiredSignatures,n=this.staticAccountKeys.length;if(t>=n){return t-n<this.addressTableLookups.reduce(((t,e)=>t+e.writableIndexes.length),0)}if(t>=this.header.numRequiredSignatures){return t-e<n-e-this.header.numReadonlyUnsignedAccounts}return t<e-this.header.numReadonlySignedAccounts}resolveAddressTableLookups(t){const e={writable:[],readonly:[]};for(const n of this.addressTableLookups){const r=t.find((t=>t.key.equals(n.accountKey)));if(!r)throw new Error(`Failed to find address lookup table account for table key ${n.accountKey.toBase58()}`);for(const t of n.writableIndexes){if(!(t<r.state.addresses.length))throw new Error(`Failed to find address for index ${t} in address lookup table ${n.accountKey.toBase58()}`);e.writable.push(r.state.addresses[t])}for(const t of n.readonlyIndexes){if(!(t<r.state.addresses.length))throw new Error(`Failed to find address for index ${t} in address lookup table ${n.accountKey.toBase58()}`);e.readonly.push(r.state.addresses[t])}}return e}static compile(t){const e=X.compile(t.instructions,t.payerKey),n=new Array,r={writable:new Array,readonly:new Array},i=t.addressLookupTableAccounts||[];for(const c of i){const t=e.extractTableLookup(c);if(void 0!==t){const[e,{writable:i,readonly:o}]=t;n.push(e),r.writable.push(...i),r.readonly.push(...o)}}const[o,s]=e.getMessageComponents(),a=new W(s,r).compileInstructions(t.instructions);return new Y({header:o,staticAccountKeys:s,recentBlockhash:t.recentBlockhash,compiledInstructions:a,addressTableLookups:n})}serialize(){const t=Array();Z(t,this.staticAccountKeys.length);const e=this.serializeInstructions(),n=Array();Z(n,this.compiledInstructions.length);const r=this.serializeAddressTableLookups(),i=Array();Z(i,this.addressTableLookups.length);const o=h.struct([h.u8("prefix"),h.struct([h.u8("numRequiredSignatures"),h.u8("numReadonlySignedAccounts"),h.u8("numReadonlyUnsignedAccounts")],"header"),h.blob(t.length,"staticAccountKeysLength"),h.seq(F(),this.staticAccountKeys.length,"staticAccountKeys"),F("recentBlockhash"),h.blob(n.length,"instructionsLength"),h.blob(e.length,"serializedInstructions"),h.blob(i.length,"addressTableLookupsLength"),h.blob(r.length,"serializedAddressTableLookups")]),s=new Uint8Array(L),a=o.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(t),staticAccountKeys:this.staticAccountKeys.map((t=>t.toBytes())),recentBlockhash:u().decode(this.recentBlockhash),instructionsLength:new Uint8Array(n),serializedInstructions:e,addressTableLookupsLength:new Uint8Array(i),serializedAddressTableLookups:r},s);return s.slice(0,a)}serializeInstructions(){let t=0;const e=new Uint8Array(L);for(const n of this.compiledInstructions){const r=Array();Z(r,n.accountKeyIndexes.length);const i=Array();Z(i,n.data.length);t+=h.struct([h.u8("programIdIndex"),h.blob(r.length,"encodedAccountKeyIndexesLength"),h.seq(h.u8(),n.accountKeyIndexes.length,"accountKeyIndexes"),h.blob(i.length,"encodedDataLength"),h.blob(n.data.length,"data")]).encode({programIdIndex:n.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(r),accountKeyIndexes:n.accountKeyIndexes,encodedDataLength:new Uint8Array(i),data:n.data},e,t)}return e.slice(0,t)}serializeAddressTableLookups(){let t=0;const e=new Uint8Array(L);for(const n of this.addressTableLookups){const r=Array();Z(r,n.writableIndexes.length);const i=Array();Z(i,n.readonlyIndexes.length);t+=h.struct([F("accountKey"),h.blob(r.length,"encodedWritableIndexesLength"),h.seq(h.u8(),n.writableIndexes.length,"writableIndexes"),h.blob(i.length,"encodedReadonlyIndexesLength"),h.seq(h.u8(),n.readonlyIndexes.length,"readonlyIndexes")]).encode({accountKey:n.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(r),writableIndexes:n.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(i),readonlyIndexes:n.readonlyIndexes},e,t)}return e.slice(0,t)}static deserialize(t){let e=[...t];const n=e.shift(),r=n&z;V(n!==r,"Expected versioned message but received legacy message");V(0===r,`Expected versioned message with version 0 but found version ${r}`);const i={numRequiredSignatures:e.shift(),numReadonlySignedAccounts:e.shift(),numReadonlyUnsignedAccounts:e.shift()},o=[],s=$(e);for(let u=0;u<s;u++)o.push(new C(e.splice(0,R)));const a=u().encode(e.splice(0,R)),c=$(e),l=[];for(let u=0;u<c;u++){const t=e.shift(),n=$(e),r=e.splice(0,n),i=$(e),o=new Uint8Array(e.splice(0,i));l.push({programIdIndex:t,accountKeyIndexes:r,data:o})}const d=$(e),h=[];for(let u=0;u<d;u++){const t=new C(e.splice(0,R)),n=$(e),r=e.splice(0,n),i=$(e),o=e.splice(0,i);h.push({accountKey:t,writableIndexes:r,readonlyIndexes:o})}return new Y({header:i,staticAccountKeys:o,recentBlockhash:a,compiledInstructions:l,addressTableLookups:h})}}const Q={deserializeMessageVersion(t){const e=t[0],n=e&z;return n===e?"legacy":n},deserialize:t=>{const e=Q.deserializeMessageVersion(t);if("legacy"===e)return J.from(t);if(0===e)return Y.deserialize(t);throw new Error(`Transaction message version ${e} deserialization is not supported`)}};let tt;!function(t){t[t.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",t[t.PROCESSED=1]="PROCESSED",t[t.TIMED_OUT=2]="TIMED_OUT"}(tt||(tt={}));const et=r.Buffer.alloc(K).fill(0);class nt{constructor(t){this.keys=void 0,this.programId=void 0,this.data=r.Buffer.alloc(0),this.programId=t.programId,this.keys=t.keys,t.data&&(this.data=t.data)}toJSON(){return{keys:this.keys.map((({pubkey:t,isSigner:e,isWritable:n})=>({pubkey:t.toJSON(),isSigner:e,isWritable:n}))),programId:this.programId.toJSON(),data:[...this.data]}}}class rt{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(t){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this._message=void 0,this._json=void 0,t)if(t.feePayer&&(this.feePayer=t.feePayer),t.signatures&&(this.signatures=t.signatures),Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")){const{blockhash:e,lastValidBlockHeight:n}=t;this.recentBlockhash=e,this.lastValidBlockHeight=n}else{const{recentBlockhash:e,nonceInfo:n}=t;n&&(this.nonceInfo=n),this.recentBlockhash=e}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map((t=>t.toJSON())),signers:this.signatures.map((({publicKey:t})=>t.toJSON()))}}add(...t){if(0===t.length)throw new Error("No instructions");return t.forEach((t=>{"instructions"in t?this.instructions=this.instructions.concat(t.instructions):"data"in t&&"programId"in t&&"keys"in t?this.instructions.push(t):this.instructions.push(new nt(t))})),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let t,e,n;if(this.nonceInfo?(t=this.nonceInfo.nonce,e=this.instructions[0]!=this.nonceInfo.nonceInstruction?[this.nonceInfo.nonceInstruction,...this.instructions]:this.instructions):(t=this.recentBlockhash,e=this.instructions),!t)throw new Error("Transaction recentBlockhash required");if(e.length<1&&console.warn("No instructions provided"),this.feePayer)n=this.feePayer;else{if(!(this.signatures.length>0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");n=this.signatures[0].publicKey}for(let u=0;u<e.length;u++)if(void 0===e[u].programId)throw new Error(`Transaction instruction index ${u} has undefined program id`);const r=[],i=[];e.forEach((t=>{t.keys.forEach((t=>{i.push({...t})}));const e=t.programId.toString();r.includes(e)||r.push(e)})),r.forEach((t=>{i.push({pubkey:new C(t),isSigner:!1,isWritable:!1})}));const o=[];i.forEach((t=>{const e=t.pubkey.toString(),n=o.findIndex((t=>t.pubkey.toString()===e));n>-1?(o[n].isWritable=o[n].isWritable||t.isWritable,o[n].isSigner=o[n].isSigner||t.isSigner):o.push(t)})),o.sort((function(t,e){return t.isSigner!==e.isSigner?t.isSigner?-1:1:t.isWritable!==e.isWritable?t.isWritable?-1:1:t.pubkey.toBase58().localeCompare(e.pubkey.toBase58())}));const s=o.findIndex((t=>t.pubkey.equals(n)));if(s>-1){const[t]=o.splice(s,1);t.isSigner=!0,t.isWritable=!0,o.unshift(t)}else o.unshift({pubkey:n,isSigner:!0,isWritable:!0});for(const u of this.signatures){const t=o.findIndex((t=>t.pubkey.equals(u.publicKey)));if(!(t>-1))throw new Error(`unknown signer: ${u.publicKey.toString()}`);o[t].isSigner||(o[t].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."))}let a=0,c=0,l=0;const d=[],h=[];o.forEach((({pubkey:t,isSigner:e,isWritable:n})=>{e?(d.push(t.toString()),a+=1,n||(c+=1)):(h.push(t.toString()),n||(l+=1))}));const f=d.concat(h),p=e.map((t=>{const{data:e,programId:n}=t;return{programIdIndex:f.indexOf(n.toString()),accounts:t.keys.map((t=>f.indexOf(t.pubkey.toString()))),data:u().encode(e)}}));return p.forEach((t=>{V(t.programIdIndex>=0),t.accounts.forEach((t=>V(t>=0)))})),new J({header:{numRequiredSignatures:a,numReadonlySignedAccounts:c,numReadonlyUnsignedAccounts:l},accountKeys:f,recentBlockhash:t,instructions:p})}_compile(){const t=this.compileMessage(),e=t.accountKeys.slice(0,t.header.numRequiredSignatures);if(this.signatures.length===e.length){if(this.signatures.every(((t,n)=>e[n].equals(t.publicKey))))return t}return this.signatures=e.map((t=>({signature:null,publicKey:t}))),t}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(t){return(await t.getFeeForMessage(this.compileMessage())).value}setSigners(...t){if(0===t.length)throw new Error("No signers");const e=new Set;this.signatures=t.filter((t=>{const n=t.toString();return!e.has(n)&&(e.add(n),!0)})).map((t=>({signature:null,publicKey:t})))}sign(...t){if(0===t.length)throw new Error("No signers");const e=new Set,n=[];for(const i of t){const t=i.publicKey.toString();e.has(t)||(e.add(t),n.push(i))}this.signatures=n.map((t=>({signature:null,publicKey:t.publicKey})));const r=this._compile();this._partialSign(r,...n)}partialSign(...t){if(0===t.length)throw new Error("No signers");const e=new Set,n=[];for(const i of t){const t=i.publicKey.toString();e.has(t)||(e.add(t),n.push(i))}const r=this._compile();this._partialSign(r,...n)}_partialSign(t,...e){const n=t.serialize();e.forEach((t=>{const e=S(n,t.secretKey);this._addSignature(t.publicKey,T(e))}))}addSignature(t,e){this._compile(),this._addSignature(t,e)}_addSignature(t,e){V(64===e.length);const n=this.signatures.findIndex((e=>t.equals(e.publicKey)));if(n<0)throw new Error(`unknown signer: ${t.toString()}`);this.signatures[n].signature=r.Buffer.from(e)}verifySignatures(){return this._verifySignatures(this.serializeMessage(),!0)}_verifySignatures(t,e){for(const{signature:n,publicKey:r}of this.signatures)if(null===n){if(e)return!1}else if(!E(n,t,r.toBuffer()))return!1;return!0}serialize(t){const{requireAllSignatures:e,verifySignatures:n}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},t),r=this.serializeMessage();if(n&&!this._verifySignatures(r,e))throw new Error("Signature verification failed");return this._serialize(r)}_serialize(t){const{signatures:e}=this,n=[];Z(n,e.length);const i=n.length+64*e.length+t.length,o=r.Buffer.alloc(i);return V(e.length<256),r.Buffer.from(n).copy(o,0),e.forEach((({signature:t},e)=>{null!==t&&(V(64===t.length,"signature has invalid length"),r.Buffer.from(t).copy(o,n.length+64*e))})),t.copy(o,n.length+64*e.length),V(o.length<=L,`Transaction too large: ${o.length} > ${L}`),o}get keys(){return V(1===this.instructions.length),this.instructions[0].keys.map((t=>t.pubkey))}get programId(){return V(1===this.instructions.length),this.instructions[0].programId}get data(){return V(1===this.instructions.length),this.instructions[0].data}static from(t){let e=[...t];const n=$(e);let i=[];for(let o=0;o<n;o++){const t=e.slice(0,K);e=e.slice(K),i.push(u().encode(r.Buffer.from(t)))}return rt.populate(J.from(e),i)}static populate(t,e=[]){const n=new rt;return n.recentBlockhash=t.recentBlockhash,t.header.numRequiredSignatures>0&&(n.feePayer=t.accountKeys[0]),e.forEach(((e,r)=>{const i={signature:e==u().encode(et)?null:u().decode(e),publicKey:t.accountKeys[r]};n.signatures.push(i)})),t.instructions.forEach((e=>{const r=e.accounts.map((e=>{const r=t.accountKeys[e];return{pubkey:r,isSigner:n.signatures.some((t=>t.publicKey.toString()===r.toString()))||t.isAccountSigner(e),isWritable:t.isAccountWritable(e)}}));n.instructions.push(new nt({keys:r,programId:t.accountKeys[e.programIdIndex],data:u().decode(e.data)}))})),n._message=t,n._json=n.toJSON(),n}}class it{constructor(t){this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=t.payerKey,this.instructions=t.instructions,this.recentBlockhash=t.recentBlockhash}static decompile(t,e){const{header:n,compiledInstructions:r,recentBlockhash:i}=t,{numRequiredSignatures:o,numReadonlySignedAccounts:s,numReadonlyUnsignedAccounts:a}=n,c=o-s;V(c>0,"Message header is invalid");const u=t.staticAccountKeys.length-a;V(u>=0,"Message header is invalid");const l=t.getAccountKeys(e),d=l.get(0);if(void 0===d)throw new Error("Failed to decompile message because no account keys were found");const h=[];for(const f of r){const t=[];for(const r of f.accountKeyIndexes){const e=l.get(r);if(void 0===e)throw new Error(`Failed to find key for account key index ${r}`);let i;i=r<o?r<c:r<l.staticAccountKeys.length?r-o<u:r-l.staticAccountKeys.length<l.accountKeysFromLookups.writable.length,t.push({pubkey:e,isSigner:r<n.numRequiredSignatures,isWritable:i})}const e=l.get(f.programIdIndex);if(void 0===e)throw new Error(`Failed to find program id for program id index ${f.programIdIndex}`);h.push(new nt({programId:e,data:T(f.data),keys:t}))}return new it({payerKey:d,instructions:h,recentBlockhash:i})}compileToLegacyMessage(){return J.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}compileToV0Message(t){return Y.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:t})}}class ot{get version(){return this.message.version}constructor(t,e){if(this.signatures=void 0,this.message=void 0,void 0!==e)V(e.length===t.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=e;else{const e=[];for(let n=0;n<t.header.numRequiredSignatures;n++)e.push(new Uint8Array(K));this.signatures=e}this.message=t}serialize(){const t=this.message.serialize(),e=Array();Z(e,this.signatures.length);const n=h.struct([h.blob(e.length,"encodedSignaturesLength"),h.seq(G(),this.signatures.length,"signatures"),h.blob(t.length,"serializedMessage")]),r=new Uint8Array(2048),i=n.encode({encodedSignaturesLength:new Uint8Array(e),signatures:this.signatures,serializedMessage:t},r);return r.slice(0,i)}static deserialize(t){let e=[...t];const n=[],r=$(e);for(let o=0;o<r;o++)n.push(new Uint8Array(e.splice(0,K)));const i=Q.deserialize(new Uint8Array(e));return new ot(i,n)}sign(t){const e=this.message.serialize(),n=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(const r of t){const t=n.findIndex((t=>t.equals(r.publicKey)));V(t>=0,`Cannot sign with non signer key ${r.publicKey.toBase58()}`),this.signatures[t]=S(e,r.secretKey)}}addSignature(t,e){V(64===e.byteLength,"Signature must be 64 bytes long");const n=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex((e=>e.equals(t)));V(n>=0,`Can not add signature; \`${t.toBase58()}\` is not required to sign this transaction`),this.signatures[n]=e}}const st=new C("SysvarC1ock11111111111111111111111111111111"),at=new C("SysvarEpochSchedu1e111111111111111111111111"),ct=new C("Sysvar1nstructions1111111111111111111111111"),ut=new C("SysvarRecentB1ockHashes11111111111111111111"),lt=new C("SysvarRent111111111111111111111111111111111"),dt=new C("SysvarRewards111111111111111111111111111111"),ht=new C("SysvarS1otHashes111111111111111111111111111"),ft=new C("SysvarS1otHistory11111111111111111111111111"),pt=new C("SysvarStakeHistory1111111111111111111111111");async function yt(t,e,n,r){const i=r&&{skipPreflight:r.skipPreflight,preflightCommitment:r.preflightCommitment||r.commitment,maxRetries:r.maxRetries,minContextSlot:r.minContextSlot},o=await t.sendTransaction(e,n,i),s=null!=e.recentBlockhash&&null!=e.lastValidBlockHeight?(await t.confirmTransaction({signature:o,blockhash:e.recentBlockhash,lastValidBlockHeight:e.lastValidBlockHeight},r&&r.commitment)).value:(await t.confirmTransaction(o,r&&r.commitment)).value;if(s.err)throw new Error(`Transaction ${o} failed (${JSON.stringify(s)})`);return o}function gt(t){return new Promise((e=>setTimeout(e,t)))}function mt(t,e){const n=t.layout.span>=0?t.layout.span:q(t,e),i=r.Buffer.alloc(n),o=Object.assign({instruction:t.index},e);return t.layout.encode(o,i),i}function bt(t,e){let n;try{n=t.layout.decode(e)}catch(r){throw new Error("invalid instruction; "+r)}if(n.instruction!==t.index)throw new Error(`invalid instruction; instruction index mismatch ${n.instruction} != ${t.index}`);return n}const wt=h.nu64("lamportsPerSignature"),kt=h.struct([h.u32("version"),h.u32("state"),F("authorizedPubkey"),F("nonce"),h.struct([wt],"feeCalculator")]),vt=kt.span;class It{constructor(t){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=t.authorizedPubkey,this.nonce=t.nonce,this.feeCalculator=t.feeCalculator}static fromAccountData(t){const e=kt.decode(T(t),0);return new It({authorizedPubkey:new C(e.authorizedPubkey),nonce:new C(e.nonce).toString(),feeCalculator:e.feeCalculator})}}const At=(_t=8,t=>{const e=(0,h.blob)(_t,t),{encode:n,decode:i}=(t=>({decode:t.decode.bind(t),encode:t.encode.bind(t)}))(e),o=e;return o.decode=(t,e)=>{const n=i(t,e);return(0,f.toBigIntLE)(r.Buffer.from(n))},o.encode=(t,e,r)=>{const i=(0,f.toBufferLE)(t,_t);return n(i,e,r)},o});var _t;class St{constructor(){}static decodeInstructionType(t){this.checkProgramId(t.programId);const e=h.u32("instruction").decode(t.data);let n;for(const[r,i]of Object.entries(Et))if(i.index==e){n=r;break}if(!n)throw new Error("Instruction type incorrect; not a SystemInstruction");return n}static decodeCreateAccount(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);const{lamports:e,space:n,programId:r}=bt(Et.Create,t.data);return{fromPubkey:t.keys[0].pubkey,newAccountPubkey:t.keys[1].pubkey,lamports:e,space:n,programId:new C(r)}}static decodeTransfer(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);const{lamports:e}=bt(Et.Transfer,t.data);return{fromPubkey:t.keys[0].pubkey,toPubkey:t.keys[1].pubkey,lamports:e}}static decodeTransferWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);const{lamports:e,seed:n,programId:r}=bt(Et.TransferWithSeed,t.data);return{fromPubkey:t.keys[0].pubkey,basePubkey:t.keys[1].pubkey,toPubkey:t.keys[2].pubkey,lamports:e,seed:n,programId:new C(r)}}static decodeAllocate(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,1);const{space:e}=bt(Et.Allocate,t.data);return{accountPubkey:t.keys[0].pubkey,space:e}}static decodeAllocateWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,1);const{base:e,seed:n,space:r,programId:i}=bt(Et.AllocateWithSeed,t.data);return{accountPubkey:t.keys[0].pubkey,basePubkey:new C(e),seed:n,space:r,programId:new C(i)}}static decodeAssign(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,1);const{programId:e}=bt(Et.Assign,t.data);return{accountPubkey:t.keys[0].pubkey,programId:new C(e)}}static decodeAssignWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,1);const{base:e,seed:n,programId:r}=bt(Et.AssignWithSeed,t.data);return{accountPubkey:t.keys[0].pubkey,basePubkey:new C(e),seed:n,programId:new C(r)}}static decodeCreateWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);const{base:e,seed:n,lamports:r,space:i,programId:o}=bt(Et.CreateWithSeed,t.data);return{fromPubkey:t.keys[0].pubkey,newAccountPubkey:t.keys[1].pubkey,basePubkey:new C(e),seed:n,lamports:r,space:i,programId:new C(o)}}static decodeNonceInitialize(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);const{authorized:e}=bt(Et.InitializeNonceAccount,t.data);return{noncePubkey:t.keys[0].pubkey,authorizedPubkey:new C(e)}}static decodeNonceAdvance(t){return this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3),bt(Et.AdvanceNonceAccount,t.data),{noncePubkey:t.keys[0].pubkey,authorizedPubkey:t.keys[2].pubkey}}static decodeNonceWithdraw(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,5);const{lamports:e}=bt(Et.WithdrawNonceAccount,t.data);return{noncePubkey:t.keys[0].pubkey,toPubkey:t.keys[1].pubkey,authorizedPubkey:t.keys[4].pubkey,lamports:e}}static decodeNonceAuthorize(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);const{authorized:e}=bt(Et.AuthorizeNonceAccount,t.data);return{noncePubkey:t.keys[0].pubkey,authorizedPubkey:t.keys[1].pubkey,newAuthorizedPubkey:new C(e)}}static checkProgramId(t){if(!t.equals(Tt.programId))throw new Error("invalid instruction; programId is not SystemProgram")}static checkKeyLength(t,e){if(t.length<e)throw new Error(`invalid instruction; found ${t.length} keys, expected at least ${e}`)}}const Et=Object.freeze({Create:{index:0,layout:h.struct([h.u32("instruction"),h.ns64("lamports"),h.ns64("space"),F("programId")])},Assign:{index:1,layout:h.struct([h.u32("instruction"),F("programId")])},Transfer:{index:2,layout:h.struct([h.u32("instruction"),At("lamports")])},CreateWithSeed:{index:3,layout:h.struct([h.u32("instruction"),F("base"),H("seed"),h.ns64("lamports"),h.ns64("space"),F("programId")])},AdvanceNonceAccount:{index:4,layout:h.struct([h.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:h.struct([h.u32("instruction"),h.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:h.struct([h.u32("instruction"),F("authorized")])},AuthorizeNonceAccount:{index:7,layout:h.struct([h.u32("instruction"),F("authorized")])},Allocate:{index:8,layout:h.struct([h.u32("instruction"),h.ns64("space")])},AllocateWithSeed:{index:9,layout:h.struct([h.u32("instruction"),F("base"),H("seed"),h.ns64("space"),F("programId")])},AssignWithSeed:{index:10,layout:h.struct([h.u32("instruction"),F("base"),H("seed"),F("programId")])},TransferWithSeed:{index:11,layout:h.struct([h.u32("instruction"),At("lamports"),H("seed"),F("programId")])},UpgradeNonceAccount:{index:12,layout:h.struct([h.u32("instruction")])}});class Tt{constructor(){}static createAccount(t){const e=mt(Et.Create,{lamports:t.lamports,space:t.space,programId:T(t.programId.toBuffer())});return new nt({keys:[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:e})}static transfer(t){let e,n;if("basePubkey"in t){e=mt(Et.TransferWithSeed,{lamports:BigInt(t.lamports),seed:t.seed,programId:T(t.programId.toBuffer())}),n=[{pubkey:t.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]}else{e=mt(Et.Transfer,{lamports:BigInt(t.lamports)}),n=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]}return new nt({keys:n,programId:this.programId,data:e})}static assign(t){let e,n;if("basePubkey"in t){e=mt(Et.AssignWithSeed,{base:T(t.basePubkey.toBuffer()),seed:t.seed,programId:T(t.programId.toBuffer())}),n=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]}else{e=mt(Et.Assign,{programId:T(t.programId.toBuffer())}),n=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]}return new nt({keys:n,programId:this.programId,data:e})}static createAccountWithSeed(t){const e=mt(Et.CreateWithSeed,{base:T(t.basePubkey.toBuffer()),seed:t.seed,lamports:t.lamports,space:t.space,programId:T(t.programId.toBuffer())});let n=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!1,isWritable:!0}];return t.basePubkey!=t.fromPubkey&&n.push({pubkey:t.basePubkey,isSigner:!0,isWritable:!1}),new nt({keys:n,programId:this.programId,data:e})}static createNonceAccount(t){const e=new rt;"basePubkey"in t&&"seed"in t?e.add(Tt.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:vt,programId:this.programId})):e.add(Tt.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,lamports:t.lamports,space:vt,programId:this.programId}));const n={noncePubkey:t.noncePubkey,authorizedPubkey:t.authorizedPubkey};return e.add(this.nonceInitialize(n)),e}static nonceInitialize(t){const e=mt(Et.InitializeNonceAccount,{authorized:T(t.authorizedPubkey.toBuffer())}),n={keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:ut,isSigner:!1,isWritable:!1},{pubkey:lt,isSigner:!1,isWritable:!1}],programId:this.programId,data:e};return new nt(n)}static nonceAdvance(t){const e=mt(Et.AdvanceNonceAccount),n={keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:ut,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e};return new nt(n)}static nonceWithdraw(t){const e=mt(Et.WithdrawNonceAccount,{lamports:t.lamports});return new nt({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0},{pubkey:ut,isSigner:!1,isWritable:!1},{pubkey:lt,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static nonceAuthorize(t){const e=mt(Et.AuthorizeNonceAccount,{authorized:T(t.newAuthorizedPubkey.toBuffer())});return new nt({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static allocate(t){let e,n;if("basePubkey"in t){e=mt(Et.AllocateWithSeed,{base:T(t.basePubkey.toBuffer()),seed:t.seed,space:t.space,programId:T(t.programId.toBuffer())}),n=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]}else{e=mt(Et.Allocate,{space:t.space}),n=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]}return new nt({keys:n,programId:this.programId,data:e})}}Tt.programId=new C("11111111111111111111111111111111");const xt=L-300;class Pt{constructor(){}static getMinNumSignatures(t){return 2*(Math.ceil(t/Pt.chunkSize)+1+1)}static async load(t,e,n,i,o){{const r=await t.getMinimumBalanceForRentExemption(o.length),s=await t.getAccountInfo(n.publicKey,"confirmed");let a=null;if(null!==s){if(s.executable)return console.error("Program load failed, account is already executable"),!1;s.data.length!==o.length&&(a=a||new rt,a.add(Tt.allocate({accountPubkey:n.publicKey,space:o.length}))),s.owner.equals(i)||(a=a||new rt,a.add(Tt.assign({accountPubkey:n.publicKey,programId:i}))),s.lamports<r&&(a=a||new rt,a.add(Tt.transfer({fromPubkey:e.publicKey,toPubkey:n.publicKey,lamports:r-s.lamports})))}else a=(new rt).add(Tt.createAccount({fromPubkey:e.publicKey,newAccountPubkey:n.publicKey,lamports:r>0?r:1,space:o.length,programId:i}));null!==a&&await yt(t,a,[e,n],{commitment:"confirmed"})}const s=h.struct([h.u32("instruction"),h.u32("offset"),h.u32("bytesLength"),h.u32("bytesLengthPadding"),h.seq(h.u8("byte"),h.offset(h.u32(),-8),"bytes")]),a=Pt.chunkSize;let c=0,u=o,l=[];for(;u.length>0;){const o=u.slice(0,a),d=r.Buffer.alloc(a+16);s.encode({instruction:0,offset:c,bytes:o,bytesLength:0,bytesLengthPadding:0},d);const h=(new rt).add({keys:[{pubkey:n.publicKey,isSigner:!0,isWritable:!0}],programId:i,data:d});if(l.push(yt(t,h,[e,n],{commitment:"confirmed"})),t._rpcEndpoint.includes("solana.com")){const t=4;await gt(1e3/t)}c+=a,u=u.slice(a)}await Promise.all(l);{const o=h.struct([h.u32("instruction")]),s=r.Buffer.alloc(o.span);o.encode({instruction:1},s);const a=(new rt).add({keys:[{pubkey:n.publicKey,isSigner:!0,isWritable:!0},{pubkey:lt,isSigner:!1,isWritable:!1}],programId:i,data:s});await yt(t,a,[e,n],{commitment:"confirmed"})}return!0}}Pt.chunkSize=xt;const Bt=new C("BPFLoader2111111111111111111111111111111111");class Ot{static getMinNumSignatures(t){return Pt.getMinNumSignatures(t)}static load(t,e,n,r,i){return Pt.load(t,e,n,i,r)}}var Rt=Object.prototype.toString,Mt=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};function Ct(t,e){var n,r,i,o,s,a,c;if(!0===t)return"true";if(!1===t)return"false";switch(typeof t){case"object":if(null===t)return null;if(t.toJSON&&"function"==typeof t.toJSON)return Ct(t.toJSON(),e);if("[object Array]"===(c=Rt.call(t))){for(i="[",r=t.length-1,n=0;n<r;n++)i+=Ct(t[n],!0)+",";return r>-1&&(i+=Ct(t[n],!0)),i+"]"}if("[object Object]"===c){for(r=(o=Mt(t).sort()).length,i="",n=0;n<r;)void 0!==(a=Ct(t[s=o[n]],!1))&&(i&&(i+=","),i+=JSON.stringify(s)+":"+a),n++;return"{"+i+"}"}return JSON.stringify(t);case"function":case"undefined":return e?null:void 0;case"string":return JSON.stringify(t);default:return isFinite(t)?t:null}}var Ut=function(t){var e=Ct(t,!1);if(void 0!==e)return""+e};function Nt(t){let e=0;for(;t>1;)t/=2,e++;return e}class Lt{constructor(t,e,n,r,i){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=t,this.leaderScheduleSlotOffset=e,this.warmup=n,this.firstNormalEpoch=r,this.firstNormalSlot=i}getEpoch(t){return this.getEpochAndSlotIndex(t)[0]}getEpochAndSlotIndex(t){if(t<this.firstNormalSlot){const n=Nt(0===(e=t+32+1)?1:(e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,1+(e|=e>>32)))-Nt(32)-1;return[n,t-(this.getSlotsInEpoch(n)-32)]}{const e=t-this.firstNormalSlot,n=Math.floor(e/this.slotsPerEpoch);return[this.firstNormalEpoch+n,e%this.slotsPerEpoch]}var e}getFirstSlotInEpoch(t){return t<=this.firstNormalEpoch?32*(Math.pow(2,t)-1):(t-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(t){return this.getFirstSlotInEpoch(t)+this.getSlotsInEpoch(t)-1}getSlotsInEpoch(t){return t<this.firstNormalEpoch?Math.pow(2,t+Nt(32)):this.slotsPerEpoch}}class zt extends Error{constructor(t,e){super(t),this.logs=void 0,this.logs=e}}const Kt={JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP:-32001,JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE:-32002,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE:-32003,JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE:-32004,JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY:-32005,JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE:-32006,JSON_RPC_SERVER_ERROR_SLOT_SKIPPED:-32007,JSON_RPC_SERVER_ERROR_NO_SNAPSHOT:-32008,JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED:-32009,JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX:-32010,JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE:-32011,JSON_RPC_SCAN_ERROR:-32012,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH:-32013,JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET:-32014,JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION:-32015,JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED:-32016};class Dt extends Error{constructor({code:t,message:e,data:n},r){super(null!=r?`${r}: ${e}`:e),this.code=void 0,this.data=void 0,this.code=t,this.data=n,this.name="SolanaJSONRPCError"}}var jt=globalThis.fetch;class Wt{constructor(t){this.key=void 0,this.state=void 0,this.key=t.key,this.state=t.state}isActive(){const t=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===t}static deserialize(t){const e=function(t,e){let n;try{n=t.layout.decode(e)}catch(r){throw new Error("invalid instruction; "+r)}if(n.typeIndex!==t.index)throw new Error(`invalid account data; account type mismatch ${n.typeIndex} != ${t.index}`);return n}(Ft,t),n=t.length-56;V(n>=0,"lookup table is invalid"),V(n%32==0,"lookup table is invalid");const r=n/32,{addresses:i}=h.struct([h.seq(F(),r,"addresses")]).decode(t.slice(56));return{deactivationSlot:e.deactivationSlot,lastExtendedSlot:e.lastExtendedSlot,lastExtendedSlotStartIndex:e.lastExtendedStartIndex,authority:0!==e.authority.length?new C(e.authority[0]):void 0,addresses:i.map((t=>new C(t)))}}}const Ft={index:1,layout:h.struct([h.u32("typeIndex"),At("deactivationSlot"),h.nu64("lastExtendedSlot"),h.u8("lastExtendedStartIndex"),h.u8(),h.seq(F(),h.offset(h.u8(),-1),"authority")])},Gt=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;var Ht;const qt=(0,p.oQ)((0,p.eE)(C),(0,p.Z_)(),(t=>new C(t))),$t=(0,p.bc)([(0,p.Z_)(),(0,p.i0)("base64")]),Zt=(0,p.oQ)((0,p.eE)(r.Buffer),$t,(t=>r.Buffer.from(t[0],"base64"))),Vt=3e4;function Xt(t){let e,n;if("string"==typeof t)e=t;else if(t){const{commitment:r,...i}=t;e=r,n=i}return{commitment:e,config:n}}function Jt(t){return(0,p.G0)([(0,p.dt)({jsonrpc:(0,p.i0)("2.0"),id:(0,p.Z_)(),result:t}),(0,p.dt)({jsonrpc:(0,p.i0)("2.0"),id:(0,p.Z_)(),error:(0,p.dt)({code:(0,p._4)(),message:(0,p.Z_)(),data:(0,p.jt)((0,p.Yj)())})})])}const Yt=Jt((0,p._4)());function Qt(t){return(0,p.oQ)(Jt(t),Yt,(e=>"error"in e?e:{...e,result:(0,p.Ue)(e.result,t)}))}function te(t){return Qt((0,p.dt)({context:(0,p.dt)({slot:(0,p.Rx)()}),value:t}))}function ee(t){return(0,p.dt)({context:(0,p.dt)({slot:(0,p.Rx)()}),value:t})}function ne(t,e){return 0===t?new Y({header:e.header,staticAccountKeys:e.accountKeys.map((t=>new C(t))),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map((t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:u().decode(t.data)}))),addressTableLookups:e.addressTableLookups}):new J(e)}const re=(0,p.dt)({foundation:(0,p.Rx)(),foundationTerm:(0,p.Rx)(),initial:(0,p.Rx)(),taper:(0,p.Rx)(),terminal:(0,p.Rx)()}),ie=Qt((0,p.IX)((0,p.AG)((0,p.dt)({epoch:(0,p.Rx)(),effectiveSlot:(0,p.Rx)(),amount:(0,p.Rx)(),postBalance:(0,p.Rx)()})))),oe=(0,p.dt)({epoch:(0,p.Rx)(),slotIndex:(0,p.Rx)(),slotsInEpoch:(0,p.Rx)(),absoluteSlot:(0,p.Rx)(),blockHeight:(0,p.jt)((0,p.Rx)()),transactionCount:(0,p.jt)((0,p.Rx)())}),se=(0,p.dt)({slotsPerEpoch:(0,p.Rx)(),leaderScheduleSlotOffset:(0,p.Rx)(),warmup:(0,p.O7)(),firstNormalEpoch:(0,p.Rx)(),firstNormalSlot:(0,p.Rx)()}),ae=(0,p.IM)((0,p.Z_)(),(0,p.IX)((0,p.Rx)())),ce=(0,p.AG)((0,p.G0)([(0,p.dt)({}),(0,p.Z_)()])),ue=(0,p.dt)({err:ce}),le=(0,p.i0)("receivedSignature"),de=(0,p.dt)({"solana-core":(0,p.Z_)(),"feature-set":(0,p.jt)((0,p.Rx)())}),he=te((0,p.dt)({err:(0,p.AG)((0,p.G0)([(0,p.dt)({}),(0,p.Z_)()])),logs:(0,p.AG)((0,p.IX)((0,p.Z_)())),accounts:(0,p.jt)((0,p.AG)((0,p.IX)((0,p.AG)((0,p.dt)({executable:(0,p.O7)(),owner:(0,p.Z_)(),lamports:(0,p.Rx)(),data:(0,p.IX)((0,p.Z_)()),rentEpoch:(0,p.jt)((0,p.Rx)())}))))),unitsConsumed:(0,p.jt)((0,p.Rx)()),returnData:(0,p.jt)((0,p.AG)((0,p.dt)({programId:(0,p.Z_)(),data:(0,p.bc)([(0,p.Z_)(),(0,p.i0)("base64")])})))})),fe=te((0,p.dt)({byIdentity:(0,p.IM)((0,p.Z_)(),(0,p.IX)((0,p.Rx)())),range:(0,p.dt)({firstSlot:(0,p.Rx)(),lastSlot:(0,p.Rx)()})}));const pe=Qt(re),ye=Qt(oe),ge=Qt(se),me=Qt(ae),be=Qt((0,p.Rx)()),we=te((0,p.dt)({total:(0,p.Rx)(),circulating:(0,p.Rx)(),nonCirculating:(0,p.Rx)(),nonCirculatingAccounts:(0,p.IX)(qt)})),ke=(0,p.dt)({amount:(0,p.Z_)(),uiAmount:(0,p.AG)((0,p.Rx)()),decimals:(0,p.Rx)(),uiAmountString:(0,p.jt)((0,p.Z_)())}),ve=te((0,p.IX)((0,p.dt)({address:qt,amount:(0,p.Z_)(),uiAmount:(0,p.AG)((0,p.Rx)()),decimals:(0,p.Rx)(),uiAmountString:(0,p.jt)((0,p.Z_)())}))),Ie=te((0,p.IX)((0,p.dt)({pubkey:qt,account:(0,p.dt)({executable:(0,p.O7)(),owner:qt,lamports:(0,p.Rx)(),data:Zt,rentEpoch:(0,p.Rx)()})}))),Ae=(0,p.dt)({program:(0,p.Z_)(),parsed:(0,p._4)(),space:(0,p.Rx)()}),_e=te((0,p.IX)((0,p.dt)({pubkey:qt,account:(0,p.dt)({executable:(0,p.O7)(),owner:qt,lamports:(0,p.Rx)(),data:Ae,rentEpoch:(0,p.Rx)()})}))),Se=te((0,p.IX)((0,p.dt)({lamports:(0,p.Rx)(),address:qt}))),Ee=(0,p.dt)({executable:(0,p.O7)(),owner:qt,lamports:(0,p.Rx)(),data:Zt,rentEpoch:(0,p.Rx)()}),Te=(0,p.dt)({pubkey:qt,account:Ee}),xe=(0,p.oQ)((0,p.G0)([(0,p.eE)(r.Buffer),Ae]),(0,p.G0)([$t,Ae]),(t=>Array.isArray(t)?(0,p.Ue)(t,Zt):t)),Pe=(0,p.dt)({executable:(0,p.O7)(),owner:qt,lamports:(0,p.Rx)(),data:xe,rentEpoch:(0,p.Rx)()}),Be=(0,p.dt)({pubkey:qt,account:Pe}),Oe=(0,p.dt)({state:(0,p.G0)([(0,p.i0)("active"),(0,p.i0)("inactive"),(0,p.i0)("activating"),(0,p.i0)("deactivating")]),active:(0,p.Rx)(),inactive:(0,p.Rx)()}),Re=Qt((0,p.IX)((0,p.dt)({signature:(0,p.Z_)(),slot:(0,p.Rx)(),err:ce,memo:(0,p.AG)((0,p.Z_)()),blockTime:(0,p.jt)((0,p.AG)((0,p.Rx)()))}))),Me=Qt((0,p.IX)((0,p.dt)({signature:(0,p.Z_)(),slot:(0,p.Rx)(),err:ce,memo:(0,p.AG)((0,p.Z_)()),blockTime:(0,p.jt)((0,p.AG)((0,p.Rx)()))}))),Ce=(0,p.dt)({subscription:(0,p.Rx)(),result:ee(Ee)}),Ue=(0,p.dt)({pubkey:qt,account:Ee}),Ne=(0,p.dt)({subscription:(0,p.Rx)(),result:ee(Ue)}),Le=(0,p.dt)({parent:(0,p.Rx)(),slot:(0,p.Rx)(),root:(0,p.Rx)()}),ze=(0,p.dt)({subscription:(0,p.Rx)(),result:Le}),Ke=(0,p.G0)([(0,p.dt)({type:(0,p.G0)([(0,p.i0)("firstShredReceived"),(0,p.i0)("completed"),(0,p.i0)("optimisticConfirmation"),(0,p.i0)("root")]),slot:(0,p.Rx)(),timestamp:(0,p.Rx)()}),(0,p.dt)({type:(0,p.i0)("createdBank"),parent:(0,p.Rx)(),slot:(0,p.Rx)(),timestamp:(0,p.Rx)()}),(0,p.dt)({type:(0,p.i0)("frozen"),slot:(0,p.Rx)(),timestamp:(0,p.Rx)(),stats:(0,p.dt)({numTransactionEntries:(0,p.Rx)(),numSuccessfulTransactions:(0,p.Rx)(),numFailedTransactions:(0,p.Rx)(),maxTransactionsPerEntry:(0,p.Rx)()})}),(0,p.dt)({type:(0,p.i0)("dead"),slot:(0,p.Rx)(),timestamp:(0,p.Rx)(),err:(0,p.Z_)()})]),De=(0,p.dt)({subscription:(0,p.Rx)(),result:Ke}),je=(0,p.dt)({subscription:(0,p.Rx)(),result:ee((0,p.G0)([ue,le]))}),We=(0,p.dt)({subscription:(0,p.Rx)(),result:(0,p.Rx)()}),Fe=(0,p.dt)({pubkey:(0,p.Z_)(),gossip:(0,p.AG)((0,p.Z_)()),tpu:(0,p.AG)((0,p.Z_)()),rpc:(0,p.AG)((0,p.Z_)()),version:(0,p.AG)((0,p.Z_)())}),Ge=(0,p.dt)({votePubkey:(0,p.Z_)(),nodePubkey:(0,p.Z_)(),activatedStake:(0,p.Rx)(),epochVoteAccount:(0,p.O7)(),epochCredits:(0,p.IX)((0,p.bc)([(0,p.Rx)(),(0,p.Rx)(),(0,p.Rx)()])),commission:(0,p.Rx)(),lastVote:(0,p.Rx)(),rootSlot:(0,p.AG)((0,p.Rx)())}),He=Qt((0,p.dt)({current:(0,p.IX)(Ge),delinquent:(0,p.IX)(Ge)})),qe=(0,p.G0)([(0,p.i0)("processed"),(0,p.i0)("confirmed"),(0,p.i0)("finalized")]),$e=(0,p.dt)({slot:(0,p.Rx)(),confirmations:(0,p.AG)((0,p.Rx)()),err:ce,confirmationStatus:(0,p.jt)(qe)}),Ze=te((0,p.IX)((0,p.AG)($e))),Ve=Qt((0,p.Rx)()),Xe=(0,p.dt)({accountKey:qt,writableIndexes:(0,p.IX)((0,p.Rx)()),readonlyIndexes:(0,p.IX)((0,p.Rx)())}),Je=(0,p.dt)({signatures:(0,p.IX)((0,p.Z_)()),message:(0,p.dt)({accountKeys:(0,p.IX)((0,p.Z_)()),header:(0,p.dt)({numRequiredSignatures:(0,p.Rx)(),numReadonlySignedAccounts:(0,p.Rx)(),numReadonlyUnsignedAccounts:(0,p.Rx)()}),instructions:(0,p.IX)((0,p.dt)({accounts:(0,p.IX)((0,p.Rx)()),data:(0,p.Z_)(),programIdIndex:(0,p.Rx)()})),recentBlockhash:(0,p.Z_)(),addressTableLookups:(0,p.jt)((0,p.IX)(Xe))})}),Ye=(0,p.dt)({parsed:(0,p._4)(),program:(0,p.Z_)(),programId:qt}),Qe=(0,p.dt)({accounts:(0,p.IX)(qt),data:(0,p.Z_)(),programId:qt}),tn=(0,p.G0)([Qe,Ye]),en=(0,p.G0)([(0,p.dt)({parsed:(0,p._4)(),program:(0,p.Z_)(),programId:(0,p.Z_)()}),(0,p.dt)({accounts:(0,p.IX)((0,p.Z_)()),data:(0,p.Z_)(),programId:(0,p.Z_)()})]),nn=(0,p.oQ)(tn,en,(t=>"accounts"in t?(0,p.Ue)(t,Qe):(0,p.Ue)(t,Ye))),rn=(0,p.dt)({signatures:(0,p.IX)((0,p.Z_)()),message:(0,p.dt)({accountKeys:(0,p.IX)((0,p.dt)({pubkey:qt,signer:(0,p.O7)(),writable:(0,p.O7)(),source:(0,p.jt)((0,p.G0)([(0,p.i0)("transaction"),(0,p.i0)("lookupTable")]))})),instructions:(0,p.IX)(nn),recentBlockhash:(0,p.Z_)(),addressTableLookups:(0,p.jt)((0,p.AG)((0,p.IX)(Xe)))})}),on=(0,p.dt)({accountIndex:(0,p.Rx)(),mint:(0,p.Z_)(),owner:(0,p.jt)((0,p.Z_)()),uiTokenAmount:ke}),sn=(0,p.dt)({writable:(0,p.IX)(qt),readonly:(0,p.IX)(qt)}),an=(0,p.dt)({err:ce,fee:(0,p.Rx)(),innerInstructions:(0,p.jt)((0,p.AG)((0,p.IX)((0,p.dt)({index:(0,p.Rx)(),instructions:(0,p.IX)((0,p.dt)({accounts:(0,p.IX)((0,p.Rx)()),data:(0,p.Z_)(),programIdIndex:(0,p.Rx)()}))})))),preBalances:(0,p.IX)((0,p.Rx)()),postBalances:(0,p.IX)((0,p.Rx)()),logMessages:(0,p.jt)((0,p.AG)((0,p.IX)((0,p.Z_)()))),preTokenBalances:(0,p.jt)((0,p.AG)((0,p.IX)(on))),postTokenBalances:(0,p.jt)((0,p.AG)((0,p.IX)(on))),loadedAddresses:(0,p.jt)(sn),computeUnitsConsumed:(0,p.jt)((0,p.Rx)())}),cn=(0,p.dt)({err:ce,fee:(0,p.Rx)(),innerInstructions:(0,p.jt)((0,p.AG)((0,p.IX)((0,p.dt)({index:(0,p.Rx)(),instructions:(0,p.IX)(nn)})))),preBalances:(0,p.IX)((0,p.Rx)()),postBalances:(0,p.IX)((0,p.Rx)()),logMessages:(0,p.jt)((0,p.AG)((0,p.IX)((0,p.Z_)()))),preTokenBalances:(0,p.jt)((0,p.AG)((0,p.IX)(on))),postTokenBalances:(0,p.jt)((0,p.AG)((0,p.IX)(on))),loadedAddresses:(0,p.jt)(sn),computeUnitsConsumed:(0,p.jt)((0,p.Rx)())}),un=(0,p.G0)([(0,p.i0)(0),(0,p.i0)("legacy")]),ln=Qt((0,p.AG)((0,p.dt)({blockhash:(0,p.Z_)(),previousBlockhash:(0,p.Z_)(),parentSlot:(0,p.Rx)(),transactions:(0,p.IX)((0,p.dt)({transaction:Je,meta:(0,p.AG)(an),version:(0,p.jt)(un)})),rewards:(0,p.jt)((0,p.IX)((0,p.dt)({pubkey:(0,p.Z_)(),lamports:(0,p.Rx)(),postBalance:(0,p.AG)((0,p.Rx)()),rewardType:(0,p.AG)((0,p.Z_)())}))),blockTime:(0,p.AG)((0,p.Rx)()),blockHeight:(0,p.AG)((0,p.Rx)())}))),dn=Qt((0,p.AG)((0,p.dt)({blockhash:(0,p.Z_)(),previousBlockhash:(0,p.Z_)(),parentSlot:(0,p.Rx)(),transactions:(0,p.IX)((0,p.dt)({transaction:Je,meta:(0,p.AG)(an)})),rewards:(0,p.jt)((0,p.IX)((0,p.dt)({pubkey:(0,p.Z_)(),lamports:(0,p.Rx)(),postBalance:(0,p.AG)((0,p.Rx)()),rewardType:(0,p.AG)((0,p.Z_)())}))),blockTime:(0,p.AG)((0,p.Rx)())}))),hn=Qt((0,p.AG)((0,p.dt)({blockhash:(0,p.Z_)(),previousBlockhash:(0,p.Z_)(),parentSlot:(0,p.Rx)(),signatures:(0,p.IX)((0,p.Z_)()),blockTime:(0,p.AG)((0,p.Rx)())}))),fn=Qt((0,p.AG)((0,p.dt)({slot:(0,p.Rx)(),meta:an,blockTime:(0,p.jt)((0,p.AG)((0,p.Rx)())),transaction:Je,version:(0,p.jt)(un)}))),pn=Qt((0,p.AG)((0,p.dt)({slot:(0,p.Rx)(),transaction:rn,meta:(0,p.AG)(cn),blockTime:(0,p.jt)((0,p.AG)((0,p.Rx)())),version:(0,p.jt)(un)}))),yn=te((0,p.dt)({blockhash:(0,p.Z_)(),feeCalculator:(0,p.dt)({lamportsPerSignature:(0,p.Rx)()})})),gn=te((0,p.dt)({blockhash:(0,p.Z_)(),lastValidBlockHeight:(0,p.Rx)()})),mn=(0,p.dt)({slot:(0,p.Rx)(),numTransactions:(0,p.Rx)(),numSlots:(0,p.Rx)(),samplePeriodSecs:(0,p.Rx)()}),bn=Qt((0,p.IX)(mn)),wn=te((0,p.AG)((0,p.dt)({feeCalculator:(0,p.dt)({lamportsPerSignature:(0,p.Rx)()})}))),kn=Qt((0,p.Z_)()),vn=Qt((0,p.Z_)()),In=(0,p.dt)({err:ce,logs:(0,p.IX)((0,p.Z_)()),signature:(0,p.Z_)()}),An=(0,p.dt)({result:ee(In),subscription:(0,p.Rx)()}),_n={"solana-client":`js/${null!==(Ht="0.0.0-development")?Ht:"UNKNOWN"}`};class Sn{constructor(t,e){let n,r,i,o,s;var a;this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,e&&"string"==typeof e?this._commitment=e:e&&(this._commitment=e.commitment,this._confirmTransactionInitialTimeout=e.confirmTransactionInitialTimeout,n=e.wsEndpoint,r=e.httpHeaders,i=e.fetch,o=e.fetchMiddleware,s=e.disableRetryOnRateLimit),this._rpcEndpoint=function(t){if(!1===/^https?:/.test(t))throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return t}(t),this._rpcWsEndpoint=n||function(t){const e=t.match(Gt);if(null==e)throw TypeError(`Failed to validate endpoint URL \`${t}\``);const[n,r,i,o]=e,s=t.startsWith("https:")?"wss:":"ws:",a=null==i?null:parseInt(i.slice(1),10);return`${s}//${r}${null==a?"":`:${a+1}`}${o}`}(t),this._rpcClient=function(t,e,n,r,i){const o=n||jt;let s;return r&&(s=async(t,e)=>{const n=await new Promise(((n,i)=>{try{r(t,e,((t,e)=>n([t,e])))}catch(o){i(o)}}));return await o(...n)}),new(m())((async(n,r)=>{const a={method:"POST",body:n,agent:void 0,headers:Object.assign({"Content-Type":"application/json"},e||{},_n)};try{let e,n=5,c=500;for(;e=s?await s(t,a):await o(t,a),429===e.status&&!0!==i&&(n-=1,0!==n);)console.log(`Server responded with ${e.status} ${e.statusText}. Retrying after ${c}ms delay...`),await gt(c),c*=2;const u=await e.text();e.ok?r(null,u):r(new Error(`${e.status} ${e.statusText}: ${u}`))}catch(c){c instanceof Error&&r(c)}}),{})}(t,r,i,o,s),this._rpcRequest=(a=this._rpcClient,(t,e)=>new Promise(((n,r)=>{a.request(t,e,((t,e)=>{t?r(t):n(e)}))}))),this._rpcBatchRequest=function(t){return e=>new Promise(((n,r)=>{0===e.length&&n([]);const i=e.map((e=>t.request(e.methodName,e.args)));t.request(i,((t,e)=>{t?r(t):n(e)}))}))}(this._rpcClient),this._rpcWebSocket=new y.K(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(t,e){const{commitment:n,config:r}=Xt(e),i=this._buildArgs([t.toBase58()],n,void 0,r),o=await this._rpcRequest("getBalance",i),s=(0,p.Ue)(o,te((0,p.Rx)()));if("error"in s)throw new Dt(s.error,`failed to get balance for ${t.toBase58()}`);return s.result}async getBalance(t,e){return await this.getBalanceAndContext(t,e).then((t=>t.value)).catch((e=>{throw new Error("failed to get balance of account "+t.toBase58()+": "+e)}))}async getBlockTime(t){const e=await this._rpcRequest("getBlockTime",[t]),n=(0,p.Ue)(e,Qt((0,p.AG)((0,p.Rx)())));if("error"in n)throw new Dt(n.error,`failed to get block time for slot ${t}`);return n.result}async getMinimumLedgerSlot(){const t=await this._rpcRequest("minimumLedgerSlot",[]),e=(0,p.Ue)(t,Qt((0,p.Rx)()));if("error"in e)throw new Dt(e.error,"failed to get minimum ledger slot");return e.result}async getFirstAvailableBlock(){const t=await this._rpcRequest("getFirstAvailableBlock",[]),e=(0,p.Ue)(t,be);if("error"in e)throw new Dt(e.error,"failed to get first available block");return e.result}async getSupply(t){let e={};e="string"==typeof t?{commitment:t}:t?{...t,commitment:t&&t.commitment||this.commitment}:{commitment:this.commitment};const n=await this._rpcRequest("getSupply",[e]),r=(0,p.Ue)(n,we);if("error"in r)throw new Dt(r.error,"failed to get supply");return r.result}async getTokenSupply(t,e){const n=this._buildArgs([t.toBase58()],e),r=await this._rpcRequest("getTokenSupply",n),i=(0,p.Ue)(r,te(ke));if("error"in i)throw new Dt(i.error,"failed to get token supply");return i.result}async getTokenAccountBalance(t,e){const n=this._buildArgs([t.toBase58()],e),r=await this._rpcRequest("getTokenAccountBalance",n),i=(0,p.Ue)(r,te(ke));if("error"in i)throw new Dt(i.error,"failed to get token account balance");return i.result}async getTokenAccountsByOwner(t,e,n){const{commitment:r,config:i}=Xt(n);let o=[t.toBase58()];"mint"in e?o.push({mint:e.mint.toBase58()}):o.push({programId:e.programId.toBase58()});const s=this._buildArgs(o,r,"base64",i),a=await this._rpcRequest("getTokenAccountsByOwner",s),c=(0,p.Ue)(a,Ie);if("error"in c)throw new Dt(c.error,`failed to get token accounts owned by account ${t.toBase58()}`);return c.result}async getParsedTokenAccountsByOwner(t,e,n){let r=[t.toBase58()];"mint"in e?r.push({mint:e.mint.toBase58()}):r.push({programId:e.programId.toBase58()});const i=this._buildArgs(r,n,"jsonParsed"),o=await this._rpcRequest("getTokenAccountsByOwner",i),s=(0,p.Ue)(o,_e);if("error"in s)throw new Dt(s.error,`failed to get token accounts owned by account ${t.toBase58()}`);return s.result}async getLargestAccounts(t){const e={...t,commitment:t&&t.commitment||this.commitment},n=e.filter||e.commitment?[e]:[],r=await this._rpcRequest("getLargestAccounts",n),i=(0,p.Ue)(r,Se);if("error"in i)throw new Dt(i.error,"failed to get largest accounts");return i.result}async getTokenLargestAccounts(t,e){const n=this._buildArgs([t.toBase58()],e),r=await this._rpcRequest("getTokenLargestAccounts",n),i=(0,p.Ue)(r,ve);if("error"in i)throw new Dt(i.error,"failed to get token largest accounts");return i.result}async getAccountInfoAndContext(t,e){const{commitment:n,config:r}=Xt(e),i=this._buildArgs([t.toBase58()],n,"base64",r),o=await this._rpcRequest("getAccountInfo",i),s=(0,p.Ue)(o,te((0,p.AG)(Ee)));if("error"in s)throw new Dt(s.error,`failed to get info about account ${t.toBase58()}`);return s.result}async getParsedAccountInfo(t,e){const{commitment:n,config:r}=Xt(e),i=this._buildArgs([t.toBase58()],n,"jsonParsed",r),o=await this._rpcRequest("getAccountInfo",i),s=(0,p.Ue)(o,te((0,p.AG)(Pe)));if("error"in s)throw new Dt(s.error,`failed to get info about account ${t.toBase58()}`);return s.result}async getAccountInfo(t,e){try{return(await this.getAccountInfoAndContext(t,e)).value}catch(n){throw new Error("failed to get info about account "+t.toBase58()+": "+n)}}async getMultipleAccountsInfoAndContext(t,e){const{commitment:n,config:r}=Xt(e),i=t.map((t=>t.toBase58())),o=this._buildArgs([i],n,"base64",r),s=await this._rpcRequest("getMultipleAccounts",o),a=(0,p.Ue)(s,te((0,p.IX)((0,p.AG)(Ee))));if("error"in a)throw new Dt(a.error,`failed to get info for accounts ${i}`);return a.result}async getMultipleAccountsInfo(t,e){return(await this.getMultipleAccountsInfoAndContext(t,e)).value}async getStakeActivation(t,e,n){const{commitment:r,config:i}=Xt(e),o=this._buildArgs([t.toBase58()],r,void 0,{...i,epoch:null!=n?n:null==i?void 0:i.epoch}),s=await this._rpcRequest("getStakeActivation",o),a=(0,p.Ue)(s,Qt(Oe));if("error"in a)throw new Dt(a.error,`failed to get Stake Activation ${t.toBase58()}`);return a.result}async getProgramAccounts(t,e){const{commitment:n,config:r}=Xt(e),{encoding:i,...o}=r||{},s=this._buildArgs([t.toBase58()],n,i||"base64",o),a=await this._rpcRequest("getProgramAccounts",s),c=(0,p.Ue)(a,Qt((0,p.IX)(Te)));if("error"in c)throw new Dt(c.error,`failed to get accounts owned by program ${t.toBase58()}`);return c.result}async getParsedProgramAccounts(t,e){const{commitment:n,config:r}=Xt(e),i=this._buildArgs([t.toBase58()],n,"jsonParsed",r),o=await this._rpcRequest("getProgramAccounts",i),s=(0,p.Ue)(o,Qt((0,p.IX)(Be)));if("error"in s)throw new Dt(s.error,`failed to get accounts owned by program ${t.toBase58()}`);return s.result}async confirmTransaction(t,e){let n,r;if("string"==typeof t)n=t;else{n=t.signature}try{r=u().decode(n)}catch(h){throw new Error("signature must be base58 encoded: "+n)}V(64===r.length,"signature has invalid length");const i=e||this.commitment;let o,s,a=!1;const c=new Promise(((t,e)=>{try{s=this.onSignature(n,((e,n)=>{s=void 0;const r={context:n,value:e};a=!0,t({__type:tt.PROCESSED,response:r})}),i)}catch(h){e(h)}})),l=new Promise((n=>{if("string"==typeof t){let t=this._confirmTransactionInitialTimeout||6e4;switch(i){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":t=this._confirmTransactionInitialTimeout||3e4}o=setTimeout((()=>n({__type:tt.TIMED_OUT,timeoutMs:t})),t)}else{let r=t;const i=async()=>{try{return await this.getBlockHeight(e)}catch(t){return-1}};(async()=>{let t=await i();if(!a){for(;t<=r.lastValidBlockHeight;){if(await gt(1e3),a)return;if(t=await i(),a)return}n({__type:tt.BLOCKHEIGHT_EXCEEDED})}})()}}));let d;try{const t=await Promise.race([c,l]);switch(t.__type){case tt.BLOCKHEIGHT_EXCEEDED:throw new D(n);case tt.PROCESSED:d=t.response;break;case tt.TIMED_OUT:throw new j(n,t.timeoutMs/1e3)}}finally{clearTimeout(o),s&&this.removeSignatureListener(s)}return d}async getClusterNodes(){const t=await this._rpcRequest("getClusterNodes",[]),e=(0,p.Ue)(t,Qt((0,p.IX)(Fe)));if("error"in e)throw new Dt(e.error,"failed to get cluster nodes");return e.result}async getVoteAccounts(t){const e=this._buildArgs([],t),n=await this._rpcRequest("getVoteAccounts",e),r=(0,p.Ue)(n,He);if("error"in r)throw new Dt(r.error,"failed to get vote accounts");return r.result}async getSlot(t){const{commitment:e,config:n}=Xt(t),r=this._buildArgs([],e,void 0,n),i=await this._rpcRequest("getSlot",r),o=(0,p.Ue)(i,Qt((0,p.Rx)()));if("error"in o)throw new Dt(o.error,"failed to get slot");return o.result}async getSlotLeader(t){const{commitment:e,config:n}=Xt(t),r=this._buildArgs([],e,void 0,n),i=await this._rpcRequest("getSlotLeader",r),o=(0,p.Ue)(i,Qt((0,p.Z_)()));if("error"in o)throw new Dt(o.error,"failed to get slot leader");return o.result}async getSlotLeaders(t,e){const n=[t,e],r=await this._rpcRequest("getSlotLeaders",n),i=(0,p.Ue)(r,Qt((0,p.IX)(qt)));if("error"in i)throw new Dt(i.error,"failed to get slot leaders");return i.result}async getSignatureStatus(t,e){const{context:n,value:r}=await this.getSignatureStatuses([t],e);V(1===r.length);return{context:n,value:r[0]}}async getSignatureStatuses(t,e){const n=[t];e&&n.push(e);const r=await this._rpcRequest("getSignatureStatuses",n),i=(0,p.Ue)(r,Ze);if("error"in i)throw new Dt(i.error,"failed to get signature status");return i.result}async getTransactionCount(t){const{commitment:e,config:n}=Xt(t),r=this._buildArgs([],e,void 0,n),i=await this._rpcRequest("getTransactionCount",r),o=(0,p.Ue)(i,Qt((0,p.Rx)()));if("error"in o)throw new Dt(o.error,"failed to get transaction count");return o.result}async getTotalSupply(t){return(await this.getSupply({commitment:t,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(t){const e=this._buildArgs([],t),n=await this._rpcRequest("getInflationGovernor",e),r=(0,p.Ue)(n,pe);if("error"in r)throw new Dt(r.error,"failed to get inflation");return r.result}async getInflationReward(t,e,n){const{commitment:r,config:i}=Xt(n),o=this._buildArgs([t.map((t=>t.toBase58()))],r,void 0,{...i,epoch:null!=e?e:null==i?void 0:i.epoch}),s=await this._rpcRequest("getInflationReward",o),a=(0,p.Ue)(s,ie);if("error"in a)throw new Dt(a.error,"failed to get inflation reward");return a.result}async getEpochInfo(t){const{commitment:e,config:n}=Xt(t),r=this._buildArgs([],e,void 0,n),i=await this._rpcRequest("getEpochInfo",r),o=(0,p.Ue)(i,ye);if("error"in o)throw new Dt(o.error,"failed to get epoch info");return o.result}async getEpochSchedule(){const t=await this._rpcRequest("getEpochSchedule",[]),e=(0,p.Ue)(t,ge);if("error"in e)throw new Dt(e.error,"failed to get epoch schedule");const n=e.result;return new Lt(n.slotsPerEpoch,n.leaderScheduleSlotOffset,n.warmup,n.firstNormalEpoch,n.firstNormalSlot)}async getLeaderSchedule(){const t=await this._rpcRequest("getLeaderSchedule",[]),e=(0,p.Ue)(t,me);if("error"in e)throw new Dt(e.error,"failed to get leader schedule");return e.result}async getMinimumBalanceForRentExemption(t,e){const n=this._buildArgs([t],e),r=await this._rpcRequest("getMinimumBalanceForRentExemption",n),i=(0,p.Ue)(r,Ve);return"error"in i?(console.warn("Unable to fetch minimum balance for rent exemption"),0):i.result}async getRecentBlockhashAndContext(t){const e=this._buildArgs([],t),n=await this._rpcRequest("getRecentBlockhash",e),r=(0,p.Ue)(n,yn);if("error"in r)throw new Dt(r.error,"failed to get recent blockhash");return r.result}async getRecentPerformanceSamples(t){const e=await this._rpcRequest("getRecentPerformanceSamples",t?[t]:[]),n=(0,p.Ue)(e,bn);if("error"in n)throw new Dt(n.error,"failed to get recent performance samples");return n.result}async getFeeCalculatorForBlockhash(t,e){const n=this._buildArgs([t],e),r=await this._rpcRequest("getFeeCalculatorForBlockhash",n),i=(0,p.Ue)(r,wn);if("error"in i)throw new Dt(i.error,"failed to get fee calculator");const{context:o,value:s}=i.result;return{context:o,value:null!==s?s.feeCalculator:null}}async getFeeForMessage(t,e){const n=t.serialize().toString("base64"),r=this._buildArgs([n],e),i=await this._rpcRequest("getFeeForMessage",r),o=(0,p.Ue)(i,te((0,p.AG)((0,p.Rx)())));if("error"in o)throw new Dt(o.error,"failed to get slot");if(null===o.result)throw new Error("invalid blockhash");return o.result}async getRecentBlockhash(t){try{return(await this.getRecentBlockhashAndContext(t)).value}catch(e){throw new Error("failed to get recent blockhash: "+e)}}async getLatestBlockhash(t){try{return(await this.getLatestBlockhashAndContext(t)).value}catch(e){throw new Error("failed to get recent blockhash: "+e)}}async getLatestBlockhashAndContext(t){const{commitment:e,config:n}=Xt(t),r=this._buildArgs([],e,void 0,n),i=await this._rpcRequest("getLatestBlockhash",r),o=(0,p.Ue)(i,gn);if("error"in o)throw new Dt(o.error,"failed to get latest blockhash");return o.result}async getVersion(){const t=await this._rpcRequest("getVersion",[]),e=(0,p.Ue)(t,Qt(de));if("error"in e)throw new Dt(e.error,"failed to get version");return e.result}async getGenesisHash(){const t=await this._rpcRequest("getGenesisHash",[]),e=(0,p.Ue)(t,Qt((0,p.Z_)()));if("error"in e)throw new Dt(e.error,"failed to get genesis hash");return e.result}async getBlock(t,e){const{commitment:n,config:r}=Xt(e),i=this._buildArgsAtLeastConfirmed([t],n,void 0,r),o=await this._rpcRequest("getBlock",i),s=(0,p.Ue)(o,ln);if("error"in s)throw new Dt(s.error,"failed to get confirmed block");const a=s.result;return a?{...a,transactions:a.transactions.map((({transaction:t,meta:e,version:n})=>({meta:e,transaction:{...t,message:ne(n,t.message)},version:n})))}:a}async getBlockHeight(t){const{commitment:e,config:n}=Xt(t),r=this._buildArgs([],e,void 0,n),i=await this._rpcRequest("getBlockHeight",r),o=(0,p.Ue)(i,Qt((0,p.Rx)()));if("error"in o)throw new Dt(o.error,"failed to get block height information");return o.result}async getBlockProduction(t){let e,n;if("string"==typeof t)n=t;else if(t){const{commitment:r,...i}=t;n=r,e=i}const r=this._buildArgs([],n,"base64",e),i=await this._rpcRequest("getBlockProduction",r),o=(0,p.Ue)(i,fe);if("error"in o)throw new Dt(o.error,"failed to get block production information");return o.result}async getTransaction(t,e){const{commitment:n,config:r}=Xt(e),i=this._buildArgsAtLeastConfirmed([t],n,void 0,r),o=await this._rpcRequest("getTransaction",i),s=(0,p.Ue)(o,fn);if("error"in s)throw new Dt(s.error,"failed to get transaction");const a=s.result;return a?{...a,transaction:{...a.transaction,message:ne(a.version,a.transaction.message)}}:a}async getParsedTransaction(t,e){const{commitment:n,config:r}=Xt(e),i=this._buildArgsAtLeastConfirmed([t],n,"jsonParsed",r),o=await this._rpcRequest("getTransaction",i),s=(0,p.Ue)(o,pn);if("error"in s)throw new Dt(s.error,"failed to get transaction");return s.result}async getParsedTransactions(t,e){const{commitment:n,config:r}=Xt(e),i=t.map((t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],n,"jsonParsed",r)})));return(await this._rpcBatchRequest(i)).map((t=>{const e=(0,p.Ue)(t,pn);if("error"in e)throw new Dt(e.error,"failed to get transactions");return e.result}))}async getTransactions(t,e){const{commitment:n,config:r}=Xt(e),i=t.map((t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],n,void 0,r)})));return(await this._rpcBatchRequest(i)).map((t=>{const e=(0,p.Ue)(t,fn);if("error"in e)throw new Dt(e.error,"failed to get transactions");const n=e.result;return n?{...n,transaction:{...n.transaction,message:ne(n.version,n.transaction.message)}}:n}))}async getConfirmedBlock(t,e){const n=this._buildArgsAtLeastConfirmed([t],e),r=await this._rpcRequest("getConfirmedBlock",n),i=(0,p.Ue)(r,dn);if("error"in i)throw new Dt(i.error,"failed to get confirmed block");const o=i.result;if(!o)throw new Error("Confirmed block "+t+" not found");const s={...o,transactions:o.transactions.map((({transaction:t,meta:e})=>{const n=new J(t.message);return{meta:e,transaction:{...t,message:n}}}))};return{...s,transactions:s.transactions.map((({transaction:t,meta:e})=>({meta:e,transaction:rt.populate(t.message,t.signatures)})))}}async getBlocks(t,e,n){const r=this._buildArgsAtLeastConfirmed(void 0!==e?[t,e]:[t],n),i=await this._rpcRequest("getBlocks",r),o=(0,p.Ue)(i,Qt((0,p.IX)((0,p.Rx)())));if("error"in o)throw new Dt(o.error,"failed to get blocks");return o.result}async getBlockSignatures(t,e){const n=this._buildArgsAtLeastConfirmed([t],e,void 0,{transactionDetails:"signatures",rewards:!1}),r=await this._rpcRequest("getBlock",n),i=(0,p.Ue)(r,hn);if("error"in i)throw new Dt(i.error,"failed to get block");const o=i.result;if(!o)throw new Error("Block "+t+" not found");return o}async getConfirmedBlockSignatures(t,e){const n=this._buildArgsAtLeastConfirmed([t],e,void 0,{transactionDetails:"signatures",rewards:!1}),r=await this._rpcRequest("getConfirmedBlock",n),i=(0,p.Ue)(r,hn);if("error"in i)throw new Dt(i.error,"failed to get confirmed block");const o=i.result;if(!o)throw new Error("Confirmed block "+t+" not found");return o}async getConfirmedTransaction(t,e){const n=this._buildArgsAtLeastConfirmed([t],e),r=await this._rpcRequest("getConfirmedTransaction",n),i=(0,p.Ue)(r,fn);if("error"in i)throw new Dt(i.error,"failed to get transaction");const o=i.result;if(!o)return o;const s=new J(o.transaction.message),a=o.transaction.signatures;return{...o,transaction:rt.populate(s,a)}}async getParsedConfirmedTransaction(t,e){const n=this._buildArgsAtLeastConfirmed([t],e,"jsonParsed"),r=await this._rpcRequest("getConfirmedTransaction",n),i=(0,p.Ue)(r,pn);if("error"in i)throw new Dt(i.error,"failed to get confirmed transaction");return i.result}async getParsedConfirmedTransactions(t,e){const n=t.map((t=>({methodName:"getConfirmedTransaction",args:this._buildArgsAtLeastConfirmed([t],e,"jsonParsed")})));return(await this._rpcBatchRequest(n)).map((t=>{const e=(0,p.Ue)(t,pn);if("error"in e)throw new Dt(e.error,"failed to get confirmed transactions");return e.result}))}async getConfirmedSignaturesForAddress(t,e,n){let r={},i=await this.getFirstAvailableBlock();for(;!("until"in r)&&!(--e<=0||e<i);)try{const t=await this.getConfirmedBlockSignatures(e,"finalized");t.signatures.length>0&&(r.until=t.signatures[t.signatures.length-1].toString())}catch(s){if(s instanceof Error&&s.message.includes("skipped"))continue;throw s}let o=await this.getSlot("finalized");for(;!("before"in r||++n>o);)try{const t=await this.getConfirmedBlockSignatures(n);t.signatures.length>0&&(r.before=t.signatures[t.signatures.length-1].toString())}catch(s){if(s instanceof Error&&s.message.includes("skipped"))continue;throw s}return(await this.getConfirmedSignaturesForAddress2(t,r)).map((t=>t.signature))}async getConfirmedSignaturesForAddress2(t,e,n){const r=this._buildArgsAtLeastConfirmed([t.toBase58()],n,void 0,e),i=await this._rpcRequest("getConfirmedSignaturesForAddress2",r),o=(0,p.Ue)(i,Re);if("error"in o)throw new Dt(o.error,"failed to get confirmed signatures for address");return o.result}async getSignaturesForAddress(t,e,n){const r=this._buildArgsAtLeastConfirmed([t.toBase58()],n,void 0,e),i=await this._rpcRequest("getSignaturesForAddress",r),o=(0,p.Ue)(i,Me);if("error"in o)throw new Dt(o.error,"failed to get signatures for address");return o.result}async getAddressLookupTable(t,e){const{context:n,value:r}=await this.getAccountInfoAndContext(t,e);let i=null;return null!==r&&(i=new Wt({key:t,state:Wt.deserialize(r.data)})),{context:n,value:i}}async getNonceAndContext(t,e){const{context:n,value:r}=await this.getAccountInfoAndContext(t,e);let i=null;return null!==r&&(i=It.fromAccountData(r.data)),{context:n,value:i}}async getNonce(t,e){return await this.getNonceAndContext(t,e).then((t=>t.value)).catch((e=>{throw new Error("failed to get nonce for account "+t.toBase58()+": "+e)}))}async requestAirdrop(t,e){const n=await this._rpcRequest("requestAirdrop",[t.toBase58(),e]),r=(0,p.Ue)(n,kn);if("error"in r)throw new Dt(r.error,`airdrop to ${t.toBase58()} failed`);return r.result}async _blockhashWithExpiryBlockHeight(t){if(!t){for(;this._pollingBlockhash;)await gt(100);const t=Date.now()-this._blockhashInfo.lastFetch>=Vt;if(null!==this._blockhashInfo.latestBlockhash&&!t)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{const t=Date.now(),e=this._blockhashInfo.latestBlockhash,n=e?e.blockhash:null;for(let r=0;r<50;r++){const t=await this.getLatestBlockhash("finalized");if(n!==t.blockhash)return this._blockhashInfo={latestBlockhash:t,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},t;await gt(200)}throw new Error(`Unable to obtain a new blockhash after ${Date.now()-t}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(t){const{commitment:e,config:n}=Xt(t),r=this._buildArgs([],e,"base64",n),i=await this._rpcRequest("getStakeMinimumDelegation",r),o=(0,p.Ue)(i,te((0,p.Rx)()));if("error"in o)throw new Dt(o.error,"failed to get stake minimum delegation");return o.result}async simulateTransaction(t,e,n){if("message"in t){const i=t.serialize(),o=r.Buffer.from(i).toString("base64");if(Array.isArray(e)||void 0!==n)throw new Error("Invalid arguments");const s=e||{};s.encoding="base64","commitment"in s||(s.commitment=this.commitment);const a=[o,s],c=await this._rpcRequest("simulateTransaction",a),u=(0,p.Ue)(c,he);if("error"in u)throw new Error("failed to simulate transaction: "+u.error.message);return u.result}let i;if(t instanceof rt){let e=t;i=new rt,i.feePayer=e.feePayer,i.instructions=t.instructions,i.nonceInfo=e.nonceInfo,i.signatures=e.signatures}else i=rt.populate(t),i._message=i._json=void 0;if(void 0!==e&&!Array.isArray(e))throw new Error("Invalid arguments");const o=e;if(i.nonceInfo&&o)i.sign(...o);else{let t=this._disableBlockhashCaching;for(;;){const e=await this._blockhashWithExpiryBlockHeight(t);if(i.lastValidBlockHeight=e.lastValidBlockHeight,i.recentBlockhash=e.blockhash,!o)break;if(i.sign(...o),!i.signature)throw new Error("!signature");const n=i.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(n)&&!this._blockhashInfo.transactionSignatures.includes(n)){this._blockhashInfo.simulatedSignatures.push(n);break}t=!0}}const s=i._compile(),a=s.serialize(),c=i._serialize(a).toString("base64"),u={encoding:"base64",commitment:this.commitment};if(n){const t=(Array.isArray(n)?n:s.nonProgramIds()).map((t=>t.toBase58()));u.accounts={encoding:"base64",addresses:t}}o&&(u.sigVerify=!0);const l=[c,u],d=await this._rpcRequest("simulateTransaction",l),h=(0,p.Ue)(d,he);if("error"in h){let t;if("data"in h.error&&(t=h.error.data.logs,t&&Array.isArray(t))){const e="\n ",n=e+t.join(e);console.error(h.error.message,n)}throw new zt("failed to simulate transaction: "+h.error.message,t)}return h.result}async sendTransaction(t,e,n){if("version"in t){if(e&&Array.isArray(e))throw new Error("Invalid arguments");const r=t.serialize();return await this.sendRawTransaction(r,n)}if(void 0===e||!Array.isArray(e))throw new Error("Invalid arguments");const r=e;if(t.nonceInfo)t.sign(...r);else{let e=this._disableBlockhashCaching;for(;;){const n=await this._blockhashWithExpiryBlockHeight(e);if(t.lastValidBlockHeight=n.lastValidBlockHeight,t.recentBlockhash=n.blockhash,t.sign(...r),!t.signature)throw new Error("!signature");const i=t.signature.toString("base64");if(!this._blockhashInfo.transactionSignatures.includes(i)){this._blockhashInfo.transactionSignatures.push(i);break}e=!0}}const i=t.serialize();return await this.sendRawTransaction(i,n)}async sendRawTransaction(t,e){const n=T(t).toString("base64");return await this.sendEncodedTransaction(n,e)}async sendEncodedTransaction(t,e){const n={encoding:"base64"},r=e&&e.skipPreflight,i=e&&e.preflightCommitment||this.commitment;e&&null!=e.maxRetries&&(n.maxRetries=e.maxRetries),e&&null!=e.minContextSlot&&(n.minContextSlot=e.minContextSlot),r&&(n.skipPreflight=r),i&&(n.preflightCommitment=i);const o=[t,n],s=await this._rpcRequest("sendTransaction",o),a=(0,p.Ue)(s,vn);if("error"in a){let t;throw"data"in a.error&&(t=a.error.data.logs),new zt("failed to send transaction: "+a.error.message,t)}return a.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval((()=>{this._rpcWebSocket.notify("ping").catch((()=>{}))}),5e3),this._updateSubscriptions()}_wsOnError(t){this._rpcWebSocketConnected=!1,console.error("ws error:",t.message)}_wsOnClose(t){this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration++,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),1e3!==t?(this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach((([t,e])=>{this._subscriptionsByHash[t]={...e,state:"pending"}}))):this._updateSubscriptions()}async _updateSubscriptions(){if(0===Object.keys(this._subscriptionsByHash).length)return void(this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout((()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(t){t instanceof Error&&console.log(`Error when closing socket connection: ${t.message}`)}}),500)));if(null!==this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected)return void this._rpcWebSocket.connect();const t=this._rpcWebSocketGeneration,e=()=>t===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map((async t=>{const n=this._subscriptionsByHash[t];if(void 0!==n)switch(n.state){case"pending":case"unsubscribed":if(0===n.callbacks.size)return delete this._subscriptionsByHash[t],"unsubscribed"===n.state&&delete this._subscriptionCallbacksByServerSubscriptionId[n.serverSubscriptionId],void(await this._updateSubscriptions());await(async()=>{const{args:r,method:i}=n;try{this._subscriptionsByHash[t]={...n,state:"subscribing"};const e=await this._rpcWebSocket.call(i,r);this._subscriptionsByHash[t]={...n,serverSubscriptionId:e,state:"subscribed"},this._subscriptionCallbacksByServerSubscriptionId[e]=n.callbacks,await this._updateSubscriptions()}catch(o){if(o instanceof Error&&console.error(`${i} error for argument`,r,o.message),!e())return;this._subscriptionsByHash[t]={...n,state:"pending"},await this._updateSubscriptions()}})();break;case"subscribed":0===n.callbacks.size&&await(async()=>{const{serverSubscriptionId:r,unsubscribeMethod:i}=n;if(this._subscriptionsAutoDisposedByRpc.has(r))this._subscriptionsAutoDisposedByRpc.delete(r);else{this._subscriptionsByHash[t]={...n,state:"unsubscribing"};try{await this._rpcWebSocket.call(i,[r])}catch(o){if(o instanceof Error&&console.error(`${i} error:`,o.message),!e())return;return this._subscriptionsByHash[t]={...n,state:"subscribed"},void(await this._updateSubscriptions())}}this._subscriptionsByHash[t]={...n,state:"unsubscribed"},await this._updateSubscriptions()})()}})))}_handleServerNotification(t,e){const n=this._subscriptionCallbacksByServerSubscriptionId[t];void 0!==n&&n.forEach((t=>{try{t(...e)}catch(n){console.error(n)}}))}_wsOnAccountNotification(t){const{result:e,subscription:n}=(0,p.Ue)(t,Ce);this._handleServerNotification(n,[e.value,e.context])}_makeSubscription(t,e){const n=this._nextClientSubscriptionId++,r=Ut([t.method,e],!0),i=this._subscriptionsByHash[r];return void 0===i?this._subscriptionsByHash[r]={...t,args:e,callbacks:new Set([t.callback]),state:"pending"}:i.callbacks.add(t.callback),this._subscriptionDisposeFunctionsByClientSubscriptionId[n]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[n];const e=this._subscriptionsByHash[r];V(void 0!==e,`Could not find a \`Subscription\` when tearing down client subscription #${n}`),e.callbacks.delete(t.callback),await this._updateSubscriptions()},this._updateSubscriptions(),n}onAccountChange(t,e,n){const r=this._buildArgs([t.toBase58()],n||this._commitment||"finalized","base64");return this._makeSubscription({callback:e,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},r)}async removeAccountChangeListener(t){await this._unsubscribeClientSubscription(t,"account change")}_wsOnProgramAccountNotification(t){const{result:e,subscription:n}=(0,p.Ue)(t,Ne);this._handleServerNotification(n,[{accountId:e.value.pubkey,accountInfo:e.value.account},e.context])}onProgramAccountChange(t,e,n,r){const i=this._buildArgs([t.toBase58()],n||this._commitment||"finalized","base64",r?{filters:r}:void 0);return this._makeSubscription({callback:e,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},i)}async removeProgramAccountChangeListener(t){await this._unsubscribeClientSubscription(t,"program account change")}onLogs(t,e,n){const r=this._buildArgs(["object"==typeof t?{mentions:[t.toString()]}:t],n||this._commitment||"finalized");return this._makeSubscription({callback:e,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},r)}async removeOnLogsListener(t){await this._unsubscribeClientSubscription(t,"logs")}_wsOnLogsNotification(t){const{result:e,subscription:n}=(0,p.Ue)(t,An);this._handleServerNotification(n,[e.value,e.context])}_wsOnSlotNotification(t){const{result:e,subscription:n}=(0,p.Ue)(t,ze);this._handleServerNotification(n,[e])}onSlotChange(t){return this._makeSubscription({callback:t,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(t){await this._unsubscribeClientSubscription(t,"slot change")}_wsOnSlotUpdatesNotification(t){const{result:e,subscription:n}=(0,p.Ue)(t,De);this._handleServerNotification(n,[e])}onSlotUpdate(t){return this._makeSubscription({callback:t,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(t){await this._unsubscribeClientSubscription(t,"slot update")}async _unsubscribeClientSubscription(t,e){const n=this._subscriptionDisposeFunctionsByClientSubscriptionId[t];n?await n():console.warn(`Ignored unsubscribe request because an active subscription with id \`${t}\` for '${e}' events could not be found.`)}_buildArgs(t,e,n,r){const i=e||this._commitment;if(i||n||r){let e={};n&&(e.encoding=n),i&&(e.commitment=i),r&&(e=Object.assign(e,r)),t.push(e)}return t}_buildArgsAtLeastConfirmed(t,e,n,r){const i=e||this._commitment;if(i&&!["confirmed","finalized"].includes(i))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(t,e,n,r)}_wsOnSignatureNotification(t){const{result:e,subscription:n}=(0,p.Ue)(t,je);"receivedSignature"!==e.value&&this._subscriptionsAutoDisposedByRpc.add(n),this._handleServerNotification(n,"receivedSignature"===e.value?[{type:"received"},e.context]:[{type:"status",result:e.value},e.context])}onSignature(t,e,n){const r=this._buildArgs([t],n||this._commitment||"finalized"),i=this._makeSubscription({callback:(t,n)=>{if("status"===t.type){e(t.result,n);try{this.removeSignatureListener(i)}catch(r){}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},r);return i}onSignatureWithOptions(t,e,n){const{commitment:r,...i}={...n,commitment:n&&n.commitment||this._commitment||"finalized"},o=this._buildArgs([t],r,void 0,i),s=this._makeSubscription({callback:(t,n)=>{e(t,n);try{this.removeSignatureListener(s)}catch(r){}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},o);return s}async removeSignatureListener(t){await this._unsubscribeClientSubscription(t,"signature result")}_wsOnRootNotification(t){const{result:e,subscription:n}=(0,p.Ue)(t,We);this._handleServerNotification(n,[e])}onRootChange(t){return this._makeSubscription({callback:t,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(t){await this._unsubscribeClientSubscription(t,"root change")}}class En{constructor(t){this._keypair=void 0,this._keypair=null!=t?t:I()}static generate(){return new En(I())}static fromSecretKey(t,e){if(64!==t.byteLength)throw new Error("bad secret key size");const n=t.slice(32,64);if(!e||!e.skipValidation){const e=t.slice(0,32),r=A(e);for(let t=0;t<32;t++)if(n[t]!==r[t])throw new Error("provided secretKey is invalid")}return new En({publicKey:n,secretKey:t})}static fromSeed(t){const e=A(t),n=new Uint8Array(64);return n.set(t),n.set(e,32),new En({publicKey:e,secretKey:n})}get publicKey(){return new C(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}const Tn=Object.freeze({CreateLookupTable:{index:0,layout:h.struct([h.u32("instruction"),At("recentSlot"),h.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:h.struct([h.u32("instruction")])},ExtendLookupTable:{index:2,layout:h.struct([h.u32("instruction"),At(),h.seq(F(),h.offset(h.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:h.struct([h.u32("instruction")])},CloseLookupTable:{index:4,layout:h.struct([h.u32("instruction")])}});class xn{constructor(){}static decodeInstructionType(t){this.checkProgramId(t.programId);const e=h.u32("instruction").decode(t.data);let n;for(const[r,i]of Object.entries(Tn))if(i.index==e){n=r;break}if(!n)throw new Error("Invalid Instruction. Should be a LookupTable Instruction");return n}static decodeCreateLookupTable(t){this.checkProgramId(t.programId),this.checkKeysLength(t.keys,4);const{recentSlot:e}=bt(Tn.CreateLookupTable,t.data);return{authority:t.keys[1].pubkey,payer:t.keys[2].pubkey,recentSlot:Number(e)}}static decodeExtendLookupTable(t){if(this.checkProgramId(t.programId),t.keys.length<2)throw new Error(`invalid instruction; found ${t.keys.length} keys, expected at least 2`);const{addresses:e}=bt(Tn.ExtendLookupTable,t.data);return{lookupTable:t.keys[0].pubkey,authority:t.keys[1].pubkey,payer:t.keys.length>2?t.keys[2].pubkey:void 0,addresses:e.map((t=>new C(t)))}}static decodeCloseLookupTable(t){return this.checkProgramId(t.programId),this.checkKeysLength(t.keys,3),{lookupTable:t.keys[0].pubkey,authority:t.keys[1].pubkey,recipient:t.keys[2].pubkey}}static decodeFreezeLookupTable(t){return this.checkProgramId(t.programId),this.checkKeysLength(t.keys,2),{lookupTable:t.keys[0].pubkey,authority:t.keys[1].pubkey}}static decodeDeactivateLookupTable(t){return this.checkProgramId(t.programId),this.checkKeysLength(t.keys,2),{lookupTable:t.keys[0].pubkey,authority:t.keys[1].pubkey}}static checkProgramId(t){if(!t.equals(Pn.programId))throw new Error("invalid instruction; programId is not AddressLookupTable Program")}static checkKeysLength(t,e){if(t.length<e)throw new Error(`invalid instruction; found ${t.length} keys, expected at least ${e}`)}}class Pn{constructor(){}static createLookupTable(t){const[e,n]=C.findProgramAddressSync([t.authority.toBuffer(),(0,f.toBufferLE)(BigInt(t.recentSlot),8)],this.programId),r=mt(Tn.CreateLookupTable,{recentSlot:BigInt(t.recentSlot),bumpSeed:n}),i=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1},{pubkey:t.payer,isSigner:!0,isWritable:!0},{pubkey:Tt.programId,isSigner:!1,isWritable:!1}];return[new nt({programId:this.programId,keys:i,data:r}),e]}static freezeLookupTable(t){const e=mt(Tn.FreezeLookupTable),n=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return new nt({programId:this.programId,keys:n,data:e})}static extendLookupTable(t){const e=mt(Tn.ExtendLookupTable,{addresses:t.addresses.map((t=>t.toBytes()))}),n=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return t.payer&&n.push({pubkey:t.payer,isSigner:!0,isWritable:!0},{pubkey:Tt.programId,isSigner:!1,isWritable:!1}),new nt({programId:this.programId,keys:n,data:e})}static deactivateLookupTable(t){const e=mt(Tn.DeactivateLookupTable),n=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return new nt({programId:this.programId,keys:n,data:e})}static closeLookupTable(t){const e=mt(Tn.CloseLookupTable),n=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1},{pubkey:t.recipient,isSigner:!1,isWritable:!0}];return new nt({programId:this.programId,keys:n,data:e})}}Pn.programId=new C("AddressLookupTab1e1111111111111111111111111");class Bn{constructor(){}static decodeInstructionType(t){this.checkProgramId(t.programId);const e=h.u8("instruction").decode(t.data);let n;for(const[r,i]of Object.entries(On))if(i.index==e){n=r;break}if(!n)throw new Error("Instruction type incorrect; not a ComputeBudgetInstruction");return n}static decodeRequestUnits(t){this.checkProgramId(t.programId);const{units:e,additionalFee:n}=bt(On.RequestUnits,t.data);return{units:e,additionalFee:n}}static decodeRequestHeapFrame(t){this.checkProgramId(t.programId);const{bytes:e}=bt(On.RequestHeapFrame,t.data);return{bytes:e}}static decodeSetComputeUnitLimit(t){this.checkProgramId(t.programId);const{units:e}=bt(On.SetComputeUnitLimit,t.data);return{units:e}}static decodeSetComputeUnitPrice(t){this.checkProgramId(t.programId);const{microLamports:e}=bt(On.SetComputeUnitPrice,t.data);return{microLamports:e}}static checkProgramId(t){if(!t.equals(Rn.programId))throw new Error("invalid instruction; programId is not ComputeBudgetProgram")}}const On=Object.freeze({RequestUnits:{index:0,layout:h.struct([h.u8("instruction"),h.u32("units"),h.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:h.struct([h.u8("instruction"),h.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:h.struct([h.u8("instruction"),h.u32("units")])},SetComputeUnitPrice:{index:3,layout:h.struct([h.u8("instruction"),At("microLamports")])}});class Rn{constructor(){}static requestUnits(t){const e=mt(On.RequestUnits,t);return new nt({keys:[],programId:this.programId,data:e})}static requestHeapFrame(t){const e=mt(On.RequestHeapFrame,t);return new nt({keys:[],programId:this.programId,data:e})}static setComputeUnitLimit(t){const e=mt(On.SetComputeUnitLimit,t);return new nt({keys:[],programId:this.programId,data:e})}static setComputeUnitPrice(t){const e=mt(On.SetComputeUnitPrice,{microLamports:BigInt(t.microLamports)});return new nt({keys:[],programId:this.programId,data:e})}}Rn.programId=new C("ComputeBudget111111111111111111111111111111");const Mn=h.struct([h.u8("numSignatures"),h.u8("padding"),h.u16("signatureOffset"),h.u16("signatureInstructionIndex"),h.u16("publicKeyOffset"),h.u16("publicKeyInstructionIndex"),h.u16("messageDataOffset"),h.u16("messageDataSize"),h.u16("messageInstructionIndex")]);class Cn{constructor(){}static createInstructionWithPublicKey(t){const{publicKey:e,message:n,signature:i,instructionIndex:o}=t;V(32===e.length,`Public Key must be 32 bytes but received ${e.length} bytes`),V(64===i.length,`Signature must be 64 bytes but received ${i.length} bytes`);const s=Mn.span,a=s+e.length,c=a+i.length,u=r.Buffer.alloc(c+n.length),l=null==o?65535:o;return Mn.encode({numSignatures:1,padding:0,signatureOffset:a,signatureInstructionIndex:l,publicKeyOffset:s,publicKeyInstructionIndex:l,messageDataOffset:c,messageDataSize:n.length,messageInstructionIndex:l},u),u.fill(e,s),u.fill(i,a),u.fill(n,c),new nt({keys:[],programId:Cn.programId,data:u})}static createInstructionWithPrivateKey(t){const{privateKey:e,message:n,instructionIndex:r}=t;V(64===e.length,`Private key must be 64 bytes but received ${e.length} bytes`);try{const t=En.fromSecretKey(e),i=t.publicKey.toBytes(),o=S(n,t.secretKey);return this.createInstructionWithPublicKey({publicKey:i,message:n,signature:o,instructionIndex:r})}catch(i){throw new Error(`Error creating instruction; ${i}`)}}}Cn.programId=new C("Ed25519SigVerify111111111111111111111111111"),k.P6.hmacSha256Sync=(t,...e)=>{const n=w.b.create(l.J,t);return e.forEach((t=>n.update(t))),n.digest()};k.P6.isValidPrivateKey;const Un=k.$3,Nn=h.struct([h.u8("numSignatures"),h.u16("signatureOffset"),h.u8("signatureInstructionIndex"),h.u16("ethAddressOffset"),h.u8("ethAddressInstructionIndex"),h.u16("messageDataOffset"),h.u16("messageDataSize"),h.u8("messageInstructionIndex"),h.blob(20,"ethAddress"),h.blob(64,"signature"),h.u8("recoveryId")]);class Ln{constructor(){}static publicKeyToEthAddress(t){V(64===t.length,`Public key must be 64 bytes but received ${t.length} bytes`);try{return r.Buffer.from((0,b.fr)(T(t))).slice(-20)}catch(e){throw new Error(`Error constructing Ethereum address: ${e}`)}}static createInstructionWithPublicKey(t){const{publicKey:e,message:n,signature:r,recoveryId:i,instructionIndex:o}=t;return Ln.createInstructionWithEthAddress({ethAddress:Ln.publicKeyToEthAddress(e),message:n,signature:r,recoveryId:i,instructionIndex:o})}static createInstructionWithEthAddress(t){const{ethAddress:e,message:n,signature:i,recoveryId:o,instructionIndex:s=0}=t;let a;a="string"==typeof e?e.startsWith("0x")?r.Buffer.from(e.substr(2),"hex"):r.Buffer.from(e,"hex"):e,V(20===a.length,`Address must be 20 bytes but received ${a.length} bytes`);const c=12+a.length,u=c+i.length+1,l=r.Buffer.alloc(Nn.span+n.length);return Nn.encode({numSignatures:1,signatureOffset:c,signatureInstructionIndex:s,ethAddressOffset:12,ethAddressInstructionIndex:s,messageDataOffset:u,messageDataSize:n.length,messageInstructionIndex:s,signature:T(i),ethAddress:T(a),recoveryId:o},l),l.fill(T(n),Nn.span),new nt({keys:[],programId:Ln.programId,data:l})}static createInstructionWithPrivateKey(t){const{privateKey:e,message:n,instructionIndex:i}=t;V(32===e.length,`Private key must be 32 bytes but received ${e.length} bytes`);try{const t=T(e),a=Un(t,!1).slice(1),c=r.Buffer.from((0,b.fr)(T(n))),[u,l]=(o=c,s=t,k.kS(o,s,{der:!1,recovered:!0}));return this.createInstructionWithPublicKey({publicKey:a,message:n,signature:u,recoveryId:l,instructionIndex:i})}catch(a){throw new Error(`Error creating instruction; ${a}`)}var o,s}}Ln.programId=new C("KeccakSecp256k11111111111111111111111111111");const zn=new C("StakeConfig11111111111111111111111111111111");class Kn{constructor(t,e){this.staker=void 0,this.withdrawer=void 0,this.staker=t,this.withdrawer=e}}class Dn{constructor(t,e,n){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=e,this.custodian=n}}Dn.default=new Dn(0,0,C.default);class jn{constructor(){}static decodeInstructionType(t){this.checkProgramId(t.programId);const e=h.u32("instruction").decode(t.data);let n;for(const[r,i]of Object.entries(Wn))if(i.index==e){n=r;break}if(!n)throw new Error("Instruction type incorrect; not a StakeInstruction");return n}static decodeInitialize(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);const{authorized:e,lockup:n}=bt(Wn.Initialize,t.data);return{stakePubkey:t.keys[0].pubkey,authorized:new Kn(new C(e.staker),new C(e.withdrawer)),lockup:new Dn(n.unixTimestamp,n.epoch,new C(n.custodian))}}static decodeDelegate(t){return this.checkProgramId(t.programId),this.checkKeyLength(t.keys,6),bt(Wn.Delegate,t.data),{stakePubkey:t.keys[0].pubkey,votePubkey:t.keys[1].pubkey,authorizedPubkey:t.keys[5].pubkey}}static decodeAuthorize(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);const{newAuthorized:e,stakeAuthorizationType:n}=bt(Wn.Authorize,t.data),r={stakePubkey:t.keys[0].pubkey,authorizedPubkey:t.keys[2].pubkey,newAuthorizedPubkey:new C(e),stakeAuthorizationType:{index:n}};return t.keys.length>3&&(r.custodianPubkey=t.keys[3].pubkey),r}static decodeAuthorizeWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);const{newAuthorized:e,stakeAuthorizationType:n,authoritySeed:r,authorityOwner:i}=bt(Wn.AuthorizeWithSeed,t.data),o={stakePubkey:t.keys[0].pubkey,authorityBase:t.keys[1].pubkey,authoritySeed:r,authorityOwner:new C(i),newAuthorizedPubkey:new C(e),stakeAuthorizationType:{index:n}};return t.keys.length>3&&(o.custodianPubkey=t.keys[3].pubkey),o}static decodeSplit(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);const{lamports:e}=bt(Wn.Split,t.data);return{stakePubkey:t.keys[0].pubkey,splitStakePubkey:t.keys[1].pubkey,authorizedPubkey:t.keys[2].pubkey,lamports:e}}static decodeMerge(t){return this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3),bt(Wn.Merge,t.data),{stakePubkey:t.keys[0].pubkey,sourceStakePubKey:t.keys[1].pubkey,authorizedPubkey:t.keys[4].pubkey}}static decodeWithdraw(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,5);const{lamports:e}=bt(Wn.Withdraw,t.data),n={stakePubkey:t.keys[0].pubkey,toPubkey:t.keys[1].pubkey,authorizedPubkey:t.keys[4].pubkey,lamports:e};return t.keys.length>5&&(n.custodianPubkey=t.keys[5].pubkey),n}static decodeDeactivate(t){return this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3),bt(Wn.Deactivate,t.data),{stakePubkey:t.keys[0].pubkey,authorizedPubkey:t.keys[2].pubkey}}static checkProgramId(t){if(!t.equals(Gn.programId))throw new Error("invalid instruction; programId is not StakeProgram")}static checkKeyLength(t,e){if(t.length<e)throw new Error(`invalid instruction; found ${t.length} keys, expected at least ${e}`)}}const Wn=Object.freeze({Initialize:{index:0,layout:h.struct([h.u32("instruction"),((t="authorized")=>h.struct([F("staker"),F("withdrawer")],t))(),((t="lockup")=>h.struct([h.ns64("unixTimestamp"),h.ns64("epoch"),F("custodian")],t))()])},Authorize:{index:1,layout:h.struct([h.u32("instruction"),F("newAuthorized"),h.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:h.struct([h.u32("instruction")])},Split:{index:3,layout:h.struct([h.u32("instruction"),h.ns64("lamports")])},Withdraw:{index:4,layout:h.struct([h.u32("instruction"),h.ns64("lamports")])},Deactivate:{index:5,layout:h.struct([h.u32("instruction")])},Merge:{index:7,layout:h.struct([h.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:h.struct([h.u32("instruction"),F("newAuthorized"),h.u32("stakeAuthorizationType"),H("authoritySeed"),F("authorityOwner")])}}),Fn=Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class Gn{constructor(){}static initialize(t){const{stakePubkey:e,authorized:n,lockup:r}=t,i=r||Dn.default,o=mt(Wn.Initialize,{authorized:{staker:T(n.staker.toBuffer()),withdrawer:T(n.withdrawer.toBuffer())},lockup:{unixTimestamp:i.unixTimestamp,epoch:i.epoch,custodian:T(i.custodian.toBuffer())}}),s={keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:lt,isSigner:!1,isWritable:!1}],programId:this.programId,data:o};return new nt(s)}static createAccountWithSeed(t){const e=new rt;e.add(Tt.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:this.space,programId:this.programId}));const{stakePubkey:n,authorized:r,lockup:i}=t;return e.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}static createAccount(t){const e=new rt;e.add(Tt.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,lamports:t.lamports,space:this.space,programId:this.programId}));const{stakePubkey:n,authorized:r,lockup:i}=t;return e.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}static delegate(t){const{stakePubkey:e,authorizedPubkey:n,votePubkey:r}=t,i=mt(Wn.Delegate);return(new rt).add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!1},{pubkey:st,isSigner:!1,isWritable:!1},{pubkey:pt,isSigner:!1,isWritable:!1},{pubkey:zn,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static authorize(t){const{stakePubkey:e,authorizedPubkey:n,newAuthorizedPubkey:r,stakeAuthorizationType:i,custodianPubkey:o}=t,s=mt(Wn.Authorize,{newAuthorized:T(r.toBuffer()),stakeAuthorizationType:i.index}),a=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:st,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!1,isWritable:!1}),(new rt).add({keys:a,programId:this.programId,data:s})}static authorizeWithSeed(t){const{stakePubkey:e,authorityBase:n,authoritySeed:r,authorityOwner:i,newAuthorizedPubkey:o,stakeAuthorizationType:s,custodianPubkey:a}=t,c=mt(Wn.AuthorizeWithSeed,{newAuthorized:T(o.toBuffer()),stakeAuthorizationType:s.index,authoritySeed:r,authorityOwner:T(i.toBuffer())}),u=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:st,isSigner:!1,isWritable:!1}];return a&&u.push({pubkey:a,isSigner:!1,isWritable:!1}),(new rt).add({keys:u,programId:this.programId,data:c})}static splitInstruction(t){const{stakePubkey:e,authorizedPubkey:n,splitStakePubkey:r,lamports:i}=t,o=mt(Wn.Split,{lamports:i});return new nt({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static split(t){const e=new rt;return e.add(Tt.createAccount({fromPubkey:t.authorizedPubkey,newAccountPubkey:t.splitStakePubkey,lamports:0,space:this.space,programId:this.programId})),e.add(this.splitInstruction(t))}static splitWithSeed(t){const{stakePubkey:e,authorizedPubkey:n,splitStakePubkey:r,basePubkey:i,seed:o,lamports:s}=t,a=new rt;return a.add(Tt.allocate({accountPubkey:r,basePubkey:i,seed:o,space:this.space,programId:this.programId})),a.add(this.splitInstruction({stakePubkey:e,authorizedPubkey:n,splitStakePubkey:r,lamports:s}))}static merge(t){const{stakePubkey:e,sourceStakePubKey:n,authorizedPubkey:r}=t,i=mt(Wn.Merge);return(new rt).add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:st,isSigner:!1,isWritable:!1},{pubkey:pt,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static withdraw(t){const{stakePubkey:e,authorizedPubkey:n,toPubkey:r,lamports:i,custodianPubkey:o}=t,s=mt(Wn.Withdraw,{lamports:i}),a=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:st,isSigner:!1,isWritable:!1},{pubkey:pt,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!1,isWritable:!1}),(new rt).add({keys:a,programId:this.programId,data:s})}static deactivate(t){const{stakePubkey:e,authorizedPubkey:n}=t,r=mt(Wn.Deactivate);return(new rt).add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:st,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}}Gn.programId=new C("Stake11111111111111111111111111111111111111"),Gn.space=200;class Hn{constructor(t,e,n,r){this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=t,this.authorizedVoter=e,this.authorizedWithdrawer=n,this.commission=r}}class qn{constructor(){}static decodeInstructionType(t){this.checkProgramId(t.programId);const e=h.u32("instruction").decode(t.data);let n;for(const[r,i]of Object.entries($n))if(i.index==e){n=r;break}if(!n)throw new Error("Instruction type incorrect; not a VoteInstruction");return n}static decodeInitializeAccount(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,4);const{voteInit:e}=bt($n.InitializeAccount,t.data);return{votePubkey:t.keys[0].pubkey,nodePubkey:t.keys[3].pubkey,voteInit:new Hn(new C(e.nodePubkey),new C(e.authorizedVoter),new C(e.authorizedWithdrawer),e.commission)}}static decodeAuthorize(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);const{newAuthorized:e,voteAuthorizationType:n}=bt($n.Authorize,t.data);return{votePubkey:t.keys[0].pubkey,authorizedPubkey:t.keys[2].pubkey,newAuthorizedPubkey:new C(e),voteAuthorizationType:{index:n}}}static decodeAuthorizeWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);const{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:e,currentAuthorityDerivedKeySeed:n,newAuthorized:r,voteAuthorizationType:i}}=bt($n.AuthorizeWithSeed,t.data);return{currentAuthorityDerivedKeyBasePubkey:t.keys[2].pubkey,currentAuthorityDerivedKeyOwnerPubkey:new C(e),currentAuthorityDerivedKeySeed:n,newAuthorizedPubkey:new C(r),voteAuthorizationType:{index:i},votePubkey:t.keys[0].pubkey}}static decodeWithdraw(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);const{lamports:e}=bt($n.Withdraw,t.data);return{votePubkey:t.keys[0].pubkey,authorizedWithdrawerPubkey:t.keys[2].pubkey,lamports:e,toPubkey:t.keys[1].pubkey}}static checkProgramId(t){if(!t.equals(Vn.programId))throw new Error("invalid instruction; programId is not VoteProgram")}static checkKeyLength(t,e){if(t.length<e)throw new Error(`invalid instruction; found ${t.length} keys, expected at least ${e}`)}}const $n=Object.freeze({InitializeAccount:{index:0,layout:h.struct([h.u32("instruction"),((t="voteInit")=>h.struct([F("nodePubkey"),F("authorizedVoter"),F("authorizedWithdrawer"),h.u8("commission")],t))()])},Authorize:{index:1,layout:h.struct([h.u32("instruction"),F("newAuthorized"),h.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:h.struct([h.u32("instruction"),h.ns64("lamports")])},AuthorizeWithSeed:{index:10,layout:h.struct([h.u32("instruction"),((t="voteAuthorizeWithSeedArgs")=>h.struct([h.u32("voteAuthorizationType"),F("currentAuthorityDerivedKeyOwnerPubkey"),H("currentAuthorityDerivedKeySeed"),F("newAuthorized")],t))()])}}),Zn=Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class Vn{constructor(){}static initializeAccount(t){const{votePubkey:e,nodePubkey:n,voteInit:r}=t,i=mt($n.InitializeAccount,{voteInit:{nodePubkey:T(r.nodePubkey.toBuffer()),authorizedVoter:T(r.authorizedVoter.toBuffer()),authorizedWithdrawer:T(r.authorizedWithdrawer.toBuffer()),commission:r.commission}}),o={keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:lt,isSigner:!1,isWritable:!1},{pubkey:st,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i};return new nt(o)}static createAccount(t){const e=new rt;return e.add(Tt.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.votePubkey,lamports:t.lamports,space:this.space,programId:this.programId})),e.add(this.initializeAccount({votePubkey:t.votePubkey,nodePubkey:t.voteInit.nodePubkey,voteInit:t.voteInit}))}static authorize(t){const{votePubkey:e,authorizedPubkey:n,newAuthorizedPubkey:r,voteAuthorizationType:i}=t,o=mt($n.Authorize,{newAuthorized:T(r.toBuffer()),voteAuthorizationType:i.index}),s=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:st,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return(new rt).add({keys:s,programId:this.programId,data:o})}static authorizeWithSeed(t){const{currentAuthorityDerivedKeyBasePubkey:e,currentAuthorityDerivedKeyOwnerPubkey:n,currentAuthorityDerivedKeySeed:r,newAuthorizedPubkey:i,voteAuthorizationType:o,votePubkey:s}=t,a=mt($n.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:T(n.toBuffer()),currentAuthorityDerivedKeySeed:r,newAuthorized:T(i.toBuffer()),voteAuthorizationType:o.index}}),c=[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:st,isSigner:!1,isWritable:!1},{pubkey:e,isSigner:!0,isWritable:!1}];return(new rt).add({keys:c,programId:this.programId,data:a})}static withdraw(t){const{votePubkey:e,authorizedWithdrawerPubkey:n,lamports:r,toPubkey:i}=t,o=mt($n.Withdraw,{lamports:r}),s=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return(new rt).add({keys:s,programId:this.programId,data:o})}static safeWithdraw(t,e,n){if(t.lamports>e-n)throw new Error("Withdraw will leave vote account with insuffcient funds.");return Vn.withdraw(t)}}Vn.programId=new C("Vote111111111111111111111111111111111111111"),Vn.space=3731;const Xn=new C("Va1idator1nfo111111111111111111111111111111"),Jn=(0,p.dt)({name:(0,p.Z_)(),website:(0,p.jt)((0,p.Z_)()),details:(0,p.jt)((0,p.Z_)()),keybaseUsername:(0,p.jt)((0,p.Z_)())});class Yn{constructor(t,e){this.key=void 0,this.info=void 0,this.key=t,this.info=e}static fromConfigData(t){let e=[...t];if(2!==$(e))return null;const n=[];for(let r=0;r<2;r++){const t=new C(e.slice(0,R));e=e.slice(R);const r=1===e.slice(0,1)[0];e=e.slice(1),n.push({publicKey:t,isSigner:r})}if(n[0].publicKey.equals(Xn)&&n[1].isSigner){const t=H().decode(r.Buffer.from(e)),i=JSON.parse(t);return(0,p.hu)(i,Jn),new Yn(n[1].publicKey,i)}return null}}const Qn=new C("Vote111111111111111111111111111111111111111"),tr=h.struct([F("nodePubkey"),F("authorizedWithdrawer"),h.u8("commission"),h.nu64(),h.seq(h.struct([h.nu64("slot"),h.u32("confirmationCount")]),h.offset(h.u32(),-8),"votes"),h.u8("rootSlotValid"),h.nu64("rootSlot"),h.nu64(),h.seq(h.struct([h.nu64("epoch"),F("authorizedVoter")]),h.offset(h.u32(),-8),"authorizedVoters"),h.struct([h.seq(h.struct([F("authorizedPubkey"),h.nu64("epochOfLastAuthorizedSwitch"),h.nu64("targetEpoch")]),32,"buf"),h.nu64("idx"),h.u8("isEmpty")],"priorVoters"),h.nu64(),h.seq(h.struct([h.nu64("epoch"),h.nu64("credits"),h.nu64("prevCredits")]),h.offset(h.u32(),-8),"epochCredits"),h.struct([h.nu64("slot"),h.nu64("timestamp")],"lastTimestamp")]);class er{constructor(t){this.nodePubkey=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.rootSlot=void 0,this.votes=void 0,this.authorizedVoters=void 0,this.priorVoters=void 0,this.epochCredits=void 0,this.lastTimestamp=void 0,this.nodePubkey=t.nodePubkey,this.authorizedWithdrawer=t.authorizedWithdrawer,this.commission=t.commission,this.rootSlot=t.rootSlot,this.votes=t.votes,this.authorizedVoters=t.authorizedVoters,this.priorVoters=t.priorVoters,this.epochCredits=t.epochCredits,this.lastTimestamp=t.lastTimestamp}static fromAccountData(t){const e=tr.decode(T(t),4);let n=e.rootSlot;return e.rootSlotValid||(n=null),new er({nodePubkey:new C(e.nodePubkey),authorizedWithdrawer:new C(e.authorizedWithdrawer),commission:e.commission,votes:e.votes,rootSlot:n,authorizedVoters:e.authorizedVoters.map(nr),priorVoters:ir(e.priorVoters),epochCredits:e.epochCredits,lastTimestamp:e.lastTimestamp})}}function nr({authorizedVoter:t,epoch:e}){return{epoch:e,authorizedVoter:new C(t)}}function rr({authorizedPubkey:t,epochOfLastAuthorizedSwitch:e,targetEpoch:n}){return{authorizedPubkey:new C(t),epochOfLastAuthorizedSwitch:e,targetEpoch:n}}function ir({buf:t,idx:e,isEmpty:n}){return n?[]:[...t.slice(e+1).map(rr),...t.slice(0,e).map(rr)]}const or={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};function sr(t,e){const n=!1===e?"http":"https";if(!t)return or[n].devnet;const r=or[n][t];if(!r)throw new Error(`Unknown ${n} cluster: ${t}`);return r}async function ar(t,e,n,r){let i,o;n&&Object.prototype.hasOwnProperty.call(n,"lastValidBlockHeight")?(i=n,o=r):o=n;const s=o&&{skipPreflight:o.skipPreflight,preflightCommitment:o.preflightCommitment||o.commitment,minContextSlot:o.minContextSlot},a=await t.sendRawTransaction(e,s),c=o&&o.commitment,u=i?t.confirmTransaction(i,c):t.confirmTransaction(a,c),l=(await u).value;if(l.err)throw new Error(`Raw transaction ${a} failed (${JSON.stringify(l)})`);return a}const cr=1e9},93560:function(t,e,n){var r;!function(i){"use strict";var o,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,c=Math.floor,u="[BigNumber Error] ",l=u+"Number primitive has more than 15 significant digits: ",d=1e14,h=14,f=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],y=1e7,g=1e9;function m(t){var e=0|t;return t>0||t===e?e:e-1}function b(t){for(var e,n,r=1,i=t.length,o=t[0]+"";r<i;){for(e=t[r++]+"",n=h-e.length;n--;e="0"+e);o+=e}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function w(t,e){var n,r,i=t.c,o=e.c,s=t.s,a=e.s,c=t.e,u=e.e;if(!s||!a)return null;if(n=i&&!i[0],r=o&&!o[0],n||r)return n?r?0:-a:s;if(s!=a)return s;if(n=s<0,r=c==u,!i||!o)return r?0:!i^n?1:-1;if(!r)return c>u^n?1:-1;for(a=(c=i.length)<(u=o.length)?c:u,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^n?1:-1;return c==u?0:c>u^n?1:-1}function k(t,e,n,r){if(t<e||t>n||t!==c(t))throw Error(u+(r||"Argument")+("number"==typeof t?t<e||t>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function v(t){var e=t.c.length-1;return m(t.e/h)==e&&t.c[e]%2!=0}function I(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function A(t,e,n){var r,i;if(e<0){for(i=n+".";++e;i+=n);t=i+t}else if(++e>(r=t.length)){for(i=n,e-=r;--e;i+=n);t+=i}else e<r&&(t=t.slice(0,e)+"."+t.slice(e));return t}o=function t(e){var n,r,i,o,_,S,E,T,x,P,B=G.prototype={constructor:G,toString:null,valueOf:null},O=new G(1),R=20,M=4,C=-7,U=21,N=-1e7,L=1e7,z=!1,K=1,D=0,j={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xa0",suffix:""},W="0123456789abcdefghijklmnopqrstuvwxyz",F=!0;function G(t,e){var n,o,a,u,d,p,y,g,m=this;if(!(m instanceof G))return new G(t,e);if(null==e){if(t&&!0===t._isBigNumber)return m.s=t.s,void(!t.c||t.e>L?m.c=m.e=null:t.e<N?m.c=[m.e=0]:(m.e=t.e,m.c=t.c.slice()));if((p="number"==typeof t)&&0*t==0){if(m.s=1/t<0?(t=-t,-1):1,t===~~t){for(u=0,d=t;d>=10;d/=10,u++);return void(u>L?m.c=m.e=null:(m.e=u,m.c=[t]))}g=String(t)}else{if(!s.test(g=String(t)))return i(m,g,p);m.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(u=g.indexOf("."))>-1&&(g=g.replace(".","")),(d=g.search(/e/i))>0?(u<0&&(u=d),u+=+g.slice(d+1),g=g.substring(0,d)):u<0&&(u=g.length)}else{if(k(e,2,W.length,"Base"),10==e&&F)return Z(m=new G(t),R+m.e+1,M);if(g=String(t),p="number"==typeof t){if(0*t!=0)return i(m,g,p,e);if(m.s=1/t<0?(g=g.slice(1),-1):1,G.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(l+t)}else m.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(n=W.slice(0,e),u=d=0,y=g.length;d<y;d++)if(n.indexOf(o=g.charAt(d))<0){if("."==o){if(d>u){u=y;continue}}else if(!a&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){a=!0,d=-1,u=0;continue}return i(m,String(t),p,e)}p=!1,(u=(g=r(g,e,10,m.s)).indexOf("."))>-1?g=g.replace(".",""):u=g.length}for(d=0;48===g.charCodeAt(d);d++);for(y=g.length;48===g.charCodeAt(--y););if(g=g.slice(d,++y)){if(y-=d,p&&G.DEBUG&&y>15&&(t>f||t!==c(t)))throw Error(l+m.s*t);if((u=u-d-1)>L)m.c=m.e=null;else if(u<N)m.c=[m.e=0];else{if(m.e=u,m.c=[],d=(u+1)%h,u<0&&(d+=h),d<y){for(d&&m.c.push(+g.slice(0,d)),y-=h;d<y;)m.c.push(+g.slice(d,d+=h));d=h-(g=g.slice(d)).length}else d-=y;for(;d--;g+="0");m.c.push(+g)}}else m.c=[m.e=0]}function H(t,e,n,r){var i,o,s,a,c;if(null==n?n=M:k(n,0,8),!t.c)return t.toString();if(i=t.c[0],s=t.e,null==e)c=b(t.c),c=1==r||2==r&&(s<=C||s>=U)?I(c,s):A(c,s,"0");else if(o=(t=Z(new G(t),e,n)).e,a=(c=b(t.c)).length,1==r||2==r&&(e<=o||o<=C)){for(;a<e;c+="0",a++);c=I(c,o)}else if(e-=s,c=A(c,o,"0"),o+1>a){if(--e>0)for(c+=".";e--;c+="0");}else if((e+=o-a)>0)for(o+1==a&&(c+=".");e--;c+="0");return t.s<0&&i?"-"+c:c}function q(t,e){for(var n,r=1,i=new G(t[0]);r<t.length;r++){if(!(n=new G(t[r])).s){i=n;break}e.call(i,n)&&(i=n)}return i}function $(t,e,n){for(var r=1,i=e.length;!e[--i];e.pop());for(i=e[0];i>=10;i/=10,r++);return(n=r+n*h-1)>L?t.c=t.e=null:n<N?t.c=[t.e=0]:(t.e=n,t.c=e),t}function Z(t,e,n,r){var i,o,s,u,l,f,y,g=t.c,m=p;if(g){t:{for(i=1,u=g[0];u>=10;u/=10,i++);if((o=e-i)<0)o+=h,s=e,y=(l=g[f=0])/m[i-s-1]%10|0;else if((f=a((o+1)/h))>=g.length){if(!r)break t;for(;g.length<=f;g.push(0));l=y=0,i=1,s=(o%=h)-h+1}else{for(l=u=g[f],i=1;u>=10;u/=10,i++);y=(s=(o%=h)-h+i)<0?0:l/m[i-s-1]%10|0}if(r=r||e<0||null!=g[f+1]||(s<0?l:l%m[i-s-1]),r=n<4?(y||r)&&(0==n||n==(t.s<0?3:2)):y>5||5==y&&(4==n||r||6==n&&(o>0?s>0?l/m[i-s]:0:g[f-1])%10&1||n==(t.s<0?8:7)),e<1||!g[0])return g.length=0,r?(e-=t.e+1,g[0]=m[(h-e%h)%h],t.e=-e||0):g[0]=t.e=0,t;if(0==o?(g.length=f,u=1,f--):(g.length=f+1,u=m[h-o],g[f]=s>0?c(l/m[i-s]%m[s])*u:0),r)for(;;){if(0==f){for(o=1,s=g[0];s>=10;s/=10,o++);for(s=g[0]+=u,u=1;s>=10;s/=10,u++);o!=u&&(t.e++,g[0]==d&&(g[0]=1));break}if(g[f]+=u,g[f]!=d)break;g[f--]=0,u=1}for(o=g.length;0===g[--o];g.pop());}t.e>L?t.c=t.e=null:t.e<N&&(t.c=[t.e=0])}return t}function V(t){var e,n=t.e;return null===n?t.toString():(e=b(t.c),e=n<=C||n>=U?I(e,n):A(e,n,"0"),t.s<0?"-"+e:e)}return G.clone=t,G.ROUND_UP=0,G.ROUND_DOWN=1,G.ROUND_CEIL=2,G.ROUND_FLOOR=3,G.ROUND_HALF_UP=4,G.ROUND_HALF_DOWN=5,G.ROUND_HALF_EVEN=6,G.ROUND_HALF_CEIL=7,G.ROUND_HALF_FLOOR=8,G.EUCLID=9,G.config=G.set=function(t){var e,n;if(null!=t){if("object"!=typeof t)throw Error(u+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(k(n=t[e],0,g,e),R=n),t.hasOwnProperty(e="ROUNDING_MODE")&&(k(n=t[e],0,8,e),M=n),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((n=t[e])&&n.pop?(k(n[0],-g,0,e),k(n[1],0,g,e),C=n[0],U=n[1]):(k(n,-g,g,e),C=-(U=n<0?-n:n))),t.hasOwnProperty(e="RANGE"))if((n=t[e])&&n.pop)k(n[0],-g,-1,e),k(n[1],1,g,e),N=n[0],L=n[1];else{if(k(n,-g,g,e),!n)throw Error(u+e+" cannot be zero: "+n);N=-(L=n<0?-n:n)}if(t.hasOwnProperty(e="CRYPTO")){if((n=t[e])!==!!n)throw Error(u+e+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw z=!n,Error(u+"crypto unavailable");z=n}else z=n}if(t.hasOwnProperty(e="MODULO_MODE")&&(k(n=t[e],0,9,e),K=n),t.hasOwnProperty(e="POW_PRECISION")&&(k(n=t[e],0,g,e),D=n),t.hasOwnProperty(e="FORMAT")){if("object"!=typeof(n=t[e]))throw Error(u+e+" not an object: "+n);j=n}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(n=t[e])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(u+e+" invalid: "+n);F="0123456789"==n.slice(0,10),W=n}}return{DECIMAL_PLACES:R,ROUNDING_MODE:M,EXPONENTIAL_AT:[C,U],RANGE:[N,L],CRYPTO:z,MODULO_MODE:K,POW_PRECISION:D,FORMAT:j,ALPHABET:W}},G.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!G.DEBUG)return!0;var e,n,r=t.c,i=t.e,o=t.s;t:if("[object Array]"=={}.toString.call(r)){if((1===o||-1===o)&&i>=-g&&i<=g&&i===c(i)){if(0===r[0]){if(0===i&&1===r.length)return!0;break t}if((e=(i+1)%h)<1&&(e+=h),String(r[0]).length==e){for(e=0;e<r.length;e++)if((n=r[e])<0||n>=d||n!==c(n))break t;if(0!==n)return!0}}}else if(null===r&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(u+"Invalid BigNumber: "+t)},G.maximum=G.max=function(){return q(arguments,B.lt)},G.minimum=G.min=function(){return q(arguments,B.gt)},G.random=(o=9007199254740992,_=Math.random()*o&2097151?function(){return c(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,n,r,i,o,s=0,l=[],d=new G(O);if(null==t?t=R:k(t,0,g),i=a(t/h),z)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(i*=2));s<i;)(o=131072*e[s]+(e[s+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),e[s]=n[0],e[s+1]=n[1]):(l.push(o%1e14),s+=2);s=i/2}else{if(!crypto.randomBytes)throw z=!1,Error(u+"crypto unavailable");for(e=crypto.randomBytes(i*=7);s<i;)(o=281474976710656*(31&e[s])+1099511627776*e[s+1]+4294967296*e[s+2]+16777216*e[s+3]+(e[s+4]<<16)+(e[s+5]<<8)+e[s+6])>=9e15?crypto.randomBytes(7).copy(e,s):(l.push(o%1e14),s+=7);s=i/7}if(!z)for(;s<i;)(o=_())<9e15&&(l[s++]=o%1e14);for(i=l[--s],t%=h,i&&t&&(o=p[h-t],l[s]=c(i/o)*o);0===l[s];l.pop(),s--);if(s<0)l=[r=0];else{for(r=-1;0===l[0];l.splice(0,1),r-=h);for(s=1,o=l[0];o>=10;o/=10,s++);s<h&&(r-=h-s)}return d.e=r,d.c=l,d}),G.sum=function(){for(var t=1,e=arguments,n=new G(e[0]);t<e.length;)n=n.plus(e[t++]);return n},r=function(){var t="0123456789";function e(t,e,n,r){for(var i,o,s=[0],a=0,c=t.length;a<c;){for(o=s.length;o--;s[o]*=e);for(s[0]+=r.indexOf(t.charAt(a++)),i=0;i<s.length;i++)s[i]>n-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/n|0,s[i]%=n)}return s.reverse()}return function(r,i,o,s,a){var c,u,l,d,h,f,p,y,g=r.indexOf("."),m=R,w=M;for(g>=0&&(d=D,D=0,r=r.replace(".",""),f=(y=new G(i)).pow(r.length-g),D=d,y.c=e(A(b(f.c),f.e,"0"),10,o,t),y.e=y.c.length),l=d=(p=e(r,i,o,a?(c=W,t):(c=t,W))).length;0==p[--d];p.pop());if(!p[0])return c.charAt(0);if(g<0?--l:(f.c=p,f.e=l,f.s=s,p=(f=n(f,y,m,w,o)).c,h=f.r,l=f.e),g=p[u=l+m+1],d=o/2,h=h||u<0||null!=p[u+1],h=w<4?(null!=g||h)&&(0==w||w==(f.s<0?3:2)):g>d||g==d&&(4==w||h||6==w&&1&p[u-1]||w==(f.s<0?8:7)),u<1||!p[0])r=h?A(c.charAt(1),-m,c.charAt(0)):c.charAt(0);else{if(p.length=u,h)for(--o;++p[--u]>o;)p[u]=0,u||(++l,p=[1].concat(p));for(d=p.length;!p[--d];);for(g=0,r="";g<=d;r+=c.charAt(p[g++]));r=A(r,l,c.charAt(0))}return r}}(),n=function(){function t(t,e,n){var r,i,o,s,a=0,c=t.length,u=e%y,l=e/y|0;for(t=t.slice();c--;)a=((i=u*(o=t[c]%y)+(r=l*o+(s=t[c]/y|0)*u)%y*y+a)/n|0)+(r/y|0)+l*s,t[c]=i%n;return a&&(t=[a].concat(t)),t}function e(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function n(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]<e[n]?1:0,t[n]=i*r+t[n]-e[n];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(r,i,o,s,a){var u,l,f,p,y,g,b,w,k,v,I,A,_,S,E,T,x,P=r.s==i.s?1:-1,B=r.c,O=i.c;if(!(B&&B[0]&&O&&O[0]))return new G(r.s&&i.s&&(B?!O||B[0]!=O[0]:O)?B&&0==B[0]||!O?0*P:P/0:NaN);for(k=(w=new G(P)).c=[],P=o+(l=r.e-i.e)+1,a||(a=d,l=m(r.e/h)-m(i.e/h),P=P/h|0),f=0;O[f]==(B[f]||0);f++);if(O[f]>(B[f]||0)&&l--,P<0)k.push(1),p=!0;else{for(S=B.length,T=O.length,f=0,P+=2,(y=c(a/(O[0]+1)))>1&&(O=t(O,y,a),B=t(B,y,a),T=O.length,S=B.length),_=T,I=(v=B.slice(0,T)).length;I<T;v[I++]=0);x=O.slice(),x=[0].concat(x),E=O[0],O[1]>=a/2&&E++;do{if(y=0,(u=e(O,v,T,I))<0){if(A=v[0],T!=I&&(A=A*a+(v[1]||0)),(y=c(A/E))>1)for(y>=a&&(y=a-1),b=(g=t(O,y,a)).length,I=v.length;1==e(g,v,b,I);)y--,n(g,T<b?x:O,b,a),b=g.length,u=1;else 0==y&&(u=y=1),b=(g=O.slice()).length;if(b<I&&(g=[0].concat(g)),n(v,g,I,a),I=v.length,-1==u)for(;e(O,v,T,I)<1;)y++,n(v,T<I?x:O,I,a),I=v.length}else 0===u&&(y++,v=[0]);k[f++]=y,v[0]?v[I++]=B[_]||0:(v=[B[_]],I=1)}while((_++<S||null!=v[0])&&P--);p=null!=v[0],k[0]||k.splice(0,1)}if(a==d){for(f=1,P=k[0];P>=10;P/=10,f++);Z(w,o+(w.e=f+l*h-1)+1,s,p)}else w.e=l,w.r=+p;return w}}(),S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,T=/^\.([^.]+)$/,x=/^-?(Infinity|NaN)$/,P=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(t,e,n,r){var i,o=n?e:e.replace(P,"");if(x.test(o))t.s=isNaN(o)?null:o<0?-1:1;else{if(!n&&(o=o.replace(S,(function(t,e,n){return i="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=i?t:e})),r&&(i=r,o=o.replace(E,"$1").replace(T,"0.$1")),e!=o))return new G(o,i);if(G.DEBUG)throw Error(u+"Not a"+(r?" base "+r:"")+" number: "+e);t.s=null}t.c=t.e=null},B.absoluteValue=B.abs=function(){var t=new G(this);return t.s<0&&(t.s=1),t},B.comparedTo=function(t,e){return w(this,new G(t,e))},B.decimalPlaces=B.dp=function(t,e){var n,r,i,o=this;if(null!=t)return k(t,0,g),null==e?e=M:k(e,0,8),Z(new G(o),t+o.e+1,e);if(!(n=o.c))return null;if(r=((i=n.length-1)-m(this.e/h))*h,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},B.dividedBy=B.div=function(t,e){return n(this,new G(t,e),R,M)},B.dividedToIntegerBy=B.idiv=function(t,e){return n(this,new G(t,e),0,1)},B.exponentiatedBy=B.pow=function(t,e){var n,r,i,o,s,l,d,f,p=this;if((t=new G(t)).c&&!t.isInteger())throw Error(u+"Exponent not an integer: "+V(t));if(null!=e&&(e=new G(e)),s=t.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!t.c||!t.c[0])return f=new G(Math.pow(+V(p),s?2-v(t):+V(t))),e?f.mod(e):f;if(l=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new G(NaN);(r=!l&&p.isInteger()&&e.isInteger())&&(p=p.mod(e))}else{if(t.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||s&&p.c[1]>=24e7:p.c[0]<8e13||s&&p.c[0]<=9999975e7)))return o=p.s<0&&v(t)?-0:0,p.e>-1&&(o=1/o),new G(l?1/o:o);D&&(o=a(D/h+2))}for(s?(n=new G(.5),l&&(t.s=1),d=v(t)):d=(i=Math.abs(+V(t)))%2,f=new G(O);;){if(d){if(!(f=f.times(p)).c)break;o?f.c.length>o&&(f.c.length=o):r&&(f=f.mod(e))}if(i){if(0===(i=c(i/2)))break;d=i%2}else if(Z(t=t.times(n),t.e+1,1),t.e>14)d=v(t);else{if(0===(i=+V(t)))break;d=i%2}p=p.times(p),o?p.c&&p.c.length>o&&(p.c.length=o):r&&(p=p.mod(e))}return r?f:(l&&(f=O.div(f)),e?f.mod(e):o?Z(f,D,M,undefined):f)},B.integerValue=function(t){var e=new G(this);return null==t?t=M:k(t,0,8),Z(e,e.e+1,t)},B.isEqualTo=B.eq=function(t,e){return 0===w(this,new G(t,e))},B.isFinite=function(){return!!this.c},B.isGreaterThan=B.gt=function(t,e){return w(this,new G(t,e))>0},B.isGreaterThanOrEqualTo=B.gte=function(t,e){return 1===(e=w(this,new G(t,e)))||0===e},B.isInteger=function(){return!!this.c&&m(this.e/h)>this.c.length-2},B.isLessThan=B.lt=function(t,e){return w(this,new G(t,e))<0},B.isLessThanOrEqualTo=B.lte=function(t,e){return-1===(e=w(this,new G(t,e)))||0===e},B.isNaN=function(){return!this.s},B.isNegative=function(){return this.s<0},B.isPositive=function(){return this.s>0},B.isZero=function(){return!!this.c&&0==this.c[0]},B.minus=function(t,e){var n,r,i,o,s=this,a=s.s;if(e=(t=new G(t,e)).s,!a||!e)return new G(NaN);if(a!=e)return t.s=-e,s.plus(t);var c=s.e/h,u=t.e/h,l=s.c,f=t.c;if(!c||!u){if(!l||!f)return l?(t.s=-e,t):new G(f?s:NaN);if(!l[0]||!f[0])return f[0]?(t.s=-e,t):new G(l[0]?s:3==M?-0:0)}if(c=m(c),u=m(u),l=l.slice(),a=c-u){for((o=a<0)?(a=-a,i=l):(u=c,i=f),i.reverse(),e=a;e--;i.push(0));i.reverse()}else for(r=(o=(a=l.length)<(e=f.length))?a:e,a=e=0;e<r;e++)if(l[e]!=f[e]){o=l[e]<f[e];break}if(o&&(i=l,l=f,f=i,t.s=-t.s),(e=(r=f.length)-(n=l.length))>0)for(;e--;l[n++]=0);for(e=d-1;r>a;){if(l[--r]<f[r]){for(n=r;n&&!l[--n];l[n]=e);--l[n],l[r]+=d}l[r]-=f[r]}for(;0==l[0];l.splice(0,1),--u);return l[0]?$(t,l,u):(t.s=3==M?-1:1,t.c=[t.e=0],t)},B.modulo=B.mod=function(t,e){var r,i,o=this;return t=new G(t,e),!o.c||!t.s||t.c&&!t.c[0]?new G(NaN):!t.c||o.c&&!o.c[0]?new G(o):(9==K?(i=t.s,t.s=1,r=n(o,t,0,3),t.s=i,r.s*=i):r=n(o,t,0,K),(t=o.minus(r.times(t))).c[0]||1!=K||(t.s=o.s),t)},B.multipliedBy=B.times=function(t,e){var n,r,i,o,s,a,c,u,l,f,p,g,b,w,k,v=this,I=v.c,A=(t=new G(t,e)).c;if(!(I&&A&&I[0]&&A[0]))return!v.s||!t.s||I&&!I[0]&&!A||A&&!A[0]&&!I?t.c=t.e=t.s=null:(t.s*=v.s,I&&A?(t.c=[0],t.e=0):t.c=t.e=null),t;for(r=m(v.e/h)+m(t.e/h),t.s*=v.s,(c=I.length)<(f=A.length)&&(b=I,I=A,A=b,i=c,c=f,f=i),i=c+f,b=[];i--;b.push(0));for(w=d,k=y,i=f;--i>=0;){for(n=0,p=A[i]%k,g=A[i]/k|0,o=i+(s=c);o>i;)n=((u=p*(u=I[--s]%k)+(a=g*u+(l=I[s]/k|0)*p)%k*k+b[o]+n)/w|0)+(a/k|0)+g*l,b[o--]=u%w;b[o]=n}return n?++r:b.splice(0,1),$(t,b,r)},B.negated=function(){var t=new G(this);return t.s=-t.s||null,t},B.plus=function(t,e){var n,r=this,i=r.s;if(e=(t=new G(t,e)).s,!i||!e)return new G(NaN);if(i!=e)return t.s=-e,r.minus(t);var o=r.e/h,s=t.e/h,a=r.c,c=t.c;if(!o||!s){if(!a||!c)return new G(i/0);if(!a[0]||!c[0])return c[0]?t:new G(a[0]?r:0*i)}if(o=m(o),s=m(s),a=a.slice(),i=o-s){for(i>0?(s=o,n=c):(i=-i,n=a),n.reverse();i--;n.push(0));n.reverse()}for((i=a.length)-(e=c.length)<0&&(n=c,c=a,a=n,e=i),i=0;e;)i=(a[--e]=a[e]+c[e]+i)/d|0,a[e]=d===a[e]?0:a[e]%d;return i&&(a=[i].concat(a),++s),$(t,a,s)},B.precision=B.sd=function(t,e){var n,r,i,o=this;if(null!=t&&t!==!!t)return k(t,1,g),null==e?e=M:k(e,0,8),Z(new G(o),t,e);if(!(n=o.c))return null;if(r=(i=n.length-1)*h+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return t&&o.e+1>r&&(r=o.e+1),r},B.shiftedBy=function(t){return k(t,-9007199254740991,f),this.times("1e"+t)},B.squareRoot=B.sqrt=function(){var t,e,r,i,o,s=this,a=s.c,c=s.s,u=s.e,l=R+4,d=new G("0.5");if(1!==c||!a||!a[0])return new G(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(c=Math.sqrt(+V(s)))||c==1/0?(((e=b(a)).length+u)%2==0&&(e+="0"),c=Math.sqrt(+e),u=m((u+1)/2)-(u<0||u%2),r=new G(e=c==1/0?"5e"+u:(e=c.toExponential()).slice(0,e.indexOf("e")+1)+u)):r=new G(c+""),r.c[0])for((c=(u=r.e)+l)<3&&(c=0);;)if(o=r,r=d.times(o.plus(n(s,o,l,1))),b(o.c).slice(0,c)===(e=b(r.c)).slice(0,c)){if(r.e<u&&--c,"9999"!=(e=e.slice(c-3,c+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(Z(r,r.e+R+2,1),t=!r.times(r).eq(s));break}if(!i&&(Z(o,o.e+R+2,0),o.times(o).eq(s))){r=o;break}l+=4,c+=4,i=1}return Z(r,r.e+R+1,M,t)},B.toExponential=function(t,e){return null!=t&&(k(t,0,g),t++),H(this,t,e,1)},B.toFixed=function(t,e){return null!=t&&(k(t,0,g),t=t+this.e+1),H(this,t,e)},B.toFormat=function(t,e,n){var r,i=this;if(null==n)null!=t&&e&&"object"==typeof e?(n=e,e=null):t&&"object"==typeof t?(n=t,t=e=null):n=j;else if("object"!=typeof n)throw Error(u+"Argument not an object: "+n);if(r=i.toFixed(t,e),i.c){var o,s=r.split("."),a=+n.groupSize,c=+n.secondaryGroupSize,l=n.groupSeparator||"",d=s[0],h=s[1],f=i.s<0,p=f?d.slice(1):d,y=p.length;if(c&&(o=a,a=c,c=o,y-=o),a>0&&y>0){for(o=y%a||a,d=p.substr(0,o);o<y;o+=a)d+=l+p.substr(o,a);c>0&&(d+=l+p.slice(o)),f&&(d="-"+d)}r=h?d+(n.decimalSeparator||"")+((c=+n.fractionGroupSize)?h.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):h):d}return(n.prefix||"")+r+(n.suffix||"")},B.toFraction=function(t){var e,r,i,o,s,a,c,l,d,f,y,g,m=this,w=m.c;if(null!=t&&(!(c=new G(t)).isInteger()&&(c.c||1!==c.s)||c.lt(O)))throw Error(u+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+V(c));if(!w)return new G(m);for(e=new G(O),d=r=new G(O),i=l=new G(O),g=b(w),s=e.e=g.length-m.e-1,e.c[0]=p[(a=s%h)<0?h+a:a],t=!t||c.comparedTo(e)>0?s>0?e:d:c,a=L,L=1/0,c=new G(g),l.c[0]=0;f=n(c,e,0,1),1!=(o=r.plus(f.times(i))).comparedTo(t);)r=i,i=o,d=l.plus(f.times(o=d)),l=o,e=c.minus(f.times(o=e)),c=o;return o=n(t.minus(r),i,0,1),l=l.plus(o.times(d)),r=r.plus(o.times(i)),l.s=d.s=m.s,y=n(d,i,s*=2,M).minus(m).abs().comparedTo(n(l,r,s,M).minus(m).abs())<1?[d,i]:[l,r],L=a,y},B.toNumber=function(){return+V(this)},B.toPrecision=function(t,e){return null!=t&&k(t,1,g),H(this,t,e,2)},B.toString=function(t){var e,n=this,i=n.s,o=n.e;return null===o?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(null==t?e=o<=C||o>=U?I(b(n.c),o):A(b(n.c),o,"0"):10===t&&F?e=A(b((n=Z(new G(n),R+o+1,M)).c),n.e,"0"):(k(t,2,W.length,"Base"),e=r(A(b(n.c),o,"0"),10,t,i,!0)),i<0&&n.c[0]&&(e="-"+e)),e},B.valueOf=B.toJSON=function(){return V(this)},B._isBigNumber=!0,null!=e&&G.set(e),G}(),o.default=o.BigNumber=o,void 0===(r=(function(){return o}).call(e,n,e,t))||(t.exports=r)}()},96346:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.s16=e.s8=e.nu64be=e.u48be=e.u40be=e.u32be=e.u24be=e.u16be=e.nu64=e.u48=e.u40=e.u32=e.u24=e.u16=e.u8=e.offset=e.greedy=e.Constant=e.UTF8=e.CString=e.Blob=e.Boolean=e.BitField=e.BitStructure=e.VariantLayout=e.Union=e.UnionLayoutDiscriminator=e.UnionDiscriminator=e.Structure=e.Sequence=e.DoubleBE=e.Double=e.FloatBE=e.Float=e.NearInt64BE=e.NearInt64=e.NearUInt64BE=e.NearUInt64=e.IntBE=e.Int=e.UIntBE=e.UInt=e.OffsetLayout=e.GreedyCount=e.ExternalLayout=e.bindConstructorLayout=e.nameWithProperty=e.Layout=e.uint8ArrayToBuffer=e.checkUint8Array=void 0,e.constant=e.utf8=e.cstr=e.blob=e.unionLayoutDiscriminator=e.union=e.seq=e.bits=e.struct=e.f64be=e.f64=e.f32be=e.f32=e.ns64be=e.s48be=e.s40be=e.s32be=e.s24be=e.s16be=e.ns64=e.s48=e.s40=e.s32=e.s24=void 0;const r=n(72753);function i(t){if(!(t instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}function o(t){return i(t),r.Buffer.from(t.buffer,t.byteOffset,t.length)}e.checkUint8Array=i,e.uint8ArrayToBuffer=o;class s{constructor(t,e){if(!Number.isInteger(t))throw new TypeError("span must be an integer");this.span=t,this.property=e}makeDestinationObject(){return{}}getSpan(t,e){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(t){const e=Object.create(this.constructor.prototype);return Object.assign(e,this),e.property=t,e}fromArray(t){}}function a(t,e){return e.property?t+"["+e.property+"]":t}e.Layout=s,e.nameWithProperty=a,e.bindConstructorLayout=function(t,e){if("function"!=typeof t)throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(t,"layout_"))throw new Error("Class is already bound to a layout");if(!(e&&e instanceof s))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");t.layout_=e,e.boundConstructor_=t,e.makeDestinationObject=()=>new t,Object.defineProperty(t.prototype,"encode",{value(t,n){return e.encode(this,t,n)},writable:!0}),Object.defineProperty(t,"decode",{value:(t,n)=>e.decode(t,n),writable:!0})};class c extends s{isCount(){throw new Error("ExternalLayout is abstract")}}e.ExternalLayout=c;class u extends c{constructor(t=1,e){if(!Number.isInteger(t)||0>=t)throw new TypeError("elementSpan must be a (positive) integer");super(-1,e),this.elementSpan=t}isCount(){return!0}decode(t,e=0){i(t);const n=t.length-e;return Math.floor(n/this.elementSpan)}encode(t,e,n){return 0}}e.GreedyCount=u;class l extends c{constructor(t,e=0,n){if(!(t instanceof s))throw new TypeError("layout must be a Layout");if(!Number.isInteger(e))throw new TypeError("offset must be integer or undefined");super(t.span,n||t.property),this.layout=t,this.offset=e}isCount(){return this.layout instanceof d||this.layout instanceof h}decode(t,e=0){return this.layout.decode(t,e+this.offset)}encode(t,e,n=0){return this.layout.encode(t,e,n+this.offset)}}e.OffsetLayout=l;class d extends s{constructor(t,e){if(super(t,e),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readUIntLE(e,this.span)}encode(t,e,n=0){return o(e).writeUIntLE(t,n,this.span),this.span}}e.UInt=d;class h extends s{constructor(t,e){if(super(t,e),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readUIntBE(e,this.span)}encode(t,e,n=0){return o(e).writeUIntBE(t,n,this.span),this.span}}e.UIntBE=h;class f extends s{constructor(t,e){if(super(t,e),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readIntLE(e,this.span)}encode(t,e,n=0){return o(e).writeIntLE(t,n,this.span),this.span}}e.Int=f;class p extends s{constructor(t,e){if(super(t,e),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(t,e=0){return o(t).readIntBE(e,this.span)}encode(t,e,n=0){return o(e).writeIntBE(t,n,this.span),this.span}}e.IntBE=p;const y=Math.pow(2,32);function g(t){const e=Math.floor(t/y);return{hi32:e,lo32:t-e*y}}function m(t,e){return t*y+e}class b extends s{constructor(t){super(8,t)}decode(t,e=0){const n=o(t),r=n.readUInt32LE(e);return m(n.readUInt32LE(e+4),r)}encode(t,e,n=0){const r=g(t),i=o(e);return i.writeUInt32LE(r.lo32,n),i.writeUInt32LE(r.hi32,n+4),8}}e.NearUInt64=b;class w extends s{constructor(t){super(8,t)}decode(t,e=0){const n=o(t);return m(n.readUInt32BE(e),n.readUInt32BE(e+4))}encode(t,e,n=0){const r=g(t),i=o(e);return i.writeUInt32BE(r.hi32,n),i.writeUInt32BE(r.lo32,n+4),8}}e.NearUInt64BE=w;class k extends s{constructor(t){super(8,t)}decode(t,e=0){const n=o(t),r=n.readUInt32LE(e);return m(n.readInt32LE(e+4),r)}encode(t,e,n=0){const r=g(t),i=o(e);return i.writeUInt32LE(r.lo32,n),i.writeInt32LE(r.hi32,n+4),8}}e.NearInt64=k;class v extends s{constructor(t){super(8,t)}decode(t,e=0){const n=o(t);return m(n.readInt32BE(e),n.readUInt32BE(e+4))}encode(t,e,n=0){const r=g(t),i=o(e);return i.writeInt32BE(r.hi32,n),i.writeUInt32BE(r.lo32,n+4),8}}e.NearInt64BE=v;class I extends s{constructor(t){super(4,t)}decode(t,e=0){return o(t).readFloatLE(e)}encode(t,e,n=0){return o(e).writeFloatLE(t,n),4}}e.Float=I;class A extends s{constructor(t){super(4,t)}decode(t,e=0){return o(t).readFloatBE(e)}encode(t,e,n=0){return o(e).writeFloatBE(t,n),4}}e.FloatBE=A;class _ extends s{constructor(t){super(8,t)}decode(t,e=0){return o(t).readDoubleLE(e)}encode(t,e,n=0){return o(e).writeDoubleLE(t,n),8}}e.Double=_;class S extends s{constructor(t){super(8,t)}decode(t,e=0){return o(t).readDoubleBE(e)}encode(t,e,n=0){return o(e).writeDoubleBE(t,n),8}}e.DoubleBE=S;class E extends s{constructor(t,e,n){if(!(t instanceof s))throw new TypeError("elementLayout must be a Layout");if(!(e instanceof c&&e.isCount()||Number.isInteger(e)&&0<=e))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let r=-1;!(e instanceof c)&&0<t.span&&(r=e*t.span),super(r,n),this.elementLayout=t,this.count=e}getSpan(t,e=0){if(0<=this.span)return this.span;let n=0,r=this.count;if(r instanceof c&&(r=r.decode(t,e)),0<this.elementLayout.span)n=r*this.elementLayout.span;else{let i=0;for(;i<r;)n+=this.elementLayout.getSpan(t,e+n),++i}return n}decode(t,e=0){const n=[];let r=0,i=this.count;for(i instanceof c&&(i=i.decode(t,e));r<i;)n.push(this.elementLayout.decode(t,e)),e+=this.elementLayout.getSpan(t,e),r+=1;return n}encode(t,e,n=0){const r=this.elementLayout,i=t.reduce(((t,i)=>t+r.encode(i,e,n+t)),0);return this.count instanceof c&&this.count.encode(t.length,e,n),i}}e.Sequence=E;class T extends s{constructor(t,e,n){if(!Array.isArray(t)||!t.reduce(((t,e)=>t&&e instanceof s),!0))throw new TypeError("fields must be array of Layout instances");"boolean"==typeof e&&void 0===n&&(n=e,e=void 0);for(const o of t)if(0>o.span&&void 0===o.property)throw new Error("fields cannot contain unnamed variable-length layout");let r=-1;try{r=t.reduce(((t,e)=>t+e.getSpan()),0)}catch(i){}super(r,e),this.fields=t,this.decodePrefixes=!!n}getSpan(t,e=0){if(0<=this.span)return this.span;let n=0;try{n=this.fields.reduce(((n,r)=>{const i=r.getSpan(t,e);return e+=i,n+i}),0)}catch(r){throw new RangeError("indeterminate span")}return n}decode(t,e=0){i(t);const n=this.makeDestinationObject();for(const r of this.fields)if(void 0!==r.property&&(n[r.property]=r.decode(t,e)),e+=r.getSpan(t,e),this.decodePrefixes&&t.length===e)break;return n}encode(t,e,n=0){const r=n;let i=0,o=0;for(const s of this.fields){let r=s.span;if(o=0<r?r:0,void 0!==s.property){const i=t[s.property];void 0!==i&&(o=s.encode(i,e,n),0>r&&(r=s.getSpan(e,n)))}i=n,n+=r}return i+o-r}fromArray(t){const e=this.makeDestinationObject();for(const n of this.fields)void 0!==n.property&&0<t.length&&(e[n.property]=t.shift());return e}layoutFor(t){if("string"!=typeof t)throw new TypeError("property must be string");for(const e of this.fields)if(e.property===t)return e}offsetOf(t){if("string"!=typeof t)throw new TypeError("property must be string");let e=0;for(const n of this.fields){if(n.property===t)return e;0>n.span?e=-1:0<=e&&(e+=n.span)}}}e.Structure=T;class x{constructor(t){this.property=t}decode(t,e){throw new Error("UnionDiscriminator is abstract")}encode(t,e,n){throw new Error("UnionDiscriminator is abstract")}}e.UnionDiscriminator=x;class P extends x{constructor(t,e){if(!(t instanceof c&&t.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(e||t.property||"variant"),this.layout=t}decode(t,e){return this.layout.decode(t,e)}encode(t,e,n){return this.layout.encode(t,e,n)}}e.UnionLayoutDiscriminator=P;class B extends s{constructor(t,e,n){let r;if(t instanceof d||t instanceof h)r=new P(new l(t));else if(t instanceof c&&t.isCount())r=new P(t);else{if(!(t instanceof x))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");r=t}if(void 0===e&&(e=null),!(null===e||e instanceof s))throw new TypeError("defaultLayout must be null or a Layout");if(null!==e){if(0>e.span)throw new Error("defaultLayout must have constant span");void 0===e.property&&(e=e.replicate("content"))}let i=-1;e&&(i=e.span,0<=i&&(t instanceof d||t instanceof h)&&(i+=r.layout.span)),super(i,n),this.discriminator=r,this.usesPrefixDiscriminator=t instanceof d||t instanceof h,this.defaultLayout=e,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(t){return o(t)},this.configGetSourceVariant=function(t){o=t.bind(this)}}getSpan(t,e=0){if(0<=this.span)return this.span;const n=this.getVariant(t,e);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.getSpan(t,e)}defaultGetSourceVariant(t){if(Object.prototype.hasOwnProperty.call(t,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(t,this.defaultLayout.property))return;const e=this.registry[t[this.discriminator.property]];if(e&&(!e.layout||e.property&&Object.prototype.hasOwnProperty.call(t,e.property)))return e}else for(const e in this.registry){const n=this.registry[e];if(n.property&&Object.prototype.hasOwnProperty.call(t,n.property))return n}throw new Error("unable to infer src variant")}decode(t,e=0){let n;const r=this.discriminator,i=r.decode(t,e),o=this.registry[i];if(void 0===o){const o=this.defaultLayout;let s=0;this.usesPrefixDiscriminator&&(s=r.layout.span),n=this.makeDestinationObject(),n[r.property]=i,n[o.property]=o.decode(t,e+s)}else n=o.decode(t,e);return n}encode(t,e,n=0){const r=this.getSourceVariant(t);if(void 0===r){const r=this.discriminator,i=this.defaultLayout;let o=0;return this.usesPrefixDiscriminator&&(o=r.layout.span),r.encode(t[r.property],e,n),o+i.encode(t[i.property],e,n+o)}return r.encode(t,e,n)}addVariant(t,e,n){const r=new O(this,t,e,n);return this.registry[t]=r,r}getVariant(t,e=0){let n;return n=t instanceof Uint8Array?this.discriminator.decode(t,e):t,this.registry[n]}}e.Union=B;class O extends s{constructor(t,e,n,r){if(!(t instanceof B))throw new TypeError("union must be a Union");if(!Number.isInteger(e)||0>e)throw new TypeError("variant must be a (non-negative) integer");if("string"==typeof n&&void 0===r&&(r=n,n=null),n){if(!(n instanceof s))throw new TypeError("layout must be a Layout");if(null!==t.defaultLayout&&0<=n.span&&n.span>t.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if("string"!=typeof r)throw new TypeError("variant must have a String property")}let i=t.span;0>t.span&&(i=n?n.span:0,0<=i&&t.usesPrefixDiscriminator&&(i+=t.discriminator.layout.span)),super(i,r),this.union=t,this.variant=e,this.layout=n||null}getSpan(t,e=0){if(0<=this.span)return this.span;let n=0;this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span);let r=0;return this.layout&&(r=this.layout.getSpan(t,e+n)),n+r}decode(t,e=0){const n=this.makeDestinationObject();if(this!==this.union.getVariant(t,e))throw new Error("variant mismatch");let r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(t,e+r):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}encode(t,e,n=0){let r=0;if(this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(t,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,e,n);let i=r;if(this.layout&&(this.layout.encode(t[this.property],e,n+r),i+=this.layout.getSpan(e,n+r),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i}fromArray(t){if(this.layout)return this.layout.fromArray(t)}}function R(t){return 0>t&&(t+=4294967296),t}e.VariantLayout=O;class M extends s{constructor(t,e,n){if(!(t instanceof d||t instanceof h))throw new TypeError("word must be a UInt or UIntBE layout");if("string"==typeof e&&void 0===n&&(n=e,e=!1),4<t.span)throw new RangeError("word cannot exceed 32 bits");super(t.span,n),this.word=t,this.msb=!!e,this.fields=[];let r=0;this._packedSetValue=function(t){return r=R(t),this},this._packedGetValue=function(){return r}}decode(t,e=0){const n=this.makeDestinationObject(),r=this.word.decode(t,e);this._packedSetValue(r);for(const i of this.fields)void 0!==i.property&&(n[i.property]=i.decode(t));return n}encode(t,e,n=0){const r=this.word.decode(e,n);this._packedSetValue(r);for(const i of this.fields)if(void 0!==i.property){const e=t[i.property];void 0!==e&&i.encode(e)}return this.word.encode(this._packedGetValue(),e,n)}addField(t,e){const n=new C(this,t,e);return this.fields.push(n),n}addBoolean(t){const e=new U(this,t);return this.fields.push(e),e}fieldFor(t){if("string"!=typeof t)throw new TypeError("property must be string");for(const e of this.fields)if(e.property===t)return e}}e.BitStructure=M;class C{constructor(t,e,n){if(!(t instanceof M))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(e)||0>=e)throw new TypeError("bits must be positive integer");const r=8*t.span,i=t.fields.reduce(((t,e)=>t+e.bits),0);if(e+i>r)throw new Error("bits too long for span remainder ("+(r-i)+" of "+r+" remain)");this.container=t,this.bits=e,this.valueMask=(1<<e)-1,32===e&&(this.valueMask=4294967295),this.start=i,this.container.msb&&(this.start=r-i-e),this.wordMask=R(this.valueMask<<this.start),this.property=n}decode(t,e){return R(this.container._packedGetValue()&this.wordMask)>>>this.start}encode(t){if("number"!=typeof t||!Number.isInteger(t)||t!==R(t&this.valueMask))throw new TypeError(a("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const e=this.container._packedGetValue(),n=R(t<<this.start);this.container._packedSetValue(R(e&~this.wordMask)|n)}}e.BitField=C;class U extends C{constructor(t,e){super(t,1,e)}decode(t,e){return!!super.decode(t,e)}encode(t){"boolean"==typeof t&&(t=+t),super.encode(t)}}e.Boolean=U;class N extends s{constructor(t,e){if(!(t instanceof c&&t.isCount()||Number.isInteger(t)&&0<=t))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let n=-1;t instanceof c||(n=t),super(n,e),this.length=t}getSpan(t,e){let n=this.span;return 0>n&&(n=this.length.decode(t,e)),n}decode(t,e=0){let n=this.span;return 0>n&&(n=this.length.decode(t,e)),o(t).slice(e,e+n)}encode(t,e,n){let r=this.length;if(this.length instanceof c&&(r=t.length),!(t instanceof Uint8Array&&r===t.length))throw new TypeError(a("Blob.encode",this)+" requires (length "+r+") Uint8Array as src");if(n+r>e.length)throw new RangeError("encoding overruns Uint8Array");const i=o(t);return o(e).write(i.toString("hex"),n,r,"hex"),this.length instanceof c&&this.length.encode(r,e,n),r}}e.Blob=N;class L extends s{constructor(t){super(-1,t)}getSpan(t,e=0){i(t);let n=e;for(;n<t.length&&0!==t[n];)n+=1;return 1+n-e}decode(t,e=0){const n=this.getSpan(t,e);return o(t).slice(e,e+n-1).toString("utf-8")}encode(t,e,n=0){"string"!=typeof t&&(t=String(t));const i=r.Buffer.from(t,"utf8"),s=i.length;if(n+s>e.length)throw new RangeError("encoding overruns Buffer");const a=o(e);return i.copy(a,n),a[n+s]=0,s+1}}e.CString=L;class z extends s{constructor(t,e){if("string"==typeof t&&void 0===e&&(e=t,t=void 0),void 0===t)t=-1;else if(!Number.isInteger(t))throw new TypeError("maxSpan must be an integer");super(-1,e),this.maxSpan=t}getSpan(t,e=0){return i(t),t.length-e}decode(t,e=0){const n=this.getSpan(t,e);if(0<=this.maxSpan&&this.maxSpan<n)throw new RangeError("text length exceeds maxSpan");return o(t).slice(e,e+n).toString("utf-8")}encode(t,e,n=0){"string"!=typeof t&&(t=String(t));const i=r.Buffer.from(t,"utf8"),s=i.length;if(0<=this.maxSpan&&this.maxSpan<s)throw new RangeError("text length exceeds maxSpan");if(n+s>e.length)throw new RangeError("encoding overruns Buffer");return i.copy(o(e),n),s}}e.UTF8=z;class K extends s{constructor(t,e){super(0,e),this.value=t}decode(t,e){return this.value}encode(t,e,n){return 0}}e.Constant=K,e.greedy=(t,e)=>new u(t,e),e.offset=(t,e,n)=>new l(t,e,n),e.u8=t=>new d(1,t),e.u16=t=>new d(2,t),e.u24=t=>new d(3,t),e.u32=t=>new d(4,t),e.u40=t=>new d(5,t),e.u48=t=>new d(6,t),e.nu64=t=>new b(t),e.u16be=t=>new h(2,t),e.u24be=t=>new h(3,t),e.u32be=t=>new h(4,t),e.u40be=t=>new h(5,t),e.u48be=t=>new h(6,t),e.nu64be=t=>new w(t),e.s8=t=>new f(1,t),e.s16=t=>new f(2,t),e.s24=t=>new f(3,t),e.s32=t=>new f(4,t),e.s40=t=>new f(5,t),e.s48=t=>new f(6,t),e.ns64=t=>new k(t),e.s16be=t=>new p(2,t),e.s24be=t=>new p(3,t),e.s32be=t=>new p(4,t),e.s40be=t=>new p(5,t),e.s48be=t=>new p(6,t),e.ns64be=t=>new v(t),e.f32=t=>new I(t),e.f32be=t=>new A(t),e.f64=t=>new _(t),e.f64be=t=>new S(t),e.struct=(t,e,n)=>new T(t,e,n),e.bits=(t,e,n)=>new M(t,e,n),e.seq=(t,e,n)=>new E(t,e,n),e.union=(t,e,n)=>new B(t,e,n),e.unionLayoutDiscriminator=(t,e)=>new P(t,e),e.blob=(t,e)=>new N(t,e),e.cstr=t=>new L(t),e.utf8=(t,e)=>new z(t,e),e.constant=(t,e)=>new K(t,e)},72753:(t,e,n)=>{"use strict";const r=n(95766),i=n(62333),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return d(t)}return u(t,e,n)}function u(t,e,n){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=0|y(t,e);let r=a(n);const i=r.write(t,e);i!==n&&(r=r.slice(0,i));return r}(t,e);if(ArrayBuffer.isView(t))return function(t){if(V(t,Uint8Array)){const e=new Uint8Array(t);return f(e.buffer,e.byteOffset,e.byteLength)}return h(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(V(t,ArrayBuffer)||t&&V(t.buffer,ArrayBuffer))return f(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(V(t,SharedArrayBuffer)||t&&V(t.buffer,SharedArrayBuffer)))return f(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return c.from(r,e,n);const i=function(t){if(c.isBuffer(t)){const e=0|p(t.length),n=a(e);return 0===n.length||t.copy(n,0,0,e),n}if(void 0!==t.length)return"number"!=typeof t.length||X(t.length)?a(0):h(t);if("Buffer"===t.type&&Array.isArray(t.data))return h(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function d(t){return l(t),a(t<0?0:0|p(t))}function h(t){const e=t.length<0?0:0|p(t.length),n=a(e);for(let r=0;r<e;r+=1)n[r]=255&t[r];return n}function f(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n),Object.setPrototypeOf(r,c.prototype),r}function p(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function y(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||V(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return $(t).length;default:if(i)return r?-1:q(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,n){let r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return B(this,e,n);case"utf8":case"utf-8":return E(this,e,n);case"ascii":return x(this,e,n);case"latin1":case"binary":return P(this,e,n);case"base64":return S(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function b(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),X(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=c.from(e,r)),c.isBuffer(e))return 0===e.length?-1:w(t,e,n,r,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):w(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function w(t,e,n,r,i){let o,s=1,a=t.length,c=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,n/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let r=-1;for(o=n;o<a;o++)if(u(t,o)===u(e,-1===r?0:o-r)){if(-1===r&&(r=o),o-r+1===c)return r*s}else-1!==r&&(o-=o-r),r=-1}else for(n+c>a&&(n=a-c),o=n;o>=0;o--){let n=!0;for(let r=0;r<c;r++)if(u(t,o+r)!==u(e,r)){n=!1;break}if(n)return o}return-1}function k(t,e,n,r){n=Number(n)||0;const i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;const o=e.length;let s;for(r>o/2&&(r=o/2),s=0;s<r;++s){const r=parseInt(e.substr(2*s,2),16);if(X(r))return s;t[n+s]=r}return s}function v(t,e,n,r){return Z(q(e,t.length-n),t,n,r)}function I(t,e,n,r){return Z(function(t){const e=[];for(let n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function A(t,e,n,r){return Z($(e),t,n,r)}function _(t,e,n,r){return Z(function(t,e){let n,r,i;const o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function S(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function E(t,e,n){n=Math.min(t.length,n);const r=[];let i=e;for(;i<n;){const e=t[i];let o=null,s=e>239?4:e>223?3:e>191?2:1;if(i+s<=n){let n,r,a,c;switch(s){case 1:e<128&&(o=e);break;case 2:n=t[i+1],128==(192&n)&&(c=(31&e)<<6|63&n,c>127&&(o=c));break;case 3:n=t[i+1],r=t[i+2],128==(192&n)&&128==(192&r)&&(c=(15&e)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:n=t[i+1],r=t[i+2],a=t[i+3],128==(192&n)&&128==(192&r)&&128==(192&a)&&(c=(15&e)<<18|(63&n)<<12|(63&r)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=s}return function(t){const e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);let n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=T));return n}(r)}e.kMaxLength=s,c.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(t,e,n){return u(t,e,n)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(t,e,n){return function(t,e,n){return l(t),t<=0?a(t):void 0!==e?"string"==typeof n?a(t).fill(e,n):a(t).fill(e):a(t)}(t,e,n)},c.allocUnsafe=function(t){return d(t)},c.allocUnsafeSlow=function(t){return d(t)},c.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==c.prototype},c.compare=function(t,e){if(V(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),V(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,r=e.length;for(let i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);let n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;const r=c.allocUnsafe(e);let i=0;for(n=0;n<t.length;++n){let e=t[n];if(V(e,Uint8Array))i+e.length>r.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(r,i)):Uint8Array.prototype.set.call(r,e,i);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(r,i)}i+=e.length}return r},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},c.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},c.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},c.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?E(this,0,t):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){let t="";const n=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(t,e,n,r,i){if(V(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;let o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0);const a=Math.min(o,s),u=this.slice(r,i),l=t.slice(e,n);for(let c=0;c<a;++c)if(u[c]!==l[c]){o=u[c],s=l[c];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},c.prototype.indexOf=function(t,e,n){return b(this,t,e,n,!0)},c.prototype.lastIndexOf=function(t,e,n){return b(this,t,e,n,!1)},c.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return k(this,t,e,n);case"utf8":case"utf-8":return v(this,t,e,n);case"ascii":case"latin1":case"binary":return I(this,t,e,n);case"base64":return A(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function x(t,e,n){let r="";n=Math.min(t.length,n);for(let i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function P(t,e,n){let r="";n=Math.min(t.length,n);for(let i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function B(t,e,n){const r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);let i="";for(let o=e;o<n;++o)i+=J[t[o]];return i}function O(t,e,n){const r=t.slice(e,n);let i="";for(let o=0;o<r.length-1;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function R(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,n,r,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function C(t,e,n,r,i){W(e,r,i,t,n,7);let o=Number(e&BigInt(4294967295));t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=s,s>>=8,t[n++]=s,s>>=8,t[n++]=s,s>>=8,t[n++]=s,n}function U(t,e,n,r,i){W(e,r,i,t,n,7);let o=Number(e&BigInt(4294967295));t[n+7]=o,o>>=8,t[n+6]=o,o>>=8,t[n+5]=o,o>>=8,t[n+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=s,s>>=8,t[n+2]=s,s>>=8,t[n+1]=s,s>>=8,t[n]=s,n+8}function N(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(t,e,n,r,o){return e=+e,n>>>=0,o||N(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function z(t,e,n,r,o){return e=+e,n>>>=0,o||N(t,0,n,8),i.write(t,e,n,r,52,8),n+8}c.prototype.slice=function(t,e){const n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);const r=this.subarray(t,e);return Object.setPrototypeOf(r,c.prototype),r},c.prototype.readUintLE=c.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||R(t,e,this.length);let r=this[t],i=1,o=0;for(;++o<e&&(i*=256);)r+=this[t+o]*i;return r},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||R(t,e,this.length);let r=this[t+--e],i=1;for(;e>0&&(i*=256);)r+=this[t+--e]*i;return r},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=Y((function(t){F(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||G(t,this.length-8);const r=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=Y((function(t){F(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||G(t,this.length-8);const r=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||R(t,e,this.length);let r=this[t],i=1,o=0;for(;++o<e&&(i*=256);)r+=this[t+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*e)),r},c.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||R(t,e,this.length);let r=e,i=1,o=this[t+--r];for(;r>0&&(i*=256);)o+=this[t+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||R(t,2,this.length);const n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(t,e){t>>>=0,e||R(t,2,this.length);const n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=Y((function(t){F(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||G(t,this.length-8);const r=this[t+4]+256*this[t+5]+65536*this[t+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),c.prototype.readBigInt64BE=Y((function(t){F(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||G(t,this.length-8);const r=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+n)})),c.prototype.readFloatLE=function(t,e){return t>>>=0,e||R(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||R(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||R(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||R(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e>>>=0,n>>>=0,!r){M(this,t,e,n,Math.pow(2,8*n)-1,0)}let i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,e,n,r){if(t=+t,e>>>=0,n>>>=0,!r){M(this,t,e,n,Math.pow(2,8*n)-1,0)}let i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=Y((function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Y((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);M(this,t,e,n,r-1,-r)}let i=0,o=1,s=0;for(this[e]=255&t;++i<n&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+n},c.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);M(this,t,e,n,r-1,-r)}let i=n-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+n},c.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=Y((function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Y((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(t,e,n){return L(this,t,e,!0,n)},c.prototype.writeFloatBE=function(t,e,n){return L(this,t,e,!1,n)},c.prototype.writeDoubleLE=function(t,e,n){return z(this,t,e,!0,n)},c.prototype.writeDoubleBE=function(t,e,n){return z(this,t,e,!1,n)},c.prototype.copy=function(t,e,n,r){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);const i=r-n;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),e),i},c.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===t.length){const e=t.charCodeAt(0);("utf8"===r&&e<128||"latin1"===r)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;let i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{const o=c.isBuffer(t)?t:c.from(t,r),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<n-e;++i)this[i+e]=o[i%s]}return this};const K={};function D(t,e,n){K[t]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function j(t){let e="",n=t.length;const r="-"===t[0]?1:0;for(;n>=r+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function W(t,e,n,r,i,o){if(t>n||t<e){const r="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${e}${r} and <= ${n}${r}`,new K.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,n){F(e,"offset"),void 0!==t[e]&&void 0!==t[e+n]||G(e,t.length-(n+1))}(r,i,o)}function F(t,e){if("number"!=typeof t)throw new K.ERR_INVALID_ARG_TYPE(e,"number",t)}function G(t,e,n){if(Math.floor(t)!==t)throw F(t,n),new K.ERR_OUT_OF_RANGE(n||"offset","an integer",t);if(e<0)throw new K.ERR_BUFFER_OUT_OF_BOUNDS;throw new K.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${e}`,t)}D("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),D("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),D("ERR_OUT_OF_RANGE",(function(t,e,n){let r=`The value of "${t}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=j(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=j(i)),i+="n"),r+=` It must be ${e}. Received ${i}`,r}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function q(t,e){let n;e=e||1/0;const r=t.length;let i=null;const o=[];for(let s=0;s<r;++s){if(n=t.charCodeAt(s),n>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function $(t){return r.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Z(t,e,n,r){let i;for(i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function V(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function X(t){return t!=t}const J=function(){const t="0123456789abcdef",e=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)e[r+i]=t[n]+t[i]}return e}();function Y(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},27158:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Account:()=>U,AddressLookupTableAccount:()=>Wt,AddressLookupTableInstruction:()=>Pn,AddressLookupTableProgram:()=>Bn,Authorized:()=>Dn,BLOCKHASH_CACHE_TIMEOUT_MS:()=>Vt,BPF_LOADER_DEPRECATED_PROGRAM_ID:()=>N,BPF_LOADER_PROGRAM_ID:()=>Bt,BpfLoader:()=>Ot,COMPUTE_BUDGET_INSTRUCTION_LAYOUTS:()=>Rn,ComputeBudgetInstruction:()=>On,ComputeBudgetProgram:()=>Mn,Connection:()=>En,Ed25519Program:()=>Un,Enum:()=>P,EpochSchedule:()=>Lt,FeeCalculatorLayout:()=>wt,Keypair:()=>Tn,LAMPORTS_PER_SOL:()=>ur,LOOKUP_TABLE_INSTRUCTION_LAYOUTS:()=>xn,Loader:()=>Pt,Lockup:()=>jn,MAX_SEED_LENGTH:()=>O,Message:()=>J,MessageAccountKeys:()=>W,MessageV0:()=>Y,NONCE_ACCOUNT_LENGTH:()=>vt,NonceAccount:()=>It,PACKET_DATA_SIZE:()=>L,PUBLIC_KEY_LENGTH:()=>R,PublicKey:()=>C,SIGNATURE_LENGTH_IN_BYTES:()=>K,SOLANA_SCHEMA:()=>B,STAKE_CONFIG_ID:()=>Kn,STAKE_INSTRUCTION_LAYOUTS:()=>Fn,SYSTEM_INSTRUCTION_LAYOUTS:()=>Et,SYSVAR_CLOCK_PUBKEY:()=>st,SYSVAR_EPOCH_SCHEDULE_PUBKEY:()=>at,SYSVAR_INSTRUCTIONS_PUBKEY:()=>ct,SYSVAR_RECENT_BLOCKHASHES_PUBKEY:()=>ut,SYSVAR_RENT_PUBKEY:()=>lt,SYSVAR_REWARDS_PUBKEY:()=>dt,SYSVAR_SLOT_HASHES_PUBKEY:()=>ht,SYSVAR_SLOT_HISTORY_PUBKEY:()=>ft,SYSVAR_STAKE_HISTORY_PUBKEY:()=>pt,Secp256k1Program:()=>zn,SendTransactionError:()=>zt,SolanaJSONRPCError:()=>Dt,SolanaJSONRPCErrorCode:()=>Kt,StakeAuthorizationLayout:()=>Gn,StakeInstruction:()=>Wn,StakeProgram:()=>Hn,Struct:()=>x,SystemInstruction:()=>St,SystemProgram:()=>Tt,Transaction:()=>rt,TransactionExpiredBlockheightExceededError:()=>D,TransactionExpiredTimeoutError:()=>j,TransactionInstruction:()=>nt,TransactionMessage:()=>it,TransactionStatus:()=>tt,VALIDATOR_INFO_KEY:()=>Jn,VERSION_PREFIX_MASK:()=>z,VOTE_PROGRAM_ID:()=>tr,ValidatorInfo:()=>Qn,VersionedMessage:()=>Q,VersionedTransaction:()=>ot,VoteAccount:()=>nr,VoteAuthorizationLayout:()=>Vn,VoteInit:()=>qn,VoteInstruction:()=>$n,VoteProgram:()=>Xn,clusterApiUrl:()=>ar,sendAndConfirmRawTransaction:()=>cr,sendAndConfirmTransaction:()=>yt});var r=n(48834),i=n(8448),o=n(21686),s=n(62197),a=n.n(s),c=n(17022),u=n.n(c),l=n(53929),d=n(83871),h=n(96346),f=n(41528),p=n(50974),y=n(50714),g=n(87414),m=n.n(g),b=n(48796),w=n(10846),k=n(89580);o.P6.sha512Sync=(...t)=>(0,i.o)(o.P6.concatBytes(...t));const v=o.P6.randomPrivateKey,I=()=>{const t=o.P6.randomPrivateKey(),e=A(t),n=new Uint8Array(64);return n.set(t),n.set(e,32),{publicKey:e,secretKey:n}},A=o.Z_.getPublicKey;function _(t){try{return o.E9.fromHex(t,!0),!0}catch{return!1}}const S=(t,e)=>o.Z_.sign(t,e.slice(0,32)),E=o.Z_.verify,T=t=>r.Buffer.isBuffer(t)?t:t instanceof Uint8Array?r.Buffer.from(t.buffer,t.byteOffset,t.byteLength):r.Buffer.from(t);class x{constructor(t){Object.assign(this,t)}encode(){return r.Buffer.from((0,d.serialize)(B,this))}static decode(t){return(0,d.deserialize)(B,this,t)}static decodeUnchecked(t){return(0,d.deserializeUnchecked)(B,this,t)}}class P extends x{constructor(t){if(super(t),this.enum="",1!==Object.keys(t).length)throw new Error("Enum can only take single value");Object.keys(t).map((t=>{this.enum=t}))}}const B=new Map,O=32,R=32;let M=1;class C extends x{constructor(t){if(super({}),this._bn=void 0,function(t){return void 0!==t._bn}(t))this._bn=t._bn;else{if("string"==typeof t){const e=u().decode(t);if(e.length!=R)throw new Error("Invalid public key input");this._bn=new(a())(e)}else this._bn=new(a())(t);if(this._bn.byteLength()>32)throw new Error("Invalid public key input")}}static unique(){const t=new C(M);return M+=1,new C(t.toBuffer())}equals(t){return this._bn.eq(t._bn)}toBase58(){return u().encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){return this.toBuffer()}toBuffer(){const t=this._bn.toArrayLike(r.Buffer);if(t.length===R)return t;const e=r.Buffer.alloc(32);return t.copy(e,32-t.length),e}toString(){return this.toBase58()}static async createWithSeed(t,e,n){const i=r.Buffer.concat([t.toBuffer(),r.Buffer.from(e),n.toBuffer()]),o=(0,l.J)(i);return new C(o)}static createProgramAddressSync(t,e){let n=r.Buffer.alloc(0);t.forEach((function(t){if(t.length>O)throw new TypeError("Max seed length exceeded");n=r.Buffer.concat([n,T(t)])})),n=r.Buffer.concat([n,e.toBuffer(),r.Buffer.from("ProgramDerivedAddress")]);const i=(0,l.J)(n);if(_(i))throw new Error("Invalid seeds, address must fall off the curve");return new C(i)}static async createProgramAddress(t,e){return this.createProgramAddressSync(t,e)}static findProgramAddressSync(t,e){let n,i=255;for(;0!=i;){try{const o=t.concat(r.Buffer.from([i]));n=this.createProgramAddressSync(o,e)}catch(o){if(o instanceof TypeError)throw o;i--;continue}return[n,i]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(t,e){return this.findProgramAddressSync(t,e)}static isOnCurve(t){return _(new C(t).toBytes())}}C.default=new C("11111111111111111111111111111111"),B.set(C,{kind:"struct",fields:[["_bn","u256"]]});class U{constructor(t){if(this._publicKey=void 0,this._secretKey=void 0,t){const e=T(t);if(64!==t.length)throw new Error("bad secret key size");this._publicKey=e.slice(32,64),this._secretKey=e.slice(0,32)}else this._secretKey=T(v()),this._publicKey=T(A(this._secretKey))}get publicKey(){return new C(this._publicKey)}get secretKey(){return r.Buffer.concat([this._secretKey,this._publicKey],64)}}const N=new C("BPFLoader1111111111111111111111111111111111"),L=1232,z=127,K=64;class D extends Error{constructor(t){super(`Signature ${t} has expired: block height exceeded.`),this.signature=void 0,this.signature=t}}Object.defineProperty(D.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class j extends Error{constructor(t,e){super(`Transaction was not confirmed in ${e.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${t} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=t}}Object.defineProperty(j.prototype,"name",{value:"TransactionExpiredTimeoutError"});class W{constructor(t,e){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=e}keySegments(){const t=[this.staticAccountKeys];return this.accountKeysFromLookups&&(t.push(this.accountKeysFromLookups.writable),t.push(this.accountKeysFromLookups.readonly)),t}get(t){for(const e of this.keySegments()){if(t<e.length)return e[t];t-=e.length}}get length(){return this.keySegments().flat().length}compileInstructions(t){if(this.length>256)throw new Error("Account index overflow encountered during compilation");const e=new Map;this.keySegments().flat().forEach(((t,n)=>{e.set(t.toBase58(),n)}));const n=t=>{const n=e.get(t.toBase58());if(void 0===n)throw new Error("Encountered an unknown instruction account key during compilation");return n};return t.map((t=>({programIdIndex:n(t.programId),accountKeyIndexes:t.keys.map((t=>n(t.pubkey))),data:t.data})))}}const F=(t="publicKey")=>h.blob(32,t),G=(t="signature")=>h.blob(64,t),H=(t="string")=>{const e=h.struct([h.u32("length"),h.u32("lengthPadding"),h.blob(h.offset(h.u32(),-8),"chars")],t),n=e.decode.bind(e),i=e.encode.bind(e),o=e;return o.decode=(t,e)=>n(t,e).chars.toString(),o.encode=(t,e,n)=>{const o={chars:r.Buffer.from(t,"utf8")};return i(o,e,n)},o.alloc=t=>h.u32().span+h.u32().span+r.Buffer.from(t,"utf8").length,o};function q(t,e){const n=t=>{if(t.span>=0)return t.span;if("function"==typeof t.alloc)return t.alloc(e[t.property]);if("count"in t&&"elementLayout"in t){const r=e[t.property];if(Array.isArray(r))return r.length*n(t.elementLayout)}else if("fields"in t)return q({layout:t},e[t.property]);return 0};let r=0;return t.layout.fields.forEach((t=>{r+=n(t)})),r}function $(t){let e=0,n=0;for(;;){let r=t.shift();if(e|=(127&r)<<7*n,n+=1,0==(128&r))break}return e}function Z(t,e){let n=e;for(;;){let e=127&n;if(n>>=7,0==n){t.push(e);break}e|=128,t.push(e)}}function V(t,e){if(!t)throw new Error(e||"Assertion failed")}class X{constructor(t,e){this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=e}static compile(t,e){const n=new Map,r=t=>{const e=t.toBase58();let r=n.get(e);return void 0===r&&(r={isSigner:!1,isWritable:!1,isInvoked:!1},n.set(e,r)),r},i=r(e);i.isSigner=!0,i.isWritable=!0;for(const o of t){r(o.programId).isInvoked=!0;for(const t of o.keys){const e=r(t.pubkey);e.isSigner||(e.isSigner=t.isSigner),e.isWritable||(e.isWritable=t.isWritable)}}return new X(e,n)}getMessageComponents(){const t=[...this.keyMetaMap.entries()];V(t.length<=256,"Max static account keys length exceeded");const e=t.filter((([,t])=>t.isSigner&&t.isWritable)),n=t.filter((([,t])=>t.isSigner&&!t.isWritable)),r=t.filter((([,t])=>!t.isSigner&&t.isWritable)),i=t.filter((([,t])=>!t.isSigner&&!t.isWritable)),o={numRequiredSignatures:e.length+n.length,numReadonlySignedAccounts:n.length,numReadonlyUnsignedAccounts:i.length};{V(e.length>0,"Expected at least one writable signer key");const[t]=e[0];V(t===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}return[o,[...e.map((([t])=>new C(t))),...n.map((([t])=>new C(t))),...r.map((([t])=>new C(t))),...i.map((([t])=>new C(t)))]]}extractTableLookup(t){const[e,n]=this.drainKeysFoundInLookupTable(t.state.addresses,(t=>!t.isSigner&&!t.isInvoked&&t.isWritable)),[r,i]=this.drainKeysFoundInLookupTable(t.state.addresses,(t=>!t.isSigner&&!t.isInvoked&&!t.isWritable));if(0!==e.length||0!==r.length)return[{accountKey:t.key,writableIndexes:e,readonlyIndexes:r},{writable:n,readonly:i}]}drainKeysFoundInLookupTable(t,e){const n=new Array,r=new Array;for(const[i,o]of this.keyMetaMap.entries())if(e(o)){const e=new C(i),o=t.findIndex((t=>t.equals(e)));o>=0&&(V(o<256,"Max lookup table index exceeded"),n.push(o),r.push(e),this.keyMetaMap.delete(i))}return[n,r]}}class J{constructor(t){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map((t=>new C(t))),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach((t=>this.indexToProgramIds.set(t.programIdIndex,this.accountKeys[t.programIdIndex])))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map((t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:u().decode(t.data)})))}get addressTableLookups(){return[]}getAccountKeys(){return new W(this.staticAccountKeys)}static compile(t){const e=X.compile(t.instructions,t.payerKey),[n,r]=e.getMessageComponents(),i=new W(r).compileInstructions(t.instructions).map((t=>({programIdIndex:t.programIdIndex,accounts:t.accountKeyIndexes,data:u().encode(t.data)})));return new J({header:n,accountKeys:r,recentBlockhash:t.recentBlockhash,instructions:i})}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){const e=this.header.numRequiredSignatures;if(t>=this.header.numRequiredSignatures){return t-e<this.accountKeys.length-e-this.header.numReadonlyUnsignedAccounts}return t<e-this.header.numReadonlySignedAccounts}isProgramId(t){return this.indexToProgramIds.has(t)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter(((t,e)=>!this.isProgramId(e)))}serialize(){const t=this.accountKeys.length;let e=[];Z(e,t);const n=this.instructions.map((t=>{const{accounts:e,programIdIndex:n}=t,i=Array.from(u().decode(t.data));let o=[];Z(o,e.length);let s=[];return Z(s,i.length),{programIdIndex:n,keyIndicesCount:r.Buffer.from(o),keyIndices:e,dataLength:r.Buffer.from(s),data:i}}));let i=[];Z(i,n.length);let o=r.Buffer.alloc(L);r.Buffer.from(i).copy(o);let s=i.length;n.forEach((t=>{const e=h.struct([h.u8("programIdIndex"),h.blob(t.keyIndicesCount.length,"keyIndicesCount"),h.seq(h.u8("keyIndex"),t.keyIndices.length,"keyIndices"),h.blob(t.dataLength.length,"dataLength"),h.seq(h.u8("userdatum"),t.data.length,"data")]).encode(t,o,s);s+=e})),o=o.slice(0,s);const a=h.struct([h.blob(1,"numRequiredSignatures"),h.blob(1,"numReadonlySignedAccounts"),h.blob(1,"numReadonlyUnsignedAccounts"),h.blob(e.length,"keyCount"),h.seq(F("key"),t,"keys"),F("recentBlockhash")]),c={numRequiredSignatures:r.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:r.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:r.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:r.Buffer.from(e),keys:this.accountKeys.map((t=>T(t.toBytes()))),recentBlockhash:u().decode(this.recentBlockhash)};let l=r.Buffer.alloc(2048);const d=a.encode(c,l);return o.copy(l,d),l.slice(0,d+o.length)}static from(t){let e=[...t];const n=e.shift();if(n!==(n&z))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const i=e.shift(),o=e.shift(),s=$(e);let a=[];for(let u=0;u<s;u++){const t=e.slice(0,R);e=e.slice(R),a.push(new C(r.Buffer.from(t)))}const c=e.slice(0,R);e=e.slice(R);const l=$(e);let d=[];for(let f=0;f<l;f++){const t=e.shift(),n=$(e),i=e.slice(0,n);e=e.slice(n);const o=$(e),s=e.slice(0,o),a=u().encode(r.Buffer.from(s));e=e.slice(o),d.push({programIdIndex:t,accounts:i,data:a})}const h={header:{numRequiredSignatures:n,numReadonlySignedAccounts:i,numReadonlyUnsignedAccounts:o},recentBlockhash:u().encode(r.Buffer.from(c)),accountKeys:a,instructions:d};return new J(h)}}class Y{constructor(t){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=t.header,this.staticAccountKeys=t.staticAccountKeys,this.recentBlockhash=t.recentBlockhash,this.compiledInstructions=t.compiledInstructions,this.addressTableLookups=t.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let t=0;for(const e of this.addressTableLookups)t+=e.readonlyIndexes.length+e.writableIndexes.length;return t}getAccountKeys(t){let e;if(t&&"accountKeysFromLookups"in t&&t.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=t.accountKeysFromLookups.writable.length+t.accountKeysFromLookups.readonly.length)throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");e=t.accountKeysFromLookups}else if(t&&"addressLookupTableAccounts"in t&&t.addressLookupTableAccounts)e=this.resolveAddressTableLookups(t.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new W(this.staticAccountKeys,e)}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){const e=this.header.numRequiredSignatures,n=this.staticAccountKeys.length;if(t>=n){return t-n<this.addressTableLookups.reduce(((t,e)=>t+e.writableIndexes.length),0)}if(t>=this.header.numRequiredSignatures){return t-e<n-e-this.header.numReadonlyUnsignedAccounts}return t<e-this.header.numReadonlySignedAccounts}resolveAddressTableLookups(t){const e={writable:[],readonly:[]};for(const n of this.addressTableLookups){const r=t.find((t=>t.key.equals(n.accountKey)));if(!r)throw new Error(`Failed to find address lookup table account for table key ${n.accountKey.toBase58()}`);for(const t of n.writableIndexes){if(!(t<r.state.addresses.length))throw new Error(`Failed to find address for index ${t} in address lookup table ${n.accountKey.toBase58()}`);e.writable.push(r.state.addresses[t])}for(const t of n.readonlyIndexes){if(!(t<r.state.addresses.length))throw new Error(`Failed to find address for index ${t} in address lookup table ${n.accountKey.toBase58()}`);e.readonly.push(r.state.addresses[t])}}return e}static compile(t){const e=X.compile(t.instructions,t.payerKey),n=new Array,r={writable:new Array,readonly:new Array},i=t.addressLookupTableAccounts||[];for(const c of i){const t=e.extractTableLookup(c);if(void 0!==t){const[e,{writable:i,readonly:o}]=t;n.push(e),r.writable.push(...i),r.readonly.push(...o)}}const[o,s]=e.getMessageComponents(),a=new W(s,r).compileInstructions(t.instructions);return new Y({header:o,staticAccountKeys:s,recentBlockhash:t.recentBlockhash,compiledInstructions:a,addressTableLookups:n})}serialize(){const t=Array();Z(t,this.staticAccountKeys.length);const e=this.serializeInstructions(),n=Array();Z(n,this.compiledInstructions.length);const r=this.serializeAddressTableLookups(),i=Array();Z(i,this.addressTableLookups.length);const o=h.struct([h.u8("prefix"),h.struct([h.u8("numRequiredSignatures"),h.u8("numReadonlySignedAccounts"),h.u8("numReadonlyUnsignedAccounts")],"header"),h.blob(t.length,"staticAccountKeysLength"),h.seq(F(),this.staticAccountKeys.length,"staticAccountKeys"),F("recentBlockhash"),h.blob(n.length,"instructionsLength"),h.blob(e.length,"serializedInstructions"),h.blob(i.length,"addressTableLookupsLength"),h.blob(r.length,"serializedAddressTableLookups")]),s=new Uint8Array(L),a=o.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(t),staticAccountKeys:this.staticAccountKeys.map((t=>t.toBytes())),recentBlockhash:u().decode(this.recentBlockhash),instructionsLength:new Uint8Array(n),serializedInstructions:e,addressTableLookupsLength:new Uint8Array(i),serializedAddressTableLookups:r},s);return s.slice(0,a)}serializeInstructions(){let t=0;const e=new Uint8Array(L);for(const n of this.compiledInstructions){const r=Array();Z(r,n.accountKeyIndexes.length);const i=Array();Z(i,n.data.length);t+=h.struct([h.u8("programIdIndex"),h.blob(r.length,"encodedAccountKeyIndexesLength"),h.seq(h.u8(),n.accountKeyIndexes.length,"accountKeyIndexes"),h.blob(i.length,"encodedDataLength"),h.blob(n.data.length,"data")]).encode({programIdIndex:n.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(r),accountKeyIndexes:n.accountKeyIndexes,encodedDataLength:new Uint8Array(i),data:n.data},e,t)}return e.slice(0,t)}serializeAddressTableLookups(){let t=0;const e=new Uint8Array(L);for(const n of this.addressTableLookups){const r=Array();Z(r,n.writableIndexes.length);const i=Array();Z(i,n.readonlyIndexes.length);t+=h.struct([F("accountKey"),h.blob(r.length,"encodedWritableIndexesLength"),h.seq(h.u8(),n.writableIndexes.length,"writableIndexes"),h.blob(i.length,"encodedReadonlyIndexesLength"),h.seq(h.u8(),n.readonlyIndexes.length,"readonlyIndexes")]).encode({accountKey:n.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(r),writableIndexes:n.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(i),readonlyIndexes:n.readonlyIndexes},e,t)}return e.slice(0,t)}static deserialize(t){let e=[...t];const n=e.shift(),r=n&z;V(n!==r,"Expected versioned message but received legacy message");V(0===r,`Expected versioned message with version 0 but found version ${r}`);const i={numRequiredSignatures:e.shift(),numReadonlySignedAccounts:e.shift(),numReadonlyUnsignedAccounts:e.shift()},o=[],s=$(e);for(let u=0;u<s;u++)o.push(new C(e.splice(0,R)));const a=u().encode(e.splice(0,R)),c=$(e),l=[];for(let u=0;u<c;u++){const t=e.shift(),n=$(e),r=e.splice(0,n),i=$(e),o=new Uint8Array(e.splice(0,i));l.push({programIdIndex:t,accountKeyIndexes:r,data:o})}const d=$(e),h=[];for(let u=0;u<d;u++){const t=new C(e.splice(0,R)),n=$(e),r=e.splice(0,n),i=$(e),o=e.splice(0,i);h.push({accountKey:t,writableIndexes:r,readonlyIndexes:o})}return new Y({header:i,staticAccountKeys:o,recentBlockhash:a,compiledInstructions:l,addressTableLookups:h})}}const Q={deserializeMessageVersion(t){const e=t[0],n=e&z;return n===e?"legacy":n},deserialize:t=>{const e=Q.deserializeMessageVersion(t);if("legacy"===e)return J.from(t);if(0===e)return Y.deserialize(t);throw new Error(`Transaction message version ${e} deserialization is not supported`)}};let tt;!function(t){t[t.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",t[t.PROCESSED=1]="PROCESSED",t[t.TIMED_OUT=2]="TIMED_OUT"}(tt||(tt={}));const et=r.Buffer.alloc(K).fill(0);class nt{constructor(t){this.keys=void 0,this.programId=void 0,this.data=r.Buffer.alloc(0),this.programId=t.programId,this.keys=t.keys,t.data&&(this.data=t.data)}toJSON(){return{keys:this.keys.map((({pubkey:t,isSigner:e,isWritable:n})=>({pubkey:t.toJSON(),isSigner:e,isWritable:n}))),programId:this.programId.toJSON(),data:[...this.data]}}}class rt{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(t){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this._message=void 0,this._json=void 0,t)if(t.feePayer&&(this.feePayer=t.feePayer),t.signatures&&(this.signatures=t.signatures),Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")){const{blockhash:e,lastValidBlockHeight:n}=t;this.recentBlockhash=e,this.lastValidBlockHeight=n}else{const{recentBlockhash:e,nonceInfo:n}=t;n&&(this.nonceInfo=n),this.recentBlockhash=e}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map((t=>t.toJSON())),signers:this.signatures.map((({publicKey:t})=>t.toJSON()))}}add(...t){if(0===t.length)throw new Error("No instructions");return t.forEach((t=>{"instructions"in t?this.instructions=this.instructions.concat(t.instructions):"data"in t&&"programId"in t&&"keys"in t?this.instructions.push(t):this.instructions.push(new nt(t))})),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let t,e,n;if(this.nonceInfo?(t=this.nonceInfo.nonce,e=this.instructions[0]!=this.nonceInfo.nonceInstruction?[this.nonceInfo.nonceInstruction,...this.instructions]:this.instructions):(t=this.recentBlockhash,e=this.instructions),!t)throw new Error("Transaction recentBlockhash required");if(e.length<1&&console.warn("No instructions provided"),this.feePayer)n=this.feePayer;else{if(!(this.signatures.length>0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");n=this.signatures[0].publicKey}for(let u=0;u<e.length;u++)if(void 0===e[u].programId)throw new Error(`Transaction instruction index ${u} has undefined program id`);const r=[],i=[];e.forEach((t=>{t.keys.forEach((t=>{i.push({...t})}));const e=t.programId.toString();r.includes(e)||r.push(e)})),r.forEach((t=>{i.push({pubkey:new C(t),isSigner:!1,isWritable:!1})}));const o=[];i.forEach((t=>{const e=t.pubkey.toString(),n=o.findIndex((t=>t.pubkey.toString()===e));n>-1?(o[n].isWritable=o[n].isWritable||t.isWritable,o[n].isSigner=o[n].isSigner||t.isSigner):o.push(t)})),o.sort((function(t,e){return t.isSigner!==e.isSigner?t.isSigner?-1:1:t.isWritable!==e.isWritable?t.isWritable?-1:1:t.pubkey.toBase58().localeCompare(e.pubkey.toBase58())}));const s=o.findIndex((t=>t.pubkey.equals(n)));if(s>-1){const[t]=o.splice(s,1);t.isSigner=!0,t.isWritable=!0,o.unshift(t)}else o.unshift({pubkey:n,isSigner:!0,isWritable:!0});for(const u of this.signatures){const t=o.findIndex((t=>t.pubkey.equals(u.publicKey)));if(!(t>-1))throw new Error(`unknown signer: ${u.publicKey.toString()}`);o[t].isSigner||(o[t].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."))}let a=0,c=0,l=0;const d=[],h=[];o.forEach((({pubkey:t,isSigner:e,isWritable:n})=>{e?(d.push(t.toString()),a+=1,n||(c+=1)):(h.push(t.toString()),n||(l+=1))}));const f=d.concat(h),p=e.map((t=>{const{data:e,programId:n}=t;return{programIdIndex:f.indexOf(n.toString()),accounts:t.keys.map((t=>f.indexOf(t.pubkey.toString()))),data:u().encode(e)}}));return p.forEach((t=>{V(t.programIdIndex>=0),t.accounts.forEach((t=>V(t>=0)))})),new J({header:{numRequiredSignatures:a,numReadonlySignedAccounts:c,numReadonlyUnsignedAccounts:l},accountKeys:f,recentBlockhash:t,instructions:p})}_compile(){const t=this.compileMessage(),e=t.accountKeys.slice(0,t.header.numRequiredSignatures);if(this.signatures.length===e.length){if(this.signatures.every(((t,n)=>e[n].equals(t.publicKey))))return t}return this.signatures=e.map((t=>({signature:null,publicKey:t}))),t}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(t){return(await t.getFeeForMessage(this.compileMessage())).value}setSigners(...t){if(0===t.length)throw new Error("No signers");const e=new Set;this.signatures=t.filter((t=>{const n=t.toString();return!e.has(n)&&(e.add(n),!0)})).map((t=>({signature:null,publicKey:t})))}sign(...t){if(0===t.length)throw new Error("No signers");const e=new Set,n=[];for(const i of t){const t=i.publicKey.toString();e.has(t)||(e.add(t),n.push(i))}this.signatures=n.map((t=>({signature:null,publicKey:t.publicKey})));const r=this._compile();this._partialSign(r,...n)}partialSign(...t){if(0===t.length)throw new Error("No signers");const e=new Set,n=[];for(const i of t){const t=i.publicKey.toString();e.has(t)||(e.add(t),n.push(i))}const r=this._compile();this._partialSign(r,...n)}_partialSign(t,...e){const n=t.serialize();e.forEach((t=>{const e=S(n,t.secretKey);this._addSignature(t.publicKey,T(e))}))}addSignature(t,e){this._compile(),this._addSignature(t,e)}_addSignature(t,e){V(64===e.length);const n=this.signatures.findIndex((e=>t.equals(e.publicKey)));if(n<0)throw new Error(`unknown signer: ${t.toString()}`);this.signatures[n].signature=r.Buffer.from(e)}verifySignatures(){return this._verifySignatures(this.serializeMessage(),!0)}_verifySignatures(t,e){for(const{signature:n,publicKey:r}of this.signatures)if(null===n){if(e)return!1}else if(!E(n,t,r.toBuffer()))return!1;return!0}serialize(t){const{requireAllSignatures:e,verifySignatures:n}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},t),r=this.serializeMessage();if(n&&!this._verifySignatures(r,e))throw new Error("Signature verification failed");return this._serialize(r)}_serialize(t){const{signatures:e}=this,n=[];Z(n,e.length);const i=n.length+64*e.length+t.length,o=r.Buffer.alloc(i);return V(e.length<256),r.Buffer.from(n).copy(o,0),e.forEach((({signature:t},e)=>{null!==t&&(V(64===t.length,"signature has invalid length"),r.Buffer.from(t).copy(o,n.length+64*e))})),t.copy(o,n.length+64*e.length),V(o.length<=L,`Transaction too large: ${o.length} > ${L}`),o}get keys(){return V(1===this.instructions.length),this.instructions[0].keys.map((t=>t.pubkey))}get programId(){return V(1===this.instructions.length),this.instructions[0].programId}get data(){return V(1===this.instructions.length),this.instructions[0].data}static from(t){let e=[...t];const n=$(e);let i=[];for(let o=0;o<n;o++){const t=e.slice(0,K);e=e.slice(K),i.push(u().encode(r.Buffer.from(t)))}return rt.populate(J.from(e),i)}static populate(t,e=[]){const n=new rt;return n.recentBlockhash=t.recentBlockhash,t.header.numRequiredSignatures>0&&(n.feePayer=t.accountKeys[0]),e.forEach(((e,r)=>{const i={signature:e==u().encode(et)?null:u().decode(e),publicKey:t.accountKeys[r]};n.signatures.push(i)})),t.instructions.forEach((e=>{const r=e.accounts.map((e=>{const r=t.accountKeys[e];return{pubkey:r,isSigner:n.signatures.some((t=>t.publicKey.toString()===r.toString()))||t.isAccountSigner(e),isWritable:t.isAccountWritable(e)}}));n.instructions.push(new nt({keys:r,programId:t.accountKeys[e.programIdIndex],data:u().decode(e.data)}))})),n._message=t,n._json=n.toJSON(),n}}class it{constructor(t){this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=t.payerKey,this.instructions=t.instructions,this.recentBlockhash=t.recentBlockhash}static decompile(t,e){const{header:n,compiledInstructions:r,recentBlockhash:i}=t,{numRequiredSignatures:o,numReadonlySignedAccounts:s,numReadonlyUnsignedAccounts:a}=n,c=o-s;V(c>0,"Message header is invalid");const u=t.staticAccountKeys.length-a;V(u>=0,"Message header is invalid");const l=t.getAccountKeys(e),d=l.get(0);if(void 0===d)throw new Error("Failed to decompile message because no account keys were found");const h=[];for(const f of r){const t=[];for(const r of f.accountKeyIndexes){const e=l.get(r);if(void 0===e)throw new Error(`Failed to find key for account key index ${r}`);let i;i=r<o?r<c:r<l.staticAccountKeys.length?r-o<u:r-l.staticAccountKeys.length<l.accountKeysFromLookups.writable.length,t.push({pubkey:e,isSigner:r<n.numRequiredSignatures,isWritable:i})}const e=l.get(f.programIdIndex);if(void 0===e)throw new Error(`Failed to find program id for program id index ${f.programIdIndex}`);h.push(new nt({programId:e,data:T(f.data),keys:t}))}return new it({payerKey:d,instructions:h,recentBlockhash:i})}compileToLegacyMessage(){return J.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}compileToV0Message(t){return Y.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:t})}}class ot{get version(){return this.message.version}constructor(t,e){if(this.signatures=void 0,this.message=void 0,void 0!==e)V(e.length===t.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=e;else{const e=[];for(let n=0;n<t.header.numRequiredSignatures;n++)e.push(new Uint8Array(K));this.signatures=e}this.message=t}serialize(){const t=this.message.serialize(),e=Array();Z(e,this.signatures.length);const n=h.struct([h.blob(e.length,"encodedSignaturesLength"),h.seq(G(),this.signatures.length,"signatures"),h.blob(t.length,"serializedMessage")]),r=new Uint8Array(2048),i=n.encode({encodedSignaturesLength:new Uint8Array(e),signatures:this.signatures,serializedMessage:t},r);return r.slice(0,i)}static deserialize(t){let e=[...t];const n=[],r=$(e);for(let o=0;o<r;o++)n.push(new Uint8Array(e.splice(0,K)));const i=Q.deserialize(new Uint8Array(e));return new ot(i,n)}sign(t){const e=this.message.serialize(),n=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(const r of t){const t=n.findIndex((t=>t.equals(r.publicKey)));V(t>=0,`Cannot sign with non signer key ${r.publicKey.toBase58()}`),this.signatures[t]=S(e,r.secretKey)}}addSignature(t,e){V(64===e.byteLength,"Signature must be 64 bytes long");const n=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex((e=>e.equals(t)));V(n>=0,`Can not add signature; \`${t.toBase58()}\` is not required to sign this transaction`),this.signatures[n]=e}}const st=new C("SysvarC1ock11111111111111111111111111111111"),at=new C("SysvarEpochSchedu1e111111111111111111111111"),ct=new C("Sysvar1nstructions1111111111111111111111111"),ut=new C("SysvarRecentB1ockHashes11111111111111111111"),lt=new C("SysvarRent111111111111111111111111111111111"),dt=new C("SysvarRewards111111111111111111111111111111"),ht=new C("SysvarS1otHashes111111111111111111111111111"),ft=new C("SysvarS1otHistory11111111111111111111111111"),pt=new C("SysvarStakeHistory1111111111111111111111111");async function yt(t,e,n,r){const i=r&&{skipPreflight:r.skipPreflight,preflightCommitment:r.preflightCommitment||r.commitment,maxRetries:r.maxRetries,minContextSlot:r.minContextSlot},o=await t.sendTransaction(e,n,i),s=null!=e.recentBlockhash&&null!=e.lastValidBlockHeight?(await t.confirmTransaction({signature:o,blockhash:e.recentBlockhash,lastValidBlockHeight:e.lastValidBlockHeight},r&&r.commitment)).value:(await t.confirmTransaction(o,r&&r.commitment)).value;if(s.err)throw new Error(`Transaction ${o} failed (${JSON.stringify(s)})`);return o}function gt(t){return new Promise((e=>setTimeout(e,t)))}function mt(t,e){const n=t.layout.span>=0?t.layout.span:q(t,e),i=r.Buffer.alloc(n),o=Object.assign({instruction:t.index},e);return t.layout.encode(o,i),i}function bt(t,e){let n;try{n=t.layout.decode(e)}catch(r){throw new Error("invalid instruction; "+r)}if(n.instruction!==t.index)throw new Error(`invalid instruction; instruction index mismatch ${n.instruction} != ${t.index}`);return n}const wt=h.nu64("lamportsPerSignature"),kt=h.struct([h.u32("version"),h.u32("state"),F("authorizedPubkey"),F("nonce"),h.struct([wt],"feeCalculator")]),vt=kt.span;class It{constructor(t){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=t.authorizedPubkey,this.nonce=t.nonce,this.feeCalculator=t.feeCalculator}static fromAccountData(t){const e=kt.decode(T(t),0);return new It({authorizedPubkey:new C(e.authorizedPubkey),nonce:new C(e.nonce).toString(),feeCalculator:e.feeCalculator})}}const At=(_t=8,t=>{const e=(0,h.blob)(_t,t),{encode:n,decode:i}=(t=>({decode:t.decode.bind(t),encode:t.encode.bind(t)}))(e),o=e;return o.decode=(t,e)=>{const n=i(t,e);return(0,f.toBigIntLE)(r.Buffer.from(n))},o.encode=(t,e,r)=>{const i=(0,f.toBufferLE)(t,_t);return n(i,e,r)},o});var _t;class St{constructor(){}static decodeInstructionType(t){this.checkProgramId(t.programId);const e=h.u32("instruction").decode(t.data);let n;for(const[r,i]of Object.entries(Et))if(i.index==e){n=r;break}if(!n)throw new Error("Instruction type incorrect; not a SystemInstruction");return n}static decodeCreateAccount(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);const{lamports:e,space:n,programId:r}=bt(Et.Create,t.data);return{fromPubkey:t.keys[0].pubkey,newAccountPubkey:t.keys[1].pubkey,lamports:e,space:n,programId:new C(r)}}static decodeTransfer(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);const{lamports:e}=bt(Et.Transfer,t.data);return{fromPubkey:t.keys[0].pubkey,toPubkey:t.keys[1].pubkey,lamports:e}}static decodeTransferWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);const{lamports:e,seed:n,programId:r}=bt(Et.TransferWithSeed,t.data);return{fromPubkey:t.keys[0].pubkey,basePubkey:t.keys[1].pubkey,toPubkey:t.keys[2].pubkey,lamports:e,seed:n,programId:new C(r)}}static decodeAllocate(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,1);const{space:e}=bt(Et.Allocate,t.data);return{accountPubkey:t.keys[0].pubkey,space:e}}static decodeAllocateWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,1);const{base:e,seed:n,space:r,programId:i}=bt(Et.AllocateWithSeed,t.data);return{accountPubkey:t.keys[0].pubkey,basePubkey:new C(e),seed:n,space:r,programId:new C(i)}}static decodeAssign(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,1);const{programId:e}=bt(Et.Assign,t.data);return{accountPubkey:t.keys[0].pubkey,programId:new C(e)}}static decodeAssignWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,1);const{base:e,seed:n,programId:r}=bt(Et.AssignWithSeed,t.data);return{accountPubkey:t.keys[0].pubkey,basePubkey:new C(e),seed:n,programId:new C(r)}}static decodeCreateWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);const{base:e,seed:n,lamports:r,space:i,programId:o}=bt(Et.CreateWithSeed,t.data);return{fromPubkey:t.keys[0].pubkey,newAccountPubkey:t.keys[1].pubkey,basePubkey:new C(e),seed:n,lamports:r,space:i,programId:new C(o)}}static decodeNonceInitialize(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);const{authorized:e}=bt(Et.InitializeNonceAccount,t.data);return{noncePubkey:t.keys[0].pubkey,authorizedPubkey:new C(e)}}static decodeNonceAdvance(t){return this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3),bt(Et.AdvanceNonceAccount,t.data),{noncePubkey:t.keys[0].pubkey,authorizedPubkey:t.keys[2].pubkey}}static decodeNonceWithdraw(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,5);const{lamports:e}=bt(Et.WithdrawNonceAccount,t.data);return{noncePubkey:t.keys[0].pubkey,toPubkey:t.keys[1].pubkey,authorizedPubkey:t.keys[4].pubkey,lamports:e}}static decodeNonceAuthorize(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);const{authorized:e}=bt(Et.AuthorizeNonceAccount,t.data);return{noncePubkey:t.keys[0].pubkey,authorizedPubkey:t.keys[1].pubkey,newAuthorizedPubkey:new C(e)}}static checkProgramId(t){if(!t.equals(Tt.programId))throw new Error("invalid instruction; programId is not SystemProgram")}static checkKeyLength(t,e){if(t.length<e)throw new Error(`invalid instruction; found ${t.length} keys, expected at least ${e}`)}}const Et=Object.freeze({Create:{index:0,layout:h.struct([h.u32("instruction"),h.ns64("lamports"),h.ns64("space"),F("programId")])},Assign:{index:1,layout:h.struct([h.u32("instruction"),F("programId")])},Transfer:{index:2,layout:h.struct([h.u32("instruction"),At("lamports")])},CreateWithSeed:{index:3,layout:h.struct([h.u32("instruction"),F("base"),H("seed"),h.ns64("lamports"),h.ns64("space"),F("programId")])},AdvanceNonceAccount:{index:4,layout:h.struct([h.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:h.struct([h.u32("instruction"),h.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:h.struct([h.u32("instruction"),F("authorized")])},AuthorizeNonceAccount:{index:7,layout:h.struct([h.u32("instruction"),F("authorized")])},Allocate:{index:8,layout:h.struct([h.u32("instruction"),h.ns64("space")])},AllocateWithSeed:{index:9,layout:h.struct([h.u32("instruction"),F("base"),H("seed"),h.ns64("space"),F("programId")])},AssignWithSeed:{index:10,layout:h.struct([h.u32("instruction"),F("base"),H("seed"),F("programId")])},TransferWithSeed:{index:11,layout:h.struct([h.u32("instruction"),At("lamports"),H("seed"),F("programId")])},UpgradeNonceAccount:{index:12,layout:h.struct([h.u32("instruction")])}});class Tt{constructor(){}static createAccount(t){const e=mt(Et.Create,{lamports:t.lamports,space:t.space,programId:T(t.programId.toBuffer())});return new nt({keys:[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:e})}static transfer(t){let e,n;if("basePubkey"in t){e=mt(Et.TransferWithSeed,{lamports:BigInt(t.lamports),seed:t.seed,programId:T(t.programId.toBuffer())}),n=[{pubkey:t.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]}else{e=mt(Et.Transfer,{lamports:BigInt(t.lamports)}),n=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]}return new nt({keys:n,programId:this.programId,data:e})}static assign(t){let e,n;if("basePubkey"in t){e=mt(Et.AssignWithSeed,{base:T(t.basePubkey.toBuffer()),seed:t.seed,programId:T(t.programId.toBuffer())}),n=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]}else{e=mt(Et.Assign,{programId:T(t.programId.toBuffer())}),n=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]}return new nt({keys:n,programId:this.programId,data:e})}static createAccountWithSeed(t){const e=mt(Et.CreateWithSeed,{base:T(t.basePubkey.toBuffer()),seed:t.seed,lamports:t.lamports,space:t.space,programId:T(t.programId.toBuffer())});let n=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!1,isWritable:!0}];return t.basePubkey!=t.fromPubkey&&n.push({pubkey:t.basePubkey,isSigner:!0,isWritable:!1}),new nt({keys:n,programId:this.programId,data:e})}static createNonceAccount(t){const e=new rt;"basePubkey"in t&&"seed"in t?e.add(Tt.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:vt,programId:this.programId})):e.add(Tt.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,lamports:t.lamports,space:vt,programId:this.programId}));const n={noncePubkey:t.noncePubkey,authorizedPubkey:t.authorizedPubkey};return e.add(this.nonceInitialize(n)),e}static nonceInitialize(t){const e=mt(Et.InitializeNonceAccount,{authorized:T(t.authorizedPubkey.toBuffer())}),n={keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:ut,isSigner:!1,isWritable:!1},{pubkey:lt,isSigner:!1,isWritable:!1}],programId:this.programId,data:e};return new nt(n)}static nonceAdvance(t){const e=mt(Et.AdvanceNonceAccount),n={keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:ut,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e};return new nt(n)}static nonceWithdraw(t){const e=mt(Et.WithdrawNonceAccount,{lamports:t.lamports});return new nt({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0},{pubkey:ut,isSigner:!1,isWritable:!1},{pubkey:lt,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static nonceAuthorize(t){const e=mt(Et.AuthorizeNonceAccount,{authorized:T(t.newAuthorizedPubkey.toBuffer())});return new nt({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:e})}static allocate(t){let e,n;if("basePubkey"in t){e=mt(Et.AllocateWithSeed,{base:T(t.basePubkey.toBuffer()),seed:t.seed,space:t.space,programId:T(t.programId.toBuffer())}),n=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]}else{e=mt(Et.Allocate,{space:t.space}),n=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]}return new nt({keys:n,programId:this.programId,data:e})}}Tt.programId=new C("11111111111111111111111111111111");const xt=L-300;class Pt{constructor(){}static getMinNumSignatures(t){return 2*(Math.ceil(t/Pt.chunkSize)+1+1)}static async load(t,e,n,i,o){{const r=await t.getMinimumBalanceForRentExemption(o.length),s=await t.getAccountInfo(n.publicKey,"confirmed");let a=null;if(null!==s){if(s.executable)return console.error("Program load failed, account is already executable"),!1;s.data.length!==o.length&&(a=a||new rt,a.add(Tt.allocate({accountPubkey:n.publicKey,space:o.length}))),s.owner.equals(i)||(a=a||new rt,a.add(Tt.assign({accountPubkey:n.publicKey,programId:i}))),s.lamports<r&&(a=a||new rt,a.add(Tt.transfer({fromPubkey:e.publicKey,toPubkey:n.publicKey,lamports:r-s.lamports})))}else a=(new rt).add(Tt.createAccount({fromPubkey:e.publicKey,newAccountPubkey:n.publicKey,lamports:r>0?r:1,space:o.length,programId:i}));null!==a&&await yt(t,a,[e,n],{commitment:"confirmed"})}const s=h.struct([h.u32("instruction"),h.u32("offset"),h.u32("bytesLength"),h.u32("bytesLengthPadding"),h.seq(h.u8("byte"),h.offset(h.u32(),-8),"bytes")]),a=Pt.chunkSize;let c=0,u=o,l=[];for(;u.length>0;){const o=u.slice(0,a),d=r.Buffer.alloc(a+16);s.encode({instruction:0,offset:c,bytes:o,bytesLength:0,bytesLengthPadding:0},d);const h=(new rt).add({keys:[{pubkey:n.publicKey,isSigner:!0,isWritable:!0}],programId:i,data:d});if(l.push(yt(t,h,[e,n],{commitment:"confirmed"})),t._rpcEndpoint.includes("solana.com")){const t=4;await gt(1e3/t)}c+=a,u=u.slice(a)}await Promise.all(l);{const o=h.struct([h.u32("instruction")]),s=r.Buffer.alloc(o.span);o.encode({instruction:1},s);const a=(new rt).add({keys:[{pubkey:n.publicKey,isSigner:!0,isWritable:!0},{pubkey:lt,isSigner:!1,isWritable:!1}],programId:i,data:s});await yt(t,a,[e,n],{commitment:"confirmed"})}return!0}}Pt.chunkSize=xt;const Bt=new C("BPFLoader2111111111111111111111111111111111");class Ot{static getMinNumSignatures(t){return Pt.getMinNumSignatures(t)}static load(t,e,n,r,i){return Pt.load(t,e,n,i,r)}}var Rt=Object.prototype.toString,Mt=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};function Ct(t,e){var n,r,i,o,s,a,c;if(!0===t)return"true";if(!1===t)return"false";switch(typeof t){case"object":if(null===t)return null;if(t.toJSON&&"function"==typeof t.toJSON)return Ct(t.toJSON(),e);if("[object Array]"===(c=Rt.call(t))){for(i="[",r=t.length-1,n=0;n<r;n++)i+=Ct(t[n],!0)+",";return r>-1&&(i+=Ct(t[n],!0)),i+"]"}if("[object Object]"===c){for(r=(o=Mt(t).sort()).length,i="",n=0;n<r;)void 0!==(a=Ct(t[s=o[n]],!1))&&(i&&(i+=","),i+=JSON.stringify(s)+":"+a),n++;return"{"+i+"}"}return JSON.stringify(t);case"function":case"undefined":return e?null:void 0;case"string":return JSON.stringify(t);default:return isFinite(t)?t:null}}var Ut=function(t){var e=Ct(t,!1);if(void 0!==e)return""+e};function Nt(t){let e=0;for(;t>1;)t/=2,e++;return e}class Lt{constructor(t,e,n,r,i){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=t,this.leaderScheduleSlotOffset=e,this.warmup=n,this.firstNormalEpoch=r,this.firstNormalSlot=i}getEpoch(t){return this.getEpochAndSlotIndex(t)[0]}getEpochAndSlotIndex(t){if(t<this.firstNormalSlot){const n=Nt(0===(e=t+32+1)?1:(e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,1+(e|=e>>32)))-Nt(32)-1;return[n,t-(this.getSlotsInEpoch(n)-32)]}{const e=t-this.firstNormalSlot,n=Math.floor(e/this.slotsPerEpoch);return[this.firstNormalEpoch+n,e%this.slotsPerEpoch]}var e}getFirstSlotInEpoch(t){return t<=this.firstNormalEpoch?32*(Math.pow(2,t)-1):(t-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(t){return this.getFirstSlotInEpoch(t)+this.getSlotsInEpoch(t)-1}getSlotsInEpoch(t){return t<this.firstNormalEpoch?Math.pow(2,t+Nt(32)):this.slotsPerEpoch}}class zt extends Error{constructor(t,e){super(t),this.logs=void 0,this.logs=e}}const Kt={JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP:-32001,JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE:-32002,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE:-32003,JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE:-32004,JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY:-32005,JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE:-32006,JSON_RPC_SERVER_ERROR_SLOT_SKIPPED:-32007,JSON_RPC_SERVER_ERROR_NO_SNAPSHOT:-32008,JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED:-32009,JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX:-32010,JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE:-32011,JSON_RPC_SCAN_ERROR:-32012,JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH:-32013,JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET:-32014,JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION:-32015,JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED:-32016};class Dt extends Error{constructor({code:t,message:e,data:n},r){super(null!=r?`${r}: ${e}`:e),this.code=void 0,this.data=void 0,this.code=t,this.data=n,this.name="SolanaJSONRPCError"}}var jt=globalThis.fetch;class Wt{constructor(t){this.key=void 0,this.state=void 0,this.key=t.key,this.state=t.state}isActive(){const t=BigInt("0xffffffffffffffff");return this.state.deactivationSlot===t}static deserialize(t){const e=function(t,e){let n;try{n=t.layout.decode(e)}catch(r){throw new Error("invalid instruction; "+r)}if(n.typeIndex!==t.index)throw new Error(`invalid account data; account type mismatch ${n.typeIndex} != ${t.index}`);return n}(Ft,t),n=t.length-56;V(n>=0,"lookup table is invalid"),V(n%32==0,"lookup table is invalid");const r=n/32,{addresses:i}=h.struct([h.seq(F(),r,"addresses")]).decode(t.slice(56));return{deactivationSlot:e.deactivationSlot,lastExtendedSlot:e.lastExtendedSlot,lastExtendedSlotStartIndex:e.lastExtendedStartIndex,authority:0!==e.authority.length?new C(e.authority[0]):void 0,addresses:i.map((t=>new C(t)))}}}const Ft={index:1,layout:h.struct([h.u32("typeIndex"),At("deactivationSlot"),h.nu64("lastExtendedSlot"),h.u8("lastExtendedStartIndex"),h.u8(),h.seq(F(),h.offset(h.u8(),-1),"authority")])},Gt=/^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i;var Ht;const qt=(0,p.oQ)((0,p.eE)(C),(0,p.Z_)(),(t=>new C(t))),$t=(0,p.bc)([(0,p.Z_)(),(0,p.i0)("base64")]),Zt=(0,p.oQ)((0,p.eE)(r.Buffer),$t,(t=>r.Buffer.from(t[0],"base64"))),Vt=3e4;function Xt(t){let e,n;if("string"==typeof t)e=t;else if(t){const{commitment:r,...i}=t;e=r,n=i}return{commitment:e,config:n}}function Jt(t){return(0,p.G0)([(0,p.dt)({jsonrpc:(0,p.i0)("2.0"),id:(0,p.Z_)(),result:t}),(0,p.dt)({jsonrpc:(0,p.i0)("2.0"),id:(0,p.Z_)(),error:(0,p.dt)({code:(0,p._4)(),message:(0,p.Z_)(),data:(0,p.jt)((0,p.Yj)())})})])}const Yt=Jt((0,p._4)());function Qt(t){return(0,p.oQ)(Jt(t),Yt,(e=>"error"in e?e:{...e,result:(0,p.Ue)(e.result,t)}))}function te(t){return Qt((0,p.dt)({context:(0,p.dt)({slot:(0,p.Rx)()}),value:t}))}function ee(t){return(0,p.dt)({context:(0,p.dt)({slot:(0,p.Rx)()}),value:t})}function ne(t,e){return 0===t?new Y({header:e.header,staticAccountKeys:e.accountKeys.map((t=>new C(t))),recentBlockhash:e.recentBlockhash,compiledInstructions:e.instructions.map((t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:u().decode(t.data)}))),addressTableLookups:e.addressTableLookups}):new J(e)}const re=(0,p.dt)({foundation:(0,p.Rx)(),foundationTerm:(0,p.Rx)(),initial:(0,p.Rx)(),taper:(0,p.Rx)(),terminal:(0,p.Rx)()}),ie=Qt((0,p.IX)((0,p.AG)((0,p.dt)({epoch:(0,p.Rx)(),effectiveSlot:(0,p.Rx)(),amount:(0,p.Rx)(),postBalance:(0,p.Rx)()})))),oe=(0,p.dt)({epoch:(0,p.Rx)(),slotIndex:(0,p.Rx)(),slotsInEpoch:(0,p.Rx)(),absoluteSlot:(0,p.Rx)(),blockHeight:(0,p.jt)((0,p.Rx)()),transactionCount:(0,p.jt)((0,p.Rx)())}),se=(0,p.dt)({slotsPerEpoch:(0,p.Rx)(),leaderScheduleSlotOffset:(0,p.Rx)(),warmup:(0,p.O7)(),firstNormalEpoch:(0,p.Rx)(),firstNormalSlot:(0,p.Rx)()}),ae=(0,p.IM)((0,p.Z_)(),(0,p.IX)((0,p.Rx)())),ce=(0,p.AG)((0,p.G0)([(0,p.dt)({}),(0,p.Z_)()])),ue=(0,p.dt)({err:ce}),le=(0,p.i0)("receivedSignature"),de=(0,p.dt)({"solana-core":(0,p.Z_)(),"feature-set":(0,p.jt)((0,p.Rx)())}),he=te((0,p.dt)({err:(0,p.AG)((0,p.G0)([(0,p.dt)({}),(0,p.Z_)()])),logs:(0,p.AG)((0,p.IX)((0,p.Z_)())),accounts:(0,p.jt)((0,p.AG)((0,p.IX)((0,p.AG)((0,p.dt)({executable:(0,p.O7)(),owner:(0,p.Z_)(),lamports:(0,p.Rx)(),data:(0,p.IX)((0,p.Z_)()),rentEpoch:(0,p.jt)((0,p.Rx)())}))))),unitsConsumed:(0,p.jt)((0,p.Rx)()),returnData:(0,p.jt)((0,p.AG)((0,p.dt)({programId:(0,p.Z_)(),data:(0,p.bc)([(0,p.Z_)(),(0,p.i0)("base64")])})))})),fe=te((0,p.dt)({byIdentity:(0,p.IM)((0,p.Z_)(),(0,p.IX)((0,p.Rx)())),range:(0,p.dt)({firstSlot:(0,p.Rx)(),lastSlot:(0,p.Rx)()})}));const pe=Qt(re),ye=Qt(oe),ge=Qt(se),me=Qt(ae),be=Qt((0,p.Rx)()),we=te((0,p.dt)({total:(0,p.Rx)(),circulating:(0,p.Rx)(),nonCirculating:(0,p.Rx)(),nonCirculatingAccounts:(0,p.IX)(qt)})),ke=(0,p.dt)({amount:(0,p.Z_)(),uiAmount:(0,p.AG)((0,p.Rx)()),decimals:(0,p.Rx)(),uiAmountString:(0,p.jt)((0,p.Z_)())}),ve=te((0,p.IX)((0,p.dt)({address:qt,amount:(0,p.Z_)(),uiAmount:(0,p.AG)((0,p.Rx)()),decimals:(0,p.Rx)(),uiAmountString:(0,p.jt)((0,p.Z_)())}))),Ie=te((0,p.IX)((0,p.dt)({pubkey:qt,account:(0,p.dt)({executable:(0,p.O7)(),owner:qt,lamports:(0,p.Rx)(),data:Zt,rentEpoch:(0,p.Rx)()})}))),Ae=(0,p.dt)({program:(0,p.Z_)(),parsed:(0,p._4)(),space:(0,p.Rx)()}),_e=te((0,p.IX)((0,p.dt)({pubkey:qt,account:(0,p.dt)({executable:(0,p.O7)(),owner:qt,lamports:(0,p.Rx)(),data:Ae,rentEpoch:(0,p.Rx)()})}))),Se=te((0,p.IX)((0,p.dt)({lamports:(0,p.Rx)(),address:qt}))),Ee=(0,p.dt)({executable:(0,p.O7)(),owner:qt,lamports:(0,p.Rx)(),data:Zt,rentEpoch:(0,p.Rx)()}),Te=(0,p.dt)({pubkey:qt,account:Ee}),xe=(0,p.oQ)((0,p.G0)([(0,p.eE)(r.Buffer),Ae]),(0,p.G0)([$t,Ae]),(t=>Array.isArray(t)?(0,p.Ue)(t,Zt):t)),Pe=(0,p.dt)({executable:(0,p.O7)(),owner:qt,lamports:(0,p.Rx)(),data:xe,rentEpoch:(0,p.Rx)()}),Be=(0,p.dt)({pubkey:qt,account:Pe}),Oe=(0,p.dt)({state:(0,p.G0)([(0,p.i0)("active"),(0,p.i0)("inactive"),(0,p.i0)("activating"),(0,p.i0)("deactivating")]),active:(0,p.Rx)(),inactive:(0,p.Rx)()}),Re=Qt((0,p.IX)((0,p.dt)({signature:(0,p.Z_)(),slot:(0,p.Rx)(),err:ce,memo:(0,p.AG)((0,p.Z_)()),blockTime:(0,p.jt)((0,p.AG)((0,p.Rx)()))}))),Me=Qt((0,p.IX)((0,p.dt)({signature:(0,p.Z_)(),slot:(0,p.Rx)(),err:ce,memo:(0,p.AG)((0,p.Z_)()),blockTime:(0,p.jt)((0,p.AG)((0,p.Rx)()))}))),Ce=(0,p.dt)({subscription:(0,p.Rx)(),result:ee(Ee)}),Ue=(0,p.dt)({pubkey:qt,account:Ee}),Ne=(0,p.dt)({subscription:(0,p.Rx)(),result:ee(Ue)}),Le=(0,p.dt)({parent:(0,p.Rx)(),slot:(0,p.Rx)(),root:(0,p.Rx)()}),ze=(0,p.dt)({subscription:(0,p.Rx)(),result:Le}),Ke=(0,p.G0)([(0,p.dt)({type:(0,p.G0)([(0,p.i0)("firstShredReceived"),(0,p.i0)("completed"),(0,p.i0)("optimisticConfirmation"),(0,p.i0)("root")]),slot:(0,p.Rx)(),timestamp:(0,p.Rx)()}),(0,p.dt)({type:(0,p.i0)("createdBank"),parent:(0,p.Rx)(),slot:(0,p.Rx)(),timestamp:(0,p.Rx)()}),(0,p.dt)({type:(0,p.i0)("frozen"),slot:(0,p.Rx)(),timestamp:(0,p.Rx)(),stats:(0,p.dt)({numTransactionEntries:(0,p.Rx)(),numSuccessfulTransactions:(0,p.Rx)(),numFailedTransactions:(0,p.Rx)(),maxTransactionsPerEntry:(0,p.Rx)()})}),(0,p.dt)({type:(0,p.i0)("dead"),slot:(0,p.Rx)(),timestamp:(0,p.Rx)(),err:(0,p.Z_)()})]),De=(0,p.dt)({subscription:(0,p.Rx)(),result:Ke}),je=(0,p.dt)({subscription:(0,p.Rx)(),result:ee((0,p.G0)([ue,le]))}),We=(0,p.dt)({subscription:(0,p.Rx)(),result:(0,p.Rx)()}),Fe=(0,p.dt)({pubkey:(0,p.Z_)(),gossip:(0,p.AG)((0,p.Z_)()),tpu:(0,p.AG)((0,p.Z_)()),rpc:(0,p.AG)((0,p.Z_)()),version:(0,p.AG)((0,p.Z_)())}),Ge=(0,p.dt)({votePubkey:(0,p.Z_)(),nodePubkey:(0,p.Z_)(),activatedStake:(0,p.Rx)(),epochVoteAccount:(0,p.O7)(),epochCredits:(0,p.IX)((0,p.bc)([(0,p.Rx)(),(0,p.Rx)(),(0,p.Rx)()])),commission:(0,p.Rx)(),lastVote:(0,p.Rx)(),rootSlot:(0,p.AG)((0,p.Rx)())}),He=Qt((0,p.dt)({current:(0,p.IX)(Ge),delinquent:(0,p.IX)(Ge)})),qe=(0,p.G0)([(0,p.i0)("processed"),(0,p.i0)("confirmed"),(0,p.i0)("finalized")]),$e=(0,p.dt)({slot:(0,p.Rx)(),confirmations:(0,p.AG)((0,p.Rx)()),err:ce,confirmationStatus:(0,p.jt)(qe)}),Ze=te((0,p.IX)((0,p.AG)($e))),Ve=Qt((0,p.Rx)()),Xe=(0,p.dt)({accountKey:qt,writableIndexes:(0,p.IX)((0,p.Rx)()),readonlyIndexes:(0,p.IX)((0,p.Rx)())}),Je=(0,p.dt)({signatures:(0,p.IX)((0,p.Z_)()),message:(0,p.dt)({accountKeys:(0,p.IX)((0,p.Z_)()),header:(0,p.dt)({numRequiredSignatures:(0,p.Rx)(),numReadonlySignedAccounts:(0,p.Rx)(),numReadonlyUnsignedAccounts:(0,p.Rx)()}),instructions:(0,p.IX)((0,p.dt)({accounts:(0,p.IX)((0,p.Rx)()),data:(0,p.Z_)(),programIdIndex:(0,p.Rx)()})),recentBlockhash:(0,p.Z_)(),addressTableLookups:(0,p.jt)((0,p.IX)(Xe))})}),Ye=(0,p.dt)({parsed:(0,p._4)(),program:(0,p.Z_)(),programId:qt}),Qe=(0,p.dt)({accounts:(0,p.IX)(qt),data:(0,p.Z_)(),programId:qt}),tn=(0,p.G0)([Qe,Ye]),en=(0,p.G0)([(0,p.dt)({parsed:(0,p._4)(),program:(0,p.Z_)(),programId:(0,p.Z_)()}),(0,p.dt)({accounts:(0,p.IX)((0,p.Z_)()),data:(0,p.Z_)(),programId:(0,p.Z_)()})]),nn=(0,p.oQ)(tn,en,(t=>"accounts"in t?(0,p.Ue)(t,Qe):(0,p.Ue)(t,Ye))),rn=(0,p.dt)({signatures:(0,p.IX)((0,p.Z_)()),message:(0,p.dt)({accountKeys:(0,p.IX)((0,p.dt)({pubkey:qt,signer:(0,p.O7)(),writable:(0,p.O7)(),source:(0,p.jt)((0,p.G0)([(0,p.i0)("transaction"),(0,p.i0)("lookupTable")]))})),instructions:(0,p.IX)(nn),recentBlockhash:(0,p.Z_)(),addressTableLookups:(0,p.jt)((0,p.AG)((0,p.IX)(Xe)))})}),on=(0,p.dt)({accountIndex:(0,p.Rx)(),mint:(0,p.Z_)(),owner:(0,p.jt)((0,p.Z_)()),uiTokenAmount:ke}),sn=(0,p.dt)({writable:(0,p.IX)(qt),readonly:(0,p.IX)(qt)}),an=(0,p.dt)({err:ce,fee:(0,p.Rx)(),innerInstructions:(0,p.jt)((0,p.AG)((0,p.IX)((0,p.dt)({index:(0,p.Rx)(),instructions:(0,p.IX)((0,p.dt)({accounts:(0,p.IX)((0,p.Rx)()),data:(0,p.Z_)(),programIdIndex:(0,p.Rx)()}))})))),preBalances:(0,p.IX)((0,p.Rx)()),postBalances:(0,p.IX)((0,p.Rx)()),logMessages:(0,p.jt)((0,p.AG)((0,p.IX)((0,p.Z_)()))),preTokenBalances:(0,p.jt)((0,p.AG)((0,p.IX)(on))),postTokenBalances:(0,p.jt)((0,p.AG)((0,p.IX)(on))),loadedAddresses:(0,p.jt)(sn),computeUnitsConsumed:(0,p.jt)((0,p.Rx)())}),cn=(0,p.dt)({err:ce,fee:(0,p.Rx)(),innerInstructions:(0,p.jt)((0,p.AG)((0,p.IX)((0,p.dt)({index:(0,p.Rx)(),instructions:(0,p.IX)(nn)})))),preBalances:(0,p.IX)((0,p.Rx)()),postBalances:(0,p.IX)((0,p.Rx)()),logMessages:(0,p.jt)((0,p.AG)((0,p.IX)((0,p.Z_)()))),preTokenBalances:(0,p.jt)((0,p.AG)((0,p.IX)(on))),postTokenBalances:(0,p.jt)((0,p.AG)((0,p.IX)(on))),loadedAddresses:(0,p.jt)(sn),computeUnitsConsumed:(0,p.jt)((0,p.Rx)())}),un=(0,p.G0)([(0,p.i0)(0),(0,p.i0)("legacy")]),ln=Qt((0,p.AG)((0,p.dt)({blockhash:(0,p.Z_)(),previousBlockhash:(0,p.Z_)(),parentSlot:(0,p.Rx)(),transactions:(0,p.IX)((0,p.dt)({transaction:Je,meta:(0,p.AG)(an),version:(0,p.jt)(un)})),rewards:(0,p.jt)((0,p.IX)((0,p.dt)({pubkey:(0,p.Z_)(),lamports:(0,p.Rx)(),postBalance:(0,p.AG)((0,p.Rx)()),rewardType:(0,p.AG)((0,p.Z_)())}))),blockTime:(0,p.AG)((0,p.Rx)()),blockHeight:(0,p.AG)((0,p.Rx)())}))),dn=Qt((0,p.AG)((0,p.dt)({blockhash:(0,p.Z_)(),previousBlockhash:(0,p.Z_)(),parentSlot:(0,p.Rx)(),transactions:(0,p.IX)((0,p.dt)({transaction:rn,meta:(0,p.AG)(cn),version:(0,p.jt)(un)})),rewards:(0,p.jt)((0,p.IX)((0,p.dt)({pubkey:(0,p.Z_)(),lamports:(0,p.Rx)(),postBalance:(0,p.AG)((0,p.Rx)()),rewardType:(0,p.AG)((0,p.Z_)())}))),blockTime:(0,p.AG)((0,p.Rx)()),blockHeight:(0,p.AG)((0,p.Rx)())}))),hn=Qt((0,p.AG)((0,p.dt)({blockhash:(0,p.Z_)(),previousBlockhash:(0,p.Z_)(),parentSlot:(0,p.Rx)(),transactions:(0,p.IX)((0,p.dt)({transaction:Je,meta:(0,p.AG)(an)})),rewards:(0,p.jt)((0,p.IX)((0,p.dt)({pubkey:(0,p.Z_)(),lamports:(0,p.Rx)(),postBalance:(0,p.AG)((0,p.Rx)()),rewardType:(0,p.AG)((0,p.Z_)())}))),blockTime:(0,p.AG)((0,p.Rx)())}))),fn=Qt((0,p.AG)((0,p.dt)({blockhash:(0,p.Z_)(),previousBlockhash:(0,p.Z_)(),parentSlot:(0,p.Rx)(),signatures:(0,p.IX)((0,p.Z_)()),blockTime:(0,p.AG)((0,p.Rx)())}))),pn=Qt((0,p.AG)((0,p.dt)({slot:(0,p.Rx)(),meta:an,blockTime:(0,p.jt)((0,p.AG)((0,p.Rx)())),transaction:Je,version:(0,p.jt)(un)}))),yn=Qt((0,p.AG)((0,p.dt)({slot:(0,p.Rx)(),transaction:rn,meta:(0,p.AG)(cn),blockTime:(0,p.jt)((0,p.AG)((0,p.Rx)())),version:(0,p.jt)(un)}))),gn=te((0,p.dt)({blockhash:(0,p.Z_)(),feeCalculator:(0,p.dt)({lamportsPerSignature:(0,p.Rx)()})})),mn=te((0,p.dt)({blockhash:(0,p.Z_)(),lastValidBlockHeight:(0,p.Rx)()})),bn=(0,p.dt)({slot:(0,p.Rx)(),numTransactions:(0,p.Rx)(),numSlots:(0,p.Rx)(),samplePeriodSecs:(0,p.Rx)()}),wn=Qt((0,p.IX)(bn)),kn=te((0,p.AG)((0,p.dt)({feeCalculator:(0,p.dt)({lamportsPerSignature:(0,p.Rx)()})}))),vn=Qt((0,p.Z_)()),In=Qt((0,p.Z_)()),An=(0,p.dt)({err:ce,logs:(0,p.IX)((0,p.Z_)()),signature:(0,p.Z_)()}),_n=(0,p.dt)({result:ee(An),subscription:(0,p.Rx)()}),Sn={"solana-client":`js/${null!==(Ht="0.0.0-development")?Ht:"UNKNOWN"}`};class En{constructor(t,e){let n,r,i,o,s;var a;this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set,e&&"string"==typeof e?this._commitment=e:e&&(this._commitment=e.commitment,this._confirmTransactionInitialTimeout=e.confirmTransactionInitialTimeout,n=e.wsEndpoint,r=e.httpHeaders,i=e.fetch,o=e.fetchMiddleware,s=e.disableRetryOnRateLimit),this._rpcEndpoint=function(t){if(!1===/^https?:/.test(t))throw new TypeError("Endpoint URL must start with `http:` or `https:`.");return t}(t),this._rpcWsEndpoint=n||function(t){const e=t.match(Gt);if(null==e)throw TypeError(`Failed to validate endpoint URL \`${t}\``);const[n,r,i,o]=e,s=t.startsWith("https:")?"wss:":"ws:",a=null==i?null:parseInt(i.slice(1),10);return`${s}//${r}${null==a?"":`:${a+1}`}${o}`}(t),this._rpcClient=function(t,e,n,r,i){const o=n||jt;let s;return r&&(s=async(t,e)=>{const n=await new Promise(((n,i)=>{try{r(t,e,((t,e)=>n([t,e])))}catch(o){i(o)}}));return await o(...n)}),new(m())((async(n,r)=>{const a={method:"POST",body:n,agent:void 0,headers:Object.assign({"Content-Type":"application/json"},e||{},Sn)};try{let e,n=5,c=500;for(;e=s?await s(t,a):await o(t,a),429===e.status&&!0!==i&&(n-=1,0!==n);)console.log(`Server responded with ${e.status} ${e.statusText}. Retrying after ${c}ms delay...`),await gt(c),c*=2;const u=await e.text();e.ok?r(null,u):r(new Error(`${e.status} ${e.statusText}: ${u}`))}catch(c){c instanceof Error&&r(c)}}),{})}(t,r,i,o,s),this._rpcRequest=(a=this._rpcClient,(t,e)=>new Promise(((n,r)=>{a.request(t,e,((t,e)=>{t?r(t):n(e)}))}))),this._rpcBatchRequest=function(t){return e=>new Promise(((n,r)=>{0===e.length&&n([]);const i=e.map((e=>t.request(e.methodName,e.args)));t.request(i,((t,e)=>{t?r(t):n(e)}))}))}(this._rpcClient),this._rpcWebSocket=new y.K(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(t,e){const{commitment:n,config:r}=Xt(e),i=this._buildArgs([t.toBase58()],n,void 0,r),o=await this._rpcRequest("getBalance",i),s=(0,p.Ue)(o,te((0,p.Rx)()));if("error"in s)throw new Dt(s.error,`failed to get balance for ${t.toBase58()}`);return s.result}async getBalance(t,e){return await this.getBalanceAndContext(t,e).then((t=>t.value)).catch((e=>{throw new Error("failed to get balance of account "+t.toBase58()+": "+e)}))}async getBlockTime(t){const e=await this._rpcRequest("getBlockTime",[t]),n=(0,p.Ue)(e,Qt((0,p.AG)((0,p.Rx)())));if("error"in n)throw new Dt(n.error,`failed to get block time for slot ${t}`);return n.result}async getMinimumLedgerSlot(){const t=await this._rpcRequest("minimumLedgerSlot",[]),e=(0,p.Ue)(t,Qt((0,p.Rx)()));if("error"in e)throw new Dt(e.error,"failed to get minimum ledger slot");return e.result}async getFirstAvailableBlock(){const t=await this._rpcRequest("getFirstAvailableBlock",[]),e=(0,p.Ue)(t,be);if("error"in e)throw new Dt(e.error,"failed to get first available block");return e.result}async getSupply(t){let e={};e="string"==typeof t?{commitment:t}:t?{...t,commitment:t&&t.commitment||this.commitment}:{commitment:this.commitment};const n=await this._rpcRequest("getSupply",[e]),r=(0,p.Ue)(n,we);if("error"in r)throw new Dt(r.error,"failed to get supply");return r.result}async getTokenSupply(t,e){const n=this._buildArgs([t.toBase58()],e),r=await this._rpcRequest("getTokenSupply",n),i=(0,p.Ue)(r,te(ke));if("error"in i)throw new Dt(i.error,"failed to get token supply");return i.result}async getTokenAccountBalance(t,e){const n=this._buildArgs([t.toBase58()],e),r=await this._rpcRequest("getTokenAccountBalance",n),i=(0,p.Ue)(r,te(ke));if("error"in i)throw new Dt(i.error,"failed to get token account balance");return i.result}async getTokenAccountsByOwner(t,e,n){const{commitment:r,config:i}=Xt(n);let o=[t.toBase58()];"mint"in e?o.push({mint:e.mint.toBase58()}):o.push({programId:e.programId.toBase58()});const s=this._buildArgs(o,r,"base64",i),a=await this._rpcRequest("getTokenAccountsByOwner",s),c=(0,p.Ue)(a,Ie);if("error"in c)throw new Dt(c.error,`failed to get token accounts owned by account ${t.toBase58()}`);return c.result}async getParsedTokenAccountsByOwner(t,e,n){let r=[t.toBase58()];"mint"in e?r.push({mint:e.mint.toBase58()}):r.push({programId:e.programId.toBase58()});const i=this._buildArgs(r,n,"jsonParsed"),o=await this._rpcRequest("getTokenAccountsByOwner",i),s=(0,p.Ue)(o,_e);if("error"in s)throw new Dt(s.error,`failed to get token accounts owned by account ${t.toBase58()}`);return s.result}async getLargestAccounts(t){const e={...t,commitment:t&&t.commitment||this.commitment},n=e.filter||e.commitment?[e]:[],r=await this._rpcRequest("getLargestAccounts",n),i=(0,p.Ue)(r,Se);if("error"in i)throw new Dt(i.error,"failed to get largest accounts");return i.result}async getTokenLargestAccounts(t,e){const n=this._buildArgs([t.toBase58()],e),r=await this._rpcRequest("getTokenLargestAccounts",n),i=(0,p.Ue)(r,ve);if("error"in i)throw new Dt(i.error,"failed to get token largest accounts");return i.result}async getAccountInfoAndContext(t,e){const{commitment:n,config:r}=Xt(e),i=this._buildArgs([t.toBase58()],n,"base64",r),o=await this._rpcRequest("getAccountInfo",i),s=(0,p.Ue)(o,te((0,p.AG)(Ee)));if("error"in s)throw new Dt(s.error,`failed to get info about account ${t.toBase58()}`);return s.result}async getParsedAccountInfo(t,e){const{commitment:n,config:r}=Xt(e),i=this._buildArgs([t.toBase58()],n,"jsonParsed",r),o=await this._rpcRequest("getAccountInfo",i),s=(0,p.Ue)(o,te((0,p.AG)(Pe)));if("error"in s)throw new Dt(s.error,`failed to get info about account ${t.toBase58()}`);return s.result}async getAccountInfo(t,e){try{return(await this.getAccountInfoAndContext(t,e)).value}catch(n){throw new Error("failed to get info about account "+t.toBase58()+": "+n)}}async getMultipleParsedAccounts(t,e){const{commitment:n,config:r}=Xt(e),i=t.map((t=>t.toBase58())),o=this._buildArgs([i],n,"jsonParsed",r),s=await this._rpcRequest("getMultipleAccounts",o),a=(0,p.Ue)(s,te((0,p.IX)((0,p.AG)(Pe))));if("error"in a)throw new Dt(a.error,`failed to get info for accounts ${i}`);return a.result}async getMultipleAccountsInfoAndContext(t,e){const{commitment:n,config:r}=Xt(e),i=t.map((t=>t.toBase58())),o=this._buildArgs([i],n,"base64",r),s=await this._rpcRequest("getMultipleAccounts",o),a=(0,p.Ue)(s,te((0,p.IX)((0,p.AG)(Ee))));if("error"in a)throw new Dt(a.error,`failed to get info for accounts ${i}`);return a.result}async getMultipleAccountsInfo(t,e){return(await this.getMultipleAccountsInfoAndContext(t,e)).value}async getStakeActivation(t,e,n){const{commitment:r,config:i}=Xt(e),o=this._buildArgs([t.toBase58()],r,void 0,{...i,epoch:null!=n?n:null==i?void 0:i.epoch}),s=await this._rpcRequest("getStakeActivation",o),a=(0,p.Ue)(s,Qt(Oe));if("error"in a)throw new Dt(a.error,`failed to get Stake Activation ${t.toBase58()}`);return a.result}async getProgramAccounts(t,e){const{commitment:n,config:r}=Xt(e),{encoding:i,...o}=r||{},s=this._buildArgs([t.toBase58()],n,i||"base64",o),a=await this._rpcRequest("getProgramAccounts",s),c=(0,p.Ue)(a,Qt((0,p.IX)(Te)));if("error"in c)throw new Dt(c.error,`failed to get accounts owned by program ${t.toBase58()}`);return c.result}async getParsedProgramAccounts(t,e){const{commitment:n,config:r}=Xt(e),i=this._buildArgs([t.toBase58()],n,"jsonParsed",r),o=await this._rpcRequest("getProgramAccounts",i),s=(0,p.Ue)(o,Qt((0,p.IX)(Be)));if("error"in s)throw new Dt(s.error,`failed to get accounts owned by program ${t.toBase58()}`);return s.result}async confirmTransaction(t,e){let n,r;if("string"==typeof t)n=t;else{n=t.signature}try{r=u().decode(n)}catch(h){throw new Error("signature must be base58 encoded: "+n)}V(64===r.length,"signature has invalid length");const i=e||this.commitment;let o,s,a=!1;const c=new Promise(((t,e)=>{try{s=this.onSignature(n,((e,n)=>{s=void 0;const r={context:n,value:e};a=!0,t({__type:tt.PROCESSED,response:r})}),i)}catch(h){e(h)}})),l=new Promise((n=>{if("string"==typeof t){let t=this._confirmTransactionInitialTimeout||6e4;switch(i){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":t=this._confirmTransactionInitialTimeout||3e4}o=setTimeout((()=>n({__type:tt.TIMED_OUT,timeoutMs:t})),t)}else{let r=t;const i=async()=>{try{return await this.getBlockHeight(e)}catch(t){return-1}};(async()=>{let t=await i();if(!a){for(;t<=r.lastValidBlockHeight;){if(await gt(1e3),a)return;if(t=await i(),a)return}n({__type:tt.BLOCKHEIGHT_EXCEEDED})}})()}}));let d;try{const t=await Promise.race([c,l]);switch(t.__type){case tt.BLOCKHEIGHT_EXCEEDED:throw new D(n);case tt.PROCESSED:d=t.response;break;case tt.TIMED_OUT:throw new j(n,t.timeoutMs/1e3)}}finally{clearTimeout(o),s&&this.removeSignatureListener(s)}return d}async getClusterNodes(){const t=await this._rpcRequest("getClusterNodes",[]),e=(0,p.Ue)(t,Qt((0,p.IX)(Fe)));if("error"in e)throw new Dt(e.error,"failed to get cluster nodes");return e.result}async getVoteAccounts(t){const e=this._buildArgs([],t),n=await this._rpcRequest("getVoteAccounts",e),r=(0,p.Ue)(n,He);if("error"in r)throw new Dt(r.error,"failed to get vote accounts");return r.result}async getSlot(t){const{commitment:e,config:n}=Xt(t),r=this._buildArgs([],e,void 0,n),i=await this._rpcRequest("getSlot",r),o=(0,p.Ue)(i,Qt((0,p.Rx)()));if("error"in o)throw new Dt(o.error,"failed to get slot");return o.result}async getSlotLeader(t){const{commitment:e,config:n}=Xt(t),r=this._buildArgs([],e,void 0,n),i=await this._rpcRequest("getSlotLeader",r),o=(0,p.Ue)(i,Qt((0,p.Z_)()));if("error"in o)throw new Dt(o.error,"failed to get slot leader");return o.result}async getSlotLeaders(t,e){const n=[t,e],r=await this._rpcRequest("getSlotLeaders",n),i=(0,p.Ue)(r,Qt((0,p.IX)(qt)));if("error"in i)throw new Dt(i.error,"failed to get slot leaders");return i.result}async getSignatureStatus(t,e){const{context:n,value:r}=await this.getSignatureStatuses([t],e);V(1===r.length);return{context:n,value:r[0]}}async getSignatureStatuses(t,e){const n=[t];e&&n.push(e);const r=await this._rpcRequest("getSignatureStatuses",n),i=(0,p.Ue)(r,Ze);if("error"in i)throw new Dt(i.error,"failed to get signature status");return i.result}async getTransactionCount(t){const{commitment:e,config:n}=Xt(t),r=this._buildArgs([],e,void 0,n),i=await this._rpcRequest("getTransactionCount",r),o=(0,p.Ue)(i,Qt((0,p.Rx)()));if("error"in o)throw new Dt(o.error,"failed to get transaction count");return o.result}async getTotalSupply(t){return(await this.getSupply({commitment:t,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(t){const e=this._buildArgs([],t),n=await this._rpcRequest("getInflationGovernor",e),r=(0,p.Ue)(n,pe);if("error"in r)throw new Dt(r.error,"failed to get inflation");return r.result}async getInflationReward(t,e,n){const{commitment:r,config:i}=Xt(n),o=this._buildArgs([t.map((t=>t.toBase58()))],r,void 0,{...i,epoch:null!=e?e:null==i?void 0:i.epoch}),s=await this._rpcRequest("getInflationReward",o),a=(0,p.Ue)(s,ie);if("error"in a)throw new Dt(a.error,"failed to get inflation reward");return a.result}async getEpochInfo(t){const{commitment:e,config:n}=Xt(t),r=this._buildArgs([],e,void 0,n),i=await this._rpcRequest("getEpochInfo",r),o=(0,p.Ue)(i,ye);if("error"in o)throw new Dt(o.error,"failed to get epoch info");return o.result}async getEpochSchedule(){const t=await this._rpcRequest("getEpochSchedule",[]),e=(0,p.Ue)(t,ge);if("error"in e)throw new Dt(e.error,"failed to get epoch schedule");const n=e.result;return new Lt(n.slotsPerEpoch,n.leaderScheduleSlotOffset,n.warmup,n.firstNormalEpoch,n.firstNormalSlot)}async getLeaderSchedule(){const t=await this._rpcRequest("getLeaderSchedule",[]),e=(0,p.Ue)(t,me);if("error"in e)throw new Dt(e.error,"failed to get leader schedule");return e.result}async getMinimumBalanceForRentExemption(t,e){const n=this._buildArgs([t],e),r=await this._rpcRequest("getMinimumBalanceForRentExemption",n),i=(0,p.Ue)(r,Ve);return"error"in i?(console.warn("Unable to fetch minimum balance for rent exemption"),0):i.result}async getRecentBlockhashAndContext(t){const e=this._buildArgs([],t),n=await this._rpcRequest("getRecentBlockhash",e),r=(0,p.Ue)(n,gn);if("error"in r)throw new Dt(r.error,"failed to get recent blockhash");return r.result}async getRecentPerformanceSamples(t){const e=await this._rpcRequest("getRecentPerformanceSamples",t?[t]:[]),n=(0,p.Ue)(e,wn);if("error"in n)throw new Dt(n.error,"failed to get recent performance samples");return n.result}async getFeeCalculatorForBlockhash(t,e){const n=this._buildArgs([t],e),r=await this._rpcRequest("getFeeCalculatorForBlockhash",n),i=(0,p.Ue)(r,kn);if("error"in i)throw new Dt(i.error,"failed to get fee calculator");const{context:o,value:s}=i.result;return{context:o,value:null!==s?s.feeCalculator:null}}async getFeeForMessage(t,e){const n=t.serialize().toString("base64"),r=this._buildArgs([n],e),i=await this._rpcRequest("getFeeForMessage",r),o=(0,p.Ue)(i,te((0,p.AG)((0,p.Rx)())));if("error"in o)throw new Dt(o.error,"failed to get fee for message");if(null===o.result)throw new Error("invalid blockhash");return o.result}async getRecentBlockhash(t){try{return(await this.getRecentBlockhashAndContext(t)).value}catch(e){throw new Error("failed to get recent blockhash: "+e)}}async getLatestBlockhash(t){try{return(await this.getLatestBlockhashAndContext(t)).value}catch(e){throw new Error("failed to get recent blockhash: "+e)}}async getLatestBlockhashAndContext(t){const{commitment:e,config:n}=Xt(t),r=this._buildArgs([],e,void 0,n),i=await this._rpcRequest("getLatestBlockhash",r),o=(0,p.Ue)(i,mn);if("error"in o)throw new Dt(o.error,"failed to get latest blockhash");return o.result}async getVersion(){const t=await this._rpcRequest("getVersion",[]),e=(0,p.Ue)(t,Qt(de));if("error"in e)throw new Dt(e.error,"failed to get version");return e.result}async getGenesisHash(){const t=await this._rpcRequest("getGenesisHash",[]),e=(0,p.Ue)(t,Qt((0,p.Z_)()));if("error"in e)throw new Dt(e.error,"failed to get genesis hash");return e.result}async getBlock(t,e){const{commitment:n,config:r}=Xt(e),i=this._buildArgsAtLeastConfirmed([t],n,void 0,r),o=await this._rpcRequest("getBlock",i),s=(0,p.Ue)(o,ln);if("error"in s)throw new Dt(s.error,"failed to get confirmed block");const a=s.result;return a?{...a,transactions:a.transactions.map((({transaction:t,meta:e,version:n})=>({meta:e,transaction:{...t,message:ne(n,t.message)},version:n})))}:a}async getParsedBlock(t,e){const{commitment:n,config:r}=Xt(e),i=this._buildArgsAtLeastConfirmed([t],n,"jsonParsed",r),o=await this._rpcRequest("getBlock",i),s=(0,p.Ue)(o,dn);if("error"in s)throw new Dt(s.error,"failed to get block");return s.result}async getBlockHeight(t){const{commitment:e,config:n}=Xt(t),r=this._buildArgs([],e,void 0,n),i=await this._rpcRequest("getBlockHeight",r),o=(0,p.Ue)(i,Qt((0,p.Rx)()));if("error"in o)throw new Dt(o.error,"failed to get block height information");return o.result}async getBlockProduction(t){let e,n;if("string"==typeof t)n=t;else if(t){const{commitment:r,...i}=t;n=r,e=i}const r=this._buildArgs([],n,"base64",e),i=await this._rpcRequest("getBlockProduction",r),o=(0,p.Ue)(i,fe);if("error"in o)throw new Dt(o.error,"failed to get block production information");return o.result}async getTransaction(t,e){const{commitment:n,config:r}=Xt(e),i=this._buildArgsAtLeastConfirmed([t],n,void 0,r),o=await this._rpcRequest("getTransaction",i),s=(0,p.Ue)(o,pn);if("error"in s)throw new Dt(s.error,"failed to get transaction");const a=s.result;return a?{...a,transaction:{...a.transaction,message:ne(a.version,a.transaction.message)}}:a}async getParsedTransaction(t,e){const{commitment:n,config:r}=Xt(e),i=this._buildArgsAtLeastConfirmed([t],n,"jsonParsed",r),o=await this._rpcRequest("getTransaction",i),s=(0,p.Ue)(o,yn);if("error"in s)throw new Dt(s.error,"failed to get transaction");return s.result}async getParsedTransactions(t,e){const{commitment:n,config:r}=Xt(e),i=t.map((t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],n,"jsonParsed",r)})));return(await this._rpcBatchRequest(i)).map((t=>{const e=(0,p.Ue)(t,yn);if("error"in e)throw new Dt(e.error,"failed to get transactions");return e.result}))}async getTransactions(t,e){const{commitment:n,config:r}=Xt(e),i=t.map((t=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([t],n,void 0,r)})));return(await this._rpcBatchRequest(i)).map((t=>{const e=(0,p.Ue)(t,pn);if("error"in e)throw new Dt(e.error,"failed to get transactions");const n=e.result;return n?{...n,transaction:{...n.transaction,message:ne(n.version,n.transaction.message)}}:n}))}async getConfirmedBlock(t,e){const n=this._buildArgsAtLeastConfirmed([t],e),r=await this._rpcRequest("getConfirmedBlock",n),i=(0,p.Ue)(r,hn);if("error"in i)throw new Dt(i.error,"failed to get confirmed block");const o=i.result;if(!o)throw new Error("Confirmed block "+t+" not found");const s={...o,transactions:o.transactions.map((({transaction:t,meta:e})=>{const n=new J(t.message);return{meta:e,transaction:{...t,message:n}}}))};return{...s,transactions:s.transactions.map((({transaction:t,meta:e})=>({meta:e,transaction:rt.populate(t.message,t.signatures)})))}}async getBlocks(t,e,n){const r=this._buildArgsAtLeastConfirmed(void 0!==e?[t,e]:[t],n),i=await this._rpcRequest("getBlocks",r),o=(0,p.Ue)(i,Qt((0,p.IX)((0,p.Rx)())));if("error"in o)throw new Dt(o.error,"failed to get blocks");return o.result}async getBlockSignatures(t,e){const n=this._buildArgsAtLeastConfirmed([t],e,void 0,{transactionDetails:"signatures",rewards:!1}),r=await this._rpcRequest("getBlock",n),i=(0,p.Ue)(r,fn);if("error"in i)throw new Dt(i.error,"failed to get block");const o=i.result;if(!o)throw new Error("Block "+t+" not found");return o}async getConfirmedBlockSignatures(t,e){const n=this._buildArgsAtLeastConfirmed([t],e,void 0,{transactionDetails:"signatures",rewards:!1}),r=await this._rpcRequest("getConfirmedBlock",n),i=(0,p.Ue)(r,fn);if("error"in i)throw new Dt(i.error,"failed to get confirmed block");const o=i.result;if(!o)throw new Error("Confirmed block "+t+" not found");return o}async getConfirmedTransaction(t,e){const n=this._buildArgsAtLeastConfirmed([t],e),r=await this._rpcRequest("getConfirmedTransaction",n),i=(0,p.Ue)(r,pn);if("error"in i)throw new Dt(i.error,"failed to get transaction");const o=i.result;if(!o)return o;const s=new J(o.transaction.message),a=o.transaction.signatures;return{...o,transaction:rt.populate(s,a)}}async getParsedConfirmedTransaction(t,e){const n=this._buildArgsAtLeastConfirmed([t],e,"jsonParsed"),r=await this._rpcRequest("getConfirmedTransaction",n),i=(0,p.Ue)(r,yn);if("error"in i)throw new Dt(i.error,"failed to get confirmed transaction");return i.result}async getParsedConfirmedTransactions(t,e){const n=t.map((t=>({methodName:"getConfirmedTransaction",args:this._buildArgsAtLeastConfirmed([t],e,"jsonParsed")})));return(await this._rpcBatchRequest(n)).map((t=>{const e=(0,p.Ue)(t,yn);if("error"in e)throw new Dt(e.error,"failed to get confirmed transactions");return e.result}))}async getConfirmedSignaturesForAddress(t,e,n){let r={},i=await this.getFirstAvailableBlock();for(;!("until"in r)&&!(--e<=0||e<i);)try{const t=await this.getConfirmedBlockSignatures(e,"finalized");t.signatures.length>0&&(r.until=t.signatures[t.signatures.length-1].toString())}catch(s){if(s instanceof Error&&s.message.includes("skipped"))continue;throw s}let o=await this.getSlot("finalized");for(;!("before"in r||++n>o);)try{const t=await this.getConfirmedBlockSignatures(n);t.signatures.length>0&&(r.before=t.signatures[t.signatures.length-1].toString())}catch(s){if(s instanceof Error&&s.message.includes("skipped"))continue;throw s}return(await this.getConfirmedSignaturesForAddress2(t,r)).map((t=>t.signature))}async getConfirmedSignaturesForAddress2(t,e,n){const r=this._buildArgsAtLeastConfirmed([t.toBase58()],n,void 0,e),i=await this._rpcRequest("getConfirmedSignaturesForAddress2",r),o=(0,p.Ue)(i,Re);if("error"in o)throw new Dt(o.error,"failed to get confirmed signatures for address");return o.result}async getSignaturesForAddress(t,e,n){const r=this._buildArgsAtLeastConfirmed([t.toBase58()],n,void 0,e),i=await this._rpcRequest("getSignaturesForAddress",r),o=(0,p.Ue)(i,Me);if("error"in o)throw new Dt(o.error,"failed to get signatures for address");return o.result}async getAddressLookupTable(t,e){const{context:n,value:r}=await this.getAccountInfoAndContext(t,e);let i=null;return null!==r&&(i=new Wt({key:t,state:Wt.deserialize(r.data)})),{context:n,value:i}}async getNonceAndContext(t,e){const{context:n,value:r}=await this.getAccountInfoAndContext(t,e);let i=null;return null!==r&&(i=It.fromAccountData(r.data)),{context:n,value:i}}async getNonce(t,e){return await this.getNonceAndContext(t,e).then((t=>t.value)).catch((e=>{throw new Error("failed to get nonce for account "+t.toBase58()+": "+e)}))}async requestAirdrop(t,e){const n=await this._rpcRequest("requestAirdrop",[t.toBase58(),e]),r=(0,p.Ue)(n,vn);if("error"in r)throw new Dt(r.error,`airdrop to ${t.toBase58()} failed`);return r.result}async _blockhashWithExpiryBlockHeight(t){if(!t){for(;this._pollingBlockhash;)await gt(100);const t=Date.now()-this._blockhashInfo.lastFetch>=Vt;if(null!==this._blockhashInfo.latestBlockhash&&!t)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{const t=Date.now(),e=this._blockhashInfo.latestBlockhash,n=e?e.blockhash:null;for(let r=0;r<50;r++){const t=await this.getLatestBlockhash("finalized");if(n!==t.blockhash)return this._blockhashInfo={latestBlockhash:t,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},t;await gt(200)}throw new Error(`Unable to obtain a new blockhash after ${Date.now()-t}ms`)}finally{this._pollingBlockhash=!1}}async getStakeMinimumDelegation(t){const{commitment:e,config:n}=Xt(t),r=this._buildArgs([],e,"base64",n),i=await this._rpcRequest("getStakeMinimumDelegation",r),o=(0,p.Ue)(i,te((0,p.Rx)()));if("error"in o)throw new Dt(o.error,"failed to get stake minimum delegation");return o.result}async simulateTransaction(t,e,n){if("message"in t){const i=t.serialize(),o=r.Buffer.from(i).toString("base64");if(Array.isArray(e)||void 0!==n)throw new Error("Invalid arguments");const s=e||{};s.encoding="base64","commitment"in s||(s.commitment=this.commitment);const a=[o,s],c=await this._rpcRequest("simulateTransaction",a),u=(0,p.Ue)(c,he);if("error"in u)throw new Error("failed to simulate transaction: "+u.error.message);return u.result}let i;if(t instanceof rt){let e=t;i=new rt,i.feePayer=e.feePayer,i.instructions=t.instructions,i.nonceInfo=e.nonceInfo,i.signatures=e.signatures}else i=rt.populate(t),i._message=i._json=void 0;if(void 0!==e&&!Array.isArray(e))throw new Error("Invalid arguments");const o=e;if(i.nonceInfo&&o)i.sign(...o);else{let t=this._disableBlockhashCaching;for(;;){const e=await this._blockhashWithExpiryBlockHeight(t);if(i.lastValidBlockHeight=e.lastValidBlockHeight,i.recentBlockhash=e.blockhash,!o)break;if(i.sign(...o),!i.signature)throw new Error("!signature");const n=i.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(n)&&!this._blockhashInfo.transactionSignatures.includes(n)){this._blockhashInfo.simulatedSignatures.push(n);break}t=!0}}const s=i._compile(),a=s.serialize(),c=i._serialize(a).toString("base64"),u={encoding:"base64",commitment:this.commitment};if(n){const t=(Array.isArray(n)?n:s.nonProgramIds()).map((t=>t.toBase58()));u.accounts={encoding:"base64",addresses:t}}o&&(u.sigVerify=!0);const l=[c,u],d=await this._rpcRequest("simulateTransaction",l),h=(0,p.Ue)(d,he);if("error"in h){let t;if("data"in h.error&&(t=h.error.data.logs,t&&Array.isArray(t))){const e="\n ",n=e+t.join(e);console.error(h.error.message,n)}throw new zt("failed to simulate transaction: "+h.error.message,t)}return h.result}async sendTransaction(t,e,n){if("version"in t){if(e&&Array.isArray(e))throw new Error("Invalid arguments");const r=t.serialize();return await this.sendRawTransaction(r,n)}if(void 0===e||!Array.isArray(e))throw new Error("Invalid arguments");const r=e;if(t.nonceInfo)t.sign(...r);else{let e=this._disableBlockhashCaching;for(;;){const n=await this._blockhashWithExpiryBlockHeight(e);if(t.lastValidBlockHeight=n.lastValidBlockHeight,t.recentBlockhash=n.blockhash,t.sign(...r),!t.signature)throw new Error("!signature");const i=t.signature.toString("base64");if(!this._blockhashInfo.transactionSignatures.includes(i)){this._blockhashInfo.transactionSignatures.push(i);break}e=!0}}const i=t.serialize();return await this.sendRawTransaction(i,n)}async sendRawTransaction(t,e){const n=T(t).toString("base64");return await this.sendEncodedTransaction(n,e)}async sendEncodedTransaction(t,e){const n={encoding:"base64"},r=e&&e.skipPreflight,i=e&&e.preflightCommitment||this.commitment;e&&null!=e.maxRetries&&(n.maxRetries=e.maxRetries),e&&null!=e.minContextSlot&&(n.minContextSlot=e.minContextSlot),r&&(n.skipPreflight=r),i&&(n.preflightCommitment=i);const o=[t,n],s=await this._rpcRequest("sendTransaction",o),a=(0,p.Ue)(s,In);if("error"in a){let t;throw"data"in a.error&&(t=a.error.data.logs),new zt("failed to send transaction: "+a.error.message,t)}return a.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval((()=>{this._rpcWebSocket.notify("ping").catch((()=>{}))}),5e3),this._updateSubscriptions()}_wsOnError(t){this._rpcWebSocketConnected=!1,console.error("ws error:",t.message)}_wsOnClose(t){this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration=(this._rpcWebSocketGeneration+1)%Number.MAX_SAFE_INTEGER,this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null),this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),1e3!==t?(this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach((([t,e])=>{this._subscriptionsByHash[t]={...e,state:"pending"}}))):this._updateSubscriptions()}async _updateSubscriptions(){if(0===Object.keys(this._subscriptionsByHash).length)return void(this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout((()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(t){t instanceof Error&&console.log(`Error when closing socket connection: ${t.message}`)}}),500)));if(null!==this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected)return void this._rpcWebSocket.connect();const t=this._rpcWebSocketGeneration,e=()=>t===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map((async t=>{const n=this._subscriptionsByHash[t];if(void 0!==n)switch(n.state){case"pending":case"unsubscribed":if(0===n.callbacks.size)return delete this._subscriptionsByHash[t],"unsubscribed"===n.state&&delete this._subscriptionCallbacksByServerSubscriptionId[n.serverSubscriptionId],void(await this._updateSubscriptions());await(async()=>{const{args:r,method:i}=n;try{this._subscriptionsByHash[t]={...n,state:"subscribing"};const e=await this._rpcWebSocket.call(i,r);this._subscriptionsByHash[t]={...n,serverSubscriptionId:e,state:"subscribed"},this._subscriptionCallbacksByServerSubscriptionId[e]=n.callbacks,await this._updateSubscriptions()}catch(o){if(o instanceof Error&&console.error(`${i} error for argument`,r,o.message),!e())return;this._subscriptionsByHash[t]={...n,state:"pending"},await this._updateSubscriptions()}})();break;case"subscribed":0===n.callbacks.size&&await(async()=>{const{serverSubscriptionId:r,unsubscribeMethod:i}=n;if(this._subscriptionsAutoDisposedByRpc.has(r))this._subscriptionsAutoDisposedByRpc.delete(r);else{this._subscriptionsByHash[t]={...n,state:"unsubscribing"};try{await this._rpcWebSocket.call(i,[r])}catch(o){if(o instanceof Error&&console.error(`${i} error:`,o.message),!e())return;return this._subscriptionsByHash[t]={...n,state:"subscribed"},void(await this._updateSubscriptions())}}this._subscriptionsByHash[t]={...n,state:"unsubscribed"},await this._updateSubscriptions()})()}})))}_handleServerNotification(t,e){const n=this._subscriptionCallbacksByServerSubscriptionId[t];void 0!==n&&n.forEach((t=>{try{t(...e)}catch(n){console.error(n)}}))}_wsOnAccountNotification(t){const{result:e,subscription:n}=(0,p.Ue)(t,Ce);this._handleServerNotification(n,[e.value,e.context])}_makeSubscription(t,e){const n=this._nextClientSubscriptionId++,r=Ut([t.method,e],!0),i=this._subscriptionsByHash[r];return void 0===i?this._subscriptionsByHash[r]={...t,args:e,callbacks:new Set([t.callback]),state:"pending"}:i.callbacks.add(t.callback),this._subscriptionDisposeFunctionsByClientSubscriptionId[n]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[n];const e=this._subscriptionsByHash[r];V(void 0!==e,`Could not find a \`Subscription\` when tearing down client subscription #${n}`),e.callbacks.delete(t.callback),await this._updateSubscriptions()},this._updateSubscriptions(),n}onAccountChange(t,e,n){const r=this._buildArgs([t.toBase58()],n||this._commitment||"finalized","base64");return this._makeSubscription({callback:e,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},r)}async removeAccountChangeListener(t){await this._unsubscribeClientSubscription(t,"account change")}_wsOnProgramAccountNotification(t){const{result:e,subscription:n}=(0,p.Ue)(t,Ne);this._handleServerNotification(n,[{accountId:e.value.pubkey,accountInfo:e.value.account},e.context])}onProgramAccountChange(t,e,n,r){const i=this._buildArgs([t.toBase58()],n||this._commitment||"finalized","base64",r?{filters:r}:void 0);return this._makeSubscription({callback:e,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},i)}async removeProgramAccountChangeListener(t){await this._unsubscribeClientSubscription(t,"program account change")}onLogs(t,e,n){const r=this._buildArgs(["object"==typeof t?{mentions:[t.toString()]}:t],n||this._commitment||"finalized");return this._makeSubscription({callback:e,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},r)}async removeOnLogsListener(t){await this._unsubscribeClientSubscription(t,"logs")}_wsOnLogsNotification(t){const{result:e,subscription:n}=(0,p.Ue)(t,_n);this._handleServerNotification(n,[e.value,e.context])}_wsOnSlotNotification(t){const{result:e,subscription:n}=(0,p.Ue)(t,ze);this._handleServerNotification(n,[e])}onSlotChange(t){return this._makeSubscription({callback:t,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(t){await this._unsubscribeClientSubscription(t,"slot change")}_wsOnSlotUpdatesNotification(t){const{result:e,subscription:n}=(0,p.Ue)(t,De);this._handleServerNotification(n,[e])}onSlotUpdate(t){return this._makeSubscription({callback:t,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(t){await this._unsubscribeClientSubscription(t,"slot update")}async _unsubscribeClientSubscription(t,e){const n=this._subscriptionDisposeFunctionsByClientSubscriptionId[t];n?await n():console.warn(`Ignored unsubscribe request because an active subscription with id \`${t}\` for '${e}' events could not be found.`)}_buildArgs(t,e,n,r){const i=e||this._commitment;if(i||n||r){let e={};n&&(e.encoding=n),i&&(e.commitment=i),r&&(e=Object.assign(e,r)),t.push(e)}return t}_buildArgsAtLeastConfirmed(t,e,n,r){const i=e||this._commitment;if(i&&!["confirmed","finalized"].includes(i))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(t,e,n,r)}_wsOnSignatureNotification(t){const{result:e,subscription:n}=(0,p.Ue)(t,je);"receivedSignature"!==e.value&&this._subscriptionsAutoDisposedByRpc.add(n),this._handleServerNotification(n,"receivedSignature"===e.value?[{type:"received"},e.context]:[{type:"status",result:e.value},e.context])}onSignature(t,e,n){const r=this._buildArgs([t],n||this._commitment||"finalized"),i=this._makeSubscription({callback:(t,n)=>{if("status"===t.type){e(t.result,n);try{this.removeSignatureListener(i)}catch(r){}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},r);return i}onSignatureWithOptions(t,e,n){const{commitment:r,...i}={...n,commitment:n&&n.commitment||this._commitment||"finalized"},o=this._buildArgs([t],r,void 0,i),s=this._makeSubscription({callback:(t,n)=>{e(t,n);try{this.removeSignatureListener(s)}catch(r){}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},o);return s}async removeSignatureListener(t){await this._unsubscribeClientSubscription(t,"signature result")}_wsOnRootNotification(t){const{result:e,subscription:n}=(0,p.Ue)(t,We);this._handleServerNotification(n,[e])}onRootChange(t){return this._makeSubscription({callback:t,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(t){await this._unsubscribeClientSubscription(t,"root change")}}class Tn{constructor(t){this._keypair=void 0,this._keypair=null!=t?t:I()}static generate(){return new Tn(I())}static fromSecretKey(t,e){if(64!==t.byteLength)throw new Error("bad secret key size");const n=t.slice(32,64);if(!e||!e.skipValidation){const e=t.slice(0,32),r=A(e);for(let t=0;t<32;t++)if(n[t]!==r[t])throw new Error("provided secretKey is invalid")}return new Tn({publicKey:n,secretKey:t})}static fromSeed(t){const e=A(t),n=new Uint8Array(64);return n.set(t),n.set(e,32),new Tn({publicKey:e,secretKey:n})}get publicKey(){return new C(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}const xn=Object.freeze({CreateLookupTable:{index:0,layout:h.struct([h.u32("instruction"),At("recentSlot"),h.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:h.struct([h.u32("instruction")])},ExtendLookupTable:{index:2,layout:h.struct([h.u32("instruction"),At(),h.seq(F(),h.offset(h.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:h.struct([h.u32("instruction")])},CloseLookupTable:{index:4,layout:h.struct([h.u32("instruction")])}});class Pn{constructor(){}static decodeInstructionType(t){this.checkProgramId(t.programId);const e=h.u32("instruction").decode(t.data);let n;for(const[r,i]of Object.entries(xn))if(i.index==e){n=r;break}if(!n)throw new Error("Invalid Instruction. Should be a LookupTable Instruction");return n}static decodeCreateLookupTable(t){this.checkProgramId(t.programId),this.checkKeysLength(t.keys,4);const{recentSlot:e}=bt(xn.CreateLookupTable,t.data);return{authority:t.keys[1].pubkey,payer:t.keys[2].pubkey,recentSlot:Number(e)}}static decodeExtendLookupTable(t){if(this.checkProgramId(t.programId),t.keys.length<2)throw new Error(`invalid instruction; found ${t.keys.length} keys, expected at least 2`);const{addresses:e}=bt(xn.ExtendLookupTable,t.data);return{lookupTable:t.keys[0].pubkey,authority:t.keys[1].pubkey,payer:t.keys.length>2?t.keys[2].pubkey:void 0,addresses:e.map((t=>new C(t)))}}static decodeCloseLookupTable(t){return this.checkProgramId(t.programId),this.checkKeysLength(t.keys,3),{lookupTable:t.keys[0].pubkey,authority:t.keys[1].pubkey,recipient:t.keys[2].pubkey}}static decodeFreezeLookupTable(t){return this.checkProgramId(t.programId),this.checkKeysLength(t.keys,2),{lookupTable:t.keys[0].pubkey,authority:t.keys[1].pubkey}}static decodeDeactivateLookupTable(t){return this.checkProgramId(t.programId),this.checkKeysLength(t.keys,2),{lookupTable:t.keys[0].pubkey,authority:t.keys[1].pubkey}}static checkProgramId(t){if(!t.equals(Bn.programId))throw new Error("invalid instruction; programId is not AddressLookupTable Program")}static checkKeysLength(t,e){if(t.length<e)throw new Error(`invalid instruction; found ${t.length} keys, expected at least ${e}`)}}class Bn{constructor(){}static createLookupTable(t){const[e,n]=C.findProgramAddressSync([t.authority.toBuffer(),(0,f.toBufferLE)(BigInt(t.recentSlot),8)],this.programId),r=mt(xn.CreateLookupTable,{recentSlot:BigInt(t.recentSlot),bumpSeed:n}),i=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1},{pubkey:t.payer,isSigner:!0,isWritable:!0},{pubkey:Tt.programId,isSigner:!1,isWritable:!1}];return[new nt({programId:this.programId,keys:i,data:r}),e]}static freezeLookupTable(t){const e=mt(xn.FreezeLookupTable),n=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return new nt({programId:this.programId,keys:n,data:e})}static extendLookupTable(t){const e=mt(xn.ExtendLookupTable,{addresses:t.addresses.map((t=>t.toBytes()))}),n=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return t.payer&&n.push({pubkey:t.payer,isSigner:!0,isWritable:!0},{pubkey:Tt.programId,isSigner:!1,isWritable:!1}),new nt({programId:this.programId,keys:n,data:e})}static deactivateLookupTable(t){const e=mt(xn.DeactivateLookupTable),n=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1}];return new nt({programId:this.programId,keys:n,data:e})}static closeLookupTable(t){const e=mt(xn.CloseLookupTable),n=[{pubkey:t.lookupTable,isSigner:!1,isWritable:!0},{pubkey:t.authority,isSigner:!0,isWritable:!1},{pubkey:t.recipient,isSigner:!1,isWritable:!0}];return new nt({programId:this.programId,keys:n,data:e})}}Bn.programId=new C("AddressLookupTab1e1111111111111111111111111");class On{constructor(){}static decodeInstructionType(t){this.checkProgramId(t.programId);const e=h.u8("instruction").decode(t.data);let n;for(const[r,i]of Object.entries(Rn))if(i.index==e){n=r;break}if(!n)throw new Error("Instruction type incorrect; not a ComputeBudgetInstruction");return n}static decodeRequestUnits(t){this.checkProgramId(t.programId);const{units:e,additionalFee:n}=bt(Rn.RequestUnits,t.data);return{units:e,additionalFee:n}}static decodeRequestHeapFrame(t){this.checkProgramId(t.programId);const{bytes:e}=bt(Rn.RequestHeapFrame,t.data);return{bytes:e}}static decodeSetComputeUnitLimit(t){this.checkProgramId(t.programId);const{units:e}=bt(Rn.SetComputeUnitLimit,t.data);return{units:e}}static decodeSetComputeUnitPrice(t){this.checkProgramId(t.programId);const{microLamports:e}=bt(Rn.SetComputeUnitPrice,t.data);return{microLamports:e}}static checkProgramId(t){if(!t.equals(Mn.programId))throw new Error("invalid instruction; programId is not ComputeBudgetProgram")}}const Rn=Object.freeze({RequestUnits:{index:0,layout:h.struct([h.u8("instruction"),h.u32("units"),h.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:h.struct([h.u8("instruction"),h.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:h.struct([h.u8("instruction"),h.u32("units")])},SetComputeUnitPrice:{index:3,layout:h.struct([h.u8("instruction"),At("microLamports")])}});class Mn{constructor(){}static requestUnits(t){const e=mt(Rn.RequestUnits,t);return new nt({keys:[],programId:this.programId,data:e})}static requestHeapFrame(t){const e=mt(Rn.RequestHeapFrame,t);return new nt({keys:[],programId:this.programId,data:e})}static setComputeUnitLimit(t){const e=mt(Rn.SetComputeUnitLimit,t);return new nt({keys:[],programId:this.programId,data:e})}static setComputeUnitPrice(t){const e=mt(Rn.SetComputeUnitPrice,{microLamports:BigInt(t.microLamports)});return new nt({keys:[],programId:this.programId,data:e})}}Mn.programId=new C("ComputeBudget111111111111111111111111111111");const Cn=h.struct([h.u8("numSignatures"),h.u8("padding"),h.u16("signatureOffset"),h.u16("signatureInstructionIndex"),h.u16("publicKeyOffset"),h.u16("publicKeyInstructionIndex"),h.u16("messageDataOffset"),h.u16("messageDataSize"),h.u16("messageInstructionIndex")]);class Un{constructor(){}static createInstructionWithPublicKey(t){const{publicKey:e,message:n,signature:i,instructionIndex:o}=t;V(32===e.length,`Public Key must be 32 bytes but received ${e.length} bytes`),V(64===i.length,`Signature must be 64 bytes but received ${i.length} bytes`);const s=Cn.span,a=s+e.length,c=a+i.length,u=r.Buffer.alloc(c+n.length),l=null==o?65535:o;return Cn.encode({numSignatures:1,padding:0,signatureOffset:a,signatureInstructionIndex:l,publicKeyOffset:s,publicKeyInstructionIndex:l,messageDataOffset:c,messageDataSize:n.length,messageInstructionIndex:l},u),u.fill(e,s),u.fill(i,a),u.fill(n,c),new nt({keys:[],programId:Un.programId,data:u})}static createInstructionWithPrivateKey(t){const{privateKey:e,message:n,instructionIndex:r}=t;V(64===e.length,`Private key must be 64 bytes but received ${e.length} bytes`);try{const t=Tn.fromSecretKey(e),i=t.publicKey.toBytes(),o=S(n,t.secretKey);return this.createInstructionWithPublicKey({publicKey:i,message:n,signature:o,instructionIndex:r})}catch(i){throw new Error(`Error creating instruction; ${i}`)}}}Un.programId=new C("Ed25519SigVerify111111111111111111111111111"),k.P6.hmacSha256Sync=(t,...e)=>{const n=w.b.create(l.J,t);return e.forEach((t=>n.update(t))),n.digest()};k.P6.isValidPrivateKey;const Nn=k.$3,Ln=h.struct([h.u8("numSignatures"),h.u16("signatureOffset"),h.u8("signatureInstructionIndex"),h.u16("ethAddressOffset"),h.u8("ethAddressInstructionIndex"),h.u16("messageDataOffset"),h.u16("messageDataSize"),h.u8("messageInstructionIndex"),h.blob(20,"ethAddress"),h.blob(64,"signature"),h.u8("recoveryId")]);class zn{constructor(){}static publicKeyToEthAddress(t){V(64===t.length,`Public key must be 64 bytes but received ${t.length} bytes`);try{return r.Buffer.from((0,b.fr)(T(t))).slice(-20)}catch(e){throw new Error(`Error constructing Ethereum address: ${e}`)}}static createInstructionWithPublicKey(t){const{publicKey:e,message:n,signature:r,recoveryId:i,instructionIndex:o}=t;return zn.createInstructionWithEthAddress({ethAddress:zn.publicKeyToEthAddress(e),message:n,signature:r,recoveryId:i,instructionIndex:o})}static createInstructionWithEthAddress(t){const{ethAddress:e,message:n,signature:i,recoveryId:o,instructionIndex:s=0}=t;let a;a="string"==typeof e?e.startsWith("0x")?r.Buffer.from(e.substr(2),"hex"):r.Buffer.from(e,"hex"):e,V(20===a.length,`Address must be 20 bytes but received ${a.length} bytes`);const c=12+a.length,u=c+i.length+1,l=r.Buffer.alloc(Ln.span+n.length);return Ln.encode({numSignatures:1,signatureOffset:c,signatureInstructionIndex:s,ethAddressOffset:12,ethAddressInstructionIndex:s,messageDataOffset:u,messageDataSize:n.length,messageInstructionIndex:s,signature:T(i),ethAddress:T(a),recoveryId:o},l),l.fill(T(n),Ln.span),new nt({keys:[],programId:zn.programId,data:l})}static createInstructionWithPrivateKey(t){const{privateKey:e,message:n,instructionIndex:i}=t;V(32===e.length,`Private key must be 32 bytes but received ${e.length} bytes`);try{const t=T(e),a=Nn(t,!1).slice(1),c=r.Buffer.from((0,b.fr)(T(n))),[u,l]=(o=c,s=t,k.kS(o,s,{der:!1,recovered:!0}));return this.createInstructionWithPublicKey({publicKey:a,message:n,signature:u,recoveryId:l,instructionIndex:i})}catch(a){throw new Error(`Error creating instruction; ${a}`)}var o,s}}zn.programId=new C("KeccakSecp256k11111111111111111111111111111");const Kn=new C("StakeConfig11111111111111111111111111111111");class Dn{constructor(t,e){this.staker=void 0,this.withdrawer=void 0,this.staker=t,this.withdrawer=e}}class jn{constructor(t,e,n){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=e,this.custodian=n}}jn.default=new jn(0,0,C.default);class Wn{constructor(){}static decodeInstructionType(t){this.checkProgramId(t.programId);const e=h.u32("instruction").decode(t.data);let n;for(const[r,i]of Object.entries(Fn))if(i.index==e){n=r;break}if(!n)throw new Error("Instruction type incorrect; not a StakeInstruction");return n}static decodeInitialize(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);const{authorized:e,lockup:n}=bt(Fn.Initialize,t.data);return{stakePubkey:t.keys[0].pubkey,authorized:new Dn(new C(e.staker),new C(e.withdrawer)),lockup:new jn(n.unixTimestamp,n.epoch,new C(n.custodian))}}static decodeDelegate(t){return this.checkProgramId(t.programId),this.checkKeyLength(t.keys,6),bt(Fn.Delegate,t.data),{stakePubkey:t.keys[0].pubkey,votePubkey:t.keys[1].pubkey,authorizedPubkey:t.keys[5].pubkey}}static decodeAuthorize(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);const{newAuthorized:e,stakeAuthorizationType:n}=bt(Fn.Authorize,t.data),r={stakePubkey:t.keys[0].pubkey,authorizedPubkey:t.keys[2].pubkey,newAuthorizedPubkey:new C(e),stakeAuthorizationType:{index:n}};return t.keys.length>3&&(r.custodianPubkey=t.keys[3].pubkey),r}static decodeAuthorizeWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,2);const{newAuthorized:e,stakeAuthorizationType:n,authoritySeed:r,authorityOwner:i}=bt(Fn.AuthorizeWithSeed,t.data),o={stakePubkey:t.keys[0].pubkey,authorityBase:t.keys[1].pubkey,authoritySeed:r,authorityOwner:new C(i),newAuthorizedPubkey:new C(e),stakeAuthorizationType:{index:n}};return t.keys.length>3&&(o.custodianPubkey=t.keys[3].pubkey),o}static decodeSplit(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);const{lamports:e}=bt(Fn.Split,t.data);return{stakePubkey:t.keys[0].pubkey,splitStakePubkey:t.keys[1].pubkey,authorizedPubkey:t.keys[2].pubkey,lamports:e}}static decodeMerge(t){return this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3),bt(Fn.Merge,t.data),{stakePubkey:t.keys[0].pubkey,sourceStakePubKey:t.keys[1].pubkey,authorizedPubkey:t.keys[4].pubkey}}static decodeWithdraw(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,5);const{lamports:e}=bt(Fn.Withdraw,t.data),n={stakePubkey:t.keys[0].pubkey,toPubkey:t.keys[1].pubkey,authorizedPubkey:t.keys[4].pubkey,lamports:e};return t.keys.length>5&&(n.custodianPubkey=t.keys[5].pubkey),n}static decodeDeactivate(t){return this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3),bt(Fn.Deactivate,t.data),{stakePubkey:t.keys[0].pubkey,authorizedPubkey:t.keys[2].pubkey}}static checkProgramId(t){if(!t.equals(Hn.programId))throw new Error("invalid instruction; programId is not StakeProgram")}static checkKeyLength(t,e){if(t.length<e)throw new Error(`invalid instruction; found ${t.length} keys, expected at least ${e}`)}}const Fn=Object.freeze({Initialize:{index:0,layout:h.struct([h.u32("instruction"),((t="authorized")=>h.struct([F("staker"),F("withdrawer")],t))(),((t="lockup")=>h.struct([h.ns64("unixTimestamp"),h.ns64("epoch"),F("custodian")],t))()])},Authorize:{index:1,layout:h.struct([h.u32("instruction"),F("newAuthorized"),h.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:h.struct([h.u32("instruction")])},Split:{index:3,layout:h.struct([h.u32("instruction"),h.ns64("lamports")])},Withdraw:{index:4,layout:h.struct([h.u32("instruction"),h.ns64("lamports")])},Deactivate:{index:5,layout:h.struct([h.u32("instruction")])},Merge:{index:7,layout:h.struct([h.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:h.struct([h.u32("instruction"),F("newAuthorized"),h.u32("stakeAuthorizationType"),H("authoritySeed"),F("authorityOwner")])}}),Gn=Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class Hn{constructor(){}static initialize(t){const{stakePubkey:e,authorized:n,lockup:r}=t,i=r||jn.default,o=mt(Fn.Initialize,{authorized:{staker:T(n.staker.toBuffer()),withdrawer:T(n.withdrawer.toBuffer())},lockup:{unixTimestamp:i.unixTimestamp,epoch:i.epoch,custodian:T(i.custodian.toBuffer())}}),s={keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:lt,isSigner:!1,isWritable:!1}],programId:this.programId,data:o};return new nt(s)}static createAccountWithSeed(t){const e=new rt;e.add(Tt.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:this.space,programId:this.programId}));const{stakePubkey:n,authorized:r,lockup:i}=t;return e.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}static createAccount(t){const e=new rt;e.add(Tt.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.stakePubkey,lamports:t.lamports,space:this.space,programId:this.programId}));const{stakePubkey:n,authorized:r,lockup:i}=t;return e.add(this.initialize({stakePubkey:n,authorized:r,lockup:i}))}static delegate(t){const{stakePubkey:e,authorizedPubkey:n,votePubkey:r}=t,i=mt(Fn.Delegate);return(new rt).add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!1},{pubkey:st,isSigner:!1,isWritable:!1},{pubkey:pt,isSigner:!1,isWritable:!1},{pubkey:Kn,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static authorize(t){const{stakePubkey:e,authorizedPubkey:n,newAuthorizedPubkey:r,stakeAuthorizationType:i,custodianPubkey:o}=t,s=mt(Fn.Authorize,{newAuthorized:T(r.toBuffer()),stakeAuthorizationType:i.index}),a=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:st,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!1,isWritable:!1}),(new rt).add({keys:a,programId:this.programId,data:s})}static authorizeWithSeed(t){const{stakePubkey:e,authorityBase:n,authoritySeed:r,authorityOwner:i,newAuthorizedPubkey:o,stakeAuthorizationType:s,custodianPubkey:a}=t,c=mt(Fn.AuthorizeWithSeed,{newAuthorized:T(o.toBuffer()),stakeAuthorizationType:s.index,authoritySeed:r,authorityOwner:T(i.toBuffer())}),u=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:st,isSigner:!1,isWritable:!1}];return a&&u.push({pubkey:a,isSigner:!1,isWritable:!1}),(new rt).add({keys:u,programId:this.programId,data:c})}static splitInstruction(t){const{stakePubkey:e,authorizedPubkey:n,splitStakePubkey:r,lamports:i}=t,o=mt(Fn.Split,{lamports:i});return new nt({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static split(t){const e=new rt;return e.add(Tt.createAccount({fromPubkey:t.authorizedPubkey,newAccountPubkey:t.splitStakePubkey,lamports:0,space:this.space,programId:this.programId})),e.add(this.splitInstruction(t))}static splitWithSeed(t){const{stakePubkey:e,authorizedPubkey:n,splitStakePubkey:r,basePubkey:i,seed:o,lamports:s}=t,a=new rt;return a.add(Tt.allocate({accountPubkey:r,basePubkey:i,seed:o,space:this.space,programId:this.programId})),a.add(this.splitInstruction({stakePubkey:e,authorizedPubkey:n,splitStakePubkey:r,lamports:s}))}static merge(t){const{stakePubkey:e,sourceStakePubKey:n,authorizedPubkey:r}=t,i=mt(Fn.Merge);return(new rt).add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:st,isSigner:!1,isWritable:!1},{pubkey:pt,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static withdraw(t){const{stakePubkey:e,authorizedPubkey:n,toPubkey:r,lamports:i,custodianPubkey:o}=t,s=mt(Fn.Withdraw,{lamports:i}),a=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:st,isSigner:!1,isWritable:!1},{pubkey:pt,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!1,isWritable:!1}),(new rt).add({keys:a,programId:this.programId,data:s})}static deactivate(t){const{stakePubkey:e,authorizedPubkey:n}=t,r=mt(Fn.Deactivate);return(new rt).add({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:st,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}}Hn.programId=new C("Stake11111111111111111111111111111111111111"),Hn.space=200;class qn{constructor(t,e,n,r){this.nodePubkey=void 0,this.authorizedVoter=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.nodePubkey=t,this.authorizedVoter=e,this.authorizedWithdrawer=n,this.commission=r}}class $n{constructor(){}static decodeInstructionType(t){this.checkProgramId(t.programId);const e=h.u32("instruction").decode(t.data);let n;for(const[r,i]of Object.entries(Zn))if(i.index==e){n=r;break}if(!n)throw new Error("Instruction type incorrect; not a VoteInstruction");return n}static decodeInitializeAccount(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,4);const{voteInit:e}=bt(Zn.InitializeAccount,t.data);return{votePubkey:t.keys[0].pubkey,nodePubkey:t.keys[3].pubkey,voteInit:new qn(new C(e.nodePubkey),new C(e.authorizedVoter),new C(e.authorizedWithdrawer),e.commission)}}static decodeAuthorize(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);const{newAuthorized:e,voteAuthorizationType:n}=bt(Zn.Authorize,t.data);return{votePubkey:t.keys[0].pubkey,authorizedPubkey:t.keys[2].pubkey,newAuthorizedPubkey:new C(e),voteAuthorizationType:{index:n}}}static decodeAuthorizeWithSeed(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);const{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:e,currentAuthorityDerivedKeySeed:n,newAuthorized:r,voteAuthorizationType:i}}=bt(Zn.AuthorizeWithSeed,t.data);return{currentAuthorityDerivedKeyBasePubkey:t.keys[2].pubkey,currentAuthorityDerivedKeyOwnerPubkey:new C(e),currentAuthorityDerivedKeySeed:n,newAuthorizedPubkey:new C(r),voteAuthorizationType:{index:i},votePubkey:t.keys[0].pubkey}}static decodeWithdraw(t){this.checkProgramId(t.programId),this.checkKeyLength(t.keys,3);const{lamports:e}=bt(Zn.Withdraw,t.data);return{votePubkey:t.keys[0].pubkey,authorizedWithdrawerPubkey:t.keys[2].pubkey,lamports:e,toPubkey:t.keys[1].pubkey}}static checkProgramId(t){if(!t.equals(Xn.programId))throw new Error("invalid instruction; programId is not VoteProgram")}static checkKeyLength(t,e){if(t.length<e)throw new Error(`invalid instruction; found ${t.length} keys, expected at least ${e}`)}}const Zn=Object.freeze({InitializeAccount:{index:0,layout:h.struct([h.u32("instruction"),((t="voteInit")=>h.struct([F("nodePubkey"),F("authorizedVoter"),F("authorizedWithdrawer"),h.u8("commission")],t))()])},Authorize:{index:1,layout:h.struct([h.u32("instruction"),F("newAuthorized"),h.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:h.struct([h.u32("instruction"),h.ns64("lamports")])},AuthorizeWithSeed:{index:10,layout:h.struct([h.u32("instruction"),((t="voteAuthorizeWithSeedArgs")=>h.struct([h.u32("voteAuthorizationType"),F("currentAuthorityDerivedKeyOwnerPubkey"),H("currentAuthorityDerivedKeySeed"),F("newAuthorized")],t))()])}}),Vn=Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class Xn{constructor(){}static initializeAccount(t){const{votePubkey:e,nodePubkey:n,voteInit:r}=t,i=mt(Zn.InitializeAccount,{voteInit:{nodePubkey:T(r.nodePubkey.toBuffer()),authorizedVoter:T(r.authorizedVoter.toBuffer()),authorizedWithdrawer:T(r.authorizedWithdrawer.toBuffer()),commission:r.commission}}),o={keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:lt,isSigner:!1,isWritable:!1},{pubkey:st,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i};return new nt(o)}static createAccount(t){const e=new rt;return e.add(Tt.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.votePubkey,lamports:t.lamports,space:this.space,programId:this.programId})),e.add(this.initializeAccount({votePubkey:t.votePubkey,nodePubkey:t.voteInit.nodePubkey,voteInit:t.voteInit}))}static authorize(t){const{votePubkey:e,authorizedPubkey:n,newAuthorizedPubkey:r,voteAuthorizationType:i}=t,o=mt(Zn.Authorize,{newAuthorized:T(r.toBuffer()),voteAuthorizationType:i.index}),s=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:st,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}];return(new rt).add({keys:s,programId:this.programId,data:o})}static authorizeWithSeed(t){const{currentAuthorityDerivedKeyBasePubkey:e,currentAuthorityDerivedKeyOwnerPubkey:n,currentAuthorityDerivedKeySeed:r,newAuthorizedPubkey:i,voteAuthorizationType:o,votePubkey:s}=t,a=mt(Zn.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:T(n.toBuffer()),currentAuthorityDerivedKeySeed:r,newAuthorized:T(i.toBuffer()),voteAuthorizationType:o.index}}),c=[{pubkey:s,isSigner:!1,isWritable:!0},{pubkey:st,isSigner:!1,isWritable:!1},{pubkey:e,isSigner:!0,isWritable:!1}];return(new rt).add({keys:c,programId:this.programId,data:a})}static withdraw(t){const{votePubkey:e,authorizedWithdrawerPubkey:n,lamports:r,toPubkey:i}=t,o=mt(Zn.Withdraw,{lamports:r}),s=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}];return(new rt).add({keys:s,programId:this.programId,data:o})}static safeWithdraw(t,e,n){if(t.lamports>e-n)throw new Error("Withdraw will leave vote account with insuffcient funds.");return Xn.withdraw(t)}}Xn.programId=new C("Vote111111111111111111111111111111111111111"),Xn.space=3731;const Jn=new C("Va1idator1nfo111111111111111111111111111111"),Yn=(0,p.dt)({name:(0,p.Z_)(),website:(0,p.jt)((0,p.Z_)()),details:(0,p.jt)((0,p.Z_)()),keybaseUsername:(0,p.jt)((0,p.Z_)())});class Qn{constructor(t,e){this.key=void 0,this.info=void 0,this.key=t,this.info=e}static fromConfigData(t){let e=[...t];if(2!==$(e))return null;const n=[];for(let r=0;r<2;r++){const t=new C(e.slice(0,R));e=e.slice(R);const r=1===e.slice(0,1)[0];e=e.slice(1),n.push({publicKey:t,isSigner:r})}if(n[0].publicKey.equals(Jn)&&n[1].isSigner){const t=H().decode(r.Buffer.from(e)),i=JSON.parse(t);return(0,p.hu)(i,Yn),new Qn(n[1].publicKey,i)}return null}}const tr=new C("Vote111111111111111111111111111111111111111"),er=h.struct([F("nodePubkey"),F("authorizedWithdrawer"),h.u8("commission"),h.nu64(),h.seq(h.struct([h.nu64("slot"),h.u32("confirmationCount")]),h.offset(h.u32(),-8),"votes"),h.u8("rootSlotValid"),h.nu64("rootSlot"),h.nu64(),h.seq(h.struct([h.nu64("epoch"),F("authorizedVoter")]),h.offset(h.u32(),-8),"authorizedVoters"),h.struct([h.seq(h.struct([F("authorizedPubkey"),h.nu64("epochOfLastAuthorizedSwitch"),h.nu64("targetEpoch")]),32,"buf"),h.nu64("idx"),h.u8("isEmpty")],"priorVoters"),h.nu64(),h.seq(h.struct([h.nu64("epoch"),h.nu64("credits"),h.nu64("prevCredits")]),h.offset(h.u32(),-8),"epochCredits"),h.struct([h.nu64("slot"),h.nu64("timestamp")],"lastTimestamp")]);class nr{constructor(t){this.nodePubkey=void 0,this.authorizedWithdrawer=void 0,this.commission=void 0,this.rootSlot=void 0,this.votes=void 0,this.authorizedVoters=void 0,this.priorVoters=void 0,this.epochCredits=void 0,this.lastTimestamp=void 0,this.nodePubkey=t.nodePubkey,this.authorizedWithdrawer=t.authorizedWithdrawer,this.commission=t.commission,this.rootSlot=t.rootSlot,this.votes=t.votes,this.authorizedVoters=t.authorizedVoters,this.priorVoters=t.priorVoters,this.epochCredits=t.epochCredits,this.lastTimestamp=t.lastTimestamp}static fromAccountData(t){const e=er.decode(T(t),4);let n=e.rootSlot;return e.rootSlotValid||(n=null),new nr({nodePubkey:new C(e.nodePubkey),authorizedWithdrawer:new C(e.authorizedWithdrawer),commission:e.commission,votes:e.votes,rootSlot:n,authorizedVoters:e.authorizedVoters.map(rr),priorVoters:or(e.priorVoters),epochCredits:e.epochCredits,lastTimestamp:e.lastTimestamp})}}function rr({authorizedVoter:t,epoch:e}){return{epoch:e,authorizedVoter:new C(t)}}function ir({authorizedPubkey:t,epochOfLastAuthorizedSwitch:e,targetEpoch:n}){return{authorizedPubkey:new C(t),epochOfLastAuthorizedSwitch:e,targetEpoch:n}}function or({buf:t,idx:e,isEmpty:n}){return n?[]:[...t.slice(e+1).map(ir),...t.slice(0,e).map(ir)]}const sr={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};function ar(t,e){const n=!1===e?"http":"https";if(!t)return sr[n].devnet;const r=sr[n][t];if(!r)throw new Error(`Unknown ${n} cluster: ${t}`);return r}async function cr(t,e,n,r){let i,o;n&&Object.prototype.hasOwnProperty.call(n,"lastValidBlockHeight")?(i=n,o=r):o=n;const s=o&&{skipPreflight:o.skipPreflight,preflightCommitment:o.preflightCommitment||o.commitment,minContextSlot:o.minContextSlot},a=await t.sendRawTransaction(e,s),c=o&&o.commitment,u=i?t.confirmTransaction(i,c):t.confirmTransaction(a,c),l=(await u).value;if(l.err)throw new Error(`Raw transaction ${a} failed (${JSON.stringify(l)})`);return a}const ur=1e9},89644:(t,e,n)=>{t.exports=n(25644)},70353:(t,e,n)=>{"use strict";var r=n(93044),i=n(86955),o=n(92233),s=n(68030),a=n(97948),c=n(51875),u=n(60842),l=n(88618),d=n(98560),h=n(26714);t.exports=function(t){return new Promise((function(e,n){var f,p=t.data,y=t.headers,g=t.responseType;function m(){t.cancelToken&&t.cancelToken.unsubscribe(f),t.signal&&t.signal.removeEventListener("abort",f)}r.isFormData(p)&&delete y["Content-Type"];var b=new XMLHttpRequest;if(t.auth){var w=t.auth.username||"",k=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";y.Authorization="Basic "+btoa(w+":"+k)}var v=a(t.baseURL,t.url);function I(){if(b){var r="getAllResponseHeaders"in b?c(b.getAllResponseHeaders()):null,o={data:g&&"text"!==g&&"json"!==g?b.response:b.responseText,status:b.status,statusText:b.statusText,headers:r,config:t,request:b};i((function(t){e(t),m()}),(function(t){n(t),m()}),o),b=null}}if(b.open(t.method.toUpperCase(),s(v,t.params,t.paramsSerializer),!0),b.timeout=t.timeout,"onloadend"in b?b.onloadend=I:b.onreadystatechange=function(){b&&4===b.readyState&&(0!==b.status||b.responseURL&&0===b.responseURL.indexOf("file:"))&&setTimeout(I)},b.onabort=function(){b&&(n(l("Request aborted",t,"ECONNABORTED",b)),b=null)},b.onerror=function(){n(l("Network Error",t,null,b)),b=null},b.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",r=t.transitional||d;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(l(e,t,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",b)),b=null},r.isStandardBrowserEnv()){var A=(t.withCredentials||u(v))&&t.xsrfCookieName?o.read(t.xsrfCookieName):void 0;A&&(y[t.xsrfHeaderName]=A)}"setRequestHeader"in b&&r.forEach(y,(function(t,e){void 0===p&&"content-type"===e.toLowerCase()?delete y[e]:b.setRequestHeader(e,t)})),r.isUndefined(t.withCredentials)||(b.withCredentials=!!t.withCredentials),g&&"json"!==g&&(b.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&b.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&b.upload&&b.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(f=function(t){b&&(n(!t||t&&t.type?new h("canceled"):t),b.abort(),b=null)},t.cancelToken&&t.cancelToken.subscribe(f),t.signal&&(t.signal.aborted?f():t.signal.addEventListener("abort",f))),p||(p=null),b.send(p)}))}},25644:(t,e,n)=>{"use strict";var r=n(93044),i=n(73644),o=n(62215),s=n(92937);var a=function t(e){var n=new o(e),a=i(o.prototype.request,n);return r.extend(a,o.prototype,n),r.extend(a,n),a.create=function(n){return t(s(e,n))},a}(n(10663));a.Axios=o,a.Cancel=n(26714),a.CancelToken=n(34089),a.isCancel=n(98041),a.VERSION=n(29241).version,a.all=function(t){return Promise.all(t)},a.spread=n(70783),a.isAxiosError=n(65587),t.exports=a,t.exports.default=a},26714:t=>{"use strict";function e(t){this.message=t}e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},e.prototype.__CANCEL__=!0,t.exports=e},34089:(t,e,n)=>{"use strict";var r=n(26714);function i(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;this.promise.then((function(t){if(n._listeners){var e,r=n._listeners.length;for(e=0;e<r;e++)n._listeners[e](t);n._listeners=null}})),this.promise.then=function(t){var e,r=new Promise((function(t){n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t){n.reason||(n.reason=new r(t),e(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},i.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}},i.source=function(){var t;return{token:new i((function(e){t=e})),cancel:t}},t.exports=i},98041:t=>{"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},62215:(t,e,n)=>{"use strict";var r=n(93044),i=n(68030),o=n(946),s=n(6895),a=n(92937),c=n(17525),u=c.validators;function l(t){this.defaults=t,this.interceptors={request:new o,response:new o}}l.prototype.request=function(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var n=e.transitional;void 0!==n&&c.assertOptions(n,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var r=[],i=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(i=i&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var o,l=[];if(this.interceptors.response.forEach((function(t){l.push(t.fulfilled,t.rejected)})),!i){var d=[s,void 0];for(Array.prototype.unshift.apply(d,r),d=d.concat(l),o=Promise.resolve(e);d.length;)o=o.then(d.shift(),d.shift());return o}for(var h=e;r.length;){var f=r.shift(),p=r.shift();try{h=f(h)}catch(y){p(y);break}}try{o=s(h)}catch(y){return Promise.reject(y)}for(;l.length;)o=o.then(l.shift(),l.shift());return o},l.prototype.getUri=function(t){return t=a(this.defaults,t),i(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(t){l.prototype[t]=function(e,n){return this.request(a(n||{},{method:t,url:e,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(t){l.prototype[t]=function(e,n,r){return this.request(a(r||{},{method:t,url:e,data:n}))}})),t.exports=l},946:(t,e,n)=>{"use strict";var r=n(93044);function i(){this.handlers=[]}i.prototype.use=function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},i.prototype.forEach=function(t){r.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=i},97948:(t,e,n)=>{"use strict";var r=n(99192),i=n(48762);t.exports=function(t,e){return t&&!r(e)?i(t,e):e}},88618:(t,e,n)=>{"use strict";var r=n(11935);t.exports=function(t,e,n,i,o){var s=new Error(t);return r(s,e,n,i,o)}},6895:(t,e,n)=>{"use strict";var r=n(93044),i=n(38556),o=n(98041),s=n(10663),a=n(26714);function c(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new a("canceled")}t.exports=function(t){return c(t),t.headers=t.headers||{},t.data=i.call(t,t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||s.adapter)(t).then((function(e){return c(t),e.data=i.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return o(e)||(c(t),e&&e.response&&(e.response.data=i.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},11935:t=>{"use strict";t.exports=function(t,e,n,r,i){return t.config=e,n&&(t.code=n),t.request=r,t.response=i,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t}},92937:(t,e,n)=>{"use strict";var r=n(93044);t.exports=function(t,e){e=e||{};var n={};function i(t,e){return r.isPlainObject(t)&&r.isPlainObject(e)?r.merge(t,e):r.isPlainObject(e)?r.merge({},e):r.isArray(e)?e.slice():e}function o(n){return r.isUndefined(e[n])?r.isUndefined(t[n])?void 0:i(void 0,t[n]):i(t[n],e[n])}function s(t){if(!r.isUndefined(e[t]))return i(void 0,e[t])}function a(n){return r.isUndefined(e[n])?r.isUndefined(t[n])?void 0:i(void 0,t[n]):i(void 0,e[n])}function c(n){return n in e?i(t[n],e[n]):n in t?i(void 0,t[n]):void 0}var u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c};return r.forEach(Object.keys(t).concat(Object.keys(e)),(function(t){var e=u[t]||o,i=e(t);r.isUndefined(i)&&e!==c||(n[t]=i)})),n}},86955:(t,e,n)=>{"use strict";var r=n(88618);t.exports=function(t,e,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?e(r("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},38556:(t,e,n)=>{"use strict";var r=n(93044),i=n(10663);t.exports=function(t,e,n){var o=this||i;return r.forEach(n,(function(n){t=n.call(o,t,e)})),t}},10663:(t,e,n)=>{"use strict";var r=n(93044),i=n(98868),o=n(11935),s=n(98560),a={"Content-Type":"application/x-www-form-urlencoded"};function c(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var u,l={transitional:s,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(u=n(70353)),u),transformRequest:[function(t,e){return i(e,"Accept"),i(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(c(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)||e&&"application/json"===e["Content-Type"]?(c(e,"application/json"),function(t,e,n){if(r.isString(t))try{return(e||JSON.parse)(t),r.trim(t)}catch(i){if("SyntaxError"!==i.name)throw i}return(n||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||l.transitional,n=e&&e.silentJSONParsing,i=e&&e.forcedJSONParsing,s=!n&&"json"===this.responseType;if(s||i&&r.isString(t)&&t.length)try{return JSON.parse(t)}catch(a){if(s){if("SyntaxError"===a.name)throw o(a,this,"E_JSON_PARSE");throw a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(t){l.headers[t]={}})),r.forEach(["post","put","patch"],(function(t){l.headers[t]=r.merge(a)})),t.exports=l},98560:t=>{"use strict";t.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}},29241:t=>{t.exports={version:"0.26.1"}},73644:t=>{"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},68030:(t,e,n)=>{"use strict";var r=n(93044);function i(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var o;if(n)o=n(e);else if(r.isURLSearchParams(e))o=e.toString();else{var s=[];r.forEach(e,(function(t,e){null!=t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,(function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),s.push(i(e)+"="+i(t))})))})),o=s.join("&")}if(o){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+o}return t}},48762:t=>{"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},92233:(t,e,n)=>{"use strict";var r=n(93044);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,i,o,s){var a=[];a.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(i)&&a.push("path="+i),r.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},99192:t=>{"use strict";t.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}},65587:(t,e,n)=>{"use strict";var r=n(93044);t.exports=function(t){return r.isObject(t)&&!0===t.isAxiosError}},60842:(t,e,n)=>{"use strict";var r=n(93044);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=i(window.location.href),function(e){var n=r.isString(e)?i(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},98868:(t,e,n)=>{"use strict";var r=n(93044);t.exports=function(t,e){r.forEach(t,(function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])}))}},51875:(t,e,n)=>{"use strict";var r=n(93044),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,o,s={};return t?(r.forEach(t.split("\n"),(function(t){if(o=t.indexOf(":"),e=r.trim(t.substr(0,o)).toLowerCase(),n=r.trim(t.substr(o+1)),e){if(s[e]&&i.indexOf(e)>=0)return;s[e]="set-cookie"===e?(s[e]?s[e]:[]).concat([n]):s[e]?s[e]+", "+n:n}})),s):s}},70783:t=>{"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},17525:(t,e,n)=>{"use strict";var r=n(29241).version,i={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){i[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));var o={};i.transitional=function(t,e,n){function i(t,e){return"[Axios v"+r+"] Transitional option '"+t+"'"+e+(n?". "+n:"")}return function(n,r,s){if(!1===t)throw new Error(i(r," has been removed"+(e?" in "+e:"")));return e&&!o[r]&&(o[r]=!0,console.warn(i(r," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,r,s)}},t.exports={assertOptions:function(t,e,n){if("object"!=typeof t)throw new TypeError("options must be an object");for(var r=Object.keys(t),i=r.length;i-- >0;){var o=r[i],s=e[o];if(s){var a=t[o],c=void 0===a||s(a,o,t);if(!0!==c)throw new TypeError("option "+o+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+o)}},validators:i}},93044:(t,e,n)=>{"use strict";var r=n(73644),i=Object.prototype.toString;function o(t){return Array.isArray(t)}function s(t){return void 0===t}function a(t){return"[object ArrayBuffer]"===i.call(t)}function c(t){return null!==t&&"object"==typeof t}function u(t){if("[object Object]"!==i.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function l(t){return"[object Function]"===i.call(t)}function d(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),o(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.call(null,t[i],i,t)}t.exports={isArray:o,isArrayBuffer:a,isBuffer:function(t){return null!==t&&!s(t)&&null!==t.constructor&&!s(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"[object FormData]"===i.call(t)},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&a(t.buffer)},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:c,isPlainObject:u,isUndefined:s,isDate:function(t){return"[object Date]"===i.call(t)},isFile:function(t){return"[object File]"===i.call(t)},isBlob:function(t){return"[object Blob]"===i.call(t)},isFunction:l,isStream:function(t){return c(t)&&l(t.pipe)},isURLSearchParams:function(t){return"[object URLSearchParams]"===i.call(t)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:d,merge:function t(){var e={};function n(n,r){u(e[r])&&u(n)?e[r]=t(e[r],n):u(n)?e[r]=t({},n):o(n)?e[r]=n.slice():e[r]=n}for(var r=0,i=arguments.length;r<i;r++)d(arguments[r],n);return e},extend:function(t,e,n){return d(e,(function(e,i){t[i]=n&&"function"==typeof e?r(e,n):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}}},18166:(t,e,n)=>{"use strict";var r=n(77834).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),n=0;n<e.length;n++)e[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),s=o.charCodeAt(0);if(255!==e[s])throw new TypeError(o+" is ambiguous");e[s]=i}var a=t.length,c=t.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function d(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return r.alloc(0);for(var n=0,i=0,o=0;t[n]===c;)i++,n++;for(var s=(t.length-n)*u+1>>>0,l=new Uint8Array(s);t[n];){var d=e[t.charCodeAt(n)];if(255===d)return;for(var h=0,f=s-1;(0!==d||h<o)&&-1!==f;f--,h++)d+=a*l[f]>>>0,l[f]=d%256>>>0,d=d/256>>>0;if(0!==d)throw new Error("Non-zero carry");o=h,n++}for(var p=s-o;p!==s&&0===l[p];)p++;var y=r.allocUnsafe(i+(s-p));y.fill(0,0,i);for(var g=i;p!==s;)y[g++]=l[p++];return y}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=r.from(e)),!r.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var n=0,i=0,o=0,s=e.length;o!==s&&0===e[o];)o++,n++;for(var u=(s-o)*l+1>>>0,d=new Uint8Array(u);o!==s;){for(var h=e[o],f=0,p=u-1;(0!==h||f<i)&&-1!==p;p--,f++)h+=256*d[p]>>>0,d[p]=h%a>>>0,h=h/a>>>0;if(0!==h)throw new Error("Non-zero carry");i=f,o++}for(var y=u-i;y!==u&&0===d[y];)y++;for(var g=c.repeat(n);y<u;++y)g+=t.charAt(d[y]);return g},decodeUnsafe:d,decode:function(t){var e=d(t);if(e)return e;throw new Error("Non-base"+a+" character")}}}},95766:(t,e)=>{"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,o=c(t),s=o[0],a=o[1],u=new i(function(t,e,n){return 3*(e+n)/4-n}(0,s,a)),l=0,d=a>0?s-4:s;for(n=0;n<d;n+=4)e=r[t.charCodeAt(n)]<<18|r[t.charCodeAt(n+1)]<<12|r[t.charCodeAt(n+2)]<<6|r[t.charCodeAt(n+3)],u[l++]=e>>16&255,u[l++]=e>>8&255,u[l++]=255&e;2===a&&(e=r[t.charCodeAt(n)]<<2|r[t.charCodeAt(n+1)]>>4,u[l++]=255&e);1===a&&(e=r[t.charCodeAt(n)]<<10|r[t.charCodeAt(n+1)]<<4|r[t.charCodeAt(n+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e);return u},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=16383,a=0,c=r-i;a<c;a+=s)o.push(u(t,a,a+s>c?c:a+s));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)n[s]=o[s],r[o.charCodeAt(s)]=s;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function u(t,e,r){for(var i,o,s=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},41528:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toBigIntLE=function(t){{const e=Buffer.from(t);e.reverse();const n=e.toString("hex");return 0===n.length?BigInt(0):BigInt(`0x${n}`)}},e.toBigIntBE=function(t){{const e=t.toString("hex");return 0===e.length?BigInt(0):BigInt(`0x${e}`)}},e.toBufferLE=function(t,e){{const n=t.toString(16),r=Buffer.from(n.padStart(2*e,"0").slice(0,2*e),"hex");return r.reverse(),r}},e.toBufferBE=function(t,e){{const n=t.toString(16);return Buffer.from(n.padStart(2*e,"0").slice(0,2*e),"hex")}}},6391:function(t,e,n){var r;!function(i){"use strict";var o,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,c=Math.floor,u="[BigNumber Error] ",l=u+"Number primitive has more than 15 significant digits: ",d=1e14,h=14,f=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],y=1e7,g=1e9;function m(t){var e=0|t;return t>0||t===e?e:e-1}function b(t){for(var e,n,r=1,i=t.length,o=t[0]+"";r<i;){for(e=t[r++]+"",n=h-e.length;n--;e="0"+e);o+=e}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function w(t,e){var n,r,i=t.c,o=e.c,s=t.s,a=e.s,c=t.e,u=e.e;if(!s||!a)return null;if(n=i&&!i[0],r=o&&!o[0],n||r)return n?r?0:-a:s;if(s!=a)return s;if(n=s<0,r=c==u,!i||!o)return r?0:!i^n?1:-1;if(!r)return c>u^n?1:-1;for(a=(c=i.length)<(u=o.length)?c:u,s=0;s<a;s++)if(i[s]!=o[s])return i[s]>o[s]^n?1:-1;return c==u?0:c>u^n?1:-1}function k(t,e,n,r){if(t<e||t>n||t!==c(t))throw Error(u+(r||"Argument")+("number"==typeof t?t<e||t>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function v(t){var e=t.c.length-1;return m(t.e/h)==e&&t.c[e]%2!=0}function I(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function A(t,e,n){var r,i;if(e<0){for(i=n+".";++e;i+=n);t=i+t}else if(++e>(r=t.length)){for(i=n,e-=r;--e;i+=n);t+=i}else e<r&&(t=t.slice(0,e)+"."+t.slice(e));return t}o=function t(e){var n,r,i,o,_,S,E,T,x,P,B=G.prototype={constructor:G,toString:null,valueOf:null},O=new G(1),R=20,M=4,C=-7,U=21,N=-1e7,L=1e7,z=!1,K=1,D=0,j={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xa0",suffix:""},W="0123456789abcdefghijklmnopqrstuvwxyz",F=!0;function G(t,e){var n,o,a,u,d,p,y,g,m=this;if(!(m instanceof G))return new G(t,e);if(null==e){if(t&&!0===t._isBigNumber)return m.s=t.s,void(!t.c||t.e>L?m.c=m.e=null:t.e<N?m.c=[m.e=0]:(m.e=t.e,m.c=t.c.slice()));if((p="number"==typeof t)&&0*t==0){if(m.s=1/t<0?(t=-t,-1):1,t===~~t){for(u=0,d=t;d>=10;d/=10,u++);return void(u>L?m.c=m.e=null:(m.e=u,m.c=[t]))}g=String(t)}else{if(!s.test(g=String(t)))return i(m,g,p);m.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(u=g.indexOf("."))>-1&&(g=g.replace(".","")),(d=g.search(/e/i))>0?(u<0&&(u=d),u+=+g.slice(d+1),g=g.substring(0,d)):u<0&&(u=g.length)}else{if(k(e,2,W.length,"Base"),10==e&&F)return Z(m=new G(t),R+m.e+1,M);if(g=String(t),p="number"==typeof t){if(0*t!=0)return i(m,g,p,e);if(m.s=1/t<0?(g=g.slice(1),-1):1,G.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(l+t)}else m.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(n=W.slice(0,e),u=d=0,y=g.length;d<y;d++)if(n.indexOf(o=g.charAt(d))<0){if("."==o){if(d>u){u=y;continue}}else if(!a&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){a=!0,d=-1,u=0;continue}return i(m,String(t),p,e)}p=!1,(u=(g=r(g,e,10,m.s)).indexOf("."))>-1?g=g.replace(".",""):u=g.length}for(d=0;48===g.charCodeAt(d);d++);for(y=g.length;48===g.charCodeAt(--y););if(g=g.slice(d,++y)){if(y-=d,p&&G.DEBUG&&y>15&&(t>f||t!==c(t)))throw Error(l+m.s*t);if((u=u-d-1)>L)m.c=m.e=null;else if(u<N)m.c=[m.e=0];else{if(m.e=u,m.c=[],d=(u+1)%h,u<0&&(d+=h),d<y){for(d&&m.c.push(+g.slice(0,d)),y-=h;d<y;)m.c.push(+g.slice(d,d+=h));d=h-(g=g.slice(d)).length}else d-=y;for(;d--;g+="0");m.c.push(+g)}}else m.c=[m.e=0]}function H(t,e,n,r){var i,o,s,a,c;if(null==n?n=M:k(n,0,8),!t.c)return t.toString();if(i=t.c[0],s=t.e,null==e)c=b(t.c),c=1==r||2==r&&(s<=C||s>=U)?I(c,s):A(c,s,"0");else if(o=(t=Z(new G(t),e,n)).e,a=(c=b(t.c)).length,1==r||2==r&&(e<=o||o<=C)){for(;a<e;c+="0",a++);c=I(c,o)}else if(e-=s,c=A(c,o,"0"),o+1>a){if(--e>0)for(c+=".";e--;c+="0");}else if((e+=o-a)>0)for(o+1==a&&(c+=".");e--;c+="0");return t.s<0&&i?"-"+c:c}function q(t,e){for(var n,r=1,i=new G(t[0]);r<t.length;r++){if(!(n=new G(t[r])).s){i=n;break}e.call(i,n)&&(i=n)}return i}function $(t,e,n){for(var r=1,i=e.length;!e[--i];e.pop());for(i=e[0];i>=10;i/=10,r++);return(n=r+n*h-1)>L?t.c=t.e=null:n<N?t.c=[t.e=0]:(t.e=n,t.c=e),t}function Z(t,e,n,r){var i,o,s,u,l,f,y,g=t.c,m=p;if(g){t:{for(i=1,u=g[0];u>=10;u/=10,i++);if((o=e-i)<0)o+=h,s=e,y=(l=g[f=0])/m[i-s-1]%10|0;else if((f=a((o+1)/h))>=g.length){if(!r)break t;for(;g.length<=f;g.push(0));l=y=0,i=1,s=(o%=h)-h+1}else{for(l=u=g[f],i=1;u>=10;u/=10,i++);y=(s=(o%=h)-h+i)<0?0:l/m[i-s-1]%10|0}if(r=r||e<0||null!=g[f+1]||(s<0?l:l%m[i-s-1]),r=n<4?(y||r)&&(0==n||n==(t.s<0?3:2)):y>5||5==y&&(4==n||r||6==n&&(o>0?s>0?l/m[i-s]:0:g[f-1])%10&1||n==(t.s<0?8:7)),e<1||!g[0])return g.length=0,r?(e-=t.e+1,g[0]=m[(h-e%h)%h],t.e=-e||0):g[0]=t.e=0,t;if(0==o?(g.length=f,u=1,f--):(g.length=f+1,u=m[h-o],g[f]=s>0?c(l/m[i-s]%m[s])*u:0),r)for(;;){if(0==f){for(o=1,s=g[0];s>=10;s/=10,o++);for(s=g[0]+=u,u=1;s>=10;s/=10,u++);o!=u&&(t.e++,g[0]==d&&(g[0]=1));break}if(g[f]+=u,g[f]!=d)break;g[f--]=0,u=1}for(o=g.length;0===g[--o];g.pop());}t.e>L?t.c=t.e=null:t.e<N&&(t.c=[t.e=0])}return t}function V(t){var e,n=t.e;return null===n?t.toString():(e=b(t.c),e=n<=C||n>=U?I(e,n):A(e,n,"0"),t.s<0?"-"+e:e)}return G.clone=t,G.ROUND_UP=0,G.ROUND_DOWN=1,G.ROUND_CEIL=2,G.ROUND_FLOOR=3,G.ROUND_HALF_UP=4,G.ROUND_HALF_DOWN=5,G.ROUND_HALF_EVEN=6,G.ROUND_HALF_CEIL=7,G.ROUND_HALF_FLOOR=8,G.EUCLID=9,G.config=G.set=function(t){var e,n;if(null!=t){if("object"!=typeof t)throw Error(u+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(k(n=t[e],0,g,e),R=n),t.hasOwnProperty(e="ROUNDING_MODE")&&(k(n=t[e],0,8,e),M=n),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((n=t[e])&&n.pop?(k(n[0],-g,0,e),k(n[1],0,g,e),C=n[0],U=n[1]):(k(n,-g,g,e),C=-(U=n<0?-n:n))),t.hasOwnProperty(e="RANGE"))if((n=t[e])&&n.pop)k(n[0],-g,-1,e),k(n[1],1,g,e),N=n[0],L=n[1];else{if(k(n,-g,g,e),!n)throw Error(u+e+" cannot be zero: "+n);N=-(L=n<0?-n:n)}if(t.hasOwnProperty(e="CRYPTO")){if((n=t[e])!==!!n)throw Error(u+e+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw z=!n,Error(u+"crypto unavailable");z=n}else z=n}if(t.hasOwnProperty(e="MODULO_MODE")&&(k(n=t[e],0,9,e),K=n),t.hasOwnProperty(e="POW_PRECISION")&&(k(n=t[e],0,g,e),D=n),t.hasOwnProperty(e="FORMAT")){if("object"!=typeof(n=t[e]))throw Error(u+e+" not an object: "+n);j=n}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(n=t[e])||/^.?$|[+\-.\s]|(.).*\1/.test(n))throw Error(u+e+" invalid: "+n);F="0123456789"==n.slice(0,10),W=n}}return{DECIMAL_PLACES:R,ROUNDING_MODE:M,EXPONENTIAL_AT:[C,U],RANGE:[N,L],CRYPTO:z,MODULO_MODE:K,POW_PRECISION:D,FORMAT:j,ALPHABET:W}},G.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!G.DEBUG)return!0;var e,n,r=t.c,i=t.e,o=t.s;t:if("[object Array]"=={}.toString.call(r)){if((1===o||-1===o)&&i>=-g&&i<=g&&i===c(i)){if(0===r[0]){if(0===i&&1===r.length)return!0;break t}if((e=(i+1)%h)<1&&(e+=h),String(r[0]).length==e){for(e=0;e<r.length;e++)if((n=r[e])<0||n>=d||n!==c(n))break t;if(0!==n)return!0}}}else if(null===r&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(u+"Invalid BigNumber: "+t)},G.maximum=G.max=function(){return q(arguments,B.lt)},G.minimum=G.min=function(){return q(arguments,B.gt)},G.random=(o=9007199254740992,_=Math.random()*o&2097151?function(){return c(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,n,r,i,o,s=0,l=[],d=new G(O);if(null==t?t=R:k(t,0,g),i=a(t/h),z)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(i*=2));s<i;)(o=131072*e[s]+(e[s+1]>>>11))>=9e15?(n=crypto.getRandomValues(new Uint32Array(2)),e[s]=n[0],e[s+1]=n[1]):(l.push(o%1e14),s+=2);s=i/2}else{if(!crypto.randomBytes)throw z=!1,Error(u+"crypto unavailable");for(e=crypto.randomBytes(i*=7);s<i;)(o=281474976710656*(31&e[s])+1099511627776*e[s+1]+4294967296*e[s+2]+16777216*e[s+3]+(e[s+4]<<16)+(e[s+5]<<8)+e[s+6])>=9e15?crypto.randomBytes(7).copy(e,s):(l.push(o%1e14),s+=7);s=i/7}if(!z)for(;s<i;)(o=_())<9e15&&(l[s++]=o%1e14);for(i=l[--s],t%=h,i&&t&&(o=p[h-t],l[s]=c(i/o)*o);0===l[s];l.pop(),s--);if(s<0)l=[r=0];else{for(r=-1;0===l[0];l.splice(0,1),r-=h);for(s=1,o=l[0];o>=10;o/=10,s++);s<h&&(r-=h-s)}return d.e=r,d.c=l,d}),G.sum=function(){for(var t=1,e=arguments,n=new G(e[0]);t<e.length;)n=n.plus(e[t++]);return n},r=function(){var t="0123456789";function e(t,e,n,r){for(var i,o,s=[0],a=0,c=t.length;a<c;){for(o=s.length;o--;s[o]*=e);for(s[0]+=r.indexOf(t.charAt(a++)),i=0;i<s.length;i++)s[i]>n-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/n|0,s[i]%=n)}return s.reverse()}return function(r,i,o,s,a){var c,u,l,d,h,f,p,y,g=r.indexOf("."),m=R,w=M;for(g>=0&&(d=D,D=0,r=r.replace(".",""),f=(y=new G(i)).pow(r.length-g),D=d,y.c=e(A(b(f.c),f.e,"0"),10,o,t),y.e=y.c.length),l=d=(p=e(r,i,o,a?(c=W,t):(c=t,W))).length;0==p[--d];p.pop());if(!p[0])return c.charAt(0);if(g<0?--l:(f.c=p,f.e=l,f.s=s,p=(f=n(f,y,m,w,o)).c,h=f.r,l=f.e),g=p[u=l+m+1],d=o/2,h=h||u<0||null!=p[u+1],h=w<4?(null!=g||h)&&(0==w||w==(f.s<0?3:2)):g>d||g==d&&(4==w||h||6==w&&1&p[u-1]||w==(f.s<0?8:7)),u<1||!p[0])r=h?A(c.charAt(1),-m,c.charAt(0)):c.charAt(0);else{if(p.length=u,h)for(--o;++p[--u]>o;)p[u]=0,u||(++l,p=[1].concat(p));for(d=p.length;!p[--d];);for(g=0,r="";g<=d;r+=c.charAt(p[g++]));r=A(r,l,c.charAt(0))}return r}}(),n=function(){function t(t,e,n){var r,i,o,s,a=0,c=t.length,u=e%y,l=e/y|0;for(t=t.slice();c--;)a=((i=u*(o=t[c]%y)+(r=l*o+(s=t[c]/y|0)*u)%y*y+a)/n|0)+(r/y|0)+l*s,t[c]=i%n;return a&&(t=[a].concat(t)),t}function e(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function n(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]<e[n]?1:0,t[n]=i*r+t[n]-e[n];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(r,i,o,s,a){var u,l,f,p,y,g,b,w,k,v,I,A,_,S,E,T,x,P=r.s==i.s?1:-1,B=r.c,O=i.c;if(!(B&&B[0]&&O&&O[0]))return new G(r.s&&i.s&&(B?!O||B[0]!=O[0]:O)?B&&0==B[0]||!O?0*P:P/0:NaN);for(k=(w=new G(P)).c=[],P=o+(l=r.e-i.e)+1,a||(a=d,l=m(r.e/h)-m(i.e/h),P=P/h|0),f=0;O[f]==(B[f]||0);f++);if(O[f]>(B[f]||0)&&l--,P<0)k.push(1),p=!0;else{for(S=B.length,T=O.length,f=0,P+=2,(y=c(a/(O[0]+1)))>1&&(O=t(O,y,a),B=t(B,y,a),T=O.length,S=B.length),_=T,I=(v=B.slice(0,T)).length;I<T;v[I++]=0);x=O.slice(),x=[0].concat(x),E=O[0],O[1]>=a/2&&E++;do{if(y=0,(u=e(O,v,T,I))<0){if(A=v[0],T!=I&&(A=A*a+(v[1]||0)),(y=c(A/E))>1)for(y>=a&&(y=a-1),b=(g=t(O,y,a)).length,I=v.length;1==e(g,v,b,I);)y--,n(g,T<b?x:O,b,a),b=g.length,u=1;else 0==y&&(u=y=1),b=(g=O.slice()).length;if(b<I&&(g=[0].concat(g)),n(v,g,I,a),I=v.length,-1==u)for(;e(O,v,T,I)<1;)y++,n(v,T<I?x:O,I,a),I=v.length}else 0===u&&(y++,v=[0]);k[f++]=y,v[0]?v[I++]=B[_]||0:(v=[B[_]],I=1)}while((_++<S||null!=v[0])&&P--);p=null!=v[0],k[0]||k.splice(0,1)}if(a==d){for(f=1,P=k[0];P>=10;P/=10,f++);Z(w,o+(w.e=f+l*h-1)+1,s,p)}else w.e=l,w.r=+p;return w}}(),S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,T=/^\.([^.]+)$/,x=/^-?(Infinity|NaN)$/,P=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(t,e,n,r){var i,o=n?e:e.replace(P,"");if(x.test(o))t.s=isNaN(o)?null:o<0?-1:1;else{if(!n&&(o=o.replace(S,(function(t,e,n){return i="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=i?t:e})),r&&(i=r,o=o.replace(E,"$1").replace(T,"0.$1")),e!=o))return new G(o,i);if(G.DEBUG)throw Error(u+"Not a"+(r?" base "+r:"")+" number: "+e);t.s=null}t.c=t.e=null},B.absoluteValue=B.abs=function(){var t=new G(this);return t.s<0&&(t.s=1),t},B.comparedTo=function(t,e){return w(this,new G(t,e))},B.decimalPlaces=B.dp=function(t,e){var n,r,i,o=this;if(null!=t)return k(t,0,g),null==e?e=M:k(e,0,8),Z(new G(o),t+o.e+1,e);if(!(n=o.c))return null;if(r=((i=n.length-1)-m(this.e/h))*h,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},B.dividedBy=B.div=function(t,e){return n(this,new G(t,e),R,M)},B.dividedToIntegerBy=B.idiv=function(t,e){return n(this,new G(t,e),0,1)},B.exponentiatedBy=B.pow=function(t,e){var n,r,i,o,s,l,d,f,p=this;if((t=new G(t)).c&&!t.isInteger())throw Error(u+"Exponent not an integer: "+V(t));if(null!=e&&(e=new G(e)),s=t.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!t.c||!t.c[0])return f=new G(Math.pow(+V(p),s?2-v(t):+V(t))),e?f.mod(e):f;if(l=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new G(NaN);(r=!l&&p.isInteger()&&e.isInteger())&&(p=p.mod(e))}else{if(t.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||s&&p.c[1]>=24e7:p.c[0]<8e13||s&&p.c[0]<=9999975e7)))return o=p.s<0&&v(t)?-0:0,p.e>-1&&(o=1/o),new G(l?1/o:o);D&&(o=a(D/h+2))}for(s?(n=new G(.5),l&&(t.s=1),d=v(t)):d=(i=Math.abs(+V(t)))%2,f=new G(O);;){if(d){if(!(f=f.times(p)).c)break;o?f.c.length>o&&(f.c.length=o):r&&(f=f.mod(e))}if(i){if(0===(i=c(i/2)))break;d=i%2}else if(Z(t=t.times(n),t.e+1,1),t.e>14)d=v(t);else{if(0===(i=+V(t)))break;d=i%2}p=p.times(p),o?p.c&&p.c.length>o&&(p.c.length=o):r&&(p=p.mod(e))}return r?f:(l&&(f=O.div(f)),e?f.mod(e):o?Z(f,D,M,undefined):f)},B.integerValue=function(t){var e=new G(this);return null==t?t=M:k(t,0,8),Z(e,e.e+1,t)},B.isEqualTo=B.eq=function(t,e){return 0===w(this,new G(t,e))},B.isFinite=function(){return!!this.c},B.isGreaterThan=B.gt=function(t,e){return w(this,new G(t,e))>0},B.isGreaterThanOrEqualTo=B.gte=function(t,e){return 1===(e=w(this,new G(t,e)))||0===e},B.isInteger=function(){return!!this.c&&m(this.e/h)>this.c.length-2},B.isLessThan=B.lt=function(t,e){return w(this,new G(t,e))<0},B.isLessThanOrEqualTo=B.lte=function(t,e){return-1===(e=w(this,new G(t,e)))||0===e},B.isNaN=function(){return!this.s},B.isNegative=function(){return this.s<0},B.isPositive=function(){return this.s>0},B.isZero=function(){return!!this.c&&0==this.c[0]},B.minus=function(t,e){var n,r,i,o,s=this,a=s.s;if(e=(t=new G(t,e)).s,!a||!e)return new G(NaN);if(a!=e)return t.s=-e,s.plus(t);var c=s.e/h,u=t.e/h,l=s.c,f=t.c;if(!c||!u){if(!l||!f)return l?(t.s=-e,t):new G(f?s:NaN);if(!l[0]||!f[0])return f[0]?(t.s=-e,t):new G(l[0]?s:3==M?-0:0)}if(c=m(c),u=m(u),l=l.slice(),a=c-u){for((o=a<0)?(a=-a,i=l):(u=c,i=f),i.reverse(),e=a;e--;i.push(0));i.reverse()}else for(r=(o=(a=l.length)<(e=f.length))?a:e,a=e=0;e<r;e++)if(l[e]!=f[e]){o=l[e]<f[e];break}if(o&&(i=l,l=f,f=i,t.s=-t.s),(e=(r=f.length)-(n=l.length))>0)for(;e--;l[n++]=0);for(e=d-1;r>a;){if(l[--r]<f[r]){for(n=r;n&&!l[--n];l[n]=e);--l[n],l[r]+=d}l[r]-=f[r]}for(;0==l[0];l.splice(0,1),--u);return l[0]?$(t,l,u):(t.s=3==M?-1:1,t.c=[t.e=0],t)},B.modulo=B.mod=function(t,e){var r,i,o=this;return t=new G(t,e),!o.c||!t.s||t.c&&!t.c[0]?new G(NaN):!t.c||o.c&&!o.c[0]?new G(o):(9==K?(i=t.s,t.s=1,r=n(o,t,0,3),t.s=i,r.s*=i):r=n(o,t,0,K),(t=o.minus(r.times(t))).c[0]||1!=K||(t.s=o.s),t)},B.multipliedBy=B.times=function(t,e){var n,r,i,o,s,a,c,u,l,f,p,g,b,w,k,v=this,I=v.c,A=(t=new G(t,e)).c;if(!(I&&A&&I[0]&&A[0]))return!v.s||!t.s||I&&!I[0]&&!A||A&&!A[0]&&!I?t.c=t.e=t.s=null:(t.s*=v.s,I&&A?(t.c=[0],t.e=0):t.c=t.e=null),t;for(r=m(v.e/h)+m(t.e/h),t.s*=v.s,(c=I.length)<(f=A.length)&&(b=I,I=A,A=b,i=c,c=f,f=i),i=c+f,b=[];i--;b.push(0));for(w=d,k=y,i=f;--i>=0;){for(n=0,p=A[i]%k,g=A[i]/k|0,o=i+(s=c);o>i;)n=((u=p*(u=I[--s]%k)+(a=g*u+(l=I[s]/k|0)*p)%k*k+b[o]+n)/w|0)+(a/k|0)+g*l,b[o--]=u%w;b[o]=n}return n?++r:b.splice(0,1),$(t,b,r)},B.negated=function(){var t=new G(this);return t.s=-t.s||null,t},B.plus=function(t,e){var n,r=this,i=r.s;if(e=(t=new G(t,e)).s,!i||!e)return new G(NaN);if(i!=e)return t.s=-e,r.minus(t);var o=r.e/h,s=t.e/h,a=r.c,c=t.c;if(!o||!s){if(!a||!c)return new G(i/0);if(!a[0]||!c[0])return c[0]?t:new G(a[0]?r:0*i)}if(o=m(o),s=m(s),a=a.slice(),i=o-s){for(i>0?(s=o,n=c):(i=-i,n=a),n.reverse();i--;n.push(0));n.reverse()}for((i=a.length)-(e=c.length)<0&&(n=c,c=a,a=n,e=i),i=0;e;)i=(a[--e]=a[e]+c[e]+i)/d|0,a[e]=d===a[e]?0:a[e]%d;return i&&(a=[i].concat(a),++s),$(t,a,s)},B.precision=B.sd=function(t,e){var n,r,i,o=this;if(null!=t&&t!==!!t)return k(t,1,g),null==e?e=M:k(e,0,8),Z(new G(o),t,e);if(!(n=o.c))return null;if(r=(i=n.length-1)*h+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return t&&o.e+1>r&&(r=o.e+1),r},B.shiftedBy=function(t){return k(t,-9007199254740991,f),this.times("1e"+t)},B.squareRoot=B.sqrt=function(){var t,e,r,i,o,s=this,a=s.c,c=s.s,u=s.e,l=R+4,d=new G("0.5");if(1!==c||!a||!a[0])return new G(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(c=Math.sqrt(+V(s)))||c==1/0?(((e=b(a)).length+u)%2==0&&(e+="0"),c=Math.sqrt(+e),u=m((u+1)/2)-(u<0||u%2),r=new G(e=c==1/0?"5e"+u:(e=c.toExponential()).slice(0,e.indexOf("e")+1)+u)):r=new G(c+""),r.c[0])for((c=(u=r.e)+l)<3&&(c=0);;)if(o=r,r=d.times(o.plus(n(s,o,l,1))),b(o.c).slice(0,c)===(e=b(r.c)).slice(0,c)){if(r.e<u&&--c,"9999"!=(e=e.slice(c-3,c+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(Z(r,r.e+R+2,1),t=!r.times(r).eq(s));break}if(!i&&(Z(o,o.e+R+2,0),o.times(o).eq(s))){r=o;break}l+=4,c+=4,i=1}return Z(r,r.e+R+1,M,t)},B.toExponential=function(t,e){return null!=t&&(k(t,0,g),t++),H(this,t,e,1)},B.toFixed=function(t,e){return null!=t&&(k(t,0,g),t=t+this.e+1),H(this,t,e)},B.toFormat=function(t,e,n){var r,i=this;if(null==n)null!=t&&e&&"object"==typeof e?(n=e,e=null):t&&"object"==typeof t?(n=t,t=e=null):n=j;else if("object"!=typeof n)throw Error(u+"Argument not an object: "+n);if(r=i.toFixed(t,e),i.c){var o,s=r.split("."),a=+n.groupSize,c=+n.secondaryGroupSize,l=n.groupSeparator||"",d=s[0],h=s[1],f=i.s<0,p=f?d.slice(1):d,y=p.length;if(c&&(o=a,a=c,c=o,y-=o),a>0&&y>0){for(o=y%a||a,d=p.substr(0,o);o<y;o+=a)d+=l+p.substr(o,a);c>0&&(d+=l+p.slice(o)),f&&(d="-"+d)}r=h?d+(n.decimalSeparator||"")+((c=+n.fractionGroupSize)?h.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):h):d}return(n.prefix||"")+r+(n.suffix||"")},B.toFraction=function(t){var e,r,i,o,s,a,c,l,d,f,y,g,m=this,w=m.c;if(null!=t&&(!(c=new G(t)).isInteger()&&(c.c||1!==c.s)||c.lt(O)))throw Error(u+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+V(c));if(!w)return new G(m);for(e=new G(O),d=r=new G(O),i=l=new G(O),g=b(w),s=e.e=g.length-m.e-1,e.c[0]=p[(a=s%h)<0?h+a:a],t=!t||c.comparedTo(e)>0?s>0?e:d:c,a=L,L=1/0,c=new G(g),l.c[0]=0;f=n(c,e,0,1),1!=(o=r.plus(f.times(i))).comparedTo(t);)r=i,i=o,d=l.plus(f.times(o=d)),l=o,e=c.minus(f.times(o=e)),c=o;return o=n(t.minus(r),i,0,1),l=l.plus(o.times(d)),r=r.plus(o.times(i)),l.s=d.s=m.s,y=n(d,i,s*=2,M).minus(m).abs().comparedTo(n(l,r,s,M).minus(m).abs())<1?[d,i]:[l,r],L=a,y},B.toNumber=function(){return+V(this)},B.toPrecision=function(t,e){return null!=t&&k(t,1,g),H(this,t,e,2)},B.toString=function(t){var e,n=this,i=n.s,o=n.e;return null===o?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(null==t?e=o<=C||o>=U?I(b(n.c),o):A(b(n.c),o,"0"):10===t&&F?e=A(b((n=Z(new G(n),R+o+1,M)).c),n.e,"0"):(k(t,2,W.length,"Base"),e=r(A(b(n.c),o,"0"),10,t,i,!0)),i<0&&n.c[0]&&(e="-"+e)),e},B.valueOf=B.toJSON=function(){return V(this)},B._isBigNumber=!0,null!=e&&G.set(e),G}(),o.default=o.BigNumber=o,void 0===(r=(function(){return o}).call(e,n,e,t))||(t.exports=r)}()},62197:function(t,e,n){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function o(t,e,n){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:n(33196).Buffer}catch(x){}function a(t,e){var n=t.charCodeAt(e);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+t)}function c(t,e,n){var r=a(t,n);return n-1>=e&&(r|=a(t,n-1)<<4),r}function u(t,e,n,i){for(var o=0,s=0,a=Math.min(t.length,n),c=e;c<a;c++){var u=t.charCodeAt(c)-48;o*=i,s=u>=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&s<i,"Invalid character"),o+=s}return o}function l(t,e){t.words=e.words,t.length=e.length,t.negative=e.negative,t.red=e.red}if(o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,n):(this._parseBase(t,e,i),"le"===n&&this._initArray(this.toArray(),e,n)))},o.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},o.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===n)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e,n){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,o=0,s=0;if("be"===n)for(r=t.length-1;r>=e;r-=2)i=c(t,e,r)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(r=(t.length-e)%2==0?e+1:e;r<t.length;r+=2)i=c(t,e,r)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,s=o%r,a=Math.min(o,o-s)+n,c=0,l=n;l<a;l+=r)c=u(t,l,l+r,e),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var d=1;for(c=u(t,l,t.length,e),l=0;l<s;l++)d*=e;this.imuln(d),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype._move=function(t){l(t,this)},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(x){o.prototype.inspect=d}else o.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<i|o)).toString(16);o=a>>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),n=0!==o||s!==this.length-1?h[6-c.length]+c+n:c+n}for(0!==o&&(n=o.toString(16)+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var u=f[t],l=p[t];n="";var d=this.clone();for(d.negative=0;!d.isZero();){var y=d.modrn(l).toString(t);n=(d=d.idivn(l)).isZero()?y+n:h[u-y.length]+y+n}for(this.isZero()&&(n="0"+n);n.length%e!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function y(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,c=s/67108864|0;n.words[0]=a;for(var u=1;u<r;u++){for(var l=c>>>26,d=67108863&c,h=Math.min(u,e.length-1),f=Math.max(0,u-t.length+1);f<=h;f++){var p=u-f|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[f])+d)/67108864|0,d=67108863&s}n.words[u]=0|d,c=0|l}return 0!==c?n.words[u]=0|c:n.length--,n._strip()}o.prototype.toArrayLike=function(t,e,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var n=0,r=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|r;t[n++]=255&s,n<t.length&&(t[n++]=s>>8&255),n<t.length&&(t[n++]=s>>16&255),6===o?(n<t.length&&(t[n++]=s>>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n<t.length)for(t[n++]=r;n<t.length;)t[n++]=0},o.prototype._toArrayLikeBE=function(t,e){for(var n=t.length-1,r=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|r;t[n--]=255&s,n>=0&&(t[n--]=s>>8&255),n>=0&&(t[n--]=s>>16&255),6===o?(n>=0&&(t[n--]=s>>24&255),r=0,o=0):(r=s>>>24,o+=2)}if(n>=0)for(t[n--]=r;n>=0;)t[n--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,n=0;return e>=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0==(8191&e)&&(n+=13,e>>>=13),0==(127&e)&&(n+=7,e>>>=7),0==(15&e)&&(n+=4,e>>>=4),0==(3&e)&&(n+=2,e>>>=2),0==(1&e)&&n++,n},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var n=this._zeroBits(this.words[e]);if(t+=n,26!==n)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this._strip()},o.prototype.ior=function(t){return r(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;n<e.length;n++)this.words[n]=this.words[n]&t.words[n];return this.length=e.length,this._strip()},o.prototype.iand=function(t){return r(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;r<n.length;r++)this.words[r]=e.words[r]^n.words[r];if(this!==e)for(;r<e.length;r++)this.words[r]=e.words[r];return this.length=e.length,this._strip()},o.prototype.ixor=function(t){return r(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<<i:this.words[n]&~(1<<i),this._strip()},o.prototype.iadd=function(t){var e,n,r;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o<r.length;o++)e=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<n.length;o++)e=(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,s=0;s<r.length;s++)o=(e=(0|n.words[s])-(0|r.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<n.length;s++)o=(e=(0|n.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<n.length&&n!==this)for(;s<n.length;s++)this.words[s]=n.words[s];return this.length=Math.max(this.length,s),n!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var g=function(t,e,n){var r,i,o,s=t.words,a=e.words,c=n.words,u=0,l=0|s[0],d=8191&l,h=l>>>13,f=0|s[1],p=8191&f,y=f>>>13,g=0|s[2],m=8191&g,b=g>>>13,w=0|s[3],k=8191&w,v=w>>>13,I=0|s[4],A=8191&I,_=I>>>13,S=0|s[5],E=8191&S,T=S>>>13,x=0|s[6],P=8191&x,B=x>>>13,O=0|s[7],R=8191&O,M=O>>>13,C=0|s[8],U=8191&C,N=C>>>13,L=0|s[9],z=8191&L,K=L>>>13,D=0|a[0],j=8191&D,W=D>>>13,F=0|a[1],G=8191&F,H=F>>>13,q=0|a[2],$=8191&q,Z=q>>>13,V=0|a[3],X=8191&V,J=V>>>13,Y=0|a[4],Q=8191&Y,tt=Y>>>13,et=0|a[5],nt=8191&et,rt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ct=8191&at,ut=at>>>13,lt=0|a[8],dt=8191<,ht=lt>>>13,ft=0|a[9],pt=8191&ft,yt=ft>>>13;n.negative=t.negative^e.negative,n.length=19;var gt=(u+(r=Math.imul(d,j))|0)+((8191&(i=(i=Math.imul(d,W))+Math.imul(h,j)|0))<<13)|0;u=((o=Math.imul(h,W))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,r=Math.imul(p,j),i=(i=Math.imul(p,W))+Math.imul(y,j)|0,o=Math.imul(y,W);var mt=(u+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,H)|0)+Math.imul(h,G)|0))<<13)|0;u=((o=o+Math.imul(h,H)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(m,j),i=(i=Math.imul(m,W))+Math.imul(b,j)|0,o=Math.imul(b,W),r=r+Math.imul(p,G)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,H)|0;var bt=(u+(r=r+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,Z)|0)+Math.imul(h,$)|0))<<13)|0;u=((o=o+Math.imul(h,Z)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(k,j),i=(i=Math.imul(k,W))+Math.imul(v,j)|0,o=Math.imul(v,W),r=r+Math.imul(m,G)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,H)|0,r=r+Math.imul(p,$)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,Z)|0;var wt=(u+(r=r+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,J)|0)+Math.imul(h,X)|0))<<13)|0;u=((o=o+Math.imul(h,J)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(A,j),i=(i=Math.imul(A,W))+Math.imul(_,j)|0,o=Math.imul(_,W),r=r+Math.imul(k,G)|0,i=(i=i+Math.imul(k,H)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,H)|0,r=r+Math.imul(m,$)|0,i=(i=i+Math.imul(m,Z)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,Z)|0,r=r+Math.imul(p,X)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,J)|0;var kt=(u+(r=r+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,tt)|0)+Math.imul(h,Q)|0))<<13)|0;u=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(E,j),i=(i=Math.imul(E,W))+Math.imul(T,j)|0,o=Math.imul(T,W),r=r+Math.imul(A,G)|0,i=(i=i+Math.imul(A,H)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,H)|0,r=r+Math.imul(k,$)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,Z)|0,r=r+Math.imul(m,X)|0,i=(i=i+Math.imul(m,J)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,J)|0,r=r+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0;var vt=(u+(r=r+Math.imul(d,nt)|0)|0)+((8191&(i=(i=i+Math.imul(d,rt)|0)+Math.imul(h,nt)|0))<<13)|0;u=((o=o+Math.imul(h,rt)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(P,j),i=(i=Math.imul(P,W))+Math.imul(B,j)|0,o=Math.imul(B,W),r=r+Math.imul(E,G)|0,i=(i=i+Math.imul(E,H)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,H)|0,r=r+Math.imul(A,$)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,Z)|0,r=r+Math.imul(k,X)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,J)|0,r=r+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(y,nt)|0,o=o+Math.imul(y,rt)|0;var It=(u+(r=r+Math.imul(d,ot)|0)|0)+((8191&(i=(i=i+Math.imul(d,st)|0)+Math.imul(h,ot)|0))<<13)|0;u=((o=o+Math.imul(h,st)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(R,j),i=(i=Math.imul(R,W))+Math.imul(M,j)|0,o=Math.imul(M,W),r=r+Math.imul(P,G)|0,i=(i=i+Math.imul(P,H)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,H)|0,r=r+Math.imul(E,$)|0,i=(i=i+Math.imul(E,Z)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,Z)|0,r=r+Math.imul(A,X)|0,i=(i=i+Math.imul(A,J)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,J)|0,r=r+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(m,nt)|0,i=(i=i+Math.imul(m,rt)|0)+Math.imul(b,nt)|0,o=o+Math.imul(b,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0;var At=(u+(r=r+Math.imul(d,ct)|0)|0)+((8191&(i=(i=i+Math.imul(d,ut)|0)+Math.imul(h,ct)|0))<<13)|0;u=((o=o+Math.imul(h,ut)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(U,j),i=(i=Math.imul(U,W))+Math.imul(N,j)|0,o=Math.imul(N,W),r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,H)|0,r=r+Math.imul(P,$)|0,i=(i=i+Math.imul(P,Z)|0)+Math.imul(B,$)|0,o=o+Math.imul(B,Z)|0,r=r+Math.imul(E,X)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,J)|0,r=r+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,r=r+Math.imul(k,nt)|0,i=(i=i+Math.imul(k,rt)|0)+Math.imul(v,nt)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,r=r+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ut)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,ut)|0;var _t=(u+(r=r+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,ht)|0)+Math.imul(h,dt)|0))<<13)|0;u=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(z,j),i=(i=Math.imul(z,W))+Math.imul(K,j)|0,o=Math.imul(K,W),r=r+Math.imul(U,G)|0,i=(i=i+Math.imul(U,H)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,H)|0,r=r+Math.imul(R,$)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,Z)|0,r=r+Math.imul(P,X)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,J)|0,r=r+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,r=r+Math.imul(A,nt)|0,i=(i=i+Math.imul(A,rt)|0)+Math.imul(_,nt)|0,o=o+Math.imul(_,rt)|0,r=r+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0,r=r+Math.imul(m,ct)|0,i=(i=i+Math.imul(m,ut)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,ut)|0,r=r+Math.imul(p,dt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(y,dt)|0,o=o+Math.imul(y,ht)|0;var St=(u+(r=r+Math.imul(d,pt)|0)|0)+((8191&(i=(i=i+Math.imul(d,yt)|0)+Math.imul(h,pt)|0))<<13)|0;u=((o=o+Math.imul(h,yt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(z,G),i=(i=Math.imul(z,H))+Math.imul(K,G)|0,o=Math.imul(K,H),r=r+Math.imul(U,$)|0,i=(i=i+Math.imul(U,Z)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,Z)|0,r=r+Math.imul(R,X)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,J)|0,r=r+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(B,Q)|0,o=o+Math.imul(B,tt)|0,r=r+Math.imul(E,nt)|0,i=(i=i+Math.imul(E,rt)|0)+Math.imul(T,nt)|0,o=o+Math.imul(T,rt)|0,r=r+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,r=r+Math.imul(k,ct)|0,i=(i=i+Math.imul(k,ut)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,ut)|0,r=r+Math.imul(m,dt)|0,i=(i=i+Math.imul(m,ht)|0)+Math.imul(b,dt)|0,o=o+Math.imul(b,ht)|0;var Et=(u+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,yt)|0)+Math.imul(y,pt)|0))<<13)|0;u=((o=o+Math.imul(y,yt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(z,$),i=(i=Math.imul(z,Z))+Math.imul(K,$)|0,o=Math.imul(K,Z),r=r+Math.imul(U,X)|0,i=(i=i+Math.imul(U,J)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,J)|0,r=r+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,r=r+Math.imul(P,nt)|0,i=(i=i+Math.imul(P,rt)|0)+Math.imul(B,nt)|0,o=o+Math.imul(B,rt)|0,r=r+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,r=r+Math.imul(A,ct)|0,i=(i=i+Math.imul(A,ut)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ut)|0,r=r+Math.imul(k,dt)|0,i=(i=i+Math.imul(k,ht)|0)+Math.imul(v,dt)|0,o=o+Math.imul(v,ht)|0;var Tt=(u+(r=r+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,yt)|0)+Math.imul(b,pt)|0))<<13)|0;u=((o=o+Math.imul(b,yt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(z,X),i=(i=Math.imul(z,J))+Math.imul(K,X)|0,o=Math.imul(K,J),r=r+Math.imul(U,Q)|0,i=(i=i+Math.imul(U,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,r=r+Math.imul(R,nt)|0,i=(i=i+Math.imul(R,rt)|0)+Math.imul(M,nt)|0,o=o+Math.imul(M,rt)|0,r=r+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(B,ot)|0,o=o+Math.imul(B,st)|0,r=r+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,ut)|0)+Math.imul(T,ct)|0,o=o+Math.imul(T,ut)|0,r=r+Math.imul(A,dt)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(_,dt)|0,o=o+Math.imul(_,ht)|0;var xt=(u+(r=r+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,yt)|0)+Math.imul(v,pt)|0))<<13)|0;u=((o=o+Math.imul(v,yt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(z,Q),i=(i=Math.imul(z,tt))+Math.imul(K,Q)|0,o=Math.imul(K,tt),r=r+Math.imul(U,nt)|0,i=(i=i+Math.imul(U,rt)|0)+Math.imul(N,nt)|0,o=o+Math.imul(N,rt)|0,r=r+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,r=r+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,ut)|0)+Math.imul(B,ct)|0,o=o+Math.imul(B,ut)|0,r=r+Math.imul(E,dt)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(T,dt)|0,o=o+Math.imul(T,ht)|0;var Pt=(u+(r=r+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,yt)|0)+Math.imul(_,pt)|0))<<13)|0;u=((o=o+Math.imul(_,yt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,r=Math.imul(z,nt),i=(i=Math.imul(z,rt))+Math.imul(K,nt)|0,o=Math.imul(K,rt),r=r+Math.imul(U,ot)|0,i=(i=i+Math.imul(U,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,r=r+Math.imul(R,ct)|0,i=(i=i+Math.imul(R,ut)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,ut)|0,r=r+Math.imul(P,dt)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(B,dt)|0,o=o+Math.imul(B,ht)|0;var Bt=(u+(r=r+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,yt)|0)+Math.imul(T,pt)|0))<<13)|0;u=((o=o+Math.imul(T,yt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,r=Math.imul(z,ot),i=(i=Math.imul(z,st))+Math.imul(K,ot)|0,o=Math.imul(K,st),r=r+Math.imul(U,ct)|0,i=(i=i+Math.imul(U,ut)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,ut)|0,r=r+Math.imul(R,dt)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(M,dt)|0,o=o+Math.imul(M,ht)|0;var Ot=(u+(r=r+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,yt)|0)+Math.imul(B,pt)|0))<<13)|0;u=((o=o+Math.imul(B,yt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(z,ct),i=(i=Math.imul(z,ut))+Math.imul(K,ct)|0,o=Math.imul(K,ut),r=r+Math.imul(U,dt)|0,i=(i=i+Math.imul(U,ht)|0)+Math.imul(N,dt)|0,o=o+Math.imul(N,ht)|0;var Rt=(u+(r=r+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,yt)|0)+Math.imul(M,pt)|0))<<13)|0;u=((o=o+Math.imul(M,yt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,r=Math.imul(z,dt),i=(i=Math.imul(z,ht))+Math.imul(K,dt)|0,o=Math.imul(K,ht);var Mt=(u+(r=r+Math.imul(U,pt)|0)|0)+((8191&(i=(i=i+Math.imul(U,yt)|0)+Math.imul(N,pt)|0))<<13)|0;u=((o=o+Math.imul(N,yt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863;var Ct=(u+(r=Math.imul(z,pt))|0)+((8191&(i=(i=Math.imul(z,yt))+Math.imul(K,pt)|0))<<13)|0;return u=((o=Math.imul(K,yt))+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,c[0]=gt,c[1]=mt,c[2]=bt,c[3]=wt,c[4]=kt,c[5]=vt,c[6]=It,c[7]=At,c[8]=_t,c[9]=St,c[10]=Et,c[11]=Tt,c[12]=xt,c[13]=Pt,c[14]=Bt,c[15]=Ot,c[16]=Rt,c[17]=Mt,c[18]=Ct,0!==u&&(c[19]=u,n.length++),n};function m(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o<n.length-1;o++){var s=i;i=0;for(var a=67108863&r,c=Math.min(o,e.length-1),u=Math.max(0,o-t.length+1);u<=c;u++){var l=o-u,d=(0|t.words[l])*(0|e.words[u]),h=67108863&d;a=67108863&(h=h+a|0),i+=(s=(s=s+(d/67108864|0)|0)+(h>>>26)|0)>>>26,s&=67108863}n.words[o]=a,r=s,s=i}return 0!==r?n.words[o]=r:n.length--,n._strip()}function b(t,e,n){return m(t,e,n)}function w(t,e){this.x=t,this.y=e}Math.imul||(g=y),o.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):n<63?y(this,t,e):n<1024?m(this,t,e):b(this,t,e)},w.prototype.makeRBT=function(t){for(var e=new Array(t),n=o.prototype._countBits(t)-1,r=0;r<t;r++)e[r]=this.revBin(r,n,t);return e},w.prototype.revBin=function(t,e,n){if(0===t||t===n-1)return t;for(var r=0,i=0;i<e;i++)r|=(1&t)<<e-i-1,t>>=1;return r},w.prototype.permute=function(t,e,n,r,i,o){for(var s=0;s<o;s++)r[s]=e[t[s]],i[s]=n[t[s]]},w.prototype.transform=function(t,e,n,r,i,o){this.permute(o,t,e,n,r,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,c=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var d=c,h=u,f=0;f<s;f++){var p=n[l+f],y=r[l+f],g=n[l+f+s],m=r[l+f+s],b=d*g-h*m;m=d*m+h*g,g=b,n[l+f]=p+g,r[l+f]=y+m,n[l+f+s]=p-g,r[l+f+s]=y-m,f!==a&&(b=c*d-u*h,h=c*h+u*d,d=b)}},w.prototype.guessLen13b=function(t,e){var n=1|Math.max(e,t),r=1&n,i=0;for(n=n/2|0;n;n>>>=1)i++;return 1<<i+1+r},w.prototype.conjugate=function(t,e,n){if(!(n<=1))for(var r=0;r<n/2;r++){var i=t[r];t[r]=t[n-r-1],t[n-r-1]=i,i=e[r],e[r]=-e[n-r-1],e[n-r-1]=-i}},w.prototype.normalize13b=function(t,e){for(var n=0,r=0;r<e/2;r++){var i=8192*Math.round(t[2*r+1]/e)+Math.round(t[2*r]/e)+n;t[r]=67108863&i,n=i<67108864?0:i/67108864|0}return t},w.prototype.convert13b=function(t,e,n,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],n[2*s]=8191&o,o>>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)n[s]=0;r(0===o),r(0==(-8192&o))},w.prototype.stub=function(t){for(var e=new Array(t),n=0;n<t;n++)e[n]=0;return e},w.prototype.mulp=function(t,e,n){var r=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(r),o=this.stub(r),s=new Array(r),a=new Array(r),c=new Array(r),u=new Array(r),l=new Array(r),d=new Array(r),h=n.words;h.length=r,this.convert13b(t.words,t.length,s,r),this.convert13b(e.words,e.length,u,r),this.transform(s,o,a,c,r,i),this.transform(u,o,l,d,r,i);for(var f=0;f<r;f++){var p=a[f]*l[f]-c[f]*d[f];c[f]=a[f]*d[f]+c[f]*l[f],a[f]=p}return this.conjugate(a,c,r),this.transform(a,c,h,o,r,i),this.conjugate(h,o,r),this.normalize13b(h,r),n.negative=t.negative^e.negative,n.length=t.length+e.length,n._strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),b(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){var e=t<0;e&&(t=-t),r("number"==typeof t),r(t<67108864);for(var n=0,i=0;i<this.length;i++){var o=(0|this.words[i])*t,s=(67108863&o)+(67108863&n);n>>=26,n+=o/67108864|0,n+=s>>>26,this.words[i]=67108863&s}return 0!==n&&(this.words[i]=n,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n<e.length;n++){var r=n/26|0,i=n%26;e[n]=t.words[r]>>>i&1}return e}(t);if(0===e.length)return new o(1);for(var n=this,r=0;r<e.length&&0===e[r];r++,n=n.sqr());if(++r<e.length)for(var i=n.sqr();r<e.length;r++,i=i.sqr())0!==e[r]&&(n=n.mul(i));return n},o.prototype.iushln=function(t){r("number"==typeof t&&t>=0);var e,n=t%26,i=(t-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,c=(0|this.words[e])-a<<n;this.words[e]=c|s,s=a>>>26-n}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(t){return r(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,n){var i;r("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,c=n;if(i-=s,i=Math.max(0,i),c){for(var u=0;u<s;u++)c.words[u]=this.words[u];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=i);u--){var d=0|this.words[u];this.words[u]=l<<26-o|d>>>o,l=d&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<<e;return!(this.length<=n)&&!!(this.words[n]&i)},o.prototype.imaskn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return r("number"==typeof t),r(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this._strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,n){var i,o,s=t.length+n;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+n])+a;var c=(0|t.words[i])*e;a=((o-=67108863&c)>>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i<this.length-n;i++)a=(o=(0|this.words[i+n])+a)>>26,this.words[i+n]=67108863&o;if(0===a)return this._strip();for(r(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),i=t,s=0|i.words[i.length-1];0!==(n=26-this._countBits(s))&&(i=i.ushln(n),r.iushln(n),s=0|i.words[i.length-1]);var a,c=r.length-i.length;if("mod"!==e){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=r.clone()._ishlnsubmul(i,1,c);0===l.negative&&(r=l,a&&(a.words[c]=1));for(var d=c-1;d>=0;d--){var h=67108864*(0|r.words[i.length+d])+(0|r.words[i.length+d-1]);for(h=Math.min(h/s|0,67108863),r._ishlnsubmul(i,h,d);0!==r.negative;)h--,r.negative=0,r._ishlnsubmul(i,1,d),r.isZero()||(r.negative^=1);a&&(a.words[d]=h)}return a&&a._strip(),r._strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:a||null,mod:r}},o.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var n=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/t|0,n=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),d=e.clone();!e.isZero();){for(var h=0,f=1;0==(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;0==(n.words[0]&y)&&p<26;++p,y<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);e.cmp(n)>=0?(e.isub(n),i.isub(a),s.isub(c)):(n.isub(e),a.isub(i),c.isub(s))}return{a,b:c,gcd:n.iushln(u)}},o.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),c=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0==(e.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(e.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,h=1;0==(n.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(n.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);e.cmp(n)>=0?(e.isub(n),s.isub(a)):(n.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<<e;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var o=i,s=n;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){r<i?e=-1:r>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new E(t)},o.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var k={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function I(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(I,v),I.prototype.split=function(t,e){for(var n=4194303,r=Math.min(t.length,9),i=0;i<r;i++)e.words[i]=t.words[i];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var o=t.words[9];for(e.words[e.length++]=o&n,i=10;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(s&n)<<4|o>>>22,o=s}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},I.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n<t.length;n++){var r=0|t.words[n];e+=977*r,t.words[n]=67108863&e,e=64*r+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(A,v),i(_,v),i(S,v),S.prototype.imulK=function(t){for(var e=0,n=0;n<t.length;n++){var r=19*(0|t.words[n])+e,i=67108863&r;r>>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(k[t])return k[t];var e;if("k256"===t)e=new I;else if("p224"===t)e=new A;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return k[t]=e,e},E.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){r(0==(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},E.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},E.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},E.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new o(1)).iushrn(2);return this.pow(t,n)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);r(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,i),h=this.pow(t,i.addn(1).iushrn(1)),f=this.pow(t,i),p=s;0!==f.cmp(a);){for(var y=f,g=0;0!==y.cmp(a);g++)y=y.redSqr();r(g<p);var m=this.pow(d,new o(1).iushln(p-g-1));h=h.redMul(m),d=m.redSqr(),f=f.redMul(d),p=g}return h},E.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},E.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var n=new Array(16);n[0]=new o(1).toRed(this),n[1]=t;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],t);var i=n[0],s=0,a=0,c=e.bitLength()%26;for(0===c&&(c=26),r=e.length-1;r>=0;r--){for(var u=e.words[r],l=c-1;l>=0;l--){var d=u>>l&1;i!==n[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===r&&0===l)&&(i=this.mul(i,n[s]),a=0,s=0)):a=0}c=26}return i},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new T(t)},i(T,E),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=n.nmd(t),this)},83871:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__decorate||function(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.deserializeUnchecked=e.deserialize=e.serialize=e.BinaryReader=e.BinaryWriter=e.BorshError=e.baseDecode=e.baseEncode=void 0;const c=a(n(62197)),u=a(n(17022)),l=s(n(92338)),d=new("function"!=typeof TextDecoder?l.TextDecoder:TextDecoder)("utf-8",{fatal:!0});e.baseEncode=function(t){return"string"==typeof t&&(t=Buffer.from(t,"utf8")),u.default.encode(Buffer.from(t))},e.baseDecode=function(t){return Buffer.from(u.default.decode(t))};const h=1024;class f extends Error{constructor(t){super(t),this.fieldPath=[],this.originalMessage=t}addToFieldPath(t){this.fieldPath.splice(0,0,t),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}e.BorshError=f;class p{constructor(){this.buf=Buffer.alloc(h),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(h)]))}writeU8(t){this.maybeResize(),this.buf.writeUInt8(t,this.length),this.length+=1}writeU16(t){this.maybeResize(),this.buf.writeUInt16LE(t,this.length),this.length+=2}writeU32(t){this.maybeResize(),this.buf.writeUInt32LE(t,this.length),this.length+=4}writeU64(t){this.maybeResize(),this.writeBuffer(Buffer.from(new c.default(t).toArray("le",8)))}writeU128(t){this.maybeResize(),this.writeBuffer(Buffer.from(new c.default(t).toArray("le",16)))}writeU256(t){this.maybeResize(),this.writeBuffer(Buffer.from(new c.default(t).toArray("le",32)))}writeU512(t){this.maybeResize(),this.writeBuffer(Buffer.from(new c.default(t).toArray("le",64)))}writeBuffer(t){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),t,Buffer.alloc(h)]),this.length+=t.length}writeString(t){this.maybeResize();const e=Buffer.from(t,"utf8");this.writeU32(e.length),this.writeBuffer(e)}writeFixedArray(t){this.writeBuffer(Buffer.from(t))}writeArray(t,e){this.maybeResize(),this.writeU32(t.length);for(const n of t)this.maybeResize(),e(n)}toArray(){return this.buf.subarray(0,this.length)}}function y(t,e,n){const r=n.value;n.value=function(...t){try{return r.apply(this,t)}catch(e){if(e instanceof RangeError){const t=e.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(t)>=0)throw new f("Reached the end of buffer when deserializing")}throw e}}}e.BinaryWriter=p;class g{constructor(t){this.buf=t,this.offset=0}readU8(){const t=this.buf.readUInt8(this.offset);return this.offset+=1,t}readU16(){const t=this.buf.readUInt16LE(this.offset);return this.offset+=2,t}readU32(){const t=this.buf.readUInt32LE(this.offset);return this.offset+=4,t}readU64(){const t=this.readBuffer(8);return new c.default(t,"le")}readU128(){const t=this.readBuffer(16);return new c.default(t,"le")}readU256(){const t=this.readBuffer(32);return new c.default(t,"le")}readU512(){const t=this.readBuffer(64);return new c.default(t,"le")}readBuffer(t){if(this.offset+t>this.buf.length)throw new f(`Expected buffer length ${t} isn't within bounds`);const e=this.buf.slice(this.offset,this.offset+t);return this.offset+=t,e}readString(){const t=this.readU32(),e=this.readBuffer(t);try{return d.decode(e)}catch(n){throw new f(`Error decoding UTF-8 string: ${n}`)}}readFixedArray(t){return new Uint8Array(this.readBuffer(t))}readArray(t){const e=this.readU32(),n=Array();for(let r=0;r<e;++r)n.push(t());return n}}function m(t){return t.charAt(0).toUpperCase()+t.slice(1)}function b(t,e,n,r,i){try{if("string"==typeof r)i[`write${m(r)}`](n);else if(r instanceof Array)if("number"==typeof r[0]){if(n.length!==r[0])throw new f(`Expecting byte array of length ${r[0]}, but got ${n.length} bytes`);i.writeFixedArray(n)}else if(2===r.length&&"number"==typeof r[1]){if(n.length!==r[1])throw new f(`Expecting byte array of length ${r[1]}, but got ${n.length} bytes`);for(let e=0;e<r[1];e++)b(t,null,n[e],r[0],i)}else i.writeArray(n,(n=>{b(t,e,n,r[0],i)}));else if(void 0!==r.kind)switch(r.kind){case"option":null==n?i.writeU8(0):(i.writeU8(1),b(t,e,n,r.type,i));break;case"map":i.writeU32(n.size),n.forEach(((n,o)=>{b(t,e,o,r.key,i),b(t,e,n,r.value,i)}));break;default:throw new f(`FieldType ${r} unrecognized`)}else w(t,n,i)}catch(o){throw o instanceof f&&o.addToFieldPath(e),o}}function w(t,e,n){if("function"==typeof e.borshSerialize)return void e.borshSerialize(n);const r=t.get(e.constructor);if(!r)throw new f(`Class ${e.constructor.name} is missing in schema`);if("struct"===r.kind)r.fields.map((([r,i])=>{b(t,r,e[r],i,n)}));else{if("enum"!==r.kind)throw new f(`Unexpected schema kind: ${r.kind} for ${e.constructor.name}`);{const i=e[r.field];for(let o=0;o<r.values.length;++o){const[s,a]=r.values[o];if(s===i){n.writeU8(o),b(t,s,e[s],a,n);break}}}}}function k(t,e,n,r){try{if("string"==typeof n)return r[`read${m(n)}`]();if(n instanceof Array){if("number"==typeof n[0])return r.readFixedArray(n[0]);if("number"==typeof n[1]){const e=[];for(let i=0;i<n[1];i++)e.push(k(t,null,n[0],r));return e}return r.readArray((()=>k(t,e,n[0],r)))}if("option"===n.kind){return r.readU8()?k(t,e,n.type,r):void 0}if("map"===n.kind){let i=new Map;const o=r.readU32();for(let s=0;s<o;s++){const o=k(t,e,n.key,r),s=k(t,e,n.value,r);i.set(o,s)}return i}return v(t,n,r)}catch(i){throw i instanceof f&&i.addToFieldPath(e),i}}function v(t,e,n){if("function"==typeof e.borshDeserialize)return e.borshDeserialize(n);const r=t.get(e);if(!r)throw new f(`Class ${e.name} is missing in schema`);if("struct"===r.kind){const r={};for(const[i,o]of t.get(e).fields)r[i]=k(t,i,o,n);return new e(r)}if("enum"===r.kind){const i=n.readU8();if(i>=r.values.length)throw new f(`Enum index: ${i} is out of range`);const[o,s]=r.values[i];return new e({[o]:k(t,o,s,n)})}throw new f(`Unexpected schema kind: ${r.kind} for ${e.constructor.name}`)}o([y],g.prototype,"readU8",null),o([y],g.prototype,"readU16",null),o([y],g.prototype,"readU32",null),o([y],g.prototype,"readU64",null),o([y],g.prototype,"readU128",null),o([y],g.prototype,"readU256",null),o([y],g.prototype,"readU512",null),o([y],g.prototype,"readString",null),o([y],g.prototype,"readFixedArray",null),o([y],g.prototype,"readArray",null),e.BinaryReader=g,e.serialize=function(t,e,n=p){const r=new n;return w(t,e,r),r.toArray()},e.deserialize=function(t,e,n,r=g){const i=new r(n),o=v(t,e,i);if(i.offset<n.length)throw new f(`Unexpected ${n.length-i.offset} bytes after deserialized data`);return o},e.deserializeUnchecked=function(t,e,n,r=g){return v(t,e,new r(n))}},17022:(t,e,n)=>{var r=n(18166);t.exports=r("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},48834:(t,e,n)=>{"use strict";const r=n(95766),i=n(62333),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return d(t)}return u(t,e,n)}function u(t,e,n){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const n=0|y(t,e);let r=a(n);const i=r.write(t,e);i!==n&&(r=r.slice(0,i));return r}(t,e);if(ArrayBuffer.isView(t))return function(t){if(V(t,Uint8Array)){const e=new Uint8Array(t);return f(e.buffer,e.byteOffset,e.byteLength)}return h(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(V(t,ArrayBuffer)||t&&V(t.buffer,ArrayBuffer))return f(t,e,n);if("undefined"!=typeof SharedArrayBuffer&&(V(t,SharedArrayBuffer)||t&&V(t.buffer,SharedArrayBuffer)))return f(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return c.from(r,e,n);const i=function(t){if(c.isBuffer(t)){const e=0|p(t.length),n=a(e);return 0===n.length||t.copy(n,0,0,e),n}if(void 0!==t.length)return"number"!=typeof t.length||X(t.length)?a(0):h(t);if("Buffer"===t.type&&Array.isArray(t.data))return h(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function d(t){return l(t),a(t<0?0:0|p(t))}function h(t){const e=t.length<0?0:0|p(t.length),n=a(e);for(let r=0;r<e;r+=1)n[r]=255&t[r];return n}function f(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n),Object.setPrototypeOf(r,c.prototype),r}function p(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function y(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||V(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return $(t).length;default:if(i)return r?-1:q(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,n){let r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return B(this,e,n);case"utf8":case"utf-8":return E(this,e,n);case"ascii":return x(this,e,n);case"latin1":case"binary":return P(this,e,n);case"base64":return S(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function b(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),X(n=+n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=c.from(e,r)),c.isBuffer(e))return 0===e.length?-1:w(t,e,n,r,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):w(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function w(t,e,n,r,i){let o,s=1,a=t.length,c=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,n/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let r=-1;for(o=n;o<a;o++)if(u(t,o)===u(e,-1===r?0:o-r)){if(-1===r&&(r=o),o-r+1===c)return r*s}else-1!==r&&(o-=o-r),r=-1}else for(n+c>a&&(n=a-c),o=n;o>=0;o--){let n=!0;for(let r=0;r<c;r++)if(u(t,o+r)!==u(e,r)){n=!1;break}if(n)return o}return-1}function k(t,e,n,r){n=Number(n)||0;const i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;const o=e.length;let s;for(r>o/2&&(r=o/2),s=0;s<r;++s){const r=parseInt(e.substr(2*s,2),16);if(X(r))return s;t[n+s]=r}return s}function v(t,e,n,r){return Z(q(e,t.length-n),t,n,r)}function I(t,e,n,r){return Z(function(t){const e=[];for(let n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function A(t,e,n,r){return Z($(e),t,n,r)}function _(t,e,n,r){return Z(function(t,e){let n,r,i;const o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function S(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function E(t,e,n){n=Math.min(t.length,n);const r=[];let i=e;for(;i<n;){const e=t[i];let o=null,s=e>239?4:e>223?3:e>191?2:1;if(i+s<=n){let n,r,a,c;switch(s){case 1:e<128&&(o=e);break;case 2:n=t[i+1],128==(192&n)&&(c=(31&e)<<6|63&n,c>127&&(o=c));break;case 3:n=t[i+1],r=t[i+2],128==(192&n)&&128==(192&r)&&(c=(15&e)<<12|(63&n)<<6|63&r,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:n=t[i+1],r=t[i+2],a=t[i+3],128==(192&n)&&128==(192&r)&&128==(192&a)&&(c=(15&e)<<18|(63&n)<<12|(63&r)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=s}return function(t){const e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);let n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=T));return n}(r)}e.kMaxLength=s,c.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(t,e,n){return u(t,e,n)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(t,e,n){return function(t,e,n){return l(t),t<=0?a(t):void 0!==e?"string"==typeof n?a(t).fill(e,n):a(t).fill(e):a(t)}(t,e,n)},c.allocUnsafe=function(t){return d(t)},c.allocUnsafeSlow=function(t){return d(t)},c.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==c.prototype},c.compare=function(t,e){if(V(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),V(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,r=e.length;for(let i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);let n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;const r=c.allocUnsafe(e);let i=0;for(n=0;n<t.length;++n){let e=t[n];if(V(e,Uint8Array))i+e.length>r.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(r,i)):Uint8Array.prototype.set.call(r,e,i);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(r,i)}i+=e.length}return r},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},c.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},c.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},c.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?E(this,0,t):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){let t="";const n=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(t+=" ... "),"<Buffer "+t+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(t,e,n,r,i){if(V(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;let o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0);const a=Math.min(o,s),u=this.slice(r,i),l=t.slice(e,n);for(let c=0;c<a;++c)if(u[c]!==l[c]){o=u[c],s=l[c];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},c.prototype.indexOf=function(t,e,n){return b(this,t,e,n,!0)},c.prototype.lastIndexOf=function(t,e,n){return b(this,t,e,n,!1)},c.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return k(this,t,e,n);case"utf8":case"utf-8":return v(this,t,e,n);case"ascii":case"latin1":case"binary":return I(this,t,e,n);case"base64":return A(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function x(t,e,n){let r="";n=Math.min(t.length,n);for(let i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function P(t,e,n){let r="";n=Math.min(t.length,n);for(let i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function B(t,e,n){const r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);let i="";for(let o=e;o<n;++o)i+=J[t[o]];return i}function O(t,e,n){const r=t.slice(e,n);let i="";for(let o=0;o<r.length-1;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function R(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,n,r,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function C(t,e,n,r,i){W(e,r,i,t,n,7);let o=Number(e&BigInt(4294967295));t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o,o>>=8,t[n++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=s,s>>=8,t[n++]=s,s>>=8,t[n++]=s,s>>=8,t[n++]=s,n}function U(t,e,n,r,i){W(e,r,i,t,n,7);let o=Number(e&BigInt(4294967295));t[n+7]=o,o>>=8,t[n+6]=o,o>>=8,t[n+5]=o,o>>=8,t[n+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=s,s>>=8,t[n+2]=s,s>>=8,t[n+1]=s,s>>=8,t[n]=s,n+8}function N(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(t,e,n,r,o){return e=+e,n>>>=0,o||N(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function z(t,e,n,r,o){return e=+e,n>>>=0,o||N(t,0,n,8),i.write(t,e,n,r,52,8),n+8}c.prototype.slice=function(t,e){const n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);const r=this.subarray(t,e);return Object.setPrototypeOf(r,c.prototype),r},c.prototype.readUintLE=c.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||R(t,e,this.length);let r=this[t],i=1,o=0;for(;++o<e&&(i*=256);)r+=this[t+o]*i;return r},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||R(t,e,this.length);let r=this[t+--e],i=1;for(;e>0&&(i*=256);)r+=this[t+--e]*i;return r},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=Y((function(t){F(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||G(t,this.length-8);const r=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=Y((function(t){F(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||G(t,this.length-8);const r=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||R(t,e,this.length);let r=this[t],i=1,o=0;for(;++o<e&&(i*=256);)r+=this[t+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*e)),r},c.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||R(t,e,this.length);let r=e,i=1,o=this[t+--r];for(;r>0&&(i*=256);)o+=this[t+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||R(t,2,this.length);const n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(t,e){t>>>=0,e||R(t,2,this.length);const n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=Y((function(t){F(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||G(t,this.length-8);const r=this[t+4]+256*this[t+5]+65536*this[t+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),c.prototype.readBigInt64BE=Y((function(t){F(t>>>=0,"offset");const e=this[t],n=this[t+7];void 0!==e&&void 0!==n||G(t,this.length-8);const r=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+n)})),c.prototype.readFloatLE=function(t,e){return t>>>=0,e||R(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||R(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||R(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||R(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e>>>=0,n>>>=0,!r){M(this,t,e,n,Math.pow(2,8*n)-1,0)}let i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,e,n,r){if(t=+t,e>>>=0,n>>>=0,!r){M(this,t,e,n,Math.pow(2,8*n)-1,0)}let i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=Y((function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Y((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);M(this,t,e,n,r-1,-r)}let i=0,o=1,s=0;for(this[e]=255&t;++i<n&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+n},c.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*n-1);M(this,t,e,n,r-1,-r)}let i=n-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+n},c.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=Y((function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Y((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(t,e,n){return L(this,t,e,!0,n)},c.prototype.writeFloatBE=function(t,e,n){return L(this,t,e,!1,n)},c.prototype.writeDoubleLE=function(t,e,n){return z(this,t,e,!0,n)},c.prototype.writeDoubleBE=function(t,e,n){return z(this,t,e,!1,n)},c.prototype.copy=function(t,e,n,r){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);const i=r-n;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),e),i},c.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===t.length){const e=t.charCodeAt(0);("utf8"===r&&e<128||"latin1"===r)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;let i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{const o=c.isBuffer(t)?t:c.from(t,r),s=o.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<n-e;++i)this[i+e]=o[i%s]}return this};const K={};function D(t,e,n){K[t]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function j(t){let e="",n=t.length;const r="-"===t[0]?1:0;for(;n>=r+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function W(t,e,n,r,i,o){if(t>n||t<e){const r="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${e}${r} and <= ${n}${r}`,new K.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,n){F(e,"offset"),void 0!==t[e]&&void 0!==t[e+n]||G(e,t.length-(n+1))}(r,i,o)}function F(t,e){if("number"!=typeof t)throw new K.ERR_INVALID_ARG_TYPE(e,"number",t)}function G(t,e,n){if(Math.floor(t)!==t)throw F(t,n),new K.ERR_OUT_OF_RANGE(n||"offset","an integer",t);if(e<0)throw new K.ERR_BUFFER_OUT_OF_BOUNDS;throw new K.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${e}`,t)}D("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),D("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),D("ERR_OUT_OF_RANGE",(function(t,e,n){let r=`The value of "${t}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=j(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=j(i)),i+="n"),r+=` It must be ${e}. Received ${i}`,r}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function q(t,e){let n;e=e||1/0;const r=t.length;let i=null;const o=[];for(let s=0;s<r;++s){if(n=t.charCodeAt(s),n>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function $(t){return r.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Z(t,e,n,r){let i;for(i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function V(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function X(t){return t!=t}const J=function(){const t="0123456789abcdef",e=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)e[r+i]=t[n]+t[i]}return e}();function Y(t){return"undefined"==typeof BigInt?Q:t}function Q(){throw new Error("BigInt not supported")}},62680:(t,e,n)=>{"use strict";var r=n(67286),i=n(89429),o=i(r("String.prototype.indexOf"));t.exports=function(t,e){var n=r(t,!!e);return"function"==typeof n&&o(t,".prototype.")>-1?i(n):n}},89429:(t,e,n)=>{"use strict";var r=n(4090),i=n(67286),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||r.call(s,o),c=i("%Object.getOwnPropertyDescriptor%",!0),u=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(u)try{u({},"a",{value:1})}catch(h){u=null}t.exports=function(t){var e=a(r,s,arguments);if(c&&u){var n=c(e,"length");n.configurable&&u(e,"length",{value:1+l(0,t.length-(arguments.length-1))})}return e};var d=function(){return a(r,o,arguments)};u?u(t.exports,"apply",{value:d}):t.exports.apply=d},10161:t=>{"use strict";var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var a=new i(r,o||t,s),c=n?n+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],a]:t._events[c].push(a):(t._events[c]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function a(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),a.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,s=new Array(o);i<o;i++)s[i]=r[i].fn;return s},a.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},a.prototype.emit=function(t,e,r,i,o,s){var a=n?n+t:t;if(!this._events[a])return!1;var c,u,l=this._events[a],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,o),!0;case 6:return l.fn.call(l.context,e,r,i,o,s),!0}for(u=1,c=new Array(d-1);u<d;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var h,f=l.length;for(u=0;u<f;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),d){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,r);break;case 4:l[u].fn.call(l[u].context,e,r,i);break;default:if(!c)for(h=1,c=new Array(d-1);h<d;h++)c[h-1]=arguments[h];l[u].fn.apply(l[u].context,c)}}return!0},a.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},a.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},a.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==e||i&&!a.once||r&&a.context!==r||s(this,o);else{for(var c=0,u=[],l=a.length;c<l;c++)(a[c].fn!==e||i&&!a[c].once||r&&a[c].context!==r)&&u.push(a[c]);u.length?this._events[o]=1===u.length?u[0]:u:s(this,o)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&s(this,e)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a},83243:(t,e,n)=>{"use strict";var r=n(9680),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,s=function(t,e,n){for(var r=0,i=t.length;r<i;r++)o.call(t,r)&&(null==n?e(t[r],r,t):e.call(n,t[r],r,t))},a=function(t,e,n){for(var r=0,i=t.length;r<i;r++)null==n?e(t.charAt(r),r,t):e.call(n,t.charAt(r),r,t)},c=function(t,e,n){for(var r in t)o.call(t,r)&&(null==n?e(t[r],r,t):e.call(n,t[r],r,t))};t.exports=function(t,e,n){if(!r(e))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=n),"[object Array]"===i.call(t)?s(t,e,o):"string"==typeof t?a(t,e,o):c(t,e,o)}},37795:t=>{"use strict";var e="Function.prototype.bind called on incompatible ",n=Array.prototype.slice,r=Object.prototype.toString,i="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||r.call(o)!==i)throw new TypeError(e+o);for(var s,a=n.call(arguments,1),c=function(){if(this instanceof s){var e=o.apply(this,a.concat(n.call(arguments)));return Object(e)===e?e:this}return o.apply(t,a.concat(n.call(arguments)))},u=Math.max(0,o.length-a.length),l=[],d=0;d<u;d++)l.push("$"+d);if(s=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(c),o.prototype){var h=function(){};h.prototype=o.prototype,s.prototype=new h,h.prototype=null}return s}},4090:(t,e,n)=>{"use strict";var r=n(37795);t.exports=Function.prototype.bind||r},67286:(t,e,n)=>{"use strict";var r,i=SyntaxError,o=Function,s=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(e){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(P){c=null}var u=function(){throw new s},l=c?function(){try{return u}catch(t){try{return c(arguments,"callee").get}catch(e){return u}}}():u,d=n(32636)(),h=Object.getPrototypeOf||function(t){return t.__proto__},f={},p="undefined"==typeof Uint8Array?r:h(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":d?h([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":d?h(h([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&d?h((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&d?h((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":d?h(""[Symbol.iterator]()):r,"%Symbol%":d?Symbol:r,"%SyntaxError%":i,"%ThrowTypeError%":l,"%TypedArray%":p,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet},g=function t(e){var n;if("%AsyncFunction%"===e)n=a("async function () {}");else if("%GeneratorFunction%"===e)n=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)n=a("async function* () {}");else if("%AsyncGenerator%"===e){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(n=h(i.prototype))}return y[e]=n,n},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=n(4090),w=n(23198),k=b.call(Function.call,Array.prototype.concat),v=b.call(Function.apply,Array.prototype.splice),I=b.call(Function.call,String.prototype.replace),A=b.call(Function.call,String.prototype.slice),_=b.call(Function.call,RegExp.prototype.exec),S=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,E=/\\(\\)?/g,T=function(t){var e=A(t,0,1),n=A(t,-1);if("%"===e&&"%"!==n)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var r=[];return I(t,S,(function(t,e,n,i){r[r.length]=n?I(i,E,"$1"):e||t})),r},x=function(t,e){var n,r=t;if(w(m,r)&&(r="%"+(n=m[r])[0]+"%"),w(y,r)){var o=y[r];if(o===f&&(o=g(r)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');if(null===_(/^%?[^%]*%?$/,t))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=T(t),r=n.length>0?n[0]:"",o=x("%"+r+"%",e),a=o.name,u=o.value,l=!1,d=o.alias;d&&(r=d[0],v(n,k([0,1],d)));for(var h=1,f=!0;h<n.length;h+=1){var p=n[h],g=A(p,0,1),m=A(p,-1);if(('"'===g||"'"===g||"`"===g||'"'===m||"'"===m||"`"===m)&&g!==m)throw new i("property names with quotes must have matching quotes");if("constructor"!==p&&f||(l=!0),w(y,a="%"+(r+="."+p)+"%"))u=y[a];else if(null!=u){if(!(p in u)){if(!e)throw new s("base intrinsic for "+t+" exists, but the property is not available.");return}if(c&&h+1>=n.length){var b=c(u,p);u=(f=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:u[p]}else f=w(u,p),u=u[p];f&&!l&&(y[a]=u)}}return u}},32636:(t,e,n)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,i=n(66679);t.exports=function(){return"function"==typeof r&&("function"==typeof Symbol&&("symbol"==typeof r("foo")&&("symbol"==typeof Symbol("bar")&&i())))}},66679:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},67226:(t,e,n)=>{"use strict";var r=n(66679);t.exports=function(){return r()&&!!Symbol.toStringTag}},23198:(t,e,n)=>{"use strict";var r=n(4090);t.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},62333:(t,e)=>{e.read=function(t,e,n,r,i){var o,s,a=8*i-r-1,c=(1<<a)-1,u=c>>1,l=-7,d=n?i-1:0,h=n?-1:1,f=t[e+d];for(d+=h,o=f&(1<<-l)-1,f>>=-l,l+=a;l>0;o=256*o+t[e+d],d+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+t[e+d],d+=h,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,r),o-=u}return(f?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var s,a,c,u=8*o-i-1,l=(1<<u)-1,d=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+d>=1?h/c:h*Math.pow(2,1-d))*c>=2&&(s++,c/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(e*c-1)*Math.pow(2,i),s+=d):(a=e*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;t[n+f]=255&a,f+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[n+f]=255&s,f+=p,s/=256,u-=8);t[n+f-p]|=128*y}},91285:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},52635:(t,e,n)=>{"use strict";var r=n(67226)(),i=n(62680)("Object.prototype.toString"),o=function(t){return!(r&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},s=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,t.exports=a?o:s},9680:t=>{"use strict";var e,n,r=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw n}}),n={},i((function(){throw 42}),null,e)}catch(f){f!==n&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(t){try{var e=r.call(t);return o.test(e)}catch(n){return!1}},a=function(t){try{return!s(t)&&(r.call(t),!0)}catch(e){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),d=function(){return!1};if("object"==typeof document){var h=document.all;c.call(h)===c.call(document.all)&&(d=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(n){}return!1})}t.exports=i?function(t){if(d(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{i(t,null,e)}catch(r){if(r!==n)return!1}return!s(t)&&a(t)}:function(t){if(d(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(u)return a(t);if(s(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&a(t)}},43138:(t,e,n)=>{"use strict";var r,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=n(67226)(),c=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(s.test(o.call(t)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(t);if(!c)return!1;if(void 0===r){var e=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(t){}}();r=!!e&&c(e)}return c(t)===r}},50198:(t,e,n)=>{"use strict";var r=n(83243),i=n(62191),o=n(62680),s=o("Object.prototype.toString"),a=n(67226)(),c="undefined"==typeof globalThis?global:globalThis,u=i(),l=o("Array.prototype.indexOf",!0)||function(t,e){for(var n=0;n<t.length;n+=1)if(t[n]===e)return n;return-1},d=o("String.prototype.slice"),h={},f=n(29765),p=Object.getPrototypeOf;a&&f&&p&&r(u,(function(t){var e=new c[t];if(Symbol.toStringTag in e){var n=p(e),r=f(n,Symbol.toStringTag);if(!r){var i=p(n);r=f(i,Symbol.toStringTag)}h[t]=r.get}}));t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!a||!(Symbol.toStringTag in t)){var e=d(s(t),8,-1);return l(u,e)>-1}return!!f&&function(t){var e=!1;return r(h,(function(n,r){if(!e)try{e=n.call(t)===r}catch(i){}})),e}(t)}},87414:(t,e,n)=>{"use strict";const r=n(55029).v4,i=n(45901),o=function(t,e){if(!(this instanceof o))return new o(t,e);e||(e={}),this.options={reviver:void 0!==e.reviver?e.reviver:null,replacer:void 0!==e.replacer?e.replacer:null,generator:void 0!==e.generator?e.generator:function(){return r()},version:void 0!==e.version?e.version:2,notificationIdNull:"boolean"==typeof e.notificationIdNull&&e.notificationIdNull},this.callServer=t};t.exports=o,o.prototype.request=function(t,e,n,r){const o=this;let s=null;const a=Array.isArray(t)&&"function"==typeof e;if(1===this.options.version&&a)throw new TypeError("JSON-RPC 1.0 does not support batching");if(a||!a&&t&&"object"==typeof t&&"function"==typeof e)r=e,s=t;else{"function"==typeof n&&(r=n,n=void 0);const o="function"==typeof r;try{s=i(t,e,n,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(u){if(o)return r(u);throw u}if(!o)return s}let c;try{c=JSON.stringify(s,this.options.replacer)}catch(u){return r(u)}return this.callServer(c,(function(t,e){o._parseResponse(t,e,r)})),s},o.prototype._parseResponse=function(t,e,n){if(t)return void n(t);if(!e)return n();let r;try{r=JSON.parse(e,this.options.reviver)}catch(t){return n(t)}if(3===n.length){if(Array.isArray(r)){const t=function(t){return void 0!==t.error},e=function(e){return!t(e)};return n(null,r.filter(t),r.filter(e))}return n(null,r.error,r.result)}n(null,r)}},45901:(t,e,n)=>{"use strict";const r=n(55029).v4;t.exports=function(t,e,n,i){if("string"!=typeof t)throw new TypeError(t+" must be a string");const o="number"==typeof(i=i||{}).version?i.version:2;if(1!==o&&2!==o)throw new TypeError(o+" must be 1 or 2");const s={method:t};if(2===o&&(s.jsonrpc="2.0"),e){if("object"!=typeof e&&!Array.isArray(e))throw new TypeError(e+" must be an object, array or omitted");s.params=e}if(void 0===n){const t="function"==typeof i.generator?i.generator:function(){return r()};s.id=t(s,i)}else 2===o&&null===n?i.notificationIdNull&&(s.id=null):s.id=n;return s}},90394:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HDKey=e.HARDENED_OFFSET=e.MASTER_SECRET=void 0;const r=n(59696),i=n(41377),o=n(80590),s=n(96053),a=n(12540),c=n(70064),u=n(53525);r.utils.sha512Sync=(...t)=>(0,a.sha512)(r.utils.concatBytes(...t)),e.MASTER_SECRET=(0,c.utf8ToBytes)("ed25519 seed"),e.HARDENED_OFFSET=2147483648;const l=new Uint8Array([0]);function d(t,...e){return"string"==typeof t&&(t=(0,c.hexToBytes)(t)),(0,u.bytes)(t,...e),t}const h=t=>{if(!Number.isSafeInteger(t)||t<0||t>2**32-1)throw new Error(`Invalid number=${t}. Should be from 0 to 2 ** 32 - 1`);const e=new Uint8Array(4);return(0,c.createView)(e).setUint32(0,t,!1),e};class f{constructor(t){if(this.depth=0,this.index=0,this.parentFingerprint=0,!t||"object"!=typeof t)throw new Error("HDKey.constructor must not be called directly");if((0,u.bytes)(t.privateKey,32),(0,u.bytes)(t.chainCode,32),this.depth=t.depth||0,this.index=t.index||0,this.parentFingerprint=t.parentFingerprint||0,!this.depth&&(this.parentFingerprint||this.index))throw new Error("HDKey: zero depth with non-zero index/parent fingerprint");this.chainCode=t.chainCode,this.privateKey=t.privateKey}get publicKeyRaw(){return r.sync.getPublicKey(this.privateKey)}get publicKey(){return(0,c.concatBytes)(l,this.publicKeyRaw)}get pubHash(){return t=this.publicKey,(0,o.ripemd160)((0,s.sha256)(t));var t}get fingerprint(){return t=this.pubHash,(0,c.createView)(t).getUint32(0,!1);var t}get fingerprintHex(){return(0,c.bytesToHex)(h(this.fingerprint))}get parentFingerprintHex(){return(0,c.bytesToHex)(h(this.parentFingerprint))}static fromMasterSeed(t){if(8*(t=d(t)).length<128||8*t.length>512)throw new Error(`HDKey: wrong seed length=${t.length}. Should be between 128 and 512 bits; 256 bits is advised)`);const n=(0,i.hmac)(a.sha512,e.MASTER_SECRET,t);return new f({privateKey:n.slice(0,32),chainCode:n.slice(32)})}derive(t,n=!1){if(!/^[mM]'?/.test(t))throw new Error('Path must start with "m" or "M"');if(/^[mM]'?$/.test(t))return this;const r=t.replace(/^[mM]'?\//,"").split("/");let i=this;for(const o of r){const t=/^(\d+)('?)$/.exec(o);if(!t||3!==t.length)throw new Error(`Invalid child index: ${o}`);let r=+t[1];if(!Number.isSafeInteger(r)||r>=e.HARDENED_OFFSET)throw new Error("Invalid index");(n||"'"===t[2])&&(r+=e.HARDENED_OFFSET),i=i.deriveChild(r)}return i}deriveChild(t){if(t<e.HARDENED_OFFSET)throw new Error(`Non-hardened child derivation not possible for Ed25519 (index=${t})`);const n=(0,c.concatBytes)(l,this.privateKey,h(t)),r=(0,i.hmac)(a.sha512,this.chainCode,n);return new f({chainCode:r.slice(32),depth:this.depth+1,parentFingerprint:this.fingerprint,index:t,privateKey:r.slice(0,32)})}sign(t){return t=d(t,32),r.sync.sign(t,this.privateKey)}verify(t,e){return t=d(t,32),e=d(e,64),r.sync.verify(e,t,this.publicKeyRaw)}}e.HDKey=f},50714:(t,e,n)=>{"use strict";var r=n(71600);e.K=void 0;var i=r(n(98870)),o=r(n(53100)),s=r(n(68230)),a=r(n(60421)),c=r(n(1147)),u=r(n(380));function l(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,c.default)(t);if(e){var i=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,a.default)(this,n)}}var d=function(t){(0,s.default)(n,t);var e=l(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"ws://localhost:8080",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.autoconnect,s=void 0===i||i,a=r.reconnect,c=void 0===a||a,l=r.reconnect_interval,d=void 0===l?1e3:l,h=r.max_reconnects,f=void 0===h?5:h,p=arguments.length>2?arguments[2]:void 0;return(0,o.default)(this,n),e.call(this,u.default,t,{autoconnect:s,reconnect:c,reconnect_interval:d,max_reconnects:f},p)}return(0,i.default)(n)}(r(n(98904)).default);e.K=d},98904:(t,e,n)=>{"use strict";var r=n(71600);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n(82841)),o=r(n(91461)),s=r(n(67425)),a=r(n(53100)),c=r(n(98870)),u=r(n(68230)),l=r(n(60421)),d=r(n(1147)),h=n(10161);function f(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,d.default)(t);if(e){var i=(0,d.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,l.default)(this,n)}}var p=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n},y=function(t){(0,u.default)(h,t);var e,n,r,l,d=f(h);function h(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ws://localhost:8080",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;(0,a.default)(this,h);var o=r.autoconnect,s=void 0===o||o,c=r.reconnect,u=void 0===c||c,l=r.reconnect_interval,f=void 0===l?1e3:l,y=r.max_reconnects,g=void 0===y?5:y,m=p(r,["autoconnect","reconnect","reconnect_interval","max_reconnects"]);return(e=d.call(this)).webSocketFactory=t,e.queue={},e.rpc_id=0,e.address=n,e.autoconnect=s,e.ready=!1,e.reconnect=u,e.reconnect_interval=f,e.max_reconnects=g,e.rest_options=m,e.current_reconnects=0,e.generate_request_id=i||function(){return++e.rpc_id},e.autoconnect&&e._connect(e.address,Object.assign({autoconnect:e.autoconnect,reconnect:e.reconnect,reconnect_interval:e.reconnect_interval,max_reconnects:e.max_reconnects},e.rest_options)),e}return(0,c.default)(h,[{key:"connect",value:function(){this.socket||this._connect(this.address,Object.assign({autoconnect:this.autoconnect,reconnect:this.reconnect,reconnect_interval:this.reconnect_interval,max_reconnects:this.max_reconnects},this.rest_options))}},{key:"call",value:function(t,e,n,r){var i=this;return r||"object"!==(0,s.default)(n)||(r=n,n=null),new Promise((function(o,s){if(!i.ready)return s(new Error("socket not ready"));var a=i.generate_request_id(t,e),c={jsonrpc:"2.0",method:t,params:e||null,id:a};i.socket.send(JSON.stringify(c),r,(function(t){if(t)return s(t);i.queue[a]={promise:[o,s]},n&&(i.queue[a].timeout=setTimeout((function(){delete i.queue[a],s(new Error("reply timeout"))}),n))}))}))}},{key:"login",value:(l=(0,o.default)(i.default.mark((function t(e){var n;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.call("rpc.login",e);case 2:if(n=t.sent){t.next=5;break}throw new Error("authentication failed");case 5:return t.abrupt("return",n);case 6:case"end":return t.stop()}}),t,this)}))),function(t){return l.apply(this,arguments)})},{key:"listMethods",value:(r=(0,o.default)(i.default.mark((function t(){return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.call("__listMethods");case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"notify",value:function(t,e){var n=this;return new Promise((function(r,i){if(!n.ready)return i(new Error("socket not ready"));var o={jsonrpc:"2.0",method:t,params:e||null};n.socket.send(JSON.stringify(o),(function(t){if(t)return i(t);r()}))}))}},{key:"subscribe",value:(n=(0,o.default)(i.default.mark((function t(e){var n;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return"string"==typeof e&&(e=[e]),t.next=3,this.call("rpc.on",e);case 3:if(n=t.sent,"string"!=typeof e||"ok"===n[e]){t.next=6;break}throw new Error("Failed subscribing to an event '"+e+"' with: "+n[e]);case 6:return t.abrupt("return",n);case 7:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"unsubscribe",value:(e=(0,o.default)(i.default.mark((function t(e){var n;return i.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return"string"==typeof e&&(e=[e]),t.next=3,this.call("rpc.off",e);case 3:if(n=t.sent,"string"!=typeof e||"ok"===n[e]){t.next=6;break}throw new Error("Failed unsubscribing from an event with: "+n);case 6:return t.abrupt("return",n);case 7:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"close",value:function(t,e){this.socket.close(t||1e3,e)}},{key:"_connect",value:function(t,e){var n=this;this.socket=this.webSocketFactory(t,e),this.socket.addEventListener("open",(function(){n.ready=!0,n.emit("open"),n.current_reconnects=0})),this.socket.addEventListener("message",(function(t){var e=t.data;e instanceof ArrayBuffer&&(e=Buffer.from(e).toString());try{e=JSON.parse(e)}catch(o){return}if(e.notification&&n.listeners(e.notification).length){if(!Object.keys(e.params).length)return n.emit(e.notification);var r=[e.notification];if(e.params.constructor===Object)r.push(e.params);else for(var i=0;i<e.params.length;i++)r.push(e.params[i]);return Promise.resolve().then((function(){n.emit.apply(n,r)}))}if(!n.queue[e.id])return e.method&&e.params?Promise.resolve().then((function(){n.emit(e.method,e.params)})):void 0;"error"in e=="result"in e&&n.queue[e.id].promise[1](new Error('Server response malformed. Response must include either "result" or "error", but not both.')),n.queue[e.id].timeout&&clearTimeout(n.queue[e.id].timeout),e.error?n.queue[e.id].promise[1](e.error):n.queue[e.id].promise[0](e.result),delete n.queue[e.id]})),this.socket.addEventListener("error",(function(t){return n.emit("error",t)})),this.socket.addEventListener("close",(function(r){var i=r.code,o=r.reason;n.ready&&setTimeout((function(){return n.emit("close",i,o)}),0),n.ready=!1,n.socket=void 0,1e3!==i&&(n.current_reconnects++,n.reconnect&&(n.max_reconnects>n.current_reconnects||0===n.max_reconnects)&&setTimeout((function(){return n._connect(t,e)}),n.reconnect_interval))}))}}]),h}(h.EventEmitter);e.default=y},380:(t,e,n)=>{"use strict";var r=n(71600);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return new l(t,e)};var i=r(n(53100)),o=r(n(98870)),s=r(n(68230)),a=r(n(60421)),c=r(n(1147));function u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=(0,c.default)(t);if(e){var i=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,a.default)(this,n)}}var l=function(t){(0,s.default)(n,t);var e=u(n);function n(t,r,o){var s;return(0,i.default)(this,n),(s=e.call(this)).socket=new window.WebSocket(t,o),s.socket.onopen=function(){return s.emit("open")},s.socket.onmessage=function(t){return s.emit("message",t.data)},s.socket.onerror=function(t){return s.emit("error",t)},s.socket.onclose=function(t){s.emit("close",t.code,t.reason)},s}return(0,o.default)(n,[{key:"send",value:function(t,e,n){var r=n||e;try{this.socket.send(t),r()}catch(i){r(i)}}},{key:"close",value:function(t,e){this.socket.close(t,e)}},{key:"addEventListener",value:function(t,e,n){this.socket.addEventListener(t,e,n)}}]),n}(n(10161).EventEmitter)},77834:(t,e,n)=>{var r=n(48834),i=r.Buffer;function o(t,e){for(var n in t)e[n]=t[n]}function s(t,e,n){return i(t,e,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(o(r,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,n)},s.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=i(t);return void 0!==e?"string"==typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},5163:(t,e,n)=>{"use strict";n.r(e),n.d(e,{__assign:()=>o,__asyncDelegator:()=>v,__asyncGenerator:()=>k,__asyncValues:()=>I,__await:()=>w,__awaiter:()=>l,__classPrivateFieldGet:()=>T,__classPrivateFieldIn:()=>P,__classPrivateFieldSet:()=>x,__createBinding:()=>h,__decorate:()=>a,__exportStar:()=>f,__extends:()=>i,__generator:()=>d,__importDefault:()=>E,__importStar:()=>S,__makeTemplateObject:()=>A,__metadata:()=>u,__param:()=>c,__read:()=>y,__rest:()=>s,__spread:()=>g,__spreadArray:()=>b,__spreadArrays:()=>m,__values:()=>p});var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},o.apply(this,arguments)};function s(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function a(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}function c(t,e){return function(n,r){e(n,r,t)}}function u(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))}function d(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(a){o=[6,a],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}var h=Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]};function f(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||h(e,t,n)}function p(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function g(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(y(arguments[e]));return t}function m(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}function b(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function w(t){return this instanceof w?(this.v=t,this):new w(t)}function k(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||a(t,e)}))})}function a(t,e){try{(n=i[t](e)).value instanceof w?Promise.resolve(n.value.v).then(c,u):l(o[0][2],n)}catch(r){l(o[0][3],r)}var n}function c(t){a("next",t)}function u(t){a("throw",t)}function l(t,e){t(e),o.shift(),o.length&&a(o[0][0],o[0][1])}}function v(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:w(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function I(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=p(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}function A(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var _=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function S(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&h(e,t,n);return _(e,t),e}function E(t){return t&&t.__esModule?t:{default:t}}function T(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function x(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}function P(t,e){if(null===e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}},10082:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},54895:(t,e,n)=>{"use strict";var r=n(52635),i=n(43138),o=n(32094),s=n(50198);function a(t){return t.call.bind(t)}var c="undefined"!=typeof BigInt,u="undefined"!=typeof Symbol,l=a(Object.prototype.toString),d=a(Number.prototype.valueOf),h=a(String.prototype.valueOf),f=a(Boolean.prototype.valueOf);if(c)var p=a(BigInt.prototype.valueOf);if(u)var y=a(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(n){return!1}}function m(t){return"[object Map]"===l(t)}function b(t){return"[object Set]"===l(t)}function w(t){return"[object WeakMap]"===l(t)}function k(t){return"[object WeakSet]"===l(t)}function v(t){return"[object ArrayBuffer]"===l(t)}function I(t){return"undefined"!=typeof ArrayBuffer&&(v.working?v(t):t instanceof ArrayBuffer)}function A(t){return"[object DataView]"===l(t)}function _(t){return"undefined"!=typeof DataView&&(A.working?A(t):t instanceof DataView)}e.isArgumentsObject=r,e.isGeneratorFunction=i,e.isTypedArray=s,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):s(t)||_(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},m.working="undefined"!=typeof Map&&m(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(m.working?m(t):t instanceof Map)},b.working="undefined"!=typeof Set&&b(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(b.working?b(t):t instanceof Set)},w.working="undefined"!=typeof WeakMap&&w(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(w.working?w(t):t instanceof WeakMap)},k.working="undefined"!=typeof WeakSet&&k(new WeakSet),e.isWeakSet=function(t){return k(t)},v.working="undefined"!=typeof ArrayBuffer&&v(new ArrayBuffer),e.isArrayBuffer=I,A.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&A(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=_;var S="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function E(t){return"[object SharedArrayBuffer]"===l(t)}function T(t){return void 0!==S&&(void 0===E.working&&(E.working=E(new S)),E.working?E(t):t instanceof S)}function x(t){return g(t,d)}function P(t){return g(t,h)}function B(t){return g(t,f)}function O(t){return c&&g(t,p)}function R(t){return u&&g(t,y)}e.isSharedArrayBuffer=T,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===l(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===l(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===l(t)},e.isGeneratorObject=function(t){return"[object Generator]"===l(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===l(t)},e.isNumberObject=x,e.isStringObject=P,e.isBooleanObject=B,e.isBigIntObject=O,e.isSymbolObject=R,e.isBoxedPrimitive=function(t){return x(t)||P(t)||B(t)||O(t)||R(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(I(t)||T(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},43335:(t,e,n)=>{var r=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),n={},r=0;r<e.length;r++)n[e[r]]=Object.getOwnPropertyDescriptor(t,e[r]);return n},i=/%[sdj%]/g;e.format=function(t){if(!b(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(c(arguments[n]));return e.join(" ")}n=1;for(var r=arguments,o=r.length,s=String(t).replace(i,(function(t){if("%%"===t)return"%";if(n>=o)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return t}})),a=r[n];n<o;a=r[++n])g(a)||!v(a)?s+=" "+a:s+=" "+c(a);return s},e.deprecate=function(t,n){if("undefined"!=typeof process&&!0===process.noDeprecation)return t;if("undefined"==typeof process)return function(){return e.deprecate(t,n).apply(this,arguments)};var r=!1;return function(){if(!r){if(process.throwDeprecation)throw new Error(n);process.traceDeprecation?console.trace(n):console.error(n),r=!0}return t.apply(this,arguments)}};var o={},s=/^$/;if({NODE_ENV:"production",NX_CLI_SET:"true",NX_INVOKED_BY_RUNNER:"true",NX_WORKSPACE_ROOT:"/Users/beeman/kin/kin-labs/kinetic-cdn",NX_TERMINAL_OUTPUT_PATH:"/Users/beeman/kin/kin-labs/kinetic-cdn/node_modules/.cache/nx/terminalOutputs/77fbd5c7acaf697826deeab548bcd3e3a2d826cb067dbc0737e0c7c1639efc36",NX_STREAM_OUTPUT:"true",NX_TASK_TARGET_PROJECT:"demo",NX_TASK_HASH:"77fbd5c7acaf697826deeab548bcd3e3a2d826cb067dbc0737e0c7c1639efc36"}.NODE_DEBUG){var a={NODE_ENV:"production",NX_CLI_SET:"true",NX_INVOKED_BY_RUNNER:"true",NX_WORKSPACE_ROOT:"/Users/beeman/kin/kin-labs/kinetic-cdn",NX_TERMINAL_OUTPUT_PATH:"/Users/beeman/kin/kin-labs/kinetic-cdn/node_modules/.cache/nx/terminalOutputs/77fbd5c7acaf697826deeab548bcd3e3a2d826cb067dbc0737e0c7c1639efc36",NX_STREAM_OUTPUT:"true",NX_TASK_TARGET_PROJECT:"demo",NX_TASK_HASH:"77fbd5c7acaf697826deeab548bcd3e3a2d826cb067dbc0737e0c7c1639efc36"}.NODE_DEBUG;a=a.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+a+"$","i")}function c(t,n){var r={seen:[],stylize:l};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),y(n)?r.showHidden=n:n&&e._extend(r,n),w(r.showHidden)&&(r.showHidden=!1),w(r.depth)&&(r.depth=2),w(r.colors)&&(r.colors=!1),w(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),d(r,t,r.depth)}function u(t,e){var n=c.styles[e];return n?"\x1b["+c.colors[n][0]+"m"+t+"\x1b["+c.colors[n][1]+"m":t}function l(t,e){return t}function d(t,n,r){if(t.customInspect&&n&&_(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,t);return b(i)||(i=d(t,i,r)),i}var o=function(t,e){if(w(e))return t.stylize("undefined","undefined");if(b(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}if(m(e))return t.stylize(""+e,"number");if(y(e))return t.stylize(""+e,"boolean");if(g(e))return t.stylize("null","null")}(t,n);if(o)return o;var s=Object.keys(n),a=function(t){var e={};return t.forEach((function(t,n){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(n)),A(n)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return h(n);if(0===s.length){if(_(n)){var c=n.name?": "+n.name:"";return t.stylize("[Function"+c+"]","special")}if(k(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(I(n))return t.stylize(Date.prototype.toString.call(n),"date");if(A(n))return h(n)}var u,l="",v=!1,S=["{","}"];(p(n)&&(v=!0,S=["[","]"]),_(n))&&(l=" [Function"+(n.name?": "+n.name:"")+"]");return k(n)&&(l=" "+RegExp.prototype.toString.call(n)),I(n)&&(l=" "+Date.prototype.toUTCString.call(n)),A(n)&&(l=" "+h(n)),0!==s.length||v&&0!=n.length?r<0?k(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special"):(t.seen.push(n),u=v?function(t,e,n,r,i){for(var o=[],s=0,a=e.length;s<a;++s)P(e,String(s))?o.push(f(t,e,n,r,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(f(t,e,n,r,i,!0))})),o}(t,n,r,a,s):s.map((function(e){return f(t,n,r,a,e,v)})),t.seen.pop(),function(t,e,n){if(t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1];return n[0]+e+" "+t.join(", ")+" "+n[1]}(u,l,S)):S[0]+l+S[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,n,r,i,o){var s,a,c;if((c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(a=t.stylize("[Setter]","special")),P(r,i)||(s="["+i+"]"),a||(t.seen.indexOf(c.value)<0?(a=g(n)?d(t,c.value,null):d(t,c.value,n-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function p(t){return Array.isArray(t)}function y(t){return"boolean"==typeof t}function g(t){return null===t}function m(t){return"number"==typeof t}function b(t){return"string"==typeof t}function w(t){return void 0===t}function k(t){return v(t)&&"[object RegExp]"===S(t)}function v(t){return"object"==typeof t&&null!==t}function I(t){return v(t)&&"[object Date]"===S(t)}function A(t){return v(t)&&("[object Error]"===S(t)||t instanceof Error)}function _(t){return"function"==typeof t}function S(t){return Object.prototype.toString.call(t)}function E(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!o[t])if(s.test(t)){var n=process.pid;o[t]=function(){var r=e.format.apply(e,arguments);console.error("%s %d: %s",t,n,r)}}else o[t]=function(){};return o[t]},e.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=n(54895),e.isArray=p,e.isBoolean=y,e.isNull=g,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=b,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=w,e.isRegExp=k,e.types.isRegExp=k,e.isObject=v,e.isDate=I,e.types.isDate=I,e.isError=A,e.types.isNativeError=A,e.isFunction=_,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=n(10082);var T=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function x(){var t=new Date,e=[E(t.getHours()),E(t.getMinutes()),E(t.getSeconds())].join(":");return[t.getDate(),T[t.getMonth()],e].join(" ")}function P(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",x(),e.format.apply(e,arguments))},e.inherits=n(91285),e._extend=function(t,e){if(!e||!v(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t};var B="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(t,e){if(!t){var n=new Error("Promise was rejected with a falsy value");n.reason=t,t=n}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(B&&t[B]){var e;if("function"!=typeof(e=t[B]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,B,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,n,r=new Promise((function(t,r){e=t,n=r})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(t,r){t?n(t):e(r)}));try{t.apply(this,i)}catch(s){n(s)}return r}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),B&&Object.defineProperty(e,B,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,r(t))},e.promisify.custom=B,e.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function e(){for(var e=[],n=0;n<arguments.length;n++)e.push(arguments[n]);var r=e.pop();if("function"!=typeof r)throw new TypeError("The last argument must be of type Function");var i=this,o=function(){return r.apply(i,arguments)};t.apply(this,e).then((function(t){process.nextTick(o.bind(null,null,t))}),(function(t){process.nextTick(O.bind(null,t,o))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,r(t)),e}},55029:(t,e,n)=>{"use strict";var r;n.d(e,{v4:()=>d});var i=new Uint8Array(16);function o(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}const s=/^(?:[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;const a=function(t){return"string"==typeof t&&s.test(t)};for(var c=[],u=0;u<256;++u)c.push((u+256).toString(16).substr(1));const l=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(c[t[e+0]]+c[t[e+1]]+c[t[e+2]]+c[t[e+3]]+"-"+c[t[e+4]]+c[t[e+5]]+"-"+c[t[e+6]]+c[t[e+7]]+"-"+c[t[e+8]]+c[t[e+9]]+"-"+c[t[e+10]]+c[t[e+11]]+c[t[e+12]]+c[t[e+13]]+c[t[e+14]]+c[t[e+15]]).toLowerCase();if(!a(n))throw TypeError("Stringified UUID is invalid");return n};const d=function(t,e,n){var r=(t=t||{}).random||(t.rng||o)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(var i=0;i<16;++i)e[n+i]=r[i];return e}return l(r)}},32094:(t,e,n)=>{"use strict";var r=n(83243),i=n(62191),o=n(62680),s=o("Object.prototype.toString"),a=n(67226)(),c="undefined"==typeof globalThis?global:globalThis,u=i(),l=o("String.prototype.slice"),d={},h=n(29765),f=Object.getPrototypeOf;a&&h&&f&&r(u,(function(t){if("function"==typeof c[t]){var e=new c[t];if(Symbol.toStringTag in e){var n=f(e),r=h(n,Symbol.toStringTag);if(!r){var i=f(n);r=h(i,Symbol.toStringTag)}d[t]=r.get}}}));var p=n(50198);t.exports=function(t){return!!p(t)&&(a&&Symbol.toStringTag in t?function(t){var e=!1;return r(d,(function(n,r){if(!e)try{var i=n.call(t);i===r&&(e=i)}catch(o){}})),e}(t):l(s(t),8,-1))}},77378:()=>{},10868:()=>{},69314:()=>{},33196:()=>{},85297:t=>{t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports},91461:t=>{function e(t,e,n,r,i,o,s){try{var a=t[o](s),c=a.value}catch(u){return void n(u)}a.done?e(c):Promise.resolve(c).then(r,i)}t.exports=function(t){return function(){var n=this,r=arguments;return new Promise((function(i,o){var s=t.apply(n,r);function a(t){e(s,i,o,a,c,"next",t)}function c(t){e(s,i,o,a,c,"throw",t)}a(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},53100:t=>{t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},98870:t=>{function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},1147:t=>{function e(n){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},68230:(t,e,n)=>{var r=n(78560);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&r(t,e)},t.exports.__esModule=!0,t.exports.default=t.exports},71600:t=>{t.exports=function(t){return t&&t.__esModule?t:{default:t}},t.exports.__esModule=!0,t.exports.default=t.exports},60421:(t,e,n)=>{var r=n(67425).default,i=n(85297);t.exports=function(t,e){if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return i(t)},t.exports.__esModule=!0,t.exports.default=t.exports},27609:(t,e,n)=>{var r=n(67425).default;function i(){"use strict";t.exports=i=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},n=Object.prototype,o=n.hasOwnProperty,s="function"==typeof Symbol?Symbol:{},a=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(P){l=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var i=e&&e.prototype instanceof p?e:p,o=Object.create(i.prototype),s=new E(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return x()}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var a=A(s,n);if(a){if(a===f)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=h(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(t,n,s),o}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(P){return{type:"throw",arg:P}}}e.wrap=d;var f={};function p(){}function y(){}function g(){}var m={};l(m,a,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(T([])));w&&w!==n&&o.call(w,a)&&(m=w);var k=g.prototype=p.prototype=Object.create(m);function v(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function I(t,e){function n(i,s,a,c){var u=h(t[i],t,s);if("throw"!==u.type){var l=u.arg,d=l.value;return d&&"object"==r(d)&&o.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(d).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var i;this._invoke=function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}}function A(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,A(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=h(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,f;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function T(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(o.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:x}}function x(){return{value:void 0,done:!0}}return y.prototype=g,l(k,"constructor",g),l(g,"constructor",y),y.displayName=l(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},v(I.prototype),l(I.prototype,c,(function(){return this})),e.AsyncIterator=I,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var s=new I(d(t,n,r,i),o);return e.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},v(k),l(k,u,"Generator"),l(k,a,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=T,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return s.type="throw",s.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=o.call(i,"catchLoc"),c=o.call(i,"finallyLoc");if(a&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:T(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},78560:t=>{function e(n,r){return t.exports=e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n,r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},67425:t=>{function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},82841:(t,e,n)=>{var r=n(27609)();t.exports=r;try{regeneratorRuntime=r}catch(i){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},80883:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.encodeDecode=void 0;e.encodeDecode=t=>({decode:t.decode.bind(t),encode:t.encode.bind(t)})},58287:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.u256be=e.u256=e.u192be=e.u192=e.u128be=e.u128=e.u64be=e.u64=e.bigIntBE=e.bigInt=void 0;const r=n(96346),i=n(41528),o=n(80883);e.bigInt=t=>e=>{const n=(0,r.blob)(t,e),{encode:s,decode:a}=(0,o.encodeDecode)(n),c=n;return c.decode=(t,e)=>{const n=a(t,e);return(0,i.toBigIntLE)(Buffer.from(n))},c.encode=(e,n,r)=>{const o=(0,i.toBufferLE)(e,t);return s(o,n,r)},c};e.bigIntBE=t=>e=>{const n=(0,r.blob)(t,e),{encode:s,decode:a}=(0,o.encodeDecode)(n),c=n;return c.decode=(t,e)=>{const n=a(t,e);return(0,i.toBigIntBE)(Buffer.from(n))},c.encode=(e,n,r)=>{const o=(0,i.toBufferBE)(e,t);return s(o,n,r)},c},e.u64=(0,e.bigInt)(8),e.u64be=(0,e.bigIntBE)(8),e.u128=(0,e.bigInt)(16),e.u128be=(0,e.bigIntBE)(16),e.u192=(0,e.bigInt)(24),e.u192be=(0,e.bigIntBE)(24),e.u256=(0,e.bigInt)(32),e.u256be=(0,e.bigIntBE)(32)},25281:function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.decimal=e.WAD=void 0;const i=r(n(93560)),o=n(80883),s=n(58287);e.WAD=new i.default("1e+18");e.decimal=t=>{const n=(0,s.u128)(t),{encode:r,decode:a}=(0,o.encodeDecode)(n),c=n;return c.decode=(t,n)=>{const r=a(t,n).toString();return new i.default(r).div(e.WAD)},c.encode=(t,n,i)=>{const o=BigInt(t.times(e.WAD).integerValue().toString());return r(o,n,i)},c}},28813:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(80883),e),i(n(58287),e),i(n(25281),e),i(n(4622),e),i(n(86254),e)},4622:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bool=void 0;const r=n(96346),i=n(80883);e.bool=t=>{const e=(0,r.u8)(t),{encode:n,decode:o}=(0,i.encodeDecode)(e),s=e;return s.decode=(t,e)=>!!o(t,e),s.encode=(t,e,r)=>{const i=Number(t);return n(i,e,r)},s}},86254:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.publicKey=void 0;const r=n(96346),i=n(70841),o=n(80883);e.publicKey=t=>{const e=(0,r.blob)(32,t),{encode:n,decode:s}=(0,o.encodeDecode)(e),a=e;return a.decode=(t,e)=>{const n=s(t,e);return new i.PublicKey(n)},a.encode=(t,e,r)=>{const i=t.toBuffer();return n(i,e,r)},a}},36563:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.amountToUiAmount=void 0;const i=n(27158),o=n(8075),s=n(78641);e.amountToUiAmount=function(t,e,n,a,c=o.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const r=(new i.Transaction).add((0,s.createAmountToUiAmountInstruction)(n,a,c)),{returnData:o,err:u}=(yield t.simulateTransaction(r,[e],!1)).value;return(null==o?void 0:o.data)?Buffer.from(o.data[0],o.data[1]).toString("utf-8"):u}))}},14608:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.approve=void 0;const i=n(27158),o=n(8075),s=n(68728),a=n(47813);e.approve=function(t,e,n,c,u,l,d=[],h,f=o.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const[r,o]=(0,a.getSigners)(u,d),p=(new i.Transaction).add((0,s.createApproveInstruction)(n,c,r,l,d,f));return yield(0,i.sendAndConfirmTransaction)(t,p,[e,...o],h)}))}},79970:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.approveChecked=void 0;const i=n(27158),o=n(8075),s=n(13878),a=n(47813);e.approveChecked=function(t,e,n,c,u,l,d,h,f=[],p,y=o.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const[r,o]=(0,a.getSigners)(l,f),g=(new i.Transaction).add((0,s.createApproveCheckedInstruction)(c,n,u,r,d,h,f,y));return yield(0,i.sendAndConfirmTransaction)(t,g,[e,...o],p)}))}},64616:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.burn=void 0;const i=n(27158),o=n(8075),s=n(82900),a=n(47813);e.burn=function(t,e,n,c,u,l,d=[],h,f=o.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const[r,o]=(0,a.getSigners)(u,d),p=(new i.Transaction).add((0,s.createBurnInstruction)(n,c,r,l,d,f));return yield(0,i.sendAndConfirmTransaction)(t,p,[e,...o],h)}))}},4642:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.burnChecked=void 0;const i=n(27158),o=n(8075),s=n(52432),a=n(47813);e.burnChecked=function(t,e,n,c,u,l,d,h=[],f,p=o.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const[r,o]=(0,a.getSigners)(u,h),y=(new i.Transaction).add((0,s.createBurnCheckedInstruction)(n,c,r,l,d,h,p));return yield(0,i.sendAndConfirmTransaction)(t,y,[e,...o],f)}))}},38344:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.closeAccount=void 0;const i=n(27158),o=n(8075),s=n(15725),a=n(47813);e.closeAccount=function(t,e,n,c,u,l=[],d,h=o.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const[r,o]=(0,a.getSigners)(u,l),f=(new i.Transaction).add((0,s.createCloseAccountInstruction)(n,c,r,l,h));return yield(0,i.sendAndConfirmTransaction)(t,f,[e,...o],d)}))}},57746:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.createAccount=void 0;const i=n(27158),o=n(8075),s=n(53907),a=n(91358),c=n(41022),u=n(81705);e.createAccount=function(t,e,n,l,d,h,f=o.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){if(!d)return yield(0,u.createAssociatedTokenAccount)(t,e,n,l,h,f);const r=yield(0,c.getMint)(t,n,null==h?void 0:h.commitment,f),o=(0,s.getAccountLenForMint)(r),p=yield t.getMinimumBalanceForRentExemption(o),y=(new i.Transaction).add(i.SystemProgram.createAccount({fromPubkey:e.publicKey,newAccountPubkey:d.publicKey,space:o,lamports:p,programId:f}),(0,a.createInitializeAccountInstruction)(d.publicKey,n,l,f));return yield(0,i.sendAndConfirmTransaction)(t,y,[e,d],h),d.publicKey}))}},81705:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.createAssociatedTokenAccount=void 0;const i=n(27158),o=n(8075),s=n(34684),a=n(41022);e.createAssociatedTokenAccount=function(t,e,n,c,u,l=o.TOKEN_PROGRAM_ID,d=o.ASSOCIATED_TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const r=yield(0,a.getAssociatedTokenAddress)(n,c,!1,l,d),o=(new i.Transaction).add((0,s.createAssociatedTokenAccountInstruction)(e.publicKey,r,c,n,l,d));return yield(0,i.sendAndConfirmTransaction)(t,o,[e],u),r}))}},84184:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.createAssociatedTokenAccountIdempotent=void 0;const i=n(27158),o=n(8075),s=n(34684),a=n(41022);e.createAssociatedTokenAccountIdempotent=function(t,e,n,c,u,l=o.TOKEN_PROGRAM_ID,d=o.ASSOCIATED_TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const r=yield(0,a.getAssociatedTokenAddress)(n,c,!1,l,d),o=(new i.Transaction).add((0,s.createAssociatedTokenAccountIdempotentInstruction)(e.publicKey,r,c,n,l,d));return yield(0,i.sendAndConfirmTransaction)(t,o,[e],u),r}))}},19953:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.createMint=void 0;const i=n(27158),o=n(8075),s=n(38631),a=n(41022);e.createMint=function(t,e,n,c,u,l=i.Keypair.generate(),d,h=o.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const r=yield(0,a.getMinimumBalanceForRentExemptMint)(t),o=(new i.Transaction).add(i.SystemProgram.createAccount({fromPubkey:e.publicKey,newAccountPubkey:l.publicKey,space:a.MINT_SIZE,lamports:r,programId:h}),(0,s.createInitializeMint2Instruction)(l.publicKey,u,n,c,h));return yield(0,i.sendAndConfirmTransaction)(t,o,[e,l],d),l.publicKey}))}},13972:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.createMultisig=void 0;const i=n(27158),o=n(8075),s=n(46433),a=n(74610);e.createMultisig=function(t,e,n,c,u=i.Keypair.generate(),l,d=o.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const r=yield(0,a.getMinimumBalanceForRentExemptMultisig)(t),o=(new i.Transaction).add(i.SystemProgram.createAccount({fromPubkey:e.publicKey,newAccountPubkey:u.publicKey,space:a.MULTISIG_SIZE,lamports:r,programId:d}),(0,s.createInitializeMultisigInstruction)(u.publicKey,n,c,d));return yield(0,i.sendAndConfirmTransaction)(t,o,[e,u],l),u.publicKey}))}},4361:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.createNativeMint=void 0;const i=n(27158),o=n(8075),s=n(78719);e.createNativeMint=function(t,e,n,a=o.NATIVE_MINT_2022,c=o.TOKEN_2022_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const r=(new i.Transaction).add((0,s.createCreateNativeMintInstruction)(e.publicKey,a,c));yield(0,i.sendAndConfirmTransaction)(t,r,[e],n)}))}},2929:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.createWrappedNativeAccount=void 0;const i=n(27158),o=n(8075),s=n(34684),a=n(91358),c=n(20096),u=n(77014),l=n(41022),d=n(57746);e.createWrappedNativeAccount=function(t,e,n,h,f,p,y=o.TOKEN_PROGRAM_ID,g=o.NATIVE_MINT){return r(this,void 0,void 0,(function*(){if(!h)return yield(0,d.createAccount)(t,e,g,n,f,p,y);if(!f){const r=yield(0,l.getAssociatedTokenAddress)(g,n,!1,y,o.ASSOCIATED_TOKEN_PROGRAM_ID),a=(new i.Transaction).add((0,s.createAssociatedTokenAccountInstruction)(e.publicKey,r,n,g,y,o.ASSOCIATED_TOKEN_PROGRAM_ID),i.SystemProgram.transfer({fromPubkey:e.publicKey,toPubkey:r,lamports:h}),(0,c.createSyncNativeInstruction)(r,y));return yield(0,i.sendAndConfirmTransaction)(t,a,[e],p),r}const r=yield(0,u.getMinimumBalanceForRentExemptAccount)(t),m=(new i.Transaction).add(i.SystemProgram.createAccount({fromPubkey:e.publicKey,newAccountPubkey:f.publicKey,space:u.ACCOUNT_SIZE,lamports:r,programId:y}),i.SystemProgram.transfer({fromPubkey:e.publicKey,toPubkey:f.publicKey,lamports:h}),(0,a.createInitializeAccountInstruction)(f.publicKey,g,n,y));return yield(0,i.sendAndConfirmTransaction)(t,m,[e,f],p),f.publicKey}))}},32562:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.freezeAccount=void 0;const i=n(27158),o=n(8075),s=n(39670),a=n(47813);e.freezeAccount=function(t,e,n,c,u,l=[],d,h=o.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const[r,o]=(0,a.getSigners)(u,l),f=(new i.Transaction).add((0,s.createFreezeAccountInstruction)(n,c,r,l,h));return yield(0,i.sendAndConfirmTransaction)(t,f,[e,...o],d)}))}},18743:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.getOrCreateAssociatedTokenAccount=void 0;const i=n(27158),o=n(8075),s=n(35434),a=n(34684),c=n(77014),u=n(41022);e.getOrCreateAssociatedTokenAccount=function(t,e,n,l,d=!1,h,f,p=o.TOKEN_PROGRAM_ID,y=o.ASSOCIATED_TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const r=yield(0,u.getAssociatedTokenAddress)(n,l,d,p,y);let o;try{o=yield(0,c.getAccount)(t,r,h,p)}catch(g){if(!(g instanceof s.TokenAccountNotFoundError||g instanceof s.TokenInvalidAccountOwnerError))throw g;try{const o=(new i.Transaction).add((0,a.createAssociatedTokenAccountInstruction)(e.publicKey,r,l,n,p,y));yield(0,i.sendAndConfirmTransaction)(t,o,[e],f)}catch(g){}o=yield(0,c.getAccount)(t,r,h,p)}if(!o.mint.equals(n))throw new s.TokenInvalidMintError;if(!o.owner.equals(l))throw new s.TokenInvalidOwnerError;return o}))}},67621:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(36563),e),i(n(14608),e),i(n(79970),e),i(n(64616),e),i(n(4642),e),i(n(38344),e),i(n(57746),e),i(n(81705),e),i(n(84184),e),i(n(19953),e),i(n(13972),e),i(n(4361),e),i(n(2929),e),i(n(32562),e),i(n(18743),e),i(n(26787),e),i(n(44934),e),i(n(43117),e),i(n(49506),e),i(n(8813),e),i(n(8156),e),i(n(79036),e),i(n(93553),e),i(n(44109),e)},47813:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getSigners=void 0;const r=n(27158);e.getSigners=function(t,e){return t instanceof r.PublicKey?[t,e]:[t.publicKey,[t]]}},26787:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.mintTo=void 0;const i=n(27158),o=n(8075),s=n(36514),a=n(47813);e.mintTo=function(t,e,n,c,u,l,d=[],h,f=o.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const[r,o]=(0,a.getSigners)(u,d),p=(new i.Transaction).add((0,s.createMintToInstruction)(n,c,r,l,d,f));return yield(0,i.sendAndConfirmTransaction)(t,p,[e,...o],h)}))}},44934:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.mintToChecked=void 0;const i=n(27158),o=n(8075),s=n(11702),a=n(47813);e.mintToChecked=function(t,e,n,c,u,l,d,h=[],f,p=o.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const[r,o]=(0,a.getSigners)(u,h),y=(new i.Transaction).add((0,s.createMintToCheckedInstruction)(n,c,r,l,d,h,p));return yield(0,i.sendAndConfirmTransaction)(t,y,[e,...o],f)}))}},43117:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.revoke=void 0;const i=n(27158),o=n(8075),s=n(26248),a=n(47813);e.revoke=function(t,e,n,c,u=[],l,d=o.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const[r,o]=(0,a.getSigners)(c,u),h=(new i.Transaction).add((0,s.createRevokeInstruction)(n,r,u,d));return yield(0,i.sendAndConfirmTransaction)(t,h,[e,...o],l)}))}},49506:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.setAuthority=void 0;const i=n(27158),o=n(8075),s=n(13249),a=n(47813);e.setAuthority=function(t,e,n,c,u,l,d=[],h,f=o.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const[r,o]=(0,a.getSigners)(c,d),p=(new i.Transaction).add((0,s.createSetAuthorityInstruction)(n,r,u,l,d,f));return yield(0,i.sendAndConfirmTransaction)(t,p,[e,...o],h)}))}},8813:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.syncNative=void 0;const i=n(27158),o=n(8075),s=n(20096);e.syncNative=function(t,e,n,a,c=o.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const r=(new i.Transaction).add((0,s.createSyncNativeInstruction)(n,c));return yield(0,i.sendAndConfirmTransaction)(t,r,[e],a)}))}},8156:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.thawAccount=void 0;const i=n(27158),o=n(8075),s=n(7765),a=n(47813);e.thawAccount=function(t,e,n,c,u,l=[],d,h=o.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const[r,o]=(0,a.getSigners)(u,l),f=(new i.Transaction).add((0,s.createThawAccountInstruction)(n,c,r,l,h));return yield(0,i.sendAndConfirmTransaction)(t,f,[e,...o],d)}))}},79036:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.transfer=void 0;const i=n(27158),o=n(8075),s=n(22990),a=n(47813);e.transfer=function(t,e,n,c,u,l,d=[],h,f=o.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const[r,o]=(0,a.getSigners)(u,d),p=(new i.Transaction).add((0,s.createTransferInstruction)(n,c,r,l,d,f));return yield(0,i.sendAndConfirmTransaction)(t,p,[e,...o],h)}))}},93553:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.transferChecked=void 0;const i=n(27158),o=n(8075),s=n(67997),a=n(47813);e.transferChecked=function(t,e,n,c,u,l,d,h,f=[],p,y=o.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const[r,o]=(0,a.getSigners)(l,f),g=(new i.Transaction).add((0,s.createTransferCheckedInstruction)(n,c,u,r,d,h,f,y));return yield(0,i.sendAndConfirmTransaction)(t,g,[e,...o],p)}))}},44109:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.uiAmountToAmount=void 0;const i=n(28813),o=n(27158),s=n(8075),a=n(27776);e.uiAmountToAmount=function(t,e,n,c,u=s.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const r=(new o.Transaction).add((0,a.createUiAmountToAmountInstruction)(n,c,u)),{returnData:s,err:l}=(yield t.simulateTransaction(r,[e],!1)).value;if(s){const t=Buffer.from(s.data[0],s.data[1]);return(0,i.u64)().decode(t)}return l}))}},8075:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.programSupportsExtensions=e.NATIVE_MINT_2022=e.NATIVE_MINT=e.ASSOCIATED_TOKEN_PROGRAM_ID=e.TOKEN_2022_PROGRAM_ID=e.TOKEN_PROGRAM_ID=void 0;const r=n(27158);e.TOKEN_PROGRAM_ID=new r.PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),e.TOKEN_2022_PROGRAM_ID=new r.PublicKey("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"),e.ASSOCIATED_TOKEN_PROGRAM_ID=new r.PublicKey("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"),e.NATIVE_MINT=new r.PublicKey("So11111111111111111111111111111111111111112"),e.NATIVE_MINT_2022=new r.PublicKey("9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP"),e.programSupportsExtensions=function(t){return t!==e.TOKEN_PROGRAM_ID}},35434:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TokenUnsupportedInstructionError=e.TokenInvalidInstructionTypeError=e.TokenInvalidInstructionDataError=e.TokenInvalidInstructionKeysError=e.TokenInvalidInstructionProgramError=e.TokenOwnerOffCurveError=e.TokenInvalidOwnerError=e.TokenInvalidMintError=e.TokenInvalidAccountSizeError=e.TokenInvalidAccountOwnerError=e.TokenInvalidAccountError=e.TokenAccountNotFoundError=e.TokenError=void 0;class n extends Error{constructor(t){super(t)}}e.TokenError=n;e.TokenAccountNotFoundError=class extends n{constructor(){super(...arguments),this.name="TokenAccountNotFoundError"}};e.TokenInvalidAccountError=class extends n{constructor(){super(...arguments),this.name="TokenInvalidAccountError"}};e.TokenInvalidAccountOwnerError=class extends n{constructor(){super(...arguments),this.name="TokenInvalidAccountOwnerError"}};e.TokenInvalidAccountSizeError=class extends n{constructor(){super(...arguments),this.name="TokenInvalidAccountSizeError"}};e.TokenInvalidMintError=class extends n{constructor(){super(...arguments),this.name="TokenInvalidMintError"}};e.TokenInvalidOwnerError=class extends n{constructor(){super(...arguments),this.name="TokenInvalidOwnerError"}};e.TokenOwnerOffCurveError=class extends n{constructor(){super(...arguments),this.name="TokenOwnerOffCurveError"}};e.TokenInvalidInstructionProgramError=class extends n{constructor(){super(...arguments),this.name="TokenInvalidInstructionProgramError"}};e.TokenInvalidInstructionKeysError=class extends n{constructor(){super(...arguments),this.name="TokenInvalidInstructionKeysError"}};e.TokenInvalidInstructionDataError=class extends n{constructor(){super(...arguments),this.name="TokenInvalidInstructionDataError"}};e.TokenInvalidInstructionTypeError=class extends n{constructor(){super(...arguments),this.name="TokenInvalidInstructionTypeError"}};e.TokenUnsupportedInstructionError=class extends n{constructor(){super(...arguments),this.name="TokenUnsupportedInstructionError"}}},6869:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ACCOUNT_TYPE_SIZE=e.AccountType=void 0,function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Mint=1]="Mint",t[t.Account=2]="Account"}(e.AccountType||(e.AccountType={})),e.ACCOUNT_TYPE_SIZE=1},15599:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.updateDefaultAccountState=e.initializeDefaultAccountState=void 0;const i=n(27158),o=n(47813),s=n(8075),a=n(32334);e.initializeDefaultAccountState=function(t,e,n,o,c,u=s.TOKEN_2022_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const r=(new i.Transaction).add((0,a.createInitializeDefaultAccountStateInstruction)(n,o,u));return yield(0,i.sendAndConfirmTransaction)(t,r,[e],c)}))},e.updateDefaultAccountState=function(t,e,n,c,u,l=[],d,h=s.TOKEN_2022_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const[r,s]=(0,o.getSigners)(u,l),f=(new i.Transaction).add((0,a.createUpdateDefaultAccountStateInstruction)(n,c,r,s,h));return yield(0,i.sendAndConfirmTransaction)(t,f,[e,...s],d)}))}},44641:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(15599),e),i(n(32334),e),i(n(34546),e)},32334:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createUpdateDefaultAccountStateInstruction=e.createInitializeDefaultAccountStateInstruction=e.defaultAccountStateInstructionData=e.DefaultAccountStateInstruction=void 0;const r=n(96346),i=n(27158),o=n(8075),s=n(35434),a=n(31886);var c;!function(t){t[t.Initialize=0]="Initialize",t[t.Update=1]="Update"}(c=e.DefaultAccountStateInstruction||(e.DefaultAccountStateInstruction={})),e.defaultAccountStateInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,r.u8)("defaultAccountStateInstruction"),(0,r.u8)("accountState")]),e.createInitializeDefaultAccountStateInstruction=function(t,n,r=o.TOKEN_2022_PROGRAM_ID){if(!(0,o.programSupportsExtensions)(r))throw new s.TokenUnsupportedInstructionError;const u=[{pubkey:t,isSigner:!1,isWritable:!0}],l=Buffer.alloc(e.defaultAccountStateInstructionData.span);return e.defaultAccountStateInstructionData.encode({instruction:a.TokenInstruction.DefaultAccountStateExtension,defaultAccountStateInstruction:c.Initialize,accountState:n},l),new i.TransactionInstruction({keys:u,programId:r,data:l})},e.createUpdateDefaultAccountStateInstruction=function(t,n,r,u=[],l=o.TOKEN_2022_PROGRAM_ID){if(!(0,o.programSupportsExtensions)(l))throw new s.TokenUnsupportedInstructionError;const d=[{pubkey:t,isSigner:!1,isWritable:!0}];d.push({pubkey:r,isSigner:!u.length,isWritable:!1});for(const e of u)d.push({pubkey:e.publicKey,isSigner:!0,isWritable:!1});const h=Buffer.alloc(e.defaultAccountStateInstructionData.span);return e.defaultAccountStateInstructionData.encode({instruction:a.TokenInstruction.DefaultAccountStateExtension,defaultAccountStateInstruction:c.Update,accountState:n},h),new i.TransactionInstruction({keys:d,programId:l,data:h})}},34546:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getDefaultAccountState=e.DEFAULT_ACCOUNT_STATE_SIZE=e.DefaultAccountStateLayout=void 0;const r=n(96346),i=n(53907);e.DefaultAccountStateLayout=(0,r.struct)([(0,r.u8)("state")]),e.DEFAULT_ACCOUNT_STATE_SIZE=e.DefaultAccountStateLayout.span,e.getDefaultAccountState=function(t){const n=(0,i.getExtensionData)(i.ExtensionType.DefaultAccountState,t.tlvData);return null!==n?e.DefaultAccountStateLayout.decode(n):null}},53907:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getAccountLenForMint=e.getExtensionTypes=e.getExtensionData=e.getAccountLen=e.getMintLen=e.getAccountTypeOfMintType=e.getTypeLen=e.LENGTH_SIZE=e.TYPE_SIZE=e.ExtensionType=void 0;const r=n(77014),i=n(41022),o=n(74610),s=n(6869),a=n(44641),c=n(37905),u=n(18520),l=n(90664),d=n(70460),h=n(60872),f=n(77032);var p;function y(t){switch(t){case p.Uninitialized:return 0;case p.TransferFeeConfig:return f.TRANSFER_FEE_CONFIG_SIZE;case p.TransferFeeAmount:return f.TRANSFER_FEE_AMOUNT_SIZE;case p.MintCloseAuthority:return d.MINT_CLOSE_AUTHORITY_SIZE;case p.ConfidentialTransferMint:return 97;case p.ConfidentialTransferAccount:return 286;case p.DefaultAccountState:return a.DEFAULT_ACCOUNT_STATE_SIZE;case p.ImmutableOwner:return c.IMMUTABLE_OWNER_SIZE;case p.MemoTransfer:return l.MEMO_TRANSFER_SIZE;case p.NonTransferable:return h.NON_TRANSFERABLE_SIZE;case p.InterestBearingMint:return u.INTEREST_BEARING_MINT_CONFIG_STATE_SIZE;default:throw Error(`Unknown extension type: ${t}`)}}function g(t){switch(t){case p.TransferFeeConfig:return p.TransferFeeAmount;case p.ConfidentialTransferMint:return p.ConfidentialTransferAccount;case p.TransferFeeAmount:case p.ConfidentialTransferAccount:case p.DefaultAccountState:case p.ImmutableOwner:case p.MemoTransfer:case p.MintCloseAuthority:case p.NonTransferable:case p.Uninitialized:case p.InterestBearingMint:return p.Uninitialized}}function m(t,n){if(0===t.length)return n;{const n=r.ACCOUNT_SIZE+s.ACCOUNT_TYPE_SIZE+t.filter(((e,n)=>n===t.indexOf(e))).map((t=>y(t)+e.TYPE_SIZE+e.LENGTH_SIZE)).reduce(((t,e)=>t+e));return n===o.MULTISIG_SIZE?n+e.TYPE_SIZE:n}}function b(t){return m(t,r.ACCOUNT_SIZE)}function w(t){const n=[];let r=0;for(;r<t.length;){const i=t.readUInt16LE(r);n.push(i);const o=t.readUInt16LE(r+e.TYPE_SIZE);r+=e.TYPE_SIZE+e.LENGTH_SIZE+o}return n}!function(t){t[t.Uninitialized=0]="Uninitialized",t[t.TransferFeeConfig=1]="TransferFeeConfig",t[t.TransferFeeAmount=2]="TransferFeeAmount",t[t.MintCloseAuthority=3]="MintCloseAuthority",t[t.ConfidentialTransferMint=4]="ConfidentialTransferMint",t[t.ConfidentialTransferAccount=5]="ConfidentialTransferAccount",t[t.DefaultAccountState=6]="DefaultAccountState",t[t.ImmutableOwner=7]="ImmutableOwner",t[t.MemoTransfer=8]="MemoTransfer",t[t.NonTransferable=9]="NonTransferable",t[t.InterestBearingMint=10]="InterestBearingMint"}(p=e.ExtensionType||(e.ExtensionType={})),e.TYPE_SIZE=2,e.LENGTH_SIZE=2,e.getTypeLen=y,e.getAccountTypeOfMintType=g,e.getMintLen=function(t){return m(t,i.MINT_SIZE)},e.getAccountLen=b,e.getExtensionData=function(t,n){let r=0;for(;r<n.length;){const i=n.readUInt16LE(r),o=n.readUInt16LE(r+e.TYPE_SIZE),s=r+e.TYPE_SIZE+e.LENGTH_SIZE;if(i==t)return n.slice(s,s+o);r=s+o}return null},e.getExtensionTypes=w,e.getAccountLenForMint=function(t){return b(w(t.tlvData).map(g))}},37905:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getImmutableOwner=e.IMMUTABLE_OWNER_SIZE=e.ImmutableOwnerLayout=void 0;const r=n(96346),i=n(53907);e.ImmutableOwnerLayout=(0,r.struct)([]),e.IMMUTABLE_OWNER_SIZE=e.ImmutableOwnerLayout.span,e.getImmutableOwner=function(t){const n=(0,i.getExtensionData)(i.ExtensionType.ImmutableOwner,t.tlvData);return null!==n?e.ImmutableOwnerLayout.decode(n):null}},6047:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(6869),e),i(n(44641),e),i(n(53907),e),i(n(37905),e),i(n(47606),e),i(n(90664),e),i(n(70460),e),i(n(60872),e),i(n(77032),e)},83322:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.updateRateInterestBearingMint=e.createInterestBearingMint=void 0;const i=n(27158),o=n(47813),s=n(8075),a=n(54330),c=n(53907),u=n(34175);e.createInterestBearingMint=function(t,e,n,o,l,d,h,f=i.Keypair.generate(),p,y=s.TOKEN_2022_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const r=(0,c.getMintLen)([c.ExtensionType.InterestBearingMint]),s=yield t.getMinimumBalanceForRentExemption(r),g=(new i.Transaction).add(i.SystemProgram.createAccount({fromPubkey:e.publicKey,newAccountPubkey:f.publicKey,space:r,lamports:s,programId:y}),(0,u.createInitializeInterestBearingMintInstruction)(f.publicKey,l,d,y),(0,a.createInitializeMintInstruction)(f.publicKey,h,n,o,y));return yield(0,i.sendAndConfirmTransaction)(t,g,[e,f],p),f.publicKey}))},e.updateRateInterestBearingMint=function(t,e,n,a,c,l=[],d,h=s.TOKEN_2022_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const[r,s]=(0,o.getSigners)(a,l),f=(new i.Transaction).add((0,u.createUpdateRateInterestBearingMintInstruction)(n,r,c,s,h));return yield(0,i.sendAndConfirmTransaction)(t,f,[e,a,...s],d)}))}},47606:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(83322),e),i(n(34175),e),i(n(18520),e)},34175:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createUpdateRateInterestBearingMintInstruction=e.createInitializeInterestBearingMintInstruction=e.interestBearingMintUpdateRateInstructionData=e.interestBearingMintInitializeInstructionData=e.InterestBearingMintInstruction=void 0;const r=n(96346),i=n(28813),o=n(27158),s=n(8075),a=n(61081),c=n(31886);var u;!function(t){t[t.Initialize=0]="Initialize",t[t.UpdateRate=1]="UpdateRate"}(u=e.InterestBearingMintInstruction||(e.InterestBearingMintInstruction={})),e.interestBearingMintInitializeInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,r.u8)("interestBearingMintInstruction"),(0,i.publicKey)("rateAuthority"),(0,r.s16)("rate")]),e.interestBearingMintUpdateRateInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,r.u8)("interestBearingMintInstruction"),(0,r.s16)("rate")]),e.createInitializeInterestBearingMintInstruction=function(t,n,r,i=s.TOKEN_2022_PROGRAM_ID){const a=[{pubkey:t,isSigner:!1,isWritable:!0}],l=Buffer.alloc(e.interestBearingMintInitializeInstructionData.span);return e.interestBearingMintInitializeInstructionData.encode({instruction:c.TokenInstruction.InterestBearingMintExtension,interestBearingMintInstruction:u.Initialize,rateAuthority:n,rate:r},l),new o.TransactionInstruction({keys:a,programId:i,data:l})},e.createUpdateRateInterestBearingMintInstruction=function(t,n,r,i=[],l=s.TOKEN_2022_PROGRAM_ID){const d=(0,a.addSigners)([{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!i.length,isWritable:!1}],n,i),h=Buffer.alloc(e.interestBearingMintUpdateRateInstructionData.span);return e.interestBearingMintUpdateRateInstructionData.encode({instruction:c.TokenInstruction.InterestBearingMintExtension,interestBearingMintInstruction:u.UpdateRate,rate:r},h),new o.TransactionInstruction({keys:d,programId:l,data:h})}},18520:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getInterestBearingMintConfigState=e.INTEREST_BEARING_MINT_CONFIG_STATE_SIZE=e.InterestBearingMintConfigStateLayout=void 0;const r=n(96346),i=n(28813),o=n(53907);e.InterestBearingMintConfigStateLayout=(0,r.struct)([(0,i.publicKey)("rateAuthority"),(0,r.ns64)("initializationTimestamp"),(0,r.s16)("preUpdateAverageRate"),(0,r.ns64)("lastUpdateTimestamp"),(0,r.s16)("currentRate")]),e.INTEREST_BEARING_MINT_CONFIG_STATE_SIZE=e.InterestBearingMintConfigStateLayout.span,e.getInterestBearingMintConfigState=function(t){const n=(0,o.getExtensionData)(o.ExtensionType.InterestBearingMint,t.tlvData);return null!==n?e.InterestBearingMintConfigStateLayout.decode(n):null}},90117:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.disableRequiredMemoTransfers=e.enableRequiredMemoTransfers=void 0;const i=n(27158),o=n(47813),s=n(8075),a=n(12162);e.enableRequiredMemoTransfers=function(t,e,n,c,u=[],l,d=s.TOKEN_2022_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const[r,s]=(0,o.getSigners)(c,u),h=(new i.Transaction).add((0,a.createEnableRequiredMemoTransfersInstruction)(n,r,s,d));return yield(0,i.sendAndConfirmTransaction)(t,h,[e,...s],l)}))},e.disableRequiredMemoTransfers=function(t,e,n,c,u=[],l,d=s.TOKEN_2022_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const[r,s]=(0,o.getSigners)(c,u),h=(new i.Transaction).add((0,a.createDisableRequiredMemoTransfersInstruction)(n,r,s,d));return yield(0,i.sendAndConfirmTransaction)(t,h,[e,...s],l)}))}},90664:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(90117),e),i(n(12162),e),i(n(28047),e)},12162:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createDisableRequiredMemoTransfersInstruction=e.createEnableRequiredMemoTransfersInstruction=e.memoTransferInstructionData=e.MemoTransferInstruction=void 0;const r=n(96346),i=n(27158),o=n(8075),s=n(35434),a=n(31886);var c;function u(t,n,r,u,l){if(!(0,o.programSupportsExtensions)(l))throw new s.TokenUnsupportedInstructionError;const d=[{pubkey:n,isSigner:!1,isWritable:!0}];d.push({pubkey:r,isSigner:!u.length,isWritable:!1});for(const e of u)d.push({pubkey:e.publicKey,isSigner:!0,isWritable:!1});const h=Buffer.alloc(e.memoTransferInstructionData.span);return e.memoTransferInstructionData.encode({instruction:a.TokenInstruction.MemoTransferExtension,memoTransferInstruction:t?c.Enable:c.Disable},h),new i.TransactionInstruction({keys:d,programId:l,data:h})}!function(t){t[t.Enable=0]="Enable",t[t.Disable=1]="Disable"}(c=e.MemoTransferInstruction||(e.MemoTransferInstruction={})),e.memoTransferInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,r.u8)("memoTransferInstruction")]),e.createEnableRequiredMemoTransfersInstruction=function(t,e,n=[],r=o.TOKEN_2022_PROGRAM_ID){return u(!0,t,e,n,r)},e.createDisableRequiredMemoTransfersInstruction=function(t,e,n=[],r=o.TOKEN_2022_PROGRAM_ID){return u(!1,t,e,n,r)}},28047:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getMemoTransfer=e.MEMO_TRANSFER_SIZE=e.MemoTransferLayout=void 0;const r=n(96346),i=n(28813),o=n(53907);e.MemoTransferLayout=(0,r.struct)([(0,i.bool)("requireIncomingTransferMemos")]),e.MEMO_TRANSFER_SIZE=e.MemoTransferLayout.span,e.getMemoTransfer=function(t){const n=(0,o.getExtensionData)(o.ExtensionType.MemoTransfer,t.tlvData);return null!==n?e.MemoTransferLayout.decode(n):null}},70460:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getMintCloseAuthority=e.MINT_CLOSE_AUTHORITY_SIZE=e.MintCloseAuthorityLayout=void 0;const r=n(96346),i=n(28813),o=n(53907);e.MintCloseAuthorityLayout=(0,r.struct)([(0,i.publicKey)("closeAuthority")]),e.MINT_CLOSE_AUTHORITY_SIZE=e.MintCloseAuthorityLayout.span,e.getMintCloseAuthority=function(t){const n=(0,o.getExtensionData)(o.ExtensionType.MintCloseAuthority,t.tlvData);return null!==n?e.MintCloseAuthorityLayout.decode(n):null}},60872:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getNonTransferable=e.NON_TRANSFERABLE_SIZE=e.NonTransferableLayout=void 0;const r=n(96346),i=n(53907);e.NonTransferableLayout=(0,r.struct)([]),e.NON_TRANSFERABLE_SIZE=e.NonTransferableLayout.span,e.getNonTransferable=function(t){const n=(0,i.getExtensionData)(i.ExtensionType.NonTransferable,t.tlvData);return null!==n?e.NonTransferableLayout.decode(n):null}},72483:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.harvestWithheldTokensToMint=e.withdrawWithheldTokensFromAccounts=e.withdrawWithheldTokensFromMint=e.transferCheckedWithFee=void 0;const i=n(27158),o=n(47813),s=n(8075),a=n(12952);e.transferCheckedWithFee=function(t,e,n,c,u,l,d,h,f,p=[],y,g=s.TOKEN_2022_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const[r,s]=(0,o.getSigners)(l,p),m=(new i.Transaction).add((0,a.createTransferCheckedWithFeeInstruction)(n,c,u,r,d,h,f,p,g));return yield(0,i.sendAndConfirmTransaction)(t,m,[e,...s],y)}))},e.withdrawWithheldTokensFromMint=function(t,e,n,c,u,l=[],d,h=s.TOKEN_2022_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const[r,s]=(0,o.getSigners)(u,l),f=(new i.Transaction).add((0,a.createWithdrawWithheldTokensFromMintInstruction)(n,c,r,s,h));return yield(0,i.sendAndConfirmTransaction)(t,f,[e,...s],d)}))},e.withdrawWithheldTokensFromAccounts=function(t,e,n,c,u,l,d,h,f=s.TOKEN_2022_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const[r,s]=(0,o.getSigners)(u,l),p=(new i.Transaction).add((0,a.createWithdrawWithheldTokensFromAccountsInstruction)(n,c,r,s,d,f));return yield(0,i.sendAndConfirmTransaction)(t,p,[e,...s],h)}))},e.harvestWithheldTokensToMint=function(t,e,n,o,c,u=s.TOKEN_2022_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const r=(new i.Transaction).add((0,a.createHarvestWithheldTokensToMintInstruction)(n,o,u));return yield(0,i.sendAndConfirmTransaction)(t,r,[e],c)}))}},77032:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(72483),e),i(n(12952),e),i(n(49990),e)},12952:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeHarvestWithheldTokensToMintInstructionUnchecked=e.decodeHarvestWithheldTokensToMintInstruction=e.createHarvestWithheldTokensToMintInstruction=e.harvestWithheldTokensToMintInstructionData=e.decodeWithdrawWithheldTokensFromAccountsInstructionUnchecked=e.decodeWithdrawWithheldTokensFromAccountsInstruction=e.createWithdrawWithheldTokensFromAccountsInstruction=e.withdrawWithheldTokensFromAccountsInstructionData=e.decodeWithdrawWithheldTokensFromMintInstructionUnchecked=e.decodeWithdrawWithheldTokensFromMintInstruction=e.createWithdrawWithheldTokensFromMintInstruction=e.withdrawWithheldTokensFromMintInstructionData=e.decodeTransferCheckedWithFeeInstructionUnchecked=e.decodeTransferCheckedWithFeeInstruction=e.createTransferCheckedWithFeeInstruction=e.transferCheckedWithFeeInstructionData=e.decodeInitializeTransferFeeConfigInstructionUnchecked=e.decodeInitializeTransferFeeConfigInstruction=e.createInitializeTransferFeeConfigInstruction=e.initializeTransferFeeConfigInstructionData=e.TransferFeeInstruction=void 0;const r=n(96346),i=n(28813),o=n(27158),s=n(8075),a=n(35434),c=n(31886);var u;function l({programId:t,keys:[n],data:r}){const{instruction:i,transferFeeInstruction:o,transferFeeConfigAuthorityOption:s,transferFeeConfigAuthority:a,withdrawWithheldAuthorityOption:c,withdrawWithheldAuthority:u,transferFeeBasisPoints:l,maximumFee:d}=e.initializeTransferFeeConfigInstructionData.decode(r);return{programId:t,keys:{mint:n},data:{instruction:i,transferFeeInstruction:o,transferFeeConfigAuthority:s?a:null,withdrawWithheldAuthority:c?u:null,transferFeeBasisPoints:l,maximumFee:d}}}function d({programId:t,keys:[n,r,i,o,...s],data:a}){const{instruction:c,transferFeeInstruction:u,amount:l,decimals:d,fee:h}=e.transferCheckedWithFeeInstructionData.decode(a);return{programId:t,keys:{source:n,mint:r,destination:i,authority:o,signers:s},data:{instruction:c,transferFeeInstruction:u,amount:l,decimals:d,fee:h}}}function h({programId:t,keys:[n,r,i,...o],data:s}){const{instruction:a,transferFeeInstruction:c}=e.withdrawWithheldTokensFromMintInstructionData.decode(s);return{programId:t,keys:{mint:n,destination:r,authority:i,signers:o},data:{instruction:a,transferFeeInstruction:c}}}function f({programId:t,keys:n,data:r}){const{instruction:i,transferFeeInstruction:o,numTokenAccounts:s}=e.withdrawWithheldTokensFromAccountsInstructionData.decode(r),[a,c,u,l,d]=[n[0],n[1],n[2],n.slice(3,3+s),n.slice(-1*s)];return{programId:t,keys:{mint:a,destination:c,authority:u,signers:l,sources:d},data:{instruction:i,transferFeeInstruction:o,numTokenAccounts:s}}}function p({programId:t,keys:[n,...r],data:i}){const{instruction:o,transferFeeInstruction:s}=e.harvestWithheldTokensToMintInstructionData.decode(i);return{programId:t,keys:{mint:n,sources:r},data:{instruction:o,transferFeeInstruction:s}}}!function(t){t[t.InitializeTransferFeeConfig=0]="InitializeTransferFeeConfig",t[t.TransferCheckedWithFee=1]="TransferCheckedWithFee",t[t.WithdrawWithheldTokensFromMint=2]="WithdrawWithheldTokensFromMint",t[t.WithdrawWithheldTokensFromAccounts=3]="WithdrawWithheldTokensFromAccounts",t[t.HarvestWithheldTokensToMint=4]="HarvestWithheldTokensToMint",t[t.SetTransferFee=5]="SetTransferFee"}(u=e.TransferFeeInstruction||(e.TransferFeeInstruction={})),e.initializeTransferFeeConfigInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,r.u8)("transferFeeInstruction"),(0,r.u8)("transferFeeConfigAuthorityOption"),(0,i.publicKey)("transferFeeConfigAuthority"),(0,r.u8)("withdrawWithheldAuthorityOption"),(0,i.publicKey)("withdrawWithheldAuthority"),(0,r.u16)("transferFeeBasisPoints"),(0,i.u64)("maximumFee")]),e.createInitializeTransferFeeConfigInstruction=function(t,n,r,i,l,d=s.TOKEN_2022_PROGRAM_ID){if(!(0,s.programSupportsExtensions)(d))throw new a.TokenUnsupportedInstructionError;const h=[{pubkey:t,isSigner:!1,isWritable:!0}],f=Buffer.alloc(e.initializeTransferFeeConfigInstructionData.span);return e.initializeTransferFeeConfigInstructionData.encode({instruction:c.TokenInstruction.TransferFeeExtension,transferFeeInstruction:u.InitializeTransferFeeConfig,transferFeeConfigAuthorityOption:n?1:0,transferFeeConfigAuthority:n||new o.PublicKey(0),withdrawWithheldAuthorityOption:r?1:0,withdrawWithheldAuthority:r||new o.PublicKey(0),transferFeeBasisPoints:i,maximumFee:l},f),new o.TransactionInstruction({keys:h,programId:d,data:f})},e.decodeInitializeTransferFeeConfigInstruction=function(t,n){if(!t.programId.equals(n))throw new a.TokenInvalidInstructionProgramError;if(t.data.length!==e.initializeTransferFeeConfigInstructionData.span)throw new a.TokenInvalidInstructionDataError;const{keys:{mint:r},data:i}=l(t);if(i.instruction!==c.TokenInstruction.TransferFeeExtension||i.transferFeeInstruction!==u.InitializeTransferFeeConfig)throw new a.TokenInvalidInstructionTypeError;if(!r)throw new a.TokenInvalidInstructionKeysError;return{programId:n,keys:{mint:r},data:i}},e.decodeInitializeTransferFeeConfigInstructionUnchecked=l,e.transferCheckedWithFeeInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,r.u8)("transferFeeInstruction"),(0,i.u64)("amount"),(0,r.u8)("decimals"),(0,i.u64)("fee")]),e.createTransferCheckedWithFeeInstruction=function(t,n,r,i,l,d,h,f=[],p=s.TOKEN_2022_PROGRAM_ID){if(!(0,s.programSupportsExtensions)(p))throw new a.TokenUnsupportedInstructionError;const y=Buffer.alloc(e.transferCheckedWithFeeInstructionData.span);e.transferCheckedWithFeeInstructionData.encode({instruction:c.TokenInstruction.TransferFeeExtension,transferFeeInstruction:u.TransferCheckedWithFee,amount:l,decimals:d,fee:h},y);const g=[];g.push({pubkey:t,isSigner:!1,isWritable:!0}),g.push({pubkey:n,isSigner:!1,isWritable:!1}),g.push({pubkey:r,isSigner:!1,isWritable:!0}),g.push({pubkey:i,isSigner:!f.length,isWritable:!1});for(const e of f)g.push({pubkey:e.publicKey,isSigner:!0,isWritable:!1});return new o.TransactionInstruction({keys:g,programId:p,data:y})},e.decodeTransferCheckedWithFeeInstruction=function(t,n){if(!t.programId.equals(n))throw new a.TokenInvalidInstructionProgramError;if(t.data.length!==e.transferCheckedWithFeeInstructionData.span)throw new a.TokenInvalidInstructionDataError;const{keys:{source:r,mint:i,destination:o,authority:s,signers:l},data:h}=d(t);if(h.instruction!==c.TokenInstruction.TransferFeeExtension||h.transferFeeInstruction!==u.TransferCheckedWithFee)throw new a.TokenInvalidInstructionTypeError;if(!i)throw new a.TokenInvalidInstructionKeysError;return{programId:n,keys:{source:r,mint:i,destination:o,authority:s,signers:l||null},data:h}},e.decodeTransferCheckedWithFeeInstructionUnchecked=d,e.withdrawWithheldTokensFromMintInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,r.u8)("transferFeeInstruction")]),e.createWithdrawWithheldTokensFromMintInstruction=function(t,n,r,i=[],l=s.TOKEN_2022_PROGRAM_ID){if(!(0,s.programSupportsExtensions)(l))throw new a.TokenUnsupportedInstructionError;const d=Buffer.alloc(e.withdrawWithheldTokensFromMintInstructionData.span);e.withdrawWithheldTokensFromMintInstructionData.encode({instruction:c.TokenInstruction.TransferFeeExtension,transferFeeInstruction:u.WithdrawWithheldTokensFromMint},d);const h=[];h.push({pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!i.length,isWritable:!1});for(const e of i)h.push({pubkey:e.publicKey,isSigner:!0,isWritable:!1});return new o.TransactionInstruction({keys:h,programId:l,data:d})},e.decodeWithdrawWithheldTokensFromMintInstruction=function(t,n){if(!t.programId.equals(n))throw new a.TokenInvalidInstructionProgramError;if(t.data.length!==e.withdrawWithheldTokensFromMintInstructionData.span)throw new a.TokenInvalidInstructionDataError;const{keys:{mint:r,destination:i,authority:o,signers:s},data:l}=h(t);if(l.instruction!==c.TokenInstruction.TransferFeeExtension||l.transferFeeInstruction!==u.WithdrawWithheldTokensFromMint)throw new a.TokenInvalidInstructionTypeError;if(!r)throw new a.TokenInvalidInstructionKeysError;return{programId:n,keys:{mint:r,destination:i,authority:o,signers:s||null},data:l}},e.decodeWithdrawWithheldTokensFromMintInstructionUnchecked=h,e.withdrawWithheldTokensFromAccountsInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,r.u8)("transferFeeInstruction"),(0,r.u8)("numTokenAccounts")]),e.createWithdrawWithheldTokensFromAccountsInstruction=function(t,n,r,i,l,d=s.TOKEN_2022_PROGRAM_ID){if(!(0,s.programSupportsExtensions)(d))throw new a.TokenUnsupportedInstructionError;const h=Buffer.alloc(e.withdrawWithheldTokensFromAccountsInstructionData.span);e.withdrawWithheldTokensFromAccountsInstructionData.encode({instruction:c.TokenInstruction.TransferFeeExtension,transferFeeInstruction:u.WithdrawWithheldTokensFromAccounts,numTokenAccounts:l.length},h);const f=[];f.push({pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!i.length,isWritable:!1});for(const e of i)f.push({pubkey:e.publicKey,isSigner:!0,isWritable:!1});for(const e of l)f.push({pubkey:e,isSigner:!1,isWritable:!0});return new o.TransactionInstruction({keys:f,programId:d,data:h})},e.decodeWithdrawWithheldTokensFromAccountsInstruction=function(t,n){if(!t.programId.equals(n))throw new a.TokenInvalidInstructionProgramError;if(t.data.length!==e.withdrawWithheldTokensFromAccountsInstructionData.span)throw new a.TokenInvalidInstructionDataError;const{keys:{mint:r,destination:i,authority:o,signers:s,sources:l},data:d}=f(t);if(d.instruction!==c.TokenInstruction.TransferFeeExtension||d.transferFeeInstruction!==u.WithdrawWithheldTokensFromAccounts)throw new a.TokenInvalidInstructionTypeError;if(!r)throw new a.TokenInvalidInstructionKeysError;return{programId:n,keys:{mint:r,destination:i,authority:o,signers:s||null,sources:l||null},data:d}},e.decodeWithdrawWithheldTokensFromAccountsInstructionUnchecked=f,e.harvestWithheldTokensToMintInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,r.u8)("transferFeeInstruction")]),e.createHarvestWithheldTokensToMintInstruction=function(t,n,r=s.TOKEN_2022_PROGRAM_ID){if(!(0,s.programSupportsExtensions)(r))throw new a.TokenUnsupportedInstructionError;const i=Buffer.alloc(e.harvestWithheldTokensToMintInstructionData.span);e.harvestWithheldTokensToMintInstructionData.encode({instruction:c.TokenInstruction.TransferFeeExtension,transferFeeInstruction:u.HarvestWithheldTokensToMint},i);const l=[];l.push({pubkey:t,isSigner:!1,isWritable:!0});for(const e of n)l.push({pubkey:e,isSigner:!1,isWritable:!0});return new o.TransactionInstruction({keys:l,programId:r,data:i})},e.decodeHarvestWithheldTokensToMintInstruction=function(t,n){if(!t.programId.equals(n))throw new a.TokenInvalidInstructionProgramError;if(t.data.length!==e.harvestWithheldTokensToMintInstructionData.span)throw new a.TokenInvalidInstructionDataError;const{keys:{mint:r,sources:i},data:o}=p(t);if(o.instruction!==c.TokenInstruction.TransferFeeExtension||o.transferFeeInstruction!==u.HarvestWithheldTokensToMint)throw new a.TokenInvalidInstructionTypeError;if(!r)throw new a.TokenInvalidInstructionKeysError;return{programId:n,keys:{mint:r,sources:i},data:o}},e.decodeHarvestWithheldTokensToMintInstructionUnchecked=p},49990:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getTransferFeeAmount=e.getTransferFeeConfig=e.TRANSFER_FEE_AMOUNT_SIZE=e.TransferFeeAmountLayout=e.TRANSFER_FEE_CONFIG_SIZE=e.TransferFeeConfigLayout=e.transferFeeLayout=e.ONE_IN_BASIS_POINTS=e.MAX_FEE_BASIS_POINTS=void 0;const r=n(96346),i=n(28813),o=n(53907);function s(t){return(0,r.struct)([(0,i.u64)("epoch"),(0,i.u64)("maximumFee"),(0,r.u16)("transferFeeBasisPoints")],t)}e.MAX_FEE_BASIS_POINTS=1e4,e.ONE_IN_BASIS_POINTS=e.MAX_FEE_BASIS_POINTS,e.transferFeeLayout=s,e.TransferFeeConfigLayout=(0,r.struct)([(0,i.publicKey)("transferFeeConfigAuthority"),(0,i.publicKey)("withdrawWithheldAuthority"),(0,i.u64)("withheldAmount"),s("olderTransferFee"),s("newerTransferFee")]),e.TRANSFER_FEE_CONFIG_SIZE=e.TransferFeeConfigLayout.span,e.TransferFeeAmountLayout=(0,r.struct)([(0,i.u64)("withheldAmount")]),e.TRANSFER_FEE_AMOUNT_SIZE=e.TransferFeeAmountLayout.span,e.getTransferFeeConfig=function(t){const n=(0,o.getExtensionData)(o.ExtensionType.TransferFeeConfig,t.tlvData);return null!==n?e.TransferFeeConfigLayout.decode(n):null},e.getTransferFeeAmount=function(t){const n=(0,o.getExtensionData)(o.ExtensionType.TransferFeeAmount,t.tlvData);return null!==n?e.TransferFeeAmountLayout.decode(n):null}},52828:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(67621),e),i(n(8075),e),i(n(35434),e),i(n(6047),e),i(n(87885),e),i(n(79235),e)},78641:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeAmountToUiAmountInstructionUnchecked=e.decodeAmountToUiAmountInstruction=e.createAmountToUiAmountInstruction=e.amountToUiAmountInstructionData=void 0;const r=n(96346),i=n(28813),o=n(27158),s=n(8075),a=n(35434),c=n(31886);function u({programId:t,keys:[n],data:r}){return{programId:t,keys:{mint:n},data:e.amountToUiAmountInstructionData.decode(r)}}e.amountToUiAmountInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,i.u64)("amount")]),e.createAmountToUiAmountInstruction=function(t,n,r=s.TOKEN_PROGRAM_ID){const i=[{pubkey:t,isSigner:!1,isWritable:!1}],a=Buffer.alloc(e.amountToUiAmountInstructionData.span);return e.amountToUiAmountInstructionData.encode({instruction:c.TokenInstruction.AmountToUiAmount,amount:BigInt(n)},a),new o.TransactionInstruction({keys:i,programId:r,data:a})},e.decodeAmountToUiAmountInstruction=function(t,n=s.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new a.TokenInvalidInstructionProgramError;if(t.data.length!==e.amountToUiAmountInstructionData.span)throw new a.TokenInvalidInstructionDataError;const{keys:{mint:r},data:i}=u(t);if(i.instruction!==c.TokenInstruction.AmountToUiAmount)throw new a.TokenInvalidInstructionTypeError;if(!r)throw new a.TokenInvalidInstructionKeysError;return{programId:n,keys:{mint:r},data:i}},e.decodeAmountToUiAmountInstructionUnchecked=u},68728:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeApproveInstructionUnchecked=e.decodeApproveInstruction=e.createApproveInstruction=e.approveInstructionData=void 0;const r=n(96346),i=n(28813),o=n(27158),s=n(8075),a=n(35434),c=n(61081),u=n(31886);function l({programId:t,keys:[n,r,i,...o],data:s}){return{programId:t,keys:{account:n,delegate:r,owner:i,multiSigners:o},data:e.approveInstructionData.decode(s)}}e.approveInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,i.u64)("amount")]),e.createApproveInstruction=function(t,n,r,i,a=[],l=s.TOKEN_PROGRAM_ID){const d=(0,c.addSigners)([{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1}],r,a),h=Buffer.alloc(e.approveInstructionData.span);return e.approveInstructionData.encode({instruction:u.TokenInstruction.Approve,amount:BigInt(i)},h),new o.TransactionInstruction({keys:d,programId:l,data:h})},e.decodeApproveInstruction=function(t,n=s.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new a.TokenInvalidInstructionProgramError;if(t.data.length!==e.approveInstructionData.span)throw new a.TokenInvalidInstructionDataError;const{keys:{account:r,delegate:i,owner:o,multiSigners:c},data:d}=l(t);if(d.instruction!==u.TokenInstruction.Approve)throw new a.TokenInvalidInstructionTypeError;if(!r||!i||!o)throw new a.TokenInvalidInstructionKeysError;return{programId:n,keys:{account:r,delegate:i,owner:o,multiSigners:c},data:d}},e.decodeApproveInstructionUnchecked=l},13878:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeApproveCheckedInstructionUnchecked=e.decodeApproveCheckedInstruction=e.createApproveCheckedInstruction=e.approveCheckedInstructionData=void 0;const r=n(96346),i=n(28813),o=n(27158),s=n(8075),a=n(35434),c=n(61081),u=n(31886);function l({programId:t,keys:[n,r,i,o,...s],data:a}){return{programId:t,keys:{account:n,mint:r,delegate:i,owner:o,multiSigners:s},data:e.approveCheckedInstructionData.decode(a)}}e.approveCheckedInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,i.u64)("amount"),(0,r.u8)("decimals")]),e.createApproveCheckedInstruction=function(t,n,r,i,a,l,d=[],h=s.TOKEN_PROGRAM_ID){const f=(0,c.addSigners)([{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!1,isWritable:!1}],i,d),p=Buffer.alloc(e.approveCheckedInstructionData.span);return e.approveCheckedInstructionData.encode({instruction:u.TokenInstruction.ApproveChecked,amount:BigInt(a),decimals:l},p),new o.TransactionInstruction({keys:f,programId:h,data:p})},e.decodeApproveCheckedInstruction=function(t,n=s.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new a.TokenInvalidInstructionProgramError;if(t.data.length!==e.approveCheckedInstructionData.span)throw new a.TokenInvalidInstructionDataError;const{keys:{account:r,mint:i,delegate:o,owner:c,multiSigners:d},data:h}=l(t);if(h.instruction!==u.TokenInstruction.ApproveChecked)throw new a.TokenInvalidInstructionTypeError;if(!(r&&i&&o&&c))throw new a.TokenInvalidInstructionKeysError;return{programId:n,keys:{account:r,mint:i,delegate:o,owner:c,multiSigners:d},data:h}},e.decodeApproveCheckedInstructionUnchecked=l},34684:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createAssociatedTokenAccountIdempotentInstruction=e.createAssociatedTokenAccountInstruction=void 0;const r=n(27158),i=n(8075);function o(t,e,n,o,s,a=i.TOKEN_PROGRAM_ID,c=i.ASSOCIATED_TOKEN_PROGRAM_ID){const u=[{pubkey:t,isSigner:!0,isWritable:!0},{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:o,isSigner:!1,isWritable:!1},{pubkey:r.SystemProgram.programId,isSigner:!1,isWritable:!1},{pubkey:a,isSigner:!1,isWritable:!1}];return new r.TransactionInstruction({keys:u,programId:c,data:s})}e.createAssociatedTokenAccountInstruction=function(t,e,n,r,s=i.TOKEN_PROGRAM_ID,a=i.ASSOCIATED_TOKEN_PROGRAM_ID){return o(t,e,n,r,Buffer.alloc(0),s,a)},e.createAssociatedTokenAccountIdempotentInstruction=function(t,e,n,r,s=i.TOKEN_PROGRAM_ID,a=i.ASSOCIATED_TOKEN_PROGRAM_ID){return o(t,e,n,r,Buffer.from([1]),s,a)}},82900:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeBurnInstructionUnchecked=e.decodeBurnInstruction=e.createBurnInstruction=e.burnInstructionData=void 0;const r=n(96346),i=n(28813),o=n(27158),s=n(8075),a=n(35434),c=n(61081),u=n(31886);function l({programId:t,keys:[n,r,i,...o],data:s}){return{programId:t,keys:{account:n,mint:r,owner:i,multiSigners:o},data:e.burnInstructionData.decode(s)}}e.burnInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,i.u64)("amount")]),e.createBurnInstruction=function(t,n,r,i,a=[],l=s.TOKEN_PROGRAM_ID){const d=(0,c.addSigners)([{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0}],r,a),h=Buffer.alloc(e.burnInstructionData.span);return e.burnInstructionData.encode({instruction:u.TokenInstruction.Burn,amount:BigInt(i)},h),new o.TransactionInstruction({keys:d,programId:l,data:h})},e.decodeBurnInstruction=function(t,n=s.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new a.TokenInvalidInstructionProgramError;if(t.data.length!==e.burnInstructionData.span)throw new a.TokenInvalidInstructionDataError;const{keys:{account:r,mint:i,owner:o,multiSigners:c},data:d}=l(t);if(d.instruction!==u.TokenInstruction.Burn)throw new a.TokenInvalidInstructionTypeError;if(!r||!i||!o)throw new a.TokenInvalidInstructionKeysError;return{programId:n,keys:{account:r,mint:i,owner:o,multiSigners:c},data:d}},e.decodeBurnInstructionUnchecked=l},52432:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeBurnCheckedInstructionUnchecked=e.decodeBurnCheckedInstruction=e.createBurnCheckedInstruction=e.burnCheckedInstructionData=void 0;const r=n(96346),i=n(28813),o=n(27158),s=n(8075),a=n(35434),c=n(61081),u=n(31886);function l({programId:t,keys:[n,r,i,...o],data:s}){return{programId:t,keys:{account:n,mint:r,owner:i,multiSigners:o},data:e.burnCheckedInstructionData.decode(s)}}e.burnCheckedInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,i.u64)("amount"),(0,r.u8)("decimals")]),e.createBurnCheckedInstruction=function(t,n,r,i,a,l=[],d=s.TOKEN_PROGRAM_ID){const h=(0,c.addSigners)([{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0}],r,l),f=Buffer.alloc(e.burnCheckedInstructionData.span);return e.burnCheckedInstructionData.encode({instruction:u.TokenInstruction.BurnChecked,amount:BigInt(i),decimals:a},f),new o.TransactionInstruction({keys:h,programId:d,data:f})},e.decodeBurnCheckedInstruction=function(t,n=s.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new a.TokenInvalidInstructionProgramError;if(t.data.length!==e.burnCheckedInstructionData.span)throw new a.TokenInvalidInstructionDataError;const{keys:{account:r,mint:i,owner:o,multiSigners:c},data:d}=l(t);if(d.instruction!==u.TokenInstruction.BurnChecked)throw new a.TokenInvalidInstructionTypeError;if(!r||!i||!o)throw new a.TokenInvalidInstructionKeysError;return{programId:n,keys:{account:r,mint:i,owner:o,multiSigners:c},data:d}},e.decodeBurnCheckedInstructionUnchecked=l},15725:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeCloseAccountInstructionUnchecked=e.decodeCloseAccountInstruction=e.createCloseAccountInstruction=e.closeAccountInstructionData=void 0;const r=n(96346),i=n(27158),o=n(8075),s=n(35434),a=n(61081),c=n(31886);function u({programId:t,keys:[n,r,i,...o],data:s}){return{programId:t,keys:{account:n,destination:r,authority:i,multiSigners:o},data:e.closeAccountInstructionData.decode(s)}}e.closeAccountInstructionData=(0,r.struct)([(0,r.u8)("instruction")]),e.createCloseAccountInstruction=function(t,n,r,s=[],u=o.TOKEN_PROGRAM_ID){const l=(0,a.addSigners)([{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0}],r,s),d=Buffer.alloc(e.closeAccountInstructionData.span);return e.closeAccountInstructionData.encode({instruction:c.TokenInstruction.CloseAccount},d),new i.TransactionInstruction({keys:l,programId:u,data:d})},e.decodeCloseAccountInstruction=function(t,n=o.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new s.TokenInvalidInstructionProgramError;if(t.data.length!==e.closeAccountInstructionData.span)throw new s.TokenInvalidInstructionDataError;const{keys:{account:r,destination:i,authority:a,multiSigners:l},data:d}=u(t);if(d.instruction!==c.TokenInstruction.CloseAccount)throw new s.TokenInvalidInstructionTypeError;if(!r||!i||!a)throw new s.TokenInvalidInstructionKeysError;return{programId:n,keys:{account:r,destination:i,authority:a,multiSigners:l},data:d}},e.decodeCloseAccountInstructionUnchecked=u},78719:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createCreateNativeMintInstruction=e.createNativeMintInstructionData=void 0;const r=n(96346),i=n(27158),o=n(8075),s=n(35434),a=n(31886);e.createNativeMintInstructionData=(0,r.struct)([(0,r.u8)("instruction")]),e.createCreateNativeMintInstruction=function(t,n=o.NATIVE_MINT_2022,r=o.TOKEN_2022_PROGRAM_ID){if(!(0,o.programSupportsExtensions)(r))throw new s.TokenUnsupportedInstructionError;const c=[{pubkey:t,isSigner:!0,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:i.SystemProgram.programId,isSigner:!1,isWritable:!1}],u=Buffer.alloc(e.createNativeMintInstructionData.span);return e.createNativeMintInstructionData.encode({instruction:a.TokenInstruction.CreateNativeMint},u),new i.TransactionInstruction({keys:c,programId:r,data:u})}},20623:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isUiamountToAmountInstruction=e.isAmountToUiAmountInstruction=e.isInitializeMint2Instruction=e.isInitializeAccount3Instruction=e.isSyncNativeInstruction=e.isInitializeAccount2Instruction=e.isBurnCheckedInstruction=e.isMintToCheckedInstruction=e.isApproveCheckedInstruction=e.isTransferCheckedInstruction=e.isThawAccountInstruction=e.isFreezeAccountInstruction=e.isCloseAccountInstruction=e.isBurnInstruction=e.isMintToInstruction=e.isSetAuthorityInstruction=e.isRevokeInstruction=e.isApproveInstruction=e.isTransferInstruction=e.isInitializeMultisigInstruction=e.isInitializeAccountInstruction=e.isInitializeMintInstruction=e.decodeInstruction=void 0;const r=n(96346),i=n(8075),o=n(35434),s=n(78641),a=n(68728),c=n(13878),u=n(82900),l=n(52432),d=n(15725),h=n(39670),f=n(91358),p=n(48979),y=n(53218),g=n(54330),m=n(38631),b=n(46433),w=n(36514),k=n(11702),v=n(26248),I=n(13249),A=n(20096),_=n(7765),S=n(22990),E=n(67997),T=n(31886),x=n(27776);e.decodeInstruction=function(t,e=i.TOKEN_PROGRAM_ID){if(!t.data.length)throw new o.TokenInvalidInstructionDataError;const n=(0,r.u8)().decode(t.data);if(n===T.TokenInstruction.InitializeMint)return(0,g.decodeInitializeMintInstruction)(t,e);if(n===T.TokenInstruction.InitializeAccount)return(0,f.decodeInitializeAccountInstruction)(t,e);if(n===T.TokenInstruction.InitializeMultisig)return(0,b.decodeInitializeMultisigInstruction)(t,e);if(n===T.TokenInstruction.Transfer)return(0,S.decodeTransferInstruction)(t,e);if(n===T.TokenInstruction.Approve)return(0,a.decodeApproveInstruction)(t,e);if(n===T.TokenInstruction.Revoke)return(0,v.decodeRevokeInstruction)(t,e);if(n===T.TokenInstruction.SetAuthority)return(0,I.decodeSetAuthorityInstruction)(t,e);if(n===T.TokenInstruction.MintTo)return(0,w.decodeMintToInstruction)(t,e);if(n===T.TokenInstruction.Burn)return(0,u.decodeBurnInstruction)(t,e);if(n===T.TokenInstruction.CloseAccount)return(0,d.decodeCloseAccountInstruction)(t,e);if(n===T.TokenInstruction.FreezeAccount)return(0,h.decodeFreezeAccountInstruction)(t,e);if(n===T.TokenInstruction.ThawAccount)return(0,_.decodeThawAccountInstruction)(t,e);if(n===T.TokenInstruction.TransferChecked)return(0,E.decodeTransferCheckedInstruction)(t,e);if(n===T.TokenInstruction.ApproveChecked)return(0,c.decodeApproveCheckedInstruction)(t,e);if(n===T.TokenInstruction.MintToChecked)return(0,k.decodeMintToCheckedInstruction)(t,e);if(n===T.TokenInstruction.BurnChecked)return(0,l.decodeBurnCheckedInstruction)(t,e);if(n===T.TokenInstruction.InitializeAccount2)return(0,p.decodeInitializeAccount2Instruction)(t,e);if(n===T.TokenInstruction.SyncNative)return(0,A.decodeSyncNativeInstruction)(t,e);if(n===T.TokenInstruction.InitializeAccount3)return(0,y.decodeInitializeAccount3Instruction)(t,e);if(n===T.TokenInstruction.InitializeMint2)return(0,m.decodeInitializeMint2Instruction)(t,e);if(n===T.TokenInstruction.AmountToUiAmount)return(0,s.decodeAmountToUiAmountInstruction)(t,e);if(n===T.TokenInstruction.UiAmountToAmount)return(0,x.decodeUiAmountToAmountInstruction)(t,e);if(n===T.TokenInstruction.InitializeMultisig2)throw new o.TokenInvalidInstructionTypeError;throw new o.TokenInvalidInstructionTypeError},e.isInitializeMintInstruction=function(t){return t.data.instruction===T.TokenInstruction.InitializeMint},e.isInitializeAccountInstruction=function(t){return t.data.instruction===T.TokenInstruction.InitializeAccount},e.isInitializeMultisigInstruction=function(t){return t.data.instruction===T.TokenInstruction.InitializeMultisig},e.isTransferInstruction=function(t){return t.data.instruction===T.TokenInstruction.Transfer},e.isApproveInstruction=function(t){return t.data.instruction===T.TokenInstruction.Approve},e.isRevokeInstruction=function(t){return t.data.instruction===T.TokenInstruction.Revoke},e.isSetAuthorityInstruction=function(t){return t.data.instruction===T.TokenInstruction.SetAuthority},e.isMintToInstruction=function(t){return t.data.instruction===T.TokenInstruction.MintTo},e.isBurnInstruction=function(t){return t.data.instruction===T.TokenInstruction.Burn},e.isCloseAccountInstruction=function(t){return t.data.instruction===T.TokenInstruction.CloseAccount},e.isFreezeAccountInstruction=function(t){return t.data.instruction===T.TokenInstruction.FreezeAccount},e.isThawAccountInstruction=function(t){return t.data.instruction===T.TokenInstruction.ThawAccount},e.isTransferCheckedInstruction=function(t){return t.data.instruction===T.TokenInstruction.TransferChecked},e.isApproveCheckedInstruction=function(t){return t.data.instruction===T.TokenInstruction.ApproveChecked},e.isMintToCheckedInstruction=function(t){return t.data.instruction===T.TokenInstruction.MintToChecked},e.isBurnCheckedInstruction=function(t){return t.data.instruction===T.TokenInstruction.BurnChecked},e.isInitializeAccount2Instruction=function(t){return t.data.instruction===T.TokenInstruction.InitializeAccount2},e.isSyncNativeInstruction=function(t){return t.data.instruction===T.TokenInstruction.SyncNative},e.isInitializeAccount3Instruction=function(t){return t.data.instruction===T.TokenInstruction.InitializeAccount3},e.isInitializeMint2Instruction=function(t){return t.data.instruction===T.TokenInstruction.InitializeMint2},e.isAmountToUiAmountInstruction=function(t){return t.data.instruction===T.TokenInstruction.AmountToUiAmount},e.isUiamountToAmountInstruction=function(t){return t.data.instruction===T.TokenInstruction.UiAmountToAmount}},39670:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeFreezeAccountInstructionUnchecked=e.decodeFreezeAccountInstruction=e.createFreezeAccountInstruction=e.freezeAccountInstructionData=void 0;const r=n(96346),i=n(27158),o=n(8075),s=n(35434),a=n(61081),c=n(31886);function u({programId:t,keys:[n,r,i,...o],data:s}){return{programId:t,keys:{account:n,mint:r,authority:i,multiSigners:o},data:e.freezeAccountInstructionData.decode(s)}}e.freezeAccountInstructionData=(0,r.struct)([(0,r.u8)("instruction")]),e.createFreezeAccountInstruction=function(t,n,r,s=[],u=o.TOKEN_PROGRAM_ID){const l=(0,a.addSigners)([{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1}],r,s),d=Buffer.alloc(e.freezeAccountInstructionData.span);return e.freezeAccountInstructionData.encode({instruction:c.TokenInstruction.FreezeAccount},d),new i.TransactionInstruction({keys:l,programId:u,data:d})},e.decodeFreezeAccountInstruction=function(t,n=o.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new s.TokenInvalidInstructionProgramError;if(t.data.length!==e.freezeAccountInstructionData.span)throw new s.TokenInvalidInstructionDataError;const{keys:{account:r,mint:i,authority:a,multiSigners:l},data:d}=u(t);if(d.instruction!==c.TokenInstruction.FreezeAccount)throw new s.TokenInvalidInstructionTypeError;if(!r||!i||!a)throw new s.TokenInvalidInstructionKeysError;return{programId:n,keys:{account:r,mint:i,authority:a,multiSigners:l},data:d}},e.decodeFreezeAccountInstructionUnchecked=u},87885:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(34684),e),i(n(20623),e),i(n(31886),e),i(n(54330),e),i(n(91358),e),i(n(46433),e),i(n(22990),e),i(n(68728),e),i(n(26248),e),i(n(13249),e),i(n(36514),e),i(n(82900),e),i(n(15725),e),i(n(39670),e),i(n(7765),e),i(n(67997),e),i(n(13878),e),i(n(11702),e),i(n(52432),e),i(n(48979),e),i(n(20096),e),i(n(53218),e),i(n(89326),e),i(n(38631),e),i(n(4),e),i(n(78641),e),i(n(27776),e),i(n(93434),e),i(n(27892),e),i(n(78719),e),i(n(33817),e)},91358:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeInitializeAccountInstructionUnchecked=e.decodeInitializeAccountInstruction=e.createInitializeAccountInstruction=e.initializeAccountInstructionData=void 0;const r=n(96346),i=n(27158),o=n(8075),s=n(35434),a=n(31886);function c({programId:t,keys:[n,r,i,o],data:s}){return{programId:t,keys:{account:n,mint:r,owner:i,rent:o},data:e.initializeAccountInstructionData.decode(s)}}e.initializeAccountInstructionData=(0,r.struct)([(0,r.u8)("instruction")]),e.createInitializeAccountInstruction=function(t,n,r,s=o.TOKEN_PROGRAM_ID){const c=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!1,isWritable:!1},{pubkey:i.SYSVAR_RENT_PUBKEY,isSigner:!1,isWritable:!1}],u=Buffer.alloc(e.initializeAccountInstructionData.span);return e.initializeAccountInstructionData.encode({instruction:a.TokenInstruction.InitializeAccount},u),new i.TransactionInstruction({keys:c,programId:s,data:u})},e.decodeInitializeAccountInstruction=function(t,n=o.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new s.TokenInvalidInstructionProgramError;if(t.data.length!==e.initializeAccountInstructionData.span)throw new s.TokenInvalidInstructionDataError;const{keys:{account:r,mint:i,owner:u,rent:l},data:d}=c(t);if(d.instruction!==a.TokenInstruction.InitializeAccount)throw new s.TokenInvalidInstructionTypeError;if(!(r&&i&&u&&l))throw new s.TokenInvalidInstructionKeysError;return{programId:n,keys:{account:r,mint:i,owner:u,rent:l},data:d}},e.decodeInitializeAccountInstructionUnchecked=c},48979:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeInitializeAccount2InstructionUnchecked=e.decodeInitializeAccount2Instruction=e.createInitializeAccount2Instruction=e.initializeAccount2InstructionData=void 0;const r=n(96346),i=n(28813),o=n(27158),s=n(8075),a=n(35434),c=n(31886);function u({programId:t,keys:[n,r,i],data:o}){return{programId:t,keys:{account:n,mint:r,rent:i},data:e.initializeAccount2InstructionData.decode(o)}}e.initializeAccount2InstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,i.publicKey)("owner")]),e.createInitializeAccount2Instruction=function(t,n,r,i=s.TOKEN_PROGRAM_ID){const a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:o.SYSVAR_RENT_PUBKEY,isSigner:!1,isWritable:!1}],u=Buffer.alloc(e.initializeAccount2InstructionData.span);return e.initializeAccount2InstructionData.encode({instruction:c.TokenInstruction.InitializeAccount2,owner:r},u),new o.TransactionInstruction({keys:a,programId:i,data:u})},e.decodeInitializeAccount2Instruction=function(t,n=s.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new a.TokenInvalidInstructionProgramError;if(t.data.length!==e.initializeAccount2InstructionData.span)throw new a.TokenInvalidInstructionDataError;const{keys:{account:r,mint:i,rent:o},data:l}=u(t);if(l.instruction!==c.TokenInstruction.InitializeAccount2)throw new a.TokenInvalidInstructionTypeError;if(!r||!i||!o)throw new a.TokenInvalidInstructionKeysError;return{programId:n,keys:{account:r,mint:i,rent:o},data:l}},e.decodeInitializeAccount2InstructionUnchecked=u},53218:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeInitializeAccount3InstructionUnchecked=e.decodeInitializeAccount3Instruction=e.createInitializeAccount3Instruction=e.initializeAccount3InstructionData=void 0;const r=n(96346),i=n(28813),o=n(27158),s=n(8075),a=n(35434),c=n(31886);function u({programId:t,keys:[n,r],data:i}){return{programId:t,keys:{account:n,mint:r},data:e.initializeAccount3InstructionData.decode(i)}}e.initializeAccount3InstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,i.publicKey)("owner")]),e.createInitializeAccount3Instruction=function(t,n,r,i=s.TOKEN_PROGRAM_ID){const a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1}],u=Buffer.alloc(e.initializeAccount3InstructionData.span);return e.initializeAccount3InstructionData.encode({instruction:c.TokenInstruction.InitializeAccount3,owner:r},u),new o.TransactionInstruction({keys:a,programId:i,data:u})},e.decodeInitializeAccount3Instruction=function(t,n=s.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new a.TokenInvalidInstructionProgramError;if(t.data.length!==e.initializeAccount3InstructionData.span)throw new a.TokenInvalidInstructionDataError;const{keys:{account:r,mint:i},data:o}=u(t);if(o.instruction!==c.TokenInstruction.InitializeAccount3)throw new a.TokenInvalidInstructionTypeError;if(!r||!i)throw new a.TokenInvalidInstructionKeysError;return{programId:n,keys:{account:r,mint:i},data:o}},e.decodeInitializeAccount3InstructionUnchecked=u},4:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeInitializeImmutableOwnerInstructionUnchecked=e.decodeInitializeImmutableOwnerInstruction=e.createInitializeImmutableOwnerInstruction=e.initializeImmutableOwnerInstructionData=void 0;const r=n(96346),i=n(27158),o=n(35434),s=n(31886);function a({programId:t,keys:[n],data:r}){const{instruction:i}=e.initializeImmutableOwnerInstructionData.decode(r);return{programId:t,keys:{account:n},data:{instruction:i}}}e.initializeImmutableOwnerInstructionData=(0,r.struct)([(0,r.u8)("instruction")]),e.createInitializeImmutableOwnerInstruction=function(t,n){const r=[{pubkey:t,isSigner:!1,isWritable:!0}],o=Buffer.alloc(e.initializeImmutableOwnerInstructionData.span);return e.initializeImmutableOwnerInstructionData.encode({instruction:s.TokenInstruction.InitializeImmutableOwner},o),new i.TransactionInstruction({keys:r,programId:n,data:o})},e.decodeInitializeImmutableOwnerInstruction=function(t,n){if(!t.programId.equals(n))throw new o.TokenInvalidInstructionProgramError;if(t.data.length!==e.initializeImmutableOwnerInstructionData.span)throw new o.TokenInvalidInstructionDataError;const{keys:{account:r},data:i}=a(t);if(i.instruction!==s.TokenInstruction.InitializeImmutableOwner)throw new o.TokenInvalidInstructionTypeError;if(!r)throw new o.TokenInvalidInstructionKeysError;return{programId:n,keys:{account:r},data:i}},e.decodeInitializeImmutableOwnerInstructionUnchecked=a},54330:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeInitializeMintInstructionUnchecked=e.decodeInitializeMintInstruction=e.createInitializeMintInstruction=e.initializeMintInstructionData=void 0;const r=n(96346),i=n(28813),o=n(27158),s=n(8075),a=n(35434),c=n(31886);function u({programId:t,keys:[n,r],data:i}){const{instruction:o,decimals:s,mintAuthority:a,freezeAuthorityOption:c,freezeAuthority:u}=e.initializeMintInstructionData.decode(i);return{programId:t,keys:{mint:n,rent:r},data:{instruction:o,decimals:s,mintAuthority:a,freezeAuthority:c?u:null}}}e.initializeMintInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,r.u8)("decimals"),(0,i.publicKey)("mintAuthority"),(0,r.u8)("freezeAuthorityOption"),(0,i.publicKey)("freezeAuthority")]),e.createInitializeMintInstruction=function(t,n,r,i,a=s.TOKEN_PROGRAM_ID){const u=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:o.SYSVAR_RENT_PUBKEY,isSigner:!1,isWritable:!1}],l=Buffer.alloc(e.initializeMintInstructionData.span);return e.initializeMintInstructionData.encode({instruction:c.TokenInstruction.InitializeMint,decimals:n,mintAuthority:r,freezeAuthorityOption:i?1:0,freezeAuthority:i||new o.PublicKey(0)},l),new o.TransactionInstruction({keys:u,programId:a,data:l})},e.decodeInitializeMintInstruction=function(t,n=s.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new a.TokenInvalidInstructionProgramError;if(t.data.length!==e.initializeMintInstructionData.span)throw new a.TokenInvalidInstructionDataError;const{keys:{mint:r,rent:i},data:o}=u(t);if(o.instruction!==c.TokenInstruction.InitializeMint)throw new a.TokenInvalidInstructionTypeError;if(!r||!i)throw new a.TokenInvalidInstructionKeysError;return{programId:n,keys:{mint:r,rent:i},data:o}},e.decodeInitializeMintInstructionUnchecked=u},38631:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeInitializeMint2InstructionUnchecked=e.decodeInitializeMint2Instruction=e.createInitializeMint2Instruction=e.initializeMint2InstructionData=void 0;const r=n(96346),i=n(28813),o=n(27158),s=n(8075),a=n(35434),c=n(31886);function u({programId:t,keys:[n],data:r}){const{instruction:i,decimals:o,mintAuthority:s,freezeAuthorityOption:a,freezeAuthority:c}=e.initializeMint2InstructionData.decode(r);return{programId:t,keys:{mint:n},data:{instruction:i,decimals:o,mintAuthority:s,freezeAuthority:a?c:null}}}e.initializeMint2InstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,r.u8)("decimals"),(0,i.publicKey)("mintAuthority"),(0,r.u8)("freezeAuthorityOption"),(0,i.publicKey)("freezeAuthority")]),e.createInitializeMint2Instruction=function(t,n,r,i,a=s.TOKEN_PROGRAM_ID){const u=[{pubkey:t,isSigner:!1,isWritable:!0}],l=Buffer.alloc(e.initializeMint2InstructionData.span);return e.initializeMint2InstructionData.encode({instruction:c.TokenInstruction.InitializeMint2,decimals:n,mintAuthority:r,freezeAuthorityOption:i?1:0,freezeAuthority:i||new o.PublicKey(0)},l),new o.TransactionInstruction({keys:u,programId:a,data:l})},e.decodeInitializeMint2Instruction=function(t,n=s.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new a.TokenInvalidInstructionProgramError;if(t.data.length!==e.initializeMint2InstructionData.span)throw new a.TokenInvalidInstructionDataError;const{keys:{mint:r},data:i}=u(t);if(i.instruction!==c.TokenInstruction.InitializeMint2)throw new a.TokenInvalidInstructionTypeError;if(!r)throw new a.TokenInvalidInstructionKeysError;return{programId:n,keys:{mint:r},data:i}},e.decodeInitializeMint2InstructionUnchecked=u},93434:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeInitializeMintCloseAuthorityInstructionUnchecked=e.decodeInitializeMintCloseAuthorityInstruction=e.createInitializeMintCloseAuthorityInstruction=e.initializeMintCloseAuthorityInstructionData=void 0;const r=n(96346),i=n(28813),o=n(27158),s=n(8075),a=n(35434),c=n(31886);function u({programId:t,keys:[n],data:r}){const{instruction:i,closeAuthorityOption:o,closeAuthority:s}=e.initializeMintCloseAuthorityInstructionData.decode(r);return{programId:t,keys:{mint:n},data:{instruction:i,closeAuthority:o?s:null}}}e.initializeMintCloseAuthorityInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,r.u8)("closeAuthorityOption"),(0,i.publicKey)("closeAuthority")]),e.createInitializeMintCloseAuthorityInstruction=function(t,n,r){if(!(0,s.programSupportsExtensions)(r))throw new a.TokenUnsupportedInstructionError;const i=[{pubkey:t,isSigner:!1,isWritable:!0}],u=Buffer.alloc(e.initializeMintCloseAuthorityInstructionData.span);return e.initializeMintCloseAuthorityInstructionData.encode({instruction:c.TokenInstruction.InitializeMintCloseAuthority,closeAuthorityOption:n?1:0,closeAuthority:n||new o.PublicKey(0)},u),new o.TransactionInstruction({keys:i,programId:r,data:u})},e.decodeInitializeMintCloseAuthorityInstruction=function(t,n){if(!t.programId.equals(n))throw new a.TokenInvalidInstructionProgramError;if(t.data.length!==e.initializeMintCloseAuthorityInstructionData.span)throw new a.TokenInvalidInstructionDataError;const{keys:{mint:r},data:i}=u(t);if(i.instruction!==c.TokenInstruction.InitializeMintCloseAuthority)throw new a.TokenInvalidInstructionTypeError;if(!r)throw new a.TokenInvalidInstructionKeysError;return{programId:n,keys:{mint:r},data:i}},e.decodeInitializeMintCloseAuthorityInstructionUnchecked=u},46433:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeInitializeMultisigInstructionUnchecked=e.decodeInitializeMultisigInstruction=e.createInitializeMultisigInstruction=e.initializeMultisigInstructionData=void 0;const r=n(96346),i=n(27158),o=n(8075),s=n(35434),a=n(31886);function c({programId:t,keys:[n,r,...i],data:o}){return{programId:t,keys:{account:n,rent:r,signers:i},data:e.initializeMultisigInstructionData.decode(o)}}e.initializeMultisigInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,r.u8)("m")]),e.createInitializeMultisigInstruction=function(t,n,r,s=o.TOKEN_PROGRAM_ID){const c=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i.SYSVAR_RENT_PUBKEY,isSigner:!1,isWritable:!1}];for(const e of n)c.push({pubkey:e,isSigner:!1,isWritable:!1});const u=Buffer.alloc(e.initializeMultisigInstructionData.span);return e.initializeMultisigInstructionData.encode({instruction:a.TokenInstruction.InitializeMultisig,m:r},u),new i.TransactionInstruction({keys:c,programId:s,data:u})},e.decodeInitializeMultisigInstruction=function(t,n=o.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new s.TokenInvalidInstructionProgramError;if(t.data.length!==e.initializeMultisigInstructionData.span)throw new s.TokenInvalidInstructionDataError;const{keys:{account:r,rent:i,signers:u},data:l}=c(t);if(l.instruction!==a.TokenInstruction.InitializeMultisig)throw new s.TokenInvalidInstructionTypeError;if(!r||!i||!u.length)throw new s.TokenInvalidInstructionKeysError;return{programId:n,keys:{account:r,rent:i,signers:u},data:l}},e.decodeInitializeMultisigInstructionUnchecked=c},89326:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},33817:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createInitializeNonTransferableMintInstruction=e.initializeNonTransferableMintInstructionData=void 0;const r=n(96346),i=n(27158),o=n(8075),s=n(35434),a=n(31886);e.initializeNonTransferableMintInstructionData=(0,r.struct)([(0,r.u8)("instruction")]),e.createInitializeNonTransferableMintInstruction=function(t,n){if(!(0,o.programSupportsExtensions)(n))throw new s.TokenUnsupportedInstructionError;const r=[{pubkey:t,isSigner:!1,isWritable:!0}],c=Buffer.alloc(e.initializeNonTransferableMintInstructionData.span);return e.initializeNonTransferableMintInstructionData.encode({instruction:a.TokenInstruction.InitializeNonTransferableMint},c),new i.TransactionInstruction({keys:r,programId:n,data:c})}},61081:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.addSigners=void 0,e.addSigners=function(t,e,n){if(n.length){t.push({pubkey:e,isSigner:!1,isWritable:!1});for(const e of n)t.push({pubkey:e.publicKey,isSigner:!0,isWritable:!1})}else t.push({pubkey:e,isSigner:!0,isWritable:!1});return t}},36514:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeMintToInstructionUnchecked=e.decodeMintToInstruction=e.createMintToInstruction=e.mintToInstructionData=void 0;const r=n(96346),i=n(28813),o=n(27158),s=n(8075),a=n(35434),c=n(61081),u=n(31886);function l({programId:t,keys:[n,r,i,...o],data:s}){return{programId:t,keys:{mint:n,destination:r,authority:i,multiSigners:o},data:e.mintToInstructionData.decode(s)}}e.mintToInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,i.u64)("amount")]),e.createMintToInstruction=function(t,n,r,i,a=[],l=s.TOKEN_PROGRAM_ID){const d=(0,c.addSigners)([{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0}],r,a),h=Buffer.alloc(e.mintToInstructionData.span);return e.mintToInstructionData.encode({instruction:u.TokenInstruction.MintTo,amount:BigInt(i)},h),new o.TransactionInstruction({keys:d,programId:l,data:h})},e.decodeMintToInstruction=function(t,n=s.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new a.TokenInvalidInstructionProgramError;if(t.data.length!==e.mintToInstructionData.span)throw new a.TokenInvalidInstructionDataError;const{keys:{mint:r,destination:i,authority:o,multiSigners:c},data:d}=l(t);if(d.instruction!==u.TokenInstruction.MintTo)throw new a.TokenInvalidInstructionTypeError;if(!r||!i||!o)throw new a.TokenInvalidInstructionKeysError;return{programId:n,keys:{mint:r,destination:i,authority:o,multiSigners:c},data:d}},e.decodeMintToInstructionUnchecked=l},11702:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeMintToCheckedInstructionUnchecked=e.decodeMintToCheckedInstruction=e.createMintToCheckedInstruction=e.mintToCheckedInstructionData=void 0;const r=n(96346),i=n(28813),o=n(27158),s=n(8075),a=n(35434),c=n(61081),u=n(31886);function l({programId:t,keys:[n,r,i,...o],data:s}){return{programId:t,keys:{mint:n,destination:r,authority:i,multiSigners:o},data:e.mintToCheckedInstructionData.decode(s)}}e.mintToCheckedInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,i.u64)("amount"),(0,r.u8)("decimals")]),e.createMintToCheckedInstruction=function(t,n,r,i,a,l=[],d=s.TOKEN_PROGRAM_ID){const h=(0,c.addSigners)([{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0}],r,l),f=Buffer.alloc(e.mintToCheckedInstructionData.span);return e.mintToCheckedInstructionData.encode({instruction:u.TokenInstruction.MintToChecked,amount:BigInt(i),decimals:a},f),new o.TransactionInstruction({keys:h,programId:d,data:f})},e.decodeMintToCheckedInstruction=function(t,n=s.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new a.TokenInvalidInstructionProgramError;if(t.data.length!==e.mintToCheckedInstructionData.span)throw new a.TokenInvalidInstructionDataError;const{keys:{mint:r,destination:i,authority:o,multiSigners:c},data:d}=l(t);if(d.instruction!==u.TokenInstruction.MintToChecked)throw new a.TokenInvalidInstructionTypeError;if(!r||!i||!o)throw new a.TokenInvalidInstructionKeysError;return{programId:n,keys:{mint:r,destination:i,authority:o,multiSigners:c},data:d}},e.decodeMintToCheckedInstructionUnchecked=l},27892:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createReallocateInstruction=void 0;const r=n(96346),i=n(27158),o=n(8075),s=n(35434),a=n(61081),c=n(31886);e.createReallocateInstruction=function(t,e,n,u,l=[],d=o.TOKEN_2022_PROGRAM_ID){if(!(0,o.programSupportsExtensions)(d))throw new s.TokenUnsupportedInstructionError;const h=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:e,isSigner:!0,isWritable:!0},{pubkey:i.SystemProgram.programId,isSigner:!1,isWritable:!1}],f=(0,a.addSigners)(h,u,l),p=(0,r.struct)([(0,r.u8)("instruction"),(0,r.seq)((0,r.u16)(),n.length,"extensionTypes")]),y=Buffer.alloc(p.span);return p.encode({instruction:c.TokenInstruction.Reallocate,extensionTypes:n},y),new i.TransactionInstruction({keys:f,programId:d,data:y})}},26248:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeRevokeInstructionUnchecked=e.decodeRevokeInstruction=e.createRevokeInstruction=e.revokeInstructionData=void 0;const r=n(96346),i=n(27158),o=n(8075),s=n(35434),a=n(61081),c=n(31886);function u({programId:t,keys:[n,r,...i],data:o}){return{programId:t,keys:{account:n,owner:r,multiSigners:i},data:e.revokeInstructionData.decode(o)}}e.revokeInstructionData=(0,r.struct)([(0,r.u8)("instruction")]),e.createRevokeInstruction=function(t,n,r=[],s=o.TOKEN_PROGRAM_ID){const u=(0,a.addSigners)([{pubkey:t,isSigner:!1,isWritable:!0}],n,r),l=Buffer.alloc(e.revokeInstructionData.span);return e.revokeInstructionData.encode({instruction:c.TokenInstruction.Revoke},l),new i.TransactionInstruction({keys:u,programId:s,data:l})},e.decodeRevokeInstruction=function(t,n=o.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new s.TokenInvalidInstructionProgramError;if(t.data.length!==e.revokeInstructionData.span)throw new s.TokenInvalidInstructionDataError;const{keys:{account:r,owner:i,multiSigners:a},data:l}=u(t);if(l.instruction!==c.TokenInstruction.Revoke)throw new s.TokenInvalidInstructionTypeError;if(!r||!i)throw new s.TokenInvalidInstructionKeysError;return{programId:n,keys:{account:r,owner:i,multiSigners:a},data:l}},e.decodeRevokeInstructionUnchecked=u},13249:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeSetAuthorityInstructionUnchecked=e.decodeSetAuthorityInstruction=e.createSetAuthorityInstruction=e.setAuthorityInstructionData=e.AuthorityType=void 0;const r=n(96346),i=n(28813),o=n(27158),s=n(8075),a=n(35434),c=n(61081),u=n(31886);function l({programId:t,keys:[n,r,...i],data:o}){const{instruction:s,authorityType:a,newAuthorityOption:c,newAuthority:u}=e.setAuthorityInstructionData.decode(o);return{programId:t,keys:{account:n,currentAuthority:r,multiSigners:i},data:{instruction:s,authorityType:a,newAuthority:c?u:null}}}!function(t){t[t.MintTokens=0]="MintTokens",t[t.FreezeAccount=1]="FreezeAccount",t[t.AccountOwner=2]="AccountOwner",t[t.CloseAccount=3]="CloseAccount"}(e.AuthorityType||(e.AuthorityType={})),e.setAuthorityInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,r.u8)("authorityType"),(0,r.u8)("newAuthorityOption"),(0,i.publicKey)("newAuthority")]),e.createSetAuthorityInstruction=function(t,n,r,i,a=[],l=s.TOKEN_PROGRAM_ID){const d=(0,c.addSigners)([{pubkey:t,isSigner:!1,isWritable:!0}],n,a),h=Buffer.alloc(e.setAuthorityInstructionData.span);return e.setAuthorityInstructionData.encode({instruction:u.TokenInstruction.SetAuthority,authorityType:r,newAuthorityOption:i?1:0,newAuthority:i||new o.PublicKey(0)},h),new o.TransactionInstruction({keys:d,programId:l,data:h})},e.decodeSetAuthorityInstruction=function(t,n=s.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new a.TokenInvalidInstructionProgramError;if(t.data.length!==e.setAuthorityInstructionData.span)throw new a.TokenInvalidInstructionDataError;const{keys:{account:r,currentAuthority:i,multiSigners:o},data:c}=l(t);if(c.instruction!==u.TokenInstruction.SetAuthority)throw new a.TokenInvalidInstructionTypeError;if(!r||!i)throw new a.TokenInvalidInstructionKeysError;return{programId:n,keys:{account:r,currentAuthority:i,multiSigners:o},data:c}},e.decodeSetAuthorityInstructionUnchecked=l},20096:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeSyncNativeInstructionUnchecked=e.decodeSyncNativeInstruction=e.createSyncNativeInstruction=e.syncNativeInstructionData=void 0;const r=n(96346),i=n(27158),o=n(8075),s=n(35434),a=n(31886);function c({programId:t,keys:[n],data:r}){return{programId:t,keys:{account:n},data:e.syncNativeInstructionData.decode(r)}}e.syncNativeInstructionData=(0,r.struct)([(0,r.u8)("instruction")]),e.createSyncNativeInstruction=function(t,n=o.TOKEN_PROGRAM_ID){const r=[{pubkey:t,isSigner:!1,isWritable:!0}],s=Buffer.alloc(e.syncNativeInstructionData.span);return e.syncNativeInstructionData.encode({instruction:a.TokenInstruction.SyncNative},s),new i.TransactionInstruction({keys:r,programId:n,data:s})},e.decodeSyncNativeInstruction=function(t,n=o.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new s.TokenInvalidInstructionProgramError;if(t.data.length!==e.syncNativeInstructionData.span)throw new s.TokenInvalidInstructionDataError;const{keys:{account:r},data:i}=c(t);if(i.instruction!==a.TokenInstruction.SyncNative)throw new s.TokenInvalidInstructionTypeError;if(!r)throw new s.TokenInvalidInstructionKeysError;return{programId:n,keys:{account:r},data:i}},e.decodeSyncNativeInstructionUnchecked=c},7765:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeThawAccountInstructionUnchecked=e.decodeThawAccountInstruction=e.createThawAccountInstruction=e.thawAccountInstructionData=void 0;const r=n(96346),i=n(27158),o=n(8075),s=n(35434),a=n(61081),c=n(31886);function u({programId:t,keys:[n,r,i,...o],data:s}){return{programId:t,keys:{account:n,mint:r,authority:i,multiSigners:o},data:e.thawAccountInstructionData.decode(s)}}e.thawAccountInstructionData=(0,r.struct)([(0,r.u8)("instruction")]),e.createThawAccountInstruction=function(t,n,r,s=[],u=o.TOKEN_PROGRAM_ID){const l=(0,a.addSigners)([{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1}],r,s),d=Buffer.alloc(e.thawAccountInstructionData.span);return e.thawAccountInstructionData.encode({instruction:c.TokenInstruction.ThawAccount},d),new i.TransactionInstruction({keys:l,programId:u,data:d})},e.decodeThawAccountInstruction=function(t,n=o.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new s.TokenInvalidInstructionProgramError;if(t.data.length!==e.thawAccountInstructionData.span)throw new s.TokenInvalidInstructionDataError;const{keys:{account:r,mint:i,authority:a,multiSigners:l},data:d}=u(t);if(d.instruction!==c.TokenInstruction.ThawAccount)throw new s.TokenInvalidInstructionTypeError;if(!r||!i||!a)throw new s.TokenInvalidInstructionKeysError;return{programId:n,keys:{account:r,mint:i,authority:a,multiSigners:l},data:d}},e.decodeThawAccountInstructionUnchecked=u},22990:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeTransferInstructionUnchecked=e.decodeTransferInstruction=e.createTransferInstruction=e.transferInstructionData=void 0;const r=n(96346),i=n(28813),o=n(27158),s=n(8075),a=n(35434),c=n(61081),u=n(31886);function l({programId:t,keys:[n,r,i,...o],data:s}){return{programId:t,keys:{source:n,destination:r,owner:i,multiSigners:o},data:e.transferInstructionData.decode(s)}}e.transferInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,i.u64)("amount")]),e.createTransferInstruction=function(t,n,r,i,a=[],l=s.TOKEN_PROGRAM_ID){const d=(0,c.addSigners)([{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0}],r,a),h=Buffer.alloc(e.transferInstructionData.span);return e.transferInstructionData.encode({instruction:u.TokenInstruction.Transfer,amount:BigInt(i)},h),new o.TransactionInstruction({keys:d,programId:l,data:h})},e.decodeTransferInstruction=function(t,n=s.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new a.TokenInvalidInstructionProgramError;if(t.data.length!==e.transferInstructionData.span)throw new a.TokenInvalidInstructionDataError;const{keys:{source:r,destination:i,owner:o,multiSigners:c},data:d}=l(t);if(d.instruction!==u.TokenInstruction.Transfer)throw new a.TokenInvalidInstructionTypeError;if(!r||!i||!o)throw new a.TokenInvalidInstructionKeysError;return{programId:n,keys:{source:r,destination:i,owner:o,multiSigners:c},data:d}},e.decodeTransferInstructionUnchecked=l},67997:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeTransferCheckedInstructionUnchecked=e.decodeTransferCheckedInstruction=e.createTransferCheckedInstruction=e.transferCheckedInstructionData=void 0;const r=n(96346),i=n(28813),o=n(27158),s=n(8075),a=n(35434),c=n(61081),u=n(31886);function l({programId:t,keys:[n,r,i,o,...s],data:a}){return{programId:t,keys:{source:n,mint:r,destination:i,owner:o,multiSigners:s},data:e.transferCheckedInstructionData.decode(a)}}e.transferCheckedInstructionData=(0,r.struct)([(0,r.u8)("instruction"),(0,i.u64)("amount"),(0,r.u8)("decimals")]),e.createTransferCheckedInstruction=function(t,n,r,i,a,l,d=[],h=s.TOKEN_PROGRAM_ID){const f=(0,c.addSigners)([{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!1,isWritable:!0}],i,d),p=Buffer.alloc(e.transferCheckedInstructionData.span);return e.transferCheckedInstructionData.encode({instruction:u.TokenInstruction.TransferChecked,amount:BigInt(a),decimals:l},p),new o.TransactionInstruction({keys:f,programId:h,data:p})},e.decodeTransferCheckedInstruction=function(t,n=s.TOKEN_PROGRAM_ID){if(!t.programId.equals(n))throw new a.TokenInvalidInstructionProgramError;if(t.data.length!==e.transferCheckedInstructionData.span)throw new a.TokenInvalidInstructionDataError;const{keys:{source:r,mint:i,destination:o,owner:c,multiSigners:d},data:h}=l(t);if(h.instruction!==u.TokenInstruction.TransferChecked)throw new a.TokenInvalidInstructionTypeError;if(!(r&&i&&o&&c))throw new a.TokenInvalidInstructionKeysError;return{programId:n,keys:{source:r,mint:i,destination:o,owner:c,multiSigners:d},data:h}},e.decodeTransferCheckedInstructionUnchecked=l},31886:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TokenInstruction=void 0,function(t){t[t.InitializeMint=0]="InitializeMint",t[t.InitializeAccount=1]="InitializeAccount",t[t.InitializeMultisig=2]="InitializeMultisig",t[t.Transfer=3]="Transfer",t[t.Approve=4]="Approve",t[t.Revoke=5]="Revoke",t[t.SetAuthority=6]="SetAuthority",t[t.MintTo=7]="MintTo",t[t.Burn=8]="Burn",t[t.CloseAccount=9]="CloseAccount",t[t.FreezeAccount=10]="FreezeAccount",t[t.ThawAccount=11]="ThawAccount",t[t.TransferChecked=12]="TransferChecked",t[t.ApproveChecked=13]="ApproveChecked",t[t.MintToChecked=14]="MintToChecked",t[t.BurnChecked=15]="BurnChecked",t[t.InitializeAccount2=16]="InitializeAccount2",t[t.SyncNative=17]="SyncNative",t[t.InitializeAccount3=18]="InitializeAccount3",t[t.InitializeMultisig2=19]="InitializeMultisig2",t[t.InitializeMint2=20]="InitializeMint2",t[t.GetAccountDataSize=21]="GetAccountDataSize",t[t.InitializeImmutableOwner=22]="InitializeImmutableOwner",t[t.AmountToUiAmount=23]="AmountToUiAmount",t[t.UiAmountToAmount=24]="UiAmountToAmount",t[t.InitializeMintCloseAuthority=25]="InitializeMintCloseAuthority",t[t.TransferFeeExtension=26]="TransferFeeExtension",t[t.ConfidentialTransferExtension=27]="ConfidentialTransferExtension",t[t.DefaultAccountStateExtension=28]="DefaultAccountStateExtension",t[t.Reallocate=29]="Reallocate",t[t.MemoTransferExtension=30]="MemoTransferExtension",t[t.CreateNativeMint=31]="CreateNativeMint",t[t.InitializeNonTransferableMint=32]="InitializeNonTransferableMint",t[t.InterestBearingMintExtension=33]="InterestBearingMintExtension"}(e.TokenInstruction||(e.TokenInstruction={}))},27776:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeUiAmountToAmountInstructionUnchecked=e.decodeUiAmountToAmountInstruction=e.createUiAmountToAmountInstruction=void 0;const r=n(96346),i=n(27158),o=n(8075),s=n(35434),a=n(31886);function c({programId:t,keys:[e],data:n}){return{programId:t,keys:{mint:e},data:(0,r.struct)([(0,r.u8)("instruction"),(0,r.blob)(n.length-1,"amount")]).decode(n)}}e.createUiAmountToAmountInstruction=function(t,e,n=o.TOKEN_PROGRAM_ID){const s=[{pubkey:t,isSigner:!1,isWritable:!1}],c=Buffer.from(e,"utf8"),u=(0,r.struct)([(0,r.u8)("instruction"),(0,r.blob)(c.length,"amount")]),l=Buffer.alloc(u.span);return u.encode({instruction:a.TokenInstruction.UiAmountToAmount,amount:c},l),new i.TransactionInstruction({keys:s,programId:n,data:l})},e.decodeUiAmountToAmountInstruction=function(t,e=o.TOKEN_PROGRAM_ID){if(!t.programId.equals(e))throw new s.TokenInvalidInstructionProgramError;const n=(0,r.struct)([(0,r.u8)("instruction"),(0,r.blob)(t.data.length-1,"amount")]);if(t.data.length!==n.span)throw new s.TokenInvalidInstructionDataError;const{keys:{mint:i},data:u}=c(t);if(u.instruction!==a.TokenInstruction.UiAmountToAmount)throw new s.TokenInvalidInstructionTypeError;if(!i)throw new s.TokenInvalidInstructionKeysError;return{programId:e,keys:{mint:i},data:u}},e.decodeUiAmountToAmountInstructionUnchecked=c},77014:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.unpackAccount=e.getMinimumBalanceForRentExemptAccountWithExtensions=e.getMinimumBalanceForRentExemptAccount=e.getMultipleAccounts=e.getAccount=e.ACCOUNT_SIZE=e.AccountLayout=e.AccountState=void 0;const i=n(96346),o=n(28813),s=n(8075),a=n(35434),c=n(6869),u=n(53907),l=n(74610);var d;function h(t,e,n){return r(this,void 0,void 0,(function*(){const r=(0,u.getAccountLen)(e);return yield t.getMinimumBalanceForRentExemption(r,n)}))}function f(t,n,r=s.TOKEN_PROGRAM_ID){if(!n)throw new a.TokenAccountNotFoundError;if(!n.owner.equals(r))throw new a.TokenInvalidAccountOwnerError;if(n.data.length<e.ACCOUNT_SIZE)throw new a.TokenInvalidAccountSizeError;const i=e.AccountLayout.decode(n.data.slice(0,e.ACCOUNT_SIZE));let o=Buffer.alloc(0);if(n.data.length>e.ACCOUNT_SIZE){if(n.data.length===l.MULTISIG_SIZE)throw new a.TokenInvalidAccountSizeError;if(n.data[e.ACCOUNT_SIZE]!=c.AccountType.Account)throw new a.TokenInvalidAccountError;o=n.data.slice(e.ACCOUNT_SIZE+c.ACCOUNT_TYPE_SIZE)}return{address:t,mint:i.mint,owner:i.owner,amount:i.amount,delegate:i.delegateOption?i.delegate:null,delegatedAmount:i.delegatedAmount,isInitialized:i.state!==d.Uninitialized,isFrozen:i.state===d.Frozen,isNative:!!i.isNativeOption,rentExemptReserve:i.isNativeOption?i.isNative:null,closeAuthority:i.closeAuthorityOption?i.closeAuthority:null,tlvData:o}}!function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initialized=1]="Initialized",t[t.Frozen=2]="Frozen"}(d=e.AccountState||(e.AccountState={})),e.AccountLayout=(0,i.struct)([(0,o.publicKey)("mint"),(0,o.publicKey)("owner"),(0,o.u64)("amount"),(0,i.u32)("delegateOption"),(0,o.publicKey)("delegate"),(0,i.u8)("state"),(0,i.u32)("isNativeOption"),(0,o.u64)("isNative"),(0,o.u64)("delegatedAmount"),(0,i.u32)("closeAuthorityOption"),(0,o.publicKey)("closeAuthority")]),e.ACCOUNT_SIZE=e.AccountLayout.span,e.getAccount=function(t,e,n,i=s.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const r=yield t.getAccountInfo(e,n);return f(e,r,i)}))},e.getMultipleAccounts=function(t,e,n,i=s.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const r=yield t.getMultipleAccountsInfo(e,n);return e.map(((t,e)=>f(t,r[e],i)))}))},e.getMinimumBalanceForRentExemptAccount=function(t,e){return r(this,void 0,void 0,(function*(){return yield h(t,[],e)}))},e.getMinimumBalanceForRentExemptAccountWithExtensions=h,e.unpackAccount=f},79235:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(77014),e),i(n(41022),e),i(n(74610),e)},41022:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.getAssociatedTokenAddressSync=e.getAssociatedTokenAddress=e.getMinimumBalanceForRentExemptMintWithExtensions=e.getMinimumBalanceForRentExemptMint=e.unpackMint=e.getMint=e.MINT_SIZE=e.MintLayout=void 0;const i=n(96346),o=n(28813),s=n(27158),a=n(8075),c=n(35434),u=n(6869),l=n(53907),d=n(77014),h=n(74610);function f(t,n,r=a.TOKEN_PROGRAM_ID){if(!n)throw new c.TokenAccountNotFoundError;if(!n.owner.equals(r))throw new c.TokenInvalidAccountOwnerError;if(n.data.length<e.MINT_SIZE)throw new c.TokenInvalidAccountSizeError;const i=e.MintLayout.decode(n.data.slice(0,e.MINT_SIZE));let o=Buffer.alloc(0);if(n.data.length>e.MINT_SIZE){if(n.data.length<=d.ACCOUNT_SIZE)throw new c.TokenInvalidAccountSizeError;if(n.data.length===h.MULTISIG_SIZE)throw new c.TokenInvalidAccountSizeError;if(n.data[d.ACCOUNT_SIZE]!=u.AccountType.Mint)throw new c.TokenInvalidMintError;o=n.data.slice(d.ACCOUNT_SIZE+u.ACCOUNT_TYPE_SIZE)}return{address:t,mintAuthority:i.mintAuthorityOption?i.mintAuthority:null,supply:i.supply,decimals:i.decimals,isInitialized:i.isInitialized,freezeAuthority:i.freezeAuthorityOption?i.freezeAuthority:null,tlvData:o}}function p(t,e,n){return r(this,void 0,void 0,(function*(){const r=(0,l.getMintLen)(e);return yield t.getMinimumBalanceForRentExemption(r,n)}))}e.MintLayout=(0,i.struct)([(0,i.u32)("mintAuthorityOption"),(0,o.publicKey)("mintAuthority"),(0,o.u64)("supply"),(0,i.u8)("decimals"),(0,o.bool)("isInitialized"),(0,i.u32)("freezeAuthorityOption"),(0,o.publicKey)("freezeAuthority")]),e.MINT_SIZE=e.MintLayout.span,e.getMint=function(t,e,n,i=a.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const r=yield t.getAccountInfo(e,n);return f(e,r,i)}))},e.unpackMint=f,e.getMinimumBalanceForRentExemptMint=function(t,e){return r(this,void 0,void 0,(function*(){return yield p(t,[],e)}))},e.getMinimumBalanceForRentExemptMintWithExtensions=p,e.getAssociatedTokenAddress=function(t,e,n=!1,i=a.TOKEN_PROGRAM_ID,o=a.ASSOCIATED_TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){if(!n&&!s.PublicKey.isOnCurve(e.toBuffer()))throw new c.TokenOwnerOffCurveError;const[r]=yield s.PublicKey.findProgramAddress([e.toBuffer(),i.toBuffer(),t.toBuffer()],o);return r}))},e.getAssociatedTokenAddressSync=function(t,e,n=!1,r=a.TOKEN_PROGRAM_ID,i=a.ASSOCIATED_TOKEN_PROGRAM_ID){if(!n&&!s.PublicKey.isOnCurve(e.toBuffer()))throw new c.TokenOwnerOffCurveError;const[o]=s.PublicKey.findProgramAddressSync([e.toBuffer(),r.toBuffer(),t.toBuffer()],i);return o}},74610:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{c(r.next(t))}catch(e){o(e)}}function a(t){try{c(r.throw(t))}catch(e){o(e)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.getMinimumBalanceForRentExemptMultisig=e.unpackMultisig=e.getMultisig=e.MULTISIG_SIZE=e.MultisigLayout=void 0;const i=n(96346),o=n(28813),s=n(8075),a=n(35434);function c(t,n,r=s.TOKEN_PROGRAM_ID){if(!n)throw new a.TokenAccountNotFoundError;if(!n.owner.equals(r))throw new a.TokenInvalidAccountOwnerError;if(n.data.length!=e.MULTISIG_SIZE)throw new a.TokenInvalidAccountSizeError;const i=e.MultisigLayout.decode(n.data);return Object.assign({address:t},i)}e.MultisigLayout=(0,i.struct)([(0,i.u8)("m"),(0,i.u8)("n"),(0,o.bool)("isInitialized"),(0,o.publicKey)("signer1"),(0,o.publicKey)("signer2"),(0,o.publicKey)("signer3"),(0,o.publicKey)("signer4"),(0,o.publicKey)("signer5"),(0,o.publicKey)("signer6"),(0,o.publicKey)("signer7"),(0,o.publicKey)("signer8"),(0,o.publicKey)("signer9"),(0,o.publicKey)("signer10"),(0,o.publicKey)("signer11")]),e.MULTISIG_SIZE=e.MultisigLayout.span,e.getMultisig=function(t,e,n,i=s.TOKEN_PROGRAM_ID){return r(this,void 0,void 0,(function*(){const r=yield t.getAccountInfo(e,n);return c(e,r,i)}))},e.unpackMultisig=c,e.getMinimumBalanceForRentExemptMultisig=function(t,n){return r(this,void 0,void 0,(function*(){return yield t.getMinimumBalanceForRentExemption(e.MULTISIG_SIZE,n)}))}},62191:t=>{"use strict";var e=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],n="undefined"==typeof globalThis?global:globalThis;t.exports=function(){for(var t=[],r=0;r<e.length;r++)"function"==typeof n[e[r]]&&(t[t.length]=e[r]);return t}},29765:(t,e,n)=>{"use strict";var r=n(67286)("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(i){r=null}t.exports=r},21686:(t,e,n)=>{"use strict";var r;n.d(e,{E9:()=>I,P6:()=>tt,Z_:()=>Y});var i=n(77378);const o=BigInt(0),s=BigInt(1),a=BigInt(2),c=BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),u=Object.freeze({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),P:BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),l:c,n:c,h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960")}),l=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),d=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),h=(BigInt("6853475219497561581579357271197624642482790079785650197046958215289687604742"),BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235")),f=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),p=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),y=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");class g{constructor(t,e,n,r){this.x=t,this.y=e,this.z=n,this.t=r}static fromAffine(t){if(!(t instanceof I))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return t.equals(I.ZERO)?g.ZERO:new g(t.x,t.y,s,C(t.x*t.y))}static toAffineBatch(t){const e=function(t,e=u.P){const n=new Array(t.length),r=U(t.reduce(((t,r,i)=>r===o?t:(n[i]=t,C(t*r,e))),s),e);return t.reduceRight(((t,r,i)=>r===o?t:(n[i]=C(t*n[i],e),C(t*r,e))),r),n}(t.map((t=>t.z)));return t.map(((t,n)=>t.toAffine(e[n])))}static normalizeZ(t){return this.toAffineBatch(t).map(this.fromAffine)}equals(t){m(t);const{x:e,y:n,z:r}=this,{x:i,y:o,z:s}=t,a=C(e*s),c=C(i*r),u=C(n*s),l=C(o*r);return a===c&&u===l}negate(){return new g(C(-this.x),this.y,this.z,C(-this.t))}double(){const{x:t,y:e,z:n}=this,{a:r}=u,i=C(t*t),o=C(e*e),s=C(a*C(n*n)),c=C(r*i),l=t+e,d=C(C(l*l)-i-o),h=c+o,f=h-s,p=c-o,y=C(d*f),m=C(h*p),b=C(d*p),w=C(f*h);return new g(y,m,w,b)}add(t){m(t);const{x:e,y:n,z:r,t:i}=this,{x:s,y:c,z:u,t:l}=t,d=C((n-e)*(c+s)),h=C((n+e)*(c-s)),f=C(h-d);if(f===o)return this.double();const p=C(r*a*l),y=C(i*a*u),b=y+p,w=h+d,k=y-p,v=C(b*f),I=C(w*k),A=C(b*k),_=C(f*w);return new g(v,I,_,A)}subtract(t){return this.add(t.negate())}precomputeWindow(t){const e=1+256/t,n=[];let r=this,i=r;for(let o=0;o<e;o++){i=r,n.push(i);for(let e=1;e<2**(t-1);e++)i=i.add(r),n.push(i);r=i.double()}return n}wNAF(t,e){!e&&this.equals(g.BASE)&&(e=I.BASE);const n=e&&e._WINDOW_SIZE||1;if(256%n)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let r=e&&v.get(e);r||(r=this.precomputeWindow(n),e&&1!==n&&(r=g.normalizeZ(r),v.set(e,r)));let i=g.ZERO,o=g.ZERO;const a=1+256/n,c=2**(n-1),u=BigInt(2**n-1),l=2**n,d=BigInt(n);for(let h=0;h<a;h++){const e=h*c;let n=Number(t&u);if(t>>=d,n>c&&(n-=l,t+=s),0===n){let t=r[e];h%2&&(t=t.negate()),o=o.add(t)}else{let t=r[e+Math.abs(n)-1];n<0&&(t=t.negate()),i=i.add(t)}}return g.normalizeZ([i,o])[0]}multiply(t,e){return this.wNAF(W(t,u.l),e)}multiplyUnsafe(t){let e=W(t,u.l,!1);const n=g.BASE,r=g.ZERO;if(e===o)return r;if(this.equals(r)||e===s)return this;if(this.equals(n))return this.wNAF(e);let i=r,a=this;for(;e>o;)e&s&&(i=i.add(a)),a=a.double(),e>>=s;return i}isSmallOrder(){return this.multiplyUnsafe(u.h).equals(g.ZERO)}isTorsionFree(){return this.multiplyUnsafe(u.l).equals(g.ZERO)}toAffine(t=U(this.z)){const{x:e,y:n,z:r}=this,i=C(e*t),o=C(n*t);if(C(r*t)!==s)throw new Error("invZ was invalid");return new I(i,o)}fromRistrettoBytes(){w()}toRistrettoBytes(){w()}fromRistrettoHash(){w()}}function m(t){if(!(t instanceof g))throw new TypeError("ExtendedPoint expected")}function b(t){if(!(t instanceof k))throw new TypeError("RistrettoPoint expected")}function w(){throw new Error("Legacy method: switch to RistrettoPoint")}g.BASE=new g(u.Gx,u.Gy,s,C(u.Gx*u.Gy)),g.ZERO=new g(o,s,s,o);class k{constructor(t){this.ep=t}static calcElligatorRistrettoMap(t){const{d:e}=u,n=C(d*t*t),r=C((n+s)*p);let i=BigInt(-1);const o=C((i-e*n)*C(n+e));let{isValid:a,value:c}=z(r,o),l=C(c*t);B(l)||(l=C(-l)),a||(c=l),a||(i=n);const f=C(i*(n-s)*y-o),m=c*c,b=C((c+c)*o),w=C(f*h),k=C(s-m),v=C(s+m);return new g(C(b*v),C(k*w),C(w*v),C(b*k))}static hashToCurve(t){const e=M((t=j(t,64)).slice(0,32)),n=this.calcElligatorRistrettoMap(e),r=M(t.slice(32,64)),i=this.calcElligatorRistrettoMap(r);return new k(n.add(i))}static fromHex(t){t=j(t,32);const{a:e,d:n}=u,r="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",i=M(t);if(!function(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}(P(i),t)||B(i))throw new Error(r);const a=C(i*i),c=C(s+e*a),l=C(s-e*a),d=C(c*c),h=C(l*l),f=C(e*n*d-h),{isValid:p,value:y}=K(C(f*h)),m=C(y*l),b=C(y*m*f);let w=C((i+i)*m);B(w)&&(w=C(-w));const v=C(c*b),I=C(w*v);if(!p||B(I)||v===o)throw new Error(r);return new k(new g(w,v,s,I))}toRawBytes(){let{x:t,y:e,z:n,t:r}=this.ep;const i=C(C(n+e)*C(n-e)),o=C(t*e),s=C(o*o),{value:a}=K(C(i*s)),c=C(a*i),u=C(a*o),l=C(c*u*r);let h;if(B(r*l)){let n=C(e*d),r=C(t*d);t=n,e=r,h=C(c*f)}else h=u;B(t*l)&&(e=C(-e));let p=C((n-e)*h);return B(p)&&(p=C(-p)),P(p)}toHex(){return E(this.toRawBytes())}toString(){return this.toHex()}equals(t){b(t);const e=this.ep,n=t.ep,r=C(e.x*n.y)===C(e.y*n.x),i=C(e.y*n.y)===C(e.x*n.x);return r||i}add(t){return b(t),new k(this.ep.add(t.ep))}subtract(t){return b(t),new k(this.ep.subtract(t.ep))}multiply(t){return new k(this.ep.multiply(t))}multiplyUnsafe(t){return new k(this.ep.multiplyUnsafe(t))}}k.BASE=new k(g.BASE),k.ZERO=new k(g.ZERO);const v=new WeakMap;class I{constructor(t,e){this.x=t,this.y=e}_setWindowSize(t){this._WINDOW_SIZE=t,v.delete(this)}static fromHex(t,e=!0){const{d:n,P:r}=u,i=(t=j(t,32)).slice();i[31]=-129&t[31];const o=O(i);if(e&&o>=r)throw new Error("Expected 0 < hex < P");if(!e&&o>=l)throw new Error("Expected 0 < hex < 2**256");const a=C(o*o),c=C(a-s),d=C(n*a+s);let{isValid:h,value:f}=z(c,d);if(!h)throw new Error("Point.fromHex: invalid y coordinate");const p=(f&s)===s;return 0!=(128&t[31])!==p&&(f=C(-f)),new I(f,o)}static async fromPrivateKey(t){return(await Z(t)).point}toRawBytes(){const t=P(this.y);return t[31]|=this.x&s?128:0,t}toHex(){return E(this.toRawBytes())}toX25519(){const{y:t}=this;return P(C((s+t)*U(s-t)))}isTorsionFree(){return g.fromAffine(this).isTorsionFree()}equals(t){return this.x===t.x&&this.y===t.y}negate(){return new I(C(-this.x),this.y)}add(t){return g.fromAffine(this).add(g.fromAffine(t)).toAffine()}subtract(t){return this.add(t.negate())}multiply(t){return g.fromAffine(this).multiply(t,this).toAffine()}}I.BASE=new I(u.Gx,u.Gy),I.ZERO=new I(o,s);class A{constructor(t,e){this.r=t,this.s=e,this.assertValidity()}static fromHex(t){const e=j(t,64),n=I.fromHex(e.slice(0,32),!1),r=O(e.slice(32,64));return new A(n,r)}assertValidity(){const{r:t,s:e}=this;if(!(t instanceof I))throw new Error("Expected Point instance");return W(e,u.l,!1),this}toRawBytes(){const t=new Uint8Array(64);return t.set(this.r.toRawBytes()),t.set(P(this.s),32),t}toHex(){return E(this.toRawBytes())}}function _(...t){if(!t.every((t=>t instanceof Uint8Array)))throw new Error("Expected Uint8Array list");if(1===t.length)return t[0];const e=t.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const e=t[r];n.set(e,i),i+=e.length}return n}const S=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function E(t){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");let e="";for(let n=0;n<t.length;n++)e+=S[t[n]];return e}function T(t){if("string"!=typeof t)throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const e=new Uint8Array(t.length/2);for(let n=0;n<e.length;n++){const r=2*n,i=t.slice(r,r+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");e[n]=o}return e}function x(t){return T(t.toString(16).padStart(64,"0"))}function P(t){return x(t).reverse()}function B(t){return(C(t)&s)===s}function O(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");return BigInt("0x"+E(Uint8Array.from(t).reverse()))}const R=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function M(t){return C(O(t)&R)}function C(t,e=u.P){const n=t%e;return n>=o?n:e+n}function U(t,e=u.P){if(t===o||e<=o)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=C(t,e),r=e,i=o,a=s,c=s,l=o;for(;n!==o;){const t=r/n,e=r%n,o=i-c*t,s=a-l*t;r=n,n=e,i=c,a=l,c=o,l=s}if(r!==s)throw new Error("invert: does not exist");return C(i,e)}function N(t,e){const{P:n}=u;let r=t;for(;e-- >o;)r*=r,r%=n;return r}function L(t){const{P:e}=u,n=BigInt(5),r=BigInt(10),i=BigInt(20),o=BigInt(40),c=BigInt(80),l=t*t%e*t%e,d=N(l,a)*l%e,h=N(d,s)*t%e,f=N(h,n)*h%e,p=N(f,r)*f%e,y=N(p,i)*p%e,g=N(y,o)*y%e,m=N(g,c)*g%e,b=N(m,c)*g%e,w=N(b,r)*f%e;return{pow_p_5_8:N(w,a)*t%e,b2:l}}function z(t,e){const n=C(e*e*e),r=C(n*n*e);let i=C(t*n*L(t*r).pow_p_5_8);const o=C(e*i*i),s=i,a=C(i*d),c=o===t,u=o===C(-t),l=o===C(-t*d);return c&&(i=s),(u||l)&&(i=a),B(i)&&(i=C(-i)),{isValid:c||u,value:i}}function K(t){return z(s,t)}function D(t){return C(O(t),u.l)}function j(t,e){const n=t instanceof Uint8Array?Uint8Array.from(t):T(t);if("number"==typeof e&&n.length!==e)throw new Error(`Expected ${e} bytes`);return n}function W(t,e,n=!0){if(!e)throw new TypeError("Specify max value");if("number"==typeof t&&Number.isSafeInteger(t)&&(t=BigInt(t)),"bigint"==typeof t&&t<e)if(n){if(o<t)return t}else if(o<=t)return t;throw new TypeError("Expected valid scalar: 0 < scalar < max")}function F(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function G(t){if(32!==(t="bigint"==typeof t||"number"==typeof t?x(W(t,l)):j(t)).length)throw new Error("Expected 32 bytes");return t}function H(t){const e=F(t.slice(0,32)),n=t.slice(32,64),r=D(e),i=I.BASE.multiply(r),o=i.toRawBytes();return{head:e,prefix:n,scalar:r,point:i,pointBytes:o}}let q;function $(...t){if("function"!=typeof q)throw new Error("utils.sha512Sync must be set to use sync methods");return q(...t)}async function Z(t){return H(await tt.sha512(G(t)))}function V(t){return H($(G(t)))}function X(t,e,n){e=j(e),n instanceof I||(n=I.fromHex(n,!1));const{r,s:i}=t instanceof A?t.assertValidity():A.fromHex(t);return{r,s:i,SB:g.BASE.multiplyUnsafe(i),pub:n,msg:e}}function J(t,e,n,r){const i=D(r),o=g.fromAffine(t).multiplyUnsafe(i);return g.fromAffine(e).add(o).subtract(n).multiplyUnsafe(u.h).equals(g.ZERO)}const Y={getExtendedPublicKey:V,getPublicKey:function(t){return V(t).pointBytes},sign:function(t,e){t=j(t);const{prefix:n,scalar:r,pointBytes:i}=V(e),o=D($(n,t)),s=I.BASE.multiply(o),a=C(o+D($(s.toRawBytes(),i,t))*r,u.l);return new A(s,a).toRawBytes()},verify:function(t,e,n){const{r,SB:i,msg:o,pub:s}=X(t,e,n),a=$(r.toRawBytes(),s.toRawBytes(),o);return J(s,r,i,a)}};I.BASE._setWindowSize(8);const Q={node:r||(r=n.t(i,2)),web:"object"==typeof self&&"crypto"in self?self.crypto:void 0},tt={bytesToHex:E,hexToBytes:T,concatBytes:_,getExtendedPublicKey:Z,mod:C,invert:U,TORSION_SUBGROUP:["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],hashToPrivateScalar:t=>{if((t=j(t)).length<40||t.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return C(O(t),u.l-s)+s},randomBytes:(t=32)=>{if(Q.web)return Q.web.getRandomValues(new Uint8Array(t));if(Q.node){const{randomBytes:e}=Q.node;return new Uint8Array(e(t).buffer)}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>tt.randomBytes(32),sha512:async(...t)=>{const e=_(...t);if(Q.web){const t=await Q.web.subtle.digest("SHA-512",e.buffer);return new Uint8Array(t)}if(Q.node)return Uint8Array.from(Q.node.createHash("sha512").update(e).digest());throw new Error("The environment doesn't have sha512 function")},precompute(t=8,e=I.BASE){const n=e.equals(I.BASE)?e:new I(e.x,e.y);return n._setWindowSize(t),n.multiply(a),n},sha512Sync:void 0};Object.defineProperties(tt,{sha512Sync:{configurable:!1,get:()=>q,set(t){q||(q=t)}}})},59629:(t,e,n)=>{"use strict";function r(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function i(t,...e){if(!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new TypeError(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}n.d(e,{ZP:()=>s});const o={number:r,bool:function(t){if("boolean"!=typeof t)throw new Error(`Expected boolean, not ${t}`)},bytes:i,hash:function(t){if("function"!=typeof t||"function"!=typeof t.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(t.outputLen),r(t.blockLen)},exists:function(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")},output:function(t,e){i(t);const n=e.outputLen;if(t.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}},s=o},5088:(t,e,n)=>{"use strict";n.d(e,{N:()=>o});var r=n(59629),i=n(94850);class o extends i.kb{constructor(t,e,n,r){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,i.GL)(this.buffer)}update(t){r.ZP.exists(this);const{view:e,buffer:n,blockLen:o}=this,s=(t=(0,i.O0)(t)).length;for(let r=0;r<s;){const a=Math.min(o-this.pos,s-r);if(a!==o)n.set(t.subarray(r,r+a),this.pos),this.pos+=a,r+=a,this.pos===o&&(this.process(e,0),this.pos=0);else{const e=(0,i.GL)(t);for(;o<=s-r;r+=o)this.process(e,r)}}return this.length+=t.length,this.roundClean(),this}digestInto(t){r.ZP.exists(this),r.ZP.output(t,this),this.finished=!0;const{buffer:e,view:n,blockLen:o,isLE:s}=this;let{pos:a}=this;e[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(n,0),a=0);for(let r=a;r<o;r++)e[r]=0;!function(t,e,n,r){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,n,r);const i=BigInt(32),o=BigInt(4294967295),s=Number(n>>i&o),a=Number(n&o),c=r?4:0,u=r?0:4;t.setUint32(e+c,s,r),t.setUint32(e+u,a,r)}(n,o-8,BigInt(8*this.length),s),this.process(n,0);const c=(0,i.GL)(t);this.get().forEach(((t,e)=>c.setUint32(4*e,t,s)))}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:n,length:r,finished:i,destroyed:o,pos:s}=this;return t.length=r,t.pos=s,t.finished=i,t.destroyed=o,r%e&&t.buffer.set(n),t}}},96541:(t,e,n)=>{"use strict";n.d(e,{ZP:()=>s});const r=BigInt(2**32-1),i=BigInt(32);function o(t,e=!1){return e?{h:Number(t&r),l:Number(t>>i&r)}:{h:0|Number(t>>i&r),l:0|Number(t&r)}}const s={fromBig:o,split:function(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:a}=o(t[i],e);[n[i],r[i]]=[s,a]}return[n,r]},toBig:(t,e)=>BigInt(t>>>0)<<i|BigInt(e>>>0),shrSH:(t,e,n)=>t>>>n,shrSL:(t,e,n)=>t<<32-n|e>>>n,rotrSH:(t,e,n)=>t>>>n|e<<32-n,rotrSL:(t,e,n)=>t<<32-n|e>>>n,rotrBH:(t,e,n)=>t<<64-n|e>>>n-32,rotrBL:(t,e,n)=>t>>>n-32|e<<64-n,rotr32H:(t,e)=>e,rotr32L:(t,e)=>t,rotlSH:(t,e,n)=>t<<n|e>>>32-n,rotlSL:(t,e,n)=>e<<n|t>>>32-n,rotlBH:(t,e,n)=>e<<n-32|t>>>64-n,rotlBL:(t,e,n)=>t<<n-32|e>>>64-n,add:function(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:0|i}},add3L:(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),add3H:(t,e,n,r)=>e+n+r+(t/2**32|0)|0,add4L:(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),add4H:(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,add5H:(t,e,n,r,i,o)=>e+n+r+i+o+(t/2**32|0)|0,add5L:(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0)}},10846:(t,e,n)=>{"use strict";n.d(e,{b:()=>s});var r=n(59629),i=n(94850);class o extends i.kb{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,r.ZP.hash(t);const n=(0,i.O0)(e);if(this.iHash=t.create(),!(this.iHash instanceof i.kb))throw new TypeError("Expected instance of class which extends utils.Hash");const o=this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;const s=new Uint8Array(o);s.set(n.length>this.iHash.blockLen?t.create().update(n).digest():n);for(let r=0;r<s.length;r++)s[r]^=54;this.iHash.update(s),this.oHash=t.create();for(let r=0;r<s.length;r++)s[r]^=106;this.oHash.update(s),s.fill(0)}update(t){return r.ZP.exists(this),this.iHash.update(t),this}digestInto(t){r.ZP.exists(this),r.ZP.bytes(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:n,finished:r,destroyed:i,blockLen:o,outputLen:s}=this;return t.finished=r,t.destroyed=i,t.blockLen=o,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const s=(t,e,n)=>new o(t,e).update(n).digest();s.create=(t,e)=>new o(t,e)},53929:(t,e,n)=>{"use strict";n.d(e,{J:()=>l});var r=n(5088),i=n(94850);const o=(t,e,n)=>t&e^t&n^e&n,s=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint32Array(64);class u extends r.N{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){const{A:t,B:e,C:n,D:r,E:i,F:o,G:s,H:a}=this;return[t,e,n,r,i,o,s,a]}set(t,e,n,r,i,o,s,a){this.A=0|t,this.B=0|e,this.C=0|n,this.D=0|r,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(t,e){for(let i=0;i<16;i++,e+=4)c[i]=t.getUint32(e,!1);for(let o=16;o<64;o++){const t=c[o-15],e=c[o-2],n=(0,i.np)(t,7)^(0,i.np)(t,18)^t>>>3,r=(0,i.np)(e,17)^(0,i.np)(e,19)^e>>>10;c[o]=r+c[o-7]+n+c[o-16]|0}let{A:n,B:r,C:a,D:u,E:l,F:d,G:h,H:f}=this;for(let y=0;y<64;y++){const t=f+((0,i.np)(l,6)^(0,i.np)(l,11)^(0,i.np)(l,25))+((p=l)&d^~p&h)+s[y]+c[y]|0,e=((0,i.np)(n,2)^(0,i.np)(n,13)^(0,i.np)(n,22))+o(n,r,a)|0;f=h,h=d,d=l,l=u+t|0,u=a,a=r,r=n,n=t+e|0}var p;n=n+this.A|0,r=r+this.B|0,a=a+this.C|0,u=u+this.D|0,l=l+this.E|0,d=d+this.F|0,h=h+this.G|0,f=f+this.H|0,this.set(n,r,a,u,l,d,h,f)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const l=(0,i.hE)((()=>new u))},48796:(t,e,n)=>{"use strict";n.d(e,{fr:()=>v});var r=n(59629),i=n(96541),o=n(94850);const[s,a,c]=[[],[],[]],u=BigInt(0),l=BigInt(1),d=BigInt(2),h=BigInt(7),f=BigInt(256),p=BigInt(113);for(let A=0,_=l,S=1,E=0;A<24;A++){[S,E]=[E,(2*S+3*E)%5],s.push(2*(5*E+S)),a.push((A+1)*(A+2)/2%64);let t=u;for(let e=0;e<7;e++)_=(_<<l^(_>>h)*p)%f,_&d&&(t^=l<<(l<<BigInt(e))-l);c.push(t)}const[y,g]=i.ZP.split(c,!0),m=(t,e,n)=>n>32?i.ZP.rotlBH(t,e,n):i.ZP.rotlSH(t,e,n),b=(t,e,n)=>n>32?i.ZP.rotlBL(t,e,n):i.ZP.rotlSL(t,e,n);class w extends o.kb{constructor(t,e,n,i=!1,s=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,r.ZP.number(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,o.Jq)(this.state)}keccak(){!function(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let r=0;r<10;r++)n[r]=t[r]^t[r+10]^t[r+20]^t[r+30]^t[r+40];for(let r=0;r<10;r+=2){const e=(r+8)%10,i=(r+2)%10,o=n[i],s=n[i+1],a=m(o,s,1)^n[e],c=b(o,s,1)^n[e+1];for(let n=0;n<50;n+=10)t[r+n]^=a,t[r+n+1]^=c}let e=t[2],i=t[3];for(let n=0;n<24;n++){const r=a[n],o=m(e,i,r),c=b(e,i,r),u=s[n];e=t[u],i=t[u+1],t[u]=o,t[u+1]=c}for(let r=0;r<50;r+=10){for(let e=0;e<10;e++)n[e]=t[r+e];for(let e=0;e<10;e++)t[r+e]^=~n[(e+2)%10]&n[(e+4)%10]}t[0]^=y[r],t[1]^=g[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){r.ZP.exists(this);const{blockLen:e,state:n}=this,i=(t=(0,o.O0)(t)).length;for(let r=0;r<i;){const o=Math.min(e-this.pos,i-r);for(let e=0;e<o;e++)n[this.pos++]^=t[r++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:e,pos:n,blockLen:r}=this;t[n]^=e,0!=(128&e)&&n===r-1&&this.keccak(),t[r-1]^=128,this.keccak()}writeInto(t){r.ZP.exists(this,!1),r.ZP.bytes(t),this.finish();const e=this.state,{blockLen:n}=this;for(let r=0,i=t.length;r<i;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,i-r);t.set(e.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return r.ZP.number(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(r.ZP.output(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:e,suffix:n,outputLen:r,rounds:i,enableXOF:o}=this;return t||(t=new w(e,n,r,o,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=n,t.outputLen=r,t.enableXOF=o,t.destroyed=this.destroyed,t}}const k=(t,e,n)=>(0,o.hE)((()=>new w(e,t,n))),v=(k(6,144,28),k(6,136,32),k(6,104,48),k(6,72,64),k(1,144,28),k(1,136,32)),I=(k(1,104,48),k(1,72,64),(t,e,n)=>(0,o.K$)(((r={})=>new w(e,t,void 0===r.dkLen?n:r.dkLen,!0))));I(31,168,16),I(31,136,32)},8448:(t,e,n)=>{"use strict";n.d(e,{o:()=>f});var r=n(5088),i=n(96541),o=n(94850);const[s,a]=i.ZP.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((t=>BigInt(t)))),c=new Uint32Array(80),u=new Uint32Array(80);class l extends r.N{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:e,Bh:n,Bl:r,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:u,Fh:l,Fl:d,Gh:h,Gl:f,Hh:p,Hl:y}=this;return[t,e,n,r,i,o,s,a,c,u,l,d,h,f,p,y]}set(t,e,n,r,i,o,s,a,c,u,l,d,h,f,p,y){this.Ah=0|t,this.Al=0|e,this.Bh=0|n,this.Bl=0|r,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|d,this.Gh=0|h,this.Gl=0|f,this.Hh=0|p,this.Hl=0|y}process(t,e){for(let i=0;i<16;i++,e+=4)c[i]=t.getUint32(e),u[i]=t.getUint32(e+=4);for(let s=16;s<80;s++){const t=0|c[s-15],e=0|u[s-15],n=i.ZP.rotrSH(t,e,1)^i.ZP.rotrSH(t,e,8)^i.ZP.shrSH(t,e,7),r=i.ZP.rotrSL(t,e,1)^i.ZP.rotrSL(t,e,8)^i.ZP.shrSL(t,e,7),o=0|c[s-2],a=0|u[s-2],l=i.ZP.rotrSH(o,a,19)^i.ZP.rotrBH(o,a,61)^i.ZP.shrSH(o,a,6),d=i.ZP.rotrSL(o,a,19)^i.ZP.rotrBL(o,a,61)^i.ZP.shrSL(o,a,6),h=i.ZP.add4L(r,d,u[s-7],u[s-16]),f=i.ZP.add4H(h,n,l,c[s-7],c[s-16]);c[s]=0|f,u[s]=0|h}let{Ah:n,Al:r,Bh:o,Bl:l,Ch:d,Cl:h,Dh:f,Dl:p,Eh:y,El:g,Fh:m,Fl:b,Gh:w,Gl:k,Hh:v,Hl:I}=this;for(let A=0;A<80;A++){const t=i.ZP.rotrSH(y,g,14)^i.ZP.rotrSH(y,g,18)^i.ZP.rotrBH(y,g,41),e=i.ZP.rotrSL(y,g,14)^i.ZP.rotrSL(y,g,18)^i.ZP.rotrBL(y,g,41),_=y&m^~y&w,S=g&b^~g&k,E=i.ZP.add5L(I,e,S,a[A],u[A]),T=i.ZP.add5H(E,v,t,_,s[A],c[A]),x=0|E,P=i.ZP.rotrSH(n,r,28)^i.ZP.rotrBH(n,r,34)^i.ZP.rotrBH(n,r,39),B=i.ZP.rotrSL(n,r,28)^i.ZP.rotrBL(n,r,34)^i.ZP.rotrBL(n,r,39),O=n&o^n&d^o&d,R=r&l^r&h^l&h;v=0|w,I=0|k,w=0|m,k=0|b,m=0|y,b=0|g,({h:y,l:g}=i.ZP.add(0|f,0|p,0|T,0|x)),f=0|d,p=0|h,d=0|o,h=0|l,o=0|n,l=0|r;const M=i.ZP.add3L(x,B,R);n=i.ZP.add3H(M,T,P,O),r=0|M}({h:n,l:r}=i.ZP.add(0|this.Ah,0|this.Al,0|n,0|r)),({h:o,l}=i.ZP.add(0|this.Bh,0|this.Bl,0|o,0|l)),({h:d,l:h}=i.ZP.add(0|this.Ch,0|this.Cl,0|d,0|h)),({h:f,l:p}=i.ZP.add(0|this.Dh,0|this.Dl,0|f,0|p)),({h:y,l:g}=i.ZP.add(0|this.Eh,0|this.El,0|y,0|g)),({h:m,l:b}=i.ZP.add(0|this.Fh,0|this.Fl,0|m,0|b)),({h:w,l:k}=i.ZP.add(0|this.Gh,0|this.Gl,0|w,0|k)),({h:v,l:I}=i.ZP.add(0|this.Hh,0|this.Hl,0|v,0|I)),this.set(n,r,o,l,d,h,f,p,y,g,m,b,w,k,v,I)}roundClean(){c.fill(0),u.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class d extends l{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class h extends l{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const f=(0,o.hE)((()=>new l));(0,o.hE)((()=>new d)),(0,o.hE)((()=>new h))},94850:(t,e,n)=>{"use strict";n.d(e,{kb:()=>a,GL:()=>i,np:()=>o,O0:()=>s,Jq:()=>r,hE:()=>c,K$:()=>u});"object"==typeof self&&"crypto"in self&&self.crypto;const r=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),i=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),o=(t,e)=>t<<32-e|t>>>e;if(!(68===new Uint8Array(new Uint32Array([287454020]).buffer)[0]))throw new Error("Non little-endian hardware is not supported");Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function s(t){if("string"==typeof t&&(t=function(t){if("string"!=typeof t)throw new TypeError("utf8ToBytes expected string, got "+typeof t);return(new TextEncoder).encode(t)}(t)),!(t instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof t})`);return t}class a{clone(){return this._cloneInto()}}function c(t){const e=e=>t().update(s(e)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function u(t){const e=(e,n)=>t(n).update(s(e)).digest(),n=t({});return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=e=>t(e),e}},89580:(t,e,n)=>{"use strict";var r;n.d(e,{$3:()=>$,P6:()=>nt,kS:()=>Q});var i=n(69314);const o=BigInt(0),s=BigInt(1),a=BigInt(2),c=BigInt(3),u=BigInt(8),l=Object.freeze({a:o,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:s,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")});function d(t){const{a:e,b:n}=l,r=R(t*t),i=R(r*t);return R(i+e*t+n)}const h=l.a===o;class f extends Error{constructor(t){super(t)}}class p{constructor(t,e,n){this.x=t,this.y=e,this.z=n}static fromAffine(t){if(!(t instanceof g))throw new TypeError("JacobianPoint#fromAffine: expected Point");return new p(t.x,t.y,s)}static toAffineBatch(t){const e=function(t,e=l.P){const n=new Array(t.length),r=C(t.reduce(((t,r,i)=>r===o?t:(n[i]=t,R(t*r,e))),s),e);return t.reduceRight(((t,r,i)=>r===o?t:(n[i]=R(t*n[i],e),R(t*r,e))),r),n}(t.map((t=>t.z)));return t.map(((t,n)=>t.toAffine(e[n])))}static normalizeZ(t){return p.toAffineBatch(t).map(p.fromAffine)}equals(t){if(!(t instanceof p))throw new TypeError("JacobianPoint expected");const{x:e,y:n,z:r}=this,{x:i,y:o,z:s}=t,a=R(r*r),c=R(s*s),u=R(e*c),l=R(i*a),d=R(R(n*s)*c),h=R(R(o*r)*a);return u===l&&d===h}negate(){return new p(this.x,R(-this.y),this.z)}double(){const{x:t,y:e,z:n}=this,r=R(t*t),i=R(e*e),o=R(i*i),s=t+i,l=R(a*(R(s*s)-r-o)),d=R(c*r),h=R(d*d),f=R(h-a*l),y=R(d*(l-f)-u*o),g=R(a*e*n);return new p(f,y,g)}add(t){if(!(t instanceof p))throw new TypeError("JacobianPoint expected");const{x:e,y:n,z:r}=this,{x:i,y:s,z:c}=t;if(i===o||s===o)return this;if(e===o||n===o)return t;const u=R(r*r),l=R(c*c),d=R(e*l),h=R(i*u),f=R(R(n*c)*l),y=R(R(s*r)*u),g=R(h-d),m=R(y-f);if(g===o)return m===o?this.double():p.ZERO;const b=R(g*g),w=R(g*b),k=R(d*b),v=R(m*m-w-a*k),I=R(m*(k-v)-f*w),A=R(r*c*g);return new p(v,I,A)}subtract(t){return this.add(t.negate())}multiplyUnsafe(t){const e=p.ZERO;if("bigint"==typeof t&&t===o)return e;let n=O(t);if(n===s)return this;if(!h){let t=e,r=this;for(;n>o;)n&s&&(t=t.add(r)),r=r.double(),n>>=s;return t}let{k1neg:r,k1:i,k2neg:a,k2:c}=L(n),u=e,d=e,f=this;for(;i>o||c>o;)i&s&&(u=u.add(f)),c&s&&(d=d.add(f)),f=f.double(),i>>=s,c>>=s;return r&&(u=u.negate()),a&&(d=d.negate()),d=new p(R(d.x*l.beta),d.y,d.z),u.add(d)}precomputeWindow(t){const e=h?128/t+1:256/t+1,n=[];let r=this,i=r;for(let o=0;o<e;o++){i=r,n.push(i);for(let e=1;e<2**(t-1);e++)i=i.add(r),n.push(i);r=i.double()}return n}wNAF(t,e){!e&&this.equals(p.BASE)&&(e=g.BASE);const n=e&&e._WINDOW_SIZE||1;if(256%n)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let r=e&&y.get(e);r||(r=this.precomputeWindow(n),e&&1!==n&&(r=p.normalizeZ(r),y.set(e,r)));let i=p.ZERO,o=p.ZERO;const a=1+(h?128/n:256/n),c=2**(n-1),u=BigInt(2**n-1),l=2**n,d=BigInt(n);for(let h=0;h<a;h++){const e=h*c;let n=Number(t&u);if(t>>=d,n>c&&(n-=l,t+=s),0===n){let t=r[e];h%2&&(t=t.negate()),o=o.add(t)}else{let t=r[e+Math.abs(n)-1];n<0&&(t=t.negate()),i=i.add(t)}}return{p:i,f:o}}multiply(t,e){let n,r,i=O(t);if(h){const{k1neg:t,k1:o,k2neg:s,k2:a}=L(i);let{p:c,f:u}=this.wNAF(o,e),{p:d,f:h}=this.wNAF(a,e);t&&(c=c.negate()),s&&(d=d.negate()),d=new p(R(d.x*l.beta),d.y,d.z),n=c.add(d),r=u.add(h)}else{const{p:t,f:o}=this.wNAF(i,e);n=t,r=o}return p.normalizeZ([n,r])[0]}toAffine(t=C(this.z)){const{x:e,y:n,z:r}=this,i=t,o=R(i*i),a=R(o*i),c=R(e*o),u=R(n*a);if(R(r*i)!==s)throw new Error("invZ was invalid");return new g(c,u)}}p.BASE=new p(l.Gx,l.Gy,s),p.ZERO=new p(o,s,o);const y=new WeakMap;class g{constructor(t,e){this.x=t,this.y=e}_setWindowSize(t){this._WINDOW_SIZE=t,y.delete(this)}hasEvenY(){return this.y%a===o}static fromCompressedHex(t){const e=32===t.length,n=P(e?t:t.subarray(1));if(!F(n))throw new Error("Point is not on curve");let r=function(t){const{P:e}=l,n=BigInt(6),r=BigInt(11),i=BigInt(22),o=BigInt(23),s=BigInt(44),u=BigInt(88),d=t*t*t%e,h=d*d*t%e,f=M(h,c)*h%e,p=M(f,c)*h%e,y=M(p,a)*d%e,g=M(y,r)*y%e,m=M(g,i)*g%e,b=M(m,s)*m%e,w=M(b,u)*b%e,k=M(w,s)*m%e,v=M(k,c)*h%e,I=M(v,o)*g%e,A=M(I,n)*d%e;return M(A,a)}(d(n));const i=(r&s)===s;if(e)i&&(r=R(-r));else{1==(1&t[0])!==i&&(r=R(-r))}const o=new g(n,r);return o.assertValidity(),o}static fromUncompressedHex(t){const e=P(t.subarray(1,33)),n=P(t.subarray(33,65)),r=new g(e,n);return r.assertValidity(),r}static fromHex(t){const e=B(t),n=e.length,r=e[0];if(32===n||33===n&&(2===r||3===r))return this.fromCompressedHex(e);if(65===n&&4===r)return this.fromUncompressedHex(e);throw new Error(`Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ${n}`)}static fromPrivateKey(t){return g.BASE.multiply(H(t))}static fromSignature(t,e,n){const r=z(t=B(t)),{r:i,s:o}=q(e);if(0!==n&&1!==n)throw new Error("Cannot recover signature: invalid recovery bit");const s=1&n?"03":"02",a=g.fromHex(s+_(i)),{n:c}=l,u=C(i,c),d=R(-r*u,c),h=R(o*u,c),f=g.BASE.multiplyAndAddUnsafe(a,d,h);if(!f)throw new Error("Cannot recover signature: point at infinify");return f.assertValidity(),f}toRawBytes(t=!1){return x(this.toHex(t))}toHex(t=!1){const e=_(this.x);if(t){return`${this.hasEvenY()?"02":"03"}${e}`}return`04${e}${_(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const t="Point is not on elliptic curve",{x:e,y:n}=this;if(!F(e)||!F(n))throw new Error(t);const r=R(n*n);if(R(r-d(e))!==o)throw new Error(t)}equals(t){return this.x===t.x&&this.y===t.y}negate(){return new g(this.x,R(-this.y))}double(){return p.fromAffine(this).double().toAffine()}add(t){return p.fromAffine(this).add(p.fromAffine(t)).toAffine()}subtract(t){return this.add(t.negate())}multiply(t){return p.fromAffine(this).multiply(t,this).toAffine()}multiplyAndAddUnsafe(t,e,n){const r=p.fromAffine(this),i=e===o||e===s||this!==g.BASE?r.multiplyUnsafe(e):r.multiply(e),a=p.fromAffine(t).multiplyUnsafe(n),c=i.add(a);return c.equals(p.ZERO)?void 0:c.toAffine()}}function m(t){return Number.parseInt(t[0],16)>=8?"00"+t:t}function b(t){if(t.length<2||2!==t[0])throw new Error(`Invalid signature integer tag: ${I(t)}`);const e=t[1],n=t.subarray(2,e+2);if(!e||n.length!==e)throw new Error("Invalid signature integer: wrong length");if(0===n[0]&&n[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:P(n),left:t.subarray(e+2)}}g.BASE=new g(l.Gx,l.Gy),g.ZERO=new g(o,o);class w{constructor(t,e){this.r=t,this.s=e,this.assertValidity()}static fromCompact(t){const e=t instanceof Uint8Array,n="Signature.fromCompact";if("string"!=typeof t&&!e)throw new TypeError(`${n}: Expected string or Uint8Array`);const r=e?I(t):t;if(128!==r.length)throw new Error(`${n}: Expected 64-byte hex`);return new w(T(r.slice(0,64)),T(r.slice(64,128)))}static fromDER(t){const e=t instanceof Uint8Array;if("string"!=typeof t&&!e)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r:n,s:r}=function(t){if(t.length<2||48!=t[0])throw new Error(`Invalid signature tag: ${I(t)}`);if(t[1]!==t.length-2)throw new Error("Invalid signature: incorrect length");const{data:e,left:n}=b(t.subarray(2)),{data:r,left:i}=b(n);if(i.length)throw new Error(`Invalid signature: left bytes after parsing: ${I(i)}`);return{r:e,s:r}}(e?t:x(t));return new w(n,r)}static fromHex(t){return this.fromDER(t)}assertValidity(){const{r:t,s:e}=this;if(!W(t))throw new Error("Invalid Signature: r must be 0 < r < n");if(!W(e))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const t=l.n>>s;return this.s>t}normalizeS(){return this.hasHighS()?new w(this.r,l.n-this.s):this}toDERRawBytes(t=!1){return x(this.toDERHex(t))}toDERHex(t=!1){const e=m(E(this.s));if(t)return e;const n=m(E(this.r)),r=E(n.length/2),i=E(e.length/2);return`30${E(n.length/2+e.length/2+4)}02${r}${n}02${i}${e}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return x(this.toCompactHex())}toCompactHex(){return _(this.r)+_(this.s)}}function k(...t){if(!t.every((t=>t instanceof Uint8Array)))throw new Error("Uint8Array list expected");if(1===t.length)return t[0];const e=t.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const e=t[r];n.set(e,i),i+=e.length}return n}const v=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function I(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");let e="";for(let n=0;n<t.length;n++)e+=v[t[n]];return e}const A=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000");function _(t){if("bigint"!=typeof t)throw new Error("Expected bigint");if(!(o<=t&&t<A))throw new Error("Expected number < 2^256");return t.toString(16).padStart(64,"0")}function S(t){const e=x(_(t));if(32!==e.length)throw new Error("Error: expected 32 bytes");return e}function E(t){const e=t.toString(16);return 1&e.length?`0${e}`:e}function T(t){if("string"!=typeof t)throw new TypeError("hexToNumber: expected string, got "+typeof t);return BigInt(`0x${t}`)}function x(t){if("string"!=typeof t)throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+t.length);const e=new Uint8Array(t.length/2);for(let n=0;n<e.length;n++){const r=2*n,i=t.slice(r,r+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");e[n]=o}return e}function P(t){return T(I(t))}function B(t){return t instanceof Uint8Array?Uint8Array.from(t):x(t)}function O(t){if("number"==typeof t&&Number.isSafeInteger(t)&&t>0)return BigInt(t);if("bigint"==typeof t&&W(t))return t;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function R(t,e=l.P){const n=t%e;return n>=o?n:e+n}function M(t,e){const{P:n}=l;let r=t;for(;e-- >o;)r*=r,r%=n;return r}function C(t,e=l.P){if(t===o||e<=o)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=R(t,e),r=e,i=o,a=s,c=s,u=o;for(;n!==o;){const t=r/n,e=r%n,o=i-c*t,s=a-u*t;r=n,n=e,i=c,a=u,c=o,u=s}if(r!==s)throw new Error("invert: does not exist");return R(i,e)}const U=(t,e)=>(t+e/a)/e,N={a1:BigInt("0x3086d221a7d46bcde86c90e49284eb15"),b1:-s*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),a2:BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),b2:BigInt("0x3086d221a7d46bcde86c90e49284eb15"),POW_2_128:BigInt("0x100000000000000000000000000000000")};function L(t){const{n:e}=l,{a1:n,b1:r,a2:i,b2:o,POW_2_128:s}=N,a=U(o*t,e),c=U(-r*t,e);let u=R(t-a*n-c*i,e),d=R(-a*r-c*o,e);const h=u>s,f=d>s;if(h&&(u=e-u),f&&(d=e-d),u>s||d>s)throw new Error("splitScalarEndo: Endomorphism failed, k="+t);return{k1neg:h,k1:u,k2neg:f,k2:d}}function z(t){const{n:e}=l,n=8*t.length-256;let r=P(t);return n>0&&(r>>=BigInt(n)),r>=e&&(r-=e),r}let K,D;class j{constructor(){this.v=new Uint8Array(32).fill(1),this.k=new Uint8Array(32).fill(0),this.counter=0}hmac(...t){return nt.hmacSha256(this.k,...t)}hmacSync(...t){return D(this.k,...t)}checkSync(){if("function"!=typeof D)throw new f("hmacSha256Sync needs to be set")}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(t=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),t),this.v=await this.hmac(this.v),0!==t.length&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),t),this.v=await this.hmac(this.v))}reseedSync(t=new Uint8Array){this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),t),this.v=this.hmacSync(this.v),0!==t.length&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),t),this.v=this.hmacSync(this.v))}async generate(){return this.incr(),this.v=await this.hmac(this.v),this.v}generateSync(){return this.checkSync(),this.incr(),this.v=this.hmacSync(this.v),this.v}}function W(t){return o<t&&t<l.n}function F(t){return o<t&&t<l.P}function G(t,e,n){const r=P(t);if(!W(r))return;const{n:i}=l,a=g.BASE.multiply(r),c=R(a.x,i);if(c===o)return;const u=R(C(r,i)*R(e+n*c,i),i);if(u===o)return;const d=new w(c,u);return{sig:d,recovery:(a.x===d.r?0:2)|Number(a.y&s)}}function H(t){let e;if("bigint"==typeof t)e=t;else if("number"==typeof t&&Number.isSafeInteger(t)&&t>0)e=BigInt(t);else if("string"==typeof t){if(64!==t.length)throw new Error("Expected 32 bytes of private key");e=T(t)}else{if(!(t instanceof Uint8Array))throw new TypeError("Expected valid private key");if(32!==t.length)throw new Error("Expected 32 bytes of private key");e=P(t)}if(!W(e))throw new Error("Expected private key: 0 < key < n");return e}function q(t){if(t instanceof w)return t.assertValidity(),t;try{return w.fromDER(t)}catch(e){return w.fromCompact(t)}}function $(t,e=!1){return g.fromPrivateKey(t).toRawBytes(e)}function Z(t){return P(t.length>32?t.slice(0,32):t)}function V(t){const e=Z(t),n=R(e,l.n);return X(n<o?e:n)}function X(t){return S(t)}function J(t,e,n){if(null==t)throw new Error(`sign: expected valid message hash, not "${t}"`);const r=B(t),i=H(e),o=[X(i),V(r)];if(null!=n){!0===n&&(n=nt.randomBytes(32));const t=B(n);if(32!==t.length)throw new Error("sign: Expected 32 bytes of extra data");o.push(t)}return{seed:k(...o),m:Z(r),d:i}}function Y(t,e){let{sig:n,recovery:r}=t;const{canonical:i,der:o,recovered:s}=Object.assign({canonical:!0,der:!0},e);i&&n.hasHighS()&&(n=n.normalizeS(),r^=1);const a=o?n.toDERRawBytes():n.toCompactRawBytes();return s?[a,r]:a}function Q(t,e,n={}){const{seed:r,m:i,d:o}=J(t,e,n.extraEntropy);let s;const a=new j;for(a.reseedSync(r);!(s=G(a.generateSync(),i,o));)a.reseedSync();return Y(s,n)}g.BASE._setWindowSize(8);const tt={node:r||(r=n.t(i,2)),web:"object"==typeof self&&"crypto"in self?self.crypto:void 0},et={},nt={bytesToHex:I,hexToBytes:x,concatBytes:k,mod:R,invert:C,isValidPrivateKey(t){try{return H(t),!0}catch(e){return!1}},_bigintTo32Bytes:S,_normalizePrivateKey:H,hashToPrivateKey:t=>{if((t=B(t)).length<40||t.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return S(R(P(t),l.n-s)+s)},randomBytes:(t=32)=>{if(tt.web)return tt.web.getRandomValues(new Uint8Array(t));if(tt.node){const{randomBytes:e}=tt.node;return Uint8Array.from(e(t))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>nt.hashToPrivateKey(nt.randomBytes(40)),sha256:async(...t)=>{if(tt.web){const e=await tt.web.subtle.digest("SHA-256",k(...t));return new Uint8Array(e)}if(tt.node){const{createHash:e}=tt.node,n=e("sha256");return t.forEach((t=>n.update(t))),Uint8Array.from(n.digest())}throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(t,...e)=>{if(tt.web){const n=await tt.web.subtle.importKey("raw",t,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),r=k(...e),i=await tt.web.subtle.sign("HMAC",n,r);return new Uint8Array(i)}if(tt.node){const{createHmac:n}=tt.node,r=n("sha256",t);return e.forEach((t=>r.update(t))),Uint8Array.from(r.digest())}throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(t,...e)=>{let n=et[t];if(void 0===n){const e=await nt.sha256(Uint8Array.from(t,(t=>t.charCodeAt(0))));n=k(e,e),et[t]=n}return nt.sha256(n,...e)},taggedHashSync:(t,...e)=>{if("function"!=typeof K)throw new f("sha256Sync is undefined, you need to set it");let n=et[t];if(void 0===n){const e=K(Uint8Array.from(t,(t=>t.charCodeAt(0))));n=k(e,e),et[t]=n}return K(n,...e)},precompute(t=8,e=g.BASE){const n=e===g.BASE?e:new g(e.x,e.y);return n._setWindowSize(t),n.multiply(c),n}};Object.defineProperties(nt,{sha256Sync:{configurable:!1,get:()=>K,set(t){K||(K=t)}},hmacSha256Sync:{configurable:!1,get:()=>D,set(t){D||(D=t)}}})},50974:(t,e,n)=>{"use strict";n.d(e,{AG:()=>v,G0:()=>x,IM:()=>_,IX:()=>g,O7:()=>m,Rx:()=>I,Ue:()=>d,Yj:()=>y,Z_:()=>S,_4:()=>P,bc:()=>E,dt:()=>T,eE:()=>b,hu:()=>l,i0:()=>w,jt:()=>A,oQ:()=>B});class r extends TypeError{constructor(t,e){let n;const{message:r,...i}=t,{path:o}=t;super(0===o.length?r:"At path: "+o.join(".")+" -- "+r),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>{var r;return null!=(r=n)?r:n=[t,...e()]}}}function i(t){return"object"==typeof t&&null!=t}function o(t){return"string"==typeof t?JSON.stringify(t):""+t}function s(t,e,n,r){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});const{path:i,branch:s}=e,{type:a}=n,{refinement:c,message:u="Expected a value of type `"+a+"`"+(c?" with refinement `"+c+"`":"")+", but received: `"+o(r)+"`"}=t;return{value:r,type:a,refinement:c,key:i[i.length-1],path:i,branch:s,...t,message:u}}function*a(t,e,n,r){var o;i(o=t)&&"function"==typeof o[Symbol.iterator]||(t=[t]);for(const i of t){const t=s(i,e,n,r);t&&(yield t)}}function*c(t,e,n={}){const{path:r=[],branch:o=[t],coerce:s=!1,mask:a=!1}=n,u={path:r,branch:o};if(s&&(t=e.coercer(t,u),a&&"type"!==e.type&&i(e.schema)&&i(t)&&!Array.isArray(t)))for(const i in t)void 0===e.schema[i]&&delete t[i];let l=!0;for(const i of e.validator(t,u))l=!1,yield[i,void 0];for(let[d,h,f]of e.entries(t,u)){const e=c(h,f,{path:void 0===d?r:[...r,d],branch:void 0===d?o:[...o,h],coerce:s,mask:a});for(const n of e)n[0]?(l=!1,yield[n[0],void 0]):s&&(h=n[1],void 0===d?t=h:t instanceof Map?t.set(d,h):t instanceof Set?t.add(h):i(t)&&(t[d]=h))}if(l)for(const i of e.refiner(t,u))l=!1,yield[i,void 0];l&&(yield[void 0,t])}class u{constructor(t){const{type:e,schema:n,validator:r,refiner:i,coercer:o=(t=>t),entries:s=function*(){}}=t;this.type=e,this.schema=n,this.entries=s,this.coercer=o,this.validator=r?(t,e)=>a(r(t,e),e,this,t):()=>[],this.refiner=i?(t,e)=>a(i(t,e),e,this,t):()=>[]}assert(t){return l(t,this)}create(t){return d(t,this)}is(t){return h(t,this)}mask(t){return function(t,e){const n=f(t,e,{coerce:!0,mask:!0});if(n[0])throw n[0];return n[1]}(t,this)}validate(t,e={}){return f(t,this,e)}}function l(t,e){const n=f(t,e);if(n[0])throw n[0]}function d(t,e){const n=f(t,e,{coerce:!0});if(n[0])throw n[0];return n[1]}function h(t,e){return!f(t,e)[0]}function f(t,e,n={}){const i=c(t,e,n),o=function(t){const{done:e,value:n}=t.next();return e?void 0:n}(i);if(o[0]){return[new r(o[0],(function*(){for(const t of i)t[0]&&(yield t[0])})),void 0]}return[void 0,o[1]]}function p(t,e){return new u({type:t,schema:null,validator:e})}function y(){return p("any",(()=>!0))}function g(t){return new u({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[n,r]of e.entries())yield[n,r,t]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||"Expected an array value, but received: "+o(t)})}function m(){return p("boolean",(t=>"boolean"==typeof t))}function b(t){return p("instance",(e=>e instanceof t||"Expected a `"+t.name+"` instance, but received: "+o(e)))}function w(t){const e=o(t),n=typeof t;return new u({type:"literal",schema:"string"===n||"number"===n||"boolean"===n?t:null,validator:n=>n===t||"Expected the literal `"+e+"`, but received: "+o(n)})}function k(){return p("never",(()=>!1))}function v(t){return new u({...t,validator:(e,n)=>null===e||t.validator(e,n),refiner:(e,n)=>null===e||t.refiner(e,n)})}function I(){return p("number",(t=>"number"==typeof t&&!isNaN(t)||"Expected a number, but received: "+o(t)))}function A(t){return new u({...t,validator:(e,n)=>void 0===e||t.validator(e,n),refiner:(e,n)=>void 0===e||t.refiner(e,n)})}function _(t,e){return new u({type:"record",schema:null,*entries(n){if(i(n))for(const r in n){const i=n[r];yield[r,r,t],yield[r,i,e]}},validator:t=>i(t)||"Expected an object, but received: "+o(t)})}function S(){return p("string",(t=>"string"==typeof t||"Expected a string, but received: "+o(t)))}function E(t){const e=k();return new u({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(t.length,n.length);for(let i=0;i<r;i++)yield[i,n[i],t[i]||e]}},validator:t=>Array.isArray(t)||"Expected an array, but received: "+o(t)})}function T(t){const e=Object.keys(t);return new u({type:"type",schema:t,*entries(n){if(i(n))for(const r of e)yield[r,n[r],t[r]]},validator:t=>i(t)||"Expected an object, but received: "+o(t)})}function x(t){const e=t.map((t=>t.type)).join(" | ");return new u({type:"union",schema:null,validator(n,r){const i=[];for(const e of t){const[...t]=c(n,e,r),[o]=t;if(!o[0])return[];for(const[e]of t)e&&i.push(e)}return["Expected the value to satisfy a union of `"+e+"`, but received: "+o(n),...i]}})}function P(){return p("unknown",(()=>!0))}function B(t,e,n){return new u({...t,coercer:(r,i)=>h(r,e)?t.coercer(n(r,i),i):t.coercer(r,i)})}},92338:(t,e,n)=>{"use strict";function r(t,e,n){return e<=t&&t<=n}function i(t){if(void 0===t)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}n.r(e),n.d(e,{TextDecoder:()=>u,TextEncoder:()=>l});function o(t){this.tokens=[].slice.call(t)}o.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(t)},push:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.push(e.shift());else this.tokens.push(t)}};var s=-1;function a(t,e){if(t)throw TypeError("Decoder error");return e||65533}var c="utf-8";function u(t,e){if(!(this instanceof u))return new u(t,e);if((t=void 0!==t?String(t).toLowerCase():c)!==c)throw new Error("Encoding not supported. Only utf-8 is supported");e=i(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(e.fatal),this._ignoreBOM=Boolean(e.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function l(t,e){if(!(this instanceof l))return new l(t,e);if((t=void 0!==t?String(t).toLowerCase():c)!==c)throw new Error("Encoding not supported. Only utf-8 is supported");e=i(e),this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(e.fatal)},Object.defineProperty(this,"encoding",{value:"utf-8"})}function d(t){var e=t.fatal,n=0,i=0,o=0,c=128,u=191;this.handler=function(t,l){if(-1===l&&0!==o)return o=0,a(e);if(-1===l)return s;if(0===o){if(r(l,0,127))return l;if(r(l,194,223))o=1,n=l-192;else if(r(l,224,239))224===l&&(c=160),237===l&&(u=159),o=2,n=l-224;else{if(!r(l,240,244))return a(e);240===l&&(c=144),244===l&&(u=143),o=3,n=l-240}return n<<=6*o,null}if(!r(l,c,u))return n=o=i=0,c=128,u=191,t.prepend(l),a(e);if(c=128,u=191,n+=l-128<<6*(o-(i+=1)),i!==o)return null;var d=n;return n=o=i=0,d}}function h(t){t.fatal;this.handler=function(t,e){if(-1===e)return s;if(r(e,0,127))return e;var n,i;r(e,128,2047)?(n=1,i=192):r(e,2048,65535)?(n=2,i=224):r(e,65536,1114111)&&(n=3,i=240);for(var o=[(e>>6*n)+i];n>0;){var a=e>>6*(n-1);o.push(128|63&a),n-=1}return o}}u.prototype={decode:function(t,e){var n;n="object"==typeof t&&t instanceof ArrayBuffer?new Uint8Array(t):"object"==typeof t&&"buffer"in t&&t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e=i(e),this._streaming||(this._decoder=new d({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(e.stream);for(var r,a=new o(n),c=[];!a.endOfStream()&&(r=this._decoder.handler(a,a.read()))!==s;)null!==r&&(Array.isArray(r)?c.push.apply(c,r):c.push(r));if(!this._streaming){do{if((r=this._decoder.handler(a,a.read()))===s)break;null!==r&&(Array.isArray(r)?c.push.apply(c,r):c.push(r))}while(!a.endOfStream());this._decoder=null}return c.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===c[0]?(this._BOMseen=!0,c.shift()):this._BOMseen=!0)),function(t){for(var e="",n=0;n<t.length;++n){var r=t[n];r<=65535?e+=String.fromCharCode(r):(r-=65536,e+=String.fromCharCode(55296+(r>>10),56320+(1023&r)))}return e}(c)}},l.prototype={encode:function(t,e){t=t?String(t):"",e=i(e),this._streaming||(this._encoder=new h(this._options)),this._streaming=Boolean(e.stream);for(var n,r=[],a=new o(function(t){for(var e=String(t),n=e.length,r=0,i=[];r<n;){var o=e.charCodeAt(r);if(o<55296||o>57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(r===n-1)i.push(65533);else{var s=t.charCodeAt(r+1);if(56320<=s&&s<=57343){var a=1023&o,c=1023&s;i.push(65536+(a<<10)+c),r+=1}else i.push(65533)}r+=1}return i}(t));!a.endOfStream()&&(n=this._encoder.handler(a,a.read()))!==s;)Array.isArray(n)?r.push.apply(r,n):r.push(n);if(!this._streaming){for(;(n=this._encoder.handler(a,a.read()))!==s;)Array.isArray(n)?r.push.apply(r,n):r.push(n);this._encoder=null}return new Uint8Array(r)}}}},t=>{var e;e=76333,t(t.s=e)}]);/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
/*! micro-ed25519-hdkey - MIT License (c) 2022 Paul Miller (paulmillr.com) */
/*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) */
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
/*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */
/**
* Support for translating between Uint8Array instances and JavaScript
* native types.
*
* {@link module:Layout~Layout|Layout} is the basis of a class
* hierarchy that associates property names with sequences of encoded
* bytes.
*
* Layouts are supported for these scalar (numeric) types:
* * {@link module:Layout~UInt|Unsigned integers in little-endian
* format} with {@link module:Layout.u8|8-bit}, {@link
* module:Layout.u16|16-bit}, {@link module:Layout.u24|24-bit},
* {@link module:Layout.u32|32-bit}, {@link
* module:Layout.u40|40-bit}, and {@link module:Layout.u48|48-bit}
* representation ranges;
* * {@link module:Layout~UIntBE|Unsigned integers in big-endian
* format} with {@link module:Layout.u16be|16-bit}, {@link
* module:Layout.u24be|24-bit}, {@link module:Layout.u32be|32-bit},
* {@link module:Layout.u40be|40-bit}, and {@link
* module:Layout.u48be|48-bit} representation ranges;
* * {@link module:Layout~Int|Signed integers in little-endian
* format} with {@link module:Layout.s8|8-bit}, {@link
* module:Layout.s16|16-bit}, {@link module:Layout.s24|24-bit},
* {@link module:Layout.s32|32-bit}, {@link
* module:Layout.s40|40-bit}, and {@link module:Layout.s48|48-bit}
* representation ranges;
* * {@link module:Layout~IntBE|Signed integers in big-endian format}
* with {@link module:Layout.s16be|16-bit}, {@link
* module:Layout.s24be|24-bit}, {@link module:Layout.s32be|32-bit},
* {@link module:Layout.s40be|40-bit}, and {@link
* module:Layout.s48be|48-bit} representation ranges;
* * 64-bit integral values that decode to an exact (if magnitude is
* less than 2^53) or nearby integral Number in {@link
* module:Layout.nu64|unsigned little-endian}, {@link
* module:Layout.nu64be|unsigned big-endian}, {@link
* module:Layout.ns64|signed little-endian}, and {@link
* module:Layout.ns64be|unsigned big-endian} encodings;
* * 32-bit floating point values with {@link
* module:Layout.f32|little-endian} and {@link
* module:Layout.f32be|big-endian} representations;
* * 64-bit floating point values with {@link
* module:Layout.f64|little-endian} and {@link
* module:Layout.f64be|big-endian} representations;
* * {@link module:Layout.const|Constants} that take no space in the
* encoded expression.
*
* and for these aggregate types:
* * {@link module:Layout.seq|Sequence}s of instances of a {@link
* module:Layout~Layout|Layout}, with JavaScript representation as
* an Array and constant or data-dependent {@link
* module:Layout~Sequence#count|length};
* * {@link module:Layout.struct|Structure}s that aggregate a
* heterogeneous sequence of {@link module:Layout~Layout|Layout}
* instances, with JavaScript representation as an Object;
* * {@link module:Layout.union|Union}s that support multiple {@link
* module:Layout~VariantLayout|variant layouts} over a fixed
* (padded) or variable (not padded) span of bytes, using an
* unsigned integer at the start of the data or a separate {@link
* module:Layout.unionLayoutDiscriminator|layout element} to
* determine which layout to use when interpreting the buffer
* contents;
* * {@link module:Layout.bits|BitStructure}s that contain a sequence
* of individual {@link
* module:Layout~BitStructure#addField|BitField}s packed into an 8,
* 16, 24, or 32-bit unsigned integer starting at the least- or
* most-significant bit;
* * {@link module:Layout.cstr|C strings} of varying length;
* * {@link module:Layout.blob|Blobs} of fixed- or variable-{@link
* module:Layout~Blob#length|length} raw data.
*
* All {@link module:Layout~Layout|Layout} instances are immutable
* after construction, to prevent internal state from becoming
* inconsistent.
*
* @local Layout
* @local ExternalLayout
* @local GreedyCount
* @local OffsetLayout
* @local UInt
* @local UIntBE
* @local Int
* @local IntBE
* @local NearUInt64
* @local NearUInt64BE
* @local NearInt64
* @local NearInt64BE
* @local Float
* @local FloatBE
* @local Double
* @local DoubleBE
* @local Sequence
* @local Structure
* @local UnionDiscriminator
* @local UnionLayoutDiscriminator
* @local Union
* @local VariantLayout
* @local BitStructure
* @local BitField
* @local Boolean
* @local Blob
* @local CString
* @local Constant
* @local bindConstructorLayout
* @module Layout
* @license MIT
* @author Peter A. Bigot
* @see {@link https://github.com/pabigot/buffer-layout|buffer-layout on GitHub}
*/